Użytkownik:Adiblol/monobook.js: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
({{ek}}) |
|||
Linia 1: | Linia 1: | ||
function RegisterDescs() { |
|||
{{ek}}/*function ElementExists(arr, el) { alert(arr); alert(el); for(var i=0;i<arr.length;i++) { if (arr[i]==el) return true; } return false;}*/function RegisterDescs() { descs=Array(); texts=Array(); descs['ek'] = '{{[[Szablon:Ek|ek]]}}'; descs['ek-prywata'] = 'ek ([[Nonsensopedia:Prywata|prywata]])'; descs['ek-total'] = 'ek (totalne zło)'; descs['red'] = 'red.'; descs['popr.format'] = 'popr. format. wiki'; descs['sdu'] = 'SdU'; texts['ek'] = '{{ek}}'; texts['ek-prywata'] = '{{ek|[[Nonsensopedia:Prywata|Prywata]]}}'; texts['ek-total'] = '{{ek|TOTALNE ZŁO!!!}}'; texts['sdu'] = '{{SDU}}'; var s=''; for (dn in descs) { s+='<a href="#" onclick="addToSummary(''+descs[dn]+'');return false;">'+dn+'</a>, '; } document.getElementById('editOptions').innerHTML = '<small style="border:1px solid #444;background:#eee;padding:2px"> <b>Gotowce:</b> '+s+'</small>'+document.getElementById('editOptions').innerHTML; s=''; var c=''; for (dn in texts) { if (descs[dn]) { c+='<button onclick="addToText(''+texts[dn]+'');addToSummary(''+descs[dn]+'');">'+dn+'</button>'; } s+='<a href="#" onclick="addToText(''+texts[dn]+'');return false;">'+dn+'</a>'; } if (document.getElementById('toolbar')) document.getElementById('toolbar').innerHTML += '<small style="border:1px solid #444;background:#eee;padding:2px"> <b>Dodatkowe:</b> '+s+'</small>'; document.getElementById('editOptions').innerHTML = c+document.getElementById('editOptions').innerHTML }if ((wgAction=='edit') || (wgAction=='submit')) { addOnloadHook(RegisterDescs);}function addToSummary(v) { document.getElementById('wpSummary').value += v;}function addToText(v) { document.getElementById('wpTextbox1').innerText=v+"\n\n\n"+document.getElementById('wpTextbox1').innerText} |
|||
descs=Array(); |
|||
texts=Array(); |
|||
descs['ek'] = '{{[[Szablon:Ek|ek]]}}'; |
|||
descs['ek-prywata'] = 'ek ([[Nonsensopedia:Prywata|prywata]])'; |
|||
descs['ek-total'] = 'ek (totalne zło)'; |
|||
descs['red'] = 'red.'; |
|||
descs['popr.format'] = 'popr. format. wiki'; |
|||
descs['sdu'] = 'SdU'; |
|||
texts['ek'] = '{{ek}}'; |
|||
texts['ek-prywata'] = '{{ek|[[Nonsensopedia:Prywata|Prywata]]}}'; |
|||
texts['ek-total'] = '{{ek|TOTALNE ZŁO!!!}}'; |
|||
texts['sdu'] = '{{SDU}}'; |
|||
var s=''; |
|||
for (dn in descs) { |
|||
s+='<a href="#" onclick="addToSummary(''+descs[dn]+'');return false;">'+dn+'</a>, '; |
|||
} |
|||
document.getElementById('editOptions').innerHTML = '<small style="border:1px solid #444;background:#eee;padding:2px"> <b>Gotowce:</b> '+s+'</small>'+document.getElementById('editOptions').innerHTML; |
|||
s=''; |
|||
var c=''; |
|||
for (dn in texts) { |
|||
if (descs[dn]) { |
|||
c+='<button style="height:26px" onclick="addToText(''+texts[dn]+'');addToSummary(''+descs[dn]+'');return false;">'+dn+'</button>'; |
|||
} |
|||
s+='<a href="#" onclick="addToText(''+texts[dn]+'');return false;">'+dn+'</a>'; |
|||
} |
|||
if (document.getElementById('toolbar')) document.getElementById('toolbar').innerHTML += '<small style="border:1px solid #444;background:#eee;padding:2px"> <b>Dodatkowe:</b> '+s+'</small>'; |
|||
document.getElementById('editOptions').innerHTML += '<br /><br /><b>GOTOWCE (tekst & opis)</b>: '+c+'<br /><br />'; |
|||
} |
|||
if ((wgAction=='edit') || (wgAction=='submit')) { |
|||
addOnloadHook(RegisterDescs); |
|||
} |
|||
function addToSummary(v) { |
|||
document.getElementById('wpSummary').value += v; |
|||
} |
|||
function addToText(v) { |
|||
document.getElementById('wpTextbox1').innerHTML=v+"\n\n\n"+document.getElementById('wpTextbox1').innerHTML; |
|||
} |
Wersja z 16:21, 27 cze 2008
function RegisterDescs() {
descs=Array();
texts=Array();
descs['ek'] = '{{[[Szablon:Ek|ek]]}}';
descs['ek-prywata'] = 'ek ([[Nonsensopedia:Prywata|prywata]])';
descs['ek-total'] = 'ek (totalne zło)';
descs['red'] = 'red.';
descs['popr.format'] = 'popr. format. wiki';
descs['sdu'] = 'SdU';
texts['ek'] = '{{ek}}';
texts['ek-prywata'] = '{{ek|[[Nonsensopedia:Prywata|Prywata]]}}';
texts['ek-total'] = '{{ek|TOTALNE ZŁO!!!}}';
texts['sdu'] = '{{SDU}}';
var s='';
for (dn in descs) {
s+='<a href="#" onclick="addToSummary(''+descs[dn]+'');return false;">'+dn+'</a>, ';
}
document.getElementById('editOptions').innerHTML = '<small style="border:1px solid #444;background:#eee;padding:2px"> <b>Gotowce:</b> '+s+'</small>'+document.getElementById('editOptions').innerHTML;
s='';
var c='';
for (dn in texts) {
if (descs[dn]) {
c+='<button style="height:26px" onclick="addToText(''+texts[dn]+'');addToSummary(''+descs[dn]+'');return false;">'+dn+'</button>';
}
s+='<a href="#" onclick="addToText(''+texts[dn]+'');return false;">'+dn+'</a>';
}
if (document.getElementById('toolbar')) document.getElementById('toolbar').innerHTML += '<small style="border:1px solid #444;background:#eee;padding:2px"> <b>Dodatkowe:</b> '+s+'</small>';
document.getElementById('editOptions').innerHTML += '<br /><br /><b>GOTOWCE (tekst & opis)</b>: '+c+'<br /><br />';
}
if ((wgAction=='edit') || (wgAction=='submit')) {
addOnloadHook(RegisterDescs);
}
function addToSummary(v) {
document.getElementById('wpSummary').value += v;
}
function addToText(v) {
document.getElementById('wpTextbox1').innerHTML=v+"\n\n\n"+document.getElementById('wpTextbox1').innerHTML;
}