-
Notifications
You must be signed in to change notification settings - Fork 105
/
detail.js
37 lines (32 loc) · 953 Bytes
/
detail.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
const getQueryObj = () => {
var obj = {};
var str = decodeURI(location.search.replace('?', ''));
var arr = str.split('&');
arr.forEach(value => {
let k = value.match(/(.+)=.+|$/)[1];
let v = decodeURI(value.match(/.+=(.+)|$/)[1]);
if (k && v) obj[k] = v;
});
return obj;
};
document.addEventListener('DOMContentLoaded', () => {
let node = document.getElementById('stage');
let queryObj = getQueryObj();
let path = queryObj['path'];
document.title = queryObj['title'];
node.dataset.markdown = path;
Reveal.initialize({
width: 960,
height: 700,
// Factor of the display size that should remain empty around the content
margin: 0.1,
// Bounds for smallest/largest possible scale to apply to content
minScale: 0.2,
maxScale: 1.5,
history: true,
dependencies: [
{src: 'tools/plugin/markdown/marked.js'},
{src: 'tools/plugin/markdown/markdown.js'}
]
});
}, false);