Redaktor:Wizzard/monobook.js
Z Wikipédie
Poznámka: Aby sa zmeny prejavili, po uložení musíte vymazať vyrovnávaciu pamäť vášho prehliadača: Mozilla: Ctrl-Shift-R, IE: Ctrl-F5, Safari: Cmd-Shift-R, Konqueror: F5.
function vitajte(){
var reg = prompt("Reg?");
if(!reg) return;
document.editform.wpSummary.value = 'Vitajte/Welcome ';
var txt = document.editform.wpTextbox1;
if(txt.value.length > 0) txt.value += '\n';
txt.value += '{{Vitajte|redaktor=Wizzard|reg=reg' + reg + '}}';
txt.focus();
}
function experimenty(){
var dva = prompt("Druhýkrát?");
if(!dva) return;
document.editform.wpSummary.value = 'experimenty ';
var txt = document.editform.wpTextbox1;
if(txt.value.length > 0) txt.value += '\n';
if (dva == 'áno') txt.value += '{{experimenty2}}'; else txt.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}}';
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()', 'vitaj', '');
addlilink(tabs, 'javascript:experimenty()', 'exp', '');
addlilink(tabs, 'javascript:vandalizmus()', 'vandal', '');
}
}
function myLoadFuncs(){
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();
}
}

