Wikireporter:Masti/monobook.js

Z Wikinews, wolnego źródła informacji.

Uwaga: aby zobaczyć zmiany po opublikowaniu, może zajść potrzeba wyczyszczenia pamięci podręcznej przeglądarki.

  • Firefox / Safari: Przytrzymaj Shift podczas klikania Odśwież bieżącą stronę, lub naciśnij klawisze Ctrl+F5, lub Ctrl+R (⌘-R na komputerze Mac)
  • Google Chrome: Naciśnij Ctrl-Shift-R (⌘-Shift-R na komputerze Mac)
  • Internet Explorer / Edge: Przytrzymaj Ctrl, jednocześnie klikając Odśwież, lub naciśnij klawisze Ctrl+F5
  • Opera: Naciśnij klawisze Ctrl+F5.
//
 // Oryginalna wersja [[Wikipedia:Narzędzia/Navigation popups|Popups]]: [[:en:User:Lupin/popups.js]]
 // Proszę zachować powyższe informacje.
 // 
 
 //
 // skrypt z polskim tłumaczeniem i poprawkami drobnymi
 document.write('<script type="text/javascript" src=" \
 http://pl.wikipedia.org/w/index.php?title=Wikipedysta:Nux/popups.pl.js \
 &action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
 //
 // Ustawienia
 popupDelay=1;		// opóźnienie w sekundach
 popupFixRedirs=true;	// naprawianie linków do przekierowań
 popupFixDabs=true;	// naprawianie linków do stron ujednoznaczniających
 popupRevertSummaryPrompt=true; // możliwość zmiany tekstu przy revertowaniu
 popupAdminLinks=true;  // wyświetlanie linków dla adminów (bloki itp.)
 
// Revert tools by Lorian
function getElementsByClass(searchClass,node,tag) {
  // Function from http://www.dustindiaz.com/getelementsbyclass/
  var classElements = new Array();
  if ( node == null )
    node = document;
  if ( tag == null )
    tag = '*';
  var els = node.getElementsByTagName(tag);
  var elsLen = els.length;
  var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
  for (i = 0, j = 0; i < elsLen; i++) {
    if ( pattern.test(els[i].className) ) {
      classElements[j] = els[i];
      j++;
    }
  }
  return classElements;
}
 
// _GET code from NoGray JS Library http://www.nogray.com/new_site/
var _GET = new Array();
var _uri = location.href;
 
var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");
 
var _temp_get_arr_1 = new Array();
 
for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
  _temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
  _GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]);
}
 
delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;
 
function getMessage (where, user1, user2) {
  var message = prompt ('Jaką wiadomość chciałbyś zostawić ?', '');
  window.location = 'http://pl.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message;
}
 
$(function (){
  if (location.href.match(/diff=/)) {
    // Get username of submitter
    var user1h = getElementsByClass('diff-otitle',null,'td'); user1 = user1h[0].getElementsByTagName('a')[2].innerHTML;
   var user2h = getElementsByClass('diff-ntitle',null,'td'); user2 = user2h[0].getElementsByTagName('a')[3].innerHTML;
   if (user2 == 'Dyskusja') {
     user2 = user2h[0].getElementsByTagName('a')[2].innerHTML;
   }
    document.getElementById('contentSub').innerHTML = '(<a href="http://pl.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&revert=1&user1='+user1+'&user2='+user2+'">Revert</a> | <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\', \''+user2+'\');">Powód/Info</a>) (Ostrzeżenia: <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=1">Nonsensy (t2)</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=2">Nowy(t)test</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=3">Obraźliwe(t1)</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=4">spam</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=5">Ost.Ost.(t4)</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=6">P&O.Ost.(tP)</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=7">NieBawSię(tPE)</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=8">testKI</a> | <a href="http://pl.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=9">testżart</a> ';
  } else if (location.href.match(/revert=1/)) {
    document.getElementById('wpSummary').value = 'Przywrócono przedostatnią wersję, jej autor to [[Wikipedysta:'+_GET['user1']+'|'+_GET['user1']+']]. Autor wycofanej edycji to [[Specjalna:Contributions/'+_GET['user2']+'|'+_GET['user2']+']]'; 
    document.getElementById('editform').submit();
  } else if (location.href.match(/revert=2/)) {
    document.getElementById('wpSummary').value = 'Przywrócono przedostatnią wersję, jej autor to  [[Wikipedysta:'+_GET['user1']+'|'+_GET['user1']+']]. Autor wycofanej edycji to [[Specjalna:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] ('+_GET['message']+')';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=1/)) {
    document.editform.wpSummary.value = '[[Wikipedia:Wandalizm|Wandalizm]]';  
    document.getElementById('wpTextbox1').value = '{{sub'+'st:test2}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=2/)) {
    document.editform.wpSummary.value = '[[Wikipedia:Wandalizm|Wandalizm]]';      
    document.getElementById('wpTextbox1').value = '{{sub'+'st:test}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=3/)) {
    document.editform.wpSummary.value = '[[Wikipedia:Wandalizm|Wandalizm]]';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:test1}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=4/)) {
    document.editform.wpSummary.value = 'Link do strony';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:spam}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=5/)) {
    document.editform.wpSummary.value = '[[Wikipedia:Wandalizm|Wandalizm]]';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:test4}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=6/)) {
    document.editform.wpSummary.value = '[[Wikipedia:Wandalizm|Wandalizm]]';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:testP}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=7/)) {
    document.editform.wpSummary.value = '[[Ostrzeżenie]]';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:testPE}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=8/)) {
    document.editform.wpSummary.value = '[[Wikipedia:Wandalizm|Wandalizm]]';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:testKI}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=9/)) {
    document.editform.wpSummary.value = '[[Ostrzeżenie]]';
    document.getElementById('wpTextbox1').value = '{{sub'+'st:testżart}} ~~'+'~~';
    document.getElementById('editform').submit();
  } 
});
 
window.NoSummaryWarningDone = true;
 
// </nowiki>
// </pre>
 
// ---------------------------------------------------------------
// przyciski na stronie usuń
// ---------------------------------------------------------------
 
document.write('<script type="text/javascript" src="http://pl.wikipedia.org/w/index.php?title=Wikipedysta:Beau/usuń.dev.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// ---------------------------------------------------------------
// przyciski na stronie dyskusji
// ---------------------------------------------------------------
 
document.write('<script type="text/javascript" src="http://pl.wikipedia.org/w/index.php?title=Wikipedysta:Beau/dyskusja.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// skrypd pokazujący dynamiczne IP
 // Dołączenie skryptu ze strony: [[Wikipedysta:Beau/ipki.js]]
 document.write('<script type="text/javascript" src="'+
 'http://pl.wikipedia.org/w/index.php?title=Wikipedysta:Beau/ipki.js\
 &action=raw&ctype=text/javascript&dontcountme=s"></script>');