-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.template.html
66 lines (65 loc) · 1.98 KB
/
index.template.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<script>
window.addEventListener('error', event => {
const app = document.getElementById('app');
const head = document.createElement('h2');
const details = document.createElement('div');
if (event.message.toLowerCase().indexOf('script error') >= 0) {
head.append('Script Error');
details.append('See console for details');
} else {
head.append('Uncaught Error');
const message = [
'Message: ' + event.message,
'Url: ' + event.filename,
'Line: ' + event.lineno + ', column: ' + event.colno,
'Error: ' + event.error
];
message.forEach(el => {
details.append(el);
details.append(document.createElement('br'));
});
}
app.append(head);
app.append(details);
return false;
});
</script>
<style>
input.vertical[type="range"] {
writing-mode: vertical-rl;
direction: rtl;
}
body {
font-family: Roboto, Arial, Helvetica, sans-serif;
}
</style>
<link rel="stylesheet" type="text/css" href="./fonts/fira-code/index.css"/>
</head>
<body>
<div id="app"></div>
<script src="./vs/loader.js"></script>
<script>
const baseUrl = location.origin + location.pathname.split('/').slice(0, -1).join('/');
require.config({ paths: { vs: `${baseUrl}/vs` } });
window.MonacoEnvironment = {
getWorkerUrl: () => baseUrl + "/vs/base/worker/workerMain.js"
};
function getMonaco() {
return new Promise((resolve, reject) => {
require(["vs/editor/editor.main"], function (monaco) {
window.monaco = monaco;
resolve();
}, (err) => {
console.error("Error loading monaco:", err);
reject(err) ;
});
});
}
</script>
</body>
</html>