Wikipedista:Jan Jansson/modern.js: Porovnání verzí

Verze 6913769 uživatele Jan Jansson (diskuse) zrušena
(test)
(Verze 6913769 uživatele Jan Jansson (diskuse) zrušena)
 
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png",
"speedTip": "Hlasuj Za",
"tagOpen": "",
"tagClose": "",
"sampleText": "#{{za}} \~\~\~\~"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png",
"speedTip": "Hlasuj Proti",
"tagOpen": "",
"tagClose": "",
"sampleText": "#{{proti}} \~\~\~\~"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/4e/Button_neutre.png",
"speedTip": "Hlasuj Neutral",
"tagOpen": "",
"tagClose": "",
"sampleText": "#{{neutral}} \~\~\~\~"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/f8/Button_suppr.png",
"speedTip": "Kandidát na rýchle zmazanie",
"tagOpen": "\x7b\x7bzmazať lebo|",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/ba/Jadernyhrib-button.png",
"speedTip": "Urgentne upraviť",
"tagOpen": "\x7b\x7burgentne upraviť|",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/2e/Button_broom.png",
"speedTip": "Na úpravu",
"tagOpen": "\x7b\x7bna úpravu",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/e9/Button_preview.png",
"speedTip": "Na rozšírenie",
"tagOpen": "\x7b\x7bna rozšírenie",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/33/Button_unreferenced.png",
"speedTip": "Na revíziu",
"tagOpen": "\x7b\x7bna revíziu",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/37/Button_no_neutral.png",
"speedTip": "Neutralita",
"tagOpen": "\x7b\x7bneutralita",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0b/Button_fuente.png",
"speedTip": "Bez zdroja",
"tagOpen": "\x7b\x7bbezzdroja",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/72/Button_copy_vio_plagio.png",
"speedTip": "Copyvio",
"tagOpen": "\x7b\x7bcopyvio|url=",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png",
"speedTip": "Nepodpísal",
"tagOpen": "\x7b\x7bnepodpísal|",
"tagClose": "}}",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/1c/Button_smiley_face_smile.png",
"speedTip": "Smajlík",
"tagOpen": "\x7b\x7bÚsmev",
"tagClose": "}}",
"sampleText": ""};
};
function addPurge(){
ta['ca-purge'] = [new Array('g', 'Purge the internal cache for this page']);
if(!document.getElementById) return;
var x = document.getElementById('ca-history');
else x = x.childNodes[0];
addlilink(tabs, x.href.replace(/=history/, "=purge"), 'purge', 'ca-purge');
}
function addEditSection0(){
ta['ca-edit-0'] = ['', 'Edit the zeroth section of this page'];
if(!document.getElementById) return;
var x = document.getElementById('ca-edit');
if(!x) return;
var y = document.createElement('LI');
y.id = 'ca-edit-0';
if(x.className == 'selected'){
if(/&action=edit&section=0$/.test(window.location.href)){
x.className = 'istalk';
y.className = 'selected';
} else {
x.className = 'selected istalk';
}
} else if(x.className == 'selected istalk'){
if(/&action=edit&section=0$/.test(window.location.href)){
x.className = 'istalk';
y.className = 'selected istalk';
} else {
y.className = 'istalk';
}
} else {
y.className = x.className;
x.className = 'istalk';
}
var z = document.createElement('A');
if(x.children){
z.href = x.children[0].href + '&section=0';
z.appendChild(document.createTextNode('0'));
y.appendChild(z);
document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling);
}else{
z.href = x.childNodes[0].href + '&section=0';
z.appendChild(document.createTextNode('0'));
y.appendChild(z);
document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling);
}
}
function vitajte(){
var reg = confirm("Reg?");
document.editform.wpSummary.value = 'Vitajte/Welcome ';
var txt = document.editform.wpTextbox1;
if(txt.value.length > 0) txt.value += '\n';
if(reg)
txt.value += '{{Vitajte|redaktor=Jonesy|reg=regáno}}';
else
txt.value += '{{Vitajte|redaktor=Jonesy|reg=regnie}}';
txt.focus();
}
function experimenty(){
var dva = confirm("Druhýkrát?");
var txt = document.editform.wpTextbox1;
if(txt.value.length > 0) txt.value += '\n';
if (dva) {
txt.value += '{{experimenty2}}\~\~\~\~';
document.editform.wpSummary.value = '{{experimenty2}}';
} else {
txt.value += '{{experimenty}}\~\~\~\~';
document.editform.wpSummary.value = '{{experimenty}}';
}
txt.focus();
}
function reklama(){
var dva = confirm("Druhýkrát?");
var txt = document.editform.wpTextbox1;
if(txt.value.length > 0) txt.value += '\n';
if (dva) {
txt.value += '{{reklama2}}\~\~\~\~';
document.editform.wpSummary.value = '{{reklama2}}';
} else {
txt.value += '{{reklama}}\~\~\~\~';
document.editform.wpSummary.value = '{{reklama}}';
}
txt.focus();
}
tabs.appendChild(li);
return li;
}
function morelinks(){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
if(document.title.indexOf("Úprava stránky")
== 0){
addlilink(tabs, 'javascript:vitajte()', 'vitajte', '');
addlilink(tabs, 'javascript:experimenty()', 'experimenty', '');
addlilink(tabs, 'javascript:reklama()', 'reklama', '');
}
}
function LinkFA()
{
// iterate over all <span>-elements
for(var i=0; a = document.getElementsByTagName("span")[i]; i++) {
// if found a FA span
if(a.className == "FA") {
// iterate over all <li>-elements
for(var j=0; b = document.getElementsByTagName("li")[j]; j++) {
// if found a FA link
if(b.className == "interwiki-" + a.id) {
b.style.padding = "0 0 0 16px";
b.style.backgroundImage = "url('http://upload.wikimedia.org/wikipedia/en/6/60/LinkFA-star.png')";
b.style.backgroundRepeat = "no-repeat";
b.title = "This article has gained featured status";
}
}
}
}
}
function myLoadFuncs(){
if (!window.ta) window.ta = {};
addPurge();
// addEditSection0();
morelinks();
LinkFA();
}
myLoadFuncs();
}
}
function myLoadFuncs(){
addPurge();
}
 
importScript('Wikipedista:Reaperman/refToolbar.js');
// install the Slovenian translation for [[:en:User:Cacycle/wikEd]]
// --------- custom edit toolbar ---------
document.write('<script type="text/javascript" src="'
if (mwCustomEditButtons)
+ 'http://en.wikipedia.org/w/index.php?title=User:Helix84/wikEd_international_sk.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
var anchor = "t-cite";
var nazov = "Hlavná stránka";
rexp = /http:\/\/sk\.wikipedia\.org\/wiki\/(.*)$/
if (rexp.exec(document.URL)) {
var match = rexp.exec(document.URL);
if (match) nazov = match[1];
}
function addCommonsLink ()
{
nodAnchor = document.getElementById (anchor);
if (nodAnchor)
{
mwCustomEditButtons[mwCustomEditButtons.length] = {
var nodToolsList = nodAnchor.parentNode;
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/05/Button_Anf%C3%BChrung.png",
var nodLinkCommons_li = document.createElement ("li");
"speedTip": "Uvozovky",
var nodLinkCommons_a = document.createElement ("a");
"tagOpen": "\„",
"tagClose": "\“",
nodLinkCommons_li.id = "t-link-commons";
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
nodLinkCommons_a.href = "http://commons.wikimedia.org/wiki/Hlavná_stránka";
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/f2/Button-br.png",
nodLinkCommons_a.target = "_blank";
"speedTip": "Nový řádek",
"tagOpen": "<br />",
nodLinkCommons_a.appendChild (document.createTextNode ("Wikimedia Commons"));
"tagClose": "",
nodLinkCommons_li.appendChild (nodLinkCommons_a);
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
nodToolsList.insertBefore (nodLinkCommons_li, nodAnchor.nextSibling);
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/55/Button_nbsp_1.png",
"speedTip": "Pevná mezera",
var nodSeparator_hr = document.createElement ("hr");
"tagOpen": "&nbsp;",
nodToolsList.insertBefore (nodSeparator_hr, nodAnchor.nextSibling);
"tagClose": "",
}
"sampleText": ""};
}
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/17/Button_small_2.png",
function addCommonsGalLink ()
"speedTip": "Malé písmo",
{
"tagOpen": "<small>",
nodAnchor = document.getElementById (anchor);
"tagClose": "</small>",
"sampleText": ""};
if (nodAnchor)
mwCustomEditButtons [mwCustomEditButtons.length] = {
{
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png",
var nodToolsList = nodAnchor.parentNode;
"speedTip": "Za",
var nodGalLinkCommons_li = document.createElement ("li");
"tagOpen": "#[[Image:Symbol support vote.svg|15px]]",
var nodGalLinkCommons_a = document.createElement ("a");
"tagClose": "",
"sampleText": ""};
nodGalLinkCommons_li.id = "t-img-link-commons";
mwCustomEditButtons [mwCustomEditButtons.length] = {
nodGalLinkCommons_a.href = "imageFile": "http://commonsupload.wikimedia.org/wikiwikipedia/commons/f/fc/Button_supp.png"+nazov;,
"speedTip": "Proti",
nodGalLinkCommons_a.target = "_blank";
"tagOpen": "#[[Image:Symbol oppose vote.svg|15px]]",
nodGalLinkCommons_a.appendChild (document.createTextNode ("Commons/galéria"));
"tagClose": "",
nodGalLinkCommons_li.appendChild (nodGalLinkCommons_a);
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
nodToolsList.insertBefore (nodGalLinkCommons_li, nodAnchor.nextSibling);
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/50/Button_tidyman.png",
}
"speedTip": "Rychle smazat",
}
"tagOpen": "\x7b\x7bsmazat|",
"tagClose": "}}",
function addCommonsCatLink ()
"sampleText": ""};
{
mwCustomEditButtons[mwCustomEditButtons.length] = {
nodAnchor = document.getElementById (anchor);
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/ba/Jadernyhrib-button.png",
"speedTip": "Urgentně upravit",
if (nodAnchor)
"tagOpen": "\x7b\x7bsubst:Urgentně upravit",
{
"tagClose": "}}",
var nodToolsList = nodAnchor.parentNode;
"sampleText": ""};
var nodCatLinkCommons_li = document.createElement ("li");
mwCustomEditButtons[mwCustomEditButtons.length] = {
var nodCatLinkCommons_a = document.createElement ("a");
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/2e/Button_broom.png",
"speedTip": "Upravit",
nodCatLinkCommons_li.id = "t-cat-link-commons";
"tagOpen": "\x7b\x7bUpravit",
"tagClose": "}}",
nodCatLinkCommons_a.href = "http://commons.wikimedia.org/wiki/Category:"+nazov;
"sampleText": ""};
nodCatLinkCommons_a.target = "_blank";
mwCustomEditButtons[mwCustomEditButtons.length] = {
nodCatLinkCommons_a.appendChild (document.createTextNode ("Commons/kategória"));
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/bf/WP-icon.png",
nodCatLinkCommons_li.appendChild (nodCatLinkCommons_a);
"speedTip": "Wikifi",
"tagOpen": "\x7b\x7bWikifikovat}}",
nodToolsList.insertBefore (nodCatLinkCommons_li, nodAnchor.nextSibling);
"tagClose": "",
}
"sampleText": ""};
}
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0b/Button_fuente.png",
addOnloadHook( addCommonsCatLink );
"speedTip": "Bez zdroje",
addOnloadHook( addCommonsGalLink );
"tagOpen": "\x7b\x7bBez zdroje}}",
addOnloadHook( addCommonsLink );
"tagClose": "",
"sampleText": ""};
//-----
mwCustomEditButtons[mwCustomEditButtons.length] = {
function przyciskiOpis()
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/72/Button_copy_vio_plagio.png",
{
"speedTip": "Copyvio",
// stop before starting
"tagOpen": "\x7b\x7bCopyvio|zdroj=",
if (window.przyciskiOpisDone)
"tagClose": "}}",
return;
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
//
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png",
// sprawdzenie, czy to jest pole edycji z opisem zmian (nie jest takie jako nagłówek)
"speedTip": "Nepodepsal",
var el = document.getElementById('wpSummaryLabel');
"tagOpen": "\x7b\x7bnepodepsáno|",
if (el)
"tagClose": "}}",
{
"sampleText": ""};
if (el.innerHTML.indexOf('Zhrnutie úprav')==-1)
mwCustomEditButtons[mwCustomEditButtons.length] = {
return // stop
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/2b/Button_ref_inscription.png",
;
"speedTip": "Reference dole",
"tagOpen": "<references/>",
}
"tagClose": "",
else
"sampleText": ""};
{
 
return; // stop
};
//
// dodanie elementu okalającego przyciski bezpośrednio za opisem zmian
var el = document.getElementById('userSummaryButtons');
var opisBtns = document.createElement('span');
opisBtns.id = 'userSummaryButtons'
el.parentNode.insertBefore(document.createElement('br'), el)
el.parentNode.insertBefore(opisBtns, el)
//
// dodawanie przycisków
//var kl = 'userButtonsStyle';
var kl = ''; // klasa jest niepotrzebna (wszystkie <a> w #userSummaryButtons ustawione poprzez CSS)
if (opisBtns)
{
przyciskiDodaj(opisBtns, 'typografia', 'dodajOpis("typografia")', kl,
'Oprava preklepov');
przyciskiDodaj(opisBtns, 'referencie', 'dodajOpis("referencie")', kl,
'Pridanie odkazov');
}
}
function przyciskiDodaj(elUserBtns, pTekst, pAkcja, pKlasa, pOpis)
{
var nowyBtn = document.createElement('a');
// atrybuty
nowyBtn.appendChild(document.createTextNode(pTekst));
nowyBtn.title = pOpis;
if (pKlasa != '')
nowyBtn.className = pKlasa
;
nowyBtn.onclick = new Function(pAkcja);
// dodanie przycisku
elUserBtns.appendChild(nowyBtn);
}
var clickedMinor = false;
function onMinorEditClick()
{
if (this.checked && !clickedMinor)
{
dodajOpis("drobne");
clickedMinor = true;
}
}
function dodajOpis(opis)
{
var wpS = document.editform.wpSummary;
if (wpS.value != '' && wpS.value.charAt(wpS.value.length-2) != '/')
{
wpS.value += ', ' + opis
}
else
{
wpS.value += opis
}
}
addOnloadHook(przyciskiOpis);
363

editací