Redaktor:Kahoun/monobook.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;

if (mwCustomEditButtons) {
//Strike-Out Button
mwCustomEditButtons[mwCustomEditButtons.length] = {   
      "imageFile": "//upload.wikimedia.org/wikipedia/commons/2/23/Button_code.png",
      "speedTip": "code",
      "tagOpen": "<code>",
      "tagClose": "</code>",
      "sampleText": "text"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
      "imageFile": "//upload.wikimedia.org/wikipedia/commons/3/3c/Button_pre.png",
      "speedTip": "preformátovaný text",
      "tagOpen": "<pre>",
      "tagClose": "</pre>",
      "sampleText": "preformátovaný text"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png",
    "speedTip": "Hlasuj Za",
    "tagOpen": "",
    "tagClose": "",
    "sampleText": "#{{za}} \~\~\~\~"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png",
    "speedTip": "Hlasuj Proti",
    "tagOpen": "",
    "tagClose": "",
    "sampleText": "#{{proti}} \~\~\~\~"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/4/4e/Button_neutre.png",
    "speedTip": "Hlasuj Neutral",
    "tagOpen": "",
    "tagClose": "",
    "sampleText": "#{{neutral}} \~\~\~\~"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/a/a5/Buttonexperimenty.png",
    "speedTip": "experimenty",
    "tagOpen": "\x7b\x7bexperimenty}} \x7E\x7E\x7E\x7E",
    "tagClose": "",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/1/16/Buttonexperimenty2.png",
    "speedTip": "experimenty2",
    "tagOpen": "\x7b\x7bexperimenty2}} \x7E\x7E\x7E\x7E",
    "tagClose": "",
    "sampleText": ""};  
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/7/7e/Bouton_Vandale4.png",
    "speedTip": "vandalizmus",
    "tagOpen": "\x7b\x7bvandalizmus",
    "tagClose": "}} \x7e\x7e\x7e\x7e",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/7/72/Button_copy_vio_plagio.png",
    "speedTip": "Copyvio",
    "tagOpen": "\x7b\x7bcopyvio|url=",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "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",
    "tagClose": "}} \x7e\x7e\x7e\x7e",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/3/37/Button_no_neutral.png",
    "speedTip": "neutralita",
    "tagOpen": "\x7b\x7bneutralita",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png",
    "speedTip": "nepodpísal",
    "tagOpen": "\x7b\x7bnepodpísal|",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {                                     
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/a/a4/Spam1.png",
    "speedTip": "Reklama",
    "tagOpen": "\x7b\x7bReklama",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png",
    "speedTip": "Šablóna",
    "tagOpen": "\x7b\x7bŠablóna|",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/6/62/Button_desambig.png",
    "speedTip": "Rozlišovacia stránka",
    "tagOpen": "\x7b\x7bRozlišovacia stránka",           
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {                                     
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/e/e1/Button_smiley.png",
    "speedTip": "Úsmev",
    "tagOpen": "\x7b\x7bÚsmev",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/7/71/TableCell.png",
    "speedTip": "Zvislá čiara",
    "tagOpen": "|",
    "tagClose": "",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/0/02/Button_fuente_primaria.png",
    "speedTip": "bez citácie",
    "tagOpen": "\x7b\x7bbez citácie",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/3/33/Button_unreferenced.png",
    "speedTip": "bez zdroja",
    "tagOpen": "\x7b\x7bbez zdroja",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/4/4f/Button_sig_(zh).png",
    "speedTip": "Preklad",
    "tagOpen": "* \x7b\x7bPreklad|en|to|00",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/b/ba/Jadernyhrib-button.png",
    "speedTip": "urgentne upraviť",  
    "tagOpen": "\x7b\x7burgentne upraviť|2012MMDD",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/0/09/Warncreate3.png",
    "speedTip": "na revíziu",
    "tagOpen": "\x7b\x7bna revíziu",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/3/3a/Button_av-img.png", 
    "speedTip": "Nsd",
    "tagOpen": "\x7b\x7bsubst:nsd",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/2/2d/Button_removed.png", 
    "speedTip": "nlicd",
    "tagOpen": "\x7b\x7bsubst:nlicd",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/6/6c/Button_commons.png",
    "speedTip": "Commons",
    "tagOpen": "\x7b\x7bprojekt|commons=Category:",
    "tagClose": "}}",
    "sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
      "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": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "//upload.wikimedia.org/wikipedia/commons/e/ee/Button_vote_biblio.png",
    "speedTip": "Infobox Osobnosť",
    "tagOpen": "\x7b\x7bInfobox Osobnosť"+
"\n  |Meno             = ",
    "tagClose":
"\n  |Portrét          = "+
"\n  |Veľkosť obrázka  = 230px"+
"\n  |Popis            = "+
"\n  |Dátum narodenia  = "+
"\n  |Miesto narodenia = "+
"\n  |Dátum úmrtia     = "+
"\n  |Miesto úmrtia    = "+
"\n}}",
    "sampleText": "Janko Hraško"};
};
 
function addPurge(){
    ta['ca-purge'] = ['g', 'Purge the internal cache for this page'];
    if(!document.getElementById) return;
    var x = document.getElementById('ca-history');
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(!x) return;
    if(x.children) x = x.children[0];
    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=Kahoun|reg=regáno}}';
    else
        txt.value += '{{Vitajte|redaktor=Kahoun|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 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();
}
 
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();
    }
}
 
 
// install the Slovenian translation for [[:en:User:Cacycle/wikEd]]
document.write('<script type="text/javascript" src="'
 + '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)
  {
    var nodToolsList = nodAnchor.parentNode;
    var nodLinkCommons_li = document.createElement ("li");
    var nodLinkCommons_a = document.createElement ("a");
 
    nodLinkCommons_li.id = "t-link-commons";
 
    nodLinkCommons_a.href = "http://commons.wikimedia.org/wiki/Hlavná_stránka";
    nodLinkCommons_a.target = "_blank";
 
    nodLinkCommons_a.appendChild (document.createTextNode ("Wikimedia Commons"));
    nodLinkCommons_li.appendChild (nodLinkCommons_a);
 
    nodToolsList.insertBefore (nodLinkCommons_li, nodAnchor.nextSibling);
 
    var nodSeparator_hr = document.createElement ("hr");
    nodToolsList.insertBefore (nodSeparator_hr, nodAnchor.nextSibling);
    }
  }
 
function addCommonsGalLink ()
 {
  nodAnchor = document.getElementById (anchor);
 
  if (nodAnchor)
  {
    var nodToolsList = nodAnchor.parentNode;
    var nodGalLinkCommons_li = document.createElement ("li");
    var nodGalLinkCommons_a = document.createElement ("a");
 
    nodGalLinkCommons_li.id = "t-img-link-commons";
 
    nodGalLinkCommons_a.href = "http://commons.wikimedia.org/wiki/"+nazov;
    nodGalLinkCommons_a.target = "_blank";
    nodGalLinkCommons_a.appendChild (document.createTextNode ("Commons/galéria"));
    nodGalLinkCommons_li.appendChild (nodGalLinkCommons_a);
 
    nodToolsList.insertBefore (nodGalLinkCommons_li, nodAnchor.nextSibling);
    }
  }
 
 function addCommonsCatLink ()
 {
  nodAnchor = document.getElementById (anchor);
 
  if (nodAnchor)
  {
    var nodToolsList = nodAnchor.parentNode;
    var nodCatLinkCommons_li = document.createElement ("li");
    var nodCatLinkCommons_a = document.createElement ("a");
 
    nodCatLinkCommons_li.id = "t-cat-link-commons";
 
    nodCatLinkCommons_a.href = "http://commons.wikimedia.org/wiki/Category:"+nazov;
    nodCatLinkCommons_a.target = "_blank";
    nodCatLinkCommons_a.appendChild (document.createTextNode ("Commons/kategória"));
    nodCatLinkCommons_li.appendChild (nodCatLinkCommons_a);
 
    nodToolsList.insertBefore (nodCatLinkCommons_li, nodAnchor.nextSibling);
    }
  }
 
 addOnloadHook( addCommonsCatLink );
 addOnloadHook( addCommonsGalLink );
 addOnloadHook( addCommonsLink );