-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
55 lines (44 loc) · 1.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>수학</title>
<script>
list=[]
function reload(){
fetch('./html').then((응답)=>{
return 응답.text();
}).then((Data)=>{
//console.log('data',Data);
var list=eval(Data)
var out=''
console.log(list)
for(var i=0;i<list.length;i++){
out+=`<li onclick=open_file("${list[i]}")>${list[i]}</li>`;
}
document.getElementById("nav").innerHTML=out
})
}
window.onload = reload
function open_file(str){
fetch('./files/'+str).then((응답)=>{
return 응답.text();
}).then((Data)=>{
var art = document.getElementById('art')
art.innerHTML = "<p>" + Data.split('\n').join(' </p><p>') + "</p>"
MathJax.typeset([art])
})
}
</script>
<style>
p {height: 1em;}
</style>
</head>
<body>
<a href="./edit">수정하기</a>
<nav id='nav'></nav>
<script src="js/mathjax@3es5tex-mml-chtml.js"></script>
<script id="MathJax-script" async src="js/polyfill.iov3polyfill.min.js"></script>
<article id='art'></article>
</body>
</html>