-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
48 lines (43 loc) · 1.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
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
.content {display: none}
</style>
</head>
<body>
<input type="file" id="files" multiple />
<textarea class="content" id="source"></textarea>
<script src="http://gnab.github.io/remark/downloads/remark-latest.min.js" type="text/javascript"></script>
<script>
function handleFileSelect(e) {
var content = document.querySelector('#source')
content.style.display = 'block'
Array.prototype.forEach.call(e.target.files, function(f) {
var reader = new FileReader()
reader.onload = (function() {
return function(e) {
content.innerText = e.target.result
document.querySelector('#files').style.display = 'none'
remark.create()
}
})()
reader.readAsText(f)
})
}
document.getElementById('files')
.addEventListener('change', handleFileSelect, false)
</script>
</body>
</html>