-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtester.html
68 lines (62 loc) · 1.83 KB
/
tester.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
<html>
<head>
<link type="text/css" rel="stylesheet" href="http://cdn.jsdelivr.net/codemirror/3.14.0/codemirror.css" />
<link type="text/css" rel="stylesheet" href="http://cdn.jsdelivr.net/codemirror/3.14.0/theme/solarized.css" />
<style>
.CodeMirror {
border: 1px solid #eee;
height: auto;
font-size: 12pt;
}
.CodeMirror-scroll {
overflow-y: hidden;
overflow-x: auto;
}
textarea {
width: 100%;
font-family: monospace;
font-size: 120%;
}
button {
position: relative;
margin-top: -2em;
float: right;
width: 10em;
height: 2em;
font-size: 150%;
z-index: 100;
opacity: 0.5;
}
button:hover {
opacity: 1;
}
</style>
<script type="text/javascript" src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/codemirror/3.14.0/codemirror.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/codemirror/3.14.0/mode/javascript/javascript.js"></script>
<script src="src/Boo.js"></script>
<script src="src/Boo.debug.js"></script>
<script src="src/Boo.Async.js"></script>
<script src="src/BooJs.Tests/resources/BooJs.Tests.Support.js"></script>
<script>
$(function () {
var editor_js = CodeMirror.fromTextArea(document.getElementById('code'), {
mode: "javascript",
theme: "solarized",
indentUnit: 2,
tabSize: 2,
lineNumbers: true,
autofocus: true
});
$('#run').click(function () {
var code = editor_js.getValue();
eval(code);
});
});
</script>
</head>
<body>
<textarea id="code"></textarea>
<button id="run">Run</button>
</body>
</html>