-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
61 lines (54 loc) · 1.65 KB
/
scripts.js
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
var mainDom = document.getElementById('main');
// mainDom.className = 'remarkdown h1-underline ul-star em-star strong-star a-showurl code-tick pre-tick';
mainDom.style.whiteSpace = '';
// mainDom.style.fontFamily = '';
// mainDom.style.maxWidth = '';
// mainDom.style.margin = '';
var loadJs = function (url, async, defer, callback) {
var script = document.createElement('script')
script.type = 'text/javascript';
if (async) script.async = "async";
if (defer) script.defer = "defer";
if (script.readyState) { //IE
script.onreadystatechange = function () {
if (script.readyState == 'loaded' ||
script.readyState == 'complete') {
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function () {
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
};
var loadCSS = function (url) {
var styleEl = document.createElement('link');
styleEl.href = url;
styleEl.type = 'text/css';
styleEl.rel = "stylesheet"
document.head.append(styleEl);
};
MathJax = {
tex: {
inlineMath: [
['$', '$'],
['\\(', '\\)']
],
displayMath: [
['$$', '$$'],
['\\[', '\\]']
]
}
};
loadCSS('/assets/remarkdown.css');
loadCSS('/assets/hljs-grayscale.css');
loadCSS('/styles.css');
loadJs('/assets/highlight.min.js', false, true, function () {
hljs.configure({ languages: [] });
hljs.highlightAll();
});
loadJs('/assets/mathjax/tex-mml-svg.js', false, true, function () { });