From 1c61de888092ffdf7915e8fa11bb8719b1055054 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 19 Sep 2015 08:54:54 -0400 Subject: [PATCH] add admin stuff to mod panel --- contrib/static/mod.js | 19 ++++++++++++++++++- contrib/templates/default/modpage.mustache | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/contrib/static/mod.js b/contrib/static/mod.js index 871fafc..0232a5e 100644 --- a/contrib/static/mod.js +++ b/contrib/static/mod.js @@ -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"); diff --git a/contrib/templates/default/modpage.mustache b/contrib/templates/default/modpage.mustache index 1742ab0..6ad8161 100644 --- a/contrib/templates/default/modpage.mustache +++ b/contrib/templates/default/modpage.mustache @@ -25,6 +25,9 @@ +
+ +