MediaWiki:Gadget-twinklespeedy.js: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (1 revision)
imported>Mlpearc
m (Text replace - "WP" to "EFD")
Line 27: Line 27:
}
}


Twinkle.addPortletLink( Twinkle.speedy.callback, "CSD", "tw-csd", Morebits.userIsInGroup('sysop') ? "Delete page according to WP:CSD" : "Request speedy deletion according to WP:CSD" );
Twinkle.addPortletLink( Twinkle.speedy.callback, "CSD", "tw-csd", Morebits.userIsInGroup('sysop') ? "Delete page according to EFD:CSD" : "Request speedy deletion according to EFD:CSD" );
};
};


Line 44: Line 44:
dialog.setTitle( "Choose criteria for speedy deletion" );
dialog.setTitle( "Choose criteria for speedy deletion" );
dialog.setScriptName( "Twinkle" );
dialog.setScriptName( "Twinkle" );
dialog.addFooterLink( "Speedy deletion policy", "WP:CSD" );
dialog.addFooterLink( "Speedy deletion policy", "EFD:CSD" );
dialog.addFooterLink( "Twinkle help", "WP:TW/DOC#speedy" );
dialog.addFooterLink( "Twinkle help", "EFD:TW/DOC#speedy" );


var form = new Morebits.quickForm( callbackfunc, (Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null) );
var form = new Morebits.quickForm( callbackfunc, (Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null) );
Line 317: Line 317:
label: 'F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary',
label: 'F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary',
value: 'badfairuse', // same as above
value: 'badfairuse', // same as above
tooltip: 'Non-free images or media from a commercial source (e.g., Associated Press, Getty), where the file itself is not the subject of sourced commentary, are considered an invalid claim of fair use and fail the strict requirements of WP:NFCC.'
tooltip: 'Non-free images or media from a commercial source (e.g., Associated Press, Getty), where the file itself is not the subject of sourced commentary, are considered an invalid claim of fair use and fail the strict requirements of EFD:NFCC.'
});
});
}
}
Line 434: Line 434:
label: 'C1: Empty categories',
label: 'C1: Empty categories',
value: 'catempty',
value: 'catempty',
tooltip: 'Categories that have been unpopulated for at least four days. This does not apply to categories being discussed at WP:CFD, disambiguation categories, and certain other exceptions. If the category isn\'t relatively new, it possibly contained articles earlier, and deeper investigation is needed'
tooltip: 'Categories that have been unpopulated for at least four days. This does not apply to categories being discussed at EFD:CFD, disambiguation categories, and certain other exceptions. If the category isn\'t relatively new, it possibly contained articles earlier, and deeper investigation is needed'
},
},
{
{
Line 723: Line 723:
'reason': '',
'reason': '',
// General
// General
'nonsense': '[[WP:PN|Patent nonsense]], meaningless, or incomprehensible',
'nonsense': '[[EFD:PN|Patent nonsense]], meaningless, or incomprehensible',
'test': 'Test page',
'test': 'Test page',
'vandalism': '[[WP:Vandalism|Vandalism]]',
'vandalism': '[[EFD:Vandalism|Vandalism]]',
'hoax': 'Blatant [[WP:Do not create hoaxes|hoax]]',
'hoax': 'Blatant [[EFD:Do not create hoaxes|hoax]]',
'repost': 'Recreation of a page that was [[WP:DEL|deleted]] per a [[WP:XFD|deletion discussion]]',
'repost': 'Recreation of a page that was [[EFD:DEL|deleted]] per a [[EFD:XFD|deletion discussion]]',
'banned': 'Creation by a [[WP:BLOCK|blocked]] or [[WP:BAN|banned]] user in violation of block or ban',
'banned': 'Creation by a [[EFD:BLOCK|blocked]] or [[EFD:BAN|banned]] user in violation of block or ban',
'histmerge': 'Temporary deletion in order to merge page histories',
'histmerge': 'Temporary deletion in order to merge page histories',
'move': 'Making way for a non-controversial move',
'move': 'Making way for a non-controversial move',
'xfd': 'Deleting page per result of [[WP:XfD|deletion discussion]]',
'xfd': 'Deleting page per result of [[EFD:XfD|deletion discussion]]',
'disambig': 'Unnecessary disambiguation page',
'disambig': 'Unnecessary disambiguation page',
'movedab': 'Redirect to [[WP:MALPLACED|malplaced disambiguation page]]',
'movedab': 'Redirect to [[EFD:MALPLACED|malplaced disambiguation page]]',
'copypaste': '[[WP:CPMV|Copy-and-paste]] page move',
'copypaste': '[[EFD:CPMV|Copy-and-paste]] page move',
'g6': 'Housekeeping and routine (non-controversial) cleanup',
'g6': 'Housekeeping and routine (non-controversial) cleanup',
'author': 'One author who has requested deletion or blanked the page',
'author': 'One author who has requested deletion or blanked the page',
'g8': 'Page dependent on a deleted or nonexistent page',
'g8': 'Page dependent on a deleted or nonexistent page',
'talk': '[[Help:Talk page|Talk page]] of a deleted or nonexistent page',
'talk': '[[Help:Talk page|Talk page]] of a deleted or nonexistent page',
'subpage': '[[WP:Subpages|Subpage]] of a deleted or nonexistent page',
'subpage': '[[EFD:Subpages|Subpage]] of a deleted or nonexistent page',
'redirnone': '[[Wikipedia:Redirect|redirect]] to a deleted or nonexistent page',
'redirnone': '[[Wikipedia:Redirect|redirect]] to a deleted or nonexistent page',
'templatecat': 'Populated by deleted or retargeted templates',
'templatecat': 'Populated by deleted or retargeted templates',
'imagepage': 'File description page for a file that does not exist',
'imagepage': 'File description page for a file that does not exist',
'attack': '[[WP:ATP|Attack page]] or negative unsourced [[WP:BLP|BLP]]',
'attack': '[[EFD:ATP|Attack page]] or negative unsourced [[EFD:BLP|BLP]]',
'negublp': 'Negative unsourced [[WP:BLP|BLP]]',
'negublp': 'Negative unsourced [[EFD:BLP|BLP]]',
'spam': 'Unambiguous [[WP:ADS|advertising]] or promotion',
'spam': 'Unambiguous [[EFD:ADS|advertising]] or promotion',
'copyvio': 'Unambiguous [[WP:C|copyright infringement]]',
'copyvio': 'Unambiguous [[EFD:C|copyright infringement]]',
'afc': 'Abandoned [[WP:AFC|Articles for creation]] submission',
'afc': 'Abandoned [[EFD:AFC|Articles for creation]] submission',
// Articles
// Articles
'nocontext': 'Short article without enough context to identify the subject',
'nocontext': 'Short article without enough context to identify the subject',
Line 770: Line 770:
'unksource': 'Lack of licensing information',
'unksource': 'Lack of licensing information',
'unfree': 'Unused non-free media',
'unfree': 'Unused non-free media',
'norat': 'Non-free file without [[WP:RAT|fair-use rationale]]',
'norat': 'Non-free file without [[EFD:RAT|fair-use rationale]]',
'badfairuse': 'Violates [[WP:F|non-free use policy]]',
'badfairuse': 'Violates [[EFD:F|non-free use policy]]',
'nowcommons': 'Media file available on Commons',
'nowcommons': 'Media file available on Commons',
'imgcopyvio': 'Unambiguous [[WP:COPYVIO|copyright violation]]',
'imgcopyvio': 'Unambiguous [[EFD:COPYVIO|copyright violation]]',
'badfiletype': 'Useless media file (not an image, audio or video)',
'badfiletype': 'Useless media file (not an image, audio or video)',
'nopermission': 'No evidence of permission',
'nopermission': 'No evidence of permission',
Line 781: Line 781:
'userreq': 'User request to delete page in own userspace',
'userreq': 'User request to delete page in own userspace',
'nouser': 'Userpage or subpage of a nonexistent user',
'nouser': 'Userpage or subpage of a nonexistent user',
'gallery': '[[WP:NFC|Non-free]] [[Help:Gallery|gallery]]',
'gallery': '[[EFD:NFC|Non-free]] [[Help:Gallery|gallery]]',
// Templates
// Templates
'policy': 'Template that unambiguously misrepresents established policy',
'policy': 'Template that unambiguously misrepresents established policy',
Line 787: Line 787:
't3': 'Unused, redundant template',
't3': 'Unused, redundant template',
// Portals
// Portals
'p1': '[[WP:P|Portal]] page that would be subject to speedy deletion as an article',
'p1': '[[EFD:P|Portal]] page that would be subject to speedy deletion as an article',
'emptyportal': '[[WP:P|Portal]] without a substantial topic base',
'emptyportal': '[[EFD:P|Portal]] without a substantial topic base',
// Redirects
// Redirects
'rediruser': 'Cross-[[WP:NS|namespace]] [[WP:R|redirect]] from mainspace',
'rediruser': 'Cross-[[EFD:NS|namespace]] [[EFD:R|redirect]] from mainspace',
'redirtypo': 'Recently created, implausible [[WP:R|redirect]]'
'redirtypo': 'Recently created, implausible [[EFD:R|redirect]]'
};
};


Line 815: Line 815:
reason = prompt("Enter the deletion summary to use, which will be entered into the deletion log:", "");
reason = prompt("Enter the deletion summary to use, which will be entered into the deletion log:", "");
} else {
} else {
var presetReason = "[[WP:CSD#" + params.normalized.toUpperCase() + "|" + params.normalized.toUpperCase() + "]]: " + params.reason;
var presetReason = "[[EFD:CSD#" + params.normalized.toUpperCase() + "|" + params.normalized.toUpperCase() + "]]: " + params.reason;
if (Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
if (Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
reason = prompt("Enter the deletion summary to use, or press OK to accept the automatically generated one.", presetReason);
reason = prompt("Enter the deletion summary to use, or press OK to accept the automatically generated one.", presetReason);
Line 840: Line 840:
document.getElementById( 'ca-talk' ).className !== 'new') {
document.getElementById( 'ca-talk' ).className !== 'new') {
var talkpage = new Morebits.wiki.page( Morebits.wikipedia.namespaces[ mw.config.get('wgNamespaceNumber') + 1 ] + ':' + mw.config.get('wgTitle'), "Deleting talk page" );
var talkpage = new Morebits.wiki.page( Morebits.wikipedia.namespaces[ mw.config.get('wgNamespaceNumber') + 1 ] + ':' + mw.config.get('wgTitle'), "Deleting talk page" );
talkpage.setEditSummary('[[WP:CSD#G8|G8]]: Talk page of deleted page "' + Morebits.pageNameNorm + '"' + Twinkle.getPref('deletionSummaryAd'));
talkpage.setEditSummary('[[EFD:CSD#G8|G8]]: Talk page of deleted page "' + Morebits.pageNameNorm + '"' + Twinkle.getPref('deletionSummaryAd'));
talkpage.deletePage();
talkpage.deletePage();
// this is ugly, but because of the architecture of wiki.api, it is needed
// this is ugly, but because of the architecture of wiki.api, it is needed
Line 979: Line 979:
var title = $(value).attr('title');
var title = $(value).attr('title');
var page = new Morebits.wiki.page(title, 'Deleting redirect "' + title + '"');
var page = new Morebits.wiki.page(title, 'Deleting redirect "' + title + '"');
page.setEditSummary('[[WP:CSD#G8|G8]]: Redirect to deleted page "' + Morebits.pageNameNorm + '"' + Twinkle.getPref('deletionSummaryAd'));
page.setEditSummary('[[EFD:CSD#G8|G8]]: Redirect to deleted page "' + Morebits.pageNameNorm + '"' + Twinkle.getPref('deletionSummaryAd'));
page.deletePage(onsuccess);
page.deletePage(onsuccess);
});
});
Line 1,079: Line 1,079:
editsummary = 'Requesting speedy deletion (';
editsummary = 'Requesting speedy deletion (';
$.each(params.normalizeds, function(index, norm) {
$.each(params.normalizeds, function(index, norm) {
editsummary += '[[WP:CSD#' + norm.toUpperCase() + '|CSD ' + norm.toUpperCase() + ']], ';
editsummary += '[[EFD:CSD#' + norm.toUpperCase() + '|CSD ' + norm.toUpperCase() + ']], ';
});
});
editsummary = editsummary.substr(0, editsummary.length - 2); // remove trailing comma
editsummary = editsummary.substr(0, editsummary.length - 2); // remove trailing comma
editsummary += ').';
editsummary += ').';
} else if (params.normalizeds[0] === "db") {
} else if (params.normalizeds[0] === "db") {
editsummary = 'Requesting [[WP:CSD|speedy deletion]] with rationale \"' + parameters["1"] + '\".';
editsummary = 'Requesting [[EFD:CSD|speedy deletion]] with rationale \"' + parameters["1"] + '\".';
} else if (params.values[0] === "histmerge") {
} else if (params.values[0] === "histmerge") {
editsummary = "Requesting history merge with [[" + parameters["1"] + "]] ([[WP:CSD#G6|CSD G6]]).";
editsummary = "Requesting history merge with [[" + parameters["1"] + "]] ([[EFD:CSD#G6|CSD G6]]).";
} else {
} else {
editsummary = "Requesting speedy deletion ([[WP:CSD#" + params.normalizeds[0].toUpperCase() + "|CSD " + params.normalizeds[0].toUpperCase() + "]]).";
editsummary = "Requesting speedy deletion ([[EFD:CSD#" + params.normalizeds[0].toUpperCase() + "|CSD " + params.normalizeds[0].toUpperCase() + "]]).";
}
}


Line 1,186: Line 1,186:
if (!pageobj.exists()) {
if (!pageobj.exists()) {
text =
text =
"This is a log of all [[WP:CSD|speedy deletion]] nominations made by this user using [[WP:TW|Twinkle]]'s CSD module.\n\n" +
"This is a log of all [[EFD:CSD|speedy deletion]] nominations made by this user using [[EFD:TW|Twinkle]]'s CSD module.\n\n" +
"If you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and " +
"If you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and " +
"nominate this page for speedy deletion under [[WP:CSD#U1|CSD U1]].\n";
"nominate this page for speedy deletion under [[EFD:CSD#U1|CSD U1]].\n";
if (Morebits.userIsInGroup("sysop")) {
if (Morebits.userIsInGroup("sysop")) {
text += "\nThis log does not track outright speedy deletions made using Twinkle.\n";
text += "\nThis log does not track outright speedy deletions made using Twinkle.\n";
Line 1,203: Line 1,203:
text += "\n# [[:" + Morebits.pageNameNorm + "]]: ";
text += "\n# [[:" + Morebits.pageNameNorm + "]]: ";
if (params.fromDI) {
if (params.fromDI) {
text += "DI [[WP:CSD#" + params.normalized.toUpperCase() + "|CSD " + params.normalized.toUpperCase() + "]] (" + params.type + ")";
text += "DI [[EFD:CSD#" + params.normalized.toUpperCase() + "|CSD " + params.normalized.toUpperCase() + "]] (" + params.type + ")";
} else {
} else {
if (params.normalizeds.length > 1) {
if (params.normalizeds.length > 1) {
text += "multiple criteria (";
text += "multiple criteria (";
$.each(params.normalizeds, function(index, norm) {
$.each(params.normalizeds, function(index, norm) {
text += "[[WP:CSD#" + norm.toUpperCase() + "|" + norm.toUpperCase() + ']], ';
text += "[[EFD:CSD#" + norm.toUpperCase() + "|" + norm.toUpperCase() + ']], ';
});
});
text = text.substr(0, text.length - 2); // remove trailing comma
text = text.substr(0, text.length - 2); // remove trailing comma
Line 1,215: Line 1,215:
text += "{{tl|db-reason}}";
text += "{{tl|db-reason}}";
} else {
} else {
text += "[[WP:CSD#" + params.normalizeds[0].toUpperCase() + "|CSD " + params.normalizeds[0].toUpperCase() + "]] ({{tl|db-" + params.values[0] + "}})";
text += "[[EFD:CSD#" + params.normalizeds[0].toUpperCase() + "|CSD " + params.normalizeds[0].toUpperCase() + "]] ({{tl|db-" + params.values[0] + "}})";
}
}
}
}
Line 1,286: Line 1,286:
return null;
return null;
}
}
if (deldisc !== "" && deldisc.substring(0, 9) !== "Wikipedia" && deldisc.substring(0, 3) !== "WP:")
if (deldisc !== "" && deldisc.substring(0, 9) !== "Wikipedia" && deldisc.substring(0, 3) !== "EFD:")
{
{
statelem.error( 'The deletion discussion page name, if provided, must start with "Wikipedia:". Cannot proceed.' );
statelem.error( 'The deletion discussion page name, if provided, must start with "Wikipedia:". Cannot proceed.' );