diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-25 09:49:02 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-25 09:49:25 -0700 |
commit | f86c81b9cd775a62dac77dfe70371de3daf3ede1 (patch) | |
tree | 4fec2d87a22412dd3c72473a6a7a910ce512e135 /src/shell.html | |
parent | 0540b2cd86b79a5dc5b46328471654d00c36878d (diff) |
make html print output more debug friendly
Diffstat (limited to 'src/shell.html')
-rw-r--r-- | src/shell.html | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/shell.html b/src/shell.html index 79b7e9b9..31ac8c9c 100644 --- a/src/shell.html +++ b/src/shell.html @@ -4,26 +4,23 @@ <body> <center> <canvas id='canvas' width='256' height='256'></canvas> + <hr> + <textarea id="output" style="font-family: monospace; width: 80%" rows="8" readonly></textarea> + <hr> + <div id='status'></div> </center> <hr> - <div id='output'></div> - <hr> - <center><div id='status'></div></center> - <hr> <script type='text/javascript'> // connect to canvas var Module = { print: (function() { var element = document.getElementById('output'); - var printBuffer = []; return function(text) { text = text.replace(/&/g, "&"); text = text.replace(/</g, "<"); text = text.replace(/>/g, ">"); text = text.replace('\n', '<br>', 'g'); - if (printBuffer.length > 10) printBuffer.shift(); - printBuffer.push(text); - element.innerHTML = printBuffer.join('<br>'); + element.value += text + "\n"; }; })(), canvas: document.getElementById('canvas'), |