aboutsummaryrefslogtreecommitdiff
path: root/src/shell.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/shell.html')
-rw-r--r--src/shell.html30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/shell.html b/src/shell.html
index 79b7e9b9..436ba37e 100644
--- a/src/shell.html
+++ b/src/shell.html
@@ -4,34 +4,36 @@
<body>
<center>
<canvas id='canvas' width='256' height='256'></canvas>
+ <hr>
+ <textarea id="output" style="font-family: monospace; width: 80%" rows="8"></textarea>
+ <hr>
+ <div id='status'>Downloading...</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 = [];
+ element.value = ''; // clear browser cache
return function(text) {
- text = text.replace(/&/g, "&amp;");
- text = text.replace(/</g, "&lt;");
- text = text.replace(/>/g, "&gt;");
- text = text.replace('\n', '<br>', 'g');
- if (printBuffer.length > 10) printBuffer.shift();
- printBuffer.push(text);
- element.innerHTML = printBuffer.join('<br>');
+ // These replacements are necessary if you render to raw HTML
+ //text = text.replace(/&/g, "&amp;");
+ //text = text.replace(/</g, "&lt;");
+ //text = text.replace(/>/g, "&gt;");
+ //text = text.replace('\n', '<br>', 'g');
+ element.value += text + "\n";
+ element.scrollTop = 99999; // focus on bottom
};
})(),
canvas: document.getElementById('canvas'),
+ setStatus: function(text) {
+ document.getElementById('status').innerHTML = text;
+ },
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
- document.getElementById('status').innerHTML = left ? 'Downloading files: ' + (this.totalDependencies-left) + '/' + this.totalDependencies :
- 'All downloads complete.';
+ Module.setStatus(left ? 'Downloading: ' + (this.totalDependencies-left) + '/' + this.totalDependencies : 'All downloads complete.');
}
};