-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgui.html
42 lines (33 loc) · 818 Bytes
/
gui.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
<html>
<head>
<title> cpp.js tryout </title>
<script language="javascript" src="cpp.js"></script>
<script language="javascript">
function update() {
document.getElementById("dest").value = "";
var warnings = '';
var settings = {
error_func : function(err) {
document.getElementById("dest").value = err;
},
warn_func : function(warn) {
warnings += '//' + warn + '\n';
}
};
var cpp = cpp_js(settings);
var res = cpp.run(document.getElementById("src").value);
document.getElementById("dest").value = '// cpp.js warnings: \n' + warnings + '\n\n' + res;
}
</script>
</head>
<body>
<h1>cpp.js tryout</h1>
<div>
<button onclick="update()"> Run </button>
</div>
<div>
<textarea id="src" cols="60" rows="60"> </textarea>
<textarea id="dest" cols="60" rows="60"> </textarea>
</div>
</body>
</html>