From 27352fae54e400d8ac4fff8f0cfbd41c979fd4a0 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 16 Sep 2015 22:45:27 -0500 Subject: [PATCH] Work on closure action sketch. --- src/tfd_close.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/src/tfd_close.js b/src/tfd_close.js index bc6a34d..6a56276 100644 --- a/src/tfd_close.js +++ b/src/tfd_close.js @@ -43,7 +43,8 @@ TFD.prototype._is_merge = function() { }; TFD.prototype._get_close_action_choices = function() { - // TODO + // TODO: disable action options until transcluion info loads... + // TODO: restrictions for close reason return [{ id: "none", name: "Do nothing", @@ -51,14 +52,65 @@ TFD.prototype._get_close_action_choices = function() { "it. You will need to carry out the closure yourself.", on_select: null, on_close: null, + restrict: {}, 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, // TODO: auto-select "to merge" if merging + on_close: null, + restrict: {} + }, { + id: "keep", + name: "Keep", // TODO: clarify? esp. for merges + help: "TODO", + // remove {{TFD}}/{{TFM}}, add/update {{TFD end}} on talk with result + on_select: null, + on_close: null, + restrict: {} + }, { + id: "redirect", + name: "Redirect", // TODO: clarify? + help: "TODO", + // redirect main and subpages and double-redirects to user-selected + // target; add {{TFD end}} on talk [or give option to redirect talk + // instead?]; "Ensure page protection for the redirect matches that of + // the template which the page now redirects to, and that page + // protection for the target template is appropriate for the number of + // transclusions which may have increased after the redirection.") on_select: null, - on_close: null + on_close: null, + restrict: {merge: false} // TODO: allow for merges? + }, { + id: "review-and-delete", + name: "Review and delete", + help: "TODO", + on_select: null, + on_close: null, + restrict: {merge: false, used: true} + }, { + id: "orphan-and-delete", + name: "Orphan and delete", + help: "TODO", + on_select: null, + on_close: null, + restrict: {merge: false, used: true} + }, { + id: "substitute-and-delete", + name: "Substitute and delete", + help: "TODO", + on_select: null, + on_close: null, + restrict: {merge: false, used: true} + }, { + id: "delete", + name: "Delete", + help: "TODO", + on_select: null, + on_close: null, + restrict: {merge: false, used: false} }]; };