re-enabled storing selection from "last played level set" menu
[rocksndiamonds.git] / build-projects / emscripten / index.html
1 <!doctype html>
2 <html lang="en-us">
3 <head>
4 <meta charset="utf-8"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title>Loading Rocks'n'Diamonds</title>
6 </head>
7 <body style="background:black;text-align:center;vertical-align:middle;">
8 <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
9 <script type='text/javascript'>
10       var Module = {
11         arguments: [],
12         preRun: [
13           function() {}
14         ],
15         postRun: [],
16         print: (function() {
17           var element = document.getElementById('output');
18           if (element) element.value = ''; // clear browser cache
19           return function(text) {
20             if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
21             console.log(text);
22           };
23         })(),
24         printErr: function(text) {
25           if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
26           if(text.startsWith("[FATAL]")) console.error(text);
27           else console.warn(text);
28         },
29         setStatus: function(text) {/*if(text == '') { document.title = "Rocks'n'Diamonds (stopped)"; } */},
30         quit: (function()
31         {
32           document.title = "Rocks'n'Diamonds (exited)";
33         }),
34         canvas: (function() {
35           var canvas = document.getElementById('canvas');
36
37           // As a default initial behavior, pop up an alert when webgl context is lost. To make your
38           // application robust, you may want to override this behavior before shipping!
39           // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
40           canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
41
42           return canvas;
43         })(),
44         totalDependencies: 0,
45         monitorRunDependencies: function(left) {
46           this.totalDependencies = Math.max(this.totalDependencies, left);
47         }
48       };
49       window.onerror = function(event) {
50         alert("An error occurred, see console.");
51         document.title = "Rocks'n'Diamonds (aborted)";
52       };
53     </script>
54 <script async type="text/javascript" src="rocksndiamonds.js"></script>
55 </body>
56 </html>