diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-12 19:00:45 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-12 19:00:45 -0700 |
commit | 15d0f8bf3db70eaf915f1af0b205d751c9edceaa (patch) | |
tree | 0e225555dfb10fe065b730ba6e5e43b364aa9aae /src/shell.html | |
parent | b9f86b8fa3edc99805b5ace739df9c44ba8dc352 (diff) |
nicer html messages during load/startup
Diffstat (limited to 'src/shell.html')
-rw-r--r-- | src/shell.html | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/shell.html b/src/shell.html index bf81c971..035cd5ef 100644 --- a/src/shell.html +++ b/src/shell.html @@ -12,14 +12,14 @@ </style> </head> <body> + <hr/> + <div class="emscripten" id="status">Downloading...</div> <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> - <ht/> + <hr/> <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div> <hr/> <textarea class="emscripten" id="output" rows="8"></textarea> <hr> - <div class="emscripten" id="status">Downloading...</div> - <hr> <script type='text/javascript'> // connect to canvas var Module = { @@ -38,14 +38,30 @@ })(), canvas: document.getElementById('canvas'), setStatus: function(text) { - document.getElementById('status').innerHTML = text; + if (Module.setStatus.interval) clearInterval(Module.setStatus.interval); + document.getElementById('status').innerHTML = ''; + if (text) { + var counter = 0; + Module.setStatus.interval = setInterval(function() { + counter++; + counter %= 3; + var dots = ' '; + for (var i = 0; i < counter; i++) dots += '.'; + dots += '*'; + for (var i = counter; i < 2; i++) dots += '.'; + document.getElementById('status').innerHTML = text.replace('...', dots); + }, 300); + } }, totalDependencies: 0, monitorRunDependencies: function(left) { this.totalDependencies = Math.max(this.totalDependencies, left); - Module.setStatus(left ? 'Downloading: ' + (this.totalDependencies-left) + '/' + this.totalDependencies : 'All downloads complete.'); + Module.setStatus(left ? 'Downloading: ' + (this.totalDependencies-left) + '/' + this.totalDependencies + '...' : 'All downloads complete.'); } }; + Module.setStatus('Downloading...'); + </script> + <script type='text/javascript'> {{{ SCRIPT_CODE }}} |