Bikarhêner:Balyozxane/templateScript2.js
Zanibe: Piştî weşandinê, ji bo dîtina guhartinan dibe ku hewce be "cache"ya geroka xwe paqij bikî.
- Firefox / Safari: Pê li Shift û Reload bike an jî Ctrl-F5 an Ctrl-R bike (ji bo Mac: ⌘-R)
- Google Chrome: Pê li Ctrl-Shift-R (ji bo Mac: ⌘-Shift-R) bike
- Internet Explorer / Edge: Pê li Ctrl û Refresh bike, an jî Ctrl-F5 bike
- Opera: Pê li Ctrl-F5 bike.
/**
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
* @see https://meta.wikimedia.org/wiki/TemplateScript
* @update-token [[File:Pathoschild/templatescript.js]]
*/
// <nowiki>
var title = mw.config.get('wgTitle');
var gotar = title.replace(/(.+)\, (.+)/g, '$1');
var gund = title.replace(/(.*?), .+/g, '$1');
var navce = title.replace(/(.*?) \(navçe\)/g, '$1');
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
pathoschild.TemplateScript.add({
name:'NAVÇE',
forNamespaces: '10',
accessKey: 'a',
script: function(editor) {
editor
.replace(/Cities and towns in (.+)/g, title)
.replace(/Towns and municipalities in(.+)/g, title)
.replace(/\[\[Category:(.*?) cities and towns by district templates/g, '[[Kategorî:|\}]]\n[[Kategorî:Şablonên $1')
.replace(/Coat of arms(.+)/g, 'Mertal')
.replace(/Bavaria/g, 'Bavyera')
.appendEditSummary('[[Bikarhêner:Balyozxane/templateScript.js|TS]]: +')
.clickDiff();
}
});
pathoschild.TemplateScript.add([
// add your own templates or scripts here
{
name: 'Şaredarî',
template: '{{subst:Bikarhêner:Balyozxane/kat|wd=[[en:'+title+']]|nav=' + gotar + '|navçe=Kelheim (navçe)|navçe_kurte=Kelheim|herêm=Bavyera |şaredarî=şaredariyeke|kategorî=Şaredariyên Bavyera}}',
position: 'cursor',
accessKey: 'a',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: ' + gotar,
forNamespaces: '0'
},
{
name: 'Bajarok',
template: '{{subst:Bikarhêner:Balyozxane/kat|wd=[[en:'+title+']]|nav=' + gotar + '|navçe=Kelheim (navçe)|navçe_kurte=Kelheim|herêm=Bavyera |şaredarî=bajarokekî |kategorî=Bajarokên Bavyera }}',
position: 'cursor',
accessKey: 'q',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: ' + gotar,
forNamespaces: '0'
},
{
name: 'Navçe',
template: '{{subst:Bikarhêner:Balyozxane/kat2|nav=' + navce + '|navçe='+title+'|herêm=Bavyera}}',
position: 'cursor',
accessKey: '1',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: ' + gotar,
forNamespaces: '0'
},
{
name: 'navçe-kat',
template: '{{standard-kat}}\n[[Kategorî:Navçeyên Bavyera]]',
position: 'cursor',
accessKey: '',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
},
{
name: 'standard-kat',
template: '{{standard-kat}}',
position: 'cursor',
accessKey: '',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
}, {
name: 'jin',
template: '{{subst:Bikarhêner:Balyozxane/kat/jin|1=' + kat + '}}',
position: 'cursor',
accessKey: 'q',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
},
{
name: 'pîşe',
template: '{{ewkên ewk\n|pîşe=' + kat + '\n|netewe=' + netewe + '\n|dûgel='+ netewe + '\n|serkategorî=\n|com=1}}',
position: 'cursor',
accessKey: 'a',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
},
{
name: 'li gorî pîşeyan',
template: '{{netewe/pîşe\n|netewe=' + netewe2 + '\n|dûgel=' + netewe2+ '\n|com=1}}',
position: 'cursor',
accessKey: 'e',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
},
{
name: 'li gorî neteweyan',
template: '{{pîşe/netewe\n|pîşe=' + pise + '\n|gotar=' + pise + '\n|beş=\n|com=1}}',
position: 'cursor',
accessKey: 'd',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
},
{
name: 'şitil kategorî',
template: '{{şitil kategorî\n|article=' + kategori + '\n|newstub=' + kategori + '-şitil\n|category='+ kategori + '\n}}',
position: 'cursor',
accessKey: '',
editSummary: '[[Bikarhêner:Balyozxane/templateScript.js|TS]]: kategorî+',
forNamespaces: '14'
},
]);
pathoschild.TemplateScript.add({
name:'bikeKurdî',
forNamespaces: '0',
accessKey: '',
script: function(editor) {
editor
.replace(/\(\*/g, '(jdb.')
.replace(/\(z\./g, '(jdb.')
.replace(/\(\[\[z(\.)?\]\]/g, '(jdb.')
.replace(/†/g, '(m.')
.replace(/\{\{((s|S)tub|(k|K)urt)\}\}/g, '{{Aktor-şitil}}')
.replace(/Towns and municipalities in/g, 'Bajarok û şaredariyên')
.replace(/Towns and municipalities/g, 'Bajarok û şaredarî')
.replace(/Cities and towns/g, 'Bajarok û şaredarî')
.replace(/Cities/g, 'Bajarok')
.replace(/Towns/g, 'Şaredarî')
.replace(/Municipalities/g, 'Şaredarî')
.replace(/Bavaria/g, 'Bavyera')
.replace(/}}\ngundekî/g, "}}\n'''" + gund + "''' gundekî" )
.appendEditSummary('[[Bikarhêner:Balyozxane/templateScript.js|TS]]: sererastkirin')
.clickDiff();
}
});
});
// </nowiki>