-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
36 lines (32 loc) · 985 Bytes
/
script.js
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
var editor;
require.config({ paths: { 'vs': 'node_modules/monaco-editor/min/vs' }});
require(['vs/editor/editor.main'], function() {
editor = monaco.editor.create(document.getElementById('container'), {
value: [
'function x() {',
'\tconsole.log("Hello world!");',
'}'
].join('\n'),
language: 'javascript',
theme: "vs-dark"
});
});
function MoveRun(){
if(CodeCheck()){
var code = editor.getValue();
localStorage.setItem("main",code);
location.href = "run.html"
}
//location.href = "run.html"
}
function CodeCheck(){
var CC = document.getElementById("CodeConsole");
CC.value = "takaysu";
code = editor.getValue();
var SearchWord = ['import','require']
if (/import|require|banana/.test(code)) {
CC.value="不正な文字が含まれています";
return false;
}
return true;
}