User:Steel359/VoA.js

// Basically just the "revert all" and "compare" functions (a couple of other minor bits too) from User:Voice of All/Specialadmin/monobook.js

//

var cvrollbacklink=' Reverting... ';

///////LOAD-BALANCING/////// MAX_THREADS = 3; THREADS = 0; TASK_INDEX = 0; //the index of the  element to start with when continuing NEXT_INDEX = 0; // an array of window references OPERATIONS = new Array;

//tells how many windows can be opened function CheckRunningThreads { THREADS=0; var start = OPERATIONS.length - MAX_THREADS; if ( start < 0 ) start = 0; for (i=start; i < OPERATIONS.length; i++) {    if (OPERATIONS[i].closed==false) THREADS+=1; } OPEN_THREADS = MAX_THREADS - THREADS; return OPEN_THREADS; }

function isLoadReady(callback) { OPEN_THREADS = CheckRunningThreads; if (OPEN_THREADS > 0) { // call the function if ready callback; } else { // try again setTimeout("window.isLoadReady(" + callback + ")",1000); } }

// keep checking if new THREAD slots open up function loadWhenReady(callback) { setTimeout("window.isLoadReady(" + callback + ")",1000); } ///////

function checkall { if (document.getElementById('bodyContent')) {form = document.getElementById('bodyContent');} else if (document.getElementById('quickbar')) {form = document.getElementById('content');} l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) {   if (l[i].type == 'checkbox') {l[i].value = '1'; l[i].checked=true;} } } //END

//MASTER rollback function addmasterroll { if (location.href.indexOf(':Contributions') != -1 || location.href.indexOf('&title=Special%3AContribution') != -1 && location.href.search(/\d{1,3}(@|%40)\d{1,2}/) == -1) {    addTab("javascript:masterroll", "revert all edits", "ca-massroll", "Rollback user's top edits", ""); document.getElementById('ca-massroll').firstChild.innerHTML = 'rollback all'; } else if (location.href.indexOf(':Contributions') != -1 || location.href.indexOf('&title=Special%3AContribution') != -1 && location.href.search(/\d{1,3}(@|%40)\d{1,2}/) != -1) {    addTab("javascript:masterroll", "revert all edits", "ca-massroll", "Rollback top edits", ""); document.getElementById('ca-massroll').firstChild.innerHTML = 'rollback all'; } else if (document.title.indexOf('View and restore deleted pages') != -1 && location.href.search(/&timestamp=|&action=submit/) ==-1) {   addTab("javascript:checkall", "Select all", "ca-checkall", "Check all deleted revisions", ""); } }

//////////////Auto-actions////////////// function winclosed { //monobook if (document.getElementById('bodyContent')) {var body = document.getElementById('bodyContent');} //cologneblue else if (document.getElementById('quickbar')) { if (!document.getElementById('content')){return;} var body = document.getElementById('content'); } //for master rollback for moves if (location.href.indexOf('&fakaction=masterfill') != -1 && document.title.indexOf('Move page') != -1) {   document.getElementById('wpReason').value = 'Automated revert of mass page moving.'; document.getElementById('movepage').submit; } //for master rollback for image uploads else if (document.title.indexOf('Image:')==0 && location.href.indexOf('&jsaction=ImagevandalRV&target=') !=-1) { var bad_user = unescape(location.href.split('&target=')[1].split('&')[0]); var reason = location.href.split('&reason=')[1].split('&')[0]; var history_num = 1; var uls = body.getElementsByTagName('ul'); for (h=0; h' + bad_user + '' + bad_user + ' (') == -1)         {        var RV_linkURL = history[i].getElementsByTagName('a')[1].href;        Delete = 0;        if (RV_linkURL.indexOf('&wpEditToken=') ==-1){alert('Parsing error!'); return;}        document.getElementById('contentSub').innerHTML = ' Reverting: ' + RV_linkURL + ' .';        location.href = RV_linkURL;        break;         }    } //if user is the only contibutor   if (Delete == 1)    {    var Delete_AllURL = history[0].getElementsByTagName('a')[0].href;    if (Delete_AllURL.indexOf('&action=delete') ==-1){alert('Parsing error!'); return;}    Delete_AllURL += '&jsaction=imagenuke&reason=' + reason;    document.getElementById('contentSub').innerHTML = ' Deleting: ' + Delete_AllURL + ' .'; location.href = Delete_AllURL; } } //for master rollback for images, last step else if (document.title.indexOf('Confirm delete')==0 && location.href.indexOf('&action=delete&jsaction=imagenuke&reason=') !=-1) { var reason = unescape(location.href.split('&reason=')[1].split('&')[0]); document.getElementById('wpReason').value = reason; var form = document.getElementById('deleteconfirm'); form.submit; } //for master delete for page creations else if (document.title.indexOf('Confirm delete')==0 && location.href.indexOf('&action=delete&jsaction=nuke') !=-1) { var reason = unescape(location.href.split('&reason=')[1].split('&')[0]); document.getElementById('wpReason').value = reason; var form = document.getElementById('deleteconfirm'); form.submit; } else if (document.title.indexOf('Confirm delete')==0 && location.href.indexOf('&jsaction=RollbackDelete') !=-1) { if (document.getElementById('wpReason').value.length < 1) {document.getElementById('wpReason').value = 'Deleted test or vandalism page with only one contributor.';} var form = document.getElementById('deleteconfirm'); var message = 'Do you want to delete this page since it has only one author?'; var return_value = confirm(message); if (return_value == true) form.submit; } // if vandal is only author, redirect to delete else if (document.title.indexOf('Rollback failed') == 0 && document.innerHTML.indexOf(' last contributor is the only author of this page') != -1) { var article = location.href.split('?title=')[1].split('&action')[0]; location.href = wgServer + '/w/index.php?title=' + article + '&action=delete&jsaction=RollbackDelete'; } // delinking images else if (location.href.indexOf('&jsaction=delinkimg&jstarget=') !=-1) { var image = unescape(location.href.split('&jstarget=')[1].split('&')[0]); var txtbox = document.editform.wpTextbox1; txtbox.value = txtbox.value.replace( new RegExp( toRegExp(image), 'gi' ), '' ); document.editform.wpSummary.value = 'Removing link to deleted image ' + image + '.'; document.editform.submit; } } //////////////

//////////////

function jswin_close { //close JS action inputs if (document.title.search(/Action complete|Internal error/) ==0) { setTimeout('window.close',1000); } //close JS action inputs else if (document.title.indexOf('Move page')==0) { if (document.getElementById('contentSub').innerHTML == 'Move succeeded') {setTimeout('window.close',1000);} } //close JS launched rollbacks else if (location.href.search(/&action=rollback.+&jsaction=close/) !=-1) { window.close; } }

GL_MRV_REASON=''; ///////REVERT ALL EDITS///////

Rvaluejs_class = wgUserName;

//UI entry point function masterroll { if (!document.getElementsByTagName('ul')[0]) {alert('No edits found.'); return;} z=0; var oldloc = location.href; var message = "Are you sure you want to revert all top edits shown on this page by this user? Use this only to revert a large wave of vandalism by a single user or IP address." + "\n" + "To control how many edits this will revert, please set the number of articles on the list before performing this operation. You may also want to change the offset as well." + "\n" + "Close all other programs if there is a large number of edits to be reverted, otherwise, this may cause memory problems. Press OK to continue."; var return_value = confirm(message); if (return_value == true) {  var js_con_class = prompt("Secondary confirmation:" + "\n" + "All top edits by this user will be reverted!" + "\n" + "Confirm type:"); if (js_con_class == Rvaluejs_class) {     document.getElementById('contentSub').innerHTML = " All of the user's top edits are being reverted. This page will be refreshed automatically in 20 seconds ."; doMasterRollback; }     else {     return; }  }   else {  return; } }

function doMasterRollback { var l = document.getElementsByTagName('ul')[0].getElementsByTagName('li'); for (var i=NEXT_INDEX; i < l.length; i++) {   if (i == l.length-1){setTimeout("window.location.reload",20000);} var t = l[i].innerHTML; // look only at top edits if (t.indexOf(' (') != -1)   	{    	var article = l[i].getElementsByTagName('a')[0].href.split('&')[0].split('title=')[1].replace(/[^\/]*\/\/[^\/]*/, '');        var li_a = l[i].getElementsByTagName('a');        for (k=3; k < li_a.length; k++)          	{        	// look for rollback link        	if (l[i].getElementsByTagName('a')[k].href.indexOf('&action=rollback') !=-1)           		{				var URL = l[i].getElementsByTagName('a')[k].href + '&jsaction=close';				l[i].innerHTML += ' (' + cvrollbacklink + ')';				OPERATIONS[TASK_INDEX] = window.open(URL,'Masterroll:' + article,'height=300,width=800,resizeable=yes,scrollbars=yes');        		TASK_INDEX+=1; NEXT_INDEX=i+1;        		THREADS+=1;        		if (THREADS >= MAX_THREADS) {loadWhenReady(doMasterRollback); return;}				break;          		}         	}        }    } } ///////

////////////Wikipedia:WikiProject User scripts/Scripts/RBL check//////////// // This script adds an "RBL check" link to the toolbox on IP user/talk/contribs pages.

addOnloadHook(function {    var href = document.getElementById('t-contributions');    if (href) href = href.getElementsByTagName('a');    if (href) href = href[0];    if (href) href = href.href;    else href = window.location.href;

var addr = /(\/wiki\/|[?&]title=)Special:Contributions(\/([^\/?&#]*)|[?&#]|$)/.exec(href); if (!addr) return; addr = addr[3]; if (!addr) { addr = /^[^?#]*\?([^&#]*&)*target=([^&#]*)/.exec(href); if (!addr) return; addr = addr[2]; }   if (!/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/.test(addr)) return;

addLink('p-tb', 'http://www.robtex.com/rbls/'+addr+'.html', 'RBL check', 't-rblcheck', 'Multi-RBL check', null, 't-contributions'); }); ////////////

/////////////////////////////////IP range contribs check/////////////////////////////////

function IPRange_contribs_tab { if (location.href.search(/Special(:|%3A)Contributions/) != -1 && location.href.search(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) != -1 && location.href.search(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/(16|24)/) == -1) { addTab(location.href + '/24', "/24 Range", "ca-range", "Check a medium or small IP range", ""); addTab(location.href + '/16', "/16 Range", "ca-range2", "Monitor a large IP range", ""); } } ////////////

////////////////////Compare contribs//////////////////// function Compare_tab_add { if (document.title.indexOf('User contributions') == 0 && location.href.search(/\d{1,3}(@|%40)\d{1,2}/) == -1) {addTab("javascript:compare_contribs", "Compare", "ca-comp", "Compare", "");} }

//globals username_contribs_comp = ''; username_contribs_comp2 = ''; // function compare_contribs { username_contribs_comp2 = prompt('Compare with who?' + '\n' + '*for last 2000 edits' + '\n' + '*selected namespace' + '\n' + '*for last 15 (un)blocks'); if (!username_contribs_comp2){return;} username_contribs_comp = document.getElementById('contentSub').getElementsByTagName('a')[0].innerHTML; if (username_contribs_comp == 'Talk' && location.href.indexOf('&target=') != -1) {username_contribs_comp = location.href.split('&target=')[1].split('&')[0];} else if (username_contribs_comp == 'Talk' && location.href.indexOf('/Special:Contributions/') != -1) {username_contribs_comp = location.href.split('/Special:Contributions/')[1];} if (username_contribs_comp == username_contribs_comp2){alert('Cannot compare a user with his/herself!'); return;} document.getElementById('contentSub').innerHTML += " Requesting block log and contribs XML for users... "; var namespace = ''; //get namespace if (document.getElementById('namespace')) {   var inputs = document.getElementById('namespace').getElementsByTagName('option'); for (i=0; i<inputs.length; i++) {      if (inputs[i].selected==true) {var namespace = '&namespace=' + inputs[i].value; break;} }   } //  var URL = '/w/index.php?title=Special:Contributions&target=' + username_contribs_comp + namespace + '&limit=2000&useksin=none'; xml_http = HTTPClient; xml_http.open("GET", URL, true); xml_http.onreadystatechange = parse_xml_contribs2; xml_http.send(null); }

function parse_xml_contribs2 { if (xml_http.readyState != 4) {return;} doc1_xml_contribs_xml = xml_http.responseText; var namespace = ''; //get namespace if (document.getElementById('namespace')) {   var inputs = document.getElementById('namespace').getElementsByTagName('option'); for (i=0; i<inputs.length; i++) {      if (inputs[i].selected==true) {var namespace = '&namespace=' + inputs[i].value; break;} }   } //  var URL = '/w/index.php?title=Special:Contributions&target=' + username_contribs_comp2 + namespace + '&limit=2000&useksin=none'; xml_http = HTTPClient; xml_http.open("GET", URL, true); xml_http.onreadystatechange = parse_xml_comparecontribs_log; xml_http.send(null); }

function compare_contribs_range { username_contribs_comp2 = prompt('Compare with who?' + '\n' + '*for last 2000 edits' + '\n' + '*current namespace'); if (!username_contribs_comp2){return;} username_contribs_comp = 'Selected IP range'; document.getElementById('contentSub').innerHTML += " Requesting contribs XML for other user... "; var namespace = ''; if (location.href.search(/&namespace=\d/) != -1) {var namespace = location.href.match(/&namespace=\d/)[0];} var URL = '/w/index.php?title=Special:Contributions&target=' + username_contribs_comp2 + namespace + '&limit=2000&useksin=none'; xml_http = HTTPClient; xml_http.open("GET", URL, true); xml_http.onreadystatechange = parse_xml_contribs_range; xml_http.send(null); }

//cache doc_js_ipcontribs_range_cache = ''; // function parse_xml_contribs_range { if (xml_http.readyState != 4) {return;} //monobook if (document.getElementById('bodyContent')) { var body = document.getElementById('bodyContent'); } //cologneblue else if (document.getElementById('quickbar')) { if (!document.getElementById('content')){return;} var body = document.getElementById('content'); } document.getElementById('contentSub').innerHTML += " Parsing contribs XML for other user... "; xml = xml_http.responseText; var doc2 = standard_XMLParse(xml); if (doc_js_ipcontribs_range_cache == '') { doc_js_ipcontribs_range_cache = body.innerHTML; } else {body.innerHTML = doc_js_ipcontribs_range_cache;} var doc1 = body; //check for any contribs if (doc1.getElementsByTagName('li')[0] == undefined) {document.getElementById('contentSub').innerHTML += " Note: One of these users has no contributions in this namespace! "; return;} else if (doc2.getElementById('bodyContent').getElementsByTagName('li')[0] == undefined) {document.getElementById('contentSub').innerHTML += " Note: One of these users has no contributions in this namespace! "; return;} // var l = doc1.getElementsByTagName('li'); var name_list = '||'; var list_common = '||'; for (i=0; i<l.length; i++) {   if (l[i].getElementsByTagName('a')[2] != undefined) {   var name = l[i].getElementsByTagName('a')[2].innerHTML; name_list += name + '||'; } }  if (doc2.getElementsByTagName('ul')[0] != undefined) { var h = doc2.getElementById('bodyContent').getElementsByTagName('ul')[0].getElementsByTagName('li'); for (i=0; i<h.length; i++) {    var name = h[i].getElementsByTagName('a')[2].innerHTML; if (name_list.indexOf('||' + name + '||') != -1 && list_common.indexOf('||' + name + '||') == -1) {list_common += name + '||';} } } //  if (list_common == '||' || doc2.getElementsByTagName('ul')[0] == undefined) { document.getElementById('contentSub').innerHTML += " Done: comparison between edits by " + username_contribs_comp + " and " + username_contribs_comp2 + " finished. (no matches) "; var uls = body.getElementsByTagName('ul'); for (i=0; i' + pgname + ''; txt_add += " Page: " + pglink + " " + username_contribs_comp2 + "  "; for (k=0; k' + h[k].innerHTML + '';} }  txt_add += " " + username_contribs_comp + "  "; for (k=0; k' + l[k].innerHTML + '';} }     }      txt_add += '' } // document.getElementById('contentSub').innerHTML += " Done: comparison between edits by " + username_contribs_comp + " and " + username_contribs_comp2 + " finished. "; body.getElementsByTagName('ul')[0].innerHTML = ''; var uls = body.getElementsByTagName('ul'); for (i=0; i<uls.length; i++) {uls[i].innerHTML = '';} var ps = body.getElementsByTagName('p'); for (i=1; i<ps.length; i++) {ps[i].innerHTML = '';} body.innerHTML += txt_add; edits_page_compared_js = 1; addTab("javascript:date_highlight", "date", "ca-datem", "Highlight a date", ""); body.ranSetupTooltipsAlready=false; setupTooltips(body); }

function contribs_reset { //monobook if (document.getElementById('bodyContent')) { var body = document.getElementById('bodyContent'); } //cologneblue else if (document.getElementById('quickbar')) { if (!document.getElementById('content')){return;} var body = document.getElementById('content'); } if (doc_js_ipcontribs_range_cache == '') { doc_js_ipcontribs_range_cache = body.innerHTML; } else {body.innerHTML = doc_js_ipcontribs_range_cache;} body.ranSetupTooltipsAlready=false; setupTooltips(body); }

function parse_xml_comparecontribs_log { if (xml_http.readyState != 4) {return;} doc2_xml_contribs_xml = xml_http.responseText; var namespace = ''; if (location.href.indexOf('&namespace=') !=-1) {namespace = location.href.split('&namespace=')[1].split('&')[0];} URL = '/w/index.php?title=Special:Log&type=block&limit=15&page=User%3A' + username_contribs_comp + '&useskin=none'; xml_http = HTTPClient; xml_http.open("GET", URL, true); xml_http.onreadystatechange = parse_xml_comparecontribs_log2; xml_http.send(null); }

function parse_xml_comparecontribs_log2 { if (xml_http.readyState != 4) {return;} doc1_xml_log_xml = xml_http.responseText; URL = '/w/index.php?title=Special:Log&type=block&limit=15&page=User%3A' + username_contribs_comp2 + '&useskin=none'; xml_http = HTTPClient; xml_http.open("GET", URL, true); xml_http.onreadystatechange = parse_xml_comparecontribs; xml_http.send(null); }

function parse_xml_comparecontribs { if (xml_http.readyState != 4) {return;} //monobook if (document.getElementById('bodyContent')) { var body = document.getElementById('bodyContent'); } //cologneblue else if (document.getElementById('quickbar')) { if (!document.getElementById('content')){return;} var body = document.getElementById('content'); } document.getElementById('contentSub').innerHTML += " Parsing block log and contribs XML for users... "; doc2_xml_log_xml = xml_http.responseText; var user1block_count = 0; var user2block_count = 0; var user1edit_count = 0; var user2edit_count = 0; // var txt_add = ''; if (doc1_xml_log_xml.indexOf('') != -1 || doc2_xml_log_xml.indexOf('') != -1) { txt_add += ' '; txt_add += " Block log (last 20): "; } // if (doc2_xml_log_xml.indexOf('<ul>') != -1) { user2block_ul = '<ul>' + doc2_xml_log_xml.split('<ul>')[1].split('</ul>')[0] + '</ul>'; user2block_count = user2block_ul.split('</a>) blocked "<a').length - 1; txt_add += " " + username_contribs_comp2 + "  ";  txt_add += user2block_ul;  }  if (doc1_xml_log_xml.indexOf('<ul>') != -1)  {  user1block_ul = '<ul>' + doc1_xml_log_xml.split('<ul>')[1].split('</ul>')[0] + '</ul>';  user1block_count = user1block_ul.split('</a>) blocked "<a').length - 1; txt_add += " " + username_contribs_comp + " <ul>"; txt_add += user1block_ul; } if (doc1_xml_log_xml.indexOf('<ul>') != -1 || doc2_xml_log_xml.indexOf('<ul>') != -1) { txt_add += ' <br style="clear:both;">'; } // txt_add += ' '; txt_add += " Pages edited in common by " + username_contribs_comp + " and " + username_contribs_comp2 + " : "; // if (doc1_xml_contribs_xml.indexOf('<ul>') != -1) {user1edit_count = doc1_xml_contribs_xml.split('<ul>')[1].split('</ul>')[0].split('<li>').length - 1;} if (doc2_xml_contribs_xml.indexOf('<ul>') != -1) {user2edit_count = doc2_xml_contribs_xml.split('<ul>')[1].split('</ul>')[0].split('<li>').length - 1;} // var blocklink = '<a href = "/w/index.php?title=Special:Log&type=block&limit=20&page=User%3A' + username_contribs_comp + '">block(s)</a>'; var blocklink2 = '<a href = "/w/index.php?title=Special:Log&type=block&limit=20&page=User%3A' + username_contribs_comp2 + '">block(s)</a>'; //parse var doc1 = standard_XMLParse(doc1_xml_contribs_xml); var doc2 = standard_XMLParse(doc2_xml_contribs_xml); //check for any contribs if (doc1.getElementById('bodyContent').getElementsByTagName('li')[0] == undefined) {document.getElementById('contentSub').innerHTML += " Note: One of these users has no contributions in this namespace! "; return;} else if (doc2.getElementById('bodyContent').getElementsByTagName('li')[0] == undefined) {document.getElementById('contentSub').innerHTML += " Note: One of these users has no contributions in this namespace! "; return;} //compile a list of pages edited var User_talk1 = 'User talk:' + username_contribs_comp; var User_talk2 = 'User talk:' + username_contribs_comp2; var l = doc1.getElementById('bodyContent').getElementsByTagName('ul')[0].getElementsByTagName('li'); var name_list = '||'; var list_common = '||'; var list_talkbyuser1 = ''; var list_talkbyuser2 = ''; var list_afdbyuser1 = ''; var list_afdbyuser2 = ''; for (i=0; i<l.length; i++) { var name = l[i].getElementsByTagName('a')[2].innerHTML; name_list += name + '||'; if (name == User_talk2) {list_talkbyuser1 += '<li>' + l[i].innerHTML + '</li>';} else if (name.search(/.+ for Deletion|(Redirects|Categories) for [Dd]iscussion|Deletion review/) ==0) {list_afdbyuser1 += '<li>' + l[i].innerHTML + '</li>';} } //compile a list of pages edited in common (along with second talk page run) if (doc2.getElementsByTagName('ul')[0] != undefined) { var h = doc2.getElementById('bodyContent').getElementsByTagName('ul')[0].getElementsByTagName('li'); for (i=0; i<h.length; i++) {    var name = h[i].getElementsByTagName('a')[2].innerHTML; if (name_list.indexOf('||' + name + '||') != -1 && list_common.indexOf('||' + name + '||') == -1) {list_common += name + '||';} if (name == User_talk1) {list_talkbyuser2 += '<li>' + h[i].innerHTML + '</li>';} else if (name.search(/.+ for Deletion|(Redirects|Categories) for [Dd]iscussion|Deletion review/) ==0) {list_afdbyuser2 += '<li>' + h[i].innerHTML + '</li>';} } } //  if (list_common == '||' || doc2.getElementsByTagName('ul')[0] == undefined) { document.getElementById('contentSub').innerHTML += " Done: edit comparison between " + username_contribs_comp + " ( " + user1edit_count + " scanned) ( " + user1block_count + " " + blocklink + ") and " + username_contribs_comp2 + " ( " + user2edit_count + " scanned) ( " + user2block_count + " " + blocklink2 + ") finished. (no matches) "; body.getElementsByTagName('ul')[0].innerHTML = ''; document.getElementsByTagName('p')[1].innerHTML = ''; document.getElementsByTagName('p')[2].innerHTML = ''; return; } //return list of edits to pages in common var common_names = list_common.split('||'); for (i=1; i< common_names.length-1; i++) { var pgname = common_names[i]; var pglink = '<a href="/wiki/' + pgname + '" title="' + pgname + '">' + pgname + '</a>'; txt_add += " Page: " + pglink + " " + username_contribs_comp2 + "  <ul>"; for (k=0; k<h.length; k++) {     var name = h[k].getElementsByTagName('a')[2].innerHTML; if (name == pgname) {txt_add += '<li>' + h[k].innerHTML + '</li>';} }  txt_add += "</ul> " + username_contribs_comp + "  <ul>"; for (k=0; k<l.length; k++) {     var name = l[k].getElementsByTagName('a')[2].innerHTML; if (name == pgname) {txt_add += '<li>' + l[k].innerHTML + '</li>';} }     txt_add += '</ul>' } txt_add += ' <br style="clear:both;">'; //talk edit parsing if (list_talkbyuser1 !=  || list_talkbyuser2 != ) {    txt_add += ' '; txt_add += " User talk interaction "; } if (list_talkbyuser2 != '') {    txt_add += " Edits by " + username_contribs_comp2 + " to talk page of " + username_contribs_comp + "  <ul>" + list_talkbyuser2 + "</ul>"; } if (list_talkbyuser1 != '') {    txt_add += " Edits by " + username_contribs_comp + " to talk page of " + username_contribs_comp2 + "  <ul>" + list_talkbyuser1 + "</ul>"; } txt_add += ' <br style="clear:both;">'; //AFD parsing if (list_afdbyuser1 !=  && list_afdbyuser2 != ) {    txt_add += ' '; txt_add += " Edits to deletion pages "; txt_add += " " + username_contribs_comp2 + " <ul>" + list_afdbyuser2 + "</ul>"; txt_add += " " + username_contribs_comp + " <ul>" + list_afdbyuser1 + "</ul>"; } txt_add += ' <br style="clear:both;">'; //Finish document.getElementById('contentSub').innerHTML += " Done: edit comparison between " + username_contribs_comp + " ( " + user1edit_count + " scanned) ( " + user1block_count + " " + blocklink + ") and " + username_contribs_comp2 + " ( " + user2edit_count + " scanned) ( " + user2block_count + " " + blocklink2 + ") finished. "; body.getElementsByTagName('ul')[0].innerHTML = ''; document.getElementsByTagName('p')[1].innerHTML = ''; document.getElementsByTagName('p')[2].innerHTML = ''; body.innerHTML += txt_add; edits_page_compared_js = 1; addTab("javascript:date_highlight", "date", "ca-datem", "Highlight a date", "f"); body.ranSetupTooltipsAlready=false; setupTooltips(body); }

function blockhist { if (location.href.search(/Special:(Log\/block|Blockip)|&type=block/) !=-1) { var ul = document.getElementById('bodyContent').getElementsByTagName('ul')[0]; if (!ul || !ul.getElementsByTagName('li')[0]){return;} var l = ul.getElementsByTagName('li'); //admin or sysop viewing this? if (l[0].innerHTML.indexOf('">block</a>)') ==-1){return;} //unblock links if (location.href.search(/&page=[^&]/) ==-1)     {     for (var i=0; i<l.length; i++)       {         if (l[i].getElementsByTagName('a')[4])         {     var name = l[i].getElementsByTagName('a')[4].innerHTML;     l[i].innerHTML = '(<a href="/w/index.php?title=Special%3ALog&type=block&page=User:' + name + '">hist</a>) (<a href="/w/index.php?title=Special%3AIpblocklist&action=search&limit=&ip=' + name + '">status</a>) ' + l[i].innerHTML;         }       }     }  else     {     var name = l[0].getElementsByTagName('a')[4].innerHTML;     l[0].innerHTML = '(<a href="/w/index.php?title=Special%3AIpblocklist&action=search&limit=&ip=' + name + '">status</a>) ' + l[0].innerHTML;     }  } }

//options addOnloadHook(SA_main_functions) function SA_main_functions { jswin_close; blockhist; winclosed; addmasterroll; Compare_tab_add;

} //

//END