-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
159 lines (128 loc) · 4.61 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="//localhost:35729/livereload.js?snipver=1" async="" defer=""></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Course Editor Admin</title>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/custom-elements/1.1.1/custom-elements.min.js"></script> -->
<!-- <script type="text/x-mathjax-config">
MathJax.Hub.Config(
{ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
processEscapes: true,
messageStyle: "none",
processSectionDelay: 0,
processUpdateTime: 0,
showProcessingMessages: false,
"fast-preview": {disabled: true},
TeX: { equationNumbers: {autoNumber: "AMS"},
noErrors: {disabled: true},
extensions: ["mhchem.js"]
}
}
);
</script> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML"></script> -->
<script type="text/javascript" src="elm.js"></script>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w"
crossorigin="anonymous">
<link rel="stylesheet" href="assets/css/layouts/side-menu.css">
<link rel="stylesheet" href="assets/icons/icomoon/style.css">
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-rc.22/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-rc.22/js/uikit.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-rc.22/js/uikit-icons.min.js"></script>
</head>
<body>
</body>
<script type="text/javascript" src="js/keycloak.js"></script>
<script type="text/javascript" src="js/keycloak-client.js"></script>
<script type="text/javascript">
var app = null;
// var typesetTimeout = null
// var typesetQueue = []
// function enqueueTypeset(el) {
// typesetQueue.push(el)
// clearTimeout(typesetTimeout)
// typesetTimeout = setTimeout(function () {
// var toTypeset = typesetQueue
// MathJax.Hub.Queue(["resetEquationNumbers", MathJax.InputJax.TeX]);
// MathJax.Hub.Queue(['Typeset', MathJax.Hub, typesetQueue], function (arg) {
// var msg = document.getElementById('MathJax_Message');
// if (msg !== null) {
// msg.parentElement.removeChild(msg);
// }
// toTypeset.forEach(function (el) { el.style.opacity = 1 })
// })
// typesetQueue = []
// }, 1)
// }
// var updateQueue = []
// var updateTimeout = null
// function enqueueUpdate(el) {
// updateQueue.push(el)
// clearTimeout(updateTimeout)
// updateTimeout = setTimeout(function () {
// MathJax.Hub.Queue(['Update', MathJax.Hub, updateQueue], function(arg) {
// var msg = document.getElementById('MathJax_Message');
// if (msg !== null) {
// msg.parentElement.removeChild(msg);
// }
// });
// updateQueue = []
// }, 0)
// }
// customElements.define('math-text', class extends HTMLElement {
// constructor() {
// super()
// this._content = this.content
// }
// get content() {
// return this._content
// }
// set content(value) {
// if (this._content === value) return
// this._content = value
// var jaxScript = this.querySelector('script')
// if (!jaxScript) return
// jaxScript.textContent = this._content
// enqueueUpdate(this)
// }
// connectedCallback() {
// this.textContent = this._content
// this._connected = true
// this.style.opacity = 0
// this.style.display = 'inline'
// enqueueTypeset(this)
// }
// })
var onLoginSuccess = function (token, profile, logoutUrl, managementUrl) {
var storedTheme = localStorage.getItem('theme');
var theme = storedTheme ? JSON.parse(storedTheme) : '';
app = Elm.Main.init({
flags: {
token: token,
userProfile: profile,
logoutUrl: logoutUrl,
baseUrl: location.protocol + '//' + location.hostname,
theme: theme,
}
});
app.ports.setStorage.subscribe(function (state) {
localStorage.setItem('theme', JSON.stringify(state));
});
};
var onLoginFailure = function (err) {
};
var onTokenUpdate = function (token) {
app.ports.onTokenUpdated.send(token);
};
window.keycloakClient.initialize(
onLoginSuccess,
onLoginFailure,
onTokenUpdate,
window.location.hostname
);
</script>
</html>