Użytkownik:D@mi/monobook.js: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
M |
M |
||
(Nie pokazano 3 wersji utworzonych przez 3 użytkowników) | |||
Linia 1: | Linia 1: | ||
//**************************************************************************************************************** |
|||
// [http://nonsensopedia.wikia.com/index.php?title=U%C5%BCytkownik:D@mi/monobook.js&action=purge purge] |
|||
function blockreasons() { |
|||
if(!document.getElementById('ipbreason-dropdown-js')) return; |
|||
var reasondiv = document.getElementById('ipbreason-dropdown-js'); |
|||
var reasons = document.getElementById('ipbreason-dropdown-js').firstChild.nodeValue.split('\n'); |
|||
var selsel = document.createElement('select'); |
|||
/* <pre> |
|||
selsel.setAttribute('onchange','blockreasonchange();'); |
|||
Title: ReinDeel33t Scirpt |
|||
selsel.setAttribute('id','blockreasonsel'); |
|||
Version: 0.1.1b (15:00 10.01.2006) |
|||
var firstop = document.createElement('option'); |
|||
firstop.appendChild(document.createTextNode('Powody blokad')); |
|||
selsel.appendChild(firstop); |
|||
var groupop = new Array(); var gpn = 0; |
|||
Author: Łukasz "TOR" Garczewski <tor@oak.pl>, [[pl:User:TOR]] |
|||
var op = new Array(); var opn = 0; |
|||
License: GFDL, GPL, CC-by (choose one ;)) |
|||
for(var i=0;i<reasons.length;i++) { |
|||
if(reasons[i].substring(0,1)=='*') { |
|||
Note: |
|||
if(reasons[i].substring(0,2)=='**') { |
|||
en: This script was written with the invaluable help of Peter-Paul Koch's |
|||
op[opn] = document.createElement('option'); |
|||
javascript tutorials found at his homepage, QuirksMode <http://www.quirksmode.org/>. |
|||
op[opn].setAttribute('value',reasons[i].substring(2)); |
|||
If you like what I've done here, send him some happy thoughts. ;) |
|||
op[opn].appendChild(document.createTextNode(reasons[i].substring(2))); |
|||
pl: Ten skrypt został napisany dzięki nieocenionej pomocy tutoriali |
|||
groupop[gpn].appendChild(op[opn]); |
|||
Petera-Paula Kocha, które znajduja sie na jego stronie domowej, |
|||
opn++; |
|||
QuirksMode <http://www.quirksmode.org/>. |
|||
} else { |
|||
Jesli podoba ci sie to co tutaj stworzylem, wyslij mu troche cieplych mysli. ;) |
|||
if(groupop[gpn]) selsel.appendChild(groupop[gpn]) |
|||
gpn++; |
|||
Disclaimer: |
|||
groupop[gpn] = document.createElement('optgroup'); |
|||
en: This script is under heavy development. I cannot guarantee anything. |
|||
groupop[gpn].setAttribute('label',reasons[i].substring(1)); |
|||
I can't even guarantee it's a script. ;) Use at your own risk. |
|||
} |
|||
pl: Ten skrypt jest obecnie w fazie bardzo rozwojowej. Nie gwaratunje niczego. |
|||
Nie gwarantuje nawet, ze to jest skrypt. ;) Uzywasz na wlasne ryzyko. |
|||
*/ |
|||
function setupRightClickEdit() { |
|||
if (document.getElementById) { |
|||
if (document.getElementById('deleteconfirm')) { |
|||
/* FEATURE: Hardcore Mode |
|||
changing the value of del_hardcore_mode to 1 will cause the script |
|||
to automatically submit the form if needs_add_info = 0 |
|||
be *sure* you know what you're doing *before* you enable this */ |
|||
del_hardcore_mode = 1; |
|||
target = document.getElementById('deleteconfirm').childNodes[1].childNodes[1].firstChild; |
|||
var temp = document.createElement('TD'); |
|||
target.appendChild(temp); |
|||
var workspace = target.childNodes[5]; |
|||
workspace.setAttribute('rowspan','2'); |
|||
workspace.setAttribute('style','vertical-align: top'); |
|||
/* OPTIONS section start */ |
|||
labels = new Array(10); |
|||
labels[0] = 'prywata'; |
|||
labels[1] = 'bełkot'; |
|||
labels[2] = 'agitka'; |
|||
labels[3] = 'google'; |
|||
labels[4] = 'nnnw'; |
|||
labels[5] = 'celebrities'; |
|||
labels[6] = 'sdu24'; |
|||
labels[7] = 'sdu'; |
|||
labels[8] = 'woda'; |
|||
labels[9] = 'wszystko'; |
|||
reasons = new Array(10); |
|||
reasons[labels[0]] = '[[Nonsensopedia:Prywata|prywata]]'; |
|||
reasons[labels[1]] = '[[Nonsensopedia:Bełkot|bełkot]]'; |
|||
reasons[labels[2]] = '[[Nonsensopedia:Agitka|agitka]]'; |
|||
reasons[labels[3]] = '[[Nonsensopedia:Googlowalność|nic w Google]]'; |
|||
reasons[labels[4]] = '[[Nonsensopedia:Nikt nic nie wie|nikt nic nie wie]]'; |
|||
reasons[labels[5]] = '[[Nonsensopedia:Celebrities|celebrities]]'; |
|||
reasons[labels[6]] = 'wynik SDU, tryb 24 h'; |
|||
reasons[labels[7]] = 'wynik SDU'; |
|||
reasons[labels[8]] = '[[Nonsensopedia:Lanie wody|lanie wody]]'; |
|||
reasons[labels[9]] = '[[Nonsensopedia:Powody usuwania haseł|wszystko co najgorsze]]'; |
|||
needs_add_info = new Array(10); |
|||
needs_add_info[labels[0]] = 0; |
|||
needs_add_info[labels[1]] = 0; |
|||
needs_add_info[labels[2]] = 0; |
|||
needs_add_info[labels[3]] = 0; |
|||
needs_add_info[labels[4]] = 0; |
|||
needs_add_info[labels[5]] = 0; |
|||
needs_add_info[labels[6]] = 0; |
|||
needs_add_info[labels[7]] = 0; |
|||
needs_add_info[labels[8]] = 0; |
|||
needs_add_info[labels[9]] = 0; |
|||
/* OPTIONS section end */ |
|||
for (i=0; ((i+1) <= reasons.length); i++) { |
|||
workspace.appendChild(document.createElement('A')); |
|||
workspace.childNodes[(2 * i)].setAttribute('href','javascript:giveReason("' + labels[i] + '")'); |
|||
workspace.childNodes[(2 * i)].appendChild(document.createTextNode(labels[i])); |
|||
workspace.appendChild(document.createTextNode(' ')); |
|||
} |
} |
||
} |
|||
selsel.appendChild(groupop[gpn]); |
|||
var reasonparent = document.getElementById('blockip').wpBlockReason.parentNode; |
|||
} |
|||
reasonparent.appendChild(document.createElement('br')); |
|||
reasonparent.appendChild(selsel); |
|||
} |
} |
||
if(wgPageName=='Specjalna:Blockip') addOnloadHook(blockreasons); |
|||
function blockreasonchange() { |
|||
var selsel = document.getElementById('blockreasonsel'); |
|||
var reasonbox = document.getElementById('blockip').wpBlockReason; |
|||
if(selsel.selectedIndex == 0) return |
|||
reasonbox.value = selsel.options[selsel.selectedIndex].value; |
|||
} |
} |
||
var NavigationBarShowDefault = 0; |
|||
function giveReason(msg) { |
|||
document.getElementById('wpReason').setAttribute('value',reasons[msg]); |
|||
//**************************************************************************************************************** |
|||
if (needs_add_info[msg]) { |
|||
document.getElementById('wpReason').focus(); |
|||
} |
|||
else { |
|||
if (del_hardcore_mode == 1) { |
|||
document.getElementById('deleteconfirm').submit(); |
|||
} |
|||
else { |
|||
target.parentNode.childNodes[2].childNodes[3].childNodes[1].focus(); |
|||
} |
|||
} |
|||
} |
|||
/* </pre> */ |
Aktualna wersja na dzień 23:54, 8 cze 2007
//****************************************************************************************************************
function blockreasons() {
if(!document.getElementById('ipbreason-dropdown-js')) return;
var reasondiv = document.getElementById('ipbreason-dropdown-js');
var reasons = document.getElementById('ipbreason-dropdown-js').firstChild.nodeValue.split('\n');
var selsel = document.createElement('select');
selsel.setAttribute('onchange','blockreasonchange();');
selsel.setAttribute('id','blockreasonsel');
var firstop = document.createElement('option');
firstop.appendChild(document.createTextNode('Powody blokad'));
selsel.appendChild(firstop);
var groupop = new Array(); var gpn = 0;
var op = new Array(); var opn = 0;
for(var i=0;i<reasons.length;i++) {
if(reasons[i].substring(0,1)=='*') {
if(reasons[i].substring(0,2)=='**') {
op[opn] = document.createElement('option');
op[opn].setAttribute('value',reasons[i].substring(2));
op[opn].appendChild(document.createTextNode(reasons[i].substring(2)));
groupop[gpn].appendChild(op[opn]);
opn++;
} else {
if(groupop[gpn]) selsel.appendChild(groupop[gpn])
gpn++;
groupop[gpn] = document.createElement('optgroup');
groupop[gpn].setAttribute('label',reasons[i].substring(1));
}
}
}
selsel.appendChild(groupop[gpn]);
var reasonparent = document.getElementById('blockip').wpBlockReason.parentNode;
reasonparent.appendChild(document.createElement('br'));
reasonparent.appendChild(selsel);
}
if(wgPageName=='Specjalna:Blockip') addOnloadHook(blockreasons);
function blockreasonchange() {
var selsel = document.getElementById('blockreasonsel');
var reasonbox = document.getElementById('blockip').wpBlockReason;
if(selsel.selectedIndex == 0) return
reasonbox.value = selsel.options[selsel.selectedIndex].value;
}
var NavigationBarShowDefault = 0;
//****************************************************************************************************************