-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
60 lines (59 loc) · 2.11 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Thulium Music</title>
<link href="index.css" rel="stylesheet">
<link href="node_modules/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
<link href="node_modules/element-ui/lib/theme-chalk/display.css" rel="stylesheet">
<!--TODO: remove in production mode -->
<script src="http://localhost:8098"></script>
</head>
<body>
<script src="library.js" type="text/javascript"></script>
<script>
const nodeRequire = global.require
</script>
<script src="node_modules/monaco-editor/min/vs/loader.js" type="text/javascript"></script>
<script>
const amdRequire = global.require
global.require = nodeRequire
const path = require('path')
function uriFromPath(...paths) {
const result = path.resolve(path.join(...paths)).split(path.sep)
.map(name => name
.replace(/#/g, '%23')
.replace(/ /g, '%20')
).join('/')
return 'file:///' + result
}
amdRequire.config({
baseUrl: uriFromPath(__dirname, 'node_modules/monaco-editor/min')
})
self.module = undefined
self.process.browser = true
const { defineLanguage } = require('./library/editor/Editor')
global.themes = require('./themes/theme')
amdRequire(['vs/editor/editor.main'], () => {
defineLanguage()
const rawMonacoCreate = window.monaco.editor.create
global.editors = []
window.monaco.editor.create = function() {
const editor = rawMonacoCreate.apply(this, arguments)
global.editors.push(editor)
return editor
}
global.library.Themes.forEach(theme => {
window.monaco.editor.defineTheme(theme.key, {
base: global.themes[theme.key].basetheme,
inherit: true,
rules: global.themes[theme.key].tokenizer,
colors: global.themes[theme.key].editor
})
})
})
</script>
<div id="app"><!-- content will be injected --></div>
<script src="index.js" type="text/javascript"></script>
</body>
</html>