From 7990231d27ce652fd9fc6a13cdacd34df1b2413d Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 16 Aug 2015 18:52:40 -0400 Subject: [PATCH] More work on interface. --- tfdclerk.js | 107 +++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 19 deletions(-) diff --git a/tfdclerk.js b/tfdclerk.js index 4dd1b53..a436d06 100644 --- a/tfdclerk.js +++ b/tfdclerk.js @@ -28,17 +28,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -mw.loader.using(["mediawiki.api"], function() { +mw.loader.using(["mediawiki.ui", "jquery.ui.core"], function() { if (mw.config.get("wgNamespaceNumber") != 4 || ( mw.config.get("wgTitle") != "Templates for discussion" && mw.config.get("wgTitle").indexOf("Templates for discussion/Log/2") != 0)) return; TFDClerk = { - // TODO sysop: $.inArray("sysop", mw.config.get("wgUserGroups")) >= 0 }; + TFDClerk._get_today = function() { + return new Date().toISOString().slice(0, 10); + }; + TFDClerk._guard = function(head) { if (head.data("guard")) return false; @@ -54,38 +57,103 @@ mw.loader.using(["mediawiki.api"], function() { var head = box.prev("h4"); box.remove(); TFDClerk._unguard(head); - } + }; - TFDClerk._add_option_box = function(head, verb) { - var box = $("
", { addClass: "tfdclerk-" + verb + "-box" }) + TFDClerk._add_option_box = function(head, verb, title, callback, options) { + var box = $("
", { + id: "tfdclerk-" + verb + "-box-" + head.uniqueId().prop("id"), + addClass: "tfdclerk-" + verb + "-box" + }) .css("border", "1px solid #AAA") - .css("background-color", "#F5F5F5") + .css("background-color", "#F9F9F9") .css("margin", "0.5em 0") - .css("padding", "1em"); - box.append( - $("