-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpopup.js
28 lines (23 loc) · 794 Bytes
/
popup.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
const inputs = {
search: document.getElementById('search'),
name: document.getElementById('name')
}
const buttons = {
editor: document.getElementById('newScript'),
run: document.getElementById('run'),
close: document.getElementById('close'),
save: document.getElementById('save'),
}
const editor = CodeMirror.fromTextArea(document.getElementById('code'), {
mode: "javascript",
theme: "base16-dark",
gutters: ["CodeMirror-lint-markers"],
lint: true,
lineNumbers: true,
});
const [editorSlide] = document.getElementsByClassName('slide')
const scriptList = document.getElementById('script-list');
const scriptRunner = new ScriptRunner(editor, editorSlide, inputs, buttons, scriptList)
scriptRunner.init().then(() => {
scriptRunner.render()
})