MediaWiki:Gadget-Twinkle.js: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan |
k perbarui; mengulang proyek :( |
||
Baris 25:
var Twinkle = {};
window.Twinkle = Twinkle; // allow global access
// Check if account is experienced enough to use Twinkle
Twinkle.userAuthorized = Morebits.userIsInGroup( "autoconfirmed" ) || Morebits.userIsInGroup( "confirmed" );
// for use by custom modules (normally empty)
Baris 48 ⟶ 51:
userTalkPageMode: "window",
dialogLargeFont: false,
// ARV
spiWatchReport: "yes",
// Fluff (revert and rollback)
openTalkPage: [ "agf", "norm", "vand" ],
Baris 67 ⟶ 72:
// CSD
speedySelectionStyle: "buttonClick",
watchSpeedyPages: [ "g3", "g5", "g10", "g11", "g12" ],
markSpeedyPagesAsPatrolled: true,
// these next two should probably be identical by default
notifyUserOnSpeedyDeletionNomination: [ "db", "
welcomeUserOnSpeedyDeletionNotification: [ "db", "
promptForSpeedyDeletionSummary: [ "db", "
openUserTalkPageOnSpeedyDelete: [ "db", "
deleteTalkPageOnDelete: false,
deleteRedirectsOnDelete: true,
Baris 81 ⟶ 85:
speedyWindowWidth: 800,
logSpeedyNominations: false,
speedyLogPageName: "
noLogOnSpeedyNomination: [ "u1" ],
// Unlink
unlinkNamespaces: [ "0", "10", "100", "118" ],
// Warn
defaultWarningGroup: "1",
Baris 90 ⟶ 94:
watchWarnings: true,
blankTalkpageOnIndefBlock: false,
customWarningList: [],
// XfD
xfdWatchDiscussion: "default",
Baris 128 ⟶ 133:
groupByDefault: true,
watchTaggedPages: true,
watchMergeDiscussions: true,
markTaggedPagesAsMinor: false,
markTaggedPagesAsPatrolled: true,
Baris 135 ⟶ 141:
topWelcomes: false,
watchWelcomes: true,
welcomeHeading: "
insertHeadings: true,
insertUsername: true,
insertSignature: true, // sign welcome templates, where appropriate
quickWelcomeMode: "norm",
quickWelcomeTemplate: "
customWelcomeList: [],
customWelcomeSignature: true,
Baris 147 ⟶ 153:
insertTalkbackSignature: true, // always sign talkback templates
talkbackHeading: "Talkback",
adminNoticeHeading: "
mailHeading: "
// Shared
markSharedIPAsMinor: true
Baris 188 ⟶ 194:
/**
* ****************
*
* Adds a portlet menu to one of the navigation areas on the page.
Baris 215 ⟶ 221:
* @return Node -- the DOM node of the new item (a DIV element) or null
*/
{
//sanity checks, and get required DOM nodes
Baris 237 ⟶ 243:
//verify/normalize input
var skin = mw.config.get("skin");
type = ( skin === "vector" && type === "menu" && ( navigation === "left-navigation" || navigation === "right-navigation" )) ? "menu" : "";
var outerDivClass;
Baris 246 ⟶ 253:
navigation = "mw-panel";
}
outerDivClass = ( navigation === "mw-panel" ) ? "portal" : ( type === "menu" ? "vectorMenu
innerDivClass = ( navigation === "mw-panel" ) ? "body" : ( type === "menu" ? "menu" : "" );
break;
Baris 267 ⟶ 274:
outerDiv.className = outerDivClass + " emptyPortlet";
outerDiv.id = id;
if ( nextnode && nextnode.parentNode === root ) {
root.insertBefore( outerDiv, nextnode );
Baris 286 ⟶ 288:
var a = document.createElement( "a" );
a.href = "#";
$( a ).click(function ( e ) {
if ( !Twinkle.userAuthorized ) {
alert("Sorry, your account is too new to use Twinkle.");
}
});
h5.appendChild( a );
} else {
Baris 295 ⟶ 303:
outerDiv.appendChild( h5 );
if ( type === "menu" ) {
innerDiv.className = innerDivClass;
outerDiv.appendChild(innerDiv);
}
var ul = document.createElement( "ul" );
(innerDiv || outerDiv).appendChild( ul );
return outerDiv;
};
/**
* ****************
* Builds a portlet menu if it doesn't exist yet, and add the portlet link.
* @param task: Either a URL for the portlet link or a function to execute.
*/
{
if ( Twinkle.getPref("portletArea") !== null ) {
}
var link = mw.util.addPortletLink( Twinkle.getPref( "portletId" ), typeof task === "string" ? task : "#", text, id, tooltip );
Baris 322 ⟶ 332:
ev.preventDefault();
});
}
if ( $.collapsibleTabs ) {
$.collapsibleTabs.handleResize();
}
return link;
};
/**
* **************** General initialization code ****************
*/
var scriptpathbefore = mw.util.wikiScript( "index" ) + "?title=",
scriptpathafter = "&action=raw&ctype=text/javascript&happy=yes";
// Retrieve the user's Twinkle preferences
$.ajax({
url: scriptpathbefore + "User:" + encodeURIComponent( mw.config.get("wgUserName")) + "/twinkleoptions.js" + scriptpathafter,
dataType: "text"
})
.fail(function () { mw.util.jsMessage( "Could not load twinkleoptions.js" ); })
.done(function ( optionsText ) {
// Quick pass if user has no options
if ( optionsText === "" ) {
return;
}
// Twinkle options are basically a JSON object with some comments. Strip those:
optionsText = optionsText.replace( /(?:^(?:\/\/[^\n]*\n)*\n*|(?:\/\/[^\n]*(?:\n|$))*$)/g, "" );
// First version of options had some boilerplate code to make it eval-able -- strip that too. This part may become obsolete down the line.
if ( optionsText.lastIndexOf( "window.Twinkle.prefs = ", 0 ) === 0 ) {
optionsText = optionsText.replace( /(?:^window.Twinkle.prefs = |;\n*$)/g, "" );
}
try {
var options = $.parseJSON( optionsText );
// Assuming that our options evolve, we will want to transform older versions:
//if ( options.optionsVersion === undefined ) {
// ...
// options.optionsVersion = 1;
//}
//if ( options.optionsVersion === 1 ) {
// ...
// options.optionsVersion = 2;
//}
// At the same time, twinkleconfig.js needs to be adapted to write a higher version number into the options.
if ( options ) {
Twinkle.prefs = options;
}
}
catch ( e ) {
mw.util.jsMessage("Could not parse twinkleoptions.js");
}
})
.always(function () {
$( Twinkle.load );
});
// Developers: you can import custom Twinkle modules here
// For example, mw.loader.load(scriptpathbefore + "User:UncleDouggie/morebits-test.js" + scriptpathafter);
Twinkle.load = function () {
// Don't activate on special pages other than "Contributions" so that they load faster, especially the watchlist.
var isSpecialPage = ( mw.config.get('wgNamespaceNumber') === -1
&& mw.config.get('wgCanonicalSpecialPageName') !== "Contributions"
&& mw.config.get('wgCanonicalSpecialPageName') !== "Prefixindex" ),
// Also, Twinkle is incompatible with Internet Explorer versions 8 or lower, so don't load there either.
isOldIE = ( $.client.profile().name === 'msie' && $.client.profile().versionNumber < 9 );
// Prevent users that are not autoconfirmed from loading Twinkle as well.
if ( isSpecialPage || isOldIE || !Twinkle.userAuthorized ) {
return;
}
// Load the modules in the order that the tabs should appears
// User/user talk-related
Twinkle.arv();
Twinkle.warn();
Twinkle.welcome();
Twinkle.shared();
Twinkle.talkback();
// Deletion
Twinkle.speedy();
Twinkle.prod();
Twinkle.xfd();
Twinkle.image();
// Maintenance
Twinkle.protect();
Twinkle.tag();
// Misc. ones last
Twinkle.diff();
Twinkle.unlink();
Twinkle.config.init();
Twinkle.fluff.init();
if ( Morebits.userIsInGroup('sysop') ) {
Twinkle.delimages();
Twinkle.deprod();
Twinkle.batchdelete();
Twinkle.batchprotect();
Twinkle.batchundelete();
}
// Run the initialization callbacks for any custom modules
$( Twinkle.initCallbacks ).each(function ( k, v ) { v(); });
Twinkle.addInitCallback = function ( func ) { func(); };
// Increases text size in Twinkle dialogs, if so configured
if ( Twinkle.getPref( "dialogLargeFont" ) ) {
mw.util.addCSS( ".morebits-dialog-content, .morebits-dialog-footerlinks { font-size: 100% !important; } " +
".morebits-dialog input, .morebits-dialog select, .morebits-dialog-content button { font-size: inherit !important; }" );
}
};
} ( window, document, jQuery )); // End wrap with anonymous function
// </nowiki>
//<nowiki>
(function($){
/*
Baris 341 ⟶ 471:
if( mw.config.get('wgNamespaceNumber') === 3 && Morebits.isIPAddress(mw.config.get('wgTitle')) ) {
var username = mw.config.get('wgTitle').split( '/' )[0].replace( /\"/, "\\\""); // only first part before any slashes
}
};
Twinkle.shared.callback = function friendlysharedCallback( uid ) {
var Window = new Morebits.simpleWindow( 600,
Window.setTitle( "Shared IP address tagging" );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.shared.callback.evaluate );
var div = form.append( {
type: 'div', id: 'sharedip-templatelist' className: 'morebits-scrollbox'
}
);
div.append( { type: 'header', label: 'Shared IP address templates' } );
div.append( { type: 'radio', name: 'shared', list: Twinkle.shared.standardList,
Baris 393 ⟶ 528:
Window.setContent( result );
Window.display();
};
Baris 427 ⟶ 560:
value: 'Static IP'
},
{
label: '{{ISP}}: shared IP address template modified for ISP organizations (specifically proxies)',
value: 'ISP'
},
{
label: '{{Mobile IP}}: shared IP address template modified for mobile phone companies and their customers',
value: 'Mobile IP'
Baris 491 ⟶ 624:
return;
}
var value = shared[0];
if( e.target.organization.value === '') {
alert( 'You must input an organization for the {{' + value + '}} template!' );
return;
}
var params = {
value: value,
Baris 517 ⟶ 650:
wikipedia_page.load(Twinkle.shared.callbacks.main);
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 534 ⟶ 677:
if( Morebits.wiki.isPageRedirect() ) {
Twinkle.tag.mode = 'redirect';
}
// file tagging
else if( mw.config.get('wgNamespaceNumber') === 6 && !document.getElementById("mw-sharedupload") && document.getElementById("mw-imagepage-section-filehistory") ) {
Twinkle.tag.mode = 'file';
}
// article/draft article tagging
else if( ( mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 118 || /^Wikipedia(
Twinkle.tag.mode = 'article';
}
};
Twinkle.tag.callback = function friendlytagCallback( uid ) {
var Window = new Morebits.simpleWindow( 630, (Twinkle.tag.mode === "article") ?
Window.setScriptName( "Twinkle" );
// anyone got a good policy/guideline/info page/instructional page link??
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.tag.callback.evaluate );
if (document.getElementsByClassName("patrollink").length) {
form.append( {
type: 'checkbox',
list: [
{
label: 'Mark the page as patrolled',
value: 'patrolPage',
name: 'patrolPage',
checked: Twinkle.getFriendlyPref('markTaggedPagesAsPatrolled')
}
]
} );
}
switch( Twinkle.tag.mode ) {
case 'article':
Window.setTitle( "Article maintenance tagging" );
form.append({
type: 'select',
name: 'sortorder',
label: 'View this list:',
tooltip: 'You can change the default view order in your Twinkle preferences (WP:TWPREFS).',
event: Twinkle.tag.updateSortOrder,
list: [
{ type: 'option', value: 'cat', label: 'By categories', selected: Twinkle.getFriendlyPref('tagArticleSortOrder') === 'cat' },
{ type: 'option', value: 'alpha', label: 'In alphabetical order', selected: Twinkle.getFriendlyPref('tagArticleSortOrder') === 'alpha' }
]
});
form.append({
type: 'div',
id: 'tagWorkArea',
className: 'morebits-scrollbox',
style: 'max-height: 28em'
});
form.append( {
Baris 574 ⟶ 750:
);
break;
Baris 651 ⟶ 809:
Twinkle.tag.updateSortOrder = function(e) {
var sortorder = e.target.value;
Twinkle.tag.checkedTags = e.target.form.getChecked("articleTags");
Baris 657 ⟶ 814:
Twinkle.tag.checkedTags = [];
}
var container = new Morebits.quickForm.element({ type: "fragment" });
// function to generate a checkbox, with appropriate subgroup if needed
Baris 664 ⟶ 823:
checkbox.checked = true;
}
switch (tag) {
case "cleanup":
checkbox.subgroup = {
name: 'cleanup',
type: 'input',
label: 'Specific reason why cleanup is needed: ',
tooltip: 'Required.',
size: 35
};
break;
case "copy edit":
checkbox.subgroup = {
name: 'copyEdit',
label: '"This article may require copy editing for..." ',
tooltip: 'e.g. "consistent spelling". Optional.',
size: 35
};
break;
case "copypaste":
checkbox.subgroup = {
name: 'copypaste',
type: 'input',
label: 'Source URL: ',
tooltip: 'If known.',
size: 50
};
break;
case "expert-subject":
checkbox.subgroup = {
name: 'expertSubject',
type: 'input',
label: 'Name of relevant WikiProject: ',
tooltip: 'Optionally, enter the name of a WikiProject which might be able to help recruit an expert. Don\'t include the "WikiProject" prefix.'
};
break;
case "globalize":
checkbox.subgroup = {
name: 'globalize',
type: 'select',
list: [
{ label: "{{globalize}}: article may not represent a worldwide view of the subject", value: "globalize" },
{
label: "Region-specific {{globalize}} subtemplates",
list: [
{ label: "{{globalize/Australia}}: article deals primarily with the Australian viewpoint", value: "globalize/Australia" },
{ label: "{{globalize/Canada}}: article deals primarily with the Canadian viewpoint", value: "globalize/Canada" },
{ label: "{{globalize/China}}: article deals primarily with the Chinese viewpoint", value: "globalize/China" },
{ label: "{{globalize/Common law}}: article deals primarily with the viewpoint of common law countries", value: "globalize/Common law" },
{ label: "{{globalize/Eng}}: article deals primarily with the English-speaking viewpoint", value: "globalize/Eng" },
{ label: "{{globalize/Europe}}: article deals primarily with the European viewpoint", value: "globalize/Europe" },
{ label: "{{globalize/France}}: article deals primarily with the French viewpoint", value: "globalize/France" },
{ label: "{{globalize/Germany}}: article deals primarily with the German viewpoint", value: "globalize/Germany" },
{ label: "{{globalize/India}}: article deals primarily with the Indian viewpoint", value: "globalize/India" },
{ label: "{{globalize/Middle East}}: article deals primarily with the Middle Eastern viewpoint", value: "globalize/Middle East" },
{ label: "{{globalize/North America}}: article deals primarily with the North American viewpoint", value: "globalize/North America" },
{ label: "{{globalize/Northern}}: article deals primarily with the northern hemisphere viewpoint", value: "globalize/Northern" },
{ label: "{{globalize/Southern}}: article deals primarily with the southern hemisphere viewpoint", value: "globalize/Southern" },
{ label: "{{globalize/South Africa}}: article deals primarily with the South African viewpoint", value: "globalize/South Africa" },
{ label: "{{globalize/UK}}: article deals primarily with the British viewpoint", value: "globalize/UK" },
{ label: "{{globalize/UK and Canada}}: article deals primarily with the British and Canadian viewpoints", value: "globalize/UK and Canada" },
{ label: "{{globalize/US}}: article deals primarily with the USA viewpoint", value: "globalize/US" },
{ label: "{{globalize/West}}: article deals primarily with the viewpoint of Western countries", value: "globalize/West" }
]
}
]
};
break;
case "merge":
case "merge from":
case "merge to":
var otherTagName = "merge";
switch (tag)
{
case "merge from":
otherTagName = "merge to";
break;
case "merge to":
otherTagName = "merge from";
break;
}
checkbox.subgroup = [
{
name: 'mergeTarget',
type: 'input',
label: 'Other article(s): ',
tooltip: 'If specifying multiple articles, separate them with pipe characters: Article one|Article two'
},
{
name: 'mergeTagOther',
type: 'checkbox',
list: [
{
checked: true,
tooltip: 'Only available if a single article name is entered.'
}
]
}
];
if (mw.config.get('wgNamespaceNumber') === 0) {
checkbox.subgroup.push({
name: 'mergeReason',
label: 'Rationale for merge (will be posted on ' +
(tag === "merge to" ? 'the other article\'s' : 'this article\'s') + ' talk page):',
tooltip: 'Optional, but strongly recommended. Leave blank if not wanted. Only available if a single article name is entered.'
});
}
break;
case "not English":
case "rough translation":
checkbox.subgroup = [
{
name: 'translationLanguage',
type: 'input',
label: 'Language of article (if known): ',
tooltip: 'Consider looking at [[WP:LRC]] for help. If listing the article at PNT, please try to avoid leaving this box blank, unless you are completely unsure.'
}
];
if (tag === "not English") {
checkbox.subgroup.push({
name: 'translationNotify',
type: 'checkbox',
list: [
{
label: 'Notify article creator',
checked: true,
tooltip: "Places {{uw-notenglish}} on the creator's talk page."
}
]
});
}
checkbox.subgroup.push({
name: 'translationPostAtPNT',
type: 'checkbox',
list: [
{
label: 'List this article at Wikipedia:Pages needing translation into English (PNT)',
checked: true
}
]
});
checkbox.subgroup.push({
name: 'translationComments',
type: 'textarea',
label: 'Additional comments to post at PNT',
tooltip: 'Optional, and only relevant if "List this article ..." above is checked.'
});
break;
case "notability":
checkbox.subgroup = {
name: 'notability',
type: 'select',
list: [
{ label: "{{notability}}: article\'s subject may not meet the general notability guideline", value: "none" },
{ label: "{{notability|Academics}}: notability guideline for academics", value: "Academics" },
{ label: "{{notability|Biographies}}: notability guideline for biographies", value: "Biographies" },
{ label: "{{notability|Books}}: notability guideline for books", value: "Books" },
{ label: "{{notability|Companies}}: notability guidelines for companies and organizations", value: "Companies" },
{ label: "{{notability|Events}}: notability guideline for events", value: "Events" },
{ label: "{{notability|Films}}: notability guideline for films", value: "Films" },
{ label: "{{notability|Places}}: notability guideline for places", value: "Places" },
{ label: "{{notability|Music}}: notability guideline for music", value: "Music" },
{ label: "{{notability|Neologisms}}: notability guideline for neologisms", value: "Neologisms" },
{ label: "{{notability|Numbers}}: notability guideline for numbers", value: "Numbers" },
{ label: "{{notability|Products}}: notability guideline for products and services", value: "Products" },
{ label: "{{notability|Sport}}: notability guideline for sports and athletics", value: "Sport" },
{ label: "{{notability|Web}}: notability guideline for web content", value: "Web" }
]
};
break;
default:
break;
}
return checkbox;
Baris 732 ⟶ 1.003:
// categorical sort order
if (sortorder === "cat") {
// function to iterate through the tags and create a checkbox for each one
var doCategoryCheckboxes = function(subdiv, array) {
Baris 754 ⟶ 1.020:
// go through each category and sub-category and append lists of checkboxes
$.each(Twinkle.tag.article.tagCategories, function(title, content) {
var subdiv =
if ($.isArray(content)) {
doCategoryCheckboxes(subdiv, content);
Baris 765 ⟶ 1.031:
}
});
}
// alphabetical sort order
Baris 778 ⟶ 1.038:
checkboxes.push(makeCheckbox(tag, description));
});
container.append({
type: "checkbox",
name: "articleTags",
list: checkboxes
});
}
// append any custom tags
if (Twinkle.getFriendlyPref('customTagList').length) {
container.append({ type: 'header', label: 'Custom tags' });
container.append({ type: 'checkbox', name: 'articleTags', list: Twinkle.getFriendlyPref('customTagList') });
}
var $workarea = $(e.target.form).find("div#tagWorkArea");
var rendered = container.render();
$workarea.empty().append(rendered);
// style adjustments
$workarea.find("h5").css({ 'font-size': '110%' });
$workarea.find("h5:not(:first-child)").css({ 'margin-top': '1em' });
$workarea.find("div").filter(":has(span.quickformDescription)").css({ 'margin-top': '0.4em' });
// add a link to each template's description page
$.each(Morebits.quickForm.getElements(e.target.form, "articleTags"), function(index, checkbox) {
var $checkbox = $(checkbox);
var link = Morebits.htmlNode("a", ">");
link.setAttribute("class", "tag-template-link");
link.setAttribute("href", mw.util.getUrl("Template:" +
Morebits.string.toUpperCaseFirstChar($checkbox.val())));
link.setAttribute("target", "_blank");
$checkbox.parent().append(["\u00A0", link]);
});
};
Baris 794 ⟶ 1.079:
// A list of all article tags, in alphabetical order
// To ensure tags appear in the default "categorized" view, add them to the tagCategories hash below.
Twinkle.tag.article.tags = {
"advert": "article is written like an advertisement",
"
"autobiography": "article is an autobiography and may not be written neutrally",
"BLP sources": "BLP article needs additional sources for verification",
"BLP unsourced": "BLP article has no sources at all (use BLP PROD instead for new articles)",
"citation style": "article has unclear or inconsistent inline citations",
"cleanup": "article may require cleanup",
Baris 826 ⟶ 1.098:
"dead end": "article has no links to other articles",
"disputed": "article has questionable factual accuracy",
"essay-like": "article is written like
"expand language": "article can be expanded with material from a foreign-language Wikipedia",
"expert-subject": "article needs attention from an expert on the subject",
"external links": "article's external links may not follow content policies or guidelines",
Baris 835 ⟶ 1.107:
"GOCEinuse": "article is currently undergoing a major copy edit by the Guild of Copy Editors",
"hoax": "article may be a complete hoax",
"improve categories": "article may require additional categories",
"in-universe": "article subject is fictional and needs rewriting from a non-fictional perspective",
"incoherent": "article is incoherent or very hard to understand",
Baris 849 ⟶ 1.122:
"more footnotes": "article has some references, but insufficient in-text citations",
"new unreviewed article": "mark article for later review",
"news release": "article reads like a news release",
"no footnotes": "article has references, but no in-text citations",
"non-free": "article may contain excessive or improper use of copyrighted materials",
Baris 856 ⟶ 1.130:
"original research": "article has original research or unverified claims",
"orphan": "article is linked to from no other articles",
"overcoverage": "article has an extensive bias or disproportional coverage towards one or more specific regions",
"overlinked": "article may have too many duplicate and/or irrelevant links",
Baris 890 ⟶ 1.163:
// Add new categories with discretion - the list is long enough as is!
Twinkle.tag.article.tagCategories = {
"Cleanup and maintenance tags": {
"General cleanup": [
"cleanup", // has a subgroup with text input
"copy edit" // has a subgroup with text input
],
"Potentially unwanted content": [
"close paraphrasing",
"copypaste", // has a subgroup with text input
"external links",
"non-free"
Baris 924 ⟶ 1.186:
],
"Fiction-related cleanup": [
"
"fiction",
"in-universe",
Baris 932 ⟶ 1.194:
"General content issues": {
"Importance and notability": [
"notability" // has
],
"Style of writing": [
Baris 938 ⟶ 1.200:
"essay-like",
"fansite",
"news release",
"prose",
"technical",
Baris 955 ⟶ 1.218:
],
"Timeliness": [
"update"
],
Baris 963 ⟶ 1.225:
"disputed",
"hoax",
"globalize", // has
"overcoverage",
"peacock",
Baris 986 ⟶ 1.248:
"Specific content issues": {
"Language": [
"not English", // has a subgroup with several options
"rough translation", // has a subgroup with several options
"expand language"
],
Baris 1.003 ⟶ 1.265:
],
"Categories": [
"
"uncategorized"
]
},
"Merging": [ // these three have a subgroup with several options
"merge",
"merge from",
Baris 1.025 ⟶ 1.287:
{
label: '{{R from abbreviation}}: redirect from a title with an abbreviation',
value: 'R from abbreviation'
},
{
label: '{{R to list entry}}: redirect to a \"list of minor entities\"-type article which contains brief descriptions of subjects not notable enough to have separate articles',
value: 'R to list entry'
},
{
label: '{{R to section}}: similar to {{R to list entry}}, but when list is organized in sections, such as list of characters in a fictional universe.',
value: 'R to section'
},
{
label: '{{R from misspelling}}: redirect from a misspelling or typographical error',
value: 'R from misspelling'
},
{
label: '{{R from alternative spelling}}: redirect from a title with a different spelling',
value: 'R from alternative spelling'
},
{
label: '{{R from plural}}: redirect from a plural word to the singular equivalent',
value: 'R from plural'
},
{
label: '{{R from related word}}: redirect from a related word',
value: 'R from related word'
},
{
label: '{{R with possibilities}}: redirect from a more specific title to a more general, less detailed article, hence something which can and should be expanded',
value: 'R with possibilities'
},
{
label: '{{R from member}}: redirect from a member of a group to a related topic such as the group, organization, or team that he or she belongs to',
value: 'R from member'
},
{
Baris 1.068 ⟶ 1.330:
{
label: '{{R from alternative name}}: redirect from a title that is another name, a pseudonym, a nickname, or a synonym',
value: 'R from alternative name'
},
{
label: '{{R from full name}}: redirect from a title that is a complete or more complete name',
value: 'R from full name'
},
{
label: '{{R from surname}}: redirect from a title that is a surname',
value: 'R from surname'
},
{
label: '{{R from historic name}}: redirect from another name with a significant historic past as a region, state, city or such, but which is no longer known by that title or name',
value: 'R from historic name'
},
{
label: '{{R from phrase}}: redirect from a phrase to a more general relevant article covering the topic',
value: 'R from phrase'
},
{
label: '{{R from scientific name}}: redirect from the scientific name to the common name',
value: 'R from scientific name'
},
{
label: '{{R to scientific name}}: redirect from the common name to the scientific name',
value: 'R to scientific name'
},
{
label: '{{R from name and country}}: redirect from the specific name to the briefer name',
value: 'R from name and country'
},
{
label: '{{R from alternative language}}: redirect from an English name to a name in another language, or vice-versa',
value: 'R from alternative language'
},
{
label: '{{R from ASCII}}: redirect from a title in basic ASCII to the formal article title, with differences that are not diacritical marks (accents, umlauts, etc.)',
value: 'R from ASCII'
},
{
Baris 1.111 ⟶ 1.377:
{
label: '{{R from merge}}: redirect from a merged page in order to preserve its edit history',
value: 'R from merge'
},
{
label: '{{R to disambiguation page}}: redirect to a disambiguation page',
value: 'R to disambiguation page'
},
{
label: '{{R from duplicated article}}: redirect to a similar article in order to preserve its edit history',
value: 'R from duplicated article'
},
{
label: '{{R to decade}}: redirect from a year to the decade article',
value: 'R to decade'
},
{
label: '{{R from shortcut}}: redirect from a Wikipedia shortcut',
value: 'R from shortcut'
},
{
label: '{{R from CamelCase}}: redirect from a CamelCase title',
value: 'R from CamelCase'
},
{
label: '{{R from EXIF}}: redirect of a wikilink created from JPEG EXIF information (i.e. the \"metadata\" section on some image description pages)',
value: 'R from EXIF'
},
{
Baris 1.150 ⟶ 1.416:
{ label: '{{Bsr}}: source info consists of bare image URL/generic base URL only', value: 'Bsr' },
{ label: '{{Non-free reduce}}: non-low-resolution fair use image (or too-long audio clip, etc)', value: 'Non-free reduce' },
{ label: '{{Orphaned non-free revisions}}: fair use media with old revisions that need to be deleted', value: 'subst:orfurrev' }
];
Baris 1.225 ⟶ 1.490:
// Contains those article tags that *do not* work inside {{multiple issues}}.
Twinkle.tag.multipleIssuesExceptions = [
'copypaste',
'expand language',
'GOCEinuse',
'improve categories',
'in use',
'merge',
Baris 1.237 ⟶ 1.502:
'rough translation',
'uncategorized',
'under construction'
];
Baris 1.249 ⟶ 1.513:
// Remove tags that become superfluous with this action
var pageText = pageobj.getPageText().replace(/\{\{\s*(
var addTag = function friendlytagAddTag( tagIndex, tagName ) {
var currentTag = "";
if( tagName === 'uncategorized' || tagName === '
pageText += '\n\n{{' + tagName +
'|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}';
} else {
if( tagName === 'globalize' ) {
currentTag += '{{' + params.
} else {
currentTag += ( Twinkle.tag.mode === 'redirect' ? '\n' : '' ) + '{{' + tagName;
}
if( tagName === 'notability' && params.
currentTag += '|' + params.
}
Baris 1.270 ⟶ 1.534:
switch( tagName ) {
case 'cleanup':
if (params.tagParameters.cleanup) {
currentTag += '|reason=' + params.tagParameters.cleanup;
}
break;
case 'copy edit':
if (params.tagParameters.copyEdit) {
currentTag += '|for=' + params.tagParameters.copyEdit;
}
break;
case 'copypaste':
if (params.tagParameters.copypaste) {
}
break;
Baris 1.315 ⟶ 1.566:
currentTag += '|otherarticle=' + otherart;
}
break;
case 'expert-subject':
if (params.tagParameters.expertSubject) {
currentTag += '|1=' + params.tagParameters.expertSubject;
}
break;
case 'news release':
currentTag += '|1=article';
break;
case 'not English':
case 'rough translation':
if (params.translationLanguage) {
currentTag += '|1=' + params.translationLanguage;
}
if (params.translationPostAtPNT) {
currentTag += '|listed=yes';
}
break;
Baris 1.346 ⟶ 1.587:
case 'merge to':
case 'merge from':
if (params.mergeTarget) {
// normalize the merge target for now and later
params.mergeTarget = Morebits.string.toUpperCaseFirstChar(params.mergeTarget.replace(/_/g, ' '));
// link to the correct section on the talk page, for article space only
if (mw.config.get('wgNamespaceNumber') === 0 && (params.mergeReason || params.discussArticle)) {
if (!params.discussArticle) {
// discussArticle is the article whose talk page will contain the discussion
params.discussArticle = (tagName === "merge to" ? params.mergeTarget : mw.config.get('wgTitle'));
// nonDiscussArticle is the article which won't have the discussion
params.nonDiscussArticle = (tagName === "merge to" ? mw.config.get('wgTitle') : params.mergeTarget);
params.talkDiscussionTitle = 'Proposed merge with ' + params.nonDiscussArticle;
}
currentTag += '|discuss=Talk:' + params.discussArticle + '#' + params.talkDiscussionTitle;
}
}
break;
Baris 1.373 ⟶ 1.624:
summaryText += ' {{[[';
if( tagName === 'globalize' ) {
summaryText += "Template:" + params.
} else {
summaryText += (tagName.indexOf(":") !== -1 ? tagName : ("Template:" + tagName + "|" + tagName));
Baris 1.393 ⟶ 1.644:
Morebits.status.warn( 'Info', 'Found {{' + params.tags[i] +
'}} on the article already...excluding' );
// don't do anything else with merge tags
if (params.tags[i] === "merge" || params.tags[i] === "merge from" ||
params.tags[i] === "merge to") {
params.mergeTarget = params.mergeReason = params.mergeTagOther = false;
}
}
}
Baris 1.482 ⟶ 1.738:
pageobj.setMinorEdit(Twinkle.getFriendlyPref('markTaggedPagesAsMinor'));
pageobj.setCreateOption('nocreate');
pageobj.save(function()
// special functions for merge tags
if (params.mergeReason) {
// post the rationale on the talk page (only operates in main namespace)
var talkpageText = "\n\n== Proposed merge with [[" + params.nonDiscussArticle + "]] ==\n\n";
talkpageText += params.mergeReason.trim() + " ~~~~";
var talkpage = new Morebits.wiki.page("Talk:" + params.discussArticle, "Posting rationale on talk page");
talkpage.setAppendText(talkpageText);
talkpage.setEditSummary('Proposing to merge [[' + params.nonDiscussArticle + ']] ' +
(tags.indexOf("merge") !== -1 ? 'with' : 'into') + ' [[' + params.discussArticle + ']]' +
Twinkle.getPref('summaryAd'));
talkpage.setWatchlist(Twinkle.getFriendlyPref('watchMergeDiscussions'));
talkpage.setCreateOption('recreate');
talkpage.append();
}
if (params.mergeTagOther) {
// tag the target page if requested
var otherTagName = "merge";
if (tags.indexOf("merge from") !== -1) {
otherTagName = "merge to";
} else if (tags.indexOf("merge to") !== -1) {
otherTagName = "merge from";
}
var newParams = {
tags: [otherTagName],
mergeTarget: Morebits.pageNameNorm,
discussArticle: params.discussArticle,
talkDiscussionTitle: params.talkDiscussionTitle
};
var otherpage = new Morebits.wiki.page(params.mergeTarget, "Tagging other page (" +
params.mergeTarget + ")");
otherpage.setCallbackParameters(newParams);
otherpage.load(Twinkle.tag.callbacks.main);
}
// post at WP:PNT for {{not English}} and {{rough translation}} tag
if (params.translationPostAtPNT) {
var pntPage = new Morebits.wiki.page('Wikipedia:Pages needing translation into English',
"Listing article at Wikipedia:Pages needing translation into English");
pntPage.setFollowRedirect(true);
pntPage.setCallbackParameters({
template: params.tags.indexOf("rough translation") !== -1 ? "duflu" : "needtrans",
lang: params.translationLanguage,
reason: params.translationComments
});
pntPage.load(Twinkle.tag.callbacks.translationListPage);
}
if (params.translationNotify) {
pageobj.lookupCreator(function(innerPageobj) {
var initialContrib = innerPageobj.getCreator();
// Disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
innerPageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
return;
}
var userTalkPage = new Morebits.wiki.page('User talk:' + initialContrib,
'Notifying initial contributor (' + initialContrib + ')');
var notifytext = "\n\n== Your article [[" + Morebits.pageNameNorm + "]]==\n" +
"{{subst:uw-notenglish|1=" + Morebits.pageNameNorm +
(params.translationPostAtPNT ? "" : "|nopnt=yes") + "}} ~~~~";
userTalkPage.setAppendText(notifytext);
userTalkPage.setEditSummary("Notice: Please use English when contributing to the English Wikipedia." +
Twinkle.getPref('summaryAd'));
userTalkPage.setCreateOption('recreate');
userTalkPage.setFollowRedirect(true);
userTalkPage.append();
});
}
});
if( params.patrol ) {
pageobj.patrol();
}
},
translationListPage: function friendlytagCallbacksTranslationListPage(pageobj) {
var old_text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
var statelem = pageobj.getStatusElement();
var templateText = "{{subst:" + params.template + "|pg=" + Morebits.pageNameNorm + "|Language=" +
(params.lang || "uncertain") + "|Comments=" + params.reason.trim() + "}} ~~~~";
var text, summary;
if (params.template === "duflu") {
text = old_text + "\n\n" + templateText;
summary = "Translation cleanup requested on ";
} else {
text = old_text.replace(/\n+(==\s?Translated pages that could still use some cleanup\s?==)/,
"\n\n" + templateText + "\n\n$1");
summary = "Translation" + (params.lang ? (" from " + params.lang) : "") + " requested on ";
}
if (text === old_text) {
statelem.error('failed to find target spot for the discussion');
return;
}
pageobj.setPageText(text);
pageobj.setEditSummary(summary + " [[" + Morebits.pageNameNorm + "]]" + Twinkle.getPref('summaryAd'));
pageobj.setCreateOption('recreate');
pageobj.save();
},
Baris 1.585 ⟶ 1.940:
}
break;
case "
//remove {{non-free reduce}} and redirects
text = text.replace(/\{\{\s*(Template\s*:\s*)?(Non-free reduce|FairUseReduce|Fairusereduce|Fair Use Reduce|Fair use reduce|Reduce size|Reduce|Fair-use reduce|Image-toobig|Comic-ovrsize-img|Non-free-reduce|Nfr|Smaller image|Nonfree reduce)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
Baris 1.624 ⟶ 1.979:
pageobj.save();
if( params.patrol ) {
pageobj.patrol();
}
Baris 1.633 ⟶ 1.988:
var form = e.target;
var params = {};
if (form.patrolPage) {
params.patrol = form.patrolPage.checked;
}
switch (Twinkle.tag.mode) {
Baris 1.638 ⟶ 1.996:
params.tags = form.getChecked( 'articleTags' );
params.group = form.group.checked;
params.tagParameters = {
copyEdit: form["articleTags.copyEdit"] ? form["articleTags.copyEdit"].value : null,
copypaste: form["articleTags.copypaste"] ? form["articleTags.copypaste"].value : null,
expertSubject: form["articleTags.expertSubject"] ? form["articleTags.expertSubject"].value : null,
globalize: form["articleTags.globalize"] ? form["articleTags.globalize"].value : null,
notability: form["articleTags.notability"] ? form["articleTags.notability"].value : null
};
// common to {{merge}}, {{merge from}}, {{merge to}}
params.mergeTarget = form["articleTags.mergeTarget"] ? form["articleTags.mergeTarget"].value : null;
params.mergeReason = form["articleTags.mergeReason"] ? form["articleTags.mergeReason"].value : null;
params.mergeTagOther = form["articleTags.mergeTagOther"] ? form["articleTags.mergeTagOther"].checked : false;
// common to {{not English}}, {{rough translation}}
params.translationLanguage = form["articleTags.translationLanguage"] ? form["articleTags.translationLanguage"].value : null;
params.translationNotify = form["articleTags.translationNotify"] ? form["articleTags.translationNotify"].checked : null;
params.translationPostAtPNT = form["articleTags.translationPostAtPNT"] ? form["articleTags.translationPostAtPNT"].checked : null;
params.translationComments = form["articleTags.translationComments"] ? form["articleTags.translationComments"].value : null;
break;
case 'file':
Baris 1.653 ⟶ 2.026:
}
// form validation
if( !params.tags.length ) {
alert( 'You must select at least one tag!' );
return;
}
if( ((params.tags.indexOf("merge") !== -1) + (params.tags.indexOf("merge from") !== -1) +
(params.tags.indexOf("merge to") !== -1)) > 1 ) {
alert( 'Please select only one of {{merge}}, {{merge from}}, and {{merge to}}. If several merges are required, use {{merge}} and separate the article names with pipes (although in this case Twinkle cannot tag the other articles automatically).' );
return;
}
if( (params.tags.indexOf("not English") !== -1) && (params.tags.indexOf("rough translation") !== -1) ) {
alert( 'Please select only one of {{not English}} and {{rough translation}}.' );
return;
}
if( (params.mergeTagOther || params.mergeReason) && params.mergeTarget.indexOf('|') !== -1 ) {
alert( 'Tagging multiple articles in a merge, and starting a discussion for multiple articles, is not supported at the moment. Please turn off "tag other article", and/or clear out the "reason" box, and try again.' );
return;
}
if( params.tags.indexOf('cleanup') !== -1 && params.tagParameters.cleanup.trim && params.tagParameters.cleanup.trim() === "") {
alert( 'You must specify a reason for the {{cleanup}} tag.' );
return;
}
Baris 1.661 ⟶ 2.052:
Morebits.status.init( form );
Morebits.wiki.actionCompleted.redirect =
Morebits.wiki.actionCompleted.notice = "Tagging complete, reloading article in a few seconds";
if (Twinkle.tag.mode === 'redirect') {
Baris 1.667 ⟶ 2.058:
}
var wikipedia_page = new Morebits.wiki.page(
wikipedia_page.setCallbackParameters(params);
switch (Twinkle.tag.mode) {
Baris 1.683 ⟶ 2.074:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 1.692 ⟶ 2.093:
* Config directives in: FriendlyConfig
*/
if ( !mw.config.get('wgRelevantUserName') ) {
}
Twinkle.addPortletLink( Twinkle.talkback.callback, "TB", "friendly-talkback", "Easy talkback" );
};
Twinkle.talkback.callback = function( ) {
if( mw.config.get('wgRelevantUserName') === mw.config.get("wgUserName") && !confirm("Is it really so bad that you're talking back to yourself?") ){
return;
}
var Window = new Morebits.simpleWindow( 600, 350 );
Window.setTitle("Talkback");
Window.setScriptName("Twinkle");
Window.addFooterLink( "About {{talkback}}", "Template:Talkback" );
Window.addFooterLink( "Twinkle help", "WP:TW/DOC#talkback" );
var form = new Morebits.quickForm( callback_evaluate );
form.append({ type: "radio", name: "tbtarget",
list: [
{
label: "Talkback: my talk page",
value: "mytalk",
checked: "true"
},
{
label: "Talkback: other user talk page",
value: "usertalk"
},
{
label: "Talkback: other page",
value: "other"
},
{
label: "\"Please see\"",
value: "see"
},
{
label: "Noticeboard notification",
value: "notice"
},
{
label: "\"You've got mail\"",
value: "mail"
}
],
event: callback_change_target
});
form.append({
type: "field",
label: "Work area",
name: "work_area"
});
form.append({ type: "submit" });
var result = form.render();
Window.setContent( result );
Window.display();
// We must init the
var evt = document.createEvent("Event");
evt.initEvent( "change", true, true );
result.tbtarget[0].dispatchEvent( evt );
// Check whether the user has opted out from talkback
// TODO: wgCategories is only set on action=view (bug 45033)
var wgcat = mw.config.get("wgCategories");
if (wgcat.length && wgcat.indexOf("Users who do not wish to receive talkbacks") === -1) {
Twinkle.talkback.optout = false;
} else {
var query = {
action: 'query',
prop: 'extlinks',
titles: mw.config.get('wgPageName'),
elquery: 'userjs.invalid/noTalkback',
ellimit: '1'
};
var wpapi = new Morebits.wiki.api("Fetching talkback opt-out status", query, Twinkle.talkback.callback.optoutStatus);
wpapi.post();
}
};
Twinkle.talkback.optout = null;
Twinkle.talkback.callback.optoutStatus = function(apiobj) {
var xml = apiobj.getXML();
var $el = $(xml).find('el');
if ($el.length) {
Twinkle.talkback.optout = mw.config.get('wgRelevantUserName') + " prefers not to receive talkbacks";
var url = $el.text();
if (url.indexOf("reason=") > -1) {
Twinkle.talkback.optout += ": " + decodeURIComponent(url.substring(url.indexOf("reason=") + 7)) + ".";
} else {
Twinkle.talkback.optout += ".";
}
} else {
Twinkle.talkback.optout = false;
}
var $status = $("#twinkle-talkback-optout-message");
if ($status.length) {
$status.append(Twinkle.talkback.optout);
};
var prev_page = "";
var prev_section = "";
var prev_message = "";
var callback_change_target = function( e ) {
var value = e.target.values;
var root = e.target.form;
var old_area = Morebits.quickForm.getElements(root, "work_area")[0];
if(root.section) {
prev_section = root.section.value;
}
if(root.message) {
prev_message = root.message.value;
}
if(root.page) {
prev_page = root.page.value;
}
var work_area = new Morebits.quickForm.element({
label: "Talkback information",
name: "work_area"
});
switch( value ) {
case "mytalk":
/* falls through */
default:
work_area.append({
type: "div",
label: "",
style: "color: red",
id: "twinkle-talkback-optout-message"
});
work_area.append({
type:"input",
name:"section",
label:"Linked section (optional)",
tooltip:"The section heading on your talk page where you left a message. Leave empty for no section to be linked.",
value: prev_section
});
break;
case "usertalk":
work_area.append({
type: "div",
label: "",
style: "color: red",
id: "twinkle-talkback-optout-message"
});
work_area.append({
type:"input",
name:"page",
label:"User",
tooltip:"The username of the user on whose talk page you left a message.",
value: prev_page
});
work_area.append({
type:"input",
name:"section",
label:"Linked section (optional)",
tooltip:"The section heading on the page where you left a message. Leave empty for no section to be linked.",
value: prev_section
});
break;
case "notice":
var noticeboard = work_area.append({
type: "select",
name: "noticeboard",
label: "Noticeboard:",
event: function(e) {
if (e.target.value === "afchd") {
Morebits.quickForm.overrideElementLabel(e.target.form.section, "Title of draft (excluding the prefix): ");
Morebits.quickForm.setElementTooltipVisibility(e.target.form.section, false);
} else {
Morebits.quickForm.resetElementLabel(e.target.form.section);
Morebits.quickForm.setElementTooltipVisibility(e.target.form.section, true);
}
});
noticeboard.append({
type: "option",
label: "WP:AN (Administrators' noticeboard)",
});
noticeboard.append({
type: "option",
label: "WP:AN3 (Administrators' noticeboard/Edit warring)",
value: "an3"
});
noticeboard.append({
type: "option",
label: "WP:ANI (Administrators' noticeboard/Incidents)",
selected: true,
value: "ani"
});
// let's keep AN and its cousins at the top
noticeboard.append({
type: "option",
label: "WP:AFCHD (Articles for creation/Help desk)",
value: "afchd"
});
noticeboard.append({
type: "option",
label: "WP:COIN (Conflict of interest noticeboard)",
value: "coin"
});
noticeboard.append({
type: "option",
label: "WP:DRN (Dispute resolution noticeboard)",
value: "drn"
});
noticeboard.append({
type: "option",
label: "WP:HD (Help desk)",
value: "hd"
});
noticeboard.append({
type: "option",
label: "WP:OTRS/N (OTRS noticeboard)",
value: "otrs"
});
noticeboard.append({
type: "option",
label: "WP:THQ (Teahouse question forum)",
value: "th"
});
work_area.append({
type:"input",
name:"section",
label:"Linked thread",
tooltip:"The heading of the relevant thread on the noticeboard page.",
value: prev_section
});
break;
case "other":
work_area.append({
type: "div",
label: "",
style: "color: red",
id: "twinkle-talkback-optout-message"
});
work_area.append({
name:"page",
label:"Full page name",
tooltip:"The full page name where you left the message. For example: 'Wikipedia talk:Twinkle'.",
value: prev_page
});
work_area.append({
type:"input",
name:"section",
label:"Linked section (optional)",
tooltip:"The section heading on the page where you left a message. Leave empty for no section to be linked.",
value: prev_section
});
break;
case "mail":
work_area.append({
type:"input",
name:"section",
label:"Subject of email (optional)",
tooltip:"The subject line of the email you sent."
});
break;
case "see":
work_area.append({
type:"input",
name:"page",
tooltip:"The full page name of where the discussion is being held. For example: 'Wikipedia talk:Twinkle'.",
value: prev_page
});
work_area.append({
type:"input",
name:"section",
label:"Linked section (optional)",
tooltip:"The section heading where the discussion is being held. For example: 'Merge proposal'.",
value: prev_section
});
break;
}
if (value !== "notice") {
work_area.append({ type:"textarea", label:"Additional message (optional):", name:"message", tooltip:"An additional message that you would like to leave below the talkback template. Your signature will be added to the end of the message if you leave one." });
}
work_area = work_area.render();
root.replaceChild( work_area, old_area );
if (root.message) {
root.message.value = prev_message;
}
if (Twinkle.talkback.optout) {
$("#twinkle-talkback-optout-message").append(Twinkle.talkback.optout);
}
};
var callback_evaluate = function( e ) {
var tbtarget = e.target.getChecked( "tbtarget" )[0];
var page = null;
var section = e.target.section.value;
var fullUserTalkPageName = mw.config.get("wgFormattedNamespaces")[ mw.config.get("wgNamespaceIds").user_talk ] + ":" + mw.config.get('wgRelevantUserName');
if( tbtarget === "usertalk" || tbtarget === "other" || tbtarget === "see" ) {
page = e.target.page.value;
if( tbtarget === "usertalk" ) {
if( !page ) {
alert("You must specify the username of the user whose talk page you left a message on.");
return;
}
} else {
if( !page ) {
alert("You must specify the full page name when your message is not on a user talk page.");
return;
}
}
} else if (tbtarget === "notice") {
page = e.target.noticeboard.value;
}
var message;
if (e.target.message) {
message = e.target.message.value;
}
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( e.target );
Morebits.wiki.actionCompleted.redirect = fullUserTalkPageName;
Morebits.wiki.actionCompleted.notice = "Talkback complete; reloading talk page in a few seconds";
var talkpage = new Morebits.wiki.page(fullUserTalkPageName, "Adding talkback");
var tbPageName = (tbtarget === "mytalk") ? mw.config.get("wgUserName") : page;
var text;
if ( tbtarget === "notice" ) {
switch (page) {
case "afchd":
text += "\n\n{{subst:AFCHD/u|" + section + "}} ~~~~";
talkpage.setEditSummary( "You have replies at the [[Wikipedia:AFCHD|Articles for Creation Help Desk]]" + Twinkle.getPref("summaryAd") );
break;
case "
text = "\n\n== " + Twinkle.getFriendlyPref("adminNoticeHeading") + " ==\n";
text += "{{subst:ANI-notice|thread=" + section + "|noticeboard=Wikipedia:Administrators' noticeboard}} ~~~~";
talkpage.setEditSummary( "Notice of discussion at [[Wikipedia:Administrators' noticeboard]]" + Twinkle.getPref("summaryAd") );
break;
case "
text = "\n\n{{subst:An3-notice|" + section + "}} ~~~~";
talkpage.setEditSummary( "Notice of discussion at [[Wikipedia:Administrators' noticeboard/Edit warring]]" + Twinkle.getPref("summaryAd") );
break;
case "
text = "\n\n== " + Twinkle.getFriendlyPref("adminNoticeHeading") + " ==\n";
text += "{{subst:ANI-notice|thread=" + section + "|noticeboard=Wikipedia:Administrators' noticeboard/Incidents}} ~~~~";
talkpage.setEditSummary( "Notice of discussion at [[Wikipedia:Administrators' noticeboard/Incidents]]" + Twinkle.getPref("summaryAd") );
break;
case "
text = "\n\n{{subst:Coin-notice|thread=" + section + "}} ~~~~";
talkpage.setEditSummary( "Notice of discussion at [[Wikipedia:Conflict of interest noticeboard]]" + Twinkle.getPref("summaryAd") );
break;
case "drn":
text = "\n\n{{subst:DRN-notice|thread=" + section + "}} ~~~~";
talkpage.setEditSummary( "Notice of discussion at [[Wikipedia:Dispute resolution noticeboard]]" + Twinkle.getPref("summaryAd") );
break;
case "hd":
text = "\n\n== Your question at the Help desk ==\n";
text += "{{helpdeskreply|1=" + section + "|ts=~~~~~}}";
talkpage.setEditSummary( "You have replies at the [[Wikipedia:Help desk|Wikipedia help desk]]" + Twinkle.getPref("summaryAd") );
break;
case "otrs":
text = "\n\n{{OTRSreply|1=" + section + "|2=~~~~}}";
talkpage.setEditSummary( "You have replies at the [[Wikipedia:OTRS noticeboard|OTRS noticeboard]]" + Twinkle.getPref("summaryAd") );
break;
case "th":
text = "\n\n== Teahouse talkback: you've got messages! ==\n{{WP:Teahouse/Teahouse talkback|WP:Teahouse/Questions|" + section + "|ts=~~~~}}";
talkpage.setEditSummary( "You have replies at the [[Wikipedia:Teahouse/Questions|Teahouse question board]]" + Twinkle.getPref("summaryAd") );
break;
default:
throw "Twinkle.talkback, function callback_evaluate: default case reached";
}
text = "\n\n==" + Twinkle.getFriendlyPref("mailHeading") + "==\n{{you've got mail|subject=";
text += section + "|ts=~~~~~}}";
if( message ) {
text += "\n" + message.trim() + " ~~~~";
} else if( Twinkle.getFriendlyPref("insertTalkbackSignature") ) {
text += "\n~~~~";
}
talkpage.setEditSummary("Notification: You've got mail" + Twinkle.getPref("summaryAd"));
} else if ( tbtarget === "see" ) {
text = "\n\n{{subst:Please see|location=" + tbPageName;
if (
text += "#" + section;
}
text += "|more=" + message.trim() + "}}";
talkpage.setEditSummary("Please check the discussion at [[" + tbPageName + "#" + section + "]]" + Twinkle.getPref("summaryAd"));
} else {
//clean talkback heading: strip section header markers, were erroneously suggested in the documentation
text = "\n\n==" + Twinkle.getFriendlyPref("talkbackHeading").replace( /^\s*=+\s*(.*?)\s*=+$\s*/, "$1" ) + "==\n{{talkback|";
text += tbPageName;
if( section ) {
text += "|" + section;
}
text += "|ts=~~~~~}}";
text += "\n" + message.trim() + " ~~~~";
} else if( Twinkle.getFriendlyPref("insertTalkbackSignature") ) {
text += "\n~~~~";
}
(section ? ("#" + section) : "") + "]])" + Twinkle.getPref("summaryAd"));
}
talkpage.setAppendText( text );
talkpage.setCreateOption("recreate");
talkpage.setFollowRedirect( true );
talkpage.append();
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 2.082 ⟶ 2.609:
var oWelcomeNode = welcomeNode.cloneNode( true );
oWelcomeNode.firstChild.setAttribute( 'href', oHref + '&' + Morebits.queryString.create( {
'friendlywelcome': Twinkle.getFriendlyPref('quickWelcomeMode') === 'auto' ? 'auto': 'norm' 'vanarticle': } ) ); $oList[0].parentNode.parentNode.appendChild( document.createTextNode( ' ' ) );
$oList[0].parentNode.parentNode.appendChild( oWelcomeNode );
Baris 2.091 ⟶ 2.621:
var nWelcomeNode = welcomeNode.cloneNode( true );
nWelcomeNode.firstChild.setAttribute( 'href', nHref + '&' + Morebits.queryString.create( {
'friendlywelcome': Twinkle.getFriendlyPref('quickWelcomeMode') === 'auto' ? 'auto': 'norm' 'vanarticle': } ) ); $nList[0].parentNode.parentNode.appendChild( document.createTextNode( ' ' ) );
$nList[0].parentNode.parentNode.appendChild( nWelcomeNode );
Baris 2.099 ⟶ 2.632:
if( mw.config.get( 'wgNamespaceNumber' ) === 3 ) {
var username = mw.config.get( 'wgTitle' ).split( '/' )[0].replace( /\"/, "\\\""); // only first part before any slashes
}
};
Twinkle.welcome.welcomeUser = function welcomeUser() {
Morebits.status.init( document.getElementById('
$( '#catlinks' ).remove();
var params = {
Baris 2.130 ⟶ 2.664:
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "Welcoming Committee", "WP:WC" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.welcome.callback.evaluate );
Baris 2.147 ⟶ 2.681:
});
form.append( {
type: 'div', id: 'welcomeWorkArea' className: 'morebits-scrollbox'
} );
form.append( {
Baris 2.179 ⟶ 2.717:
Twinkle.welcome.populateWelcomeList = function(e) {
var type = e.target.value;
var
if ((type === "standard" || type === "anonymous") && Twinkle.getFriendlyPref("customWelcomeList").length) {
type: 'radio',
name: 'template',
Baris 2.197 ⟶ 2.731:
var appendTemplates = function(list) {
type: 'radio',
name: 'template',
list: list.map(function(obj) {
var properties = Twinkle.welcome.templates[obj];
var result = (properties ? {
value: obj,
label: "{{" + obj + "}}: " + properties.description + (properties.linkedArticle ? "\u00A0*" : ""), // U+00A0 NO-BREAK SPACE
Baris 2.218 ⟶ 2.752:
switch (type) {
case "standard":
appendTemplates([
"welcome",
Baris 2.228 ⟶ 2.762:
"welcome-belated",
"welcome student",
"welcome teacher",
"welcome non-latin"
]);
appendTemplates([
"welcomelaws",
"first article",
"welcometest",
"welcomevandal",
"welcomenpov",
Baris 2.240 ⟶ 2.776:
"welcomeauto",
"welcome-COI",
"welcome-delete",
"welcome-image"
]);
break;
case "anonymous":
appendTemplates([
"welcome-anon",
"welcome-anon-border",
"welcome-anon-test",
"welcome-anon-
"welcome-anon-constructive",
"welcome-anon-delete"
]);
break;
case "wikiProject":
appendTemplates([
"welcome-au",
"welcome-bd",
"welcome-bio",
"welcome-cal",
Baris 2.263 ⟶ 2.802:
"welcome-dbz",
"welcome-et",
"welcome-de",
"welcome-in",
"welcome-math",
"welcome-med",
Baris 2.277 ⟶ 2.816:
"welcome-ch",
"welcome-uk",
"welcome-videogames",
"TWA invite"
]);
break;
case "nonEnglish":
appendTemplates([
"welcomeen-sq",
"welcomeen-ar",
"welcomeen-zh",
"welcomeen-nl",
Baris 2.303 ⟶ 2.844:
break;
default:
break;
}
var rendered =
$(e.target.form).find("div#welcomeWorkArea").empty().append(rendered);
var firstRadio = e.target.form.template[0];
Baris 2.331 ⟶ 2.871:
Twinkle.welcome.templates = {
// GENERAL WELCOMES
"welcome": {
description: "standard welcome",
Baris 2.354 ⟶ 2.896:
description: "welcome message with large table of about 60 links",
linkedArticle: false,
syntax: "
},
"welcome-screen": {
description: "welcome message with clear, annotated table of 10 links",
linkedArticle: false,
syntax: "$HEADER$ {{subst:welcome-screen|static=true}}"
},
"welcome-belated": {
Baris 2.376 ⟶ 2.918:
syntax: "$HEADER$ {{subst:welcome teacher|$USERNAME$}} ~~~~"
},
"welcome non-latin": {
description: "welcome for users with a username containing non-Latin characters",
linkedArticle: false,
syntax: "{{subst:welcome non-latin|$USERNAME$}} ~~~~"
},
// PROBLEM USER WELCOMES
"welcomelaws": {
description: "welcome with information about copyrights, NPOV, the sandbox, and vandalism",
Baris 2.385 ⟶ 2.935:
linkedArticle: true,
syntax: "{{subst:first article|$ARTICLE$|$USERNAME$}}"
},
"welcometest": {
description: "for someone whose initial efforts appear to be tests",
linkedArticle: true,
syntax: "{{subst:welcometest|$ARTICLE$|$USERNAME$}} ~~~~"
},
"welcomevandal": {
Baris 2.415 ⟶ 2.970:
linkedArticle: true,
syntax: "{{subst:welcome-COI|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-delete": {
description: "for someone who has been removing information from articles",
linkedArticle: true,
syntax: "{{subst:welcome-delete|$ARTICLE$|$USERNAME$}} ~~~~"
},
"welcome-image": {
description: "welcome with additional information about images (policy and procedure)",
linkedArticle: true,
syntax: "{{subst:welcome-image|$USERNAME$|art=$ARTICLE$}}"
},
Baris 2.439 ⟶ 2.999:
syntax: "{{subst:welcome-anon-test|$ARTICLE$|$USERNAME$}} ~~~~"
},
"welcome-anon-
description: "for anonymous users who have vandalized
linkedArticle: true,
syntax: "{{subst:welcome-anon-
},
"welcome-anon-constructive": {
description: "for anonymous users who fight vandalism
linkedArticle: true,
syntax: "{{subst:welcome-anon-constructive|art=$ARTICLE$}}"
},
"welcome-anon-delete": {
description: "for anonymous users who have removed content from pages",
linkedArticle: true,
syntax: "{{subst:welcome-anon-delete|$ARTICLE$|$USERNAME$}} ~~~~"
},
Baris 2.456 ⟶ 3.021:
linkedArticle: false,
syntax: "{{subst:welcome-au}} ~~~~"
},
"welcome-bd": {
description: "welcome for users with an apparent interest in Bangladesh topics",
linkedArticle: true,
syntax: "{{subst:welcome-bd|$USERNAME$||$EXTRA$|art=$ARTICLE$}} ~~~~"
},
"welcome-bio": {
Baris 2.480 ⟶ 3.050:
description: "welcome for users with an apparent interest in Dragon Ball topics",
linkedArticle: false,
syntax: "{{subst:welcome-dbz|$EXTRA$|sig=~~~~}}"
},
"welcome-et": {
Baris 2.486 ⟶ 3.056:
linkedArticle: false,
syntax: "{{subst:welcome-et}}"
},
"welcome-de": {
Baris 2.496 ⟶ 3.061:
linkedArticle: false,
syntax: "{{subst:welcome-de}} ~~~~"
},
"welcome-in": {
description: "welcome for users with an apparent interest in India topics",
linkedArticle: true,
syntax: "{{subst:welcome-in|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-math": {
description: "welcome for users with an apparent interest in mathematical topics",
linkedArticle:
syntax: "{{subst:welcome-math|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-med": {
description: "welcome for users with an apparent interest in medicine topics",
linkedArticle:
syntax: "{{subst:welcome-med|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-no": {
Baris 2.514 ⟶ 3.084:
"welcome-pk": {
description: "welcome for users with an apparent interest in Pakistan topics",
linkedArticle:
syntax: "{{subst:welcome-pk|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-phys": {
description: "welcome for users with an apparent interest in physics topics",
linkedArticle:
syntax: "{{subst:welcome-phys|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-pl": {
Baris 2.544 ⟶ 3.114:
"welcome-ch": {
description: "welcome for users with an apparent interest in Switzerland topics",
linkedArticle:
syntax: "{{subst:welcome-ch|$USERNAME$|art=$ARTICLE$}} ~~~~"
},
"welcome-uk": {
Baris 2.561 ⟶ 3.131:
linkedArticle: false,
syntax: "{{subst:welcome-videogames}}"
},
"TWA invite": {
description: "invite the user to The Wikipedia Adventure (not a welcome template)",
linkedArticle: false,
syntax: "{{WP:TWA/Invite|signature=~~~~}}"
},
// NON-ENGLISH WELCOMES
"welcomeen-ar": {
description: "welcome for users whose first language appears to be Arabic",
linkedArticle: false,
syntax: "{{subst:welcomeen-ar}}"
},
"welcomeen-sq": {
description: "welcome for users whose first language appears to be Albanian",
Baris 2.661 ⟶ 3.241:
replace("$EXTRA$", ""); // EXTRA is not implemented yet
} else {
return "{{subst:" + template + (article ? ("|art=" + article) : "") + "}}" +
(Twinkle.getFriendlyPref("customWelcomeSignature") ? " ~~~~" : "");
}
Baris 2.740 ⟶ 3.320:
wikipedia_page.load(Twinkle.welcome.callbacks.main);
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 2.751 ⟶ 3.341:
Twinkle.arv = function twinklearv() {
var username = mw.config.get('wgRelevantUserName');
return;
}
Baris 2.759 ⟶ 3.348:
var title = Morebits.isIPAddress( username ) ? 'Report IP to administrators' : 'Report user to administrators';
};
Twinkle.arv.callback = function ( uid ) {
if ( uid === mw.config.get('wgUserName') ) {
alert( 'You don\'t want to report yourself, do you?' );
Baris 2.778 ⟶ 3.363:
Window.addFooterLink( "UAA instructions", "WP:UAAI" );
Window.addFooterLink( "About SPI", "WP:SPI" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.arv.callback.evaluate );
Baris 2.806 ⟶ 3.391:
label: 'Sockpuppet (WP:SPI)',
value: 'puppet'
} );
categories.append( {
type: 'option',
label: 'Edit warring (WP:AN3)',
value: 'an3'
} );
form.append( {
type: 'field',
label: 'Work area',
name: 'work_area'
} );
form.append( { type: 'submit' } );
form.append( {
type: 'hidden',
Baris 2.839 ⟶ 3.429:
/* falls through */
default:
work_area = new Morebits.quickForm.element( {
type: 'field',
label: 'Report user for vandalism',
Baris 2.886 ⟶ 3.476:
name: 'arvtype',
list: [
{
label: 'Vandalism after final (level 4 or 4im) warning given',
value: 'final'
},
{
label: 'Vandalism after recent (within 1 day) release of block',
value: 'postblock'
},
{
label: 'Evidently a vandalism-only account',
value: 'vandalonly',
disabled: Morebits.isIPAddress( root.uid.value )
},
{
label: 'Account is evidently a spambot or a compromised account',
value: 'spambot'
},
{
label: 'Account is a promotion-only account',
value: 'promoonly'
Baris 2.918 ⟶ 3.508:
break;
case 'username':
work_area = new Morebits.quickForm.element( {
type: 'field',
label: 'Report username violation',
name: 'work_area'
} );
work_area.append ( {
type: 'header',
label: 'Type(s) of inappropriate username',
tooltip: 'Wikipedia does not allow usernames that are misleading, promotional, offensive or disruptive. Domain names and
} );
work_area.append( {
Baris 2.937 ⟶ 3.527:
tooltip: 'Misleading usernames imply relevant, misleading things about the contributor. For example, misleading points of fact, an impression of undue authority, or the suggestion that the account is operated by a group, project or collective rather than one individual.'
},
{
label: 'Promotional username',
value: 'promotional',
tooltip: 'Promotional usernames are advertisements for a company, website or group. Please do not report these names to UAA unless the user has also made promotional edits related to the name.'
},
{
label: 'Offensive username',
value: 'offensive',
tooltip: 'Offensive usernames make harmonious editing difficult or impossible.'
},
{
label: 'Disruptive username',
value: 'disruptive',
Baris 2.964 ⟶ 3.554:
case 'puppet':
work_area = new Morebits.quickForm.element( {
type: 'field',
label: 'Report suspected sockpuppet',
Baris 3.002 ⟶ 3.592:
break;
case 'sock':
work_area = new Morebits.quickForm.element( {
type: 'field',
label: 'Report suspected sockpuppeteer',
Baris 3.015 ⟶ 3.605:
tooltip: 'The username of the sockpuppet without the User:-prefix',
min: 2
} );
work_area.append( {
type: 'textarea',
Baris 3.035 ⟶ 3.624:
} ]
} );
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
break;
case 'an3':
work_area = new Morebits.quickForm.element( {
type: 'field',
label: 'Report edit warring',
name: 'work_area'
} );
work_area.append( {
type: 'input',
name: 'page',
label: 'Page',
tooltip: 'The page being reported'
} );
work_area.append( {
type: 'button',
name: 'load',
label: 'Load',
event: function(e) {
var root = e.target.form;
var value = root.page.value;
var uid = root.uid.value;
var $diffs = $(root).find('[name=diffs]');
$diffs.find('.entry').remove();
var date = new Date();
date.setHours(-36); // all since 36 hours
var api = new mw.Api();
api.get({
action: 'query',
prop: 'revisions',
format: 'json',
rvprop: 'sha1|ids|timestamp|parsedcomment|comment',
rvlimit: 500,
rvend: date.toISOString(),
rvuser: uid,
indexpageids: true,
redirects: true,
titles: value
}).done(function(data){
var pageid = data.query.pageids[0];
var page = data.query.pages[pageid];
if(!page.revisions) {
return;
}
for(var i = 0; i < page.revisions.length; ++i) {
var rev = page.revisions[i];
var $entry = $('<div/>', {
'class': 'entry'
});
var $input = $('<input/>', {
'type': 'checkbox',
'name': 's_diffs',
'value': rev.revid
});
$input.data('revinfo',rev);
$input.appendTo($entry);
$entry.append('<span>"'+rev.parsedcomment+'" at <a href="'+mw.config.get('wgScript')+'?diff='+rev.revid+'">'+moment(rev.timestamp).calendar()+'</a></span>').appendTo($diffs);
}
}).fail(function(data){
console.log( 'API failed :(', data );
});
var $warnings = $(root).find('[name=warnings]');
$warnings.find('.entry').remove();
api.get({
action: 'query',
prop: 'revisions',
format: 'json',
rvprop: 'sha1|ids|timestamp|parsedcomment|comment',
rvlimit: 500,
rvend: date.toISOString(),
rvuser: mw.config.get('wgUserName'),
indexpageids: true,
redirects: true,
titles: 'User talk:' + uid
}).done(function(data){
var pageid = data.query.pageids[0];
var page = data.query.pages[pageid];
if(!page.revisions) {
return;
}
for(var i = 0; i < page.revisions.length; ++i) {
var rev = page.revisions[i];
var $entry = $('<div/>', {
'class': 'entry'
});
var $input = $('<input/>', {
'type': 'checkbox',
'name': 's_warnings',
'value': rev.revid
});
$input.data('revinfo',rev);
$input.appendTo($entry);
$entry.append('<span>"'+rev.parsedcomment+'" at <a href="'+mw.config.get('wgScript')+'?diff='+rev.revid+'">'+moment(rev.timestamp).calendar()+'</a></span>').appendTo($warnings);
}
}).fail(function(data){
console.log( 'API failed :(', data );
});
var $resolves = $(root).find('[name=resolves]');
$resolves.find('.entry').remove();
var t = new mw.Title(value);
var ns = t.getNamespaceId();
var talk_page = (new mw.Title(t.getMain(), ns%2? ns : ns+1)).getPrefixedText();
api.get({
action: 'query',
prop: 'revisions',
format: 'json',
rvprop: 'sha1|ids|timestamp|parsedcomment|comment',
rvlimit: 500,
rvend: date.toISOString(),
rvuser: mw.config.get('wgUserName'),
indexpageids: true,
redirects: true,
titles: talk_page
}).done(function(data){
var pageid = data.query.pageids[0];
var page = data.query.pages[pageid];
if(!page.revisions) {
return;
}
for(var i = 0; i < page.revisions.length; ++i) {
var rev = page.revisions[i];
var $entry = $('<div/>', {
'class': 'entry'
});
var $input = $('<input/>', {
'type': 'checkbox',
'name': 's_resolves',
'value': rev.revid
});
$input.data('revinfo',rev);
$input.appendTo($entry);
$entry.append('<span>"'+rev.parsedcomment+'" at <a href="'+mw.config.get('wgScript')+'?diff='+rev.revid+'">'+moment(rev.timestamp).calendar()+'</a></span>').appendTo($resolves);
}
// add free form input
var $free_entry = $('<div/>', {
'class': 'entry'
});
var $free_input = $('<input/>', {
'type': 'text',
'name': 's_resolves_free'
});
var $free_label = $('<label/>', {
'for': 's_resolves_free',
'html': 'Diff to additional discussions: '
});
$free_entry.append($free_label).append($free_input).appendTo($resolves);
}).fail(function(data){
console.log( 'API failed :(', data );
});
}
} );
work_area.append( {
type: 'field',
name: 'diffs',
label: 'User\'s reverts',
tooltip: 'Select the edits you believe are reverts'
} );
work_area.append( {
type: 'field',
name: 'warnings',
label: 'Warnings given to subject',
tooltip: 'You must have warned the subject before reporting'
} );
work_area.append( {
type: 'field',
name: 'resolves',
label: 'Resolution initiatives',
tooltip: 'You should have tried to resolve the issue on the talk page first'
} );
work_area.append( {
type: 'textarea',
label: 'Comment:',
name: 'comment'
} );
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 3.042 ⟶ 3.818:
Twinkle.arv.callback.evaluate = function(e) {
var form = e.target;
var reason = "";
Baris 3.088 ⟶ 3.863:
if ( form.badid.value !== '' ) {
reason += ' ({{diff|' + form.page.value + '|' + form.badid.value + '|' + form.goodid.value + '|diff}})';
}
Baris 3.104 ⟶ 3.874:
reason += (reason === "" ? "" : ". ") + comment;
}
reason
if (reason.search(/[.?!;]$/) === -1) {
reason += ".";
}
reason += " ~~~~";
reason = reason.replace(/\r?\n/g, "\n*:"); // indent newlines
Baris 3.122 ⟶ 3.896:
// check if user has already been reported
if (new RegExp( "\\{\\{\\s*(?:(?:[Ii][Pp])?[Vv]andal|[Uu]serlinks)\\s*\\|\\s*(?:1=)?\\s*" + RegExp.escape( uid, true ) + "\\s*\\}\\}" ).test(text)) {
aivPage.getStatusElement().
Morebits.status.printUserText( reason, 'The comments you typed are provided below, in case you wish to manually post them under the existing report for this user at AIV:' );
return;
}
Baris 3.172 ⟶ 3.947:
if (new RegExp( "\\{\\{\\s*user-uaa\\s*\\|\\s*(1\\s*=\\s*)?" + RegExp.escape(uid, true) + "\\s*(\\||\\})" ).test(text)) {
uaaPage.getStatusElement().error( 'User is already listed.' );
Morebits.status.printUserText( reason, 'The comments you typed are provided below, in case you wish to manually post them under the existing report for this user at UAA:' );
return;
}
Baris 3.186 ⟶ 3.962:
case "puppet":
var sockParameters = {
evidence: form.evidence.value.
checkuser: form.checkuser.checked,
notify: form.notify.checked
};
Baris 3.199 ⟶ 3.975:
}
sockParameters.uid = puppetReport ? form.sockmaster.value.
sockParameters.sockpuppets = puppetReport ? [uid] : $.map( $('input:text[name=sockpuppet]',form), function(o){ return $(o).val() || null; });
Morebits.simpleWindow.setButtonsEnabled( false );
Baris 3.207 ⟶ 3.983:
break;
case 'an3':
var diffs = $.map( $('input:checkbox[name=s_diffs]:checked',form), function(o){ return $(o).data('revinfo'); });
if (diffs.length < 3 && !confirm("You have selected fewer than three offending edits. Do you wish to make the report anyway?")) {
return;
}
var warnings = $.map( $('input:checkbox[name=s_warnings]:checked',form), function(o){ return $(o).data('revinfo'); });
if(!warnings.length && !confirm("You have not selected any edits where you warned the offender. Do you wish to make the report anyway?")) {
return;
}
var resolves = $.map( $('input:checkbox[name=s_resolves]:checked',form), function(o){ return $(o).data('revinfo'); });
var free_resolves = $('input[name=s_resolves_free]').val();
var an3_next = function(free_resolves) {
if(!resolves.length && !free_resolves && !confirm("You have not selected any edits where you tried to resolve the issue. Do you wish to make the report anyway?")) {
return;
}
var an3Parameters = {
'uid': uid,
'page': form.page.value.trim(),
'comment': form.comment.value.trim(),
'diffs': diffs,
'warnings': warnings,
'resolves': resolves,
'free_resolves': free_resolves
};
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( form );
Twinkle.arv.processAN3( an3Parameters );
};
if(free_resolves) {
var oldid=mw.util.getParamValue('oldid',free_resolves);
var api = new mw.Api();
api.get({
action: 'query',
prop: 'revisions',
format: 'json',
rvprop: 'ids|timestamp|comment',
indexpageids: true,
revids: oldid
}).done(function(data){
var pageid = data.query.pageids[0];
var page = data.query.pages[pageid];
an3_next(page);
}).fail(function(data){
console.log( 'API failed :(', data );
});
} else {
an3_next();
}
break;
}
};
Baris 3.254 ⟶ 4.087:
// prepare the SPI report
var text = "\n\n{{subst:SPI report|socksraw=" +
params.sockpuppets.map( function(v) {
return "* {{" + ( Morebits.isIPAddress( v ) ? "checkip" : "checkuser" ) + "|1=" + v + "}}";
} ).join( "\n" ) + "\n|evidence=" + params.evidence + " \n";
Baris 3.272 ⟶ 4.105:
spiPage.setEditSummary( 'Adding new report for [[Special:Contributions/' + params.uid + '|' + params.uid + ']].'+ Twinkle.getPref('summaryAd') );
spiPage.setAppendText( text );
switch( Twinkle.getPref( 'spiWatchReport' ) ) {
case 'yes':
spiPage.setWatchlist( true );
break;
case 'no':
spiPage.setWatchlistFromPreferences( false );
break;
default:
spiPage.setWatchlistFromPreferences( true );
break;
}
spiPage.append();
Morebits.wiki.removeCheckpoint(); // all page updates have been started
};
Twinkle.arv.processAN3 = function( params ) {
// prepare the AN3 report
var minid;
for(var i = 0; i < params.diffs.length; ++i) {
if( params.diffs[i].parentid && (!minid || params.diffs[i].parentid < minid)) {
minid = params.diffs[i].parentid;
}
}
var api = new mw.Api();
api.get({
action: 'query',
prop: 'revisions',
format: 'json',
rvprop: 'sha1|ids|timestamp|comment',
rvlimit: 100,
rvstartid: minid,
rvexcludeuser: params.uid,
indexpageids: true,
redirects: true,
titles: params.page
}).done(function(data){
Morebits.wiki.addCheckpoint(); // prevent notification events from causing an erronous "action completed"
var orig;
if(data.length) {
var sha1 = data[0].sha1;
for(var i = 1; i < data.length; ++i) {
if(data[i].sha1 == sha1) {
orig = data[i];
break;
}
}
if(!orig) {
orig = data[0];
}
}
var origtext = "";
if(orig) {
origtext = '{{diff2|' + orig.revid + '|' + orig.timestamp + '}} "' + orig.comment + '"';
}
var grouped_diffs = {};
var parentid, lastid;
for(var j = 0; j < params.diffs.length; ++j) {
var cur = params.diffs[j];
if( cur.revid && cur.revid != parentid || lastid === null ) {
lastid = cur.revid;
grouped_diffs[lastid] = [];
}
parentid = cur.parentid;
grouped_diffs[lastid].push(cur);
}
var difftext = $.map(grouped_diffs, function(sub, index){
var ret = "";
if(sub.length >= 2) {
var last = sub[0];
var first = sub.slice(-1)[0];
var label = "Consecutive edits made from " + moment(first.timestamp).utc().format('HH:mm, D MMMM YYYY [(UTC)]') + " to " + moment(last.timestamp).utc().format('HH:mm, D MMMM YYYY [(UTC)]');
ret = "# {{diff|oldid="+first.parentid+"|diff="+last.revid+"|label="+label+"}}\n";
}
ret += sub.reverse().map(function(v){
return (sub.length >= 2 ? '#' : '') + '# {{diff2|' + v.revid + '|' + moment(v.timestamp).utc().format('HH:mm, D MMMM YYYY [(UTC)]') + '}} "' + v.comment + '"';
}).join("\n");
return ret;
}).reverse().join("\n");
var warningtext = params.warnings.reverse().map(function(v){
return '# ' + ' {{diff2|' + v.revid + '|' + moment(v.timestamp).utc().format('HH:mm, D MMMM YYYY [(UTC)]') + '}} "' + v.comment + '"';
}).join("\n");
var resolvetext = params.resolves.reverse().map(function(v){
return '# ' + ' {{diff2|' + v.revid + '|' + moment(v.timestamp).utc().format('HH:mm, D MMMM YYYY [(UTC)]') + '}} "' + v.comment + '"';
}).join("\n");
if(params.free_resolves) {
var page = params.free_resolves;
var rev = page.revisions[0];
resolvetext += "\n# " + ' {{diff2|' + rev.revid + '|' + moment(rev.timestamp).utc().format('HH:mm, D MMMM YYYY [(UTC)]') + ' on ' + page.title + '}} "' + rev.comment + '"';
}
var comment = params.comment.replace(/~*$/g, '').trim();
if(comment) {
comment += " ~~~~";
}
var text = "\n\n"+'{{subst:AN3 report|diffs='+difftext+'|warnings='+warningtext+'|resolves='+resolvetext+'|pagename='+params.page+'|orig='+origtext+'|comment='+comment+'|uid='+params.uid+'}}';
var reportpage = 'Wikipedia:Administrators\' noticeboard/Edit warring';
Morebits.wiki.actionCompleted.redirect = reportpage;
Morebits.wiki.actionCompleted.notice = "Reporting complete";
var an3Page = new Morebits.wiki.page( reportpage, 'Retrieving discussion page' );
an3Page.setFollowRedirect( true );
an3Page.setEditSummary( 'Adding new report for [[Special:Contributions/' + params.uid + '|' + params.uid + ']].'+ Twinkle.getPref('summaryAd') );
an3Page.setAppendText( text );
an3Page.append();
// notify user
var notifyEditSummary = "Notifying about edit warring noticeboard discussion." + Twinkle.getPref('summaryAd');
var notifyText = "\n\n{{subst:an3-notice|1=" + mw.util.wikiUrlencode(params.uid) + "|auto=1}} ~~~~";
var talkPage = new Morebits.wiki.page( 'User talk:' + params.uid, 'Notifying edit warrior' );
talkPage.setFollowRedirect( true );
talkPage.setEditSummary( notifyEditSummary );
talkPage.setAppendText( notifyText );
talkPage.append();
Morebits.wiki.removeCheckpoint(); // all page updates have been started
}).fail(function(data){
console.log( 'API failed :(', data );
});
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 3.289 ⟶ 4.260:
Twinkle.batchdelete = function twinklebatchdelete() {
if( Morebits.userIsInGroup( 'sysop' ) && (mw.config.get( 'wgNamespaceNumber' ) > 0 || mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Prefixindex') ) {
}
};
Baris 3.295 ⟶ 4.266:
Twinkle.batchdelete.unlinkCache = {};
Twinkle.batchdelete.callback = function twinklebatchdeleteCallback() {
var Window = new Morebits.simpleWindow(
Window.setTitle( "Batch deletion" );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.batchdelete.callback.evaluate );
Baris 3.304 ⟶ 4.275:
type: 'checkbox',
list: [
{
label: 'Delete pages',
name: 'delete_page',
Baris 3.325 ⟶ 4.296:
} );
form.append( {
type: '
name: 'reason',
label: 'Reason: ',
size: 60
} );
Baris 3.344 ⟶ 4.316:
var gapnamespace, gapprefix;
if(Morebits.queryString.exists( '
{
gapnamespace = Morebits.queryString.get( 'namespace' );
gapprefix = Morebits.string.toUpperCaseFirstChar( Morebits.queryString.get( '
}
else
{
var pathSplit = decodeURIComponent(location.pathname).split('/');
if (pathSplit.length < 3 || pathSplit[2] !== "Special:PrefixIndex") {
return;
Baris 3.376 ⟶ 4.348:
'gapprefix': gapprefix,
'gaplimit' : Twinkle.getPref('batchMax'), // the max for sysops
'prop' :
'
'rvprop': 'size'
};
} else {
Baris 3.385 ⟶ 4.358:
'titles': mw.config.get( 'wgPageName' ),
'gpllimit' : Twinkle.getPref('batchMax'), // the max for sysops
'prop':
'
'rvprop': 'size'
};
}
var statusdiv = document.createElement( 'div' );
statusdiv.style.padding = '15px'; // just so it doesn't look broken
Window.setContent(statusdiv);
Morebits.status.init(statusdiv);
Window.display();
var statelem = new Morebits.status("Grabbing list of pages");
var wikipedia_api = new Morebits.wiki.api( 'loading...', query, function( apiobj ) {
var xml = apiobj.responseXML;
var $pages = $(xml).find('page').filter(':not([missing])');
var list = [];
$pages.each(function(index, page) {
var
var
var isRedir = $page.attr('redirect') === "";
var $editprot = $page.find('pr[type="edit"][level="sysop"]');
var protected = $editprot.length > 0;
var size = $page.find('rev').attr('size');
var metadata = [];
if (isRedir) {
metadata.push("redirect");
}
if (protected) {
metadata.push("fully protected" +
($editprot.attr('expiry') === 'infinity' ? ' indefinitely' : (', expires ' + $editprot.attr('expiry'))));
}
metadata.push(size + " bytes");
list.push({
label: title + (metadata.length ? (' (' + metadata.join('; ') + ')') : ''),
value: title,
checked: true,
style: (protected ? 'color:red' : '')
});
});
apiobj.params.form.append({ type: 'header', label: 'Pages to delete' });
apiobj.params.form.append({
type: 'button',
label: "Select All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, "pages")).prop('checked', true);
}
});
apiobj.params.form.append({
type: 'button',
label: "Deselect All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, "pages")).prop('checked', false);
}
});
apiobj.params.form.append( {
type: 'checkbox',
name: 'pages',
list: list
} );
var result =
Morebits.checkboxShiftClickSupport(Morebits.quickForm.getElements(result, 'pages'));
}, statelem );
wikipedia_api.params = { form:form, Window:Window };
wikipedia_api.post();
};
Baris 3.427 ⟶ 4.438:
Morebits.wiki.actionCompleted.notice = 'Status';
Morebits.wiki.actionCompleted.postfix = 'batch deletion is now complete';
var numProtected = $(Morebits.quickForm.getElements(event.target, 'pages')).filter(function(index, element) {
return element.checked && element.nextElementSibling.style.color === 'red';
}).length;
if (numProtected > 0 && !confirm("You are about to delete " + numProtected + " fully protected page(s). Are you sure?")) {
return;
}
var pages = event.target.getChecked( 'pages' );
var reason = event.target.reason.value;
Baris 3.434 ⟶ 4.452:
var delete_redirects = event.target.delete_redirects.checked;
if( ! reason ) {
alert("You need to give a reason, you cabal crony!");
return;
}
Baris 3.455 ⟶ 4.474:
for( var i = 0; i < pages.length; ++i ) {
var page = pages[i];
var
var query, wikipedia_api;
if( unlink_page ) {
query = {
'action': 'query',
'list': 'backlinks',
'blfilterredir': 'nonredirects',
'blnamespace': [0, 100], // main space and portal space only
'bltitle': page,
'bllimit': Morebits.userIsInGroup( 'sysop' ) ? 5000 : 500 // 500 is max for normal users, 5000 for bots and sysops
};
wikipedia_api = new Morebits.wiki.api( 'Grabbing backlinks', query, Twinkle.batchdelete.callbacks.unlinkBacklinksMain );
wikipedia_api.params = params;
wikipedia_api.post();
} else {
--Twinkle.batchdelete.currentUnlinkCounter;
}
if( delete_page ) {
if (delete_redirects)
{
query = {
'action': 'query',
'list': 'backlinks',
'blfilterredir': 'redirects',
'bltitle': page,
'bllimit': Morebits.userIsInGroup( 'sysop' ) ? 5000 : 500 // 500 is max for normal users, 5000 for bots and sysops
};
wikipedia_api = new Morebits.wiki.api( 'Grabbing redirects', query, Twinkle.batchdelete.callbacks.deleteRedirectsMain );
wikipedia_api.params = params;
wikipedia_api.post();
}
var wikipedia_page = new Morebits.wiki.page( page, 'Deleting page ' + page );
wikipedia_page.setEditSummary(reason + Twinkle.getPref('deletionSummaryAd'));
wikipedia_page.suppressProtectWarning();
wikipedia_page.deletePage(function( apiobj ) {
--Twinkle.batchdelete.currentDeleteCounter;
var link = document.createElement( 'a' );
var innerPage = apiobj.parent.getPageName();
link.setAttribute( 'href', mw.util.getUrl( innerPage ) );
link.setAttribute( 'title', innerPage );
link.appendChild( document.createTextNode( innerPage ) );
apiobj.getStatusElement().info( [ 'completed (' , link , ')' ] );
} );
} else {
--Twinkle.batchdelete.currentDeleteCounter;
}
}
}
Baris 3.471 ⟶ 4.531:
Twinkle.batchdelete.callbacks = {
deleteRedirectsMain: function( self ) {
var xmlDoc = self.responseXML;
Baris 3.570 ⟶ 4.572:
var title = snapshot.snapshotItem(i).value;
var wikipedia_page = new Morebits.wiki.page( title, "Deleting " + title );
wikipedia_page.setEditSummary('[[WP:CSD#G8|G8]]:
wikipedia_page.setCallbackParameters(params);
wikipedia_page.deletePage(onsuccess);
Baris 3.649 ⟶ 4.651:
return;
}
pageobj.setEditSummary('Removing link(s) to deleted page ' +
pageobj.setPageText(text);
pageobj.setCreateOption('nocreate');
Baris 3.655 ⟶ 4.657:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 3.671 ⟶ 4.683:
mw.config.get( 'wgNamespaceNumber' ) === 4)) || mw.config.get( 'wgNamespaceNumber' ) === 14 ||
mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Prefixindex') ) {
}
};
Baris 3.682 ⟶ 4.694:
//Window.addFooterLink( "Protection templates", "Template:Protection templates" );
Window.addFooterLink( "Protection policy", "WP:PROT" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.batchprotect.callback.evaluate );
Baris 3.713 ⟶ 4.725:
label: 'Autoconfirmed',
value: 'autoconfirmed'
});
editlevel.append({
type: 'option',
label: 'Template editor',
value: 'templateeditor'
});
editlevel.append({
Baris 3.778 ⟶ 4.795:
label: 'Autoconfirmed',
value: 'autoconfirmed'
});
movelevel.append({
type: 'option',
label: 'Template editor',
value: 'templateeditor'
});
movelevel.append({
Baris 3.847 ⟶ 4.869:
label: 'Autoconfirmed',
value: 'autoconfirmed'
});
createlevel.append({
type: 'option',
label: 'Template editor',
value: 'templateeditor'
});
createlevel.append({
Baris 4.069 ⟶ 5.096:
--Twinkle.batchprotect.currentProtectCounter;
var link = document.createElement( 'a' );
link.setAttribute( 'href', mw.util.
link.appendChild( document.createTextNode( apiobj.params.page ) );
pageobj.getStatusElement().info( [ 'completed (' , link , ')' ] );
Baris 4.075 ⟶ 5.102:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 4.081 ⟶ 5.118:
****************************************
* Mode of invocation: Tab ("Und-batch")
* Active on: Existing
* Config directives in: TwinkleConfig
*/
Twinkle.batchundelete = function twinklebatchundelete() {
if( mw.config.get("wgNamespaceNumber") !== mw.config.get("wgNamespaceIds").user
!mw.config.get("wgArticleId") ) {
return;
}
if( Morebits.userIsInGroup( 'sysop' ) ) {
}
};
Twinkle.batchundelete.callback = function twinklebatchundeleteCallback() {
var Window = new Morebits.simpleWindow(
Window.setScriptName("Twinkle");
Window.setTitle("Batch undelete");
var form = new Morebits.quickForm( Twinkle.batchundelete.callback.evaluate );
form.append( {
type: '
name: 'reason',
label: 'Reason: ',
size: 60
} );
Baris 4.114 ⟶ 5.151:
'gpllimit' : Twinkle.getPref('batchMax') // the max for sysops
};
var wikipedia_api = new Morebits.wiki.api( 'Grabbing pages', query, function(
var
var
var list = [];
$pages.each(function(index, page) {
var
var
list.push(
});
apiobj.params.form.append({
type: 'button',
label: "Select All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, 'pages')).prop('checked', true);
}
});
apiobj.params.form.append({
type: 'button',
label: "Deselect All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, 'pages')).prop('checked', false);
}
});
apiobj.params.form.append( {
type: 'checkbox',
name: 'pages',
list: list
});
apiobj.params.form.append( { type:'submit' } );
var result =
Morebits.checkboxShiftClickSupport(Morebits.quickForm.getElements(result, 'pages'));
}
wikipedia_api.params = { form:form, Window:Window };
wikipedia_api.post();
Baris 4.189 ⟶ 5.240:
--Twinkle.batchundelete.currentUndeleteCounter;
var link = document.createElement( 'a' );
link.setAttribute( 'href', mw.util.
link.setAttribute( 'title', self.itsTitle );
link.appendChild( document.createTextNode(self.itsTitle) );
Baris 4.202 ⟶ 5.253:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 4.229 ⟶ 5.290:
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",
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",
Baris 4.240 ⟶ 5.301:
csdCriteriaDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u1", "u2", "u3", "u5",
"f1", "f2", "f3", "f7", "f8", "f9", "f10",
"c1",
Baris 4.252 ⟶ 5.313:
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",
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",
Baris 4.263 ⟶ 5.324:
csdCriteriaNotificationDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u3", "u5",
"f1", "f2", "f3", "f7", "f9", "f10",
"c1",
Baris 4.274 ⟶ 5.335:
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",
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",
Baris 4.285 ⟶ 5.346:
csdAndDICriteriaDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u1", "u2", "u3", "u5",
"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11",
"c1",
Baris 4.314 ⟶ 5.375:
"101": "Portal talk",
"108": "Book",
"109": "Book talk",
"118": "Draft",
"119": "Draft talk",
"710": "TimedText",
"711": "TimedText talk",
"828": "Module",
"829": "Module talk"
}
};
Baris 4.354 ⟶ 5.421:
{
name: "summaryAd",
label: "\"
helptip: "
type: "string"
},
Baris 4.363 ⟶ 5.430:
{
name: "deletionSummaryAd",
label: "
helptip: "
adminOnly: true,
type: "string"
Baris 4.373 ⟶ 5.440:
{
name: "protectionSummaryAd",
label: "
helptip: "
adminOnly: true,
type: "string"
Baris 4.385 ⟶ 5.452:
{
name: "userTalkPageMode",
label: "
type: "enum",
enumValues: Twinkle.config.commonEnums.talkPageMode
Baris 4.393 ⟶ 5.460:
{
name: "dialogLargeFont",
label: "
type: "boolean"
}
]
},
{
title: "ARV",
preferences: [
{
name: "spiWatchReport",
label: "Add sockpuppet report pages to watchlist",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
}
]
Baris 4.465 ⟶ 5.544:
{
title: "
preferences: [
// TwinkleConfig.openTalkPage (array)
Baris 4.471 ⟶ 5.550:
{
name: "openTalkPage",
label: "
type: "set",
setValues: { agf: "
},
Baris 4.489 ⟶ 5.568:
{
name: "markRevertedPagesAsMinor",
label: "
type: "set",
setValues: { agf: "
},
Baris 4.498 ⟶ 5.577:
{
name: "watchRevertedPages",
label: "
type: "set",
setValues: { agf: "
},
Baris 4.544 ⟶ 5.623:
{
title: "
preferences: [
{
name: "speedySelectionStyle",
label: "
type: "enum",
enumValues: { "buttonClick": '
},
Baris 4.562 ⟶ 5.636:
{
name: "watchSpeedyPages",
label: "
type: "set",
setValues: Twinkle.config.commonSets.csdCriteria,
Baris 4.572 ⟶ 5.646:
{
name: "markSpeedyPagesAsPatrolled",
label: "
helptip: "Due to technical limitations, pages are only marked as patrolled when they are reached via Special:NewPages.",
type: "boolean"
Baris 4.581 ⟶ 5.655:
{
name: "notifyUserOnSpeedyDeletionNomination",
label: "
helptip: "Even if you choose to notify from the CSD screen, the notification will only take place for those criteria selected here.",
type: "set",
Baris 4.593 ⟶ 5.667:
{
name: "welcomeUserOnSpeedyDeletionNotification",
label: "Welcome page creator alongside notification when tagging with these criteria",
helptip: "The welcome is issued only if the user is notified about the deletion, and only if their talk page does not already exist. The template used is {{
type: "set",
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
Baris 4.603 ⟶ 5.677:
{
name: "promptForSpeedyDeletionSummary",
label: "Allow editing of deletion summary when deleting under these criteria",
adminOnly: true,
type: "set",
Baris 4.614 ⟶ 5.688:
{
name: "openUserTalkPageOnSpeedyDelete",
label: "
adminOnly: true,
type: "set",
Baris 4.625 ⟶ 5.699:
{
name: "deleteTalkPageOnDelete",
label: "
adminOnly: true,
type: "boolean"
Baris 4.632 ⟶ 5.706:
{
name: "deleteRedirectsOnDelete",
label: "
adminOnly: true,
type: "boolean"
Baris 4.650 ⟶ 5.724:
{
name: "speedyWindowWidth",
label: "
type: "integer"
},
Baris 4.658 ⟶ 5.732:
{
name: "speedyWindowHeight",
label: "
helptip: "
type: "integer"
},
Baris 4.665 ⟶ 5.739:
{
name: "logSpeedyNominations",
label: "
helptip: "Since non-admins do not have access to their deleted contributions, the userspace log offers a good way to keep track of all pages you nominate for CSD using Twinkle. Files tagged using DI are also added to this log.",
type: "boolean"
Baris 4.671 ⟶ 5.745:
{
name: "speedyLogPageName",
label: "
helptip: "Enter a subpage name in this box. You will find your CSD log at User:<i>username</i>/<i>subpage name</i>. Only works if you turn on the CSD userspace log.",
type: "string"
Baris 4.677 ⟶ 5.751:
{
name: "noLogOnSpeedyNomination",
label: "
type: "set",
setValues: Twinkle.config.commonSets.csdAndDICriteria,
Baris 4.691 ⟶ 5.765:
{
name: "watchTaggedPages",
label: "
type: "boolean"
},
{
name: "watchMergeDiscussions",
label: "Add talk pages to watchlist when starting merge discussions",
type: "boolean"
},
{
name: "markTaggedPagesAsMinor",
label: "
type: "boolean"
},
{
name: "markTaggedPagesAsPatrolled",
label: "
type: "boolean"
},
{
name: "groupByDefault",
label: "
type: "boolean"
},
{
name: "tagArticleSortOrder",
label: "
type: "enum",
enumValues: { "cat": "By categories", "alpha": "In alphabetical order" }
Baris 4.718 ⟶ 5.796:
{
name: "customTagList",
label: "
helptip: "These appear as additional options at the bottom of the list of tags. For example, you could add new maintenance tags which have not yet been added to Twinkle's defaults.",
type: "customList",
Baris 4.733 ⟶ 5.811:
{
name: "markTalkbackAsMinor",
label: "
type: "boolean"
},
{
name: "insertTalkbackSignature",
label: "
type: "boolean"
},
{
name: "talkbackHeading",
label: "
type: "string"
},
{
name: "adminNoticeHeading",
label: "Section heading to use for administrators' noticeboard notices",
helptip: "Only relevant for AN and ANI.",
type: "string"
Baris 4.754 ⟶ 5.832:
{
name: "mailHeading",
label: "
type: "string"
}
Baris 4.784 ⟶ 5.862:
label: "Default warning level",
type: "enum",
enumValues: {
"1": "Level 1",
"2": "Level 2",
"3": "Level 3",
"4": "Level 4",
"5": "Level 4im",
"6": "Single-issue notices",
"7": "Single-issue warnings",
"9": "Custom warnings",
"8": "Block (admin only)"
}
},
Baris 4.793 ⟶ 5.881:
name: "showSharedIPNotice",
label: "Add extra notice on shared IP talk pages",
helptip: "Notice used is {{
type: "boolean"
},
Baris 4.810 ⟶ 5.898:
name: "blankTalkpageOnIndefBlock",
label: "Blank the talk page when indefinitely blocking users",
helptip: "See <a href=\"" + mw.util.
adminOnly: true,
type: "boolean"
},
{
name: "customWarningList",
label: "Custom warning templates to display",
helptip: "You can add individual templates or user subpages. Custom warnings appear in the \"Custom warnings\" category within the warning dialog box.",
type: "customList",
customListValueTitle: "Template name (no curly brackets)",
customListLabelTitle: "Text to show in warning list (also used as edit summary)"
}
]
Baris 5.012 ⟶ 6.108:
if ((mw.config.get("wgNamespaceNumber") === mw.config.get("wgNamespaceIds").project && mw.config.get("wgTitle") === "Twinkle/Preferences" ||
// create the config page at Wikipedia:Twinkle/Preferences, and at user subpages (for testing purposes)
Baris 5.030 ⟶ 6.126:
var contentnotice = document.createElement("p");
// I hate innerHTML, but this is one thing it *is* good for...
contentnotice.innerHTML = "<b>
contentdiv.appendChild(contentnotice);
Baris 5.039 ⟶ 6.135:
// start a table of contents
var toctable = document.createElement("
toctable.className = "toc";
toctable.style.marginLeft = "0.4em";
// create TOC title
var toctitle = document.createElement("div");
Baris 5.061 ⟶ 6.155:
toctoggle.appendChild(document.createTextNode("]"));
toctitle.appendChild(toctoggle);
// create item container: this is what we add stuff to
var tocul = document.createElement("ul");
Baris 5.073 ⟶ 6.167:
}
}, false);
contentdiv.appendChild(toctable);
Baris 5.297 ⟶ 6.389:
cell.style.color = "gray";
if (pref.helptip) {
// convert mentions of templates in the helptip to clickable links
cell.innerHTML = pref.helptip.replace(/{{(.+?)}}/g,
'{{<a href="' + mw.util.getUrl("Template:") + '$1" target="_blank">$1</a>}}');
}
// add reset link (custom lists don't need this, as their config value isn't displayed on the form)
Baris 5.349 ⟶ 6.443:
}
} else if (mw.config.get("wgNamespaceNumber") === mw.config.get("wgNamespaceIds").user
mw.config.get("wgTitle").indexOf(mw.config.get("wgUserName")) === 0 &&
mw.config.get("wgPageName").slice(-3) === ".js") {
var box = document.createElement("div");
Baris 5.359 ⟶ 6.455:
box.style.textAlign = "center";
var link
mw.config.get("wgPageName").lastIndexOf(".js"));
if (scriptPageName === "twinkleoptions") {
// place "why not try the preference panel" notice
box.style.fontWeight = "bold";
Baris 5.367 ⟶ 6.466:
if (mw.config.get("wgArticleId") > 0) { // page exists
box.appendChild(document.createTextNode("
} else { // page does not exist
box.appendChild(document.createTextNode("
}
link = document.createElement("a");
link.setAttribute("href", mw.util.
link.appendChild(document.createTextNode("
box.appendChild(link);
box.appendChild(document.createTextNode(",
$(box).insertAfter($("#contentSub"));
} else if (
// place "Looking for Twinkle options?" notice
box.style.width = "60%";
Baris 5.385 ⟶ 6.483:
box.appendChild(document.createTextNode("If you want to set Twinkle preferences, you can use the "));
link = document.createElement("a");
link.setAttribute("href", mw.util.
link.appendChild(document.createTextNode("
box.appendChild(link);
box.appendChild(document.createTextNode("."));
Baris 5.401 ⟶ 6.499:
contentnotice.innerHTML = '<table class="plainlinks ombox ombox-content"><tr><td class="mbox-image">' +
'<img alt="" src="http://upload.wikimedia.org/wikipedia/en/3/38/Imbox_content.png" /></td>' +
'<td class="mbox-text"><p><big><b>
'<p>
'</td></tr></table>';
} else {
Baris 5.458 ⟶ 6.556:
var dialog = new Morebits.simpleWindow(720, 400);
dialog.setTitle(curpref.label);
dialog.setScriptName("
var dialogcontent = document.createElement("div");
Baris 5.524 ⟶ 6.622:
dialog.close();
}, false);
button.textContent = "
dialogcontent.appendChild(button);
button = document.createElement("button");
Baris 5.538 ⟶ 6.636:
dialog.close(); // the event parameter on this function seems to be broken
}, false);
button.textContent = "
dialogcontent.appendChild(button);
Baris 5.794 ⟶ 6.892:
asort[i].value !== bsort[i].value)) {
return false;
} else if (asort[i].toString() !== bsort[i].toString()) {
return false;
}
Baris 5.895 ⟶ 6.993:
"//\n" +
"// NOTE: The easiest way to change your Twinkle preferences is by using the\n" +
"// Twinkle preferences panel, at [[" +
"//\n" +
"// This file is AUTOMATICALLY GENERATED. Any changes you make (aside from\n" +
Baris 5.910 ⟶ 7.008:
pageobj.setPageText(text);
pageobj.setEditSummary("Saving Twinkle preferences: automatic edit from [[" +
pageobj.setCreateOption("recreate");
pageobj.save(Twinkle.config.saveSuccess);
Baris 5.922 ⟶ 7.020:
noticebox.style.fontSize = "100%";
noticebox.style.marginTop = "2em";
noticebox.innerHTML = "<p><b>Your Twinkle preferences have been saved.</b></p><p>To see the changes, you will need to <b>clear your browser cache entirely</b> (see <a href=\"" + mw.util.
Morebits.status.root.appendChild(noticebox);
var noticeclear = document.createElement("br");
Baris 5.928 ⟶ 7.026:
Morebits.status.root.appendChild(noticeclear);
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 5.943 ⟶ 7.051:
}
if( Morebits.userIsInGroup( 'sysop' ) ) {
}
};
Baris 5.952 ⟶ 7.060:
Window.setTitle( "Batch file deletion" );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.delimages.callback.evaluate );
Baris 5.990 ⟶ 7.098:
};
} else {
// prepare for a possible merge with batchdelete
alert('Dear admin, \n\n' +
'We are planning to overhaul the "Deli-batch" module; we are particularly wondering if it is worthwhile to maintain the functionality that allows "Deli-batch" to be used from pages other than category pages. \n\n' +
'Since you are invoking "Deli-batch" from a non-category page, we would appreciate it if you could inform the Twinkle team at [[WT:TW]]. If no one responds to say they are using it, this functionality may soon be removed or altered. \n\n' +
'Thanks, \nThe Twinkle team');
//form.append({ type:'div', style:'color:red;font-weight:bold;font-size:larger', label: 'This module is going away. Please use "D-batch" (batch deletion) instead.' });
query = {
'action': 'query',
Baris 6.016 ⟶ 7.130:
});
self.params.form.append(
type: 'checkbox',
name: 'images',
list: list
});
self.params.form.append( { type:'submit' } );
});
wikipedia_api.params = { form:form, Window:Window };
wikipedia_api.post();
var root = document.createElement( 'div' );
Morebits.status.init( root );
Window.setContent( root );
Window.display();
};
Baris 6.042 ⟶ 7.153:
Twinkle.delimages.currentdeletor = 0;
Twinkle.delimages.callback.evaluate = function twinkledeliCallbackEvaluate(event) {
var images = event.target.getChecked( 'images' );
var reason = event.target.reason.value;
Baris 6.123 ⟶ 7.233:
});
if( instances.length === 0 ) {
--
return;
}
$.each( instances, function(k,title) {
var page = new Morebits.wiki.page(title, "Unlinking instances on " + title);
page.setFollowRedirect(true);
page.setCallbackParameters({'image': self.params.image, 'reason': self.params.reason});
Baris 6.155 ⟶ 7.265:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 6.165 ⟶ 7.285:
*/
if( mw.config.get( 'wgNamespaceNumber' ) !== 14 || ! Morebits.userIsInGroup( 'sysop' ) || !((/^Category:Proposed_deletion_as_of/).test(mw.config.get( 'wgPageName' ))) ) {
return;
}
Twinkle.addPortletLink( callback, "Deprod", "tw-deprod", "Delete prod pages found in this category");
};
});
self.params.form.append({
'type': 'checkbox',
'name': 'pages',
'list': list
});
self.params.form.append({
'type': 'submit'
});
self.params.Window.setContent( self.params.form.render() );
});
var toCall = function( work ) {
if( work.length === 0 ) {
Morebits.status.info( 'work done' );
window.clearInterval( currentDeletor );
Morebits.wiki.removeCheckpoint();
return;
} else if( currentDeleteCounter <= 0 || currentUnlinkCounter <= 0 ) {
unlinkCache = []; // Clear the cache
var pages = work.pop(), i;
for( i = 0; i < pages.length; ++i ) {
var page = pages[i];
var query = {
'action': 'query',
'prop': 'revisions',
'rvprop': [ 'content' ],
'rvlimit': 1,
'titles': page
};
var wikipedia_api = new Morebits.wiki.api( 'Checking if page ' + page + ' exists', query, callback_check );
wikipedia_api.params = { page:page, reason: concerns[page] };
wikipedia_api.post();
}
}
};
var work = Morebits.array.chunk( pages, Twinkle.getPref('proddeleteChunks') );
Morebits.wiki.addCheckpoint();
currentDeletor = window.setInterval( toCall, 1000, work );
},
callback_check = function( self ) {
var $doc = $(self.responseXML);
var normal = $doc.find('normalized n').attr('to');
if( normal ) {
}
var exists = $doc.find('pages page:not([missing])').size() > 0;
if( ! exists ) {
self.statelem.error( "It seems that the page doesn't exist, perhaps it has already been deleted" );
return;
}
var query = {
'action': 'query',
'list': 'backlinks',
'blfilterredir': 'redirects',
'bltitle': self.params.page,
'bllimit': Morebits.userIsInGroup( 'sysop' ) ? 5000 : 500 // 500 is max for normal users, 5000 for bots and sysops
};
var wikipedia_api = new Morebits.wiki.api( 'Grabbing redirects', query, callback_deleteRedirects );
wikipedia_api.params = self.params;
wikipedia_api.post();
var page = new Morebits.wiki.page('Talk:' + self.params.page, "Deleting talk page");
page.setEditSummary("[[WP:CSD#G8|G8]]: [[Help:Talk page|Talk page]] of deleted page \"" + self.params.page + "\"" + Twinkle.getPref('deletionSummaryAd'));
page.deletePage();
page = new Morebits.wiki.page(self.params.page, "Deleting article");
page.setEditSummary("Expired [[WP:PROD|PROD]], concern was: " + self.params.reason + Twinkle.getPref('deletionSummaryAd'));
page.deletePage();
},
callback_deleteRedirects = function( self ) {
var $doc = $(self.responseXML);
$doc.find("backlinks bl").each(function(){
var title = $(this).attr('title');
var page = new Morebits.wiki.page(title, "Deleting redirecting page " + title);
page.setEditSummary("[[WP:CSD#R1|R1]]: Redirect to deleted page \"" + self.params.page + "\"" + Twinkle.getPref('deletionSummaryAd'));
page.deletePage();
});
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 6.323 ⟶ 7.452:
*/
Twinkle.diff = function twinklediff() {
if( mw.config.get('wgNamespaceNumber') < 0 || !mw.config.get('wgArticleId') ) {
return;
Baris 6.334 ⟶ 7.463:
};
// Show additional tabs only on diff pages
if (Morebits.queryString.exists('diff')) {
var oldid = /oldid=(.+)/.exec($('#mw-diff-ntitle1').find('strong a').first().attr("href"))[1];
Baris 6.347 ⟶ 7.476:
'oldid' : oldid
};
}
};
Baris 6.368 ⟶ 7.497:
'action': 'query',
'titles': mw.config.get('wgPageName'),
'rvlimit': 1,
'rvprop': [ 'ids', 'user' ],
'rvstartid': mw.config.get('wgCurRevisionId') - 1, // i.e. not the current one
'rvuser': user
};
Morebits.status.init( document.getElementById('
var wikipedia_api = new Morebits.wiki.api( 'Grabbing data of initial contributor', query, Twinkle.diff.callbacks.main );
wikipedia_api.params = { user: user };
Baris 6.396 ⟶ 7.525:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 6.414 ⟶ 7.553:
if( parseInt( Morebits.queryString.get('oldid'), 10) !== mw.config.get('wgCurRevisionId') ) {
// not latest revision
alert("
return;
}
Baris 6.433 ⟶ 7.572:
if( mw.config.get('wgNamespaceNumber') === -1 && mw.config.get('wgCanonicalSpecialPageName') === "Contributions" ) {
//Get the username these contributions are for
if (logLink.length>0) //#215 -- there is no log link on Special:Contributions with no user
{
var username = decodeURIComponent(/wiki\/Special:Log\/(.+)$/.exec(logLink.attr("href").replace(/_/g, "%20"))[1]);
if( Twinkle.getPref('showRollbackLinks').indexOf('contribs') !== -1 ||
( mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').indexOf('others') !== -1 ) ||
( mw.config.get('wgUserName') === username && Twinkle.getPref('showRollbackLinks').indexOf('mine') !== -1 ) ) {
var list = $("#mw-content-text").find("ul li:has(span.mw-uctop)");
var revNode = document.createElement('strong');
var revLink = document.
revLink.appendChild( spanTag( 'SteelBlue', 'rollback' ) );
revLink.appendChild( spanTag( 'Black', ']' ) );
revNode.appendChild(revLink);
var revVandNode = document.createElement('strong');
var revVandLink = document.
revVandLink.appendChild( spanTag( 'Red', 'vandalism' ) );
revVandLink.appendChild( spanTag( 'Black', ']' ) );
revVandNode.appendChild(revVandLink);
list.each(function(key, current) {
var href = $(current).children("a:eq(1)").attr("href");
current.appendChild(
tmpNode.firstChild.setAttribute( 'href', href + '&' + Morebits.queryString.create( { 'twinklerevert': 'norm' } ) );
current.appendChild( tmpNode );
current.appendChild(
tmpNode = revVandNode.cloneNode( true );
tmpNode.firstChild.setAttribute( 'href', href + '&' + Morebits.queryString.create( { 'twinklerevert': 'vand' } ) );
current.appendChild( tmpNode );
});
}
}
} else {
Baris 6.471 ⟶ 7.614:
return;
}
var firstRev = $("div.firstrevisionheader").length;
Baris 6.511 ⟶ 7.652:
});
revertToRevisionLink.appendChild( spanTag( 'Black', '[' ) );
revertToRevisionLink.appendChild( spanTag( 'SaddleBrown', '
revertToRevisionLink.appendChild( spanTag( 'Black', ']' ) );
Baris 6.518 ⟶ 7.659:
if( document.getElementById('differences-nextlink') ) {
// Not latest revision
var new_rev_url = $("#mw-diff-ntitle1").find("strong a").attr("href");
query = new Morebits.queryString( new_rev_url.split( '?', 2 )[1] );
Baris 6.532 ⟶ 7.671:
});
revertToRevisionLink.appendChild( spanTag( 'Black', '[' ) );
revertToRevisionLink.appendChild( spanTag( 'SaddleBrown', '
revertToRevisionLink.appendChild( spanTag( 'Black', ']' ) );
ntitle.insertBefore( revertToRevision, ntitle.firstChild );
Baris 6.566 ⟶ 7.705:
agfLink.appendChild( spanTag( 'Black', '[' ) );
agfLink.appendChild( spanTag( 'DarkOliveGreen', '
agfLink.appendChild( spanTag( 'Black', ']' ) );
vandLink.appendChild( spanTag( 'Black', '[' ) );
vandLink.appendChild( spanTag( 'Red', '
vandLink.appendChild( spanTag( 'Black', ']' ) );
normLink.appendChild( spanTag( 'Black', '[' ) );
normLink.appendChild( spanTag( 'SteelBlue', '
normLink.appendChild( spanTag( 'Black', ']' ) );
Baris 6.594 ⟶ 7.733:
Twinkle.fluff.revert = function revertPage( type, vandal, autoRevert, rev, page ) {
if (mw.util.isIPv6Address(vandal)) {
vandal = Morebits.sanitizeIPv6(vandal);
}
var pagename = page || mw.config.get('wgPageName');
var revid = rev || mw.config.get('wgCurRevisionId');
Morebits.status.init( document.getElementById('
$( '#catlinks' ).remove();
var params = {
type: type,
Baris 6.608 ⟶ 7.752:
var query = {
'action': 'query',
'prop': ['info', 'revisions', 'flagged'],
'titles': pagename,
'rvlimit': 50, // max possible
Baris 6.614 ⟶ 7.758:
'intoken': 'edit'
};
var wikipedia_api = new Morebits.wiki.api( '
wikipedia_api.params = params;
wikipedia_api.post();
Baris 6.621 ⟶ 7.765:
Twinkle.fluff.revertToRevision = function revertToRevision( oldrev ) {
Morebits.status.init( document.getElementById('
var query = {
Baris 6.633 ⟶ 7.777:
'format': 'xml'
};
var wikipedia_api = new Morebits.wiki.api( '
wikipedia_api.params = { rev: oldrev };
wikipedia_api.post();
Baris 6.655 ⟶ 7.799:
if (revertToRevID !== self.params.rev) {
self.statitem.error( '
return;
}
var optional_summary = prompt( "
if (optional_summary === null)
{
self.statelem.error( '
return;
}
var summary = Twinkle.fluff.formatSummary("
var query = {
'action': 'edit',
'title': mw.config.get('wgPageName'),
Baris 6.682 ⟶ 7.825:
Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
Morebits.wiki.actionCompleted.notice = "
var wikipedia_api = new Morebits.wiki.api( '
wikipedia_api.params = self.params;
wikipedia_api.post();
Baris 6.702 ⟶ 7.845:
if( revs.length < 1 ) {
self.statelem.error( '
return;
}
Baris 6.726 ⟶ 7.869:
}
}
else if(self.params.type === 'vand' &&
Twinkle.fluff.whiteList.indexOf( top.getAttribute( 'user' ) ) !== -1 && revs.length > 1 &&
revs[1].getAttribute( 'pageId' ) === self.params.revid) {
Baris 6.743 ⟶ 7.886:
Morebits.status.info( 'Info', [ 'Vandalism revert was chosen on ', Morebits.htmlNode( 'strong', self.params.user ), '. As this is a whitelisted bot, we assume you wanted to revert vandalism made by the previous user instead.' ] );
index = 2;
self.params.user = revs[1].getAttribute( 'user' );
break;
Baris 6.787 ⟶ 7.929:
var userHasAlreadyConfirmedAction = false;
if (self.params.type !== 'vand' && count > 1) {
if ( !confirm( self.params.user + '
Morebits.status.info( '
return;
}
Baris 6.801 ⟶ 7.943:
self.statelem.status( [ ' revision ', Morebits.htmlNode( 'strong', self.params.goodid ), ' that was made ', Morebits.htmlNode( 'strong', count ), ' revisions ago by ', Morebits.htmlNode( 'strong', self.params.gooduser ) ] );
var summary, extra_summary
switch( self.params.type ) {
case 'agf':
extra_summary = prompt( "
if (extra_summary === null)
{
self.statelem.error( '
return;
}
userHasAlreadyConfirmedAction = true;
summary = Twinkle.fluff.formatSummary("Reverted [[WP:AGF|good faith]] edits by $USER", self.params.user, extra_summary);
break;
case 'vand':
summary = "Reverted " + self.params.count + (self.params.count > 1 ? ' edits' : ' edit') + " by [[Special:Contributions/" +
self.params.user + "|" + self.params.user + "]] ([[User talk:" + self.params.user + "|talk]]) to last revision by " +
self.params.gooduser + "." + Twinkle.getPref('summaryAd');
break;
Baris 6.830 ⟶ 7.968:
default:
if( Twinkle.getPref('offerReasonOnNormalRevert') ) {
extra_summary = prompt( "
if (extra_summary === null)
{
self.statelem.error( '
return;
}
Baris 6.839 ⟶ 7.977:
}
summary = Twinkle.fluff.formatSummary("Reverted " + self.params.count + (self.params.count > 1 ? ' edits' : ' edit') +
" by $USER", self.params.user, extra_summary);
break;
}
if (Twinkle.getPref('confirmOnFluff') && !userHasAlreadyConfirmedAction && !confirm("
self.statelem.error( '
return;
}
var query;
if( (!self.params.autoRevert || Twinkle.getPref('openTalkPageOnAutoRevert')) &&
Twinkle.getPref('openTalkPage').indexOf( self.params.type ) !== -1 &&
mw.config.get('wgUserName') !== self.params.user ) {
Morebits.status.info( 'Info', [ '
query = {
'title': 'User talk:' + self.params.user,
Baris 6.870 ⟶ 8.006:
switch( Twinkle.getPref('userTalkPageMode') ) {
case 'tab':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '
break;
case 'blank':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank',
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' ); break;
case 'window':
/* falls through */
default:
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
( window.name === 'twinklewarnwindow' 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' ); break;
}
}
// figure out whether we need to/can review the edit
var $flagged = $(xmlDoc).find('flagged');
if ((Morebits.userIsInGroup('reviewer') || Morebits.userIsInGroup('sysop')) &&
$flagged.length &&
$flagged.attr("stable_revid") >= self.params.goodid &&
$flagged.attr("pending_since")) {
self.params.reviewRevert = true;
self.params.edittoken = edittoken;
}
query = {
'action': 'edit',
Baris 6.897 ⟶ 8.046:
Morebits.wiki.actionCompleted.redirect = self.params.pagename;
Morebits.wiki.actionCompleted.notice = "
var wikipedia_api = new Morebits.wiki.api( '
wikipedia_api.params = self.params;
wikipedia_api.post();
Baris 6.905 ⟶ 8.054:
},
complete: function (apiobj) {
var
var blacklist = $edit.attr('spamblacklist'); if (blacklist) {
var code = document.createElement('code');
code.style.fontFamily = "monospace";
code.appendChild(document.createTextNode(blacklist));
apiobj.statelem.error(['
} else if ($edit.attr('nochange') === '') {
apiobj.statelem.warn("Revision we are reverting to is identical to current revision: Nothing to do");
} else {
apiobj.statelem.info("
// review the revert, if needed
if (apiobj.params.reviewRevert) {
var query = {
'action': 'review',
'revid': $edit.attr('newrevid'),
'token': apiobj.params.edittoken,
'comment': Twinkle.getPref('summaryAd').trim()
};
var wikipedia_api = new Morebits.wiki.api('Automatically accepting your changes', query);
wikipedia_api.post();
}
}
}
};
// builtInString should contain the string "$USER", which will be replaced
// by an appropriate user link
Twinkle.fluff.formatSummary = function(builtInString, userName, userString) {
var result = builtInString;
// append user's custom reason with requisite punctuation
if (userString) {
result += ': ' + Morebits.string.toUpperCaseFirstChar(userString);
if (userString.search(/[.?!;]$/) === -1) {
result += '.';
}
} else {
result += '.';
}
result += Twinkle.getPref('summaryAd');
// find number of UTF-8 bytes the resulting string takes up, and possibly add
// a contributions or contributions+talk link if it doesn't push the edit summary
// over the 255-byte limit
var resultLen = unescape(encodeURIComponent(result.replace("$USER", ""))).length;
var contribsLink = "[[Special:Contributions/" + userName + "|" + userName + "]]";
var contribsLen = unescape(encodeURIComponent(contribsLink)).length;
if (resultLen + contribsLen <= 255) {
var talkLink = " ([[User talk:" + userName + "|talk]])";
if (resultLen + contribsLen + unescape(encodeURIComponent(talkLink)).length <= 255) {
result = result.replace("$USER", contribsLink + talkLink);
} else {
result = result.replace("$USER", contribsLink);
}
} else {
result = result.replace("$USER", userName);
}
return result;
};
Twinkle.fluff.init = function twinklefluffinit() {
if (
{
//
// if vandalism revert was chosen on such username, then
// This is for
// This only
// has no faith, and for normal rollback, it will rollback that edit.
Twinkle.fluff.whiteList = [
'AnomieBOT',
'SineBot'
];
Baris 6.951 ⟶ 8.137:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 6.963 ⟶ 8.159:
Twinkle.image = function twinkleimage() {
if (mw.config.get('wgNamespaceNumber') === 6 &&
}
};
Twinkle.image.callback = function twinkleimageCallback() {
var Window = new Morebits.simpleWindow( 600, 330 );
Window.setTitle( "File for dated speedy deletion" );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.image.callback.evaluate );
Baris 6.986 ⟶ 8.178:
list: [
{
label: '
value: 'notify',
name: 'notify',
Baris 7.128 ⟶ 8.320:
Twinkle.image.callback.evaluate = function twinkleimageCallbackEvaluate(event) {
var type, non_free, source, reason, replacement, old_image;
var notify = event.target.notify.checked;
Baris 7.267 ⟶ 8.458:
var params = pageobj.getCallbackParameters();
var initialContrib = pageobj.getCreator();
// disallow warning yourself
if (
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
} else {
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:di-" + params.type + "-notice|1=" + mw.config.get('wgTitle');
if (params.type === 'no permission') {
notifytext += params.source ? "|source=" + params.source : "";
}
notifytext += "}} ~~~~";
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: tagging for deletion of [[" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('deliWatchUser')) {
case 'yes':
usertalkpage.setWatchlist(true);
break;
case 'no':
usertalkpage.setWatchlistFromPreferences(false);
break;
default:
usertalkpage.setWatchlistFromPreferences(true);
break;
}
usertalkpage.setFollowRedirect(true);
usertalkpage.append();
}
// add this nomination to the user's userspace log, if the user has enabled it
Baris 7.297 ⟶ 8.494:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 7.312 ⟶ 8.519:
}
};
Twinkle.prod.callback = function twinkleprodCallback() {
Twinkle.prod.defaultReason = Twinkle.getPref('prodReasonDefault');
Baris 7.327 ⟶ 8.530:
Window.addFooterLink( "Proposed deletion policy", "WP:PROD" );
Window.addFooterLink( "BLP PROD policy", "WP:BLPPROD" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.prod.callback.evaluate );
Baris 7.360 ⟶ 8.563:
} );
form.append( { type:'submit', label:'Propose deletion' } );
var result = form.render();
Baris 7.373 ⟶ 8.576:
Twinkle.prod.callback.prodtypechanged = function(event) {
var field = new Morebits.quickForm.element( {
type: 'field',
Baris 7.380 ⟶ 8.583:
} );
// create prod type dependant controls
switch( event.target.values ) {
case 'prod':
field.append( {
Baris 7.405 ⟶ 8.607:
case 'prodblp':
Twinkle.prod.defaultReason = event.target.form.reason.value;
}
field.append( {
type: 'checkbox',
Baris 7.431 ⟶ 8.633:
label: boldtext
});
if (mw.config.get('wgArticleId') < 26596183) {
field.append({
type: 'header',
Baris 7.439 ⟶ 8.640:
}
break;
default:
break;
Baris 7.455 ⟶ 8.656:
return;
}
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
Baris 7.466 ⟶ 8.667:
// Remove tags that become superfluous with this action
text = text.replace(/\{\{\s*(
var prod_re = /\{\{\s*(?:dated prod|dated prod blp|Prod blp\/dated|Proposed deletion\/dated)\s*\|(?:\{\{[^\{\}]*\}\}|[^\}\{])*\}\}/i;
Baris 7.479 ⟶ 8.680:
// If not notifying, log this PROD
else if( Twinkle.getPref('logProdPages') ) {
Twinkle.prod.callbacks.addToLog(params
}
summaryText = "Proposing article for deletion per [[WP:" + (params.blp ? "BLP" : "") + "PROD]].";
text = "{{subst:prod" + (params.blp ? " blp" : ("|1=" + Morebits.string.formatReasonText(params.reason))) + "}}\n" + text;
}
else { // already tagged for PROD, so try endorsing it
Baris 7.493 ⟶ 8.694:
var confirmtext = "A {{prod}} tag was already found on this article. \nWould you like to add a {{prod-2}} (PROD endorsement) tag with your explanation?";
if (params.blp) {
confirmtext = "A non-BLP {{prod}} tag was found on this article. \nWould you like to add a {{prod-2}} (PROD endorsement) tag with explanation \"
}
if( !confirm( confirmtext ) ) {
Baris 7.501 ⟶ 8.702:
summaryText = "Endorsing proposed deletion per [[WP:" + (params.blp ? "BLP" : "") + "PROD]].";
text = text.replace( prod_re, text.match( prod_re ) + "\n{{prod-2|1=" + (params.blp ?
"article is a [[WP:BLPPROD|biography of a living person with no sources]]" : Morebits.string.formatReasonText(params.reason)) + "}}\n" );
if( Twinkle.getPref('logProdPages') ) {
Baris 7.519 ⟶ 8.722:
var params = pageobj.getCallbackParameters();
var initialContrib = pageobj.getCreator();
// Disallow warning yourself
if (initialContrib === mw.config.get("wgUserName")) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
if (Twinkle.getPref("logProdPages")) {
Twinkle.prod.callbacks.addToLog(params);
}
return;
}
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:prodwarning" + (params.blp ? "BLP" : "") + "|1=" +
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: proposed deletion of [[" +
usertalkpage.setCreateOption('recreate');
usertalkpage.setFollowRedirect(true);
Baris 7.559 ⟶ 8.772:
var summarytext;
if (params.logEndorsing) {
text += "\n# [[" +
if (params.reason) {
text += "\n#* '''Reason''': " + params.reason + "\n";
}
summarytext = "Logging endorsement of PROD nomination of [[" +
} else {
text += "\n# [[" +
if (params.logInitialContrib) {
text += "; notified {{user|" + params.logInitialContrib + "}}";
Baris 7.573 ⟶ 8.786:
text += "#* '''Reason''': " + params.reason + "\n";
}
summarytext = "Logging PROD nomination of [[" +
}
Baris 7.584 ⟶ 8.797:
Twinkle.prod.callback.evaluate = function twinkleprodCallbackEvaluate(e) {
var form = e.target;
var prodtype;
var prodtypes = form.prodtype;
for( var i = 0; i < prodtypes.length; i++ ) {
if( !prodtypes[i].checked ) {
continue;
Baris 7.607 ⟶ 8.818:
Morebits.status.init( form );
if (prodtype === 'prodblp' && mw.config.get('wgArticleId') < 26596183) {
if (!confirm( "It appears that this article was created before March 18, 2010, and is thus ineligible for a BLP PROD. Do you want to continue tagging it?" )) {
Morebits.status.warn( 'Notice', 'Aborting per user input.' );
return;
Baris 7.624 ⟶ 8.833:
wikipedia_page.load(Twinkle.prod.callbacks.main);
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 7.641 ⟶ 8.860:
}
Morebits.userIsInGroup('sysop') ? "Protect page" : "Request page protection" );
};
Twinkle.protect.callback = function twinkleprotectCallback() {
Twinkle.protect.protectionLevel = null;
var Window = new Morebits.simpleWindow( 620, 530 );
Window.setTitle( Morebits.userIsInGroup( 'sysop' ) ? "Apply, request or tag page protection" : "Request or tag page protection" );
Baris 7.655 ⟶ 8.872:
Window.addFooterLink( "Protection templates", "Template:Protection templates" );
Window.addFooterLink( "Protection policy", "WP:PROT" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.protect.callback.evaluate );
Baris 7.713 ⟶ 8.930:
// get current protection level asynchronously
if (Morebits.userIsInGroup('sysop')) {
Morebits.wiki.actionCompleted.postfix = false; // avoid Action: completed notice
Morebits.status.init($('div[name="currentprot"] span').last()[0]);
}
Twinkle.protect.fetchProtectionLevel();
};
// Current protection level in a human-readable format
// (a string, or null if no protection; only filled for sysops)
Twinkle.protect.protectionLevel = null;
// Contains the current protection level in an object
// Once filled, it will look something like:
// { edit: { level: "sysop", expiry: <some date>, cascade: true }, ... }
Twinkle.protect.currentProtectionLevels = {};
Twinkle.protect.
var api = new mw.Api();
api.get({
format: 'json',
indexpageids: true,
action: 'query',
prop: 'info|flagged',
inprop: 'protection',
titles: mw.config.get('wgPageName')
})
.done(function(data){
var pageid = data.query.pageids[0];
var page = data.query.pages[pageid];
var result = [];
var current = {};
var updateResult = function(label, level, expiry, cascade) {
// for sysops, stringify, so they can base their decision on existing protection
if (Morebits.userIsInGroup('sysop')) {
var boldnode = document.createElement('b');
boldnode.textContent = label + ": " + level;
result.push(boldnode);
if (expiry === 'infinity') {
result.push(" (indefinite) ");
} else {
result.push(" (expires " + new Date(expiry).toUTCString() + ") ");
}
if (cascade) {
result.push("(cascading) ");
}
}
};
$.each(page.protection, function( index, protection ) {
if (protection.type !== "aft") {
current[protection.type] = {
level: protection.level,
expiry: protection.expiry,
cascade: protection.cascade === ''
};
updateResult( Morebits.string.toUpperCaseFirstChar(protection.type), protection.level, protection.expiry, protection.cascade );
}
});
if (page.flagged) {
current.stabilize = {
level: page.flagged.protection_level,
expiry: page.flagged.protection_expiry
};
// FlaggedRevision gives bad date
updateResult( 'Pending Changes', page.flagged.protection_level, page.flagged.protection_expiry, false );
}
// show the protection level to sysops
if (Morebits.userIsInGroup('sysop')) {
if (!result.length) {
var boldnode = document.createElement('b');
boldnode.textContent = "no protection";
result.push(boldnode);
}
Twinkle.protect.protectionLevel = result;
Morebits.status.init($('div[name="currentprot"] span').last()[0]);
Morebits.status.info("Current protection level", Twinkle.protect.protectionLevel);
}
Twinkle.protect.currentProtectionLevels = current;
});
};
Baris 7.771 ⟶ 9.019:
var field1;
var field2;
var isTemplate = mw.config.get("wgNamespaceNumber") === 10 || mw.config.get("wgNamespaceNumber") === 828;
switch (e.target.values) {
Baris 7.780 ⟶ 9.029:
label: 'Choose a preset:',
event: Twinkle.protect.callback.changePreset,
list: (mw.config.get('wgArticleId') ?
Twinkle.protect.protectionTypes.filter(function(v) {
return isTemplate || v.label !== 'Template protection';
}) :
Twinkle.protect.protectionTypesCreate)
});
Baris 7.816 ⟶ 9.069:
value: 'autoconfirmed'
});
if (isTemplate) {
editlevel.append({
type: 'option',
label: 'Template editor',
value: 'templateeditor'
});
}
editlevel.append({
type: 'option',
Baris 7.880 ⟶ 9.140:
value: 'autoconfirmed'
});
if (isTemplate) {
movelevel.append({
type: 'option',
label: 'Template editor',
value: 'templateeditor'
});
}
movelevel.append({
type: 'option',
Baris 7.902 ⟶ 9.169:
{ label: '12 hours', value: '12 hours' },
{ label: '1 day', value: '1 day' },
{ label: '2 days'
{ label: '3 days', value: '3 days' },
{ label: '4 days', value: '4 days' },
Baris 7.908 ⟶ 9.175:
{ label: '2 weeks', value: '2 weeks' },
{ label: '1 month', value: '1 month' },
{ label: '2 months', value: '2 months' },
{ label: '3 months', value: '3 months' },
{ label: '1 year', value: '1 year' },
{ label: 'indefinite', selected: true, value:'indefinite' },
{ label: 'Custom...', value: 'custom' }
]
});
field2.append({
type: 'checkbox',
name: 'pcmodify',
event: Twinkle.protect.formevents.pcmodify,
list: [
{
label: 'Modify pending changes protection',
value: 'pcmodify',
tooltip: 'If this is turned off, the pending changes level, and expiry time, will be left as is.',
checked: true
}
]
});
var pclevel = field2.append({
type: 'select',
name: 'pclevel',
label: 'Pending changes:',
event: Twinkle.protect.formevents.pclevel
});
pclevel.append({
type: 'option',
label: 'None',
value: 'none'
});
pclevel.append({
type: 'option',
label: 'Level 1',
value: 'autoconfirmed',
selected: true
});
pclevel.append({
type: 'option',
label: 'Level 2 (do not use)',
value: 'review'
});
field2.append({
type: 'select',
name: 'pcexpiry',
label: 'Expires:',
event: function(e) {
if (e.target.value === 'custom') {
Twinkle.protect.doCustomExpiry(e.target);
}
},
list: [
{ label: '1 hour', value: '1 hour' },
{ label: '2 hours', value: '2 hours' },
{ label: '3 hours', value: '3 hours' },
{ label: '6 hours', value: '6 hours' },
{ label: '12 hours', value: '12 hours' },
{ label: '1 day', value: '1 day' },
{ label: '2 days', value: '2 days' },
{ label: '3 days', value: '3 days' },
{ label: '4 days', value: '4 days' },
{ label: '1 week', value: '1 week' },
{ label: '2 weeks', value: '2 weeks' },
{ label: '1 month', selected: true, value: '1 month' },
{ label: '2 months', value: '2 months' },
{ label: '3 months', value: '3 months' },
Baris 7.932 ⟶ 9.263:
value: 'autoconfirmed'
});
if (isTemplate) {
createlevel.append({
type: 'option',
label: 'Template editor',
value: 'templateeditor'
});
}
createlevel.append({
type: 'option',
Baris 7.971 ⟶ 9.309:
type: 'textarea',
name: 'protectReason',
label: '
});
if (!mw.config.get('wgArticleId')) { // tagging isn't relevant for non-existing pages
Baris 8.090 ⟶ 9.428:
movelevel: function twinkleprotectFormMovelevelEvent(e) {
e.target.form.moveexpiry.disabled = (e.target.value === 'all');
},
pcmodify: function twinkleprotectFormPcmodifyEvent(e) {
e.target.form.pclevel.disabled = !e.target.checked;
e.target.form.pcexpiry.disabled = !e.target.checked || (e.target.form.pclevel.value === 'none');
e.target.form.pclevel.style.color = e.target.form.pcexpiry.style.color = (e.target.checked ? "" : "transparent");
},
pclevel: function twinkleprotectFormPclevelEvent(e) {
e.target.form.pcexpiry.disabled = (e.target.value === 'none');
},
createlevel: function twinkleprotectFormCreatelevelEvent(e) {
Baris 8.107 ⟶ 9.453:
target.appendChild(option);
target.value = custom;
} else {
target.selectedIndex = 0;
}
};
Twinkle.protect.protectionTypes = [
{ label: 'Unprotection', value: 'unprotect' },
{
label: 'Full protection',
Baris 8.117 ⟶ 9.466:
{ label: 'Content dispute/edit warring (full)', value: 'pp-dispute' },
{ label: 'Persistent vandalism (full)', value: 'pp-vandalism' },
{ label: 'User talk of blocked user (full)', value: 'pp-usertalk' }
]
},
{
label: 'Template protection',
list: [
{ label: 'Highly visible template (TE)', value: 'pp-template' }
]
},
Baris 8.147 ⟶ 9.501:
{ label: 'Highly visible page (move)', value: 'pp-move-indef' }
]
}
];
Twinkle.protect.protectionTypesCreate = [
{ label: 'Unprotection', value: 'unprotect' },
{
label: 'Create protection',
Baris 8.195 ⟶ 9.514:
{ label: 'Recently deleted BLP', value: 'pp-create-blp' }
]
}
];
// A page with both regular and PC protection will be assigned its regular
// protection weight plus 2 (for PC1) or 7 (for PC2)
Twinkle.protect.protectionWeight = {
sysop: 30,
templateeditor: 20,
flaggedrevs_review: 15, // Pending Changes level 2 protection alone
autoconfirmed: 10,
flaggedrevs_autoconfirmed: 5, // Pending Changes level 1 protection alone
all: 0,
flaggedrevs_none: 0 // just in case
};
// NOTICE: keep this synched with [[MediaWiki:Protect-dropdown]]
Baris 8.210 ⟶ 9.540:
edit: 'sysop',
move: 'sysop',
reason: '[[WP:PP#Content disputes|Edit warring /
},
'pp-vandalism': {
Baris 8.216 ⟶ 9.546:
move: 'sysop',
reason: 'Persistent [[WP:Vandalism|vandalism]]'
},
'pp-usertalk': {
Baris 8.226 ⟶ 9.551:
move: 'sysop',
reason: '[[WP:PP#Talk-page protection|Inappropriate use of user talk page while blocked]]'
},
'pp-template': {
edit: 'templateeditor',
move: 'templateeditor',
reason: '[[WP:High-risk templates|Highly visible template]]'
},
'pp-semi-vandalism': {
Baris 8.234 ⟶ 9.564:
'pp-semi-blp': {
edit: 'autoconfirmed',
reason: 'Violations of the [[WP:
template: 'pp-blp'
},
'pp-semi-usertalk': {
edit: 'autoconfirmed',
move: 'sysop',
reason: '[[WP:PP#Talk-page protection|Inappropriate use of user talk page while blocked]]',
template: 'pp-usertalk'
},
'pp-semi-template': { // removed for now
Baris 8.249 ⟶ 9.581:
'pp-semi-sock': {
edit: 'autoconfirmed',
reason: 'Persistent [[WP:Sock puppetry|sock puppetry]]',
template: 'pp-sock'
},
'pp-semi-protected': {
Baris 8.323 ⟶ 9.656:
},
{
label: '
list: [
{ label: '{{pp-vandalism}}: vandalism', value: 'pp-vandalism' },
{ label: '{{pp-dispute}}: dispute/edit war', value: 'pp-dispute', selected: true },
{ label: '{{pp-
{ label: '{{pp-sock}}: sockpuppetry', value: 'pp-sock' },
{ label: '{{pp-template}}: high-risk template', value: 'pp-template' },
{ label: '{{pp-
{ label: '{{pp-protected}}: general protection', value: 'pp-protected' },
{ label: '{{pp-semi-indef}}: general long-term semi-protection', value: 'pp-semi-indef' }
]
},
Baris 8.398 ⟶ 9.720:
form.movemodify.checked = false;
Twinkle.protect.formevents.movemodify({ target: form.movemodify });
}
if (item.stabilize) {
form.pcmodify.checked = true;
Twinkle.protect.formevents.pcmodify({ target: form.pcmodify });
form.pclevel.value = item.stabilize;
Twinkle.protect.formevents.pclevel({ target: form.pclevel });
} else {
form.pcmodify.checked = false;
Twinkle.protect.formevents.pcmodify({ target: form.pcmodify });
}
} else {
Baris 8.424 ⟶ 9.756:
if( /template/.test( form.category.value ) ) {
form.noinclude.checked = true;
form.editexpiry.value = form.moveexpiry.value = form.pcexpiry.value = "indefinite";
} else {
form.noinclude.checked = false;
Baris 8.454 ⟶ 9.786:
}
var tagparams;
if( actiontype === 'tag' || (actiontype === 'protect' && mw.config.get('wgArticleId')) ) {
tagparams = {
tag: form.tagtype.value,
reason: ((form.tagtype.value === 'pp-protected' || form.tagtype.value === 'pp-semi-protected' || form.tagtype.value === 'pp-move') && form.protectReason) ? form.protectReason.value : null,
expiry: (actiontype === 'protect') ?
(form.editmodify.checked ? form.editexpiry.value : (form.movemodify.checked ? form.moveexpiry.value : (form.
)
) : null,
small: form.small.checked,
noinclude: form.noinclude.checked
Baris 8.468 ⟶ 9.805:
case 'protect':
// protect the page
Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
Morebits.wiki.actionCompleted.notice = "Protection complete";
var statusInited = false;
var allDone = function twinkleprotectCallbackAllDone() {
if (thispage) {
thispage.getStatusElement().info("done");
}
if (tagparams) {
Twinkle.protect.callbacks.taggingPageInitial(tagparams);
}
}
var protectIt = function twinkleprotectCallbackProtectIt(next) {
thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Protecting page");
if (mw.config.get('wgArticleId')) {
if (form.editmodify.checked) {
thispage.setEditProtection(form.editlevel.value, form.editexpiry.value);
}
if (form.movemodify.checked) {
thispage.setMoveProtection(form.movelevel.value, form.moveexpiry.value);
}
} else {
thispage.setCreateProtection(form.createlevel.value, form.createexpiry.value);
thispage.setWatchlist(false);
}
if (form.protectReason.value) {
thispage.setEditSummary(form.protectReason.value);
} else {
alert("You must enter a protect reason, which will be inscribed into the protection log.");
return;
}
if (!statusInited) {
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( form );
statusInited = true;
}
thispage.protect(next);
};
var stabilizeIt = function twinkleprotectCallbackStabilizeIt() {
if (thispage) {
thispage.getStatusElement().info("done");
}
thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Applying pending changes protection");
thispage.setFlaggedRevs(form.pclevel.value, form.pcexpiry.value);
if (form.protectReason.value) {
thispage.setEditSummary(form.protectReason.value);
} else {
alert("You must enter a protect reason, which will be inscribed into the protection log.");
return;
}
if (!statusInited) {
Morebits.simpleWindow.setButtonsEnabled(false);
Morebits.status.init(form);
statusInited = true;
}
thispage.stabilize(allDone);
};
if ((form.editmodify && form.editmodify.checked) || (form.movemodify && form.movemodify.checked) ||
!mw.config.get('wgArticleId')) {
if (form.pcmodify && form.pcmodify.checked) {
protectIt(stabilizeIt);
} else {
protectIt(allDone);
}
} else if (form.pcmodify && form.pcmodify.checked) {
stabilizeIt();
} else {
alert("Please give Twinkle something to do! \nIf you just want to tag the page, you can choose the 'Tag page with protection template' option at the top.");
}
break;
Baris 8.519 ⟶ 9.909:
case 'pp-dispute':
case 'pp-vandalism':
case 'pp-usertalk':
case 'pp-protected':
typename = 'full protection';
break;
case 'pp-template':
typename = 'template protection';
break;
case 'pp-semi-vandalism':
case 'pp-semi-usertalk':
case 'pp-semi-sock':
case 'pp-semi-blp':
Baris 8.565 ⟶ 9.956:
break;
case 'pp-template':
typereason = 'Highly visible template';
break;
Baris 8.623 ⟶ 10.013:
Morebits.status.init( form );
var rppName = 'Wikipedia:Requests for page protection';
// Updating data for the action completed event
Baris 8.682 ⟶ 10.072:
if( params.noinclude ) {
text = "<noinclude>{{" + tag + "}}</noinclude>" + text;
} else if( Morebits.wiki.isPageRedirect() ) {
text = text + "\n{{" + tag + "}}";
} else {
text = "{{" + tag + "}}\n" + text;
Baris 8.691 ⟶ 10.083:
protectedPage.setPageText( text );
protectedPage.setCreateOption( 'nocreate' );
protectedPage.suppressProtectWarning(); // no need to let admins know they are editing through protection
protectedPage.save();
},
Baris 8.720 ⟶ 10.113:
'101': 'lpt',
'108': 'lb',
'109': 'lbt',
'118': 'ld',
'119': 'ldt',
'710': 'lttxt',
'711': 'lttxtt',
'828': 'lmd',
'829': 'lmdt'
};
var
// support other namespaces like TimedText
// (this could support talk spaces better, but doesn't seem worth it)
if (!linkTemplate) {
linkTemplate = 'ln|' + Morebits.pageNameNorm.substring(0, Morebits.pageNameNorm.indexOf(':'));
}
var rppRe = new RegExp( '====\\s*\\{\\{\\s*' + linkTemplate + '\\s*\\|\\s*' + RegExp.escape( mw.config.get('wgTitle'), true ) + '\\s*\\}\\}\\s*====', 'm' );
var tag = rppRe.exec( text );
var rppLink = document.createElement('a');
rppLink.setAttribute('href', mw.util.
rppLink.appendChild(document.createTextNode(rppPage.getPageName()));
Baris 8.735 ⟶ 10.141:
}
var newtag = '==== {{' +
if( ( new RegExp( '^' + RegExp.escape( newtag ).replace( /\s+/g, '\\s*' ), 'm' ) ).test( text ) ) {
statusElement.error( [ 'There is already a protection request for this page at ', rppLink, ', aborting.' ] );
Baris 8.756 ⟶ 10.162:
words += params.typename;
newtag += "'''" + Morebits.string.toUpperCaseFirstChar(words) + ( params.reason !== '' ? ( ":''' " +
Morebits.string.formatReasonText(params.reason) ) : ".'''" ) + " ~~~~"; // If either protection type results in a increased status, then post it under increase
// else we post it under decrease
var increase = false;
var protInfo = Twinkle.protect.protectionPresetsInfo[params.category];
// function to compute protection weights (see comment at Twinkle.protect.protectionWeight)
var computeWeight = function(mainLevel, stabilizeLevel) {
var result = Twinkle.protect.protectionWeight[mainLevel || 'all'];
if (stabilizeLevel) {
if (result) {
if (stabilizeLevel.level === "autoconfirmed") {
result += 2;
} else if (stabilizeLevel.level === "review") {
result += 7;
}
} else {
result = Twinkle.protect.protectionWeight["flaggedrevs_" + stabilizeLevel];
}
}
return result;
};
// compare the page's current protection weights with the protection we are requesting
var editWeight = computeWeight(Twinkle.protect.currentProtectionLevels.edit &&
Twinkle.protect.currentProtectionLevels.edit.level,
Twinkle.protect.currentProtectionLevels.stabilize &&
Twinkle.protect.currentProtectionLevels.stabilize.level);
if (computeWeight(protInfo.edit, protInfo.stabilize) > editWeight ||
computeWeight(protInfo.move) > computeWeight(Twinkle.protect.currentProtectionLevels.move &&
Twinkle.protect.currentProtectionLevels.move.level) ||
computeWeight(protInfo.create) > computeWeight(Twinkle.protect.currentProtectionLevels.create &&
Twinkle.protect.currentProtectionLevels.create.level)) {
increase = true;
}
var reg;
if (
reg = /(\n==\s*Current requests for
} else {
reg = /(\n==\s*Current requests for reduction in protection level\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)/;
}
var originalTextLength = text.length;
Baris 8.769 ⟶ 10.211:
{
var linknode = document.createElement('a');
linknode.setAttribute("href", mw.util.
linknode.appendChild(document.createTextNode('How to fix RPP'));
statusElement.error( [ 'Could not find relevant heading on WP:RPP. To fix this problem, please see ', linknode, '.' ] );
Baris 8.775 ⟶ 10.217:
}
statusElement.status( 'Adding new request...' );
rppPage.setEditSummary( "Requesting " + params.typename +
Morebits.pageNameNorm + ']].' + Twinkle.getPref('summaryAd') );
rppPage.setPageText( text );
rppPage.setCreateOption( 'recreate' );
Baris 8.781 ⟶ 10.224:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 8.791 ⟶ 10.244:
*
* NOTE FOR DEVELOPERS:
* If adding a new criterion,
* twinkleconfig.js. Also check out the default values of the CSD preferences
* in twinkle.js, and add your new criterion to those if you think it would be
* good.
*/
Baris 8.804 ⟶ 10.258:
}
};
// This function is run when the CSD tab/header link is clicked
Twinkle.speedy.callback = function twinklespeedyCallback() {
Twinkle.speedy.initDialog(Morebits.userIsInGroup( 'sysop' ) ? Twinkle.speedy.callback.evaluateSysop : Twinkle.speedy.callback.evaluateUser, true);
};
Twinkle.speedy.dialog = null;
// The speedy criteria list can be in one of several modes
Twinkle.speedy.mode = {
sysopSubmit: 1, // radio buttons, no subgroups, submit when "Submit" button is clicked
sysopRadioClick: 2, // radio buttons, no subgroups, submit when a radio button is clicked
userMultipleSubmit: 3, // check boxes, subgroups, "Submit" button already pressent
userMultipleRadioClick: 4, // check boxes, subgroups, need to add a "Submit" button
userSingleSubmit: 5, // radio buttons, subgroups, submit when "Submit" button is clicked
userSingleRadioClick: 6, // radio buttons, subgroups, submit when a radio button is clicked
// are we in "delete page" mode?
// (sysops can access both "delete page" [sysop] and "tag page only" [user] modes)
isSysop: function twinklespeedyModeIsSysop(mode) {
return mode === Twinkle.speedy.mode.sysopSubmit ||
mode === Twinkle.speedy.mode.sysopRadioClick;
},
// do we have a "Submit" button once the form is created?
hasSubmitButton: function twinklespeedyModeHasSubmitButton(mode) {
return mode === Twinkle.speedy.mode.sysopSubmit ||
mode === Twinkle.speedy.mode.userMultipleSubmit ||
mode === Twinkle.speedy.mode.userMultipleRadioClick ||
mode === Twinkle.speedy.mode.userSingleSubmit;
},
// is db-multiple the outcome here?
isMultiple: function twinklespeedyModeIsMultiple(mode) {
return mode === Twinkle.speedy.mode.userMultipleSubmit ||
mode === Twinkle.speedy.mode.userMultipleRadioClick;
},
// do we want subgroups? (if not we have to use prompt())
wantSubgroups: function twinklespeedyModeWantSubgroups(mode) {
return !Twinkle.speedy.mode.isSysop(mode);
}
};
// Prepares the speedy deletion dialog and displays it
Baris 8.824 ⟶ 10.307:
Twinkle.speedy.dialog = new Morebits.simpleWindow( Twinkle.getPref('speedyWindowWidth'), Twinkle.getPref('speedyWindowHeight') );
dialog = Twinkle.speedy.dialog;
dialog.setTitle( "
dialog.setScriptName( "Twinkle" );
dialog.addFooterLink( "
dialog.addFooterLink( "
var form = new Morebits.quickForm( callbackfunc, (Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null) );
Baris 8.835 ⟶ 10.318:
list: [
{
label: '
value: 'tag_only',
name: 'tag_only',
tooltip: '
checked : Twinkle.getPref('deleteSysopDefaultToTag'),
event: function( event ) {
Baris 8.859 ⟶ 10.342:
cForm.multiple.checked = false;
Twinkle.speedy.callback.
event.stopPropagation();
Baris 8.866 ⟶ 10.349:
]
} );
form.append( { type: 'header', label: '
if (mw.config.get('wgNamespaceNumber') % 2 === 0 && (mw.config.get('wgNamespaceNumber') !== 2 || (/\//).test(mw.config.get('wgTitle')))) { // hide option for user pages, to avoid accidentally deleting user talk page
form.append( {
Baris 8.872 ⟶ 10.355:
list: [
{
label: '
value: 'talkpage',
name: 'talkpage',
tooltip: "
checked: Twinkle.getPref('deleteTalkPageOnDelete'),
disabled: Twinkle.getPref('deleteSysopDefaultToTag'),
Baris 8.889 ⟶ 10.372:
list: [
{
label: '
value: 'redirects',
name: 'redirects',
tooltip: "
checked: Twinkle.getPref('deleteRedirectsOnDelete'),
disabled: Twinkle.getPref('deleteSysopDefaultToTag'),
Baris 8.901 ⟶ 10.384:
]
} );
form.append( { type: 'header', label: '
}
Baris 8.908 ⟶ 10.391:
list: [
{
label: '
value: 'notify',
name: 'notify',
tooltip: "
"
checked: !Morebits.userIsInGroup( 'sysop' ) || Twinkle.getPref('deleteSysopDefaultToTag'),
disabled: Morebits.userIsInGroup( 'sysop' ) && !Twinkle.getPref('deleteSysopDefaultToTag'),
Baris 8.925 ⟶ 10.408:
list: [
{
label: 'Tag
value: 'multiple',
name: 'multiple',
tooltip: "
disabled: Morebits.userIsInGroup( 'sysop' ) && !Twinkle.getPref('deleteSysopDefaultToTag'),
event: function( event ) {
Twinkle.speedy.callback.
event.stopPropagation();
}
Baris 8.952 ⟶ 10.435:
dialog.display();
Twinkle.speedy.callback.
};
Twinkle.speedy.callback.
var namespace = mw.config.get('wgNamespaceNumber');
// first figure out what mode we're in
var mode = Twinkle.speedy.mode.userSingleSubmit;
if (form.tag_only && !form.tag_only.checked) {
mode = Twinkle.speedy.mode.sysopSubmit;
} else {
if (form.multiple.checked) {
mode = Twinkle.speedy.mode.userMultipleSubmit;
} else {
mode = Twinkle.speedy.mode.userSingleSubmit;
}
}
if (Twinkle.getPref('speedySelectionStyle') === 'radioClick') {
mode++;
}
var work_area = new Morebits.quickForm.element( {
Baris 8.964 ⟶ 10.461:
} );
if (mode === Twinkle.speedy.mode.userMultipleRadioClick) {
work_area.append( {
type: 'div',
label: '
} );
work_area.append( {
type: 'button',
name: 'submit-multiple',
label: '
event: function( event ) {
Twinkle.speedy.callback.evaluateUser( event );
Baris 8.980 ⟶ 10.477:
}
var radioOrCheckbox = (
if (namespace % 2 === 1 && namespace !== 3) {
// show db-talk on talk pages, but not user talk pages work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.talkList, mode) } );
}
Baris 8.990 ⟶ 10.488:
case 0: // article
case 1: // talk
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.
break;
case 2: // user
case 3: // user talk
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.
break;
case 6: // file
case 7: // file talk
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.
if (!Twinkle.speedy.mode.isSysop(mode)) {
work_area.append( { type: 'div', label: 'Tagging for CSD F4 (no license), F5 (orphaned fair use), F6 (no fair use rationale), and F11 (no permission) can be done using Twinkle\'s "DI" tab.' } );
}
break;
case 10: // template
case 11: // template talk
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.
break;
case 14: // category
case 15: // category talk
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.categoryList, mode) } );
break;
case 100: // portal
case 101: // portal talk
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.
break;
Baris 9.029 ⟶ 10.529:
}
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.
work_area.append( { type: 'header', label: '
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.redirectList, mode) } );
var old_area = Morebits.quickForm.getElements(form, "work_area")[0];
form.replaceChild(work_area.render(), old_area);
};
Twinkle.speedy.generateCsdList = function twinklespeedyGenerateCsdList(list, mode) {
// mode switches
var isSysop = Twinkle.speedy.mode.isSysop(mode);
var multiple = Twinkle.speedy.mode.isMultiple(mode);
var wantSubgroups = Twinkle.speedy.mode.wantSubgroups(mode);
var hasSubmitButton = Twinkle.speedy.mode.hasSubmitButton(mode);
var openSubgroupHandler = function(e) {
$(e.target.form).find('input').prop('disabled', true);
$(e.target.form).children().css('color', 'gray');
$(e.target).parent().css('color', 'black').find('input').prop('disabled', false);
$(e.target).parent().find('input:text')[0].focus();
e.stopPropagation();
};
var submitSubgroupHandler = function(e) {
Twinkle.speedy.callback.evaluateUser(e);
e.stopPropagation();
};
return $.map(list, function(critElement) {
var criterion = $.extend({}, critElement);
if (!wantSubgroups) {
criterion.subgroup = null;
}
if (multiple) {
if (criterion.hideWhenMultiple) {
return null;
}
if (criterion.hideSubgroupWhenMultiple) {
criterion.subgroup = null;
}
} else {
if (criterion.hideWhenSingle) {
return null;
}
if (criterion.hideSubgroupWhenSingle) {
criterion.subgroup = null;
}
}
if (isSysop) {
if (criterion.hideWhenSysop) {
return null;
}
if (criterion.hideSubgroupWhenSysop) {
criterion.subgroup = null;
}
} else {
if (criterion.hideWhenUser) {
return null;
}
if (criterion.hideSubgroupWhenUser) {
criterion.subgroup = null;
}
}
if (criterion.subgroup && !hasSubmitButton) {
if ($.isArray(criterion.subgroup)) {
criterion.subgroup.push({
type: 'button',
name: 'submit',
label: 'Submit Query',
event: submitSubgroupHandler
});
} else {
criterion.subgroup = [
criterion.subgroup,
{
type: 'button',
name: 'submit', // ends up being called "csd.submit" so this is OK
label: 'Submit Query',
event: submitSubgroupHandler
}
];
}
criterion.event = openSubgroupHandler;
}
return criterion;
});
};
Baris 9.047 ⟶ 10.631:
];
Twinkle.speedy.fileList = [
{
label: 'F1: Redundant file',
value: 'redundantimage',
tooltip: 'Any file that is a redundant copy, in the same file format and same or lower resolution, of something else on Wikipedia. Likewise, other media that is a redundant copy, in the same format and of the same or lower quality. This does not apply to files duplicated on Wikimedia Commons, because of licence issues; these should be tagged with {{subst:ncd|Image:newname.ext}} or {{subst:ncd}} instead',
name: 'redundantimage_filename',
type: 'input',
label: 'File this is redundant to: ',
tooltip: 'The "File:" prefix can be left off.'
}
},
label: 'F2: Corrupt or blank file',
value: 'noimage',
tooltip: 'Before deleting this type of file, verify that the MediaWiki engine cannot read it by previewing a resized thumbnail of it. This also includes empty (i.e., no content) file description pages for Commons files'
},
{
label: 'F2: Unneeded file description page for a file on Commons',
value: 'fpcfail',
tooltip: 'An image, hosted on Commons, but with tags or information on its English Wikipedia description page that are no longer needed. (For example, a failed featured picture candidate.)',
hideWhenMultiple: true
},
{
label: 'F3: Improper license',
value: 'noncom',
tooltip: 'Files licensed as "for non-commercial use only", "non-derivative use" or "used with permission" that were uploaded on or after 2005-05-19, except where they have been shown to comply with the limited standards for the use of non-free content. This includes files licensed under a "Non-commercial Creative Commons License". Such files uploaded before 2005-05-19 may also be speedily deleted if they are not used in any articles'
},
{
label: 'F4: Lack of licensing information',
value: 'unksource',
tooltip: 'Files in category "Files with unknown source", "Files with unknown copyright status", or "Files with no copyright tag" that have been tagged with a template that places them in the category for more than seven days, regardless of when uploaded. Note, users sometimes specify their source in the upload summary, so be sure to check the circumstances of the file.',
hideWhenUser: true
},
{
label: 'F5: Unused unfree copyrighted file',
value: 'unfree',
tooltip: 'Files that are not under a free license or in the public domain that are not used in any article and that have been tagged with a template that places them in a dated subcategory of Category:Orphaned fairuse files for more than seven days. Reasonable exceptions may be made for file uploaded for an upcoming article. Use the "Orphaned fair use" option in Twinkle\'s DI module to tag files for forthcoming deletion.',
hideWhenUser: true
},
{
label: 'F6: Missing fair-use rationale',
value: 'norat',
tooltip: 'Any file without a fair use rationale may be deleted seven days after it is uploaded. Boilerplate fair use templates do not constitute a fair use rationale. Files uploaded before 2006-05-04 should not be deleted immediately; instead, the uploader should be notified that a fair-use rationale is needed. Files uploaded after 2006-05-04 can be tagged using the "No fair use rationale" option in Twinkle\'s DI module. Such files can be found in the dated subcategories of Category:Files with no fair use rationale.',
hideWhenUser: true
},
label: 'F7: Clearly invalid fair-use tag',
value: 'badfairuse', // same as below
tooltip: 'This is only for files with a clearly invalid fair-use tag, such as a {{Non-free logo}} tag on a photograph of a mascot. For cases that require a waiting period (replaceable images or otherwise disputed rationales), use the options on Twinkle\'s DI tab.',
subgroup: {
name: 'badfairuse_reason',
type: 'input',
label: 'Optional explanation: ',
size: 60
}
},
{
label: 'F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary',
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.',
subgroup: {
name: 'badfairuse_reason',
label: 'Optional explanation: ',
size: 60
},
hideWhenMultiple: true
},
{
label: 'F8: File available as an identical or higher-resolution copy on Wikimedia Commons',
value: 'nowcommons',
tooltip: 'Provided the following conditions are met: 1: The file format of both images is the same. 2: The file\'s license and source status is beyond reasonable doubt, and the license is undoubtedly accepted at Commons. 3: All information on the file description page is present on the Commons file description page. That includes the complete upload history with links to the uploader\'s local user pages. 4: The file is not protected, and the file description page does not contain a request not to move it to Commons. 5: If the file is available on Commons under a different name than locally, all local references to the file must be updated to point to the title used at Commons. 6: For {{c-uploaded}} files: They may be speedily deleted as soon as they are off the Main Page',
subgroup: {
type: 'input',
label: 'Filename on Commons: ',
value: Morebits.pageNameNorm,
tooltip: 'This can be left blank if the file has the same name on Commons as here. The "File:" prefix is optional.'
},
hideWhenMultiple: true
},
{
label: 'F9: Unambiguous copyright infringement',
value: 'imgcopyvio',
tooltip: 'The file was copied from a website or other source that does not have a license compatible with Wikipedia, and the uploader neither claims fair use nor makes a credible assertion of permission of free use. Sources that do not have a license compatible with Wikipedia include stock photo libraries such as Getty Images or Corbis. Non-blatant copyright infringements should be discussed at Wikipedia:Files for deletion',
subgroup: {
name: 'imgcopyvio_url',
type: 'input',
label: 'URL of the copyvio, including the "http://". If you cannot provide a URL, please do not use CSD F9. (Exception: for copyvios of non-Internet sources, leave the box blank.) ',
size: 60
}
},
{
label: 'F10: Useless non-media file',
value: 'badfiletype',
tooltip: 'Files uploaded that are neither image, sound, nor video files (e.g. .doc, .pdf, or .xls files) which are not used in any article and have no foreseeable encyclopedic use'
},
{
label: 'F11: No evidence of permission',
value: 'nopermission',
tooltip: 'If an uploader has specified a license and has named a third party as the source/copyright holder without providing evidence that this third party has in fact agreed, the item may be deleted seven days after notification of the uploader',
hideWhenUser: true
},
{
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.'
}
];
Twinkle.speedy.
{
label: 'A1: No context. Articles lacking sufficient context to identify the subject of the article.',
tooltip: 'Example: "He is a funny man with a red car. He makes people laugh." This applies only to very short articles. Context is different from content, treated in A3, below.'
},
label: 'A2: Foreign language articles that exist on another Wikimedia project',
value: 'foreign',
tooltip: 'If the article in question does not exist on another project, the template {{notenglish}} should be used instead. All articles in a non-English language that do not meet this criteria (and do not meet any other criteria for speedy deletion) should be listed at Pages Needing Translation (PNT) for review and possible translation',
subgroup: {
name: 'foreign_source',
type: 'input',
label: 'Interwiki link to the article on the foreign-language wiki: ',
tooltip: 'For example, fr:Bonjour'
}
}
{
label: '
value: 'nocontent',
tooltip: 'Any article consisting only of links elsewhere (including hyperlinks, category tags and "see also" sections), a rephrasing of the title, and/or attempts to correspond with the person or group named by its title. This does not include disambiguation pages'
},
{
label: 'A5: Transwikied articles',
value: 'transwiki',
tooltip: 'Any article that has been discussed at Articles for Deletion (et al), where the outcome was to transwiki, and where the transwikification has been properly performed and the author information recorded. Alternately, any article that consists of only a dictionary definition, where the transwikification has been properly performed and the author information recorded'
}
{
label: 'A7: Unremarkable people, groups, companies, web content, individual animals, or organized events',
value: 'a7',
tooltip: 'An article about a real person, group of people, band, club, company, web content, individual animal, tour, or party that does not assert the importance or significance of its subject. If controversial, or if a previous AfD has resulted in the article being kept, the article should be nominated for AfD instead',
hideWhenSingle: true
},
{
label: 'A7: Unremarkable person',
tooltip: 'An article about a real person that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead',
hideWhenMultiple: true
},
{
hideWhenMultiple: true
},
{
value: 'club',
tooltip: 'Article about a club that does not assert the importance or significance of the subject',
hideWhenMultiple: true
},
{
label: 'A7: Unremarkable company or organization',
value: 'corp', tooltip: 'Article about a company or organization that does not assert the importance or significance of the subject', hideWhenMultiple: true
},
{
label: 'A7: Unremarkable website or web content',
value: 'web',
tooltip: 'Article about a web site, blog, online forum, webcomic, podcast, or similar web content that does not assert the importance or significance of its subject',
hideWhenMultiple: true
},
{
label: 'A7: Unremarkable individual animal',
value: 'animal', tooltip: 'Article about an individual animal (e.g. pet) that does not assert the importance or significance of its subject', hideWhenMultiple: true
},
{
value: 'event',
tooltip: 'Article about an organized event (tour, function, meeting, party, etc.) that does not assert the importance or significance of its subject',
hideWhenMultiple: true
},
{
label: 'A9: Unremarkable musical recording where artist\'s article doesn\'t exist',
value: 'a9',
tooltip: 'An article about a musical recording which does not indicate why its subject is important or significant, and where the artist\'s article has never existed or has been deleted'
}
{
label: 'A10:
value: 'a10',
tooltip: 'A recently created article with no relevant page history that does not aim to expand upon, detail or improve information within any existing article(s) on the subject, and where the title is not a plausible redirect. This does not include content forks, split pages or any article that aims at expanding or detailing an existing one.',
subgroup: {
name: 'a10_article',
type: 'input',
label: 'Article that is duplicated: '
}
},
{
label: 'A11: Obviously made up by creator, and no claim of significance',
value: 'madeup',
tooltip: 'An article which plainly indicates that the subject was invented/coined/discovered by the article\'s creator or someone they know personally, and does not credibly indicate why its subject is important or significant'
}
];
Twinkle.speedy.categoryList = [
{
label: 'C1:
value: '
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'
}
{
label: 'G8: Categories populated by a deleted or retargeted template',
value: 'templatecat',
tooltip: 'This is for situations where a category is effectively empty, because the template(s) that formerly placed pages in that category are now deleted. This excludes categories that are still in use.'
}
];
Twinkle.speedy.
{
label: 'U1: User request',
value: 'userreq',
tooltip: 'Personal subpages, upon request by their user. In some rare cases there may be administrative need to retain the page. Also, sometimes, main user pages may be deleted as well. See Wikipedia:User page for full instructions and guidelines',
subgroup: ((mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1) ? {
name: 'userreq_rationale',
type: 'input',
label: 'A mandatory rationale to explain why this user talk page should be deleted: ',
tooltip: 'User talk pages are deleted only in highly exceptional circumstances. See WP:DELTALK.',
size: 60
} : null),
hideSubgroupWhenMultiple: true
},
{
label: 'U2: Nonexistent user',
value: 'nouser',
tooltip: 'User pages of users that do not exist (Check Special:Listusers)'
},
{
tooltip: 'Galleries in the userspace which consist mostly of "fair use" or non-free files. Wikipedia\'s non-free content policy forbids users from displaying non-free files, even ones they have uploaded themselves, in userspace. It is acceptable to have free files, GFDL-files, Creative Commons and similar licenses along with public domain material, but not "fair use" files'
},
label: 'U5: Blatant WP:NOTWEBHOST violations',
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: '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
}
];
Twinkle.speedy.
{
label: 'T2: Templates that are blatant misrepresentations of established policy',
value: 'policy',
tooltip: 'This includes "speedy deletion" templates for issues that are not speedy deletion criteria and disclaimer templates intended to be used in articles'
},
label: 'T3: Duplicate templates or hardcoded instances',
value: 'duplicatetemplate',
tooltip: 'Templates that are either substantial duplications of another template or hardcoded instances of another template where the same functionality could be provided by that other template',
name: 'duplicatetemplate_2',
type: 'input',
label: 'Template this is redundant to: ',
tooltip: 'The "Template:" prefix is not needed.'
},
hideWhenMultiple: true
},
{
label: 'T3: Templates that are not employed in any useful fashion',
value: 't3',
tooltip: 'This criterion allows you to provide a rationale. In many cases, another criterion will be more appropriate, such as G1, G2, G6, or G8.',
subgroup: {
name: 't3_rationale',
type: 'input',
label: 'Rationale: ',
tooltip: 'The rationale is required.',
size: 60
},
hideWhenMultiple: true
}
];
Twinkle.speedy.
{
label: 'P1: Portal that would be subject to speedy deletion if it were an article',
value: 'p1',
tooltip: 'You must specify the article criterion that applies in this case (A1, A3, A7, or A10).',
name: 'p1_1',
type: 'select',
label: 'Article criterion that would apply: '
},
hideWhenMultiple: true
},
{
label: 'P2: Underpopulated portal',
value: 'emptyportal',
tooltip: 'Any Portal based on a topic for which there is not a non-stub header article, and at least three non-stub articles detailing subject matter that would be appropriate to discuss under the title of that Portal'
}
];
Twinkle.speedy.
{
label: 'Custom rationale' + (Morebits.userIsInGroup('sysop') ? ' (custom deletion reason)' : ' using {{db}} template'),
value: 'reason',
tooltip: '{{db}} is short for "delete because". At least one of the other deletion criteria must still apply to the page, and you must make mention of this in your rationale. This is not a "catch-all" for when you can\'t find any criteria that fit.',
subgroup: {
name: 'reason_1',
type: 'input',
label: 'Rationale: ',
size: 60
},
hideWhenMultiple: true,
hideSubgroupWhenSysop: true
},
{
label: 'G1: Patent nonsense. Pages consisting purely of incoherent text or gibberish with no meaningful content or history.',
value: 'nonsense',
tooltip: 'This does not include poor writing, partisan screeds, obscene remarks, vandalism, fictional material, material not in English, poorly translated material, implausible theories, or hoaxes. In short, if you can understand it, G1 does not apply.'
},
{
label: 'G2: Test page',
value: 'test',
tooltip: 'A page created to test editing or other Wikipedia functions. Pages in the User namespace are not included, nor are valid but unused or duplicate templates (although criterion T3 may apply).'
},
{
label: 'G3: Pure vandalism',
value: 'vandalism',
tooltip: 'Plain pure vandalism (including redirects left behind from pagemove vandalism)'
},
{
label: 'G3: Blatant hoax',
value: 'hoax',
tooltip: 'Blatant and obvious hoax, to the point of vandalism',
hideWhenMultiple: true
},
{
label: 'G4: Recreation of material deleted via a deletion discussion',
value: 'repost',
tooltip: 'A copy, by any title, of a page that was deleted via an XfD process or Deletion review, provided that the copy is substantially identical to the deleted version. This clause does not apply to content that has been "userfied", to content undeleted as a result of Deletion review, or if the prior deletions were proposed or speedy deletions, although in this last case, other speedy deletion criteria may still apply',
subgroup: {
name: 'repost_1',
type: 'input',
label: 'Page where the deletion discussion took place: ',
tooltip: 'Must start with "Wikipedia:"',
size: 60
}
},
{
label: 'G5: Banned or blocked user',
value: 'banned',
tooltip: 'Pages created by banned or blocked users in violation of their ban or block, and which have no substantial edits by others',
subgroup: {
name: 'banned_1',
type: 'input',
label: 'Username of banned user (if available): ',
tooltip: 'Should not start with "User:"'
},
hideSubgroupWhenMultiple: true
},
{
label: 'G6: History merge',
value: 'histmerge',
tooltip: 'Temporarily deleting a page in order to merge page histories',
subgroup: {
name: 'histmerge_1',
type: 'input',
label: 'Page to be merged into this one: '
},
hideWhenMultiple: true
},
{
label: 'G6: Move',
value: 'move',
tooltip: 'Making way for an uncontroversial move like reversing a redirect',
subgroup: [
{
name: 'move_1',
type: 'input',
label: 'Page to be moved here: '
},
{
name: 'move_2',
type: 'input',
label: 'Reason: ',
size: 60
}
],
hideWhenMultiple: true
},
{
label: 'G6: XfD',
value: 'xfd',
tooltip: 'An admin has closed a deletion discussion (at AfD, FfD, RfD, TfD, CfD, or MfD) as "delete", but they didn\'t actually delete the page.',
subgroup: {
name: 'xfd_fullvotepage',
type: 'input',
label: 'Page where the deletion discussion was held: ',
size: 40
},
hideWhenMultiple: true
},
{
label: 'G6: Unnecessary disambiguation page',
value: 'disambig',
tooltip: 'This only applies for orphaned disambiguation pages which either: (1) disambiguate two or fewer existing Wikipedia pages and whose title ends in "(disambiguation)" (i.e., there is a primary topic); or (2) disambiguates no (zero) existing Wikipedia pages, regardless of its title.',
hideWhenMultiple: true
},
{
label: 'G6: Redirect to malplaced disambiguation page',
value: 'movedab',
tooltip: 'This only applies for redirects to disambiguation pages ending in (disambiguation) where a primary topic does not exist.',
hideWhenMultiple: true
},
{
label: 'G6: Copy-and-paste page move',
value: 'copypaste',
tooltip: 'This only applies for a copy-and-paste page move of another page that needs to be temporarily deleted to make room for a clean page move.',
subgroup: {
name: 'copypaste_1',
type: 'input',
label: 'Original page that was copy-pasted here: '
},
hideWhenMultiple: true
},
{
label: 'G6: Housekeeping',
value: 'g6',
tooltip: 'Other non-controversial "housekeeping" tasks',
subgroup: {
name: 'g6_rationale',
type: 'input',
label: 'Rationale: ',
size: 60
}
},
{
label: 'G7: Author requests deletion, or author blanked',
value: 'author',
tooltip: 'Any page for which deletion is requested by the original author in good faith, provided the page\'s only substantial content was added by its author. If the author blanks the page, this can also be taken as a deletion request.',
subgroup: {
name: 'author_rationale',
type: 'input',
label: 'Optional explanation: ',
tooltip: 'Perhaps linking to where the author requested this deletion.',
size: 60
}
},
{
label: 'G8: Pages dependent on a non-existent or deleted page',
value: 'g8',
tooltip: 'such as talk pages with no corresponding subject page; subpages with no parent page; file pages without a corresponding file; redirects to invalid targets, such as nonexistent targets, redirect loops, and bad titles; or categories populated by deleted or retargeted templates. This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.',
subgroup: {
name: 'g8_rationale',
type: 'input',
label: 'Optional explanation: ',
size: 60
}
},
{
label: 'G8: Subpages with no parent page',
value: 'subpage',
tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.',
hideWhenMultiple: true
},
{
label: 'G10: Attack page',
value: 'attack',
tooltip: 'Pages that serve no purpose but to disparage their subject or some other entity (e.g., "John Q. Doe is an imbecile"). This includes a biography of a living person that is negative in tone and unsourced, where there is no NPOV version in the history to revert to. Administrators deleting such pages should not quote the content of the page in the deletion summary!'
},
{
label: 'G10: Wholly negative, unsourced BLP',
value: 'negublp',
tooltip: 'A biography of a living person that is entirely negative in tone and unsourced, where there is no neutral version in the history to revert to.',
hideWhenMultiple: true
},
{
label: 'G11: Unambiguous advertising',
value: 'spam',
tooltip: 'Pages which exclusively promote a company, product, group, service, or person and which would need to be fundamentally rewritten in order to become encyclopedic. Note that an article about a company or a product which describes its subject from a neutral point of view does not qualify for this criterion; an article that is blatant advertising should have inappropriate content as well'
},
{
label: 'G12: Unambiguous copyright infringement',
value: 'copyvio',
tooltip: 'Either: (1) Material was copied from another website that does not have a license compatible with Wikipedia, or is photography from a stock photo seller (such as Getty Images or Corbis) or other commercial content provider; (2) There is no non-infringing content in the page history worth saving; or (3) The infringement was introduced at once by a single person rather than created organically on wiki and then copied by another website such as one of the many Wikipedia mirrors',
subgroup: [
{
name: 'copyvio_url',
type: 'input',
label: 'URL (if available): ',
tooltip: 'If the material was copied from an online source, put the URL here, including the "http://" or "https://" protocol. If the URL is on the spam blacklist, you can leave off the protocol.',
size: 60
},
{
name: 'copyvio_url2',
type: 'input',
label: 'Additional URL: ',
tooltip: 'Optional.',
size: 60
},
{
name: 'copyvio_url3',
type: 'input',
label: 'Additional URL: ',
tooltip: 'Optional.',
size: 60
}
]
},
{
label: 'G13: Old, abandoned Articles for Creation submissions',
value: 'afc',
tooltip: 'Any rejected or unsubmitted AfC submission that has not been edited for more than 6 months.'
}
];
Twinkle.speedy.redirectList = [
{
label: 'R2:
value: '
tooltip: '(this does not include the Wikipedia shortcut pseudo-namespaces). If this was the result of a page move, consider waiting a day or two before deleting the redirect'
},
{
label: 'R3:
value: '
tooltip: 'However, redirects from common misspellings or misnomers are generally useful, as are redirects in other languages'
}
{
label: 'G8: Redirects to invalid targets, such as nonexistent targets, redirect loops, and bad titles',
value: 'redirnone',
tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.'
}
];
Twinkle.speedy.normalizeHash = {
'reason': 'db',
'nonsense': '
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'
'nocontext': 'a1',
'foreign': 'a2',
'nocontent': 'a3',
'transwiki': 'a5',
'a7': 'a7',
'person': 'a7',
Baris 9.484 ⟶ 11.216:
'a9': 'a9',
'a10': 'a10',
'madeup': 'a11',
'rediruser': 'r2',
'redirtypo': 'r3',
'
'
'
'
'
'
'
'
'
'
'
'
'catempty': 'c1',
'
'
'
'
'
'duplicatetemplate': 't3',
't3': 't3',
'p1': 'p1',
'emptyportal': 'p2'
};
Baris 9.532 ⟶ 11.247:
'reason': '',
// General
'nonsense': '[[WP:PN|Patent nonsense]], meaningless, or incomprehensible',
'
'
'hoax': 'Blatant [[WP:Do not create hoaxes|hoax]]',
'repost': 'Recreation of a page that was [[WP:DEL|deleted]] per a [[WP:XFD|deletion discussion]]',
'banned': 'Creation by a [[WP:BLOCK|blocked]] or [[WP:BAN|banned]] user in violation of block or ban',
'histmerge': 'Temporary deletion in order to merge page histories',
'move': 'Making way for a non-controversial move',
'xfd': 'Deleting page per result of [[WP:XfD|deletion discussion]]',
'disambig': 'Unnecessary disambiguation page',
'movedab': 'Redirect to [[WP:MALPLACED|malplaced disambiguation page]]',
'copypaste': '[[WP:CPMV|Copy-and-paste]] page move',
'g6': 'Housekeeping and routine (non-controversial) cleanup',
'author': 'One author who has requested deletion or blanked the page',
'g8': 'Page dependent on 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',
'redirnone': '[[Wikipedia:Redirect|redirect]] to a deleted or nonexistent page',
'templatecat': 'Populated by deleted or retargeted templates',
'imagepage': 'File description page for a file that does not exist',
'attack': '[[WP:ATP|Attack page]] or negative unsourced [[WP:BLP|BLP]]',
'negublp': 'Negative unsourced [[WP:BLP|BLP]]',
'spam': 'Unambiguous [[WP:NOTADVERTISING|advertising]] or promotion',
'copyvio': 'Unambiguous [[WP:C|copyright infringement]]',
'afc': 'Abandoned [[WP:AFC|Article for creation]] – to retrieve it, see [[WP:REFUND/G13]]',
// Articles
'nocontext': 'Short article without enough context to identify the subject',
'foreign': 'Article in a foreign language that exists on another project',
'nocontent': 'Article that has no meaningful, substantive content',
'transwiki': 'Article that has been transwikied to another project',
'a7': 'No explanation of the subject\'s significance (real person, animal, organization, or web content)',
'person' : 'No explanation of the subject\'s significance (real person)',
'web': 'No explanation of the subject\'s significance (web content)',
'corp': 'No explanation of the subject\'s significance (organization)',
'club': 'No explanation of the subject\'s significance (organization)',
'band': 'No explanation of the subject\'s significance (band/musician)',
'animal': 'No explanation of the subject\'s significance (individual animal)',
'event': 'No explanation of the subject\'s significance (event)',
'a9': 'Music recording by redlinked artist and no indication of importance or significance',
'a10': 'Recently created article that duplicates an existing topic',
'madeup': 'Made up by article creator or an associate, and no indication of importance/significance',
// Images and media
'redundantimage': 'File redundant to another on Wikipedia',
'
'fpcfail': 'Unneeded file description page for a file on Commons',
'noncom': 'File with improper license',
'unksource': 'Lack of licensing information',
'unfree': 'Unused non-free media',
'norat': 'Non-free file without [[WP:RAT|fair-use rationale]]',
'badfairuse': 'Violates [[WP:F|non-free use policy]]',
'nowcommons': 'Media file available on Commons',
'imgcopyvio': 'Unambiguous [[WP:COPYVIO|copyright violation]]',
'badfiletype': 'Useless media file (not an image, audio or video)',
'nopermission': 'No evidence of permission',
// Categories
'
// User pages
'userreq': 'User request to delete page in own userspace',
'nouser': 'Userpage or subpage of a nonexistent user',
'gallery': '[[WP:NFC|Non-free]] [[Help:Gallery|gallery]]',
'notwebhost': '[[WP:NOTWEBHOST|Misuse of Wikipedia as a web host]]',
// Templates
'policy': 'Template that unambiguously misrepresents established policy',
'duplicatetemplate': 'Unused, redundant template',
't3': 'Unused, redundant template',
// Portals
'p1': '[[WP:P|Portal]] page that would be subject to speedy deletion as an article',
'
// Redirects
'rediruser': 'Cross-[[WP:NS|namespace]] [[WP:R|redirect]] from mainspace',
'redirtypo': 'Recently created, implausible [[WP:R|redirect]]'
};
Baris 9.584 ⟶ 11.323:
sysop: {
main: function( params ) {
var thispage;
Morebits.wiki.addCheckpoint(); // prevent actionCompleted from kicking in until user interaction is done
// look up initial contributor. If prompting user for deletion reason, just display a link.
// Otherwise open the talk page directly
if( params.openusertalk ) {
thispage = new Morebits.wiki.page( mw.config.get('wgPageName') ); // a necessary evil, in order to clear incorrect status text
thispage.setCallbackParameters( params );
thispage.lookupCreator( Twinkle.speedy.callbacks.sysop.openUserTalkPage );
}
// delete page
var reason;
thispage = new Morebits.wiki.page( mw.config.get('wgPageName'), "Deleting page" );
if (params.normalized === 'db') {
reason = prompt("
} else {
var presetReason = "[[WP:
if (Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
reason = prompt("
} else {
reason = presetReason;
}
}
if (
Morebits.status.error("
Morebits.wiki.removeCheckpoint();
return;
} else if (!reason || !reason.replace(/^\s*/, "").replace(/\s*$/, "")) {
Morebits.status.error("Asking for reason", "you didn't give one. I don't know... what with admins and their apathetic antics... I give up...");
Morebits.wiki.removeCheckpoint();
return;
}
thispage.setEditSummary( reason + Twinkle.getPref('deletionSummaryAd') );
thispage.deletePage(function()
thispage.getStatusElement().info("done");
Twinkle.speedy.callbacks.sysop.deleteTalk( params );
});
Morebits.wiki.removeCheckpoint();
},
deleteTalk: function( params ) {
// delete talk page
if (params.deleteTalkPage &&
var talkpage = new Morebits.wiki.page( Morebits.wikipedia.namespaces[ mw.config.get('wgNamespaceNumber') + 1 ] + ':' + mw.config.get('wgTitle'), "
talkpage.setEditSummary('[[WP:
talkpage.deletePage();
// this is ugly, but because of the architecture of wiki.api, it is needed
// (otherwise success/failure messages for the previous action would be suppressed)
window.setTimeout(function() { Twinkle.speedy.callbacks.sysop.deleteRedirects( params ); }, 1800);
} else {
Twinkle.speedy.callbacks.sysop.deleteRedirects( params );
}
},
deleteRedirects: function( params ) {
// delete redirects
if (params.deleteRedirects) {
var query = {
'action': 'query',
'list': 'backlinks',
'blfilterredir': 'redirects',
'bltitle': mw.config.get('wgPageName'),
'bllimit': 5000 // 500 is max for normal users, 5000 for bots and sysops
};
var wikipedia_api = new Morebits.wiki.api( 'getting list of redirects...', query, Twinkle.speedy.callbacks.sysop.deleteRedirectsMain,
new Morebits.status( 'Deleting redirects' ) );
wikipedia_api.params = params;
wikipedia_api.post();
}
// promote Unlink tool
var $link, $bigtext;
if( mw.config.get('wgNamespaceNumber') === 6 && params.normalized !== '
$link = $('<a/>', {
'href': '#',
'text': '
'css': { 'fontSize': '130%', 'fontWeight': 'bold' },
'click': function(){
Morebits.wiki.actionCompleted.redirect = null;
Twinkle.speedy.dialog.close();
Twinkle.unlink.callback("
}
});
Baris 9.632 ⟶ 11.413:
});
Morebits.status.info($bigtext[0], $link[0]);
} else if (params.normalized !== '
$link = $('<a/>', {
'href': '#',
'text': '
'css': { 'fontSize': '130%', 'fontWeight': 'bold' },
'click': function(){
Morebits.wiki.actionCompleted.redirect = null;
Twinkle.speedy.dialog.close();
Twinkle.unlink.callback("
}
});
Baris 9.648 ⟶ 11.429:
});
Morebits.status.info($bigtext[0], $link[0]);
}
},
Baris 9.675 ⟶ 11.434:
pageobj.getStatusElement().unlink(); // don't need it anymore
var user = pageobj.getCreator();
var params = pageobj.getCallbackParameters();
var query = {
'title': '
'action': 'edit',
'preview': 'yes',
'vanarticle':
};
if (params.normalized === 'db' || Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
// provide a link to the user talk page
var $link, $bigtext;
$link = $('<a/>', {
'href': mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
'text': 'click here to open User talk:' + user,
'target': '_blank',
'css': { 'fontSize': '130%', 'fontWeight': 'bold' }
});
$bigtext = $('<span/>', {
'text': 'To notify the page creator',
'css': { 'fontSize': '130%', 'fontWeight': 'bold' }
});
Morebits.status.info($bigtext[0], $link[0]);
} else {
// open the initial contributor's talk page
var statusIndicator = new Morebits.status('Opening user talk page edit form for ' + user, 'opening...');
switch( Twinkle.getPref('userTalkPageMode') ) {
case 'tab':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank' );
break;
case 'blank':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
break;
case 'window':
/* falls through */
default:
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
( window.name === 'twinklewarnwindow' ? '_blank' : 'twinklewarnwindow' ),
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
break;
}
statusIndicator.info( 'complete' );
}
},
deleteRedirectsMain: function( apiobj ) {
var xmlDoc = apiobj.getXML();
var $snapshot = $(xmlDoc).find('backlinks bl');
var total = $snapshot.length;
var statusIndicator = apiobj.statelem;
if( !total ) {
statusIndicator.status("no redirects found");
return;
}
statusIndicator.status("0%");
var
var
statusIndicator.update( now );
if( current >= total ) {
statusIndicator.info( now + ' (completed)' );
Morebits.wiki.removeCheckpoint();
}
Baris 9.725 ⟶ 11.505:
Morebits.wiki.addCheckpoint();
$snapshot.each(function(key, value) {
var title = $(value).attr('title');
var page = new Morebits.wiki.page(title, '
page.setEditSummary('[[WP:
page.deletePage(onsuccess);
});
}
},
user: {
Baris 9.749 ⟶ 11.520:
if (!pageobj.exists()) {
statelem.error( "
return;
}
Baris 9.756 ⟶ 11.527:
var params = pageobj.getCallbackParameters();
statelem.status( '
// check for existing deletion tags
var tag = /(?:\{\{\s*(db|delete
if( tag ) {
statelem.error( [ Morebits.htmlNode( 'strong', tag[1] ) , "
return;
}
var xfd = /(?:\{\{([rsaiftcm]fd|md1|proposed deletion)[^{}]*?\}\})/i.exec( text );
if( xfd && !confirm( "
return;
}
var code, parameters, i;
if (params.normalizeds.length > 1) {
code = "{{db-multiple";
$.each(params.normalizeds, function(index, norm) {
code += "|" + norm.toUpperCase();
parameters =
if (typeof parameters[i] === 'string' && !parseInt(i, 10)) { // skip numeric parameters - {{db-multiple}} doesn't understand them
code += "|" + i + "=" + parameters[i];
}
}
$.extend(params.utparams, Twinkle.speedy.getUserTalkParameters(norm, parameters));
});
code += "}}";
} else {
parameters = params.templateParams[0] || [];
code = "{{db-" + params.values[0];
for (i in parameters) {
if (typeof parameters[i] === 'string') {
Baris 9.823 ⟶ 11.581:
// Remove tags that become superfluous with this action
text = text.replace(/\{\{\s*(
if (mw.config.get('wgNamespaceNumber') === 6) {
// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
Baris 9.832 ⟶ 11.590:
var editsummary;
if (params.normalizeds.length > 1) {
editsummary = '
$.each(params.normalizeds, function(index, norm) {
editsummary += '[[WP:
});
editsummary = editsummary.substr(0, editsummary.length - 2); // remove trailing comma
editsummary += ').';
} else if (params.normalizeds[0] === "db") {
editsummary = '
} else if (params.values[0] === "histmerge") {
editsummary = "
} else {
editsummary = "
}
Baris 9.860 ⟶ 11.618:
var callback = function(pageobj) {
var initialContrib = pageobj.getCreator();
// disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
Morebits.status.warn("You (" + initialContrib + ") created this page; skipping user notification");
// don't notify users when their user talk page is nominated
} else if (initialContrib === mw.config.get('wgTitle') && mw.config.get('wgNamespaceNumber') === 3) {
Morebits.status.warn("
// quick hack to prevent excessive unwanted notifications, per request. Should actually be configurable on recipient page
} else if ((initialContrib === "Cyberbot I" || initialContrib === "SoxBot") && params.normalizeds[0] === "
Morebits.status.warn("
} else {
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")"),
// specialcase "db" and "db-multiple"
if (
notifytext
var count = 2;
$.each(params.normalizeds, function(index, norm) {
notifytext += "|" + (count++) + "=" + norm.toUpperCase();
});
} else if (params.normalizeds[0] === "db") {
notifytext = "\n{{subst:db-reason-notice|1=" + Morebits.pageNameNorm;
} else {
notifytext = "\n{{subst:db-csd-notice-custom|1=" + Morebits.pageNameNorm + "|2=" + params.values[0];
}
for (i in params.utparams) {
if (typeof params.
}
}
notifytext += (params.welcomeuser ? "" : "|nowelcome=yes") + "}} ~~~~";
var editsummary = "Notification: speedy deletion nomination";
if (params.normalizeds.indexOf("g10") === -1) { // no article name in summary for G10 deletions
editsummary += " of [[" + Morebits.pageNameNorm + "]].";
} else {
editsummary += " of an attack page.";
}
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
usertalkpage.setFollowRedirect(true);
usertalkpage.append();
}
// add this nomination to the user's userspace log, if the user has enabled it
Baris 9.914 ⟶ 11.674:
}
};
var thispage = new Morebits.wiki.page(
thispage.lookupCreator(callback);
}
Baris 9.928 ⟶ 11.688:
// for DI: params.fromDI = true, params.type, params.normalized (note: normalized is a string)
addToLog: function(params, initialContrib) {
var wikipedia_page = new Morebits.wiki.page("
params.logInitialContrib = initialContrib;
wikipedia_page.setCallbackParameters(params);
Baris 9.937 ⟶ 11.697:
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
var appendText = "";
// add blurb if log page doesn't exist
if (!pageobj.exists()) {
"
"
"
if (Morebits.userIsInGroup("sysop")) {
}
}
Baris 9.953 ⟶ 11.715:
var headerRe = new RegExp("^==+\\s*" + date.getUTCMonthName() + "\\s+" + date.getUTCFullYear() + "\\s*==+", "m");
if (!headerRe.exec(text)) {
}
if (params.fromDI) {
} else {
if (params.normalizeds.length > 1) {
$.each(params.normalizeds, function(index, norm) {
});
} else if (params.normalizeds[0] === "db") {
} else {
}
}
if (params.logInitialContrib) {
}
pageobj.
pageobj.setEditSummary("Logging speedy deletion nomination of [[" +
pageobj.setCreateOption("recreate");
pageobj.
}
}
};
//
Twinkle.speedy.getParameters = function twinklespeedyGetParameters(
var parameters = [];
$.each(values, function(index, value) {
var currentParams = [];
switch (value) {
case 'reason':
if (form["csd.reason_1"]) {
var dbrationale = form["csd.reason_1"].value;
if (!dbrationale || !dbrationale.trim()) {
alert( 'Custom rationale: Please specify a rationale.' );
parameters = null;
return false;
}
currentParams["1"] = dbrationale;
}
break;
case 'userreq': // U1
if (form["csd.userreq_rationale"]) {
var u1rationale = form["csd.userreq_rationale"].value;
if (mw.config.get('wgNamespaceNumber') === 3 && !((/\//).test(mw.config.get('wgTitle'))) &&
(!u1rationale || !u1rationale.trim())) {
alert( 'CSD U1: Please specify a rationale when nominating user talk pages.' );
parameters = null;
return
}
currentParams.rationale = u1rationale;
}
case 'repost': // G4
if (form["csd.repost_1"]) {
var deldisc = form["csd.repost_1"].value;
if (deldisc) {
if (deldisc.substring(0, 9) !== "Wikipedia" && deldisc.substring(0, 3) !== "WP:") {
alert( 'CSD G4: The deletion discussion page name, if provided, must start with "Wikipedia:".' );
parameters = null;
return false;
}
currentParams["1"] = deldisc;
}
}
case 'banned': // G5
if (form["csd.banned_1"] && form["csd.banned_1"].value) {
currentParams["1"] = form["csd.banned_1"].value.replace(/^\s*User:/i, "");
}
case 'histmerge': // G6
if (form["csd.histmerge_1"]) {
var merger = form["csd.histmerge_1"].value;
if (!merger || !merger.trim()) {
alert( 'CSD G6 (histmerge): Please specify the page to be merged.' );
return false;
}
}
break; case 'move': // G6
var movepage = form["csd.move_1"].value,
movereason = form["csd.move_2"].value;
if (!movepage || !movepage.trim()) {
alert( 'CSD G6 (move): Please specify the page to be moved here.' );
parameters = null;
return false;
}
if (!movereason || !movereason.trim()) {
return false;
}
}
break; case 'xfd': // G6
if (form["csd.xfd_fullvotepage"]) {
var xfd = form["csd.xfd_fullvotepage"].value;
if (xfd) {
if (xfd.substring(0, 9) !== "Wikipedia" && xfd.substring(0, 3) !== "WP:") {
alert( 'CSD G6 (XFD): The deletion discussion page name, if provided, must start with "Wikipedia:".' );
parameters = null;
return false;
}
currentParams.fullvotepage = xfd;
}
}
case 'copypaste': // G6
var copypaste = form["csd.copypaste_1"].value;
if (!copypaste || !copypaste.trim()) {
alert( 'CSD G6 (copypaste): Please specify the source page name.' );
parameters = null;
return false;
}
}
break; case 'g6': // G6
if (form["csd.g6_rationale"] && form["csd.g6_rationale"].value) {
currentParams.rationale = form["csd.g6_rationale"].value;
}
case 'author': // G7
if (form["csd.author_rationale"] && form["csd.author_rationale"].value) {
currentParams.rationale = form["csd.author_rationale"].value;
}
break;
case 'g8': // G8
if (form["csd.g8_rationale"] && form["csd.g8_rationale"].value) {
currentParams.rationale = form["csd.g8_rationale"].value;
}
break;
case 'attack': // G10
currentParams.blanked = 'yes';
// it is actually blanked elsewhere in code, but setting the flag here
break;
case 'copyvio': // G12
if (form["csd.copyvio_url"] && form["csd.copyvio_url"].value) {
currentParams.url = form["csd.copyvio_url"].value;
}
if (form["csd.copyvio_url2"] && form["csd.copyvio_url2"].value) {
currentParams.url2 = form["csd.copyvio_url2"].value;
}
if (form["csd.copyvio_url3"] && form["csd.copyvio_url3"].value) {
currentParams.url3 = form["csd.copyvio_url3"].value;
}
break;
case 'afc': // G13
var query = {
action: "query",
titles: mw.config.get("wgPageName"),
prop: "revisions",
rvprop: "timestamp"
},
api = new Morebits.wiki.api( 'Grabbing the last revision timestamp', query, function( apiobj ) {
var xmlDoc = apiobj.getXML(),
isoDateString = $(xmlDoc).find("rev").attr("timestamp");
currentParams.ts = isoDateString;
});
// Wait for API call to finish
api.post({
async: false
});
break;
case 'redundantimage': // F1
if (form["csd.redundantimage_filename"]) {
var redimage = form["csd.redundantimage_filename"].value;
if (!redimage || !redimage.trim()) {
alert( 'CSD F1: Please specify the filename of the other file.' );
parameters = null;
return false;
}
currentParams.filename = redimage.replace(/^\s*(Image|File):/i, "");
break;
case 'badfairuse': // F7
if (form["csd.badfairuse_reason"] && form["csd.badfairuse_reason"].value) {
currentParams.reason = form["csd.badfairuse_reason"].value;
}
break;
case 'nowcommons': // F8
if (form["csd.nowcommons_filename"]) {
var filename = form["csd.nowcommons_filename"].value;
if (filename && filename !== Morebits.pageNameNorm) {
if (filename.indexOf("Image:") === 0 || filename.indexOf("File:") === 0) {
currentParams["1"] = filename;
} else {
currentParams["1"] = "File:" + filename;
}
}
}
currentParams.date = "~~~~~";
case 'imgcopyvio': // F9
if (form["csd.imgcopyvio_url"] && form["csd.imgcopyvio_url"].value) {
currentParams.url = form["csd.imgcopyvio_url"].value;
}
case '
if (form["csd.foreign_source"]) {
var foreignlink = form["csd.foreign_source"].value;
if (!foreignlink || !foreignlink.trim()) {
alert( 'CSD A2: Please specify an interwiki link to the article of which this is a copy.' );
return false;
}
}
case 'a10': // A10
if (form["csd.a10_article"]) {
var duptitle = form["csd.a10_article"].value;
if (!duptitle || !duptitle.trim()) {
alert( 'CSD A10: Please specify the name of the article which is duplicated.' );
parameters = null;
return false;
}
}
case 'duplicatetemplate': // T3
if (form["csd.duplicatetemplate_2"]) {
var t3template = form["csd.duplicatetemplate_2"].value;
if (!t3template || !t3template.trim()) {
alert( 'CSD T3: Please specify the name of a template duplicated by this one.' );
parameters = null;
return false;
}
currentParams["1"] = "~~~~~";
currentParams["2"] = t3template.replace(/^\s*Template:/i, "");
case 't3': // T3
if (form["csd.t3_rationale"]) {
var t3rationale = form["csd.t3_rationale"].value;
if (!t3rationale || !t3rationale.trim()) {
alert( 'CSD T3: Please specify a rationale.' );
parameters = null;
return false;
}
currentParams["1"] = "~~~~~";
currentParams.rationale = t3rationale;
}
break;
case 'p1': // P1
if (form["csd.p1_criterion"]) {
var criterion = form["csd.p1_criterion"].value;
if (!criterion || !criterion.trim()) {
alert( 'CSD P1: Please specify a criterion and/or associated rationale.' );
parameters = null;
return false;
}
currentParams["1"] = criterion;
}
break;
default:
break;
}
parameters.push(currentParams);
});
return parameters;
};
// function for processing talk page notification template parameters
Twinkle.speedy.getUserTalkParameters = function twinklespeedyGetUserTalkParameters(normalized, parameters) {
var utparams = [];
switch (normalized) {
case 'db':
utparams["2"] = parameters["1"];
break;
case 'g12':
utparams.key1 = "url";
utparams.value1 = utparams.url = parameters.url;
break;
case 'a10':
utparams.key1 = "article";
utparams.value1 = utparams.article = parameters.article;
break;
default:
Baris 10.251 ⟶ 12.053:
};
Twinkle.speedy.callback.evaluateSysop = function twinklespeedyCallbackEvaluateSysop(e) {
var form = (e.target.form ? e.target.form : e.target);
Baris 10.285 ⟶ 12.085:
Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUser(e) {
var form = (e.target.form ? e.target.form : e.target);
if (e.target.type === "checkbox"
e.target.type === "select") {
return;
}
Baris 10.300 ⟶ 12.100:
$.each(values, function(index, value) {
var norm = Twinkle.speedy.normalizeHash[ value ];
normalizeds.push(norm);
Baris 10.323 ⟶ 12.117:
$.each(normalizeds, function(index, norm) {
if (Twinkle.getPref('notifyUserOnSpeedyDeletionNomination').indexOf(norm) !== -1) {
if (norm === '
return true;
}
Baris 10.358 ⟶ 12.152:
usertalk: notifyuser,
welcomeuser: welcomeuser,
lognomination: csdlog,
templateParams: Twinkle.speedy.getParameters( form, values )
};
if (!params.templateParams) {
return;
}
Morebits.simpleWindow.setButtonsEnabled( false );
Baris 10.371 ⟶ 12.169:
wikipedia_page.load(Twinkle.speedy.callbacks.user.main);
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 10.385 ⟶ 12.193:
return;
}
};
Baris 10.403 ⟶ 12.211:
// the parameter is used when invoking unlink from admin speedy
Twinkle.unlink.callback = function(presetReason) {
var Window = new Morebits.simpleWindow(
Window.setTitle( "Unlink backlinks" + (mw.config.get('wgNamespaceNumber') === 6 ? " and file usages" : "") );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.unlink.callback.evaluate );
// prepend some basic documentation
var node1 = Morebits.htmlNode("code", "[[" + Morebits.pageNameNorm + "|link text]]")
var node2 = Morebits.htmlNode("code", "link text");
node1.style.fontFamily = node2.style.fontFamily = "monospace";
node1.style.fontStyle = node2.style.fontStyle = "normal";
form.append( {
type: '
style: 'margin-bottom: 0.5em',
label: [
'This tool allows you to unlink all incoming links ("backlinks") that point to this page' +
(mw.config.get('wgNamespaceNumber') === 6 ? ", and/or hide all inclusions of this file by wrapping them in <!-- --> comment markup" : "") +
". For instance, ",
node1,
" would become ",
node2,
". Use it with caution."
]
} );
form.append( {
type: 'input',
name: 'reason',
label: 'Reason: ',
value: (presetReason ? presetReason : ''),
size: 60
} );
Baris 10.451 ⟶ 12.280:
Twinkle.unlink.callback.evaluate = function twinkleunlinkCallbackEvaluate(event) {
Twinkle.unlink.backlinksdone = 0;
Twinkle.unlink.imageusagedone = 0;
Baris 10.475 ⟶ 12.302:
var articlepage = new Morebits.wiki.page(pages[i], 'Unlinking in article "' + pages[i] + '"');
articlepage.setCallbackParameters(myparams);
articlepage.setBotEdit(true); // unlink considered a floody operation
articlepage.load(imageusage ? Twinkle.unlink.callbacks.unlinkImageInstances : Twinkle.unlink.callbacks.unlinkBacklinks);
}
Baris 10.480 ⟶ 12.308:
var reason = event.target.reason.value;
if (!reason) {
alert("You must specify a reason for unlinking.");
return;
}
var backlinks, imageusage;
if( event.target.backlinks ) {
Baris 10.539 ⟶ 12.372:
});
}
apiobj.params.form.append(
type: 'button',
label: "Select All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, "imageusage")).prop('checked', true);
}
});
apiobj.params.form.append({
type: 'button',
label: "Deselect All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, "imageusage")).prop('checked', false);
}
});
apiobj.params.form.append({
type: 'checkbox',
name: 'imageusage',
list: list
}
havecontent = true;
}
Baris 10.571 ⟶ 12.418:
});
}
apiobj.params.form.append(
type: 'button',
label: "Select All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, "backlinks")).prop('checked', true);
}
});
apiobj.params.form.append({
type: 'button',
label: "Deselect All",
event: function(e) {
$(Morebits.quickForm.getElements(e.target.form, "backlinks")).prop('checked', false);
}
});
apiobj.params.form.append({
type: 'checkbox',
name: 'backlinks',
Baris 10.589 ⟶ 12.450:
var result = apiobj.params.form.render();
apiobj.params.Window.setContent( result );
Morebits.checkboxShiftClickSupport($("input[name='imageusage']", result));
Morebits.checkboxShiftClickSupport($("input[name='backlinks']", result));
}
},
Baris 10.597 ⟶ 12.462:
var wikiPage = new Morebits.wikitext.page(text);
wikiPage.removeLink(
text = wikiPage.getText();
if (text === oldtext) {
Baris 10.607 ⟶ 12.472:
pageobj.setPageText(text);
pageobj.setEditSummary("Removing link(s) to \"" +
pageobj.setCreateOption('nocreate');
pageobj.save(Twinkle.unlink.callbacks.success);
Baris 10.627 ⟶ 12.492:
pageobj.setPageText(text);
pageobj.setEditSummary("Commenting out use(s) of file \"" +
pageobj.setCreateOption('nocreate');
pageobj.save(Twinkle.unlink.callbacks.success);
Baris 10.642 ⟶ 12.507:
}
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 10.654 ⟶ 12.529:
Twinkle.warn = function twinklewarn() {
if( mw.config.get('wgNamespaceNumber') === 3 ) {
}
Baris 10.663 ⟶ 12.538:
$vandalTalkLink.wrapInner($("<span/>").attr("title", "If appropriate, you can use Twinkle to warn the user about their edits to this page."));
var extraParam = "vanarticle=" + mw.util.rawurlencode(
var href = $vandalTalkLink.attr("href");
if (href.indexOf("?") === -1) {
Baris 10.674 ⟶ 12.549:
Twinkle.warn.callback = function twinklewarnCallback() {
if( mw.config.get('wgTitle').split( '/' )[0] === mw.config.get('wgUserName') &&
!confirm( 'You are about to warn yourself! Are you sure you want to proceed?' ) ) {
return;
}
var Window = new Morebits.simpleWindow( 600, 440 );
Window.setTitle( "Warn/notify user" );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "Choosing a warning level", "WP:UWUL#Levels" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.warn.callback.evaluate );
var main_select = form.append( {
type: 'field',
label: 'Choose type of warning/notice to issue',
tooltip: 'First choose a main warning group, then the specific warning to issue.'
} );
var main_group = main_select.append( {
type: 'select',
name: 'main_group',
event:Twinkle.warn.callback.change_category
} );
var defaultGroup = parseInt(Twinkle.getPref('defaultWarningGroup'), 10);
main_group.append( { type: 'option', label: 'General note (1)', value: 'level1', selected: ( defaultGroup === 1 || defaultGroup < 1 || ( Morebits.userIsInGroup( 'sysop' ) ? defaultGroup > 8 : defaultGroup > 7 ) ) } );
main_group.append( { type: 'option', label: 'Caution (2)', value: 'level2', selected: ( defaultGroup === 2 ) } );
main_group.append( { type: 'option', label: 'Warning (3)', value: 'level3', selected: ( defaultGroup === 3 ) } );
main_group.append( { type: 'option', label: 'Final warning (4)', value: 'level4', selected: ( defaultGroup === 4 ) } );
main_group.append( { type: 'option', label: 'Only warning (4im)', value: 'level4im', selected: ( defaultGroup === 5 ) } );
main_group.append( { type: 'option', label: 'Single issue notices', value: 'singlenotice', selected: ( defaultGroup === 6 ) } );
main_group.append( { type: 'option', label: 'Single issue warnings', value: 'singlewarn', selected: ( defaultGroup === 7 ) } );
if( Twinkle.getPref( 'customWarningList' ).length ) {
main_group.append( { type: 'option', label: 'Custom warnings', value: 'custom', selected: ( defaultGroup === 9 ) } );
}
if( Morebits.userIsInGroup( 'sysop' ) ) {
main_group.append( { type: 'option', label: 'Blocking', value: 'block', selected: ( defaultGroup === 8 ) } );
}
main_select.append( { type: 'select', name: 'sub_group', event:Twinkle.warn.callback.change_subcategory } ); //Will be empty to begin with.
form.append( {
type: 'input',
name: 'article',
label: 'Linked article',
value:( Morebits.queryString.exists( 'vanarticle' ) ? Morebits.queryString.get( 'vanarticle' ) : '' ),
tooltip: 'An article can be linked within the notice, perhaps because it was a revert to said article that dispatched this notice. Leave empty for no article to be linked.'
} );
var more = form.append( { type: 'field', name: 'reasonGroup', label: 'Warning information' } );
more.append( { type: 'textarea', label: 'Optional message:', name: 'reason', tooltip: 'Perhaps a reason, or that a more detailed notice must be appended' } );
var previewlink = document.createElement( 'a' );
Baris 10.736 ⟶ 12.610:
more.append( { type: 'div', id: 'twinklewarn-previewbox', style: 'display: none' } );
more.append( { type: 'submit', label: 'Submit' } );
var result = form.render();
Baris 10.757 ⟶ 12.631:
Twinkle.warn.messages = {
level1: {
"
"uw-vandalism1": {
label: "Vandalism",
summary: "General note: Unconstructive editing"
},
"uw-disruptive1": {
label: "Disruptive editing",
summary: "General note: Unconstructive editing"
},
"uw-test1": {
label: "Editing tests",
summary: "General note: Editing tests"
},
"uw-delete1": {
label: "Removal of content, blanking",
summary: "General note: Removal of content, blanking"
}
},
"
"uw-biog1": {
label: "Adding unreferenced controversial information about living persons",
summary: "General note: Adding unreferenced controversial information about living persons"
},
"uw-defam1": {
label: "Addition of defamatory content",
summary: "General note: Addition of defamatory content"
},
"uw-error1": {
label: "Introducing deliberate factual errors",
summary: "General note: Introducing factual errors"
},
"uw-genre1": {
label: "Frequent or mass changes to genres without consensus or references",
summary: "General note: Frequent or mass changes to genres without consensus or references"
},
"uw-image1": {
label: "Image-related vandalism in articles",
summary: "General note: Image-related vandalism in articles"
},
"uw-joke1": {
label: "Using improper humor in articles",
summary: "General note: Using improper humor in articles"
},
"uw-nor1": {
label: "Adding original research, including unpublished syntheses of sources",
summary: "General note: Adding original research, including unpublished syntheses of sources"
},
"uw-notcensored1": {
label: "Censorship of material",
summary: "General note: Censorship of material"
},
"uw-own1": {
label: "Ownership of articles",
summary: "General note: Ownership of articles"
},
"uw-tdel1": {
label: "Removal of maintenance templates",
summary: "General note: Removal of maintenance templates"
},
"uw-unsourced1": {
label: "Addition of unsourced or improperly cited material",
summary: "General note: Addition of unsourced or improperly cited material"
}
},
"
"uw-advert1": {
label: "Using Wikipedia for advertising or promotion",
summary: "General note: Using Wikipedia for advertising or promotion"
},
"uw-npov1": {
label: "Not adhering to neutral point of view",
summary: "General note: Not adhering to neutral point of view"
},
"uw-spam1": {
label: "Adding spam links",
summary: "General note: Adding spam links"
}
},
"Behavior towards other editors": {
"uw-agf1": {
label: "Not assuming good faith",
summary: "General note: Not assuming good faith"
},
"uw-harass1": {
label: "Harassment of other users",
summary: "General note: Harassment of other users"
},
"uw-npa1": {
label: "Personal attack directed at a specific editor",
summary: "General note: Personal attack directed at a specific editor"
},
"uw-tempabuse1": {
label: "Improper use of warning or blocking template",
summary: "General note: Improper use of warning or blocking template"
}
},
"
"uw-afd1": {
label: "Removing {{afd}} templates",
summary: "General note: Removing {{afd}} templates"
},
"uw-blpprod1": {
label: "Removing {{blp prod}} templates",
summary: "General note: Removing {{blp prod}} templates"
},
"uw-idt1": {
label: "Removing file deletion tags",
summary: "General note: Removing file deletion tags"
},
"uw-speedy1": {
label: "Removing speedy deletion tags",
summary: "General note: Removing speedy deletion tags"
}
},
"
label: "Using talk page as forum",
summary: "General note: Using talk page as forum"
},
"uw-create1": {
label: "Creating inappropriate pages",
summary: "General note: Creating inappropriate pages"
},
"uw-mos1": {
label: "Manual of style",
summary: "General note: Formatting, date, language, etc (Manual of style)"
},
"uw-move1": {
label: "Page moves against naming conventions or consensus",
summary: "General note: Page moves against naming conventions or consensus"
},
"uw-tpv1": {
label: "Refactoring others' talk page comments",
summary: "General note: Refactoring others' talk page comments"
},
"uw-upload1": {
label: "Uploading unencyclopedic images",
summary: "General note: Uploading unencyclopedic images"
}
}/*,
"To be removed from Twinkle": {
"uw-redirect1": {
label: "Creating malicious redirects",
summary: "General note: Creating malicious redirects"
},
"uw-ics1": {
label: "Uploading files missing copyright status",
summary: "General note: Uploading files missing copyright status"
},
"uw-af1": {
label: "Inappropriate feedback through the Article Feedback Tool",
}
}
},
level2: {
"
summary: "Caution: Unconstructive editing"
},
"uw-disruptive2": {
label: "Disruptive editing",
summary: "Caution: Unconstructive editing"
},
"uw-test2": {
label: "Editing tests",
summary: "Caution: Editing tests"
},
"uw-delete2": {
label: "Removal of content, blanking",
summary: "Caution: Removal of content, blanking"
}
},
"
label: "Adding unreferenced controversial information about living persons",
summary: "Caution: Adding unreferenced controversial information about living persons"
},
"uw-defam2": {
label: "Addition of defamatory content",
summary: "Caution: Addition of defamatory content"
},
"uw-error2": {
label: "Introducing deliberate factual errors",
summary: "Caution: Introducing factual errors"
},
"uw-genre2": {
label: "Frequent or mass changes to genres without consensus or references",
summary: "Caution: Frequent or mass changes to genres without consensus or references"
},
"uw-image2": {
label: "Image-related vandalism in articles",
summary: "Caution: Image-related vandalism in articles"
},
"uw-joke2": {
label: "Using improper humor in articles",
summary: "Caution: Using improper humor in articles"
},
"uw-nor2": {
label: "Adding original research, including unpublished syntheses of sources",
summary: "Caution: Adding original research, including unpublished syntheses of sources"
},
"uw-notcensored2": {
label: "Censorship of material",
summary: "Caution: Censorship of material"
},
"uw-own2": {
label: "Ownership of articles",
summary: "Caution: Ownership of articles"
},
"uw-tdel2": {
label: "Removal of maintenance templates",
summary: "Caution: Removal of maintenance templates"
},
"uw-unsourced2": {
label: "Addition of unsourced or improperly cited material",
summary: "Caution: Addition of unsourced or improperly cited material"
}
},
"
"uw-advert2": {
label: "Using Wikipedia for advertising or promotion",
summary: "Caution: Using Wikipedia for advertising or promotion"
},
"uw-npov2": {
label: "Not adhering to neutral point of view",
summary: "Caution: Not adhering to neutral point of view"
},
"uw-spam2": {
label: "Adding spam links",
summary: "Caution: Adding spam links"
}
},
"Behavior towards other editors": {
"uw-agf2": {
label: "Not assuming good faith",
summary: "Caution: Not assuming good faith"
},
"uw-harass2": {
label: "Harassment of other users",
summary: "Caution: Harassment of other users"
},
"uw-npa2": {
label: "Personal attack directed at a specific editor",
summary: "Caution: Personal attack directed at a specific editor"
},
"uw-tempabuse2": {
label: "Improper use of warning or blocking template",
summary: "Caution: Improper use of warning or blocking template"
}
},
"
"uw-afd2": {
summary: "Caution: Removing {{afd}} templates"
},
"uw-blpprod2": {
label: "Removing {{blp prod}} templates",
summary: "Caution: Removing {{blp prod}} templates"
},
"uw-idt2": {
label: "Removing file deletion tags",
summary: "Caution: Removing file deletion tags"
},
"uw-speedy2": {
label: "Removing speedy deletion tags",
summary: "Caution: Removing speedy deletion tags"
}
},
"
"uw-chat2": {
summary: "Caution: Using talk page as forum"
},
"uw-create2": {
label: "Creating inappropriate pages",
summary: "Caution: Creating inappropriate pages"
},
"uw-mos2": {
label: "Manual of style",
summary: "Caution: Formatting, date, language, etc (Manual of style)"
},
"uw-move2": {
label: "Page moves against naming conventions or consensus",
summary: "Caution: Page moves against naming conventions or consensus"
},
"uw-tpv2": {
label: "Refactoring others' talk page comments",
summary: "Caution: Refactoring others' talk page comments"
},
"uw-upload2": {
label: "Uploading unencyclopedic images",
summary: "Caution: Uploading unencyclopedic images"
}
}/*,
"To be removed from Twinkle": {
"uw-redirect2": {
label: "Creating malicious redirects",
summary: "Caution: Creating malicious redirects"
},
"uw-ics2": {
label: "Uploading files missing copyright status",
summary: "Caution: Uploading files missing copyright status"
},
"uw-af2": {
label: "Inappropriate feedback through the Article Feedback Tool",
summary: "Caution: Inappropriate feedback through the Article Feedback Tool"
}
}*/
},
level3: {
"
summary: "Warning: Vandalism"
},
"uw-disruptive3": {
label: "Disruptive editing",
summary: "Warning: Disruptive editing"
},
"uw-test3": {
label: "Editing tests",
summary: "Warning: Editing tests"
},
"uw-delete3": {
label: "Removal of content, blanking",
summary: "Warning: Removal of content, blanking"
}
},
"
label: "Adding unreferenced controversial/defamatory information about living persons",
summary: "Warning: Adding unreferenced controversial information about living persons"
},
"uw-defam3": {
label: "Addition of defamatory content",
summary: "Warning: Addition of defamatory content"
},
"uw-error3": {
label: "Introducing deliberate factual errors",
summary: "Warning: Introducing deliberate factual errors"
},
"uw-genre3": {
label: "Frequent or mass changes to genres without consensus or reference",
summary: "Warning: Frequent or mass changes to genres without consensus or reference"
},
"uw-image3": {
label: "Image-related vandalism in articles",
summary: "Warning: Image-related vandalism in articles"
},
"uw-joke3": {
label: "Using improper humor in articles",
summary: "Warning: Using improper humor in articles"
},
"uw-nor3": {
label: "Adding original research, including unpublished syntheses of sources",
summary: "Warning: Adding original research, including unpublished syntheses of sources"
},
"uw-notcensored3": {
label: "Censorship of material",
summary: "Warning: Censorship of material"
},
"uw-own3": {
label: "Ownership of articles",
summary: "Warning: Ownership of articles"
},
"uw-tdel3": {
label: "Removal of maintenance templates",
summary: "Warning: Removal of maintenance templates"
},
"uw-unsourced3": {
label: "Addition of unsourced or improperly cited material",
summary: "Warning: Addition of unsourced or improperly cited material"
}
},
"
"uw-advert3": {
label: "Using Wikipedia for advertising or promotion",
summary: "Warning: Using Wikipedia for advertising or promotion"
},
"uw-npov3": {
label: "Not adhering to neutral point of view",
summary: "Warning: Not adhering to neutral point of view"
},
"uw-spam3": {
label: "Adding spam links",
summary: "Warning: Adding spam links"
}
},
"Behavior towards other users": {
"uw-agf3": {
label: "Not assuming good faith",
summary: "Warning: Not assuming good faith"
},
"uw-harass3": {
label: "Harassment of other users",
summary: "Warning: Harassment of other users"
},
"uw-npa3": {
label: "Personal attack directed at a specific editor",
summary: "Warning: Personal attack directed at a specific editor"
}
},
"
"uw-afd3": {
summary: "Warning: Removing {{afd}} templates"
},
"uw-blpprod3": {
label: "Removing {{blpprod}} templates",
summary: "Warning: Removing {{blpprod}} templates"
},
"uw-idt3": {
label: "Removing file deletion tags",
summary: "Warning: Removing file deletion tags"
},
"uw-speedy3": {
label: "Removing speedy deletion tags",
summary: "Warning: Removing speedy deletion tags"
}
},
"
"uw-chat3": {
label: "Using talk page as forum",
summary: "Warning: Using talk page as forum"
},
"uw-create3": {
label: "Creating inappropriate pages",
summary: "Warning: Creating inappropriate pages"
},
"uw-mos3": {
label: "Manual of style",
summary: "Warning: Formatting, date, language, etc (Manual of style)"
},
"uw-move3": {
label: "Page moves against naming conventions or consensus",
summary: "Warning: Page moves against naming conventions or consensus"
},
"uw-tpv3": {
label: "Refactoring others' talk page comments",
summary: "Warning: Refactoring others' talk page comments"
},
"uw-upload3": {
label: "Uploading unencyclopedic images",
summary: "Warning: Uploading unencyclopedic images"
}
}/*,
"To be removed fomr Twinkle": {
"uw-af3": {
label: "Inappropriate feedback through the Article Feedback Tool",
summary: "Warning: Inappropriate feedback through the Article Feedback Tool"
},
"uw-ics3": {
label: "Uploading files missing copyright status",
summary: "Warning: Uploading files missing copyright status"
},
"uw-redirect3": {
label: "Creating malicious redirects",
summary: "Warning: Creating malicious redirects"
}
}
},
level4: {
"
"uw-generic4": {
summary: "Final warning notice"
},
"uw-vandalism4": {
label: "Vandalism",
summary: "Final warning: Vandalism"
},
"uw-delete4": {
label: "Removal of content, blanking",
summary: "Final warning: Removal of content, blanking"
}
},
"
label: "Adding unreferenced defamatory information about living persons",
summary: "Final warning: Adding unreferenced controversial information about living persons"
},
"uw-defam4": {
label: "Addition of defamatory content",
summary: "Final warning: Addition of defamatory content"
},
"uw-error4": {
label: "Introducing deliberate factual errors",
summary: "Final warning: Introducing deliberate factual errors"
},
"uw-genre4": {
label: "Frequent or mass changes to genres without consensus or reference",
summary: "Final warning: Frequent or mass changes to genres without consensus or reference"
},
"uw-image4": {
label: "Image-related vandalism in articles",
summary: "Final warning: Image-related vandalism in articles"
},
"uw-joke4": {
label: "Using improper humor in articles",
summary: "Final warning: Using improper humor in articles"
},
"uw-nor4": {
label: "Adding original research, including unpublished syntheses of sources",
summary: "Final warning: Adding original research, including unpublished syntheses of sources"
},
"uw-tdel4": {
label: "Removal of maintenance templates",
summary: "Final warning: Removal of maintenance templates"
},
"uw-unsourced4": {
label: "Addition of unsourced or improperly cited material",
summary: "Final warning: Addition of unsourced or improperly cited material"
}
},
"
label: "Using Wikipedia for advertising or promotion",
summary: "Final warning: Using Wikipedia for advertising or promotion"
},
"uw-npov4": {
label: "Not adhering to neutral point of view",
summary: "Final warning: Not adhering to neutral point of view"
},
"uw-spam4": {
label: "Adding spam links",
summary: "Final warning: Adding spam links"
}
},
"Behavior towards other editors": {
"uw-harass4": {
label: "Harassment of other users",
summary: "Final warning: Harassment of other users"
},
"uw-npa4": {
label: "Personal attack directed at a specific editor",
summary: "Final warning: Personal attack directed at a specific editor"
}
},
"
"uw-afd4": {
summary: "Final warning: Removing {{afd}} templates"
},
"uw-blpprod4": {
label: "Removing {{blp prod}} templates",
summary: "Final warning: Removing {{blp prod}} templates"
},
"uw-idt4": {
label: "Removing file deletion tags",
summary: "Final warning: Removing file deletion tags"
},
"uw-speedy4": {
label: "Removing speedy deletion tags",
summary: "Final warning: Removing speedy deletion tags"
}
},
"
"uw-chat4": {
label: "Using talk page as forum",
summary: "Final warning: Using talk page as forum"
},
"uw-create4": {
label: "Creating inappropriate pages",
summary: "Final warning: Creating inappropriate pages"
},
"uw-mos4": {
label: "Manual of style",
summary: "Final warning: Formatting, date, language, etc (Manual of style)"
},
"uw-move4": {
label: "Page moves against naming conventions or consensus",
summary: "Final warning: Page moves against naming conventions or consensus"
},
"uw-tpv4": {
label: "Refactoring others' talk page comments",
summary: "Final warning: Refactoring others' talk page comments"
},
"uw-upload4": {
label: "Uploading unencyclopedic images",
summary: "Final warning: Uploading unencyclopedic images"
}
}/*,
"To be removed from Twinkle": {
"uw-redirect4": {
label: "Creating malicious redirects",
summary: "Final warning: Creating malicious redirects"
},
"uw-ics4": {
label: "Uploading files missing copyright status",
summary: "Final warning: Uploading files missing copyright status"
},
"uw-af4": {
label: "Inappropriate feedback through the Article Feedback Tool",
summary: "Final warning: Inappropriate feedback through the Article Feedback Tool"
}
}
},
level4im: {
"
summary: "Only warning: Vandalism"
},
"uw-delete4im": {
label: "Removal of content, blanking",
summary: "Only warning: Removal of content, blanking"
}
},
"
"uw-biog4im": {
label: "Adding unreferenced defamatory information about living persons",
summary: "Only warning: Adding unreferenced controversial information about living persons"
},
"uw-defam4im": {
label: "Addition of defamatory content",
summary: "Only warning: Addition of defamatory content"
},
"uw-image4im": {
label: "Image-related vandalism",
summary: "Only warning: Image-related vandalism"
},
"uw-joke4im": {
label: "Using improper humor",
summary: "Only warning: Using improper humor"
},
"uw-own4im": {
label: "Ownership of articles",
summary: "Only warning: Ownership of articles"
}
},
"
"uw-advert4im": {
label: "Using Wikipedia for advertising or promotion",
summary: "Only warning: Using Wikipedia for advertising or promotion"
},
"uw-spam4im": {
label: "Adding spam links",
summary: "Only warning: Adding spam links"
}
},
"Behavior towards other editors": {
"uw-harass4im": {
label: "Harassment of other users",
summary: "Only warning: Harassment of other users"
},
"uw-npa4im": {
label: "Personal attack directed at a specific editor",
summary: "Only warning: Personal attack directed at a specific editor"
}
},
"
"uw-create4im": {
label: "Creating inappropriate pages", summary: "Only warning: Creating inappropriate pages"
},
"uw-
label: "Page moves against naming conventions or consensus",
summary: "Only warning:
},
"uw-
label: "
summary: "Only warning:
}
}/*,
"To be removed from Twinkle": {
"uw-af4im": {
label: "Inappropriate feedback through the Article Feedback Tool",
summary: "Only warning: Inappropriate feedback through the Article Feedback Tool"
},
"uw-redirect4im": {
label: "Creating malicious redirects",
summary: "Only warning: Creating malicious redirects"
}
}*/
},
singlenotice: {
"uw-2redirect": {
label: "Creating double redirects through bad page moves",
summary: "Notice: Creating double redirects through bad page moves"
},
"uw-af-contact": {
label: "Attempting to contact the subject of an article via article feedback",
summary: "Notice: Contacting the subject of an article via article feedback"
},
"uw-af-personalinfo": {
label: "Including personal info in article feedback",
summary: "Notice: Including personal info in article feedback"
},
"uw-af-question": {
label: "Asking questions in article feedback",
summary: "Notice: Asking questions in article feedback"
},
"uw-aiv": {
label: "Bad AIV report",
summary: "Notice: Bad AIV report"
},
"uw-articlesig": {
label: "Adding signatures to article space",
summary: "Notice: Adding signatures to article space"
},
"uw-autobiography": {
label: "Creating autobiographies",
summary: "Notice: Creating autobiographies"
},
"uw-badcat": {
label: "Adding incorrect categories",
summary: "Notice: Adding incorrect categories"
},
"uw-badlistentry": {
label: "Adding inappropriate entries to lists",
summary: "Notice: Adding inappropriate entries to lists"
},
"uw-bite": {
label: "\"Biting\" newcomers",
summary: "Notice: \"Biting\" newcomers"
suppressArticleInSummary: true // non-standard (user name, not article), and not necessary
},
"uw-coi": {
label: "Conflict of
summary: "Notice: Conflict of
heading: "Managing a conflict of interest"
},
"uw-controversial": {
label: "Introducing controversial material",
summary: "Notice: Introducing controversial material"
},
"uw-copying": {
label: "Copying text to another page",
summary: "Notice: Copying text to another page"
},
"uw-crystal": {
label: "Adding speculative or unconfirmed information",
summary: "Notice: Adding speculative or unconfirmed information"
},
"uw-csd": {
label: "Speedy deletion declined",
summary: "Notice: Speedy deletion declined"
},
"uw-c&pmove": {
label: "Cut and paste moves",
summary: "Notice: Cut and paste moves"
},
"uw-dab": {
label: "Incorrect edit to a disambiguation page",
summary: "Notice: Incorrect edit to a disambiguation page"
},
"uw-date": {
label: "Unnecessarily changing date formats",
summary: "Notice: Unnecessarily changing date formats"
},
"uw-deadlink": {
label: "Removing proper sources containing dead links",
summary: "Notice: Removing proper sources containing dead links"
},
"uw-directcat": {
label: "Applying stub categories manually",
summary: "Notice: Applying stub categories manually"
},
"uw-draftfirst": {
label: "User should draft in userspace without the risk of speedy deletion",
summary: "Notice: Consider drafting your article in [[Help:Userspace draft|userspace]]"
},
"uw-editsummary": {
label: "Not using edit summary",
summary: "Notice: Not using edit summary"
},
"uw-english": {
label: "Not communicating in English",
summary: "Notice: Not communicating in English"
},
"uw-fuir": {
label: "Fair use image has been removed from your userpage",
summary: "Notice: A fair use image has been removed from your userpage"
},
"uw-hasty": {
label: "Hasty addition of speedy deletion tags",
summary: "Notice: Allow creators time to improve their articles before tagging them for deletion"
},
"uw-imageuse": {
label: "Incorrect image linking",
summary: "Notice: Incorrect image linking"
},
"uw-incompleteAFD": {
label: "Incomplete AFD",
summary: "Notice: Incomplete AFD"
},
"uw-
label: "
summary: "Notice:
},
"uw-
label: "Italicize books, films, albums, magazines, TV series, etc within articles",
summary: "Notice:
},
"uw-
label: "
summary: "Notice:
heading: "National varieties of English"
},
"uw-
label: "
summary: "Notice:
},
"uw-
label: "
summary: "Notice:
},
"uw-
label: "
summary: "Notice:
},
"uw-notaiv": {
label: "Do not report complex abuse to AIV",
summary: "Notice: Do not report complex abuse to AIV"
},
"uw-notenglish": {
label: "Creating non-English articles",
summary: "Notice: Creating non-English articles"
},
"uw-notifysd": {
label: "Notify authors of speedy deletion tagged articles",
summary: "Notice: Please notify authors of articles tagged for speedy deletion"
},
"uw-notvand": {
label: "Mislabelling edits as vandalism",
summary: "Notice: Misidentifying edits as vandalism"
},
"uw-notvote": {
label: "We use consensus, not voting",
summary: "Notice: We use consensus, not voting"
},
"uw-patrolled": {
label: "Mark newpages as patrolled when patrolling",
summary: "Notice: Mark newpages as patrolled when patrolling"
},
"uw-
label: "
summary: "Notice:
},
"uw-
label: "
summary: "Notice:
},
"uw-
label: "
summary: "Notice:
},
"uw-
label: "
summary: "Notice:
},
"uw-refimprove": {
label: "Creating unverifiable articles",
summary: "Notice: Creating unverifiable articles"
},
"uw-removevandalism": {
label: "Incorrect vandalism removal",
summary: "Notice: Incorrect vandalism removal"
},
"uw-repost": {
label: "Recreating material previously deleted via XfD process",
summary: "Notice: Recreating previously deleted material"
},
"uw-salt": {
label: "Recreating salted articles under a different title",
summary: "Notice: Recreating salted articles under a different title"
},
"uw-samename": {
label: "Rename request impossible",
summary: "Notice: Rename request impossible"
},
"uw-selfrevert": {
label: "Reverting self tests",
summary: "Notice: Reverting self tests"
},
"uw-socialnetwork": {
label: "Wikipedia is not a social network",
summary: "Notice: Wikipedia is not a social network"
},
"uw-sofixit": {
label: "Be bold and fix things yourself",
summary: "Notice: You can be bold and fix things yourself"
},
"uw-spoiler": {
label: "Adding spoiler alerts or removing spoilers from appropriate sections",
summary: "Notice: Don't delete or flag potential 'spoilers' in Wikipedia articles"
},
"uw-subst": {
label: "Remember to subst: templates",
summary: "Notice: Remember to subst: templates"
},
"uw-talkinarticle": {
label: "Talk in article",
summary: "Notice: Talk in article"
},
"uw-tilde": {
label: "Not signing posts",
summary: "Notice: Not signing posts"
},
"uw-toppost": {
label: "Posting at the top of talk pages",
summary: "Notice: Posting at the top of talk pages"
},
"uw-uaa": {
label: "Reporting of username to WP:UAA not accepted",
summary: "Notice: Reporting of username to WP:UAA not accepted"
},
"uw-upincat": {
label: "Accidentally including user page/subpage in a content category",
summary: "Notice: Informing user that one of his/her pages had accidentally been included in a content category"
},
"uw-uploadfirst": {
label: "Attempting to display an external image on a page",
summary: "Notice: Attempting to display an external image on a page"
},
"uw-userspace draft finish": {
label: "Stale userspace draft",
summary: "Notice: Stale userspace draft"
},
"uw-userspacenoindex": {
label: "User page/subpage isn't appropriate for search engine indexing",
summary: "Notice: User (sub)page isn't appropriate for search engine indexing"
},
"uw-vgscope": {
label: "Adding video game walkthroughs, cheats or instructions",
summary: "Notice: Adding video game walkthroughs, cheats or instructions"
},
"uw-warn": {
label: "Place user warning templates when reverting vandalism",
summary: "Notice: You can use user warning templates when reverting vandalism"
}
},
singlewarn: {
"uw-3rr": {
label: "Violating the three-revert rule; see also uw-ew",
summary: "Warning: Violating the three-revert rule"
},
"uw-affiliate": {
label: "Affiliate marketing",
summary: "Warning: Affiliate marketing"
},
"uw-agf-sock": {
label: "Use of multiple accounts (assuming good faith)",
summary: "Warning: Using multiple accounts"
},
"uw-attack": {
label: "Creating attack pages",
summary: "Warning: Creating attack pages",
suppressArticleInSummary: true
},
"uw-attempt": {
label: "Triggering the edit filter",
summary: "Warning: Triggering the edit filter"
},
"uw-bizlist": {
label: "Business promotion",
summary: "Warning: Promoting a business"
},
"uw-botun": {
label: "Bot username",
summary: "Warning: Bot username"
},
"uw-canvass": {
label: "Canvassing",
summary: "Warning: Canvassing"
},
"uw-copyright": {
label: "Copyright violation",
summary: "Warning: Copyright violation"
},
"uw-copyright-link": {
label: "Linking to copyrighted works violation",
summary: "Warning: Linking to copyrighted works violation"
},
"uw-copyright-new": {
label: "Copyright violation (with explanation for new users)",
summary: "Notice: Avoiding copyright problems",
heading: "Wikipedia and copyright"
},
"uw-copyright-remove": {
label: "Removing {{copyvio}} template from articles",
summary: "Warning: Removing {{copyvio}} templates"
},
"uw-efsummary": {
label: "Edit summary triggering the edit filter",
summary: "Warning: Edit summary triggering the edit filter"
},
"uw-ew": {
label: "Edit warring (stronger wording)",
summary: "Warning: Edit warring"
},
"uw-ewsoft": {
label: "Edit warring (softer wording for newcomers)",
summary: "Warning: Edit warring"
},
"uw-hoax": {
label: "Creating hoaxes",
summary: "Warning: Creating hoaxes"
},
"uw-legal": {
label: "Making legal threats",
summary: "Warning: Making legal threats"
},
"uw-
label: "
summary: "Warning:
},
"uw-
label: "
summary: "Warning:
},
"uw-
label: "
summary: "Warning:
},
"uw-pinfo": {
label: "Personal info",
summary: "Warning: Personal info"
},
"uw-socksuspect": {
label: "Sockpuppetry",
summary: "Warning: You are a suspected [[WP:SOCK|sockpuppet]]" // of User:...
},
"uw-upv": {
label: "Userpage vandalism",
summary: "Warning: Userpage vandalism"
},
"uw-username": {
label: "Username is against policy",
summary: "Warning: Your username might be against policy",
suppressArticleInSummary: true // not relevant for this template
},
"uw-coi-username": {
label: "Username is against policy, and conflict of interest",
summary: "Warning: Username and conflict of interest policy",
heading: "Your username"
},
"uw-userpage": {
label: "Userpage or subpage is against policy",
summary: "Warning: Userpage or subpage is against policy"
},
"uw-wrongsummary": {
label: "Using inaccurate or inappropriate edit summaries",
summary: "Warning: Using inaccurate or inappropriate edit summaries"
}
},
block: {
"uw-block": {
Baris 11.695 ⟶ 13.698:
summary: "You have been blocked from editing",
pageParam: true,
reasonParam: true, // allows editing of reason for generic templates
suppressArticleInSummary: true
},
"uw-blocknotalk": {
Baris 11.701 ⟶ 13.705:
summary: "You have been blocked from editing and your user talk page has been disabled",
pageParam: true,
reasonParam: true,
suppressArticleInSummary: true
},
"uw-blockindef": {
Baris 11.708 ⟶ 13.713:
indefinite: true,
pageParam: true,
reasonParam: true,
suppressArticleInSummary: true
},
"uw-ablock": {
label: "Block - IP address",
summary: "Your IP address has been blocked from editing",
pageParam: true,
suppressArticleInSummary: true
},
"uw-vblock": {
Baris 11.745 ⟶ 13.752:
indefinite: true,
pageParam: true
},
"uw-nothereblock": {
label: "WP:NOTHERE block (indefinite)",
summary: "You have been indefinitely blocked from editing because it appears that you are not here to [[WP:NOTHERE|build an encyclopedia]]",
indefinite: true
},
"uw-npblock": {
Baris 11.891 ⟶ 13.903:
var value = e.target.value;
var sub_group = e.target.root.sub_group;
sub_group.main_group = value;
var old_subvalue = sub_group.value;
Baris 11.897 ⟶ 13.908:
if( old_subvalue ) {
old_subvalue = old_subvalue.replace(/\d*(im)?$/, '' );
old_subvalue_re = new RegExp(
}
Baris 11.904 ⟶ 13.915:
}
// worker function to create the combo box entries
var createEntries = function( contents, container ) {
$.each( contents, function( itemKey, itemProperties ) {
var key = (typeof itemKey === "string") ? itemKey : itemProperties.value;
var selected = false;
if( old_subvalue && old_subvalue_re.test( key ) ) {
selected = true;
}
var elem = new Morebits.quickForm.element( {
type: 'option',
label: "{{" + key + "}}: " + itemProperties.label,
value: key,
selected: selected
} );
var elemRendered = container.appendChild( elem.render() );
$(elemRendered).data("messageData", itemProperties);
} );
};
if( value === "singlenotice" || value === "singlewarn" || value === "block" ) {
// no categories, just create the options right away
createEntries( Twinkle.warn.messages[ value ], sub_group );
} else if( value === "custom" ) {
createEntries( Twinkle.getPref("customWarningList"), sub_group );
} else {
// create the option-groups
$.each( Twinkle.warn.messages[ value ], function( groupLabel, groupContents ) {
var optgroup = new Morebits.quickForm.element( {
type: 'optgroup',
label: groupLabel
} );
optgroup = optgroup.render();
sub_group.appendChild( optgroup );
// create the options
createEntries( groupContents, optgroup );
} );
}
Baris 11.974 ⟶ 14.015:
Morebits.quickForm.setElementTooltipVisibility(e.target.root.article, true);
Morebits.quickForm.resetElementLabel(e.target.root.article);
// hide the big red notice
$("#tw-warn-red-notice").remove();
Baris 12.055 ⟶ 14.096:
Morebits.quickForm.resetElementLabel(e.target.form.article);
}
// add big red notice, warning users about how to use {{uw-[coi-]username}} appropriately
$("#tw-warn-red-notice").remove();
var $redWarning;
if (value === "uw-username") {
"Blatant violations should be reported directly to UAA (via Twinkle's ARV tab). " +
"{{uw-username}} should only be used in edge cases in order to engage in discussion with the user.</div>");
$redWarning.insertAfter(Morebits.quickForm.getElementLabelObject(e.target.form.reasonGroup));
} else if (value === "uw-coi-username") {
$redWarning = $("<div style='color: red;' id='tw-warn-red-notice'>{{uw-coi-username}} should <b>not</b> be used for <b>blatant</b> username policy violations. " +
"Blatant violations should be reported directly to UAA (via Twinkle's ARV tab). " +
"{{uw-coi-username}} should only be used in edge cases in order to engage in discussion with the user.</div>");
$redWarning.insertAfter(Morebits.quickForm.getElementLabelObject(e.target.form.reasonGroup));
}
};
Twinkle.warn.callbacks = {
var
if (article) {
// add linked article for user warnings (non-block templates)
text += '|1=' + article;
}
if (reason && !isCustom) {
// add extra message for non-block templates
if (templateName === 'uw-csd' || templateName === 'uw-probation' ||
templateName === 'uw-userspacenoindex' || templateName === 'uw-userpage') {
text += "|3=''" + reason + "''";
} else {
}
}
text += '}}';
if (reason && isCustom) {
// we assume that custom warnings lack a {{{2}}} parameter
return text;
},
getBlockNoticeWikitext: function(templateName, article, blockTime, blockReason, isIndefTemplate) {
var text = "{{subst:" + templateName;
if (article && Twinkle.warn.messages.block[templateName].pageParam) {
text += '|page=' + article;
}
if (!/te?mp|^\s*$|min/.exec(blockTime) && !isIndefTemplate) {
if (/indef|\*|max/.exec(blockTime)) {
text += '|indef=yes';
} else {
text += '|time=' + blockTime;
}
}
if (blockReason) {
text += '|reason=' + blockReason;
}
text += "|sig=true}}";
return text;
},
preview: function(form) {
var templatename = form.sub_group.value;
var linkedarticle = form.article.value;
var templatetext;
if (templatename in Twinkle.warn.messages.block) {
templatetext = Twinkle.warn.callbacks.getBlockNoticeWikitext(templatename, linkedarticle, form.block_timer.value,
form.block_reason.value, Twinkle.warn.messages.block[templatename].indefinite);
} else {
templatetext = Twinkle.warn.callbacks.getWarningWikitext(templatename, linkedarticle,
form.reason.value, form.main_group.value === 'custom');
}
Baris 12.112 ⟶ 14.180:
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
var messageData =
var history_re = /<!-- Template:(uw-.*?) -->.*?(\d{1,2}:\d{1,2}, \d{1,2} \w+ \d{4}) \(UTC\)/g;
var history = {};
var latest = { date: new Date( 0 ), type: '' };
var current;
Baris 12.152 ⟶ 14.220:
}
}
var
// If dateHeaderRegexResult is null then lastHeaderIndex is never checked. If it is not null but
// \n== is not found, then the date header must be at the very start of the page. lastIndexOf
// returns -1 in this case, so lastHeaderIndex gets set to 0 as desired.
var lastHeaderIndex = text.lastIndexOf( "\n==" ) + 1;
if( text.length > 0 ) {
Baris 12.161 ⟶ 14.233:
if( params.main_group === 'block' ) {
if( Twinkle.getPref('blankTalkpageOnIndefBlock') && params.sub_group !== 'uw-lblock' && ( messageData.indefinite || (/indef|\*|max/).exec( params.block_timer ) ) ) {
Morebits.status.info( 'Info', 'Blanking talk page per preferences and creating a new level 2 heading for the date' );
text = "== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ==\n";
} else if( !
Morebits.status.info( 'Info', 'Will create a new level 2 heading for the date, as none was found for this month' );
text += "== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ==\n";
}
text +=
} else {
if(
text += "== " + messageData.heading + " ==\n";
} else if( !dateHeaderRegexResult || dateHeaderRegexResult.index !== lastHeaderIndex ) {
Morebits.status.info( 'Info', 'Will create a new level 2 heading for the date, as none was found for this month' );
text += "== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ==\n";
}
text += Twinkle.warn.callbacks.getWarningWikitext(params.sub_group, params.article,
params.reason, params.main_group === 'custom') + " ~~~~";
}
if ( Twinkle.getPref('showSharedIPNotice') && Morebits.isIPAddress( mw.config.get('wgTitle') ) ) {
Morebits.status.info( 'Info', 'Adding a shared IP notice' );
Baris 12.201 ⟶ 14.258:
}
var summary;
switch( params.sub_group.substr( -1 ) ) {
summary
break;
case "2":
summary = "Caution";
break;
case "3":
summary = "Warning";
break;
case "4":
summary = "Final warning";
break;
case "m":
if( params.sub_group.substr( -3 ) === "4im" ) {
summary = "Only warning";
break;
}
summary = "Notice";
break;
default:
summary = "Notice";
break;
}
summary += ": " + Morebits.string.toUpperCaseFirstChar(messageData.label);
} else {
summary = messageData.summary;
if ( messageData.suppressArticleInSummary !== true && params.article ) {
if ( params.sub_group === "uw-socksuspect" ) { // this template requires a username
summary += " of [[User:" + params.article + "]]";
} else {
summary += " on [[" + params.article + "]]";
}
}
}
Baris 12.221 ⟶ 14.308:
// First, check to make sure a reason was filled in if uw-username was selected
if(e.target.sub_group.value === 'uw-username' && e.target.article.value.trim() === '') {
alert("You must supply a reason for the {{uw-username}} template.");
return;
}
// Find the selected <option> element so we can fetch the data structure
var selectedEl = $(e.target.sub_group).find('option[value="' + $(e.target.sub_group).val() + '"]');
// Then, grab all the values provided by the form
var params = {
reason: e.target.block_reason ? e.target.block_reason.value : e.target.reason.value,
Baris 12.234 ⟶ 14.323:
sub_group: e.target.sub_group.value,
article: e.target.article.value, // .replace( /^(Image|Category):/i, ':$1:' ), -- apparently no longer needed...
block_timer: e.target.block_timer ? e.target.block_timer.value : null,
messageData: selectedEl.data("messageData")
};
Baris 12.248 ⟶ 14.338:
wikipedia_page.load( Twinkle.warn.callbacks.main );
};
})(jQuery);
//</nowiki>
//<nowiki>
(function($){
/*
Baris 12.267 ⟶ 14.367:
return;
}
};
Baris 12.284 ⟶ 14.384:
Twinkle.xfd.printRationale = function twinklexfdPrintRationale() {
if (Twinkle.xfd.currentRationale) {
Morebits.status.printUserText(Twinkle.xfd.currentRationale, "Your deletion rationale is provided below, which you can copy and paste into a new XFD dialog if you wish to try again:");
// only need to print the rationale once
Twinkle.xfd.currentRationale = null;
Baris 12.298 ⟶ 14.391:
Twinkle.xfd.callback = function twinklexfdCallback() {
var Window = new Morebits.simpleWindow( 600, 350 );
Window.setTitle( "Nominate for deletion (XfD)" );
Window.setScriptName( "Twinkle" );
Window.addFooterLink( "About deletion discussions", "WP:XFD" );
Window.addFooterLink( "
var form = new Morebits.quickForm( Twinkle.xfd.callback.evaluate );
Baris 12.331 ⟶ 14.419:
categories.append( {
type: 'option',
label: '
selected: mw.config.get('wgNamespaceNumber') === 6, // File namespace
value: 'ffd'
Baris 12.398 ⟶ 14.486:
var oldreasontextbox = form.getElementsByTagName('textarea')[0];
var oldreason = (oldreasontextbox ? oldreasontextbox.value : '');
var appendReasonBox = function twinklexfdAppendReasonBox() {
work_area.append( {
type: 'textarea',
name: 'xfdreason',
label: 'Reason: ',
value: oldreason,
tooltip: 'You can use wikimarkup in your reason. Twinkle will automatically sign your post.'
} );
// TODO possible future "preview" link here
};
switch( value ) {
Baris 12.436 ⟶ 14.535:
afd_category.append( { type:'option', label:'Debate not yet sorted', value:'U' } );
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.455 ⟶ 14.549:
label: 'Stub types and userboxes are not eligible for TfD. Stub types go to CfD, and userboxes go to MfD.'
} );
var tfd_category = work_area.append( {
type: 'select',
label: 'Choose type of action wanted: ',
name: 'xfdcat',
event: function(e) {
var target = e.target;
// add/remove extra input box
if( target.value === 'tfm' && !target.form.xfdtarget ) { //$(target.parentNode).find("input[name='xfdtarget']").length === 0 ) {
var xfdtarget = new Morebits.quickForm.element( {
name: 'xfdtarget',
type: 'input',
label: 'Other template to be merged: '
} );
target.parentNode.appendChild(xfdtarget.render());
} else {
$(Morebits.quickForm.getElementContainer(target.form.xfdtarget)).remove();
target.form.xfdtarget = null;
//$(target.parentNode).find("input[name='xfdtarget']").remove();
}
}
} );
tfd_category.append( { type: 'option', label: 'Deletion', value: 'tfd', selected: true } );
tfd_category.append( { type: 'option', label: 'Merge', value: 'tfm' } );
work_area.append( {
type: 'checkbox',
Baris 12.473 ⟶ 14.590:
]
} );
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.513 ⟶ 14.625:
} );
}
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.525 ⟶ 14.632:
work_area = new Morebits.quickForm.element( {
type: 'field',
label: '
name: 'work_area'
} );
work_area.append( {
type: '
name: '
event: Twinkle.xfd.callback.ffdvenue_change,
list: [
{
label: 'File for deletion',
value: 'ffd',
tooltip: 'General deletion discussion',
checked: mw.config.get('wgNamespaceNumber') === 6
},
{
label: 'Possibly unfree file',
value: 'puf',
tooltip: 'File has disputed source or licensing information'
},
{
label: 'Non-free content review',
value: 'nfcr',
tooltip: 'File\'s compliance with non-free content criteria ([[WP:NFCC]]) is disputed. User notification does not occur for NFCR, as it is not deemed relevant.',
checked: mw.config.get('wgNamespaceNumber') !== 6
}
]
} );
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.599 ⟶ 14.714:
value: ''
} );
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.629 ⟶ 14.739:
}
} );
cfds_category.append( { type: 'option', label: 'C2A:
cfds_category.append( { type: 'option', label: 'C2B:
cfds_category.append( { type: 'option', label: 'C2C:
cfds_category.append( { type: 'option', label: 'C2D:
cfds_category.append( { type: 'option', label: 'C2E:
work_area.append( {
Baris 12.641 ⟶ 14.751:
value: ''
} );
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.656 ⟶ 14.761:
name: 'work_area'
} );
appendReasonBox();
work_area = work_area.render();
old_area.parentNode.replaceChild( work_area, old_area );
Baris 12.684 ⟶ 14.784:
form.notify.checked = Twinkle.xfd.previousNotify;
form.notify.disabled = false;
}
};
Twinkle.xfd.callback.ffdvenue_change = function twinklexfdCallbackFfdvenueChange(e) {
if (e.target.values === "nfcr") {
e.target.form.notify.disabled = true;
e.target.form.notify.checked = false;
} else {
e.target.form.notify.disabled = false;
e.target.form.notify.checked = true;
}
};
Baris 12.702 ⟶ 14.812:
// First, simple test, is there an instance with this exact name?
if( title === 'Wikipedia:Articles for deletion/' +
number = Math.max( number, 1 );
continue;
Baris 12.708 ⟶ 14.818:
var order_re = new RegExp( '^' +
RegExp.escape( 'Wikipedia:Articles for deletion/' +
'\\s*\\(\\s*(\\d+)(?:(?:th|nd|rd|st) nom(?:ination)?)?\\s*\\)\\s*$');
var match = order_re.exec( title );
Baris 12.723 ⟶ 14.833:
apiobj.params.numbering = number > 0 ? ' (' + apiobj.params.number + ' nomination)' : '';
}
apiobj.params.discussionpage = 'Wikipedia:Articles for deletion/' +
Morebits.status.info( "Next discussion page", "[[" + apiobj.params.discussionpage + "]]" );
Baris 12.742 ⟶ 14.852:
var params = pageobj.getCallbackParameters();
var statelem = pageobj.getStatusElement();
if (!pageobj.exists()) {
statelem.error("It seems that the page doesn't exist; perhaps it has already been deleted");
return;
}
// Check for existing AfD tag, for the benefit of new page patrollers
Baris 12.778 ⟶ 14.893:
// Remove some tags that should always be removed on AfD.
text = text.replace(/\{\{\s*(dated prod|dated prod blp|Prod blp\/dated|Proposed deletion\/dated|prod2|Proposed deletion endorsed|New unreviewed article|Unreviewed|Userspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
// Then, test if there are speedy deletion-related templates on the article.
var textNoSd = text.replace(/\{\{\s*(db(-\w*)?|delete|(?:hang|hold)[\- ]?on)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
Baris 12.803 ⟶ 14.918:
},
discussionPage: function(pageobj) {
var params = pageobj.getCallbackParameters();
pageobj.setPageText("{{subst:afd2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|pg=" + pageobj.setEditSummary("Creating deletion discussion page for [[" +
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
Baris 12.829 ⟶ 14.944:
var statelem = pageobj.getStatusElement();
var text = old_text.replace( /(<\!-- Add new entries to the TOP of the following list -->\n+)/, "$1{{subst:afd3|pg=" +
if( text === old_text ) {
var linknode = document.createElement('a');
linknode.setAttribute("href", mw.util.getUrl("Wikipedia:Twinkle/Fixing AFD") + "?action=purge" );
linknode.appendChild(document.createTextNode('How to fix AFD'));
statelem.error( [ 'Could not find the target spot for the discussion. To fix this problem, please see ', linknode, '.' ] );
return;
}
Baris 12.853 ⟶ 14.971:
var params = pageobj.getCallbackParameters();
var initialContrib = pageobj.getCreator();
// Disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
return;
}
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:AFDWarning|1=" +
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: listing at [[WP:AFD|articles for deletion]] of [[" +
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
Baris 12.873 ⟶ 14.998:
}
},
Baris 12.883 ⟶ 15.007:
pageobj.setPageText((params.noinclude ? "<noinclude>" : "") + "{{subst:template for discussion|help=off|" +
(params.tfdinline ? "type=inline|" : "") + mw.config.get('wgTitle') + (params.noinclude ? "}}</noinclude>" : "}}\n") + text);
pageobj.setEditSummary("Nominated for deletion; see [[" + params.logpage + "#" +
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
pageobj.setWatchlist(true);
break;
case 'no':
pageobj.setWatchlistFromPreferences(false);
break;
default:
pageobj.setWatchlistFromPreferences(true);
break;
}
pageobj.setCreateOption('nocreate');
pageobj.save();
},
taggingTemplateForMerge: function(pageobj) {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
pageobj.setPageText((params.noinclude ? "<noinclude>" : "") + "{{subst:tfm|help=off|" +
(params.tfdinline ? "type=inline|1=" : "1=") + params.otherTemplateName.replace(/^Template:/, "") +
(params.noinclude ? "}}</noinclude>" : "}}\n") + text);
pageobj.setEditSummary("Nominated for merging with [[" + params.otherTemplateName + "]]; see [[" +
params.logpage + "#" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
Baris 12.903 ⟶ 15.050:
var statelem = pageobj.getStatusElement();
var added_data = "";
switch( params.xfdcat ) {
case 'tfd':
added_data = "{{subst:tfd2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "}}";
break;
case 'tfm':
added_data = "{{subst:tfm2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}";
break;
default:
alert("twinklexfd in todaysList: unknown TFD action");
break;
}
var text = old_text.replace( '-->', "-->\n" + added_data );
if( text === old_text ) {
statelem.error( 'failed to find target spot for the discussion' );
Baris 12.928 ⟶ 15.090:
userNotification: function(pageobj) {
var initialContrib = pageobj.getCreator();
var params = pageobj.getCallbackParameters();
// Disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
return;
}
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n
switch (params.xfdcat) {
case 'tfd':
notifytext += "{{subst:tfdnotice|1=" + mw.config.get('wgTitle') + "}} ~~~~";
break;
case 'tfm':
notifytext += "{{subst:tfmnotice|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}} ~~~~";
break;
default:
alert("twinklexfd in userNotification: unknown TFD action");
break;
}
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: nomination at [[WP:TFD|templates for discussion]] of [[" +
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
Baris 12.958 ⟶ 15.140:
if( titles.length <= 0 ) {
apiobj.params.numbering = apiobj.params.number = '';
} else {
var number = 0;
Baris 12.965 ⟶ 15.146:
// First, simple test, is there an instance with this exact name?
if( title === 'Wikipedia:Miscellany for deletion/' +
number = Math.max( number, 1 );
continue;
Baris 12.971 ⟶ 15.152:
var order_re = new RegExp( '^' +
RegExp.escape( 'Wikipedia:Miscellany for deletion/' +
'\\s*\\(\\s*(\\d+)(?:(?:th|nd|rd|st) nom(?:ination)?)?\\s*\\)\\s*$' );
var match = order_re.exec( title );
Baris 12.986 ⟶ 15.167:
apiobj.params.numbering = number > 0 ? ' (' + apiobj.params.number + ' nomination)' : '';
}
apiobj.params.discussionpage = "Wikipedia:Miscellany for deletion/" +
apiobj.statelem.info( "next in order is [[" + apiobj.params.discussionpage + ']]');
Baris 13.043 ⟶ 15.224:
},
discussionPage: function(pageobj) {
var params = pageobj.getCallbackParameters();
pageobj.setPageText("{{subst:mfd2|text=" + Morebits.string.formatReasonText(params.reason
" ~~~~|pg=" + Morebits.pageNameNorm + "}}\n");
pageobj.setEditSummary("Creating deletion discussion page for [[" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
Baris 13.072 ⟶ 15.253:
var date_header = "===" + date.getUTCMonthName() + ' ' + date.getUTCDate() + ', ' + date.getUTCFullYear() + "===\n";
var date_header_regex = new RegExp( "(===\\s*" + date.getUTCMonthName() + '\\s+' + date.getUTCDate() + ',\\s+' + date.getUTCFullYear() + "\\s*===)" );
var new_data = "{{subst:mfd3|pg=" +
if( date_header_regex.test( text ) ) { // we have a section already
Baris 13.102 ⟶ 15.283:
var params = pageobj.getCallbackParameters();
//
if (initialContrib === mw.config.get('wgUserName')) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
} else {
// Really notify the creator
Twinkle.xfd.callbacks.mfd.userNotificationMain(params, initialContrib, "Notifying initial contributor");
}
// Also notify the user who owns the subpage if they are not the creator
Baris 13.116 ⟶ 15.302:
{
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, actionName + " (" + initialContrib + ")");
var notifytext = "\n{{subst:MFDWarning|1=" +
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: listing at [[WP:MFD|miscellany for deletion]] of [[" +
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
Baris 13.145 ⟶ 15.331:
// Adding discussion
var wikipedia_page = new Morebits.wiki.page(params.logpage, "Adding discussion to today's list");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
Baris 13.151 ⟶ 15.337:
// Notification to first contributor
if (params.usertalk) {
// Disallow warning yourself
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
} else {
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:idw|1=" + mw.config.get('wgTitle') + "}}";
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: listing at [[WP:FFD|files for deletion]] of [[" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
case 'yes':
usertalkpage.setWatchlist(true);
case 'no':
usertalkpage.setWatchlistFromPreferences( break;
default:
usertalkpage.setWatchlistFromPreferences(true);
break;
}
usertalkpage.setFollowRedirect(true);
usertalkpage.append();
}
}
},
Baris 13.179 ⟶ 15.370:
pageobj.setPageText("{{ffd|log=" + params.date + "}}\n" + text);
pageobj.setEditSummary("Nominated for deletion; see [[" + params.logpage + "#" +
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
Baris 13.203 ⟶ 15.394:
}
pageobj.setPageText(text + "\n{{subst:ffd2|Reason=" + Morebits.string.formatReasonText(params.reason) +
"|Uploader=" + params.uploader + "|1=" + mw.config.get('wgTitle') + "}} ~~~~"); pageobj.setEditSummary("Adding [[" +
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
Baris 13.232 ⟶ 15.424:
pageobj.setPageText("{{puf|help=off|log=" + params.date + "}}\n" + text);
pageobj.setEditSummary("Listed at [[WP:PUF|possibly unfree files]]: [[" + params.logpage + "#" +
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
Baris 13.251 ⟶ 15.443:
var params = pageobj.getCallbackParameters();
pageobj.setPageText(text + "\n{{subst:puf2|reason=" + Morebits.string.formatReasonText(params.reason) +
"|image=" + mw.config.get('wgTitle') + "}} ~~~~"); pageobj.setEditSummary("Adding [[" +
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
Baris 13.271 ⟶ 15.464:
userNotification: function(pageobj) {
var initialContrib = pageobj.getCreator();
// Disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
return;
}
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:idw-puf|1=" + mw.config.get('wgTitle') + "}} ~~~~";
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: listing at [[WP:PUF|possibly unfree files]] of [[" +
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
Baris 13.291 ⟶ 15.491:
}
},
// NOTE: NFCR doesn't have any callbacks here, everything happens in callback.evaluate
Baris 13.303 ⟶ 15.506:
case 'cfd':
added_data = "{{subst:cfd}}";
editsummary = "Category being considered for deletion; see [[" + params.logpage + "#" +
break;
case 'cfm':
added_data = "{{subst:cfm|" + params.target + "}}";
editsummary = "Category being considered for merging; see [[" + params.logpage + "#" +
break;
case 'cfr':
added_data = "{{subst:cfr|" + params.target + "}}";
editsummary = "Category being considered for renaming; see [[" + params.logpage + "#" +
break;
case 'cfs':
added_data = "{{subst:cfs|" + params.target + "|" + params.target2 + "}}";
editsummary = "Category being considered for splitting; see [[" + params.logpage + "#" +
break;
case 'cfc':
added_data = "{{subst:cfc|" + params.target + "}}";
editsummary = "Category being considered for conversion to an article; see [[" + params.logpage + "#" +
break;
default:
Baris 13.351 ⟶ 15.554:
switch( params.xfdcat ) {
case 'cfd':
added_data = "{{subst:cfd2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "}}"; editsummary = "Added delete nomination of [[:" +
break;
case 'cfm':
added_data = "{{subst:cfm2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}"; editsummary = "Added merge nomination of [[:" +
break;
case 'cfr':
added_data = "{{subst:cfr2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}"; editsummary = "Added rename nomination of [[:" +
break;
case 'cfs':
added_data = "{{subst:cfs2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "|3=" + params.target2 + "}}"; editsummary = "Added split nomination of [[:" +
break;
case 'cfc':
added_data = "{{subst:cfc2|text=" + Morebits.string.formatReasonText(params.reason) +
" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}"; editsummary = "Added convert nomination of [[:" +
break;
default:
Baris 13.375 ⟶ 15.583:
}
var text = old_text.replace( 'below this line -->', "below this line -->\n" + added_data );
if( text === old_text ) {
statelem.error( 'failed to find target spot for the discussion' );
Baris 13.401 ⟶ 15.609:
userNotification: function(pageobj) {
var initialContrib = pageobj.getCreator();
// Disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
return;
}
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:CFDNote|1=" +
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: listing at [[WP:CFD|categories for discussion]] of [[" +
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
Baris 13.451 ⟶ 15.665:
var newcatname = (/^Category:/.test(params.target) ? params.target : ("Category:" + params.target));
var text = old_text.replace( 'BELOW THIS LINE -->', "BELOW THIS LINE -->\n* [[:" +
newcatname + "]]\u00A0\u2013 " + params.xfdcat + (params.reason ? (": " + Morebits.string.formatReasonText(params.reason)) : ".") +
" ~~~~" ); // U+00A0 NO-BREAK SPACE; U+2013 EN RULE
if( text === old_text ) {
Baris 13.460 ⟶ 15.675:
pageobj.setPageText(text);
pageobj.setEditSummary("Adding [[" +
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
Baris 13.523 ⟶ 15.738:
var params = pageobj.getCallbackParameters();
pageobj.setPageText("{{subst:rfd
pageobj.setEditSummary("Listed for discussion at [[" + params.logpage + "#" +
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
Baris 13.544 ⟶ 15.759:
var statelem = pageobj.getStatusElement();
var text = old_text.replace( /(<\!-- Add new entries directly below this line\.? -->)/, "$1\n{{subst:rfd2|text=" +
Morebits.string. params.target + "}} ~~~~\n" );
if( text === old_text ) {
Baris 13.552 ⟶ 15.768:
pageobj.setPageText(text);
pageobj.setEditSummary("Adding [[" +
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
Baris 13.571 ⟶ 15.787:
userNotification: function(pageobj) {
var initialContrib = pageobj.getCreator();
// Disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
pageobj.getStatusElement().warn("You (" + initialContrib + ") created this page; skipping user notification");
return;
}
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")");
var notifytext = "\n{{subst:RFDNote|1=" +
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary("Notification: listing at [[WP:RFD|redirects for discussion]] of [[" +
usertalkpage.setCreateOption('recreate');
switch (Twinkle.getPref('xfdWatchUser')) {
Baris 13.596 ⟶ 15.819:
Twinkle.xfd.callback.evaluate = function(e) {
var type = e.target.category.value;
var usertalk = e.target.notify.checked;
var reason = e.target.xfdreason.value;
var xfdcat, xfdtarget, xfdtarget2,
if( type === "afd" || type === "cfd" || type === "cfds" || type === "tfd" ) {
xfdcat = e.target.xfdcat.value;
}
Baris 13.612 ⟶ 15.833:
}
if( type === 'ffd' ) {
for( var i = 0; i < ffdvenues.length; i++ )
{
if( !ffdvenues[i].checked ) {
continue;
}
ffdvenue = ffdvenues[i].values;
break;
}
}
if( type === "afd" || type === "mfd" || type === "tfd" ) {
Baris 13.619 ⟶ 15.848:
if( type === 'tfd' ) {
tfdinline = e.target.tfdinline.checked;
if (e.target.xfdtarget) {
xfdtarget = e.target.xfdtarget.value;
}
}
if( type === 'mfd' ) {
Baris 13.643 ⟶ 15.875:
'action': 'query',
'list': 'allpages',
'apprefix': 'Articles for deletion/' +
'apnamespace': 4,
'apfilterredir': 'nonredirects',
Baris 13.655 ⟶ 15.887:
case 'tfd': // TFD
Morebits.wiki.addCheckpoint();
if (xfdtarget) {
xfdtarget = Morebits.string.toUpperCaseFirstChar(xfdtarget.replace(/^\:?Template\:/i, ''));
} else {
xfdtarget = '';
}
logpage = 'Wikipedia:Templates for discussion/Log/' + date.getUTCFullYear() + ' ' + date.getUTCMonthName() + ' ' + date.getUTCDate();
params = { tfdinline: tfdinline, logpage: logpage, noinclude: noinclude, xfdcat: xfdcat, target: xfdtarget, reason: reason };
// Tagging template(s)
if (xfdcat === "tfm") {
// Tag this template
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "Tagging this template with merge tag");
wikipedia_page.
params.otherTemplateName = "Template:" + xfdtarget;
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.tfd.taggingTemplateForMerge);
// Tag other template
wikipedia_page = new Morebits.wiki.page("Template:" + xfdtarget, "Tagging other template with merge tag");
wikipedia_page.setFollowRedirect(true);
params = $.extend(params);
params.otherTemplateName = Morebits.pageNameNorm;
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.tfd.taggingTemplateForMerge);
} else {
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "Tagging template with deletion tag");
wikipedia_page.setFollowRedirect(true); // should never be needed, but if the page is moved, we would want to follow the redirect
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.tfd.taggingTemplate);
}
// Updating data for the action completed event
Baris 13.671 ⟶ 15.927:
wikipedia_page = new Morebits.wiki.page(logpage, "Adding discussion to today's log");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(
wikipedia_page.load(Twinkle.xfd.callbacks.tfd.todaysList);
Baris 13.677 ⟶ 15.933:
if (usertalk) {
var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
thispage.setCallbackParameters(params);
thispage.lookupCreator(Twinkle.xfd.callbacks.tfd.userNotification);
// Nice try, but what if the two page creators are the same user?
// Also, other XFD types don't do this... yet!
//if (xfdcat === "tfm") {
// thispage = new Morebits.wiki.page("Template:" + xfdtarget);
// thispage.setCallbackParameters(params);
// thispage.lookupCreator(Twinkle.xfd.callbacks.tfd.userNotification);
//}
}
Baris 13.687 ⟶ 15.952:
'action': 'query',
'list': 'allpages',
'apprefix': 'Miscellany for deletion/' +
'apnamespace': 4,
'apfilterredir': 'nonredirects',
Baris 13.697 ⟶ 15.962:
break;
case 'ffd': // FFD/PUF/NFCR
var dateString = date.getUTCFullYear() + ' ' + date.getUTCMonthName() + ' ' + date.getUTCDate();
logpage = 'Wikipedia:Files for deletion/' + dateString;
Baris 13.703 ⟶ 15.968:
Morebits.wiki.addCheckpoint();
case 'puf':
params.logpage = logpage = 'Wikipedia:Possibly unfree files/' + dateString;
// Updating data for the action completed event
Morebits.wiki.actionCompleted.redirect = logpage;
Morebits.wiki.actionCompleted.notice = "Nomination completed, now redirecting to today's list";
// Tagging file
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "Tagging file with PUF tag");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.puf.taggingImage);
// Adding discussion
wikipedia_page = new Morebits.wiki.page(params.logpage, "Adding discussion to today's list");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.
// Notification to first contributor
if (usertalk) {
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'));
wikipedia_page.setCallbackParameters(params);
wikipedia_page.lookupCreator(Twinkle.xfd.callbacks.puf.userNotification);
}
Morebits.wiki.removeCheckpoint();
break;
case 'nfcr':
// Updating data for the action completed event
Morebits.wiki.actionCompleted.redirect = "Wikipedia:Non-free content review";
Morebits.wiki.actionCompleted.notice = "Nomination completed, now redirecting to the discussion page";
//
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "Tagging file with review tag");
wikipedia_page.
wikipedia_page.setPrependText("{{non-free review}}\n");
wikipedia_page.setEditSummary("This file" +
" has been listed for review at [[Wikipedia:Non-free content review#" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchPage')) {
case 'yes':
wikipedia_page.setWatchlist(true);
break;
case 'no':
wikipedia_page.setWatchlistFromPreferences(false);
break;
default:
wikipedia_page.setWatchlistFromPreferences(true);
break;
}
wikipedia_page.setCreateOption('recreate'); // it might be possible for a file to exist without a description page
wikipedia_page.prepend();
}
// Adding discussion
wikipedia_page = new Morebits.wiki.page("Wikipedia:Non-free content review", "Adding discussion to the NFCR page");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setAppendText("\n\n== [[:" + Morebits.pageNameNorm + "]] ==\n\n" +
Morebits.string.formatReasonText(params.reason) + " ~~~~");
wikipedia_page.setEditSummary("Adding [[" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
switch (Twinkle.getPref('xfdWatchDiscussion')) {
case 'yes':
wikipedia_page.setWatchlist(true);
break;
case 'no':
wikipedia_page.setWatchlistFromPreferences(false);
break;
default:
wikipedia_page.setWatchlistFromPreferences(true);
break;
}
wikipedia_page.setCreateOption('recreate');
wikipedia_page.append(function() {
Twinkle.xfd.currentRationale = null; // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
});
// can't notify user on NFCR, so don't
Morebits.wiki.removeCheckpoint();
break;
default:
// Updating data for the action completed event
Morebits.wiki.actionCompleted.redirect = logpage;
Morebits.wiki.actionCompleted.notice = "Nomination completed, now redirecting to the discussion page";
// Tagging file
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "Adding deletion tag to file page");
wikipedia_page.setFollowRedirect(true);
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.xfd.callbacks.ffd.taggingImage);
// Contributor specific edits
wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'));
wikipedia_page.setCallbackParameters(params);
wikipedia_page.lookupCreator(Twinkle.xfd.callbacks.ffd.main);
break;
}
Morebits.wiki.removeCheckpoint();
Baris 13.840 ⟶ 16.162:
}
};
})(jQuery);
//</nowiki>
|