From 9374ebe552b7b04f72915f2e618cd654da6ccdcb Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 6 Sep 2015 16:44:29 -0500 Subject: [PATCH] Implement close action choices. --- tfdclerk.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/tfdclerk.js b/tfdclerk.js index 1714028..78d0c65 100644 --- a/tfdclerk.js +++ b/tfdclerk.js @@ -29,6 +29,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// + var dependencies = [ "mediawiki.api", "mediawiki.ui", @@ -333,6 +335,26 @@ TFD.prototype._is_merge = function() { .text() == "Propose merging"; }; +TFD.prototype._get_close_action_choices = function() { + // TODO + return [{ + id: "none", + name: "Do nothing", + help: "The script will not modify this template or pages related to " + + "it. You will need to carry out the closure yourself.", + on_select: null, + on_close: null, + default: true + }, { + id: "holding-cell", + name: "Move to holding cell", + help: "The script will add {{being deleted}} to the template and " + + "add an entry to the holding cell ([[WP:TFD/H]]).", + on_select: null, + on_close: null + }]; +}; + TFD.prototype._on_close_result_change = function() { this._unblock_submit("no-close-result"); // TODO: possibly disable/enable individual close actions @@ -457,6 +479,7 @@ TFD.prototype._load_backlink_summary = function(page, tlinfo) { }; TFD.prototype._build_close_action_entry = function(page) { + var self = this; var redlink = this.head.nextUntil("h4").filter("ul").first() .find("a").filter(function() { return $(this).text() == page; }) .hasClass("new"); @@ -465,6 +488,32 @@ TFD.prototype._build_close_action_entry = function(page) { .append(this._build_loading_node("li", "Fetching transclusions")); this._load_backlink_summary(page, tlinfo); + var select_extra = $(""); + var help = $("", {text: "?"}); + var select = $("", {disabled: redlink}) // TODO: fully implement - .append($("