5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
7 <title>FreeSpace</title>
13 background-color: #222;
18 background-color: #000;
20 max-width: 133.333333vh;
31 <canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
32 <script type='text/javascript'>
37 return function(text) {
38 if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
39 // These replacements are necessary if you render to raw HTML
40 //text = text.replace(/&/g, "&");
41 //text = text.replace(/</g, "<");
42 //text = text.replace(/>/g, ">");
43 //text = text.replace('\n', '<br>', 'g');
47 printErr: function(text) {
48 if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
49 if (0) { // XXX disabled for safety typeof dump == 'function') {
50 dump(text + '\n'); // fast, straight to the real console
56 var canvas = document.getElementById('canvas');
58 // As a default initial behavior, pop up an alert when webgl context is lost. To make your
59 // application robust, you may want to override this behavior before shipping!
60 // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
61 canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
65 setStatus: function(text) {
68 monitorRunDependencies: function(left) {
69 this.totalDependencies = Math.max(this.totalDependencies, left);
70 Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
73 Module.setStatus('Downloading...');
74 window.onerror = function() {
75 Module.setStatus('Exception thrown, see JavaScript console');
76 Module.setStatus = function(text) {
77 if (text) Module.printErr('[post-exception status] ' + text);