-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell_minimal.html
109 lines (97 loc) · 4.03 KB
/
shell_minimal.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
<title>Dear ImGui Emscripten example</title>
<style>
body { margin: 0; background-color: black }
.emscripten {
position: absolute;
top: 0px;
left: 0px;
margin: 0px;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
display: block;
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
image-rendering: crisp-edges;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
}
</style>
</head>
<body>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
<!-- <input type="text" id="my_textbox" style="position:absolute; top:20px;left:20px;"value="...">-->
<!-- <textarea id="my_textbox1" style="position:absolute; background:transparent; top:0px;left:20px;resize: none;" rows="5" cols="10" >-->
<!-- </textarea>-->
<!-- <textarea id="my_textbox1" style="position:absolute; top:300px; left:300px; height:20px; width:20px; resize: none; overflow:hidden; background-image: url(1.png);border-style:none;" rows="1" cols="1" >-->
<!-- </textarea>-->
<!-- <textarea id="my_textbox2" style="position:absolute; top:0px;left:0px;height:10px; width:10px;resize: none; display:none" rows="5" cols="10" >-->
<!-- </textarea>-->
<textarea id="my_textbox1" style="position:absolute; top:0px; left:0px; height:40px; width:40px; " rows="1" cols="1" >
</textarea>
<textarea id="my_textbox2" style="position:absolute; top:0px;left:42px;height:40px; width:40px;resize: none;" rows="5" cols="10" >
</textarea>
<script type='text/javascript'>
var Module = {
preRun: [],
postRun: [],
print: (function() {
return function(text) {
text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
};
})(),
printErr: function(text) {
text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function() {
var canvas = document.getElementById('canvas');
//canvas.addEventListener("webglcontextlost", function(e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false);
return canvas;
})(),
my_textbox1: (function () {
var my_textbox1 = document.getElementById('my_textbox1');
var my_textbox2 = document.getElementById('my_textbox2');
my_textbox1.addEventListener("compositionend", function (e) {
e.target.composing = false;
document.getElementById('my_textbox2').value = e.target.value;
e.target.value = '';
}, false);
my_textbox1.addEventListener("compositionstart", function (e) {
e.target.composing = true;
}, false);
my_textbox1.composing = false;
my_textbox1.addEventListener("textInput", function (e) {
if (e.target.composing == false) {
setTimeout(function () {
document.getElementById('my_textbox2').value = e.target.value;
e.target.value = '';
}, 0);
}
}, false);
return my_textbox1;
})(),
setStatus: function(text) {
console.log("status: " + text);
},
monitorRunDependencies: function(left) {
// no run dependencies to log
}
};
window.onerror = function() {
console.log("onerror: " + event);
};
</script>
{{{ SCRIPT }}}
</body>
</html>