Wikipedista:Mercy/common.js: Porovnání verzí

Smazaný obsah Přidaný obsah
m Pathoschild přesunul stránku Wikipedista:Mercy/monobook.js na Wikipedista:Mercy/common.js bez založení přesměrování: updated scripts
-
značka: vyprázdnění
 
Řádek 1:
/**
* StewardScript extends the user interface for Wikimedia stewards' convenience.
* @see https://meta.wikimedia.org/wiki/StewardScript
* @update-token [[File:pathoschild/stewardscript.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.stewardscript.js');
 
/**
* Ajax sysop
* @see https://meta.wikimedia.org/wiki/Ajax_sysop
* @update-token [[File:pathoschild/ajaxsysop.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');
 
// [[:en:User:Lupin/popups.js]]
//mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript');
 
//Mass rollback function
//Written by John254
//Adapted from User:Mr.Z-man/rollbackSummary.js
//Instructions: Selecting the "rollback all" tab when viewing a user's contributions history
//will open all rollback links displayed there. (Use with caution)
 
function rollbackEverythingButton() {
var hasRollback = $('span.mw-rollback-link').get();
if (hasRollback[0] && (document.title.indexOf("Příspěvky uživatele") != -1) ) {
mw.util.addPortletLink('p-cactions', 'javascript:rollbackEverything()', "vrátit vše", "ca-rollbackeverything", "vrátit všechny zde uvedené editace");
}
}
$(rollbackEverythingButton);
function rollbackEverything() {
for (var i in document.links) {
if (document.links[i].href.indexOf('action=rollback') != -1) {
window.open(document.links[i].href);
}
}
}
 
// --------- custom edit toolbar ---------
if($.wikiEditor) {
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'format',
tools: {
'custom-Požadavek na obrázek': {
label: 'Požadavek na obrázek',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/3a/Button_av-img.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bPožadavek na obrázek}}',
post: '',
sampleText: ''
}
}
},
'custom-Pahýl - biografie': {
label: 'Pahýl - biografie',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/8/83/Button_biocitas.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bPahýl - biografie}}',
post: '',
sampleText: ''
}
}
},
'custom-Kategorie': {
label: 'Kategorie',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/Button_category03.png',
action: {
type: 'encapsulate',
options: {
pre: '[[Kategorie:',
post: ']]',
sampleText: ''
}
}
},
'custom-Subpahýl': {
label: 'Subpahýl',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/6/6d/Button_exclamation_1.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Subpahýl',
post: '}}',
sampleText: ''
}
}
},
'custom-Copyvio': {
label: 'Copyvio',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/33/Button_exclamation.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bCopyvio|zdroj=',
post: '}}',
sampleText: ''
}
}
},
'custom-Upravit': {
label: 'Upravit',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/0/02/Button_fuente_primaria.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bUpravit',
post: '}}',
sampleText: ''
}
}
},
'custom-Urgentně upravit': {
label: 'Urgentně upravit',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/22/Button_radio_activite.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Urgentně upravit',
post: '}}',
sampleText: ''
}
}
},
'custom-Urgentně ověřit': {
label: 'Urgentně ověřit',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/0/0b/Button_fuente.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Urgentně ověřit',
post: '}}',
sampleText: ''
}
}
},
'custom-Chybí zdroj': {
label: 'Chybí zdroj',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/33/Button_unreferenced.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Fakt',
post: '}}',
sampleText: ''
}
}
},
'custom-Uvítání': {
label: 'Uvítání',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/a/a9/Button_tournesol.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Vítejte',
post: '}} Přeji Vám pěkný den a těším se na Vaše další příspěvky! --\x7E\x7E\x7E\x7E',
sampleText: ''
}
}
},
'custom-Anonym': {
label: 'Anonym',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/e3/Button_bienvenido.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Anon',
post: '}}Přeji Vám pěkný den a těším se na Vaše další příspěvky! --\x7E\x7E\x7E\x7E',
sampleText: ''
}
}
},
'custom-Welcome': {
label: 'Welcome',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/c/cb/Button_Nuvola_apps_ksirc.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Welcome',
post: '}} With kind regards, --\x7E\x7E\x7E\x7E',
sampleText: ''
}
}
},
'custom-Nedělitelná mezera': {
label: 'Nedělitelná mezera',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/4/4b/Button_nbsp.png',
action: {
type: 'encapsulate',
options: {
pre: ' ',
post: '',
sampleText: ''
}
}
},
'custom-Šablona': {
label: 'Šablona',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/4/42/Buttonsablona.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bTl|',
post: '}}',
sampleText: ''
}
}
},
'custom-Experimenty0': {
label: 'Experimenty0',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/3d/EXPBT0.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bExperimenty0}} S přáním pěkného dne --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Experimenty': {
label: 'Experimenty',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/b0/EXPBT1.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bExperimenty}} --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Experimenty2': {
label: 'Experimenty2',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/a/ae/EXPBT2.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bExperimenty2}} --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Experimenty2o': {
label: 'Experimenty2o',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/3a/EXPBT2-o.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bExperimenty2o}} --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Experimenty3': {
label: 'Experimenty3',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/e5/EXPBT3.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bExperimenty3}} --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Náhled': {
label: 'Náhled',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/e9/Button_preview.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Náhled}} S přáním pěkného dne --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Spam': {
label: 'Spam',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/ec/Button_aviso.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Spam}} S přáním pěkného dne --\x7E\x7E\x7E\x7E',
post: '',
sampleText: ''
}
}
},
'custom-Významnost': {
label: 'Významnost',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/9/9a/Button_references.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Významnost',
post: '}}',
sampleText: ''
}
}
},
'custom-Komentář POV': {
label: 'Komentář POV',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/e4/Warn2.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:KomentářPOV',
post: '}} S přáním pěkného dne --\x7e\x7e\x7e\x7e',
sampleText: ''
}
}
},
'custom-subst:KomentářPOV2': {
label: 'subst:KomentářPOV2',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/8/84/Warn3.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bKomentářPOV2',
post: '}} --\x7e\x7e\x7e\x7e',
sampleText: ''
}
}
},
'custom-Smazaný článek': {
label: 'Smazaný článek',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/2e/Button_broom.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Nevýznamné}}--\x7e\x7e\x7e\x7e',
post: '',
sampleText: ''
}
}
},
'custom-Vtípek': {
label: 'Vtípek',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7/74/Button_oeil.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Vtip}} --\x7e\x7e\x7e\x7e',
post: '',
sampleText: ''
}
}
},
'custom-Citace elektronické monografie (citace webu, např. Valka.cz, Antika.avonet.cz)': {
label: 'Citace elektronické monografie (citace webu, např. Valka.cz, Antika.avonet.cz)',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/9/91/Button_cite_web.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bCitace elektronické monografie\n | příjmení = \n | jméno = \n | odkaz na autora = \n | titul = \n | url = \n | datum vydání = \n | datum aktualizace = \n | datum přístupu = " + (y = new Date().getFullYear ()) + "-" + (m = new Date ().getMonth () + 1) + "-" + (d = new Date ().getDate ()) + "\n | vydavatel = \n | místo = \n | jazyk = \n}}',
post: '',
sampleText: ''
}
}
},
'custom-Citace elektronického periodika (citace online zpravodajství, např. Aktuálně.cz, Novinky.cz)': {
label: 'Citace elektronického periodika (citace online zpravodajství, např. Aktuálně.cz, Novinky.cz)',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/2c/Button_cite_news.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bCitace elektronického periodika\n | příjmení = \n | jméno = \n | odkaz na autora = \n | spoluautoři = \n | titul = \n | periodikum = \n | odkaz na periodikum = \n | datum vydání = \n | datum aktualizace = \n | datum přístupu = " + (y = new Date().getFullYear ()) + "-" + (m = new Date ().getMonth () + 1) + "-" + (d = new Date ().getDate ()) + "\n | ročník = \n | číslo = \n | strany = \n | url = \n | issn = \n}}',
post: '',
sampleText: ''
}
}
},
'custom-Citace periodika (citace novin, časopisu)': {
label: 'Citace periodika (citace novin, časopisu)',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/4/49/Button_cite_journal.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bCitace periodika\n | příjmení = \n | jméno = \n | odkaz na autora = \n | spoluautoři = \n | titul = \n | periodikum = \n | odkaz na periodikum = \n | rok = \n | měsíc = \n | ročník = \n | číslo = \n | strany = \n | url = \n | issn = \n}}',
post: '',
sampleText: ''
}
}
},
'custom-Citace monografie (citace knihy)': {
label: 'Citace monografie (citace knihy)',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/ef/Button_cite_book.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bCitace monografie\n | příjmení = \n | jméno = \n | příjmení2 = \n | jméno2 = \n | rok = \n | titul = \n | vydavatel = \n | místo = \n | stránky = \n | poznámka = \n | isbn = \n}}',
post: '',
sampleText: ''
}
}
},
'custom-Commons': {
label: 'Commons',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/6/6c/Button_commons.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bCommonscat|',
post: '}}',
sampleText: ''
}
}
},
'custom-Defaultsort': {
label: 'Defaultsort',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/9/9f/Button_defaultsort.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bDEFAULTSORT:',
post: '}}',
sampleText: ''
}
}
},
'custom-Potvrzení OTRS': {
label: 'Potvrzení OTRS',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/1/16/Button_fairuse.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bPotvrzení OTRS|otrs=',
post: '|materiál=}}',
sampleText: ''
}
}
},
'custom-Pískoviště': {
label: 'Pískoviště',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/9/9a/Button_wiktionary.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bsubst:Pískoviště',
post: '}} --\x7e\x7e\x7e\x7e',
sampleText: ''
}
}
},
'custom-Pískoviště': {
label: 'Pískoviště',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png',
action: {
type: 'encapsulate',
options: {
pre: '\x7b\x7bNepodepsáno|',
post: '}}',
sampleText: ''
}
}
},
'custom-Skrytý text': {
label: 'Skrytý text',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/1/1b/Button_hide_wiki_tag.png',
action: {
type: 'encapsulate',
options: {
pre: '<!--',
post: '-->',
sampleText: ''
}
}
},
'custom-Pomlčka': {
label: 'Pomlčka',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/4/41/Button_hr_halfwidth.png',
action: {
type: 'encapsulate',
options: {
pre: '–',
post: '',
sampleText: ''
}
}
},
'custom-Uvozovky': {
label: 'Uvozovky',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/23/Quotes-Lithuanian.png',
action: {
type: 'encapsulate',
options: {
pre: '\„',
post: '\“',
sampleText: ''
}
}
}
}
});
}
// Adds a drop-down menu to the search box to choose the namespace to search in.
 
$(function () {
var searchGoButton = document.getElementById('searchGoButton');
if (!searchGoButton) return;
 
var searchNsHidden = document.createElement('input');
searchNsHidden.id = 'searchNsHidden';
searchNsHidden.type = 'hidden';
searchNsHidden.name = 'ns0';
searchNsHidden.value = '1';
 
var searchNsMenu = document.createElement('select');
searchNsMenu.id = 'searchNsMenu';
searchNsMenu.name = 'ns';
searchNsMenu.options[searchNsMenu.options.length] = new Option('(Hlavní)', 0);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Diskuse', 1);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Wikipedista', 2);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Wikipedista diskuse', 3);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Wikipedie', 4);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Wikipedie diskuse', 5);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Soubor', 6);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Soubor diskuse', 7);
searchNsMenu.options[searchNsMenu.options.length] = new Option('MediaWiki', 8);
searchNsMenu.options[searchNsMenu.options.length] = new Option('MediaWiki diskuse', 9);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Šablona', 10);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Šablona diskuse', 11);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Nápověda', 12);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Nápověda diskuse', 13);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Kategorie', 14);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Kategorie diskuse', 15);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Portál', 100);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Portál diskuse', 101);
searchNsMenu.onchange = function () {
searchNsHidden.name = 'ns' + (this.selectedIndex < 0 ? '0' :
this.options[this.selectedIndex].value);
};
// From /skins-1.5/monobook/main.css?5:
searchNsMenu.style.width = '10.9em';
searchNsMenu.style.margin = '0';
searchNsMenu.style.fontSize = '95%';
searchGoButton.parentNode.insertBefore(searchNsHidden, searchGoButton);
searchGoButton.parentNode.insertBefore(searchNsMenu, searchGoButton);
});
 
/*
=== Osobní pískoviště ===
 
; autor: [[pl:Wikipedysta:Herr Kriss]]
*/
 
var disableSandboxLink = 0; // ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność
 
$(function()
{
if (mw.config.get('wgUserName') != null && disableSandboxLink == 0)
{
var caption = 'Moje pískoviště'
if (mw.config.get('wgUserLanguage') != 'cs')
caption = 'My sandbox';
 
mw.util.addPortletLink('p-personal', mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Wikipedista:Mercy/Pískoviště', caption, 'pt-sandbox', caption, '', document.getElementById('pt-preferences'));
}
});