Move code for the debug trace window to an external script

Chrome doesn't allow inline scripts, only external ones
pull/339/head
Alberto García Hierro 7 years ago
parent b98d7a8f3b
commit 08a54197c0

@ -125,6 +125,10 @@ sources.receiverJs = [
'./tabs/receiver_msp.js' './tabs/receiver_msp.js'
]; ];
sources.debugTraceJs = [
'./js/debug_trace.js'
];
sources.hexParserJs = [ sources.hexParserJs = [
'./js/workers/hex_parser.js', './js/workers/hex_parser.js',
]; ];
@ -136,6 +140,7 @@ var output = {
mapJs: 'map.js', mapJs: 'map.js',
receiverCss: 'receiver-msp.css', receiverCss: 'receiver-msp.css',
receiverJs: 'receiver-msp.js', receiverJs: 'receiver-msp.js',
debugTraceJs: 'debug-trace.js',
hexParserJs: 'hex_parser.js', hexParserJs: 'hex_parser.js',
}; };

@ -0,0 +1,9 @@
function debugTraceOnLoad()
{
var output = document.getElementById('debug-trace');
setInterval(function() {
output.innerText = getDebugTrace();
}, 100);
}
window.onload = debugTraceOnLoad;

@ -172,9 +172,8 @@
float: right; float: right;
margin-right: 1em; margin-right: 1em;
font-size: 90%; font-size: 90%;
text-decoration: underline;
} }
.tab-sensors a.debug-trace::hover { .tab-sensors a.debug-trace:hover {
text-decoration: underline; text-decoration: underline;
} }

@ -1,14 +1,7 @@
<html> <html>
<head> <head>
<title>Debug Trace</title> <title>Debug Trace</title>
<script type="text/javascript"> <script type="text/javascript" src="/build/debug-trace.js"></script>
window.onload = function() {
var output = document.getElementById('debug-trace');
setInterval(function() {
output.innerText = getDebugTrace();
}, 100);
}
</script>
</head> </head>
<body> <body>
<pre><code id="debug-trace"></code></pre> <pre><code id="debug-trace"></code></pre>

Loading…
Cancel
Save