Permalink
Browse files

image, speedy, xfd: remove {{move to Commons}} when tagging files for…

… deletion

Per request on [[WT:TW]]. Similar to what we do with {{new unreviewed article}}.
  • Loading branch information...
atlight committed Dec 30, 2011
1 parent e5de0db commit c6589e7a6348d72df4d714a9e18f7094b729e582
Showing with 12 additions and 1 deletion.
  1. +3 −0 modules/twinkleimage.js
  2. +4 −0 modules/twinklespeedy.js
  3. +5 −1 modules/twinklexfd.js
View
@@ -270,6 +270,9 @@ Twinkle.image.callbacks = {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*}}/gi, "");
var tag = "{{di-" + params.type + "|date={{subst:#time:j F Y}}";
switch( params.type ) {
case 'no source no license':
View
@@ -1032,6 +1032,10 @@ Twinkle.speedy.callbacks = {
// Remove tags that become superfluous with this action
text = text.replace(/\{\{\s*(New unreviewed article|Userspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
if (mw.config.get('wgNamespaceNumber') === 6) {
// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*}}/gi, "");
}
// Generate edit summary for edit
var editsummary;
View
@@ -913,6 +913,8 @@ Twinkle.xfd.callbacks = {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*}}/gi, "");
pageobj.setPageText("{{ffd|log=" + params.date + "}}\n" + text);
pageobj.setEditSummary("Nominated for deletion at [[" + params.logpage + "#" + mw.config.get('wgPageName') + "]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchPage')) {
@@ -963,6 +965,8 @@ Twinkle.xfd.callbacks = {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*}}/gi, "");
pageobj.setPageText("{{puf|help=off|log=" + params.date + "}}\n" + text);
pageobj.setEditSummary("Listed at [[WP:PUF|possibly unfree files]]: [[" + params.logpage + "#" + mw.config.get('wgPageName') + "]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchPage')) {
@@ -1152,7 +1156,7 @@ Twinkle.xfd.callbacks = {
var params = pageobj.getCallbackParameters();
pageobj.setPageText("{{subst:cfr-speedy|1=" + params.target + "}}\n" + text);
pageobj.setEditSummary("Nominated for speedy renaming; see [[WP:CFDS|categories for discussion/Speedy]]." + Twinkle.getPref('summaryAd'));
pageobj.setEditSummary("Nominated for speedy renaming; see [[WP:CFDS|Categories for discussion/Speedy]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
pageobj.setWatchlist(true);

0 comments on commit c6589e7

Please sign in to comment.