Używacz:Adziura/monobook.js: Porōwnanie wersyji

Usunięta treść Dodana treść
mNie podano opisu zmian
mNie podano opisu zmian
 
Linijŏ 1:
/*
; Informacje ogólne: [[WP:SK]]
; Pomysł, teksty: [[User:Dodek]], [[User:Adziura]]
; WykonanieAutor: Maciej Jaros [[:pl:User:Nux]], [[User:Saper]],© [[User:Beau]]2007
; Licencja: [http://opensource.org/licenses/gpl-license.php GNU General Public License v2]
*/
<pre>
var wb$description = "Opisz błąd możliwie jak najdokładniej. Jeżeli masz taką możliwość podaj źródło informacji.";
/* ======================================================================== *\
Moduł sprzątania kodu
Użycie przez wp_sk.cleanup(input) np.:
addOnloadHook(function()
wp_sk.cleanup(document.getElementById('wpTextbox1'))
version: 1.4.1
copyright: (C) 2007 Maciej Jaros (pl:User:Nux, en:User:EcceNux)
modyfikacje: pl:User:BartekChom
\* ======================================================================== */
//
// Clean up (WP:SK)
//
if (wp_sk!=undefined)
{
alert('Błąd krytyczny - konflikt nazw!\n\nJeden ze skryptów używa już nazwy wp_sk jako zmienną globalną.');
var el = document.getElementById('n-Dej-zna.C4.87-uo-fele.C5.99e');
}
var wp_sk = new Object();
//
// Button
//
wp_sk.button = function ()
{
var src='http://upload.wikimedia.org/wikipedia/commons/2/2e/Button_broom.png';
var btns=document.createElement('span');
btns.innerHTML=
'<a href="javascript:wp_sk.ryzykowne = false; wp_sk.cleanup(document.getElementById(\'wpTextbox1\'));">'
+'<img style="cursor:pointer;" title="Czyszczenie kodu bezpieczne" alt="Czyszczenie kodu bezpieczne" src="'+src+'" border="0" height="22" width="23">'
+'</a>'
;
var el=document.getElementById('toolbar');
if (el)
{
el.appendChild(btns)
el.getElementsByTagName('a')[0].onclick= wb$popWikibug;
}
else
});
{
el=document.getElementById('editform');
if (el) el.parentNode.insertBefore(btns,el);
}
}
wp_sk.button2 = function ()
{
var src='http://upload.wikimedia.org/wikipedia/commons/f/f3/Button_broom2.png';
var btns2=document.createElement('span');
btns2.innerHTML=
'<a href="javascript:wp_sk.ryzykowne = true; wp_sk.pytaj = false; wp_sk.cleanup(document.getElementById(\'wpTextbox1\'));">'
+'<img style="cursor:pointer;" title="Czyszczenie kodu ryzykowne" alt="Czyszczenie kodu ryzykowne" src="'+src+'" border="0" height="22" width="23">'
+'</a>'
;
var el=document.getElementById('toolbar');
function wb$popWikibug()
if (el)
{
el.appendChild(btns2)
}
else
{
el=document.getElementById('editform');
if (el) el.parentNode.insertBefore(btns2,el);
}
}
wp_sk.button3 = function ()
{
var src='http://upload.wikimedia.org/wikipedia/commons/9/9f/Button_broom3.png';
wb$popBugBoth("Wikipedyjo:Dej_znać_uo_feleře_we_artiklu", '\
<h3>Zgłoś błąd w artykule / Dej znać uo feleře we artiklu</h3><p style="margin-top:0px;">Możesz zgłaszać znalezione błędy w artykułach w Wikipedii, jednak pamiętaj, że Wikipedia to <a href="/wiki/Wiki">wiki</a> i można, a nawet należy śmiało poprawiać znalezione błędy samemu. Zdajemy sobie jednak sprawę z faktu, iż niektórzy czytelnicy Wikipedii mogą z różnych przyczyn nie chcieć samodzielnie poprawiać artykułów.</p><p>Przez ten formularz zgłaszaj też propozycje poprawnych śląskich słów wykorzystywanych w Wikipedii.\
var btns3=document.createElement('span');
<p><b>Uwaga:</b> Jeśli zamieściłeś/-aś raport o błędzie, a teraz go już nie ma, to najprawdopodobniej został on naprawiony. </p><ul><li><a href="/wiki/Wikipedyjo:Dej znać uo feleře we artiklu">Zobacz listę aktualnie zgłoszonych błędów</a> oraz</li><li><a href="/w/index.php?title=Wikipedyjo:Dej znać uo feleře we artiklu&amp;action=history">historię zmian wprowadzanych na tej stronie.</a></li></ul>\
btns3.innerHTML=
');
'<a href="javascript:wp_sk.ryzykowne = true; wp_sk.pytaj = true; wp_sk.cleanup(document.getElementById(\'wpTextbox1\'));">'
return false;
+'<img style="cursor:pointer;" title="Czyszczenie kodu ryzykowne z pytaniem" alt="Czyszczenie kodu ryzykowne z pytaniem" src="'+src+'" border="0" height="22" width="23">'
+'</a>'
;
var el=document.getElementById('toolbar');
if (el)
{
el.appendChild(btns3)
}
else
{
el=document.getElementById('editform');
if (el) el.parentNode.insertBefore(btns3,el);
}
}
//
function wb$getEditToken(page){
// Warning
var objhttp=(window.XMLHttpRequest) ? new XMLHttpRequest(): new ActiveXObject('Microsoft.XMLHTTP');
//
if(!objhttp){return};
wp_sk.warning = function (input)
objhttp.onreadystatechange=function() {
{
if (objhttp.readyState == 4) {
var el=document.getElementById('wpSummary');
if (objhttp.status == 200) {
if (el.value!='')
var r_sti = /value="(\d+)" name=["']wpStarttime["']/;
el.value+=', ';
var r_eti = /value="(\d+)" name=["']wpEdittime["']/;
el.value+='po czyszczeniu kodu przejrzyj wykonane zmiany!'
var r_etk = /value="(.*?)" name=["']wpEditToken["']/;
el.className = 'warning';
var r_asm = /name="wpAutoSummary" type="hidden" value="(.*?)"/;
sti = r_sti.exec(objhttp.responseText);
el=document.getElementById('wpDiff');
eri = r_eti.exec(objhttp.responseText);
el.className = 'warning';
etk = r_etk.exec(objhttp.responseText);
el.onclick=function()
asm = r_asm.exec(objhttp.responseText);
{
document.getElementById('Starttime').value=sti[1];
var el=document.getElementById('EdittimewpSummary').value=eri[1];
el.value=el.value.replace('po czyszczeniu kodu przejrzyj wykonane zmiany!', '[[WP:SK]]');
document.getElementById('EditToken').value=etk[1];
}
document.getElementById('AutoSummary').value=asm[1];
} else
alert(objhttp.status);
}
};
objhttp.open("GET", wgServer + wgScript + "?title=" + encodeURIComponent(page) + "&action=edit");
objhttp.send("");
}
wp_sk.cleanup = function wb$checkForm(forminput)
{
var wpSummaryisPartSelected = form.wpSummary.valuefalse;
if (input.selectionStart != undefined)
var wpTextbox = form.wpTextbox1.value;
{
var sel_s = input.selectionStart;
var sel_e = input.selectionEnd;
if (sel_s!=sel_e)
{
var str = input.value.substring(sel_s, sel_e);
isPartSelected = true;
}
}
// IE...
else if (document.selection)
{
var range = document.selection.createRange();
if (range.parentElement()==input && range.text!='')
{
var str = range.text;
isPartSelected = true;
}
}
if (!isPartSelected)
if (wpSummary == wgPageName) {
{
wpSummary = wpSummary.replace(/^Grafika:/, "");
var str = input.value;
wpSummary = wpSummary.replace(/_/g, " ");
}
wpSummary = "[[:" + wgPageName + "|" + wpSummary + "]]";
// OMG - IE & Opera fix
if (wgNamespaceNumber == 6)
str = str.replace(/\r\n/g, '\n');
wpTextbox = "[[" + wgPageName + "|thumb|left|100px|]]\n* " + wpTextbox + "\r\n{{clear}}";
//
// linkowato-szablonowate
// łącza zewnętrzne do innych Wikipedii w międzywiki
if(wp_sk.ryzykowne)
{
str = str.replace(/\[http:\/\/([^\.\]]*)\.wikipedia\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[:$1:$2|$3]]');
str = str.replace(/\[http:\/\/pl\.wiktionary\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[wikt:$1|$2]]');
str = str.replace(/\[http:\/\/([^\.\]]*)\.wiktionary\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[wikt:$1:$2|$3]]');
str = str.replace(/\[http:\/\/pl\.wikiquote\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[q:$1|$2]]');
str = str.replace(/\[http:\/\/([^\.\]]*)\.wikiquote\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[q:$1:$2|$3]]');
str = str.replace(/\[http:\/\/pl\.wikinews\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[n:$1|$2]]');
str = str.replace(/\[http:\/\/([^\.\]]*)\.wikinews\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[n:$1:$2|$3]]');
str = str.replace(/\[http:\/\/pl\.wikisource\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[s:$1|$2]]');
str = str.replace(/\[http:\/\/([^\.\]]*)\.wikisource\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[s:$1:$2|$3]]');
str = str.replace(/\[http:\/\/pl\.wikibooks\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[b:$1|$2]]');
str = str.replace(/\[http:\/\/([^\.\]]*)\.wikibooks\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[b:$1:$2|$3]]');
str = str.replace(/\[http:\/\/pl\.wikiversity\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[v:$1|$2]]');
str = str.replace(/\[http:\/\/([^\.\]]*)\.wikiversity\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[:$1:v:$2|$3]]');
str = str.replace(/\[http:\/\/wikispacies\.wikimedia\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[wikispacies:$1|$2]]');
str = str.replace(/\[http:\/\/commons\.wikimedia\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[commons:$1|$2]]');
str = str.replace(/\[http:\/\/meta\.wikimedia\.org\/wiki\/([^ \]]*) +([^\]]*)\]/g, '[[m:$1|$2]]');
str = str.replace(/\[\[meta:([^\|\]]*)\|([^\]]*)\]\]/g, '[[m:$1|$2]]');
}
else {
wpSummary = wpSummary.replace(/_/g, " ");
wpSummary = wpSummary.replace(/[\[\]\|]/g, "");
wpSummary = wpSummary.replace(/^\s+/g, "");
wpSummary = wpSummary.replace(/\s+$/g, "");
// [[Jaki%C5%9B_lnk#co.C5.9B|...]]→[[Jakiś lnk#coś|...]]
if (wpSummary == "") {
str = str.replace(/\[\[([^|#\]]*)([^|\]]*)(\||\]\])/g, wp_sk.rLinkdecode);
alert("Podaj nazwę strony.");
form.wpSummary.value = wgPageName;
return false;
}
str = str.replace(/\[\[[ ]*([^\]\|]*[^\]\| ])[ ]*\|/g, '[[$1|');
wpSummary = '[[:' + wpSummary + ']]';
str = str.replace(/([^ \n])\[\[ +([^\]]+\]\])/g, '$1 [[$2');
str = str.replace(/\[\[[ ]+([^\]]+\]\])/g, '[[$1');
str = str.replace(/([^ \n])\[\[([^\]\|]+\|)[ ]+([^\]\|]+\]\])/g, '$1 [[$2$3');
str = str.replace(/\[\[([^\]\|]+\|)[ ]+([^\]\|]+\]\])/g, '[[$1$2');
str = str.replace(/([^ \|])[ ]+\]\]([^ \na-zA-ZżółęśąźńŻÓŁĘŚĄŹŃ])/g, '$1]] $2');
str = str.replace(/([^ \|])[ ]+\]\]([^a-zA-ZżółęśąźńŻÓŁĘŚĄŹŃ])/g, '$1]]$2');
str = str.replace(/\[\[(:?)[ ]*([Ii]mage|[Gg]rafika)[ ]*:[ ]*([^ ])/g, function (a,dw,co,l1) {return '[['+dw+'Grafika:'+l1.toUpperCase();} );
str = str.replace(/\[\[(:?)[ ]*([Cc]ategory|[Kk]ategoria)[ ]*:[ ]*([^ ])/g, function (a,dw,co,l1) {return '[['+dw+'Kategoria:'+l1.toUpperCase();} );
str = str.replace(/\[\[[ ]*(:?)[ ]*([Tt]emplate|[Ss]zablon)[ ]*:[ ]*([^ ])/g, function (a,dw,co,l1) {return '[[Szablon:'+l1.toUpperCase();} );
str = str.replace(/\[\[[ ]*(:?)[ ]*([Ss]pecial|[Ss]pecjalna)[ ]*:[ ]*([^ ])/g, function (a,dw,co,l1) {return '[[Specjalna:'+l1.toUpperCase();} );
str = str.replace(/\[\[[ ]*:?[ ]*[Dd]yskusja([ _][a-z]*)[ ]*:[ ]*/g, '[[Dyskusja$1:');
// stare przestrzenie
str = str.replace(/Dyskusja([ _])Wikipedysty/g, 'Dyskusja$1wikipedysty');
str = str.replace(/\{\{[ ]*([Tt]emplate|[Ss]zablon|msg)[ ]*:[ ]*/g, '{{');
// str = str.replace(/\[\[[ ]*:[ ]*pl[ ]*:[ ]*/g, '[[');
// str = str.replace(/\[\[[ ]*pl[ ]*:[ ]*[^\]]*\]\][ \n\t]*/g, '');
str = str.replace(/\[\[[ ]*:?[ ]*pl[ ]*:[ ]*/g, '[[');
str = str.replace(/(\[\[Grafika:[^\|]+\|[^\|]+)\.\]\]/, '$1]]');
str = str.replace(/\[\[([^|\]]*)\|\1([a-zA-ZżółęśąźńŻÓŁĘŚĄŹŃ]*)\]\]/g, '[[$1]]$2');
str = str.replace(/\[\[([^|\]])([^|\]]*)\|([^\]])([^\]]*)\]\]/g, wp_sk.rLinksame);
//^(.*?)([a-zA-Z\x80-\xff]+)$/sD - z komunikatów (nie działa)
str = str.replace(/\[\[([^|\]]+)\|([^|\]]+)\]\]([a-zA-ZżółęśąźńŻÓŁĘŚĄŹŃ]+)/g, '[[$1|$2$3]]');
// uczłowieczanie szablonów
if(wp_sk.ryzykowne)
{
str = str.replace(/\{\{([^|\n\t{}]+)([^{}]+)\}\}/g, wp_sk.rFriendlyIbox); //podobno niezdebugowane
}
if (wpTextbox == "" || wpTextbox == wb$description )
//
// rozwijanie typowych linków
str = str.replace(/\[\[ang\.\]\]/g, '[[język angielski|ang.]]');
str = str.replace(/\[\[cz\.\]\]/g, '[[język czeski|cz.]]');
str = str.replace(/\[\[fr\.\]\]/g, '[[język francuski|fr.]]');
str = str.replace(/\[\[łac\.\]\]/g, '[[łacina|łac.]]');
str = str.replace(/\[\[niem\.\]\]/g, '[[język niemiecki|niem.]]');
str = str.replace(/\[\[pol\.\]\]/g, '[[język polski|pol.]]');
str = str.replace(/\[\[pl\.\]\]/g, '[[język polski|pol.]]');
str = str.replace(/\[\[ros\.\]\]/g, '[[język rosyjski|ros.]]');
str = str.replace(/\[\[(((G|g)iga|(M|m)ega|(K|k)ilo)herc|[GMk]Hz)\|/g, '[[herc|');
str = str.replace(/\[\[IPA\]\]/g, '[[Międzynarodowy alfabet fonetyczny|IPA]]');
//
// ujednolicanie szablonów z [[Wikiprojekt:Sprzątanie szablonów/redirecty]] 22 XII 2007
str = str.replace(/\{\{([sS]\||)[cC]opyvio(\||\}\})/g, '{{$1NPA$2');
str = str.replace(/\{\{([sS]\||)[dD]oCommons(\||\}\})/g, '{{$1Do Commons$2');
str = str.replace(/\{\{([sS]\||)[dD]oPoszerzenia(\||\}\})/g, '{{$1Do poszerzenia$2');
str = str.replace(/\{\{([sS]\||)[dD]oPracowania(\||\}\})/g, '{{$1Dopracować$2');
str = str.replace(/\{\{([sS]\||)[dD]oWikibooks(\||\}\})/g, '{{$1Do Wikibooks$2');
str = str.replace(/\{\{([sS]\||)[dD]oWikicytatów(\||\}\})/g, '{{$1Do Wikicytatów$2');
str = str.replace(/\{\{([sS]\||)[dD]oWikinews(\||\}\})/g, '{{$1Do Wikinews$2');
str = str.replace(/\{\{([sS]\||)[dD]oWikisłownika(\||\}\})/g, '{{$1Do Wikisłownika$2');
str = str.replace(/\{\{([sS]\||)[dD]oWikiźródeł(\||\}\})/g, '{{$1Do Wikiźródeł$2');
str = str.replace(/\{\{([sS]\||)[dD]z. U.(\||\}\})/g, '{{$1Dziennik Ustaw$2');
str = str.replace(/\{\{([sS]\||)[kK]oordynaty nr(\||\}\})/g, '{{$1Koordynaty$2');
str = str.replace(/\{\{([sS]\||)[mM].P.(\||\}\})/g, '{{$1Monitor Polski$2');
str = str.replace(/\{\{([sS]\||)[mM]erge(\||\}\})/g, '{{$1Integruj$2');
str = str.replace(/\{\{([sS]\||)[nN]CT(\||\}\})/g, '{{$1NowCommons$2');
str = str.replace(/\{\{([sS]\||)[oO]d[nN]owa(\||\}\})/g, '{{$1Od nowa$2');
str = str.replace(/\{\{([sS]\||)[cC]ategoryTOC(\||\}\})/g, '{{$1Spis treści kategoria$2');
str = str.replace(/\{\{([sS]\||)[dD]W(\||\}\})/g, '{{$1Do weryfikacji$2');
str = str.replace(/\{\{([sS]\||)[dD]eklinacja(\||\}\})/g, '{{$1DEC$2');
str = str.replace(/\{\{([sS]\||)[dD]elete(\||\}\})/g, '{{$1Ek$2');
str = str.replace(/\{\{([sS]\||)[dD]oWeryfikacji(\||\}\})/g, '{{$1Do weryfikacji$2');
str = str.replace(/\{\{([sS]\||)[eE]K(\||\}\})/g, '{{$1Ek$2');
str = str.replace(/\{\{([sS]\||)[eE]kspresowe kasowanko(\||\}\})/g, '{{$1Ek$2');
str = str.replace(/\{\{([sS]\||)[lL]Q(\||\}\})/g, '{{$1Słaba jakość$2');
str = str.replace(/\{\{([sS]\||)[nN]PAgraf(\||\}\})/g, '{{$1NPA$2');
str = str.replace(/\{\{([sS]\||)[oO]G(\||\}\})/g, '{{$1OpisujGrafiki$2');
str = str.replace(/\{\{([sS]\||)[pP]oczSDU(\||\}\})/g, '{{$1PoczSdU$2');
str = str.replace(/\{\{([sS]\||)[pP]oczekalnia(\||\}\})/g, '{{$1PoczSdU$2');
str = str.replace(/\{\{([sS]\||)[pP]ektascensja(\||\}\})/g, '{{$1RA$2');
str = str.replace(/\{\{([sS]\||)[sS]DUinfo(\||\}\})/g, '{{$1SDUinformacja$2');
str = str.replace(/\{\{([sS]\||)[sS]DUplus(\||\}\})/g, '{{$1SdUplus$2');
str = str.replace(/\{\{([sS]\||)[sS]d[uU](\||\}\})/g, '{{$1SDU$2');
str = str.replace(/\{\{([sS]\||)[tT]OCmpl(\||\}\})/g, '{{$1Spis treści planetoid$2');
str = str.replace(/\{\{([sS]\||)[tT]estAd(\||\}\})/g, '{{$1Spam$2');
str = str.replace(/\{\{([sS]\||)[tT]estKI(\||\}\})/g, '{{$1TestK$2');
str = str.replace(/\{\{([sS]\||)[tT]estN(\||\}\})/g, '{{$1Test3$2');
str = str.replace(/\{\{([sS]\||)[tT]estNie(\||\}\})/g, '{{$1TestG$2');
str = str.replace(/\{\{([sS]\||)[tT]estSpam(\||\}\})/g, '{{$1Spam$2');
str = str.replace(/\{\{([sS]\||)[tT]estŻ(\||\}\})/g, '{{$1TestG$2');
str = str.replace(/\{\{([sS]\||)[zZ]zW(\||\}\})/g, '{{$1Zgodnie z Wikietykietą$2');
str = str.replace(/\{\{([sS]|[uU]nis)tub2?\}\}/g, '{{Stub}}');
//
// unifikacja
str = str.replace(/[ \n\t]*\n'''?[ ]*(Zobacz|Patrz) (też|także):*[ ]*'''?[ \n\t]*/gi, '\n\n== Zobacz też ==\n');
str = str.replace(/[ \n\t]*\n(=+)[ ]*(Zobacz|Patrz) (też|także):*[ ]*=+[ \n\t]*/gi, '\n\n$1 Zobacz też $1\n');
str = str.replace(/[ \n\t]*\n'''?[ ]*((Zewnętrzn[ey] )?(Linki?|Łącza)( zewnętrzn[ey])?):*[ ]*'''?[ \n\t]*/gi, '\n\n== Linki zewnętrzne ==\n');
str = str.replace(/[ \n\t]*\n(=+)[ ]*((Zewnętrzn[ey] )?(Linki?|Łącza)( zewnętrzn[ey])?):*[ ]*=+[ \n\t]*/gi, '\n\n$1 Linki zewnętrzne $1\n');
//
// poprawkowate różne (kolejność jest istotna!)
str = str.replace(/<sup>1<\/sup>/g, '¹');
str = str.replace(/<sup>2<\/sup>/g, '²');
str = str.replace(/<sup>3<\/sup>/g, '³');
str = str.replace(/<sup>o<\/sup>/g, '°');
str = str.replace(/([0-9]) (%|‰|°)/g, '$1$2');
str = str.replace(/(\[\[[0-9]+ (stycznia|lutego|marca|kwietnia|maja|czerwca|lipca|sierpnia|września|października|grudnia)\]\]), (\[\[[0-9]{4}\]\])/g, '$1 $3');
str = str.replace(/(^|\n)(=+)[ ]*([^=]*[^ =])[ ]*=/g, '$1$2 $3 ='); // =a= > = a =
str = str.replace(/(^|\n)(=+[^=]+=+)[\n]{2,}/g, '$1$2\n');
str = str.replace(/(\n[#\*:]+)([^ \t\n*#:])/g, '$1 $2'); // listy
if(wp_sk.ryzykowne)
{
str = str.replace(/ *<[bB][rR] *[\\/]? *>/g, '<br />');
alert("Opisz zgłaszany błąd.")
//str = str.replace(/(\,\,)([^"”]*)(["”])/g, '„$2”'); //cudzysłowy ,,coś" i "coś" na „coś”
return false;
if(!wp_sk.pytaj || confirm('Czy chcesz usunąć nadmiarowe spacje? Może psuć tekst preformatowany.'))
{
str = str.replace(/ +/g, ' '); // wielokrotne spacje - uwaga na <pre>
str = str.replace(/ +\n/g, '\n');
}
str = str.replace(/\{\{IPA\|\[([^\]\}]+)\]\}\}/g, '[{{IPA|$1}}]'); //{{IPA}}
str = str.replace(/\{\{IPA\|\/([^\]\}]+)\/\}\}/g, '/{{IPA|$1}}/');
str = str.replace(/\{\{IPA\|g\}\}/g, '{{IPA|ɡ}}');
if(!wp_sk.pytaj || confirm('Czy chcesz zastąpić dywizy półpauzami? Może psuć łącza i obrazki.'))
{
str = str.replace(/ - ([^0-9])/g, ' – $1'); //myślnik oznaczamy półpauzą, ale nie między liczbami
str = str.replace(/([^0-9]) - /g, '$1 – ');
}
//str = str.replace(/ /g, '&nbsp;'); //ujawnić twarde spacje
str = str.replace(/&bull;/g, '•'); //a resztę odkodować
str = str.replace(/&dagger;/g, '†');
str = str.replace(/&infin;/g, '∞');
str = str.replace(/&ndash;/g, '–');
str = str.replace(/&plusmn;/g, '±');
str = str.replace(/&rarr;/g, '→');
str = str.replace(/&sum;/g, '∑');
}
str = str.replace(/\{\{[lL]ang\|cz\}\}/g, '{{lang|cs}}');
if (wgUserName != null)
str = str.replace(/\{\{[lL]ang\|dk\}\}/g, '{{lang|da}}');
wpTextbox += '\r\n\r\nZgłosił: ~' +'~'+'~'+'~';
str = str.replace(/(?:\{\{lang\|(\w+)\}\})\s*(?:\{\{lang\|(\w+)\}\})\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\n/g, '{{multilang|$1|$2|$3|$4|$5|$6|$7|$8|$9}}\n');
else
str = str.replace(/(?:\{\{lang\|(\w+)\}\})\s*(?:\{\{lang\|(\w+)\}\})\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?\s*(?:\{\{lang\|(\w+)\}\})?/g, '{{multilang|$1|$2|$3|$4|$5|$6|$7|$8|$9}}');
wpTextbox += '\r\n\r\nZgłosił: '+form.author.value+' ~' +'~'+'~'+'~';
str = str.replace(/\{\{multilang\|([^\}]+?)(\|+)\}\}/g, '{{multilang|$1}}');
//
form.submit.disabled = 'disabled';
// porządkowanie międzywiki, medali i kategorii
//
/* // tworzenie {{DEFAULTSORT:}}
form.wpTextbox1.value = wpTextbox;
z = new Array();
form.wpSummary.value = wpSummary;
y = new Array();
z = str.match(/\[\[Kategoria:[^\]\|]*\|[^\]\|]*\]\]/g);
y = str.match(/\[\[Kategoria:[^\]\|]*\]\]/g);
var x = z.length>0 && y.length==0;
if(x)
{
for(var i=0;i<z.length;i++)
return true;
{
z[i] = z[i].replace(/\[\[Kategoria:[^\]\|]*\|([^\]\|]*)\]\]/g, '$1');
}
for(var i=0;i<z.length-1;i++)
{
x = z[i]==z[i+1]&&x;
}
if(x)
{
str = str.replace(/\[\[Kategoria:([^\]\|]*)\|[^\]\|]*\]\]/g,'[[Kategoria:$1]]');
str = '{{DEFAULTSORT:'+z[0]+'}}'+'\n'+str;
}
}*/
/* z=str.match(/\[\[Kategoria:.*?\|.*?\]\]/g)
for(i=0;i<z.length;i++)
{
z[i]=z[i].replace(/\[\[Kategoria:.*?\|(.*?)\]\]/,'$1')
}
x=true
function wb$popBugBoth(action_page, infoHTML)
for(i=0;i<z.length-1;i++)
{
if(z[i]==z[i+1]&&x) x=true
var glob = document.body;
else x=false
}
if(x)
{
str=str.replace(/\[\[Kategoria:(.*)\|.*\]\]/g,'[[Kategoria:$1]]')
str='{{DEFAULTSORT:'+z[0]+'}}'+'\n'+str
} */
//
// zbiórka i kasowanie
// przysłaniacz
wp_sk.defsort = new Array();
var nel = document.createElement('div');
wp_sk.defsort.i = 0;
nel.id='specpop-globhidden'
str = str.replace(/\{\{DEFAULTSORT:([^\}]+)\}\}/g, function(a, sort){wp_sk.defsort[wp_sk.defsort.i++]=sort; return ''});
nel.style.cssText = 'background:white;filter:alpha(opacity=75);opacity:0.75;position:absolute;left:0px;top:0px;z-index:2000';
nel.style.width = document.documentElement.scrollWidth+'px';
wp_sk.cats = new Array();
nel.style.height= document.documentElement.scrollHeight+'px';
wp_sk.cats.i = 0;
glob.appendChild(nel);
str = str.replace(/\[\[Kategoria:([^\]\[]+)\]\]/g, function(a, cat){wp_sk.cats[wp_sk.cats.i++]=cat; return ''});
wp_sk.iwiki = new Array();
wp_sk.iwiki.i = 0;
// wg: http://meta.wikimedia.org/wiki/List_of_Wikipedias
str = str.replace(/\[\[([a-z\-]{2,3}|simple|ru-sib|be-x-old|zh-yue|map-bms|zh-min-nan|nds-nl|bat-smg|zh-classical|fiu-vro|roa-rup|tokipona|cbk-zam|roa-tara):([^\]\|\[]+)\]\]/g, wp_sk.rGatherIWiki);
wp_sk.iwikifa = new Array();
wp_sk.iwikifa.i = 0;
// wg: http://meta.wikimedia.org/wiki/List_of_Wikipedias
str = str.replace(/\{\{[Ll]ink FA\|([a-z\-]{2,3}|simple|ru-sib|be-x-old|zh-yue|map-bms|zh-min-nan|nds-nl|bat-smg|zh-classical|fiu-vro|roa-rup|tokipona|cbk-zam|roa-tara)\}\}/g, wp_sk.rGatherIWikifa);
//
// usuwanie pozostawionych i przy okazji innych wielokrotnych, pustych linii
// przesunięcie okna
str = str.replace(/[\n]{3,}/g, '\n\n');
window.scroll(0, 150);
//
// wstawienie na koniec
// informacja
str = str.replace(/\s*$/, wp_sk.rOutputCats);
str = str.replace(/\s*$/, wp_sk.rOutputIwikifa);
str = str.replace(/\s*$/, wp_sk.rOutputIwiki);
//
nel = document.createElement('div');
// zapisanie zmian
nel.id='specpop-info'
//
nel.style.cssText = 'font-size:13px;background:white;padding:14px 20px;border:1px solid black;position:absolute;width:600px;min-height:300px;top:200px;z-index:2002;';
if (!isPartSelected)
if (nel.style.maxHeight==undefined) nel.style.height='300px'; // IE blah...
{
var tmp = Math.floor(glob.clientWidth/2)-300;
input.value = str;
if (tmp<5) tmp = 5;
}
nel.style.left = tmp + 'px';
else if (input.selectionStart!=undefined)
nel.innerHTML = infoHTML + '<p><b>Uwaga:</b> Twój adres IP zostanie zapisany w historii zgłoszeń.</p>\
{
<p style="text-align:center;margin-top:15px">\
input.value = input.value.substring(0, sel_s) + str + input.value.substring(sel_e)
<input type="button" value="Przejdź do formularza" onclick="wb$elementsRemove(\'specpop-info\');"/>&nbsp;&nbsp;&nbsp;\
}
<input type="button" value="Anuluj" onclick="wb$elementsRemove(\'specpop-info\',\'specpop-form\',\'specpop-globhidden\',\'specpop-pos\')"/>\
// IE...
</p>';
else if (document.selection)
glob.appendChild(nel);
{
range.text = str;
range.scrollIntoView(false);// at bottom
}
input.focus();
var action_url = window.wgServer + window.wgScript + "?title=" +encodeURIComponent(action_page) + "&action=submit";
wp_sk.warning();
//
}
// formularz
//
nel = document.createElement('div');
// Pomocnicze funkcje do porządkowania
nel.id='specpop-form'
//
nel.style.cssText = 'background:white;padding:5px 10px;border:1px solid black;position:absolute;width:330px;min-height:300px;top:200px;z-index:2001';
wp_sk.rLinkdecode = function(a,name,anchor,end)
if (nel.style.maxHeight==undefined) nel.style.height='300px'; // IE blah...
{
nel.style.left = (Math.floor(glob.clientWidth/2)-165)+'px';
try
//nel.style.top = (this.offsetTop-100)+'px';
{
nel.innerHTML ='<form id="fm1" action="'+action_url+'" method="post" enctype="multipart/form-data" onsubmit="return wb$checkForm(this);">\
name=decodeURIComponent(name)
Nazwa strony:<br /><input type="text" name="wpSummary" id="wpSummary" style="width:320px;" /><br />\
anchor=decodeURIComponent(anchor.replace(/\.([0-9A-F]{2})\.([0-9A-F]{2})/g,'%$1%$2'))
<input type="hidden" name="wpSection" value="new" />\
a='[['+name+anchor+end;
<input type="hidden" name="wpSave" value="Zapisz" />\
}
<input type="hidden" id="Starttime" name="wpStarttime" value="" />\
catch(err){}
<input type="hidden" id="Edittime" name="wpEdittime" value="" />\
<input type="hidden" id="EditToken" name="wpEditToken" value="" />\
<input type="hidden" id="AutoSummary" name="wpAutoSummary" value="" />\
<input type="hidden" name="wpScrolltop" value="0" />\
Treść zgłoszenia:<br /><textarea id="TextBox" name="wpTextbox1" style="width:320px;height:200px" onclick="if (this.value == wb$description) {this.value = \'\';}">' + wb$description + '</textarea><br />\
Podpis:<input type="text" name="author" id="wikibug-input-author" /><br />\
<input type="submit" id="submit" value="Wyślij" /> &nbsp; \
<input type="button" value="Anuluj" onclick="wb$elementsRemove(\'specpop-form\',\'specpop-globhidden\',\'specpop-pos\')" />\
</form>';
glob.appendChild(nel);
document.getElementById('wpSummary').value = wgPageName;
return a.replace(/_/g,' ');
if (wgUserName != null) {
}
var author = document.getElementById("wikibug-input-author");
author.value = '~'+'~'+'~'+'~';
wp_sk.rLinksame = function (a, w1_1,w1_2n, w2_1,w2_2n)
author.disabled = 'disabled';
{
var w1_1_tmp = w1_1.toUpperCase();
var w2_1_tmp = w2_1.toUpperCase();
if (w1_1_tmp==w2_1_tmp && w1_2n==w2_2n)
{
return '[['+w2_1+w2_2n+']]';
}
else
{
return a;
}
wb$getEditToken(action_page);
}
wp_sk.rFriendlyIbox = function (a,nazwa,zaw)
function wb$elementsRemove()
{
if (zaw.indexOf('\n')==-1)
var el;
for (var i=arguments.length-1; i>=0; i--)
{
return a;
el = document.getElementById(arguments[i]);
if (el) el.parentNode.removeChild(el);
}
else
{
return '{{'+nazwa+'\n'+zaw.replace(/\n(.{3,})\|\s*(?=\n)/g, '\n |$1').replace(/\|(\s*)\|(\s*)/, function(a,sp1,sp2) {return (sp1.length+sp2.length>0)?' |':'||'}).replace(/^\n+/, '')+'}}';
}
}
wp_sk.rOutputCats = function (a)
{
var str = '\n';
for (var i=0; i<wp_sk.defsort.i; i++)
{
str += '\n{{DEFAULTSORT:'+wp_sk.defsort[i]+'}}';
}
for (var i=0; i<wp_sk.cats.i; i++)
{
str += '\n[[Kategoria:'+wp_sk.cats[i]+']]';
}
return str;
}
wp_sk.rGatherIWiki = function (a, lang, art)
{
// wg: http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/maintenance/interwiki.sql
if (lang!='wp' && lang!='mw' && lang!='gej' && lang!='ppr' && lang!='rfc' && lang!='uea' && lang!='why')
{
wp_sk.iwiki[wp_sk.iwiki.i] = new Array(lang,art);
wp_sk.iwiki.i++;
return '';
}
else
{
return a;
}
}
wp_sk.rOutputIwiki = function (a)
{
var str = '\n';
wp_sk.iwiki.sort(wp_sk.iwikiComp); // alfabetycznie wg kodu literowego
for (var i=0; i<wp_sk.iwiki.i; i++)
{
str += '\n[['+wp_sk.iwiki[i][0]+':'+wp_sk.iwiki[i][1]+']]';
}
return str;
}
wp_sk.rGatherIWikifa = function (a, lang)
{
// wg: http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/maintenance/interwiki.sql
if (lang!='wp' && lang!='mw' && lang!='gej' && lang!='ppr' && lang!='rfc' && lang!='uea' && lang!='why')
{
wp_sk.iwikifa[wp_sk.iwikifa.i] = lang;
wp_sk.iwikifa.i++;
return '';
}
else
{
return a;
}
}
wp_sk.rOutputIwikifa = function (a)
{
var str = '\n';
wp_sk.iwikifa.sort(wp_sk.iwikiComp); // alfabetycznie wg kodu literowego // tutaj wspólna funkcja wp_sk.iwikiComp
for (var i=0; i<wp_sk.iwikifa.i; i++)
{
str += '\n{{link FA|'+wp_sk.iwikifa[i]+'}}';
}
return str;
}
wp_sk.iwikiComp = function (a, b)
{
if (wp_sk.iwiki_order.indexOf(a[0]) < wp_sk.iwiki_order.indexOf(b[0]))
{
return -1;
}
else if (wp_sk.iwiki_order.indexOf(a[0]) > wp_sk.iwiki_order.indexOf(b[0]))
{
return 1;
}
// else
return 0;
}
wp_sk.iwiki_order = [
'aa', 'af', 'ak', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc',
'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'bm', 'bn',
'zh-min-nan', 'map-bms', 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo',
'bs', 'br', 'bg', 'bxr', 'ca', 'cv', 'ceb', 'cs', 'ch', 'ny',
'sn', 'tum', 'cho', 'co', 'za', 'cy', 'da', 'pdc', 'de', 'dv',
'nv', 'dsb', 'dz', 'mh', 'et', 'el', 'eml', 'en', 'es', 'eo',
'eu', 'ee', 'fa', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv',
'gd', 'gl', 'ki', 'glk', 'gu', 'got', 'zh-classical', 'hak', 'xal', 'ko',
'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo',
'bpy', 'id', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is',
'it', 'he', 'jv', 'kl', 'pam', 'kn', 'kr', 'ka', 'ks', 'csb',
'kk', 'kw', 'rw', 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'kj',
'ku', 'lad', 'lbe', 'lo', 'la', 'lv', 'lb', 'lt', 'lij', 'li',
'ln', 'jbo', 'lg', 'lmo', 'hu', 'mk', 'mg', 'ml', 'mt', 'mi',
'mr', 'mzn', 'ms', 'cdo', 'mo', 'mn', 'mus', 'my', 'nah', 'na',
'fj', 'nl', 'nds-nl', 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'pih',
'no', 'nn', 'nrm', 'nov', 'oc', 'or', 'om', 'ng', 'hz', 'ug',
'uz', 'pa', 'pi', 'pag', 'pap', 'ps', 'km', 'pms', 'nds', 'pl',
'pt', 'crh', 'ty', 'ksh', 'ro', 'rmy', 'rm', 'qu', 'ru', 'se',
'sm', 'sa', 'sg', 'sc', 'sco', 'st', 'tn', 'sq', 'scn', 'si',
'simple', 'sd', 'ss', 'sk', 'cu', 'sl', 'so', 'sr', 'sh', 'stq',
'su', 'fi', 'sv', 'tl', 'ta', 'kab', 'roa-tara', 'tt', 'te', 'tet',
'th', 'vi', 'ti', 'tg', 'tpi', 'to', 'chr', 'chy', 've', 'tr',
'tk', 'tw', 'udm', 'bug', 'uk', 'ur', 'vec', 'vo', 'fiu-vro', 'wa',
'vls', 'war', 'wo', 'wuu', 'ts', 'ii', 'yi', 'yo', 'zh-yue', 'cbk-zam',
'diq', 'zea', 'bat-smg', 'zh'
]
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length;
var from = Number(arguments[1]) || 0;
from = (from < 0) ? Math.ceil(from) : Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this && this[from] === elt)
return from;
}
return -1;
};
}
if(wgAction=='submit' || wgAction=='edit')
{
addOnloadHook(wp_sk.button);
addOnloadHook(wp_sk.button2);
addOnloadHook(wp_sk.button3);
}
/*</pre>*/