Preskočiť na obsah

Redaktorka:Bubamara/common.js

z Wikipédie, slobodnej encyklopédie

Poznámka: Aby sa zmeny prejavili, po uložení musíte vymazať vyrovnávaciu pamäť vášho prehliadača. Mozilla / Firefox / Safari: držte stlačený Shift a kliknite na Reload alebo stlačte buď Ctrl-F5 alebo Ctrl-R (Command-R na Macintosh); Konqueror:: kliknite na tlačidlo Reload alebo stlačte F5; Opera vymazať vyrovnávaciu pamäť prehliadača v ponuke Tools→Preferences; Internet Explorer: držte Ctrl a kliknite na Refresh alebo stlačte Ctrl-F5;

function customizeEditScreen()
{
    mw.loader.using(['mediawiki.action.edit', 'mediawiki.toolbar'], function ()  {

        var today = new Date().toISOString().slice(0, 10);

        /** Tlačidlá */

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/2/23/Button_code.png',
            speedTip: 'code',
            tagOpen: '<code>',
            tagClose: '</code>',
            sampleText: 'text'
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/3/3c/Button_pre.png',
            speedTip: 'preformátovaný text',
            tagOpen: '<pre>',
            tagClose: '</pre>',
            sampleText: 'preformátovaný text'
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/a/a5/Buttonexperimenty.png',
            speedTip: 'experimenty',
            tagOpen: '\x7b\x7bexperimenty}} \x7E\x7E\x7E\x7E',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/1/16/Buttonexperimenty2.png',
            speedTip: 'experimenty2',
            tagOpen: '\x7b\x7bexperimenty2}} \x7E\x7E\x7E\x7E',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/7/7e/Bouton_Vandale4.png',
            speedTip: 'vandalizmus',
            tagOpen: '\x7b\x7bvandalizmus}} \x7E\x7E\x7E\x7E', 
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/6/66/Button_mort.png',
            speedTip: 'vandalizmus2',
            tagOpen: '\x7b\x7bvandalizmus2}} \x7E\x7E\x7E\x7E', 
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/2/2e/Crystal_Clear_action_button_cancel.png',
            speedTip: 'open proxy',
            tagOpen: '\x7b\x7bopen proxy', 
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/f/fb/Yes_check.svg',
            speedTip: 'Hotovo',
            tagOpen: ': \x7b\x7bHotovo}} \x7E\x7E\x7E\x7E', 
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/a/a2/X_mark.svg',
            speedTip: 'Nevykonané|Zamietnuté',
            tagOpen: ': \x7b\x7bNevykonané|Zamietnuté}} \x7E\x7E\x7E\x7E', 
            tagClose: '',
            sampleText: ''
        }; 
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/7/72/Button_copy_vio_plagio.png',
            speedTip: 'Copyvio',
            tagOpen: '\x7b\x7bcopyvio|url=',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/9/9d/Button_halt.png',
            speedTip: 'Neprípustné používateľské meno',
            tagOpen: '\x7b\x7bNeprípustné používateľské meno}} \x7E\x7E\x7E\x7E',  
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/3/37/Button_no_neutral.png',
            speedTip: 'neutralita',
            tagOpen: '\x7b\x7bneutralita',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png',
            speedTip: 'nepodpísal',
            tagOpen: '\x7b\x7bnepodpísal|',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/d/da/Broken_conversation_button.png',
            speedTip: 'odpoveď',
            tagOpen: ': \x7b\x7bRe|X|s=1}} \x7E\x7E\x7E\x7E',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/a/a4/Spam1.png',
            speedTip: 'Reklama',
            tagOpen: '\x7b\x7bReklama',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png',
            speedTip: 'Šablóna',
            tagOpen: '\x7b\x7bŠablóna|',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/e/e1/Button_smiley.png',
            speedTip: 'Úsmev',
            tagOpen: '\x7b\x7bÚsmev',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/7/74/Button_oeil.png',
            speedTip: 'Úsmev ;',
            tagOpen: '\x7b\x7bÚsmev|;)',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/7/71/TableCell.png',
            speedTip: 'Zvislá čiara',
            tagOpen: '|',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/0/02/Button_fuente_primaria.png',
            speedTip: 'bez citácie',
            tagOpen: '\x7b\x7bbez citácie',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/3/33/Button_unreferenced.png',
            speedTip: 'bez zdroja',
            tagOpen: '\x7b\x7bbez zdroja',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/4/4f/Button_sig_(zh).png',
            speedTip: 'Preklad',
            tagOpen: '* \x7b\x7bPreklad|en|to|00',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/b/ba/Jadernyhrib-button.png',
            speedTip: 'urgentne upraviť',
            tagOpen: '\x7b\x7burgentne upraviť|' + today,
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/0/09/Warncreate3.png',
            speedTip: 'na revíziu',
            tagOpen: '\x7b\x7bna revíziu',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/6/6c/Button_commons.png',
            speedTip: 'Commons',
            tagOpen: '\x7b\x7bprojekt|commons=Category:',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/7/77/Button_Nuvola_apps_edu_phi.png',
            speedTip: 'Zdieľaná IP školy',
            tagOpen: '\x7b\x7bZdieľaná IP školy|názov školy',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/b/bd/Bouton_Vandale2-.png',
            speedTip: 'polozamknutá',
            tagOpen: '\x7b\x7bpolozamknutá',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/a/a9/Button_tournesol.png',
            speedTip: 'Vitajte',
            tagOpen: '\x7b\x7bVitajte|redaktor=Bubamara|reg=regáno',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/0/06/Smilies_Alien_big_eyes.png',
            speedTip: 'Vitajte neregistrovaný',
            tagOpen: '\x7b\x7bVitajte|redaktor=Bubamara|reg=regnie',
            tagClose: '}}',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/9/91/Button_cite_web.png',
            speedTip: 'Citácia elektronického dokumentu',
            tagOpen: '<ref>\x7b\x7bCitácia elektronického dokumentu\n | priezvisko = \n | meno = \n | odkaz na autora = \n | vydavateľ = \n | titul = \n | url = \n | dátum vydania = 2012-00-0 \n | dátum prístupu = ' + today + '\n | miesto = \n | jazyk = \n}}</ref>',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/e/ef/Button_cite_book.png',
            speedTip: 'Citácia knihy',
            tagOpen: '<ref>\x7b\x7bCitácia knihy\n | priezvisko = \n | meno = \n | odkaz na autora = \n | titul = \n | vydavateľ = \n | miesto = \n | rok = \n | isbn = \n | strany = \n | počet strán = \n | url = \n | jazyk = \n}}</ref>',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/4/49/Button_cite_journal.png',
            speedTip: 'Citácia periodika',
            tagOpen: '<ref>\x7b\x7bCitácia periodika\n  | priezvisko = \n  | meno = \n  | autor = \n  | odkaz na autora = \n  | spoluautori = \n  | titul = \n  | periodikum = \n  | odkaz na periodikum = \n  | rok = \n  | mesiac = \n  | ročník = \n  | číslo = \n  | strany = \n  | url = \n  | issn = \n}}</ref>',
            tagClose: '',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

        var button = { id: 'button-comment',
            imageFile: '//upload.wikimedia.org/wikipedia/commons/5/59/Button_sekcje.png',
            speedTip: 'Koncové sekcie (Referencie, Pozri aj, Iné projekty, Externé odkazy, Zdroj)',
            tagOpen: 
                '== Referencie ==' +
                '\n \x7b\x7bReferencie}}', 
                    'tagClose':
                '\n'+
                '\n== Pozri aj =='+   
                '\n* [[]]'+
                '\n'+
                '\n== Iné projekty =='+
                '\n \x7b\x7bprojekt|commons=Category:}}'+   
                '\n'+
                '\n== Externé odkazy =='+
                '\n* []'+
                '\n'+
                '\n== Zdroj =='+
                '\n* \x7b\x7bPreklad|en|to|00}}'+
                '\n',
            sampleText: ''
        };
        mw.toolbar.addButton(button.imageFile, button.speedTip, button.tagOpen, button.tagClose, button.sampleText, button.id, button.id);

    });
}


/* Odkaz na pieskovisko */
 
var disableSandboxLink = 0;	// ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność
 
addOnloadHook(function()
{
	if (wgUserName != null && disableSandboxLink == 0)
	{
		var caption = 'P1'
		if (wgUserLanguage != 'sk')
			caption = 'My sandbox';
 
		mw.util.addPortletLink('p-personal', wgServer + wgScript + '?title=Special:Mypage/Pieskovisko', caption, 'pt-sandbox', caption, '', document.getElementById('pt-preferences'));
	}
});
 
 
var disableSandboxLink = 0;	// ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność
 
addOnloadHook(function()
{
	if (wgUserName != null && disableSandboxLink == 0)
	{
		var caption = 'P2'
		if (wgUserLanguage != 'sk')
			caption = 'My sandbox';
 
		mw.util.addPortletLink('p-personal', wgServer + wgScript + '?title=Special:Mypage/Pieskovisko 2', caption, 'pt-sandbox', caption, '', document.getElementById('pt-preferences'));
	}
});
 
var disableSandboxLink = 0;	// ustawienie tego na 1 lub true w swoim monobook.js pozwoli wyłączyć tę funkcjonalność
 
addOnloadHook(function()
{
	if (wgUserName != null && disableSandboxLink == 0)
	{
		var caption = 'P3'
		if (wgUserLanguage != 'sk')
			caption = 'My sandbox';
 
		mw.util.addPortletLink('p-personal', wgServer + wgScript + '?title=Special:Mypage/Pieskovisko 3', caption, 'pt-sandbox', caption, '', document.getElementById('pt-preferences'));
	}
});

function loadScript(url)
{
   var e = document.createElement("script");
   e.src = url;
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}
 

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=Bubamara|reg=regáno}}';
    else
        txt.value += '{{Vitajte|redaktor=Bubamara|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}}\n--~~'+'~~';
      document.editform.wpSummary.value = '{{experimenty2}}';
    } else {
      txt.value += '{{experimenty}}\n--~~'+'~~';
      document.editform.wpSummary.value = '{{experimenty}}';
    }
    txt.focus();
}

function vandalizmus() {
    document.editform.wpSummary.value = '{{vandalizmus}}';
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{vandalizmus}}\n--~~'+'~~';
    txt.focus();
}

function zaregistrujsa() {
    document.editform.wpSummary.value = '{{zaregistruj sa}}';
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{zaregistruj sa}}\n--~~'+'~~';
    txt.focus();
}
  
function addlilink(tabs, url, name, id) {
    var na = document.createElement('a');
    na.href = url;
    na.id = id;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}

function morelinks() {
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(document.title.indexOf("Úprava stránky Diskusia s redaktorom")
== 0){
        addlilink(tabs, 'javascript:vitajte()', 'vitajte', '');
        addlilink(tabs, 'javascript:experimenty()', 'exp', '');
        addlilink(tabs, 'javascript:vandalizmus()', 'vandal', '');
        addlilink(tabs, 'javascript:zaregistrujsa()', 'reg', '');
    }
}


function myLoadFuncs() {
    if (!window.ta) 
        window.ta = {};
    // addEditSection0();
    morelinks();
}

if (window.addEventListener)
    window.addEventListener("load",myLoadFuncs,false);
else if (window.attachEvent)
    window.attachEvent("onload",myLoadFuncs);
else {
    window._old_ABCD_onload = window.onload;
    window.onload = function(){
        window._old_ABCD_onload();
        myLoadFuncs();
    }
}

 // [[:en:User:Lupin/popups.js]] - please include this line, prosím nemažte tento riadok
 // [[Redaktor:jsimlo/popups.js]] - please include this line, prosím nemažte tento riadok
 
 document.write('<script type="text/javascript" src="' 
   + 'http://sk.wikipedia.org/w/index.php?title=User:jsimlo/popups.js' 
   + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// [[d:User:Yair rand/WikidataInfo.js]]
importScriptURI("//www.wikidata.org/w/index.php?title=User:Yair rand/WikidataInfo.js&action=raw&ctype=text/javascript");

/**
 * informácie o stránke [[User:Hedonil/XTools]]
 */
 mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hedonil/XTools/XTools.js&action=raw&ctype=text/javascript');

/**
 * WikiCitátor
 */
 mw.loader.load('//tools.freeside.sk/wikiciter/gadget/wikiciter-sk.js');

 /**
  * Edit screen customization
  */
 if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit'] ) !== -1 )
     customizeEditScreen();