User:JodyB/monobook.js

// close afd using newer script

importScript('User:Mr.Z-man/closeAFD2.js');

importScript('User:AzaToth/twinkle.js');

importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');

importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');

importScript('Wikipedia:WikiProject Deletion sorting/delsort.js');

importScript('User:Quarl/util.js');

importScript('User:Quarl/wikipage.js');

/*

WikEd, replaces Firefox's text edit window

  */

// install User:Cacycle/wikEd in-browser text editor

document.write('');

/*

Lupin's anti-vandal tools

  */

// Script from User:Lupin/recent2.js

document.write('');

/*{{User:AndyZ/peerreviewer.js}}*/

/*

Watchlist sorter

 

Sorts your watchlist by namespace, and also adds spaces for readability.

  • /

addOnloadHook(function (){

if (location.href.indexOf('Special:Watchlist') == -1) return; //Are we on a watchlist?

//days = document.getElementById('bodyContent').getElementsByTagName('ul');

days = document.evaluate( //Hell knows how it works - found in "Dive into Greasemonkey"

"//ul[@class='special']",

document,

null,

XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,

null);

for (d = 0; d < days.snapshotLength; d++) { //For each day

day = days.snapshotItem(d);

newday = document.createElement('ul'); //This will replace the old listing

while ((diffs = day.getElementsByTagName('li')).length > 0) { //Are there any diffs left?

//Try to extract the namespace

As = diffs[0].getElementsByTagName('a');

if (As[0].innerHTML == 'diff')

pagename = As[2].innerHTML;

else

pagename = As[1].innerHTML;

if (pagename.indexOf(':') == -1)

namespace = 'Main';

else

namespace = pagename.split(':')[0]; //This will fail for articles which contain ":" in name

hdrs = newday.getElementsByTagName('h5'); //Get the list of namespace headers

hdr = null;

for (j=0; j

if (hdrs[j].innerHTML==namespace) {

hdr = hdrs[j]; break;

}

if (hdr==null) { //Not found? Make a new one!

hdr = document.createElement('h5');

hdr.innerHTML = namespace;

newday.appendChild(hdr);

namespacesub = document.createElement('ul');

newday.appendChild(namespacesub);

}

hdr.nextSibling.appendChild(diffs[0]); //Move the diff

}

newday.appendChild(document.createElement('hr')); //For readablility

day.parentNode.replaceChild(newday,day);

}

});

//First loads

importScript('User:Voice_of_All/Addtabs/monobook.js');

importScript('User:Voice_of_All/UTCclock.js');

importScript('User:Voice_of_All/replacetxt.js');

// mass tools

importScript('User:Voice_of_All/Adminwarnings/monobook.js');

importScript('User:Voice_of_All/Specialadmin/monobook.js');

importScript('User:Voice_of_All/Protection/monobook.js');

importScript('User:Voice_of_All/History/monobook.js');

//CU stuff

importScript('User:Voice_of_All/CheckUser/monobook.js');

//rollback

//importScript('User:Voice_of_All/Revert.js');

//crat stuff

//importScript('User:Voice_of_All/Bureaucrat/monobook.js');

//BAG stuff

//importScript('User:Voice_of_All/Approvals.js');

importScript('User:Voice_of_All/Google/monobook.js')

//importScript('User:Voice_of_All/Sleeper/monobook.js');

importScript('User:Voice_of_All/Deletion/monobook.js');

function addtoolboxlinks()

{

var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];

addlilink(tb, '/wiki/Special:Newpages', 'New pages', '');

addlilink(tb, '/wiki/Special:Log/newusers', 'New users', '');

addlilink(tb, '/wiki/WP:PP', 'Protected pages', '');

}

addOnloadHook( addtoolboxlinks )

window.onload = Main;

function Main()

{

block_check();

}

//END

//************

function block_check()

{

if (document.title.indexOf('Block user') !=0){return;}

//monobook

if (document.getElementById('pt-userpage'))

{var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;}

//cologneblue

else if (document.getElementById('quickbar') && document.getElementById('quickbar').getElementsByTagName('h6')[0])

{

var toplinks = document.getElementById('quickbar');

var user_name = toplinks.innerHTML.split('

My pages
')[1].split('title="User:')[1].split('"')[0];

}

if (document.getElementsByTagName('input')[0].value == user_name)

{alert('Are you sure you want to block yourself?');}

else if (document.getElementsByTagName('input')[0].value == user_name.replace(/ /g,'_'))

{alert('Are you sure you want to block yourself?');}

}

//

Mvaluejs_class = 'DMalak1';

Rvaluejs_class = 'ERollen2';

Uvaluejs_class = 'DRaven2';

//

function XMLrequestprompt()

{

var parameters = '';

var type = 'GET';

var url = location.href;

url = prompt('Enter a URL:');

parse_js_value_cache = 0;

parse_js_value_cache = prompt('Parse the data?' + '\n' + '0 - false (default)' + '\n' + '1 - true (no script/SRCs/images)' + '\n' + '2 - true (no script/SRCs)' + '\n' + '3 - true (script/images allowed)');

if (parse_js_value_cache != 0 && parse_js_value_cache != 1 && parse_js_value_cache != 2 && parse_js_value_cache != 3){return;}

if (!url || url == ''){return;}

makeRequestXML(url, parameters,type);

}

function alertContents()

{

if (http_request.readyState != 4)

return;

body = document.getElementById('bodyContent');

if (body && parse_js_value_cache == 3)

{

document.getElementsByTagName('title')[0].innerHTML = "XML request:";

body.innerHTML = 'XML source return:
' + http_request.responseText;

}

else if (body && parse_js_value_cache == 2)

{

document.getElementsByTagName('title')[0].innerHTML = "XML request:";

var xml = http_request.responseText.replace(/<.script>/gi,'`');

body.innerHTML = 'XML source return:
' + xml.replace(/');

body.innerHTML = 'XML source return:
' + xml.replace(/');

xml = xml.replace(/()/gi,'%parenST|span style="background-color: yellow"|%parenEN$1%parenST|/span|%parenEN').replace(/()/gi,'%parenST|span style="background-color: lightgreen"|%parenEN$1%parenST|/span|%parenEN').replace(/(