forked from LafeLabs/trashbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readmeeditor.html
92 lines (75 loc) · 2.51 KB
/
readmeeditor.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADf+wAA3/sAAAfgAACv9QAAoAUAAK/1AACv9QAAqBUAAK/1AACoFQAAr/UAAKAFAACv9QAAB+AAAN/7AADf+wAA" rel="icon" type="image/x-icon" />
<script src = "https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.js"></script>
<!--Stop Google:-->
<META NAME="robots" CONTENT="noindex,nofollow">
</head>
<body>
<textarea id = "maintextarea"></textarea>
<a id = "homelink" href = "readme.html">readme</a>
<script>
//get readme.md, convert to html and display
var converter = new showdown.Converter();
// for more on options see here:
// https://github.com/showdownjs/showdown/wiki/Showdown-Options
converter.setOption('literalMidWordUnderscores', 'true');
converter.setOption('tables', 'true');
currentfile = "README.md";
//get readme.md, convert to html and display
scroll = "";
rawhtml = "";
var httpc = new XMLHttpRequest();
httpc.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
scroll = this.responseText;
document.getElementById("maintextarea").value = scroll;
}
};
httpc.open("GET", "fileloader.php?filename=" + currentfile, true);
httpc.send();
document.getElementById("maintextarea").onkeyup = function() {
scroll = this.value;
data = encodeURIComponent(this.value);
var httpc = new XMLHttpRequest();
var url = "filesaver.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpc.send("data="+data+"&filename=" + currentfile);//send text to filesaver.php
}
</script>
<style>
body{
overflow:hidden;
background-color:black;
}
a{
color:#ff2cb4;
}
#maintextarea{
position:absolute;
left:0px;
top:0px;
width:65%;
height:100%;
padding-left:1em;
padding-top:1em;
background-color:black;
color:#00ff00;
font-family:"Times New Roman", Times, serif;
font-size:1.5em;
overflow:scroll;
}
#homelink{
position:absolute;
right:0px;
top:0px;
font-size:2em;
}
@media only screen and (max-width: 1000px) {
}
</style>
</body>
</html>