-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
74 lines (58 loc) · 1.86 KB
/
Copy pathadmin.html
File metadata and controls
74 lines (58 loc) · 1.86 KB
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
<html>
<head>
<title>FABE - Fricking Awesome Blog Engine</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script>
function delpost(title,url,n){
var ok=confirm('Title: '+title+'.\\n\\n Do you want to delete this entry?');
if(ok){ ajax('delete','url='+url,delrow,n); } // delete post
}
function delrow(res,n){
var tr = document.querySelector("#row"+n);
tr.parentNode.removeChild(tr);
}
function ajax(url,data,callback,args){
var http = new XMLHttpRequest();
if(!data){mode="GET";} else {mode="POST";}
http.open(mode,url,true);
if(mode=="POST"){http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}
http.onreadystatechange=function(){if(http.readyState==4){callback(http.responseText,args);}};
http.send(data);
}
</script>
</head>
<body>
<div id="page">
<div id="head">
<h1><a href=".">FABE <small>[admin]</small></a></h1>
<h2>Fricking Awesome Blog Engine</h2>
</div><!-- head -->
<div id="content">
<div id="side">
<div class="panel">
<h1>Admin console</h1>
<ul>
<li><a href="newpost" >New post </a></li>
<li><a href="admin" >Blog entries</a></li>
<li><a href="editstyle">Edit style </a></li>
<li><a href="options" >Edit options</a></li>
</ul>
</div>
</div><!-- side -->
<div id="main">
<div class="post">
<h1>Blog entries</h1>
<table id="posts">
$code(for(i in data){)
<tr id="row$(i)"><td><a href="view/$(data[i].url)">$(data[i].title)</a></td><td>$(new Date(data[i].date).format('y.m.d h:i a'))</td><td><a href="edit/$(data[i].url)">Edit</a></td><td><a href="javascript:delpost('$(data[i].title)','$(data[i].url)',$(i))">Delete</a></td></tr>
$code(})
</table>
</div><!-- post -->
</div><!-- Main -->
</div><!-- content -->
<div id="foot">
<p>© 2010 - WTFPL - FABE</p>
</div>
</div><!-- page -->
</body>
</html>