forked from LafeLabs/trashbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.html
172 lines (140 loc) · 4.26 KB
/
board.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--
TRASH MAGIC
TRASHNET
EVERYTHING IS PHYSICAL
EVERYTHING IS FRACTAL
EVERYTHING IS RECURSIVE
NO MONEY
NO MINING
NO PROPERTY
LOOK AT THE FUNGI
LOOK AT THE INSECTS
LANGUAGE IS HOW THE MIND PARSES REALITY
All Code, text, art, media, technology, and ideas CC0 PUBLIC DOMAIN
https://github.com/lafeLabs/trashnet
-->
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA4A8AAO/vAADqrwAA6q8AAOqvAADqrwAA6q8AAOqvAADqrwAA7+8AAMAHAADf9wAAwAcAAPu/AAD4PwAA" rel="icon" type="image/x-icon" />
<!--Stop Google:-->
<META NAME="robots" CONTENT="noindex,nofollow">
<title>TRASHNET</title>
</head>
<body>
<table id = "inputtable">
<tr>
<td>NEW BOARD:</td>
<td><input id = "newboardinput"/></td>
<td><a id ="newboardlink"></a></td>
</tr>
</table>
<textarea id = "board"></textarea>
<div id = "links">
</div>
<script>
board = "";
var httpc2 = new XMLHttpRequest();
httpc2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
board = this.responseText;
document.getElementById("board").value = board;
}
};
httpc2.open("GET", "fileloader.php?filename=board.txt", true);
httpc2.send();
document.getElementById("board").onkeyup = function() {
wall = 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="+encodeURIComponent(wall)+"&filename=board.txt");//send text to filesaver.php
}
var httpc2 = new XMLHttpRequest();
httpc2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("links").innerHTML = this.responseText;
loadfolders();
}
};
httpc2.open("GET", "fileloader.php?filename=links.html", true);
httpc2.send();
function loadfolders(){
domelement = document.getElementById("links");
files = [];
var httpfiles = new XMLHttpRequest();
httpfiles.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
files = JSON.parse(this.responseText);
var locallinks = [];
var oldlinks = domelement.getElementsByTagName("A");
for(var index = 0;index < oldlinks.length;index++){
locallinks.push(oldlinks[index]);
}
for(var index = 0;index < files.length;index++){
var newa = document.createElement("A");
newa.href = files[index] + "/";
newa.innerHTML = files[index] + "/";
domelement.appendChild(newa);
locallinks.push(newa);
}
}
};
httpfiles.open("GET", "dirdir.php", true);
httpfiles.send();
}
document.getElementById("newboardinput").value = "";
document.getElementById("newboardinput").onchange = function() {
var newa = document.getElementById("newboardlink");
newa.innerHTML = "CLICK LINK TO CREATE NEW BOARD " + this.value;
newa.href = "mkdir.php?dir=" + this.value;
}
</script>
<style>
body,input,table{
background-color:#9f8767;
font-family:Comic Sans MS;
}
a{
display:block;
color:blue;
margin-left:5em;
margin-bottom:1em;
font-size:2em;
}
#board{
position:absolute;
width:90%;
height:48%;
left:5%;
top:3em;
background-color:#9f8767;
color:black;
font-family:Comic Sans MS;
overflow:scroll;
border:solid;
border-width:5px;
}
#links{
position:absolute;
left:0px;
right:0px;
bottom:2em;
top:55%;
overflow:scroll;
}
#inputtable{
position:absolute;
top:0px;
font-size:1.2em;
background-color:#9f8767;
font-family:Comic Sans MS;
}
#newboardinput{
font-size:1em;
}
</style>
</body>
</html>