-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
94 lines (77 loc) · 3.02 KB
/
index.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
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Brython</title>
<link rel="stylesheet" href="./brython/assets/brython.css">
<link rel="stylesheet" href="./brython/assets/console.css">
<script type="text/javascript" src="./brython/assets/brython.js"></script>
<script type="text/javascript" src="./brython/assets/brython_stdlib.js"></script>
<script type="text/javascript" src="./brython/assets/builtins_docstrings.js"></script>
<script type="text/javascript" src="./brython/editor/ace/ace.js" charset="utf-8"></script>
<script type="text/javascript" src="./brython/editor/ace/ext-language_tools.js" charset="utf-8"></script>
<script>
/* 引入全局主题配置文件 */
let themeDefaultStyle = window.parent.document.getElementById('themeDefaultStyle');
let themeStyle = window.parent.document.getElementById('themeStyle');
let head = document.getElementsByTagName('HEAD').item(0);
if (themeDefaultStyle != null) {
head.appendChild(themeDefaultStyle.cloneNode(true));
}
if (themeStyle != null) {
head.appendChild(themeStyle.cloneNode(true));
}
function run_js() {
var cons = document.getElementById("console")
var jscode = cons.value
var t0 = (new Date()).getTime()
eval(jscode)
var t1 = (new Date()).getTime()
console.log("Javascript code run in " + (t1 - t0) + " ms")
}
</script>
</head>
<body onload="brython()">
<div id="toolsbar">
<div id="tools">
<span id="menu"></span>
<!-- <span class="logo"><a href="/index.html">brython</a></span> -->
<!-- <label id="open_file">打开文件</label> -->
<input type="file" id="file">
<a id="save_file" href="#" download="brython.py">保存文件</a>
<label id="debug"> 调试</label>
<input type="checkbox" id="set_debug">
<label id="output"> 输出面板</label>
<input type="checkbox" id="set_output">
<span id="version_label"> Brython 版本: </span>
<span id="version"></span>
</div>
</div>
<table id="container">
<tbody>
<tr>
<td id="left">
<div id="editor"></div>
</td>
<td id="separator"></td>
<td id="right">
<textarea id="console" autocomplete="off" spellcheck="false"></textarea>
</td>
</tr>
<tr>
<td>
Python code editor uses <a href="https://ace.c9.io/" target="_blank">Ace↗</a>.
<a style="float: right; margin-left: 8px;" target="_blank" id="test" href="https://brython.info/tests/index.html">测试↗</a>
<a style="float: right; margin-left: 8px;" target="_blank" id="demo" href="https://brython.info/demo.html">示例↗</a>
<a style="float: right; margin-left: 8px;" target="_blank" id="document" href="https://brython.info/static_doc/en/intro.html">文档↗</a>
</td>
<td></td>
<td>
</td>
</tr>
</tbody>
</table>
<script type="text/python3" src="./main.py" id="tests_editor"></script>
</body>
</html>