-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (34 loc) · 879 Bytes
/
index.html
File metadata and controls
37 lines (34 loc) · 879 Bytes
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>jsPython Interpreter</title>
<script src="interpreter.js"></script>
</head>
<body>
<div id="editordiv">
<button onclick="Interpreter.Run()">Run code</button>
<button>Foo</button>
<button>Bar</button>
<textarea id="editor">
a = 1
b = 2 + a
c = 2 - (b + a)
d = (1+1j)/5j</textarea>
</div>
<div id="consolediv">
<textarea disabled="true" id="console"></textarea>
</div>
<script>
document.getElementById("editor").onkeydown = function(e) {
if (e.keyCode == 9 || e.which == 9) {
e.preventDefault();
var s = this.selectionStart;
this.value = this.value.substring(0,this.selectionStart) + " " + this.value.substring(this.selectionEnd);
this.selectionEnd = s+4;
}
}
Interpreter.Init();
</script>
</body>
</html>