"मस्यौदा:उदाहरण" का संशोधनहरू बिचको अन्तर

अस्वीकृत निवेदन
परीक्षण
चिनो: प्रतिस्थापित
पङ्क्ति २:
{{User sandbox}}
<!-- EDIT BELOW THIS LINE -->
केवल परीक्षणको लागि मात्र
//<nowiki>
 
 
(function($){
 
 
/*
****************************************
*** friendlytag.js: Tag module
****************************************
* Mode of invocation: Tab ("Tag")
* Active on: Existing articles; file pages with a corresponding file
* which is local (not on Commons); existing subpages of
* {Wikipedia|Wikipedia talk}:Articles for creation;
* all redirects
* Config directives in: FriendlyConfig
*/
 
Twinkle.tag = function friendlytag() {
// अनुप्रेषण ट्याग
if( Morebits.wiki.isPageRedirect() ) {
Twinkle.tag.mode = 'redirect';
Twinkle.addPortletLink( Twinkle.tag.callback, "ट्याग", "friendly-tag", "अनुप्रेषण ट्याग" );
}
// फाइल ट्याग
else if( mw.config.get('wgNamespaceNumber') === 6 && !document.getElementById("mw-sharedupload") && document.getElementById("mw-imagepage-section-filehistory") ) {
Twinkle.tag.mode = 'file';
Twinkle.addPortletLink( Twinkle.tag.callback, "ट्याग", "friendly-tag", "फाइलमा मर्मत ट्याग थप्ने" );
}
// लेख/मस्यौदा लेख ट्याग
else if( ( mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 118 || /^Wikipedia( talk)?\:Articles for creation\//.exec(Morebits.pageNameNorm) ) && mw.config.get('wgCurRevisionId') ) {
Twinkle.tag.mode = 'article';
Twinkle.addPortletLink( Twinkle.tag.callback, "ट्याग", "friendly-tag", "लेखमा मर्मत ट्याग थप्ने" );
}
};
 
Twinkle.tag.callback = function friendlytagCallback( uid ) {
var Window = new Morebits.simpleWindow( 630, (Twinkle.tag.mode === "लेख") ? 500 : 400 );
Window.setScriptName( "ट्विङ्कल" );
// 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: 'पृष्ठलाई गस्ती गरिएको चिन्ह लगाउनुहोस्',
value: 'patrolPage',
name: 'patrolPage',
checked: Twinkle.getFriendlyPref('markTaggedPagesAsPatrolled')
}
]
} );
}
 
switch( Twinkle.tag.mode ) {
case 'article':
Window.setTitle( "लेख मर्मत ट्याग थप्दै" );
 
form.append({
type: 'select',
name: 'sortorder',
label: 'यो सूची हेर्नुहोस्:',
tooltip: 'तपाई यो ट्विङ्कल विकल्पलाई आफ्नो [[विकिपीडिया:ट्विङ्कल/प्राथमिकताहरू]]बाट परिवर्तन गर्न सक्नुहुन्छ',
event: Twinkle.tag.updateSortOrder,
list: [
{ type: 'option', value: 'cat', label: 'श्रेणी अनुसार', selected: Twinkle.getFriendlyPref('tagArticleSortOrder') === 'cat' },
{ type: 'option', value: 'alpha', label: 'वर्णमाला क्रम अनुसार', selected: Twinkle.getFriendlyPref('tagArticleSortOrder') === 'alpha' }
]
});
 
form.append({
type: 'div',
id: 'tagWorkArea',
className: 'morebits-scrollbox',
style: 'max-height: 28em'
});
 
form.append( {
type: 'checkbox',
list: [
{
label: 'यदि सम्भव छ भने {{multiple issues}} समूह अलगग्याउने',
value: 'group',
name: 'group',
tooltip: 'If applying three or more templates supported by {{multiple issues}} and this box is checked, all supported templates will be grouped inside a {{multiple issues}} template.',
checked: Twinkle.getFriendlyPref('groupByDefault')
}
]
}
);
 
break;
 
case 'file':
Window.setTitle( "फाइल मर्मत ट्याग थप्दै" );
 
// गर्नुपर्ने: सम्भवत अनुकूलन ट्यागहरू चेकबक्सहरूको सूचीमा थप गर्नुहोस्
 
form.append({ type: 'header', label: 'इजाजतपत्र र सोर्सिङ समस्या ट्याग' });
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.licenseList } );
 
form.append({ type: 'header', label: 'विकिमीडिया कमन्स-सम्बन्धित ट्यागहरू' });
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.commonsList } );
 
form.append({ type: 'header', label: 'सफाइ ट्यागहरू' } );
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.cleanupList } );
 
form.append({ type: 'header', label: 'चित्र गुणस्तर ट्यागहरू' } );
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.qualityList } );
 
form.append({ type: 'header', label: 'प्रतिस्थापन ट्यागहरू' });
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.replacementList } );
break;
 
case 'redirect':
Window.setTitle( "अनुप्रेषण ट्याग थप्दै" );
 
form.append({ type: 'header', label:'हिज्जे, गल्तीहिज्जे, क्रिया ढाँचाहरू' });
form.append({ type: 'checkbox', name: 'redirectTags', list: Twinkle.tag.spellingList });
 
form.append({ type: 'header', label:'वैकल्पिक नाम ढाँचाहरू' });
form.append({ type: 'checkbox', name: 'redirectTags', list: Twinkle.tag.alternativeList });
 
form.append({ type: 'header', label:'विविध र प्रशासनिक अनुप्रेषित ढाँचाहरू' });
form.append({ type: 'checkbox', name: 'redirectTags', list: Twinkle.tag.administrativeList });
break;
 
default:
alert("Twinkle.tag: unknown mode " + Twinkle.tag.mode);
break;
}
 
form.append( { type:'submit' } );
 
var result = form.render();
Window.setContent( result );
Window.display();
 
if (Twinkle.tag.mode === "article") {
// क्रम ड्रपडाउनमा परिवर्तन घटना नक्कल गर्नुहोस्, ट्याग सूची सुरू गर्न
var evt = document.createEvent("घटना");
evt.initEvent("change", true, true);
result.sortorder.dispatchEvent(evt);
}
};
 
Twinkle.tag.checkedTags = [];
 
Twinkle.tag.updateSortOrder = function(e) {
var sortorder = e.target.value;
 
Twinkle.tag.checkedTags = e.target.form.getChecked("articleTags");
if (!Twinkle.tag.checkedTags) {
Twinkle.tag.checkedTags = [];
}
var container = new Morebits.quickForm.element({ type: "fragment" });
 
// एक चेकबक्स उत्पन्न गर्ने, उपयुक्त उपसमूहको साथ आवश्यक भएमा
var makeCheckbox = function(tag, description) {
var checkbox = { value: tag, label: "{{" + tag + "}}: " + description };
if (Twinkle.tag.checkedTags.indexOf(tag) !== -1) {
checkbox.checked = true;
}
switch (tag) {
case "cleanup":
checkbox.subgroup = {
name: 'cleanup',
type: 'input',
label: 'विशेष कारण किन सफाइ आवश्यक छ: ',
tooltip: 'आवश्यक छ ।',
size: 35
};
break;
case "copy edit":
checkbox.subgroup = {
name: 'copyEdit',
type: 'input',
label: '"यो लेखलाई प्रतिलिपि सम्पादन गर्नु आवश्यक छ..." ',
tooltip: 'जस्तै "लगातार हिज्जे" । वैकल्पिक ।',
size: 35
};
break;
case "copypaste":
checkbox.subgroup = {
name: 'copypaste',
type: 'input',
label: 'स्रोत यूआरएल: ',
tooltip: 'यदि ज्ञात भएमा ।',
size: 50
};
break;
case "expert-subject":
checkbox.subgroup = {
name: 'expertSubject',
type: 'input',
label: 'प्रासङ्गिक विकिपरियोजनाको नाम: ',
tooltip: 'वैकल्पिक रूपमा, विकिपरियोजनाको नाम प्रविष्ट गर्नुहोस् जुन एक विशेषज्ञलाई मद्दत गर्न सक्दछ । "विकिपरियोजनाको" उपसर्ग शामिल नगर्नुहोला ।'
};
break;
case "globalize":
checkbox.subgroup = {
name: 'globalize',
type: 'select',
list: [
{ label: "{{globalize}}: लेखले विषयको विश्वव्यापीकरणलाई देखाउन सक्दैन", value: "globalize" },
{
label: "क्षेत्र-विशेष {{globalize}} उपढाँचाहरू",
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: 'अन्य लेख: ',
tooltip: 'धेरै लेख निर्दिष्ट गर्दा, तिनीहरूलाई पाइप क्यारेक्टरसँग अलग गर्नुहोस्: लेख एक|लेख दुई'
},
{
name: 'mergeTagOther',
type: 'checkbox',
list: [
{
label: 'अर्को लेखमा {{' + otherTagName + '}} ट्याग गर्नुहोस्',
checked: true,
tooltip: 'एकल लेखको नाम प्रविष्ट गरिएमा मात्र उपलब्ध छ ।'
}
]
}
];
if (mw.config.get('wgNamespaceNumber') === 0) {
checkbox.subgroup.push({
name: 'mergeReason',
type: 'textarea',
label: 'मर्जको लागि तर्क (यो ' +
(tag === "merge to" ? 'the other article\'s' : 'this article\'s') + ' वार्ता पृष्ठ) मा पोस्ट गरिनेछ:',
tooltip: 'वैकल्पिक, तर दृढ सिफारिस गरिएको । भएन भने खाली छोड्नुहोस् । एकल लेखको नाम प्रविष्ट गरिएमा मात्र उपलब्ध छ ।'
});
}
break;
case "नेपालीमा नभएको":
case "असभ्य अनुवाद":
checkbox.subgroup = [
{
name: 'translationLanguage',
type: 'input',
label: 'लेखको भाषा (यदि ज्ञात भएमा): ',
tooltip: 'सहयोगको लागि [[विकिपीडिया:भाषा पहिचान चार्ट]] हेर्दै विचार गर्नुहोस् । पृष्ठहरू अनुवाद गर्नु आवश्यक मा सूचीबद्ध गर्नुहोस्, कृपया यो बाकस खाली छोड्नबाट बचाउन प्रयास गर्नुहोस्, जब सम्म तपाई पूर्णतया निश्चित हुनुहुन्न ।'
}
];
if (tag === "not English") {
checkbox.subgroup.push({
name: 'translationNotify',
type: 'checkbox',
list: [
{
label: 'लेख सिर्जनाकर्ता सूचित गर्नुहोस्',
checked: true,
tooltip: "सृष्टिकर्ताको कुराकानी पृष्ठमा {{uw-notnepali}} राख्दछ ।"
}
]
});
}
checkbox.subgroup.push({
name: 'translationPostAtPNT',
type: 'checkbox',
list: [
{
label: 'लेख यस विकिपीडिया:अनुवाद आवश्यक पृष्ठहरू मा सूचीबद्ध गर्नुहोस्',
checked: true
}
]
});
checkbox.subgroup.push({
name: 'translationComments',
type: 'textarea',
label: 'अनुवाद आवश्यक पृष्ठहरू मा पोस्ट गर्न थप टिप्पणीहरू',
tooltip: 'वैकल्पिक र यो केवल प्रासङ्गिक यदि यो "लेख सूची" ... माथि जाँच गरिएको भए ।'
});
break;
case "notability":
checkbox.subgroup = {
name: 'notability',
type: 'select',
list: [
{ label: "{{notability}}: लेखको विषयले सामान्य उल्लेखनीयता दिशानिर्देशलाई पूरा गर्न सक्दैन", value: "none" },
{ label: "{{notability|शैक्षणिक}}: शैक्षणिकको लागि उल्लेखनीयता दिशानिर्देश", value: "शैक्षणिक" },
{ label: "{{notability|जीवनी}}: जीवनीको लागि उल्लेखनीयता दिशानिर्देश", value: "जीवनी" },
{ label: "{{notability|पुस्तक}}: पुस्तकको लागि उल्लेखनीयता दिशानिर्देश", value: "पुस्तक" },
{ label: "{{notability|कम्पनी}}: कम्पनी र संगठनको लागि उल्लेखनीयता दिशानिर्देश", value: "कम्पनी" },
{ label: "{{notability|कार्यक्रम}}: कार्यक्रमको लागि उल्लेखनीयता दिशानिर्देश", value: "कार्यक्रम" },
{ label: "{{notability|चलचित्र}}: चलचित्रको लागि उल्लेखनीयता दिशानिर्देश", value: "चलचित्र" },
{ label: "{{notability|स्थान}}: स्थानको लागि उल्लेखनीयता दिशानिर्देश", value: "स्थान" },
{ label: "{{notability|संगीत}}: संगीतको लागि उल्लेखनीयता दिशानिर्देश", value: "संगीत" },
{ label: "{{notability|नवशब्दिक}}: नवशब्दिकको लागि उल्लेखनीयता दिशानिर्देश", value: "नवशब्दिक" },
{ label: "{{notability|संख्या}}: को लागि उल्लेखनीयता दिशानिर्देश", value: "संख्या" },
{ label: "{{notability|उत्पादन}}: उत्पादन तथा सेवाको लागि उल्लेखनीयता दिशानिर्देश", value: "उत्पादन" },
{ label: "{{notability|खेलकुद}}: खेलकुदको लागि उल्लेखनीयता दिशानिर्देश", value: "खेलकुद" },
{ label: "{{notability|वेब}}: वेब सामग्रीको लागि उल्लेखनीयता दिशानिर्देश", value: "वेब" }
]
};
break;
default:
break;
}
return checkbox;
};
 
// क्रमबद्ध क्रम
if (sortorder === "cat") {
// ट्यागको माध्यमबाट पुनरावृद्धि गर्न र प्रत्येकका लागि एक चेकबक्स सिर्जना गर्न
var doCategoryCheckboxes = function(subdiv, array) {
var checkboxes = [];
$.each(array, function(k, tag) {
var description = Twinkle.tag.article.tags[tag];
checkboxes.push(makeCheckbox(tag, description));
});
subdiv.append({
type: "checkbox",
name: "articleTags",
list: checkboxes
});
};
 
var i = 0;
// प्रत्येक श्रेणी र उप-श्रेणी मार्फत जानुहोस् र चेक बाकसहरूको सूचीहरू थप्नुहोस्
$.each(Twinkle.tag.article.tagCategories, function(title, content) {
container.append({ type: "header", id: "tagHeader" + i, label: title });
var subdiv = container.append({ type: "div", id: "tagSubdiv" + i++ });
if ($.isArray(content)) {
doCategoryCheckboxes(subdiv, content);
} else {
$.each(content, function(subtitle, subcontent) {
subdiv.append({ type: "div", label: [ Morebits.htmlNode("b", subtitle) ] });
doCategoryCheckboxes(subdiv, subcontent);
});
}
});
}
// वर्णमाला क्रमबद्ध क्रम
else {
var checkboxes = [];
$.each(Twinkle.tag.article.tags, function(tag, description) {
checkboxes.push(makeCheckbox(tag, description));
});
container.append({
type: "checkbox",
name: "articleTags",
list: checkboxes
});
}
 
// कुनै अनुकूलन ट्यागहरू जोड्ने
if (Twinkle.getFriendlyPref('customTagList').length) {
container.append({ type: 'header', label: 'अनुकूलन ट्याग' });
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);
 
// शैली समायोजन
$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' });
 
// प्रत्येक ढाँचा विवरण पृष्ठमा लिङ्क थप्नुहोस्
$.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.values)));
link.setAttribute("target", "_blank");
$checkbox.parent().append(["\u00A0", link]);
});
};
 
 
// लेखहरूको लागि ट्यागहरू यहाँबाट सुरू हुन्छ
 
Twinkle.tag.article = {};
 
// वर्णमाला क्रममा सबै लेख ट्यागको सूची
// पूर्वनिर्धारित "श्रेणीकृत" दृश्यमा ट्यागहरू देखाउन, तिनीहरूलाई तल श्रेणीट्यागमा ह्यास थप्नुहोस् ।
 
Twinkle.tag.article.tags = {
"advert": "लेख एक विज्ञापन जस्तै लेखिएको",
"all plot": "लेख लगभग पूर्णरूपले एक सारांश हो",
"autobiography": "लेख एक आत्मकथा हो र तटस्थ रूपमा नलेखिएको",
"BLP sources": "जीमाजी लेख प्रमाणिकरणको लागि थप स्रोतहरू आवश्यक पर्दछ",
"BLP unsourced": "जीमाजी लेखमा कुनै स्रोत छैन (यसको सट्टा नयाँ लेखहरूको लागि जीमाजीपृहनी प्रयोग गर्नुहोस्)",
"citation style": "लेख अस्पष्ट वा असङ्गत इनलाइन उद्धरण छ",
"cleanup": "लेखमा सफाइ आवश्यक हुन सक्छ",
"cleanup-reorganize": "लेख विकिपीडियाको लेआउट दिशानिर्देशहरू पालन गर्न पुन:निर्माणको आवश्यकता हुन सक्छ",
"close paraphrasing": "लेखमा एक गैर-मुक्त प्रतिलिपि अधिकार स्रोतको नजिकको सम्वन्धन समाविष्ट छ",
"COI": "लेख निर्माता वा प्रमुख योगदानकर्तालाई रुचिको विवाद हुन सक्छ",
"condense": "लेखमा यसको सामग्री विभाजनका लागि धेरै हेडरहरू हुनसक्छन्",
"confusing": "लेख भ्रामक वा अस्पष्ट हुन सक्छ",
"context": "लेखले अपर्याप्त सन्दर्भ प्रदान गर्दछ",
"copy edit": "लेखलाई व्याकरण, शैली, कोहनी, टोन, र/वा हिज्जेका लागि प्रतिलिपि सम्पादन आवश्यक छ",
"copypaste": "लेख एक स्रोतबाट प्रतिलिपि गरिएको जस्तो देखिन्छ",
"dead end": "लेखसँग अन्य लेखहरूको कुनै लिङ्क छैन",
"disputed": "लेखमा शङ्कास्पद व्यावहारिक सटीकता छ",
"essay-like": "लेख एक व्यक्तिगत प्रतिबिम्ब वा विचार निबन्ध जस्तै लेखिएको छ",
"expand language": "लेखलाई एक विदेशी भाषा विकिपीडियाबाट सामाग्रीको विस्तार गर्न सकिन्छ",
"expert-subject": "लेखमा एक विशेषज्ञले ध्यान दिनु आवश्यक छ",
"external links": "लेखको बाह्य लिङ्कहरूले सामग्री नीति वा दिशानिर्देशहरू पालना गर्दैन",
"fansite": "लेख एक फैनसाइट जस्तो देखिन्छ",
"fiction": "लेख तथ्य र उपन्यास बीच भेद गर्न विफल",
"globalize": "लेखले विषयको विश्वव्यापीकरण देखाउन सक्दैन",
"GOCEinuse": "लेख हाल गिल्डको प्रतिलिपि सम्पादकहरू द्वारा एक प्रमुख प्रतिलिपि सम्पादनको माध्यमले गुज्रिरहेको छ",
"hoax": "लेख एक पूरा प्रचार हुन सक्छ",
"improve categories": "लेखमा अतिरिक्त श्रेणीको आवश्यकता हुन सक्छ",
"in-universe": "लेख विषय काल्पनिक छ र गैर-काल्पनिक परिप्रेक्ष्यबाट पुनःलेखन आवश्यक छ",
"incoherent": "लेख बुझ्न असहज वा धेरै कठिन छ",
"in use": "लेख छोटो समयको लागि एक प्रमुख सम्पादनबाट गुज्रिरहेको छ",
"lead missing": "लेखमा कुनै लिखित परिचय खण्ड छैन र एउटा लेख्नु पर्छ",
"lead rewrite": "अनुच्छेदमा नेतृत्व सेक्शनको दिशानिर्देश पालन गर्नको लागी पुनर्लेखनको आवश्यकता छ",
"lead too long": "लेखको परिचय भाग धेरै लामो छ जुन छोटो हुनुपर्छ",
"lead too short": "लेखको परिचय भाग धेरै छोटो छ जुन विस्तार गर्नुपर्छ",
"linkrot": "लेख सन्दर्भहरूले नाङ्गो यूआरएलहरू प्रयोग गर्दछ, जो लिङ्क छदै छैनन्",
"manual": "लेख एक म्यानुअल वा गाइडबुक जस्तै लेखिएको छ",
"merge": "लेख दिइएको अर्को लेखसँग मर्ज गरिनुपर्छ",
"merge from": "अर्को अनुच्छेद लेख यस लेखमा मार्जित हुनुपर्छ",
"merge to": "लेख अर्को दिइएको लेखमा मर्ज गरिएको हुनुपर्छ",
"metricate": "लेखले मापनको गैर-एसआई एकाइहरूको उपयोग गर्दछ",
"more footnotes": "लेखमा केही सन्दर्भहरू छन्, तर कुनै पनि पाठ उद्धरण छैन",
"new unreviewed article": "पछि समीक्षाको लागि लेख चिन्हित गर्ने",
"news release": "लेख समाचार रिलीज जस्तै लेखिएको",
"no footnotes": "लेखमा सन्दर्भहरू छन्, तर कुनै पनि पाठ उद्धरण छैन",
"non-free": "लेखमा प्रतिलिपि अधिकार भएको सामग्रीको अत्यधिक वा अनुचित प्रयोग समावेश हुनसक्छ",
"notability": "लेखको विषयले उल्लेखनीयता दिशानिर्देश पूरा गर्दैन",
"not English": "लेख नेपाली भन्दा अन्य भाषामा लेखिएको छ र अनुवाद आवश्यक छ",
"one source": "लेख ठूलो मात्रामा वा पुरा तरिकाले एकल स्रोतमा मात्र निर्भर छ",
"original research": "लेखमा मूल अनुसन्धान वा अनुमोदित दावीहरू छन्",
"orphan": "लेख कुनै अन्य लेखसँग लिङ्क गरिएको छैन",
"overcoverage": "लेखमा एक वा बढी विशिष्ट क्षेत्रहरूको एक विस्तृत पूर्वाग्रह वा असामान्य कवरेज छ",
"overlinked": "लेखमा धेरै डुप्लिकेट र/वा अप्रासङ्गिक लिङ्कहरू हुन सक्छन्",
"overly detailed": "लेखमा जटिल विस्तारको अत्यधिक मात्रा समावेश छ",
"peacock": "लेखमा समावेश नगर्ने विषयलाई प्रबर्धन गर्ने मुख्य शब्दहरू समावेश हुन सक्छन्",
"plot": "लेखमा साक्षात्कार सारांश धेरै लामो छ",
"POV": "लेखले तटस्थ बिन्दुको दृष्टिकोण राख्दैन",
"primary sources": "लेख प्राथमिक स्रोतहरूमा धेरै निर्भर गर्दछ, र द्वितीय स्रोतको आवश्यकता छ",
"prose": "लेख एक सूची ढाँचामा रहेको छ जुन गद्य प्रयोग गरिए राम्रो प्रस्तुत हुन सक्छ",
"recentism": "लेख हालैका कार्यक्रमहरूमा झुकेको छ",
"ref improve": "लेखमा अतिरिक्त सन्दर्भहरू वा प्रमाणिकरणको स्रोतहरू आवश्यक छ",
"rough translation": "लेख खराब गरी अनुवाद गरिएको छ र सफाई आवश्यक छ",
"sections": "लेख खण्डहरूमा बिच्छेदन गर्न आवश्यक छ",
"self-published": "लेखमा आत्म-प्रकाशित स्रोतहरूको लागि अनुचित सन्दर्भ समावेश हुन सक्छ",
"technical": "लेख असीमित पाठकहरूको लागि जटिल हुन सक्छ",
"tense": "लेख गलत कालमा लेखिएको छ",
"third-party": "लेखले सम्बद्ध स्रोतहरूमा धेरै निर्भर गर्दछ, र तेस्रो पक्षका स्रोतहरू चाहिन्छ",
"tone": "लेखको टोन उपयुक्त छैन",
"too few opinions": "लेखमा सबै महत्वपूर्ण दृष्टिकोण समावेश नहुन सक्छ",
"uncategorized": "लेख अश्रेणीकृत छ",
"under construction": "लेख अहिले विस्तार वा प्रमुख परिमार्जनको बीचमा छ",
"underlinked": "लेखमा अतिरिक्त विकिलिङ्क आवश्यक छ",
"undue": "लेख विषयको पहुललाई केहि अनावश्यक तर अन्य छैन",
"unreferenced": "लेखमा कुनै सन्दर्भ छैन",
"unreliable sources": "लेख सन्दर्भहरू विश्वसनीय स्रोतको नहुन सक्छ",
"update": "लेखमा थप अप-डेट जानकारी थपिएको हुनुपर्दछ",
"very long": "लेख धेरै लामो छ",
"weasel": "लेख तटस्थताको वाणी शब्दहरूको प्रयोग गरेर सम्झौता गरिएको छ"
};
 
// श्रेणीको क्रममा ट्यागहरूको सूची
// श्रेणीको साथ-साथै ट्यागहरू वर्णमाला क्रमान्तरणमा हुनुपर्छ
// विवेकसँग नयाँ कोटीहरू थप्नुहोस् - सूची अत्यन्तै लामो छ !
 
Twinkle.tag.article.tagCategories = {
"सफाइ र मर्मतका ट्याग": {
"सामान्य सफाइ": [
"cleanup", // पाठ इनपुटको साथ एक उपसमूह छ
"copy edit" // पाठ इनपुटको साथ एक उपसमूह छ
],
"सम्भावित अवाञ्छित सामग्री": [
"close paraphrasing",
"copypaste", // पाठ इनपुटको साथ एक उपसमूह छ
"external links",
"non-free"
],
"संरचना, ढाँचा, र नेतृत्व खण्ड": [
"cleanup-reorganize",
"condense",
"lead missing",
"lead rewrite",
"lead too long",
"lead too short",
"sections",
"very long"
],
"कल्पना-सम्बन्धी सफाई": [
"all plot",
"fiction",
"in-universe",
"plot"
]
},
"सामान्य सामग्री समस्याहरू": {
"Importance and notability": [
"notability" // पाठ इनपुटको साथ उपश्रेणी छन्
],
"लेखन शैली": [
"advert",
"essay-like",
"fansite",
"manual",
"news release",
"prose",
"technical",
"tense",
"tone"
],
"भाव (वा यसको कमी)": [
"confusing",
"incoherent"
],
"सूचना र विवरण": [
"context",
"expert-subject",
"metricate",
"overly detailed",
"undue"
],
"सम-सामयिक": [
"update"
],
"तटस्थता, पूर्वाग्रह र वास्तविक सटीकता": [
"autobiography",
"COI",
"disputed",
"hoax",
"globalize", // उपश्रेणीहरू सँग एक उपसमूह छ
"overcoverage",
"peacock",
"POV",
"recentism",
"too few opinions",
"weasel"
],
"प्रमाणिकरण र स्रोतहरू": [
"BLP sources",
"BLP unsourced",
"one source",
"original research",
"primary sources",
"ref improve",
"self-published",
"third-party",
"unreferenced",
"unreliable sources"
]
},
"विशिष्ट सामग्री समस्याहरू": {
"भाषा": [
"नेपालीमा नभएको", // has a subgroup with several options
"rough translation", // has a subgroup with several options
"expand language"
],
"लिङ्क": [
"dead end",
"orphan",
"overlinked",
"underlinked"
],
"सन्दर्भ प्रविधी": [
"citation style",
"linkrot",
"more footnotes",
"no footnotes"
],
"श्रेणी": [
"improve categories",
"uncategorized"
]
},
"विलय": [ // these three have a subgroup with several options
"merge",
"merge from",
"merge to"
],
"जानकारीमूलक": [
"GOCEinuse",
"in use",
"new unreviewed article",
"under construction"
]
};
 
// Tags for REDIRECTS start here
 
Twinkle.tag.spellingList = [
{
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'
},
{
label: '{{R from other capitalisation}}: redirect from a title with another method of capitalisation',
value: 'R from other capitalisation'
}
];
 
Twinkle.tag.alternativeList = [
{
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'
},
{
label: '{{R from title without diacritics}}: redirect to the article title with diacritical marks (accents, umlauts, etc.)',
value: 'R from title without diacritics'
}
];
 
Twinkle.tag.administrativeList = [
{
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'
},
{
label: '{{R from school}}: redirect from a school article that had very little information',
value: 'R from school'
}
];
 
// maintenance tags for FILES start here
 
Twinkle.tag.file = {};
 
Twinkle.tag.file.licenseList = [
{ 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' }
];
 
Twinkle.tag.file.commonsList = [
{ label: '{{Copy to Commons}}: free media that should be copied to Commons', value: 'Copy to Commons' },
{ label: '{{Do not move to Commons}} (PD issue): file is PD in the US but not in country of origin', value: 'Do not move to Commons' },
{ label: '{{Do not move to Commons}} (other reason)', value: 'Do not move to Commons_reason' },
{ label: '{{Keep local}}: request to keep local copy of a Commons file', value: 'Keep local' },
{ label: '{{Now Commons}}: file has been copied to Commons', value: 'subst:ncd' }
];
 
Twinkle.tag.file.cleanupList = [
{ label: '{{Artifacts}}: PNG contains residual compression artifacts', value: 'Artifacts' },
{ label: '{{Bad font}}: SVG uses fonts not available on the thumbnail server', value: 'Bad font' },
{ label: '{{Bad format}}: PDF/DOC/... file should be converted to a more useful format', value: 'Bad format' },
{ label: '{{Bad GIF}}: GIF that should be PNG, JPEG, or SVG', value: 'Bad GIF' },
{ label: '{{Bad JPEG}}: JPEG that should be PNG or SVG', value: 'Bad JPEG' },
{ label: '{{Bad trace}}: auto-traced SVG requiring cleanup', value: 'Bad trace' },
{ label: '{{Cleanup image}}: general cleanup', value: 'Cleanup image' },
{ label: '{{Cleanup SVG}}: SVG needing code and/or appearance cleanup', value: 'Cleanup SVG' },
{ label: '{{ClearType}}: image (not screenshot) with ClearType anti-aliasing', value: 'ClearType' },
{ label: '{{Imagewatermark}}: image contains visible or invisible watermarking', value: 'Imagewatermark' },
{ label: '{{NoCoins}}: image using coins to indicate scale', value: 'NoCoins' },
{ label: '{{Overcompressed JPEG}}: JPEG with high levels of artifacts', value: 'Overcompressed JPEG' },
{ label: '{{Opaque}}: opaque background should be transparent', value: 'Opaque' },
{ label: '{{Remove border}}: unneeded border, white space, etc.', value: 'Remove border' },
{ label: '{{Rename media}}: file should be renamed according to the criteria at [[WP:FMV]]', value: 'Rename media' },
{ label: '{{Should be PNG}}: GIF or JPEG should be lossless', value: 'Should be PNG' },
{
label: '{{Should be SVG}}: PNG, GIF or JPEG should be vector graphics', value: 'Should be SVG',
subgroup: {
name: 'svgCategory',
type: 'select',
list: [
{ label: '{{Should be SVG|other}}', value: 'other' },
{ label: '{{Should be SVG|alphabet}}: character images, font examples, etc.', value: 'alphabet' },
{ label: '{{Should be SVG|chemical}}: chemical diagrams, etc.', value: 'chemical' },
{ label: '{{Should be SVG|circuit}}: electronic circuit diagrams, etc.', value: 'circuit' },
{ label: '{{Should be SVG|coat of arms}}: coats of arms', value: 'coat of arms' },
{ label: '{{Should be SVG|diagram}}: diagrams that do not fit any other subcategory', value: 'diagram' },
{ label: '{{Should be SVG|emblem}}: emblems, free/libre logos, insignias, etc.', value: 'emblem' },
{ label: '{{Should be SVG|fair use}}: fair-use images, fair-use logos', value: 'fair use' },
{ label: '{{Should be SVG|flag}}: flags', value: 'flag' },
{ label: '{{Should be SVG|graph}}: visual plots of data', value: 'graph' },
{ label: '{{Should be SVG|logo}}: logos', value: 'logo' },
{ label: '{{Should be SVG|map}}: maps', value: 'map' },
{ label: '{{Should be SVG|music}}: musical scales, notes, etc.', value: 'music' },
{ label: '{{Should be SVG|physical}}: "realistic" images of physical objects, people, etc.', value: 'physical' },
{ label: '{{Should be SVG|symbol}}: miscellaneous symbols, icons, etc.', value: 'symbol' }
]
}
},
{ label: '{{Should be text}}: image should be represented as text, tables, or math markup', value: 'Should be text' },
{ label: '{{Split media}}: there are two different images in the upload log which need to be split', value: 'Split media' }
];
 
Twinkle.tag.file.qualityList = [
{ label: '{{Image-blownout}}', value: 'Image-blownout' },
{ label: '{{Image-out-of-focus}}', value: 'Image-out-of-focus' },
{ label: '{{Image-Poor-Quality}}', value: 'Image-Poor-Quality' },
{ label: '{{Image-underexposure}}', value: 'Image-underexposure' },
{ label: '{{Low quality chem}}: disputed chemical structures', value: 'Low quality chem' }
];
 
Twinkle.tag.file.replacementList = [
{ label: '{{Duplicate}}: exact duplicate of another file, but not yet orphaned', value: 'Duplicate' },
{ label: '{{Obsolete}}: improved version available', value: 'Obsolete' },
{ label: '{{PNG version available}}', value: 'PNG version available' },
{ label: '{{SVG version available}}', value: 'SVG version available' }
];
 
 
// Contains those article tags that *do not* work inside {{multiple issues}}.
Twinkle.tag.multipleIssuesExceptions = [
'copypaste',
'expand language',
'GOCEinuse',
'improve categories',
'in use',
'merge',
'merge from',
'merge to',
'new unreviewed article',
'not English',
'rough translation',
'uncategorized',
'under construction'
];
 
 
Twinkle.tag.callbacks = {
main: function( pageobj ) {
var params = pageobj.getCallbackParameters(),
tagRe, tagText = '', summaryText = 'Added',
tags = [], groupableTags = [], i, totalTags;
 
// Remove tags that become superfluous with this action
var pageText = pageobj.getPageText().replace(/\{\{\s*([Nn]ew unreviewed article|[Uu]nreviewed|[Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g, "");
 
var addTag = function friendlytagAddTag( tagIndex, tagName ) {
var currentTag = "";
if( tagName === 'uncategorized' || tagName === 'improve categories' ) {
pageText += '\n\n{{' + tagName +
'|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}';
} else {
if( tagName === 'globalize' ) {
currentTag += '{{' + params.tagParameters.globalize;
} else {
currentTag += ( Twinkle.tag.mode === 'redirect' ? '\n' : '' ) + '{{' + tagName;
}
 
if( tagName === 'notability' && params.tagParameters.notability !== 'none' ) {
currentTag += '|' + params.tagParameters.notability;
}
 
// prompt for other parameters, based on the tag
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) {
currentTag += '|url=' + params.tagParameters.copypaste;
}
break;
case 'expand language':
currentTag += '|topic=';
var langcode = prompt('Please enter the language code of the other wiki (e.g. "fr", "roa-rup"). \n' +
"This information is required. To skip the {{expand language}} tag, click Cancel.", "");
if (langcode === null || langcode === "") {
Morebits.status.warn("Notice", "{{expand language}} tag skipped by user");
return true; // continue to next tag
} else {
currentTag += '|langcode=' + langcode;
}
var otherart = prompt('Please enter the name of the article in the other wiki (without interwiki prefix). \n' +
"This information is optional. To skip the {{expand language}} tag, click Cancel.", "");
if (otherart === null) {
Morebits.status.warn("Notice", "{{expand language}} tag skipped by user");
return true; // continue to next tag
} else {
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;
case 'merge':
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, ' '));
 
currentTag += '|' + params.mergeTarget;
 
// 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;
default:
break;
}
 
currentTag += (Twinkle.tag.mode === 'redirect') ? '}}' : '|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}\n';
tagText += currentTag;
}
 
if ( tagIndex > 0 ) {
if( tagIndex === (totalTags - 1) ) {
summaryText += ' and';
} else if ( tagIndex < (totalTags - 1) ) {
summaryText += ',';
}
}
 
summaryText += ' {{[[';
if( tagName === 'globalize' ) {
summaryText += "Template:" + params.tagParameters.globalize + '|' + params.tagParameters.globalize;
} else {
summaryText += (tagName.indexOf(":") !== -1 ? tagName : ("Template:" + tagName + "|" + tagName));
}
summaryText += ']]}}';
};
 
if( Twinkle.tag.mode !== 'redirect' ) {
// Check for preexisting tags and separate tags into groupable and non-groupable arrays
for( i = 0; i < params.tags.length; i++ ) {
tagRe = new RegExp( '(\\{\\{' + params.tags[i] + '(\\||\\}\\})|\\|\\s*' + params.tags[i] + '\\s*=[a-z ]+\\d+)', 'im' );
if( !tagRe.exec( pageText ) ) {
if( Twinkle.tag.multipleIssuesExceptions.indexOf(params.tags[i]) === -1 ) {
groupableTags = groupableTags.concat( params.tags[i] );
} else {
tags = tags.concat( params.tags[i] );
}
} else {
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;
}
}
}
 
var miTest = /\{\{(multiple ?issues|article ?issues|mi)[^}]+\{/im.exec(pageText);
var miOldStyleRegex = /\{\{(multiple ?issues|article ?issues|mi)\s*\|([^{]+)\}\}/im;
var miOldStyleTest = miOldStyleRegex.exec(pageText);
 
if( ( miTest || miOldStyleTest ) && groupableTags.length > 0 ) {
Morebits.status.info( 'Info', 'Adding supported tags inside existing {{multiple issues}} tag' );
 
groupableTags.sort();
tagText = "";
 
totalTags = groupableTags.length;
$.each(groupableTags, addTag);
 
summaryText += ' tag' + ( groupableTags.length > 1 ? 's' : '' ) + ' (within {{[[Template:multiple issues|multiple issues]]}})';
if( tags.length > 0 ) {
summaryText += ', and';
}
 
if( miOldStyleTest ) {
// convert tags from old-style to new-style
var split = miOldStyleTest[2].split("|");
$.each(split, function(index, val) {
split[index] = val.replace("=", "|date=").trim();
});
pageText = pageText.replace(miOldStyleRegex, "{{$1|\n{{" + split.join("}}\n{{") + "}}\n" + tagText + "}}\n");
} else {
var miRegex = new RegExp("(\\{\\{\\s*" + miTest[1] + "\\s*(?:\\|(?:\\{\\{[^{}]*\\}\\}|[^{}])*)?)\\}\\}\\s*", "im");
pageText = pageText.replace(miRegex, "$1" + tagText + "}}\n");
}
tagText = "";
} else if( params.group && groupableTags.length >= 3 ) {
Morebits.status.info( 'Info', 'Grouping supported tags inside {{multiple issues}}' );
 
groupableTags.sort();
tagText += '{{multiple issues|\n';
 
totalTags = groupableTags.length;
$.each(groupableTags, addTag);
 
summaryText += ' tags (within {{[[Template:multiple issues|multiple issues]]}})';
if( tags.length > 0 ) {
summaryText += ', and';
}
tagText += '}}\n';
} else {
tags = tags.concat( groupableTags );
}
} else {
// Redirect tagging: Check for pre-existing tags
for( i = 0; i < params.tags.length; i++ ) {
tagRe = new RegExp( '(\\{\\{' + params.tags[i] + '(\\||\\}\\}))', 'im' );
if( !tagRe.exec( pageText ) ) {
tags = tags.concat( params.tags[i] );
} else {
Morebits.status.warn( 'Info', 'Found {{' + params.tags[i] +
'}} on the redirect already...excluding' );
}
}
}
 
tags.sort();
totalTags = tags.length;
$.each(tags, addTag);
 
if( Twinkle.tag.mode === 'redirect' ) {
pageText += tagText;
} else {
// smartly insert the new tags after any hatnotes. Regex is a bit more
// complicated than it'd need to be, to allow templates as parameters,
// and to handle whitespace properly.
pageText = pageText.replace(/^\s*(?:((?:\s*\{\{\s*(?:about|correct title|dablink|distinguish|for|other\s?(?:hurricaneuses|people|persons|places|uses(?:of)?)|redirect(?:-acronym)?|see\s?(?:also|wiktionary)|selfref|the)\d*\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\})+(?:\s*\n)?)\s*)?/i,
"$1" + tagText);
}
summaryText += ( tags.length > 0 ? ' tag' + ( tags.length > 1 ? 's' : '' ) : '' ) +
' to ' + Twinkle.tag.mode;
 
// avoid truncated summaries
if (summaryText.length > (254 - Twinkle.getPref('summaryAd').length)) {
summaryText = summaryText.replace(/\[\[[^\|]+\|([^\]]+)\]\]/g, "$1");
}
 
pageobj.setPageText(pageText);
pageobj.setEditSummary(summaryText + Twinkle.getPref('summaryAd'));
pageobj.setWatchlist(Twinkle.getFriendlyPref('watchTaggedPages'));
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();
},
 
file: function friendlytagCallbacksFile(pageobj) {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
var summary = "Adding ";
 
// Add maintenance tags
if (params.tags.length) {
 
var tagtext = "", currentTag;
$.each(params.tags, function(k, tag) {
// when other commons-related tags are placed, remove "move to Commons" tag
if (["Keep local", "subst:ncd", "Do not move to Commons_reason", "Do not move to Commons",
"Now Commons"].indexOf(tag) !== -1) {
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, "");
}
if (tag === "SVG version available") {
text = text.replace(/\{\{((convert to |convertto|should be |shouldbe|to)?svg|badpng|vectorize)[^}]*\}\}/gi, "");
}
 
currentTag = "{{" + (tag === "Do not move to Commons_reason" ? "Do not move to Commons" : tag);
 
var input;
switch (tag) {
case "subst:ncd":
/* falls through */
case "Keep local":
input = prompt( "{{" + (tag === "subst:ncd" ? "Now Commons" : tag) +
"}} - Enter the name of the image on Commons (if different from local name), excluding the File: prefix:", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += '|1=' + input;
}
break;
case "Rename media":
input = prompt( "{{Rename media}} - Enter the new name for the image (optional):", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|1=" + input;
}
input = prompt( "{{Rename media}} - Enter the reason for the rename (optional):", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|2=" + input;
}
break;
case "Cleanup image":
/* falls through */
case "Cleanup SVG":
input = prompt( "{{" + tag + "}} - Enter the reason for cleanup (required). To skip the tag, click Cancel:", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|1=" + input;
}
break;
case "Image-Poor-Quality":
input = prompt( "{{Image-Poor-Quality}} - Enter the reason why this image is so bad (required). To skip the tag, click Cancel:", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|1=" + input;
}
break;
case "Low quality chem":
input = prompt( "{{Low quality chem}} - Enter the reason why the diagram is disputed (required). To skip the tag, click Cancel:", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|1=" + input;
}
break;
case "PNG version available":
/* falls through */
case "SVG version available":
/* falls through */
case "Obsolete":
/* falls through */
case "Duplicate":
input = prompt( "{{" + tag + "}} - Enter the name of the file which replaces this one (required). To skip the tag, click Cancel:", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|1=" + input;
}
break;
case "Do not move to Commons_reason":
input = prompt( "{{Do not move to Commons}} - Enter the reason why this image should not be moved to Commons (required). To skip the tag, click Cancel:", "" );
if (input === null) {
return true; // continue
} else if (input !== "") {
currentTag += "|reason=" + input;
}
break;
case "subst:orfurrev":
//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, "");
currentTag += "|date={{subst:date}}";
break;
case "Copy to Commons":
currentTag += "|human=" + mw.config.get("wgUserName");
break;
default:
break; // don't care
}
 
if (tag === "Should be SVG") {
currentTag += "|" + params.svgSubcategory;
}
 
currentTag += "}}\n";
 
tagtext += currentTag;
summary += "{{" + tag + "}}, ";
 
return true; // continue
});
 
if (!tagtext) {
pageobj.getStatusElement().warn("User canceled operation; nothing to do");
return;
}
 
text = tagtext + text;
}
 
pageobj.setPageText(text);
pageobj.setEditSummary(summary.substring(0, summary.length - 2) + Twinkle.getPref('summaryAd'));
pageobj.setWatchlist(Twinkle.getFriendlyPref('watchTaggedPages'));
pageobj.setMinorEdit(Twinkle.getFriendlyPref('markTaggedPagesAsMinor'));
pageobj.setCreateOption('nocreate');
pageobj.save();
 
if( params.patrol ) {
pageobj.patrol();
}
}
};
 
Twinkle.tag.callback.evaluate = function friendlytagCallbackEvaluate(e) {
var form = e.target;
var params = {};
if (form.patrolPage) {
params.patrol = form.patrolPage.checked;
}
 
switch (Twinkle.tag.mode) {
case 'article':
params.tags = form.getChecked( 'articleTags' );
params.group = form.group.checked;
params.tagParameters = {
cleanup: form["articleTags.cleanup"] ? form["articleTags.cleanup"].value : null,
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':
params.svgSubcategory = form["imageTags.svgCategory"] ? form["imageTags.svgCategory"].value : null;
params.tags = form.getChecked( 'imageTags' );
break;
case 'redirect':
params.tags = form.getChecked( 'redirectTags' );
break;
default:
alert("Twinkle.tag: unknown mode " + Twinkle.tag.mode);
break;
}
 
// 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;
}
 
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( form );
 
Morebits.wiki.actionCompleted.redirect = Morebits.pageNameNorm;
Morebits.wiki.actionCompleted.notice = "ट्यागिङ पूर्ण भयो, केही सेकेन्डमा लेख पुन: लोड गर्दै";
if (Twinkle.tag.mode === 'redirect') {
Morebits.wiki.actionCompleted.followRedirect = false;
}
 
var wikipedia_page = new Morebits.wiki.page(Morebits.pageNameNorm, "ट्यागिङ " + Twinkle.tag.mode);
wikipedia_page.setCallbackParameters(params);
switch (Twinkle.tag.mode) {
case 'article':
/* falls through */
case 'redirect':
wikipedia_page.load(Twinkle.tag.callbacks.main);
return;
case 'file':
wikipedia_page.load(Twinkle.tag.callbacks.file);
return;
default:
alert("Twinkle.tag: unknown mode " + Twinkle.tag.mode);
break;
}
};
})(jQuery);
 
 
//</nowiki>