Archived
1
0

add admin stuff to mod panel

This commit is contained in:
jeff 2015-09-19 08:54:54 -04:00
parent 8d146ed6cd
commit 1c61de8880
2 changed files with 21 additions and 1 deletions

View File

@ -42,6 +42,23 @@ function nntpchan_unban() {
})
}
function nntpchan_admin(method, param) {
nntpchan_mod({
name:"admin",
parser: function(target) {
return method;
}
handle: function(j) {
if (j.msg) {
return document.createTextNode(j.msg);
} else {
return "nothing happened?";
}
}
})
}
// handle delete command
function nntpchan_delete() {
nntpchan_mod({
@ -127,7 +144,7 @@ function nntpchan_mod(mod_action) {
}
if (mod_action.name) {
var url = mod_action.name + "/" + target;
ajax.open("GET", url);
ajax.open(mod_action.method || "GET", url);
ajax.send();
} else {
alert("mod action has no name");

View File

@ -25,6 +25,9 @@
<button onclick="nntpchan_unban()">unban (ip)</button>
</div>
</div>
<div>
<button onclick="nntpchan_admin('template.reload', {})">reload all templates</button>
</div>
<div id="nntpchan_mod_result"></div>
<noscript>
<b>enable js to use the mod panel kthx</b>