| 1 |
<!doctype html> |
| 2 |
<html lang="en-us"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=0"/> |
| 11 |
|
| 12 |
<title>@APPNAME@</title> |
| 13 |
<style> |
| 14 |
/* Make the html body cover the entire (visual) viewport with no scroll bars. */ |
| 15 |
html, body { padding: 0; margin: 0; overflow:hidden; height: 100vh } |
| 16 |
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */ |
| 17 |
canvas { border: 0px none; background-color: white; height:100%; width:100%; } |
| 18 |
/* The contenteditable property is set to true for the canvas in order to support |
| 19 |
clipboard events. Hide the resulting focus frame and set the cursor back to |
| 20 |
the default cursor. */ |
| 21 |
canvas { outline: 0px solid transparent; caret-color: transparent; cursor:default } |
| 22 |
</style> |
| 23 |
</head> |
| 24 |
<body onload="init()"> |
| 25 |
<figure style="overflow:visible;" id="qtspinner"> |
| 26 |
<center style="margin-top:1.5em; line-height:150%"> |
| 27 |
<img src="qtlogo.svg" width="320" height="200" style="display:block"></img> |
| 28 |
<strong>Qt for WebAssembly: @APPNAME@</strong> |
| 29 |
<div id="qtstatus"></div> |
| 30 |
<noscript>JavaScript is disabled. Please enable JavaScript to use this application.</noscript> |
| 31 |
</center> |
| 32 |
</figure> |
| 33 |
<canvas id="qtcanvas" oncontextmenu="event.preventDefault()" contenteditable="true"></canvas> |
| 34 |
|
| 35 |
<script type='text/javascript'> |
| 36 |
function init() { |
| 37 |
var spinner = document.querySelector('#qtspinner'); |
| 38 |
var canvas = document.querySelector('#qtcanvas'); |
| 39 |
var status = document.querySelector('#qtstatus') |
| 40 |
|
| 41 |
var qtLoader = QtLoader({ |
| 42 |
canvasElements : [canvas], |
| 43 |
showLoader: function(loaderStatus) { |
| 44 |
spinner.style.display = 'block'; |
| 45 |
canvas.style.display = 'none'; |
| 46 |
status.innerHTML = loaderStatus + "..."; |
| 47 |
}, |
| 48 |
showError: function(errorText) { |
| 49 |
status.innerHTML = errorText; |
| 50 |
spinner.style.display = 'block'; |
| 51 |
canvas.style.display = 'none'; |
| 52 |
}, |
| 53 |
showExit: function() { |
| 54 |
status.innerHTML = "Application exit"; |
| 55 |
if (qtLoader.exitCode !== undefined) |
| 56 |
status.innerHTML += " with code " + qtLoader.exitCode; |
| 57 |
if (qtLoader.exitText !== undefined) |
| 58 |
status.innerHTML += " (" + qtLoader.exitText + ")"; |
| 59 |
spinner.style.display = 'block'; |
| 60 |
canvas.style.display = 'none'; |
| 61 |
}, |
| 62 |
showCanvas: function() { |
| 63 |
spinner.style.display = 'none'; |
| 64 |
canvas.style.display = 'block'; |
| 65 |
}, |
| 66 |
}); |
| 67 |
qtLoader.loadEmscriptenModule("@APPNAME@"); |
| 68 |
} |
| 69 |
</script> |
| 70 |
<script type="text/javascript" src="qtloader.js"></script> |
| 71 |
</body> |
| 72 |
</html> |