add admin stuff to mod panel
This commit is contained in:
parent
8d146ed6cd
commit
1c61de8880
@ -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");
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user