-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.html
More file actions
146 lines (138 loc) · 4.08 KB
/
env.html
File metadata and controls
146 lines (138 loc) · 4.08 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html lang="en">
<head>
<title>随风的图形与数学编程小窝</title>
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" /><!-- 删除苹果默认的工具栏和菜单栏 -->
<meta name="apple-mobile-web-app-status-bar-style" content="black" /><!-- 设置苹果工具栏颜色 -->
<meta name="format-detection" content="telephone=no, email=no" />
<!--忽略页面中的数字识别为电话,忽略email识别 -->
<!-- 启用360浏览器的极速模式(webkit) -->
<meta name="renderer" content="webkit">
<!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 -->
<meta name="HandheldFriendly" content="true">
<!-- 微软的老式浏览器 -->
<meta name="MobileOptimized" content="320">
<!-- uc强制竖屏 -->
<meta name="screen-orientation" content="landscape">
<!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="landscape">
<!-- UC强制全屏 -->
<meta name="full-screen" content="yes">
<!-- QQ强制全屏 -->
<meta name="x5-fullscreen" content="true">
<!-- UC应用模式 -->
<meta name="browsermode" content="application">
<!-- QQ应用模式 -->
<meta name="x5-page-mode" content="app">
<!-- windows phone 点击无高光 -->
<meta name="msapplication-tap-highlight" content="no">
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="text/javascript" src="./lib.js"></script>
<script type="text/javascript" src="./update.js"></script>
</head>
<body>
<div id="wrapper">
<div id="boxParent">
<div id="box"></div>
</div>
<textarea id="funcDefArea"></textarea>
<div id="runCodeArea"><span>点击运行</span></div>
</div>
<div id="warning-message">
<h1>随风曰:“欢迎来到随风的图形与数学编程世界!”</h1>
<h2>随风曰:“手机和Pad只有在横屏时才能使用!”</h2>
</div>
<script>
function getVersion(){ return "1.0.1"}
var lastTouchEnd = 0;
document.oncontextmenu = function (event) {
if (event.preventDefault) {
event.preventDefault();
}
if (event.stopPropagation) {
event.stopPropagation();
}
event.cancelBubble = true;
return false;
}
document.addEventListener('touchstart', function (event) {
if (event.touches.length > 1) {
event.preventDefault();
}
});
document.addEventListener('touchend', function (event) {
var now = (new Date()).getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
}, false);
document.addEventListener('gesturestart', function (event) {
event.preventDefault();
});
</script>
<script>
function mess(message) {
$('body').append('<p class="mess">' + message + '</p>');
var $m = $('.mess');
$m.hide().fadeIn(200, function () {
setTimeout(function () {
$m.fadeOut(600, function () {
$m.remove();
});
}, 1500);
});
}
var editor = CodeMirror.fromTextArea(document.getElementById("funcDefArea"), {
lineNumbers: true,
lineWrapping: true,
matchBrackets: true,
continueComments: "Enter",
extraKeys: {
"Ctrl-Q": "toggleComment"
},
autoCloseBrackets: true
});
var codeText = window.localStorage.getItem("GEOMATH1");
if(codeText){
editor.setValue(codeText);
}
$('#runCodeArea').on('click', function (ev) {
ev.preventDefault();
var val = editor.getValue();
if (!val || !/\S/.test(val)) return;
if ((/^\s*help\s*$/i).test(val)) {
toggleHelp();
return;
}
val = val.replace(/\r?\n$/, '');
window.localStorage.setItem("GEOMATH1",val);
try {
with(window) {
window.eval(val);
}
} catch (err) {
//mess(err.message);
return;
}
});
function run($codeEl) {
var code = $codeEl.text();
if (!$codeEl.is('pre')) return;
$('#help').addClass('hidden').hide();
try {
with(window) {
window.eval(code);
}
} catch (err) {
//mess(err.message);
return
}
}
</script>
</body>
</html>