Gebruiker:Kameraad Pjotr/monobook.js

Uit Wikipedia, de vrije encyclopedie

Opmerking: nadat u de wijzigingen hebt gepubliceerd is het wellicht nodig uw browsercache te legen.

  • Firefox / Safari: houd Shift ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5 of Ctrl-R (⌘-Shift-R op een Mac)
  • Google Chrome: druk op Ctrl-Shift-R (⌘-Shift-R op een Mac)
  • Internet Explorer / Edge: houd Ctrl ingedrukt terwijl u op Vernieuwen klikt of druk op Ctrl-F5
  • Opera: druk op Ctrl-F5.
//<pre><nowiki>
/* Version 2.beta.4 

[[Image:Zeus_head_thumb-zanaq.png|left]]

'''Zeusmode''' - by [[User:Zanaq|Zanaq]] - is an extensive elaboration of Sam Hocevar's godmode-light script and some other [[Wikipedia:WikiProject_User_scripts/Scripts|scripts]]. It has been tested with [[Mozilla]] and [[Mozilla Firefox]]. Some functionality is retained when using [[Internet Explorer]].
*/

//<pre><nowiki>

// ZeusMode 2.beta - SETTINGS - [[Image:Zeus_head_thumb-zanaq.png]]
  zmver=0.041;
  isSysop=true;
  zmUseQuickTemplate=true;
      zmUseLocalTemplates=false;
      zmUseCustomTemplates=true;
      zmCustomTemplateLocation="User:Kameraad_Pjotr/nl-templates.js";
  zmUseRevert=true;
      zmUsePlace=true;
      zmUseUndo=true;
      zmUseRollback=false;
    zmUseWatchlist=true;
      zmUseSinceLinks=true;
      zmUseSinceTab=true;
      zmUseLastTab=true;
    zmUseNewPages=true;
      zmUseMarkPatrolled=true;
    zmUseMisc=true;
      zmUseBlockRequest=false;
      zmRecentChangesLink=true;
      zmRecentChangesDefault="?hidepatrolled=1&hideliu=1&limit=500";
      zmUseUserListLinks=true;
// ---  END OF ZEUSMODE SETTINGS


document.write('<scr'+'ipt type="text/javascript"'
  + 'src="http://nl.wikipedia.org/w/index.php?title=Gebruiker:Zanaq/Zeusmode/zm.js'
  + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'+'ipt>');

//</nowiki></pre>



// [[Gebruiker:Kameraad Pjotr/AVT/recent2.js]] ([[:en:User:Lupin/recent2.js]])
document.write('<script type="text/javascript" src="' 
             + 'http://nl.wikipedia.org/w/index.php?title=Gebruiker:Kameraad_Pjotr/AVT/recent2.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// Add the functions to the onload event
// OnloadHook
$( function ()
{
	// Block
	if (document.location.href.indexOf('title=Speciaal:BlokkeerIp') != -1 && document.location.href.indexOf('confirmblock') != -1)
	{
		document.getElementById('blockip').wpBlock.click();
	}

	// Unblock
	if (document.location.href.indexOf('title=Speciaal:IpBlokkeerlijst&action=unblock') != -1 && document.location.href.indexOf('confirmblock') != -1)
	{
		document.getElementById('unblockip').wpBlock.click();
	}
})

// Based on http://nl.wikipedia.org/wiki/Gebruiker:Valhallasw/hennading.js
// Which is (C) 2006 by Merlijn 'valhallasw' van Deen

// Add the functions to the onload event
// OnloadHook
var token = 0;
var blockreason = '';
var unblockreason = '';
var expiry = '';
var wpAnonOnly = 1;
var wpCreateAccount = 1;
var wpEnableAutoblock = 1;
var users;
var unblock = 0;
var r = 0;
var xhrq = new XMLHttpRequest;

var waitimage = '<a href="http://commons.wikimedia.org/wiki/Image:Symbol_wait.svg" class="image" title=""><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Symbol_wait.svg/25px-Symbol_wait.svg.png" alt="" width="25" height="26" longdesc="/wiki/Afbeelding:Symbol_wait.svg" />';
var okimage = '<a href="http://commons.wikimedia.org/wiki/Image:Symbol_wait.svg" class="image" title=""><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/94/Symbol_support_vote.svg/25px-Symbol_support_vote.svg.png" alt="" width="25" height="26" longdesc="/wiki/Afbeelding:Symbol_support_vote.svg" /></a>';
var badimage = '<a href="http://commons.wikimedia.org/wiki/Image:Symbol_wait.svg" class="image" title=""><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Symbol_oppose_vote.svg/25px-Symbol_oppose_vote.svg.png" alt="" width="25" height="26" longdesc="/wiki/Afbeelding:Symbol_oppose_vote.svg" /></a>';
var loadingimage = '<a href="http://commons.wikimedia.org/wiki/Image:Symbol_wait.svg" class="image" title=""><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Symbol_merge_vote.svg/25px-Symbol_merge_vote.svg.png" alt="" width="25" height="26" longdesc="/wiki/Afbeelding:Symbol_merge_vote.svg" /></a>';

function getVariables()
{
	bmlocation = location.search;
	l = bmlocation.substring(1).split('&');
	for (i = 0; i < l.length; i++)
	{
		var n = l[i].indexOf('=');
		var name = l[i].substring(0, n);
		if (name == 'wpBlockReason'){
			blockreason = unescape(l[i].substring(n + 1));
		} else if (name == 'wpUnblockReason'){
			unockreason = unescape(l[i].substring(n + 1));
		} else if (name == 'wpBlockOther'){
			expiry = l[i].substring(n + 1).replace(/\+/,'+');
		} else if (name == 'wpAnonOnly'){
			wpAnonOnly = l[i].substring(n + 1);
		} else if (name == 'wpCreateAccount'){
			wpCreateAccount = l[i].substring(n + 1);
		} else if (name == 'wpEnableAutoblock'){
			wpEnableAutoblock = l[i].substring(n + 1);
		} else if (name == 'unblock'){
			unblock = l[i].substring(n + 1);
		} else if (name == 'users'){
			users = unescape(l[i].substring(n + 1)).split('|');
		}
	}
}

function rsc()
{
	xhrqresult = document.getElementById('xhrqresult');
	xhrqresult.innerHTML = 'Retreived edit token';
	result = xhrq.responseXML;
	token = result.getElementsByTagName('input')[7].value;
	blockUsers();
}

function brsc()
{
	if (xhrq.readyState != 4){
		return;
	}
  
	document.getElementById(users[r]).getElementsByTagName("td")[2].innerHTML = xhrq.status + "/" + xhrq.statusText;
  	
	try {
		if (xhrq.status != 200 || xhrq.responseText.indexOf("<p class='error'>") != -1) {
			document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = badimage;
			document.getElementById(users[r]).getElementsByTagName("td")[3].innerHTML = '<b>Fout</b> - <a href="http://nl.wikipedia.org/w/index.php?title=Speciaal:BlokkeerIp&ip=' + users[r] + '&wpBlockExpiry=other&wpBlockOther=' + expiry + '&wpBlockReasonList=other&wpBlockReason=' + blockreason + '&wpAnonOnly=' + wpAnonOnly + '&wpCreateAccount=' + wpCreateAccount + '&wpEnableAutoblock=' + wpEnableAutoblock + '&confirmblock">Blokkeer gebruiker</a>';
    	} else {
			document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = okimage;
      		document.getElementById(users[r]).getElementsByTagName("td")[3].innerHTML = 'OK';
		}
	} catch (e) {
		document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = badimage;
	}
	r++;
	dorunloop()
}

function ursc()
{
	if (xhrq.readyState != 4){
		return;
	}
  
	document.getElementById(users[r]).getElementsByTagName("td")[2].innerHTML = xhrq.status + "/" + xhrq.statusText;
  	
	try {
		if (xhrq.status != 200 || xhrq.responseText.indexOf('<span class="error">') != -1) {
			document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = badimage;
			document.getElementById(users[r]).getElementsByTagName("td")[3].innerHTML = '<b>Fout</b> - <a href="http://nl.wikipedia.org/w/index.php?title=Speciaal:IpBlokkeerlijst&action=unblock&ip='+users[r]+'&wpUnblockReason='+unblockreason+'&confirmblock">Deblokkeer gebruiker</a>';
    	} else {
			document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = okimage;
      		document.getElementById(users[r]).getElementsByTagName("td")[3].innerHTML = 'OK';
		}
	} catch (e) {
		document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = badimage;
	}
	r++;
	dorunloop()
}

function getEditToken()
{
	xhrq = new XMLHttpRequest;
	xhrq.open("GET", "http://"+location.host+"/w/index.php?title=Speciaal:BlokkeerIp", true);
	try
	{
		xhrq.overrideMimeType('text/xml');
	}
	catch (e)
	{
		//xhrq.overridemimetype niet ondersteund
	}
	xhrq.onreadystatechange = rsc;		
	xhrq.send(null);
}

function blockUsers()
{
	getVariables();
	if (unblock == 1){
		title = '<h3>De gebruikers worden gedeblokkeerd...</h3>';
	} else {
		title = '<h3>De gebruikers worden geblokkeerd...</h3>';
	}
    ihtml = title + "<table class='prettytable' id='blocktable'><tr><th></th><th>User</th><th>HTTP response</th><th>Block response</th><th>Block log</th></tr>";
	for (var i = 0; i < users.length; ++i) {
		ihtml = ihtml + "<tr class='blockuser' id='"+users[i]+"'><td>"+waitimage+"</td><td><a href='http://nl.wikipedia.org/wiki/Gebruiker:"+users[i]+"'>"+users[i]+"</a></td><td></td><td></td><td><a href='http://nl.wikipedia.org/w/index.php?title=Speciaal:Log&type=block&page=Gebruiker:"+users[i]+"'>Blokkeerlogboek</a></td></tr>";
	}
	xhrqresult.innerHTML = ihtml + '</table>';

	dorunloop();
}

function dorunloop() {
  //alert("drl");
  if (r < users.length) {
    document.getElementById(users[r]).getElementsByTagName("td")[0].innerHTML = loadingimage;
	if (unblock == 1){
		unblockUser(users[r]);
	} else {
		blockUser(users[r]);
	}
  }
}

function blockUser(user)
{
	postdata = 'wpBlockAddress=' + user + '&wpBlockExpiry=other&wpBlockOther=' + expiry + '&wpBlockReasonList=other&wpBlockReason=' + blockreason + '&wpAnonOnly=' + wpAnonOnly + '&wpCreateAccount=' + wpCreateAccount + '&wpEnableAutoblock=' + wpEnableAutoblock + '&wpBlock=Blokkeer+deze+gebruiker&wpEditToken=' + escape(token);

	xhrq = new XMLHttpRequest;
	xhrq.open("POST", "http://"+location.host+"/w/index.php?title=Speciaal:BlokkeerIp&action=submit", true);
	xhrq.onreadystatechange = brsc;
	xhrq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xhrq.send(postdata);
}


function unblockUser(user)
{
	postdata = 'wpUnblockAddress=' + user + '&wpUnblockReason=' + unblockreason + '&wpBlock=Blokkering+van+deze+gebruiker+opheffen.&wpEditToken=' + escape(token);

	xhrq = new XMLHttpRequest;
	xhrq.open("POST", "http://"+location.host+"/w/index.php?title=Speciaal:IpBlokkeerlijst&action=submit", true);
	xhrq.onreadystatechange = ursc;
	xhrq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xhrq.send(postdata);
}

$( function ()
{
	if (document.location.href.indexOf('title=Gebruiker:Erwin85/blockmsg') != -1)
	{
		getEditToken();
	}
})

//document.write('<script type="text/javascript" //src="/w/index.php?title=Gebruiker:Kameraad_Pjotr/Deletescript.js&action=raw&ctype=text/javascript"><\/script>')
document.write('<script type="text/javascript" src="'
+ 'http://nl.wikipedia.org/w/index.php?title=Gebruiker:Valhallasw/hennading.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

importScript('Gebruiker:Kameraad_Pjotr/qpreview.js');

importScript('Gebruiker:Kameraad Pjotr/imagedelete.js');

/*
document.write('<scr'+'ipt type="text/javascript"'
  + 'src="http://nl.wikipedia.org/w/index.php?title=Gebruiker:Kameraad_Pjotr/avw.js'
  + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'+'ipt>');
*/
//</nowiki></pre>

//Nieuweartikelenscript
//------------------------------------------------------------------------------------
// Provide links to hide all pages by an editor in Special:Newpages
// By [[User:Zanaq]] - 3 april 2006 - released under GPL: please include this line
//-------------------------------------------------------------------------------------

txtHideLink = 'verberg';

function hideEdits(editor)
{

   newpages=document.getElementById('bodyContent').getElementsByTagName('li');


   for (i=0;i<newpages.length;i++)
   {
      editorName=newpages[i].getElementsByTagName('a')[3].innerHTML;

      if (editorName == editor)
         newpages[i].style.display='none';
   }

}



function addHideLinks()
{
   newpages=document.getElementById('bodyContent').getElementsByTagName('li');

   for (i=0;i<newpages.length;i++)
   {
      editorLink=newpages[i].getElementsByTagName('a')[2];
      var hideLink = document.createElement('span');

      hideLink.innerHTML='<a href="javascript:hideEdits(\'' + editorLink.innerHTML+ '\')">(' + txtHideLink + ')</a> - ';

      newpages[i].insertBefore(hideLink, editorLink);

      if ((i % 50) == 0) akeytt();

   }
   akeytt();
}

if (wgCanonicalSpecialPageName == "Newpages") {
      window.addEventListener ('DOMContentLoaded',addHideLinks,false);
}

/*Highlightredirects*/
importScript('Gebruiker:Kameraad Pjotr/monobook.js/highlightredirect.js');