-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path404.html
More file actions
46 lines (43 loc) · 1.34 KB
/
Copy path404.html
File metadata and controls
46 lines (43 loc) · 1.34 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="../styles.css">
</head>
<body>
<script>
(function() {
let segments = window.location.pathname.split('/').filter(Boolean);
let params = new URLSearchParams(window.location.search);
let notationDir = decodeURIComponent(segments[segments.length - 1] || 'worm');
let encodedNotation = encodeURIComponent(notationDir);
let prefix = '/' + segments.slice(0, -1).join("/") + (segments.length > 1 ? '/' : '');
function addScript(src, cb) {
let s = document.createElement('script');
s.async = false;
s.src = src;
s.onerror = function() {
s.remove();
let fallback = prefix + 'worm/notation.js';
console.log(fallback);
if (src !== fallback) {
addScript(fallback, function() {
notation.missing = true;
});
}
};
s.onload = function() { if (cb) cb(); };
document.body.appendChild(s);
}
// Load main.js first, then notation.js
addScript(prefix + 'main.js', function() {
addScript(prefix + encodedNotation + '/notation.js');
});
})();
</script>
</body>
</html>