-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
109 lines (100 loc) · 4.55 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<!-- <meta http-equiv="Content-Security-Policy" content="default-src https://*.cern.ch http://127.0.0.1:8080 data: blob: 'unsafe-inline' 'unsafe-eval' https://lhcvdm.web.cern.ch/lhcvdm/"> -->
<!-- NOTE: this is for testing to see if this fetches anything from unallowed locations - uncomment to test-->
<style>
html,
body {
margin: 0px;
}
</style>
<title>LHC VdM web-editor</title>
<noscript>
You need JavaScript enabled to run this.
</noscript>
<script>
// from https://stackoverflow.com/a/16938481/1836406
function get_browser() {
var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(M[1])){
tem=/\brv[ :]+(\d+)/g.exec(ua) || [];
return {name:'IE',version:(tem[1]||'')};
}
if(M[1]==='Chrome'){
tem=ua.match(/\bOPR|Edge\/(\d+)/)
if(tem!=null) {return {name:'Opera', version:tem[1]};}
}
M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}
return {
name: M[0],
version: M[1]
};
}
var browser_version = get_browser();
if(!((browser_version.name == "Chrome" && parseInt(browser_version.version) >= 54)
|| (browser_version.name == "Firefox" && parseInt(browser_version.version) >= 63))){
if(!((browser_version.name == "Safari" && parseInt(browser_version.version) >= 11)
|| (browser_version.name == "Opera" && parseInt(browser_version.version) >= 41))){
alert("Your browser doesn't seem to use support web components - the application may error.")
}
else{
alert("Your browser isn't officially supported (only chrome>=54 and firefox>=63 are) - the application may break.")
}
}
</script>
<script>
window.addEventListener("error", function (error) {
try{
alert(error.type + error.filename + ":" + error.lineno + "\n" + error.message);
} catch {}
})
window.addEventListener('unhandledrejection', async function (err) {
try{
if (err.reason instanceof Response) {
let errorText;
if(err.reason.body.locked) errorText = "";
else errorText = await err.reason.text();
try {
const obj = JSON.parse(errorText);
if (typeof obj.message !== "undefined") {
alert('GitLab API error: ' + obj.message);
} else {
throw err;
}
} catch {
alert(`${err.reason.url} gave error code ${err.reason.status}:\n${errorText}`)
}
}
else {
alert(err.type + err.filename + ":" + err.lineno + "\n" + err.message);
}
}
catch (e){console.error(e)}
});
</script>
<link rel="preload" as="script" href="./extern/ace-17.06.19/ace.js">
<link rel="preload" as="script" href="./extern/ace-17.06.19/ext-language_tools.js">
<link rel="preload" as="script" href="./extern/jQuery-3.4.1.js">
<link rel="preload" as="script" href="./extern/ace-17.06.19/ace.js">
<link rel="preload" as="script" href="./extern/ace-17.06.19/ext-language_tools.js">
<link rel="preload" as="script" href="./extern/ace-17.06.19/ext-searchbox.js">
<link rel="preload" as="script" href="./extern/highcharts-7.1.2/highcharts.js">
<link rel="preload" as="script" href="./extern/highcharts-7.1.2/no-data-to-display.js">
<script src="./extern/jQuery-3.4.1.js"></script>
<script src="./extern/ace-17.06.19/ace.js"></script>
<script src="./extern/ace-17.06.19/ext-language_tools.js"></script>
<script src="./extern/ace-17.06.19/ext-searchbox.js"></script>
<script src="./extern/highcharts-7.1.2/highcharts.js"></script>
<script src="./extern/highcharts-7.1.2/no-data-to-display.js"></script>
<script src="./extern/hyperhtml-2.30.1.js"></script>
<script>
let hyper = hyperHTML.hyper;
let wire = hyperHTML.wire;
</script>
<script type='module' src='src/main.js'></script>
</head>
<body>
</body>
</html>