MediaWiki:Gadget-friendlytag1.js
Not: Sayfayı kaydettikten sonra değişiklikleri görebilmek için tarayıcınızın önbelleğinizi temizlemeniz gerekir. Google Chrome, Firefox, Microsoft Edge ve Safari: ⇧ Shift tuşuna basılı tutun ve Yeniden Yükle araç çubuğu düğmesine tıklayın. Ayrıntılar ve diğer tarayıcılara yönelik yönergeler için Vikipedi:Önbelleğinizi atlayın sayfasını inceleyin.
//<nowiki>
(function($){
/*
****************************************
*** friendlytag.js: Tag module / Etiket modülü
****************************************
* Mode of invocation: Tab ("Etiket")
* 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() {
// Yönlendirme
if( Morebits.wiki.isPageRedirect() ) {
Twinkle.tag.mode = 'redirect';
Twinkle.addPortletLink( Twinkle.tag.callback, "Etiket", "friendly-tag", "Yönlendirmeye bakım etiketi ekle" );
}
// Dosya
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, "Etiket", "friendly-tag", "Dosyaya bakım etiketi ekle" );
}
// Madde
else if( ( mw.config.get('wgNamespaceNumber') === 0 || mw.config.get('wgNamespaceNumber') === 118 || mw.config.get('wgNamespaceNumber') === 4 || /^Wikipedia( talk)?:Articles for creation\//.exec(Morebits.pageNameNorm) ) && mw.config.get('wgCurRevisionId') ) {
Twinkle.tag.mode = 'article';
Twinkle.addPortletLink( Twinkle.tag.callback, "Etiket", "friendly-tag", "Maddeye bakım etiketi ekle" );
}
};
Twinkle.tag.callback = function friendlytagCallback() {
var Window = new Morebits.simpleWindow( 630, (Twinkle.tag.mode === "article") ? 500 : 400 );
Window.setScriptName( "Twinkle" );
// anyone got a good policy/guideline/info page/instructional page link??
Window.addFooterLink( "Twinkle yardım", "Vikipedi tartışma:Twinkle" );
var form = new Morebits.quickForm( Twinkle.tag.callback.evaluate );
if (document.getElementsByClassName("patrollink").length) {
form.append( {
type: 'checkbox',
list: [
{
label: 'Sayfayı kontrol edildi olarak işaretle',
value: 'patrolPage',
name: 'patrolPage',
checked: Twinkle.getFriendlyPref('markTaggedPagesAsPatrolled')
}
]
} );
}
switch( Twinkle.tag.mode ) {
case 'article':
Window.setTitle( "Madde bakım etiketlemesi" );
form.append({
type: 'select',
name: 'sortorder',
label: 'Bu listeyi görüntüle:',
tooltip: 'Varsayılan görünüm sırasını Twinkle tercihlerinizle değiştirebilirsiniz.',
event: Twinkle.tag.updateSortOrder,
list: [
{ type: 'option', value: 'cat', label: 'Kategorilere göre', selected: Twinkle.getFriendlyPref('tagArticleSortOrder') === 'cat' },
{ type: 'option', value: 'alpha', label: 'Alfabetik sırayla', selected: Twinkle.getFriendlyPref('tagArticleSortOrder') === 'alpha' }
]
});
form.append({
type: 'div',
id: 'tagWorkArea',
className: 'morebits-scrollbox',
style: 'max-height: 28em'
});
form.append( {
type: 'checkbox',
list: [
{
label: 'Mümkünse {{Çoklu sorun}} içinde gruplandır',
value: 'group',
name: 'group',
tooltip: '{{Çoklu sorun}} tarafından desteklenen üç veya daha fazla şablon eklenirse ve bu kutu işaretlenirse, desteklenen tüm şablonlar bir {{Çoklu sorun}} şablonunda gruplandırılır.',
checked: Twinkle.getFriendlyPref('groupByDefault')
}
]
}
);
break;
case 'file':
Window.setTitle( "Dosya bakım etiketlemesi" );
// TODO: perhaps add custom tags TO list of checkboxes
form.append({ type: 'header', label: 'Lisans ve kaynak sorunu etiketleri' });
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.licenseList } );
form.append({ type: 'header', label: 'Wikimedia Commons ile ilgili etiketler' });
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.commonsList } );
form.append({ type: 'header', label: 'Temizleme etiketleri' } );
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.cleanupList } );
form.append({ type: 'header', label: 'Görüntü kalitesi etiketleri' } );
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.qualityList } );
form.append({ type: 'header', label: 'Replacement tags' }); //Çevrilmeli
form.append({ type: 'checkbox', name: 'imageTags', list: Twinkle.tag.file.replacementList } );
break;
case 'redirect':
Window.setTitle( "Yönlendirme bakım etiketlemesi" );
form.append({ type: 'header', label:'Yazım, gramer ve büyük harf kullanımı şablonları' });
form.append({ type: 'checkbox', name: 'redirectTags', list: Twinkle.tag.spellingList });
form.append({ type: 'header', label:'Alternatif isim şablonları' });
form.append({ type: 'checkbox', name: 'redirectTags', list: Twinkle.tag.alternativeList });
form.append({ type: 'header', label:'Çeşitli ve yönetimsel yönlendirme şablonları' });
form.append({ type: 'checkbox', name: 'redirectTags', list: Twinkle.tag.administrativeList });
break;
default:
alert("Twinkle.tag: bilimeyen mod " + Twinkle.tag.mode);
break;
}
form.append( { type:'submit' } );
var result = form.render();
Window.setContent( result );
Window.display();
if (Twinkle.tag.mode === "article") {
// fake a change event on the sort dropdown, to initialize the tag list
var evt = document.createEvent("Event");
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" });
// function to generate a checkbox, with appropriate subgroup if needed
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 "temizleme":
checkbox.subgroup = {
name: 'cleanup',
type: 'input',
label: 'Neden temizlenmesine ihtiyaç var:',
tooltip: 'Gerekli.',
size: 35
};
break;
case "telifihlal":
checkbox.subgroup = {
name: 'copypaste',
type: 'input',
label: 'Kaynak URL: ',
tooltip: 'Eğer biliniyorsa.',
size: 50
};
break;
case "kopyala yapıştır":
checkbox.subgroup = {
name: 'copypaste',
type: 'input',
label: 'Kaynak URL: ',
tooltip: 'Eğer biliniyorsa.',
size: 50
};
break;
case "uzman":
checkbox.subgroup = {
name: 'expertNeeded',
type: 'input',
label: 'İlgili Vikiprojenin adı: ',
tooltip: 'İsteğe bağlı olarak bir Vikiproje adını girin. "Vikiproje" ön ekini eklemeyin.'
};
break;
case "evrenselleştir":
checkbox.subgroup = {
name: 'globalize',
type: 'input',
label: "{{evrenselleştir}}: madde konu hakkında evrensel bir bakış açısı yansıtmamakta",
value: "evrenselleştir"
};
break;
case "birleştir":
case "merge from":
case "merge to":
var otherTagName = "birleştir";
switch (tag)
{
case "merge from":
otherTagName = "merge to";
break;
case "merge to":
otherTagName = "merge from";
break;
}
checkbox.subgroup = [
{
name: 'mergeTarget',
type: 'input',
label: 'Diğer madde(ler): ',
tooltip: 'Birden çok makale belirtiyorsanız, bunları | karakterleriyle ayırın: Birinci madde|İkinci madde'
},
{
name: 'mergeTagOther',
type: 'checkbox',
list: [
{
label: 'Diğer maddeyi {{' + otherTagName + '}} etiketi ile etiketle',
checked: true,
tooltip: 'Yalnızca tek bir madde adı girildiğinde kullanılabilir.'
}
]
}
];
if (mw.config.get('wgNamespaceNumber') === 0) {
checkbox.subgroup.push({
name: 'mergeReason',
type: 'textarea',
label: 'Birleştirme için gerekçe ( ' +
(tag === "merge to" ? 'the other article\'s' : 'this article\'s') + ' tartışma sayfasında yayınlanacak):',
tooltip: 'İsteğe bağlı, ancak şiddetle önerilir. İstemiyorsanız boş bırakın. Yalnızca tek bir madde adı girildiğinde kullanılabilir.'
});
}
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;
};
// categorical sort order
if (sortorder === "cat") {
// function to iterate through the tags and create a checkbox for each one
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;
// go through each category and sub-category and append lists of checkboxes
$.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);
});
}
});
}
// alphabetical sort order
else {
var checkboxes = [];
$.each(Twinkle.tag.article.tags, function(tag, description) {
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: 'Özel etiketler' });
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.values)));
link.setAttribute("target", "_blank");
$checkbox.parent().append(["\u00A0", link]);
});
};
// Tags for ARTICLES start here
Twinkle.tag.article = {};
// 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 = {
"anakaynaklar": "madde güvenilir bir yayında çıkmış alıntı/referanslar içermiyor",
"aşırı alıntı": "madde ansiklopedik bir içerik için çok fazla veya çok uzun alıntılar içeriyor",
"başlık böl": "maddenin daha erişilebilir olması için konusuna göre başlıklara bölünmesi gerek",
"birleştir": "madde başka bir maddeye çok benziyor ve birleştirilmesi gerekli",
"çalışma": "bu sayfada devam eden bir çalışma var",
"çıkmaz sokak": "maddeden herhangi bir maddeye verilmiş bir bağlantı yok",
"çok resim": "maddede fazla sayıda resim, tablo veya diyagram bulunmakta ve temizlenmeli",
"çok uzun": "bu madde aşırı uzun",
"daralt": "maddede içeriği bölen çok fazla bölüm başlığı var",
"deneme benzeri": "madde, bir Vikipedistin kişisel duygularını bildiren ve kişisel bir düşünme, kişisel deneme veya tartışmalı deneme gibi yazılmış",
"dipnotsuz": "metin içi kaynaklar yeterince veya hiç kullanılmadığı için, bazı bilgilerin kaynağı belirsiz",
"dış bağlantı": "maddede kullanılan dış bağlantıların politikalara uygun değil",
"doğruluk": "madde tamamen bir aldatmaca olabilir",
"düzenle": "madde Vikipedi standartlarına uygun değil",
"düzyazı": "madde liste biçiminde, ancak düz yazı olursa okunabilirliği artabilir",
"ek kaynak gerekli": "maddenin doğrulanabilmesi için ek kaynaklara ihtiyacı var",
"eksik": "maddede belirgin bilgiler eksik",
"evrenselleştir": "konu hakkında evrensel bir bakış açısını yansıtmıyor",
"genişlet dil": "madde makaleden tercüme edilecek içerikle genişletilebilir",
"güncel": "madde güncel bir olay hakkındadır",
"güncelle": "maddenin daha doğru ve güvenilir bilgi sunması için güncellenmesi gerekmek",
"giriş çok kısa": "maddenin giriş bölümü çok kısa ve genişletilmesi gerek",
"giriş çok uzun": "maddenin giriş bölümü çok uzun ve kısaltılmalı",
"giriş yok": "maddenin giriş bölümü yok ve biri eklemelidir",
"kafa karıştırıcı": "okuyucular için kafa karıştırıcı içeriklere veya net olmayan ifadelere sahip",
"kategorisiz": "bu maddeye hiç kategori eklenmemiş",
"kayda değerlik": "maddenin konusu kayda değer olmayabilir",
"kaynakları düzenle": "madde önerilmeyen biçimde kaynaklandırılmış",
"kaynaksız": "madde herhangi bir kaynak içermiyor",
"kılavuz gibi": "madde bir el kitabı veya kılavuz kitap gibi yazılmış",
"kötü çeviri": "madde başka bir dilden kötü bir biçimde tercüme edilmiş",
"kırmızı bağlantı temizleme": "maddede kullanılan kırmızı bağlantılar Vikipedi yönergelerine uymuyor",
"kopyala yapıştır": "madde muhtemelen Vikipedi'nin telif hakkı politikasını ihlal eden başka bir yerden kopyalayıp yapıştırılmış",
"kurgu-gerçek": "maddenin üslubu ve içeriği kurgu öğeleriyle gerçek öğeleri birbirinden ayrıştırmıyor",
"madde adı": "madde adı tartışmalı",
"metrik": "maddede yalnızca SI olmayan ölçü birimleri kullanılmış",
"otobiyografi": "madde bir otobiyografidir veya konuyla bağlı biri tarafından kapsamlı bir şekilde düzenlenmiştir",
"öksüz": "herhangi bir maddeden bu maddeye verilmiş bir bağlantı yok",
"özgün araştırma": "madde; özgün araştırma, doğrulanamaz veya yorumsal ifadeler içeriyor",
"reklam-madde": "madde reklam gibi yazılmış",
"şahsen yayımlanmış": "madde şahsen yayımlanmış kaynaklara verilen uygunsuz referanslar içeriyor",
"taraflı": "bu madde taraflı olabilir",
"tartışmalı": "madde hakkında tartışmalar halen sürmektedir",
"tek kaynak": "madde tümüyle ya da çoğunluğuyla tek kaynağa dayanıyor",
"teknik": "madde çoğu okuyucunun anlayamayacağı kadar teknik",
"telifihlal": "maddede, telif hakkıyla korunan bir kaynağın yakın bir şekilde yazımı mevcut",
"temizleme": "madde temizleme gerektirebilir",
"Türkçe değil": "madde Türkçe değil ve çevrilmesi gerekiyor",
"uzman": "maddenin gelişebilmesi için konuda uzman kişilere gereksinim var",
"ücretli olabilir": "madde, Vikipedi'nin kullanım şartlarını ihlal eden, ödeme karşılığında oluşturulmuş veya düzenlenmiş olabilir",
"üçüncül kaynak": "maddenin yazımında madde konusuyla doğrudan ilintili kaynaklardan haddinden fazla yararlanılmış",
"üslup": "maddenin üslubu, ansiklopedik bir yazıdan beklenen resmî ve ciddi üsluba uygun değil",
"viki bağlantısız": "madde çok az sayıda iç bağlantı içeriyor",
"yazım yanlışları": "madde yazım ve noktalama yanlışları ya da anlatım bozuklukları içeriyor",
"yerellikten kurtar": "maddede yer alan bilgiler belli bir bölgenin bakış açısından ele alınmış"
};
// A list of tags in order of category
// Tags should be in alphabetical order within the categories
// Add new categories with discretion - the list is long enough as is!
Twinkle.tag.article.tagCategories = {
"Temizlik ve bakım etiketleri": {
"Genel": [
"düzenle",
"güncel"
],
"Genel temizlik": [
"çok resim",
"temizleme"// has a subgroup with text input
],
"Potansiyel istenmeyen içerik": [
"dış bağlantı",
"kopyala yapıştır", // has a subgroup with text input
"telifihlal"
],
"Yapı, biçimlendirme ve rehber": [
"başlık böl",
"çok uzun",
"daralt",
"giriş çok kısa",
"giriş çok uzun",
"giriş yok",
"kırmızı bağlantı temizleme",
"yazım yanlışları"
]
},
"Genel içerik sorunları": {
"Önemi ve kayda değerliği": [
"kayda değerlik" // has a subgroup with subcategories
],
"Yazılma tarzı": [
"aşırı alıntı",
"deneme benzeri",
"düzyazı",
"kılavuz gibi",
"kötü çeviri",
"reklam-madde",
"üslup",
"teknik"
],
"Anlam (veya eksikliği)": [
"kafa karıştırıcı",
"kurgu-gerçek"
],
"Bilgi ve detay": [
"eksik",
"metrik",
"uzman"
],
"Güncel değil": [
"güncelle"
],
"Tarafsızlık, önyargı ve doğruluk": [
"doğruluk",
"evrenselleştir", // has a subgroup with subcategories
"otobiyografi",
"ücretli olabilir",
"taraflı",
"tartışmalı",
"yerellikten kurtar"
],
"Doğrulanabilirlik ve kaynaklar": [
"anakaynaklar",
"ek kaynak gerekli",
"kaynaksız",
"özgün araştırma",
"üçüncül kaynak",
"şahsen yayımlanmış",
"tek kaynak"
]
},
"Belirli içerik sorunları": {
"Dil": [
"genişlet dil",
"Türkçe değil" // has a subgroup with several options
],
"Bağlantılar": [
"çıkmaz sokak",
"öksüz",
"viki bağlantısız"
],
"Kaynaklandırma tekniği": [
"dipnotsuz",
"kaynakları düzenle"
],
"Kategoriler": [
"kategorisiz"
]
},
"Birleştirme": [ // these three have a subgroup with several options
"birleştir"
],
"Bilgilendirme": [
"madde adı",
"çalışma"
]
};
// Tags for REDIRECTS start here
Twinkle.tag.spellingList = [
{
label: '{{R from initialism}}: redirect from an initialism (e.g. AGF) to its expanded form',
value: 'R from initialism'
},
{
label: '{{R from acronym}}: redirect from an acronym (e.g. POTUS) to its expanded form',
value: 'R from acronym'
},
{
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 long name}}: redirect from a title that is a complete or more complete name',
value: 'R from long 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 to diacritics}}: redirect to the article title with diacritical marks (accents, umlauts, etc.)',
value: 'R to 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: '{{adil kullanım kalitesini düşür}}: bu adil kullanım dosyası daha küçük/düşük çözünürlüklü bir versiyonu ile değiştirilmedir.', value: 'Non-free reduce' }
];
Twinkle.tag.file.commonsList = [
{ label: '{{Wikimedia Commons\'a taşı}}: ücretsiz medya Commons\'a taşınabilir', value: 'Wikimedia Commons\'a taşı' },
{ label: '{{Commons\'a taşımayın}} (KM sorunu): ABD\'de kamu malı lakin kaynak ülkede değil', value: 'Do not move to Commons' },
{ label: '{{Commons\'a taşımayın}} (diğer)', value: 'Do not move to Commons_reason' },
{ label: '{{Commons\'ta mevcut}}: dosya artık Commons üzerinde mevcut', value: 'subst:ncd' }
];
Twinkle.tag.file.replacementList = [
{ label: '{{PNG version available}}', value: 'PNG sürümü mevcut' }
];
// Contains those article tags that *do not* work inside {{multiple issues}}.
Twinkle.tag.multipleIssuesExceptions = [
'kopyala yapıştır',
'genişlet dil',
'birleştir',
'Türkçe değil',
'kategorisiz',
'çalışma',
'telifihlal',
"üslup"
];
Twinkle.tag.callbacks = {
main: function( pageobj ) {
var params = pageobj.getCallbackParameters(),
tagRe, tagText = '', summaryText = '',
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 === 'kategorisiz' || tagName === 'improve categories' ) {
pageText += '\n\n{{' + tagName +
'|tarih={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}';
} else {
if( tagName === 'evrenselleştir' ) {
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 'temizleme':
if (params.tagParameters.cleanup) {
currentTag += '|gerekçe=' + params.tagParameters.cleanup;
}
break;
case 'kopyala yapıştır':
if (params.tagParameters.copypaste) {
currentTag += '|url=' + params.tagParameters.copypaste;
}
break;
case 'telifihlal':
if (params.tagParameters.copypaste) {
currentTag += '|url=' + params.tagParameters.copypaste;
}
break;
case 'genişlet dil':
currentTag += '|topic=';
var langcode = prompt('Lütfen diğer vikinin dil kodunu girin (örn. "fr", "roa-rup")... \n' +
"Bu bilgi gereklidir. {{genişlet dil}} etiketini atlamak için İptal'e tıklayın.", "");
if (langcode === null || langcode === "") {
Morebits.status.warn("Dikkat", "{{genişlet dil}} etiketi kullanıcı tarafından atlandı");
return true; // continue to next tag
} else {
currentTag += '|langcode=' + langcode;
}
var otherart = prompt('Lütfen maddenin diğer vikideki adını girin (interwiki öneki olmadan). \n' +
"Bu bilgi isteğe bağlıdır. {{genişlet dil}} etiketini atlamak için İptal'e tıklayın.", "");
if (otherart === null) {
Morebits.status.warn("Dikkat", "{{genişlet dil}} etiketi kullanıcı tarafından atlandı");
return true; // continue to next tag
} else {
currentTag += '|otherarticle=' + otherart;
}
break;
case 'uzman':
if (params.tagParameters.expertNeeded) {
currentTag += '|Vikiproje=' + params.tagParameters.expertNeeded;
}
break;
case 'news release':
currentTag += '|1=article';
break;
case 'Türkçe değil':
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') ? '}}' : '|tarih={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}\n';
tagText += currentTag;
}
if ( tagIndex > 0 ) {
if( tagIndex === (totalTags - 1) ) {
summaryText += ' ve';
} else if ( tagIndex < (totalTags - 1) ) {
summaryText += ',';
}
}
summaryText += ' {{[[:';
if( tagName === 'evrenselleştir' ) {
summaryText += "Şablon:" + params.tagParameters.globalize + '|' + params.tagParameters.globalize;
} else {
summaryText += (tagName.indexOf(":") !== -1 ? tagName : ("Şablon:" + 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( 'Bilgilendirme', '{{' + params.tags[i] +
'}} şablonu zaten maddede var, şablon es geçiliyor' );
// don't do anything else with merge tags
if (params.tags[i] === "birleştir" || 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( 'Bilgilendirme', '{{çoklu sorun}} destekli etiketler şablona ekleniyor' );
groupableTags.sort();
tagText = "";
totalTags = groupableTags.length;
$.each(groupableTags, addTag);
summaryText += ' etiketi eklendi ({{çoklu sorun}} içinde)';
if( tags.length > 0 ) {
summaryText += ', ve';
}
if( miOldStyleTest ) {
// convert tags from old-style to new-style
var split = miOldStyleTest[2].split("|");
$.each(split, function(index, val) {
split[index] = val.replace("=", "|tarih=").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( 'Bilgilendirme', 'Desteklenen etiketler {{çoklu sorun}} içinde gruplandırılıyor' );
groupableTags.sort();
tagText += '{{çoklu sorun|\n';
totalTags = groupableTags.length;
$.each(groupableTags, addTag);
summaryText += ' etiketleri eklendi (çoklu sorun şablonu içinde)';
if( tags.length > 0 ) {
summaryText += ' ve';
}
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( 'Bilgilendirme', 'Yönlendirmede {{' + params.tags[i] +
'}} bulundu... es geçiliyor' );
}
}
}
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 += ' etiketi eklendi';
// 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, "Gerekçe konuşma sayfasına gönderiliyor");
talkpage.setAppendText(talkpageText);
talkpage.setEditSummary('Proposing to merge [[:' + params.nonDiscussArticle + ']] ' +
(tags.indexOf("birleştir") !== -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 = "birleştir";
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, "Başka sayfayı etiketleme (" +
params.mergeTarget + ")");
otherpage.setCallbackParameters(newParams);
otherpage.load(Twinkle.tag.callbacks.main);
}
});
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('tartışma için hedef nokta bulunamadı');
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 = "Ekleniyor ";
// 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 === "Vector 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 "Vector 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( "{{Commons'a taşımayın}} - 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 += "|gerekçe=" + 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 += "|tarih={{subst:date}}";
break;
case "Wikimedia Commons'a taşı":
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("Kullanıcı işlemi iptal etti; hiçbir şey yapılmıyor");
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,
expertNeeded: form["articleTags.expertNeeded"] ? form["articleTags.expertNeeded"].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.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: bilinmeyen mod " + Twinkle.tag.mode);
break;
}
// form validation
if( !params.tags.length ) {
alert( 'En az bir etiket seçmelisiniz!' );
return;
}
if( (params.mergeTagOther || params.mergeReason) && params.mergeTarget.indexOf('|') !== -1 ) {
alert( 'Bir birleştirmede birden çok maddeyi etiketlemek ve birden çok madde için bir tartışma başlatmak şu anda desteklenmemektedir. Lütfen "diğer maddeleri etiketle" yi kapatın ve/veya "neden" kutusunu temizleyin ve tekrar deneyin.' );
return;
}
if( params.tags.indexOf('cleanup') !== -1 && params.tagParameters.cleanup.trim && params.tagParameters.cleanup.trim() === "") {
alert( '{{temizleme}} etiketi için bir neden belirtmelisiniz.' );
return;
}
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( form );
Morebits.wiki.actionCompleted.redirect = Morebits.pageNameNorm;
Morebits.wiki.actionCompleted.notice = "Etiketleme tamamlandı, sayfa birkaç saniye içinde yeniden yüklenecek";
if (Twinkle.tag.mode === 'redirect') {
Morebits.wiki.actionCompleted.followRedirect = false;
}
var wikipedia_page = new Morebits.wiki.page(Morebits.pageNameNorm, "Etiketleniyor " + 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: bilinmeyen mod " + Twinkle.tag.mode);
break;
}
};
})(jQuery);
//</nowiki>