Skip to content

Commit

Permalink
Merge branch 'master' into untag-pull
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Dec 25, 2018
2 parents 4328ff7 + c579c27 commit f892f93
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 57 deletions.
5 changes: 2 additions & 3 deletions modules/friendlytag.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,10 +679,10 @@ Twinkle.tag.article.tagCategories = {
"Verifiability and sources": [
"BLP sources",
"BLP unsourced",
"More citations needed",
"One source",
"Original research",
"Primary sources",
"More citations needed",
"Self-published",
"Third-party",
"Unreferenced",
Expand Down Expand Up @@ -918,8 +918,7 @@ Twinkle.tag.file.cleanupList = [
]
}
},
{ label: '{{Should be text}}: image should be represented as text, tables, or math markup', value: 'Should be text' },
{ label: '{{Split media}}: there are two different images in the upload log which need to be split', value: 'Split media' }
{ label: '{{Should be text}}: image should be represented as text, tables, or math markup', value: 'Should be text' }
];

Twinkle.tag.file.qualityList = [
Expand Down
15 changes: 15 additions & 0 deletions modules/twinklebatchprotect.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ Twinkle.batchprotect.callback = function twinklebatchprotectCallback() {
label: 'Autoconfirmed',
value: 'autoconfirmed'
});
editlevel.append({
type: 'option',
label: 'Extended confirmed',
value: 'extendedconfirmed'
});
editlevel.append({
type: 'option',
label: 'Template editor',
Expand Down Expand Up @@ -132,6 +137,11 @@ Twinkle.batchprotect.callback = function twinklebatchprotectCallback() {
label: 'Autoconfirmed',
value: 'autoconfirmed'
});
movelevel.append({
type: 'option',
label: 'Extended confirmed',
value: 'extendedconfirmed'
});
movelevel.append({
type: 'option',
label: 'Template editor',
Expand Down Expand Up @@ -206,6 +216,11 @@ Twinkle.batchprotect.callback = function twinklebatchprotectCallback() {
label: 'Autoconfirmed',
value: 'autoconfirmed'
});
createlevel.append({
type: 'option',
label: 'Extended confirmed',
value: 'extendedconfirmed'
});
createlevel.append({
type: 'option',
label: 'Template editor',
Expand Down
24 changes: 12 additions & 12 deletions modules/twinkleconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,69 +30,69 @@ Twinkle.config.commonEnums = {
Twinkle.config.commonSets = {
csdCriteria: {
db: "Custom rationale ({{db}})",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g5: "G5", g6: "G6", g7: "G7", g8: "G8", g10: "G10", g11: "G11", g12: "G12", g13: "G13",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g5: "G5", g6: "G6", g7: "G7", g8: "G8", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a7: "A7", a9: "A9", a10: "A10", a11: "A11",
u1: "U1", u2: "U2", u3: "U3", u5: "U5",
f1: "F1", f2: "F2", f3: "F3", f7: "F7", f8: "F8", f9: "F9", f10: "F10",
c1: "C1",
t2: "T2", t3: "T3",
r2: "R2", r3: "R3",
r2: "R2", r3: "R3", r4: "R4",
p1: "P1", p2: "P2"
},
csdCriteriaDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13", "g14",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u1", "u2", "u3", "u5",
"f1", "f2", "f3", "f7", "f8", "f9", "f10",
"c1",
"t2", "t3",
"r2", "r3",
"r2", "r3", "r4",
"p1", "p2"
],
csdCriteriaNotification: {
db: "Custom rationale ({{db}})",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g6: 'G6 ("unnecessary disambig." and "copy-paste move" only)',
g10: "G10", g11: "G11", g12: "G12", g13: "G13",
g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a7: "A7", a9: "A9", a10: "A10", a11: "A11",
u3: "U3", u5: "U5",
f1: "F1", f2: "F2", f3: "F3", f7: "F7", f8: "F8", f9: "F9", f10: "F10",
c1: "C1",
t2: "T2", t3: "T3",
r2: "R2", r3: "R3",
r2: "R2", r3: "R3", r4: "R4",
p1: "P1", p2: "P2"
},
csdCriteriaNotificationDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13",
"g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "g14",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u3", "u5",
"f1", "f2", "f3", "f7", "f9", "f10",
"c1",
"t2", "t3",
"r2", "r3",
"r2", "r3", "r4",
"p1", "p2"
],
csdAndDICriteria: {
db: "Custom rationale ({{db}})",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g5: "G5", g6: "G6", g7: "G7", g8: "G8", g10: "G10", g11: "G11", g12: "G12", g13: "G13",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g5: "G5", g6: "G6", g7: "G7", g8: "G8", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a7: "A7", a9: "A9", a10: "A10", a11: "A11",
u1: "U1", u2: "U2", u3: "U3", u5: "U5",
f1: "F1", f2: "F2", f3: "F3", f4: "F4", f5: "F5", f6: "F6", f7: "F7", f8: "F8", f9: "F9", f10: "F10", f11: "F11",
c1: "C1",
t2: "T2", t3: "T3",
r2: "R2", r3: "R3",
r2: "R2", r3: "R3", r4: "R4",
p1: "P1", p2: "P2"
},
csdAndDICriteriaDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13", "g14",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u1", "u2", "u3", "u5",
"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11",
"c1",
"t2", "t3",
"r2", "r3",
"r2", "r3", "r4",
"p1", "p2"
],
namespacesNoSpecial: {
Expand Down
6 changes: 6 additions & 0 deletions modules/twinkledeprod.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//<nowiki>


(function($){


Expand Down Expand Up @@ -179,3 +182,6 @@ callback_deleteRedirects = function( apiobj ) {
};

})(jQuery);


//</nowiki>
13 changes: 12 additions & 1 deletion modules/twinkleprod.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,23 @@ Twinkle.prod.callbacks = {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();

// Check for already existing deletion tags
var tag_re = /({{(?:db-?|delete|[aitcmrs]fd|md1)[^{}]*?\|?[^{}]*?}})/i;
if( tag_re.test( text ) ) {
statelem.warn( 'Page already tagged with a deletion template, aborting procedure' );
return;
}

// Alert if article is not in Category:Living people and BLPPROD is selected
if( params.blp ) {
var blpcheck_re = /\[\[Category:Living people\]\]/i;
if( !blpcheck_re.test( text ) ) {
if( ! confirm("Please note that the article is not in Category:Living people and hence may be ineligible for BLPPROD. Are you sure you want to continue? \n\nYou may wish to add the category if you proceed, unless the article is about a recently deceased person." ) ) {
return;
}
}
}

// Remove tags that become superfluous with this action
text = text.replace(/{{\s*(userspace draft|mtc|(copy|move) to wikimedia commons|(copy |move )?to ?commons)\s*(\|(?:{{[^{}]*}}|[^{}])*)?}}\s*/gi, "");
var prod_re = /{{\s*(?:dated prod|dated files|dated prod blp|Prod blp\/dated|Proposed deletion\/dated)\s*\|(?:{{[^{}]*}}|[^{}])*}}/i;
Expand All @@ -200,7 +211,7 @@ Twinkle.prod.callbacks = {
}

summaryText = "Proposing " + namespace + " for deletion per [[WP:" + (params.blp ? "BLP" : "") + "PROD]].";
text = "{{subst:prod" + (params.blp ? " blp" : ("|1=" + Morebits.string.formatReasonText(params.reason))) + "}}\n" + text;
text = "{{subst:prod" + (params.blp ? " blp" : ("|1=" + Morebits.string.formatReasonText(params.reason))) + (params.usertalk ? "|help=off" : "") + "}}\n" + text;
}
else { // already tagged for PROD, so try endorsing it
var prod2_re = /{{(?:Proposed deletion endorsed|prod-?2).*?}}/;
Expand Down
69 changes: 35 additions & 34 deletions modules/twinklespeedy.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ Twinkle.speedy.fileList = [
{
label: 'G8: File description page with no corresponding file',
value: 'imagepage',
tooltip: 'This is only for use when the file doesn\'t exist at all. Corrupt files, and local description pages for files on Commons, should use F2; implausible redirects should use R3; and broken Commons redirects should use G6.'
tooltip: 'This is only for use when the file doesn\'t exist at all. Corrupt files, and local description pages for files on Commons, should use F2; implausible redirects should use R3; and broken Commons redirects should use R4.'
}
];

Expand Down Expand Up @@ -790,17 +790,17 @@ Twinkle.speedy.userNonRedirectList = [
value: 'notwebhost',
tooltip: 'Pages in userspace consisting of writings, information, discussions, and/or activities not closely related to Wikipedia\'s goals, where the owner has made few or no edits outside of userspace, with the exception of plausible drafts, pages adhering to WP:UPYES, and résumé-style pages.'
},
{
label: 'G6: Blank draft',
value: 'blankdraft',
tooltip: 'Userspace drafts containing only the default Article Wizard text, where the author of the page has been inactive for at least one year.',
hideWhenMultiple: true
},
{
label: 'G11: Promotional user page under a promotional user name',
value: 'spamuser',
tooltip: 'A promotional user page, with a username that promotes or implies affiliation with the thing being promoted. Note that simply having a page on a company or product in one\'s userspace does not qualify it for deletion. If a user page is spammy but the username is not, then consider tagging with regular G11 instead.',
hideWhenMultiple: true
},
{
label: 'G13: AfC draft submission or a blank draft, stale by over 6 months',
value: 'afc',
tooltip: 'Any rejected or unsubmitted AfC draft submission or a blank draft, that has not been edited in over 6 months (excluding bot edits).',
hideWhenMultiple: true
}
];

Expand Down Expand Up @@ -933,13 +933,6 @@ Twinkle.speedy.generalList = [
},
hideWhenMultiple: true
},
{
label: 'G6: Unnecessary disambiguation page',
value: 'disambig',
tooltip: 'This only applies for orphaned disambiguation pages which either: (1) disambiguate only one existing Wikipedia page and whose title ends in "(disambiguation)" (i.e., there is a primary topic); or (2) disambiguate no (zero) existing Wikipedia pages, regardless of its title.',
hideWhenMultiple: true,
hideWhenRedirect: true
},
{
label: 'G6: Copy-and-paste page move',
value: 'copypaste',
Expand Down Expand Up @@ -1037,9 +1030,15 @@ Twinkle.speedy.generalList = [
]
},
{
label: 'G13: Old, abandoned Articles for Creation submissions',
label: 'G13: Page in draft namespace or userspace AfC submission, stale by over 6 months',
value: 'afc',
tooltip: 'Any rejected or unsubmitted AfC submission that has not been edited for more than 6 months.',
tooltip: 'Any rejected or unsubmitted AfC submission in userspace or any page in draft namespace, that has not been edited for more than 6 months. Blank drafts in either namespace are also included.',
hideWhenRedirect: true
},
{
label: 'G14: Unnecessary disambiguation page',
value: 'disambig',
tooltip: 'This only applies for orphaned disambiguation pages which either: (1) disambiguate only one existing Wikipedia page and whose title ends in "(disambiguation)" (i.e., there is a primary topic); or (2) disambiguate no (zero) existing Wikipedia pages, regardless of its title.',
hideWhenRedirect: true
}
];
Expand All @@ -1055,6 +1054,11 @@ Twinkle.speedy.redirectList = [
value: 'redirtypo',
tooltip: 'However, redirects from common misspellings or misnomers are generally useful, as are redirects in other languages'
},
{
label: 'R4: File namespace redirect with name that matches a Commons page',
value: 'redircom',
tooltip: 'The redirect should have no incoming links (unless the links are cleary intended for the file or redirect at Commons).'
},
{
label: 'G6: Redirect to malplaced disambiguation page',
value: 'movedab',
Expand All @@ -1080,10 +1084,8 @@ Twinkle.speedy.normalizeHash = {
'histmerge': 'g6',
'move': 'g6',
'xfd': 'g6',
'disambig': 'g6',
'movedab': 'g6',
'copypaste': 'g6',
'blankdraft': 'g6',
'g6': 'g6',
'author': 'g7',
'g8': 'g8',
Expand All @@ -1098,6 +1100,7 @@ Twinkle.speedy.normalizeHash = {
'spamuser': 'g11',
'copyvio': 'g12',
'afc': 'g13',
'disambig': 'g14',
'nocontext': 'a1',
'foreign': 'a2',
'nocontent': 'a3',
Expand All @@ -1115,6 +1118,7 @@ Twinkle.speedy.normalizeHash = {
'madeup': 'a11',
'rediruser': 'r2',
'redirtypo': 'r3',
'redircom' : 'r4',
'redundantimage': 'f1',
'noimage': 'f2',
'fpcfail': 'f2',
Expand Down Expand Up @@ -1569,15 +1573,20 @@ Twinkle.speedy.callbacks = {
appendText += "\n\n=== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ===";
}

var editsummary = "Logging speedy deletion nomination";
appendText += "\n# [[:" + Morebits.pageNameNorm;
if (params.normalizeds.indexOf("g10") === -1) { // no article name in log for G10 taggings
appendText += "]]: ";
} else {
appendText += "|This]] attack page: ";
}

if (params.fromDI) {
appendText += "DI [[WP:CSD#" + params.normalized.toUpperCase() + "|CSD " + params.normalized.toUpperCase() + "]] ({{tl|di-" + params.templatename + "}})";
appendText += "]]: DI [[WP:CSD#" + params.normalized.toUpperCase() + "|CSD " + params.normalized.toUpperCase() + "]] ({{tl|di-" + params.templatename + "}})";
editsummary += " of [[:" + Morebits.pageNameNorm + "]].";
} else {
if (params.normalizeds.indexOf("g10") === -1) { // no article name in log for G10 taggings
appendText += "]]: ";
editsummary += " of [[:" + Morebits.pageNameNorm + "]].";
} else {
appendText += "|This]] attack page: ";
editsummary += " of an attack page.";
}
if (params.normalizeds.length > 1) {
appendText += "multiple criteria (";
$.each(params.normalizeds, function(index, norm) {
Expand All @@ -1598,15 +1607,7 @@ Twinkle.speedy.callbacks = {
appendText += " ~~~~~\n";

pageobj.setAppendText(appendText);

var editsummary = "Logging speedy deletion nomination";
if (params.normalizeds.indexOf("g10") === -1) { // no article name in summary for G10 taggings
editsummary += " of [[:" + Morebits.pageNameNorm + "]].";
} else {
editsummary += " of an attack page.";
}
editsummary += Twinkle.getPref('summaryAd');
pageobj.setEditSummary(editsummary);
pageobj.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
pageobj.setCreateOption("recreate");
pageobj.append();
}
Expand Down Expand Up @@ -1991,7 +1992,7 @@ Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUse
if (form.notify.checked) {
$.each(normalizeds, function(index, norm) {
if (Twinkle.getPref('notifyUserOnSpeedyDeletionNomination').indexOf(norm) !== -1) {
if (norm === 'g6' && ['disambig', 'copypaste'].indexOf(values[index]) === -1) {
if (norm === 'g6' && values[index] !== 'copypaste') {
return true;
}
notifyuser = true;
Expand Down
13 changes: 8 additions & 5 deletions modules/twinklexfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,30 @@ Twinkle.xfd.callback = function twinklexfdCallback() {
tooltip: 'When activated, a default choice is made, based on what namespace you are in. This default should be the most appropriate',
event: Twinkle.xfd.callback.change_category
} );
var namespace = mw.config.get('wgNamespaceNumber');

categories.append( {
type: 'option',
label: 'AfD (Articles for deletion)',
selected: mw.config.get('wgNamespaceNumber') === 0, // Main namespace
selected: namespace === 0, // Main namespace
value: 'afd'
} );
categories.append( {
type: 'option',
label: 'TfD (Templates for discussion)',
selected: [ 10, 828 ].indexOf( mw.config.get('wgNamespaceNumber') ) !== -1, // Template and module namespaces
selected: [ 10, 828 ].indexOf(namespace) !== -1, // Template and module namespaces
value: 'tfd'
} );
categories.append( {
type: 'option',
label: 'FfD (Files for discussion)',
selected: mw.config.get('wgNamespaceNumber') === 6, // File namespace
selected: namespace === 6, // File namespace
value: 'ffd'
} );
categories.append( {
type: 'option',
label: 'CfD (Categories for discussion)',
selected: mw.config.get('wgNamespaceNumber') === 14, // Category namespace
selected: namespace === 14, // Category namespace
value: 'cfd'
} );
categories.append( {
Expand All @@ -92,7 +94,8 @@ Twinkle.xfd.callback = function twinklexfdCallback() {
categories.append( {
type: 'option',
label: 'MfD (Miscellany for deletion)',
selected: [ 0, 6, 10, 14, 828 ].indexOf( mw.config.get('wgNamespaceNumber') ) === -1,
selected: [ 0, 6, 10, 14, 828 ].indexOf(namespace) === -1 || Morebits.pageNameNorm.startsWith("Template:User "),
//Other namespaces, and userboxes in template namespace
value: 'mfd'
} );
categories.append( {
Expand Down
4 changes: 2 additions & 2 deletions twinkle.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ Twinkle.defaultConfig.twinkle = {
markSpeedyPagesAsPatrolled: false,

// these next two should probably be identical by default
notifyUserOnSpeedyDeletionNomination: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3", "u5", "t2", "t3", "p1", "p2" ],
welcomeUserOnSpeedyDeletionNotification: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3", "u5", "t2", "t3", "p1", "p2" ],
notifyUserOnSpeedyDeletionNomination: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "g14", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3", "u5", "t2", "t3", "p1", "p2" ],
welcomeUserOnSpeedyDeletionNotification: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "g14", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3", "u5", "t2", "t3", "p1", "p2" ],
promptForSpeedyDeletionSummary: [],
openUserTalkPageOnSpeedyDelete: [ "db", "g1", "g2", "g3", "g4", "g5", "g10", "g11", "g12", "a1", "a3", "a7", "a9", "a10", "a11", "f3", "f7", "f9", "u3", "u5", "t2", "p1" ],
deleteTalkPageOnDelete: true,
Expand Down

0 comments on commit f892f93

Please sign in to comment.