forked from LafeLabs/trashbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scrolldelete.html
135 lines (109 loc) · 3.76 KB
/
scrolldelete.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<!--
NO MONEY
NO MINING
NO PROPERTY
EVERYTHING IS PHYSICAL
EVERYTHING IS RECURSIVE
EVERYTHING IS FRACTAL
LOOK AT THE INSECTS
LOOK AT THE FUNGI
LANGUGE IS HOW THE MIND PARSES REALITY
-->
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAABEAAREQAAABERABERAAAAEREAAREAAAAREAAAABAAAQAAAAAAAQAQAAAAAAAAEQAAAAAAAAEREAAAAAAAAREQAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAM/zAACH4QAAh+EAAMfjAAD73wAA/b8AAP5/AAD8PwAA/D8AAP5/AAD//wAA//8AAP//AAD//wAA" rel="icon" type="image/x-icon" />
<!--Stop Google:-->
<META NAME="robots" CONTENT="noindex,nofollow">
</head>
<body>
<a href = "index.html">
<img id = "scrollbutton" class = "button" src = "iconsymbols/home.svg"/>
</a>
<a href = "scrolleditor.php">
<img id = "scrollbutton" class = "button" src = "iconsymbols/edit.svg"/>
</a>
<ul id = "mainlist">
</ul>
<script>
//deleteprotect = true;//set to false to enable deletion of directories
deleteprotect = false;//set to ture to disable deletion of directories
scrolls = [];
var httpc2 = new XMLHttpRequest();
httpc2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
scrolls = JSON.parse(this.responseText);
for(var index = 0;index < scrolls.length;index++) {
if(scrolls[index] != "home"){
var newspan = document.createElement("SPAN");
newspan.innerHTML = "scrolls/" + scrolls[index];
var newli = document.createElement("LI");
newli.appendChild(newspan);
document.getElementById("mainlist").appendChild(newli);
}
}
addDeleteButtons();
}
};
httpc2.open("GET", "dir.php?filename=scrolls", true);
httpc2.send();
function addDeleteButtons(){
dirlist = document.getElementById("mainlist").getElementsByTagName("LI");
for(var index = 0;index < dirlist.length;index++){
var newdeletebutton = document.createElement("span");
newdeletebutton.innerHTML = "DELETE";
newdeletebutton.className = "button";
dirlist[index].appendChild(newdeletebutton);
}
deletebuttons = document.getElementById("mainlist").getElementsByClassName("button");
for(var index = 0;index < deletebuttons.length;index++){
deletebuttons[index].onclick = function() {
thisdir = this.parentNode.getElementsByTagName("SPAN")[0].innerHTML;
// console.log(thisdir);
var httpc = new XMLHttpRequest();
var url = "deletefile.php";
httpc.open("POST", url, true);
httpc.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
httpc.send("filename=" + thisdir);//send text to deletefile.php
this.parentNode.parentNode.removeChild(this.parentNode);
}
}
}
</script>
<style>
body{
font-size:2em;
background-color:#9f8767;
font-family:Comic Sans MS;
}
table{
font-family:courier;
font-family:Comic Sans MS;
}
.button{
cursor:pointer;
}
.button:hover{
background-color:green;
}
.button:active{
background-color:yellow;
}
.button{
cursor:pointer;
color:red;
font-family:courier;
font-size:1.5em;
}
#deleteonbutton{
cursor:pointer;
background-color:#9f8767;
font-family:Comic Sans MS;
border:solid;
border-radius:0.3em;
width:10em;
}
</style>
</body>
</html>