-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathZillaLibEmscripten.html
60 lines (60 loc) · 3.37 KB
/
ZillaLibEmscripten.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{{ZILLAAPP}}</title>
<style type="text/css">:fullscreen{background:#000;margin:0!important}:full-screen{background:#000;margin:0!important}:-webkit-full-screen{background:#000;margin:0!important}:-moz-full-screen{background:#000;margin:0!important}</style>
</head>
<body style="background:#CCCCCC">
<h1 style="text-align:center">{{ZILLAAPP}}</h1>
<h2 id="zl_status" style="text-align:center">Status: Loading...</h2>
<canvas id="zl_canvas" style="display:block;margin:0 auto 10px" oncontextmenu="event.preventDefault()" width="0" height="0"></canvas>
<div id="zl_popup" style="text-align:center;position:absolute;top:300px;left:0;width:99%;z-index:9;display:none"><div id="zl_popupmsg" style="width:500px;margin:0 auto;padding:20px 10px;background:#444;color:#DDD;border:1px solid white">Please open the following link in a new window to continue<br><br><a id="zl_popup_a" target="_blank" style="color:#88D"></a><br><br><input type="button" value="CLOSE THIS" onclick="document.getElementById('zl_popup').style.display = 'none'"></div></div>
<div id="zl_control" style="text-align:center;display:none"><input type="button" value="fullscreen" onclick="try{_ZLJS_SetFullscreen(true)}catch(e){}"></div>
<hr style="border:0;border-bottom:1px dashed gray;margin:10px 0">
<div id="zl_log"></div>
<script type='text/javascript'>
var Module =
{
canvas: document.getElementById('zl_canvas'),
//requestWidth: 960,
//requestHeight: 540,
zl_log: document.getElementById('zl_log'),
openUrl: function(url)
{
var a = document.getElementById('zl_popup_a');
a.href = a.innerHTML = url;
document.getElementById('zl_popup').style.display = '';
},
print: function(text)
{
Module.zl_log.innerHTML = text + '<br>' + Module.zl_log.innerHTML;
},
postRun: function()
{
var L = function(id)
{
if (id == 'NO_WEBGL') return 'Your browser or graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br>Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.';
if (id == 'IEWEBGL') return '<br><br>On Internet Explorer older than version 11 you can try the <a href="https://github.com/iewebgl/iewebgl" style="color:#000">IEWebGL</a> plugin.';
};
var zl_status = document.getElementById('zl_status'), zl_control = document.getElementById('zl_control');
if (parseInt(navigator.userAgent.split('MSIE').slice(-1)[0]) < 11)
{
Module.canvas.outerHTML = '<object id="zl_iecanvas" type="application/x-webgl" style="' + Module.canvas.style.cssText + ' " oncontextmenu="event.preventDefault()" width="0" height="0"></object>';
Module.canvas = document.getElementById('zl_iecanvas');
}
if (!Module.noExitRuntime)
{
zl_control.innerHTML = '<div style="text-align:center;background-color:#FFF;color:#000;padding:1.5em;width:540px;margin:2em auto">' + L('NO_WEBGL') + (parseInt(navigator.userAgent.split('MSIE').slice(-1)[0]) < 11 ? L('IEWEBGL') : '') + '</div>';
Module.canvas.style.display = 'none';
}
zl_status.innerHTML = '';
zl_control.style.display = '';
},
};
window.onerror = function(e,u,l){Module.print(e);};
</script>
{{ZILLAAPPSCRIPT}}
</body>
</html>