User:JoanneB/monobook.js

/* */

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Alf's monobook ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Helper tools ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Voice of All //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Test-n //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function testn(number) { var page = prompt("Vandalism to which article?") var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "" + page + " ~"; f.wpSummary.value = "Your edits to " + page + "" document.editform.wpWatchthis.checked = false; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Automatically check "anon only" in block field //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

addOnloadHook(function{ var x; if (x=document.getElementById('wpAnonOnly')) {x.checked=true;} });

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add link //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) {       if(key && title) {           ta[id] = [key, title]; }       else if(key) {           ta[id] = [key, '']; }       else if(title) {           ta[id] = ['', title]; }   }    akeytt; return li; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add toolbox link //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addToolboxLink(url, name, id){ var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; addlilink(tb, url, name, id); }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add tab //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key) };

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add menu //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addlimenu(tabs, name, id) {   var na = document.createElement('a'); na.href = ''; var mn = document.createElement('ul'); na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.className = 'tabmenu'; li.appendChild(na); li.appendChild(mn); tabs.appendChild(li); return li; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Get page name //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function getPname { z=document.getElementById("content").childNodes; for (var n=0;n<z.length;n++) { if (z[n].className=="firstHeading") return z[n].textContent; }; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Get tidy title //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function get_tidy_title { var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href; editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));

return editlk; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add link //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addLink(where, url, name, id, title, key, after){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); var tabs = document.getElementById(where).getElementsByTagName('ul')[0]; if(after) { tabs.insertBefore(li,document.getElementById(after)); } else { tabs.appendChild(li); }   if(id) { if(key && title) { ta[id] = [key, title]; } else if(key) { ta[id] = [key, '']; } else if(title) { ta[id] = ['', title];} }   // re-render the title and accesskeys from existing code in wikibits.js    akeytt; return li; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Voice of All tools ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Master rollback //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

document.write(' ');

addOnloadHook(Dfn_js_con) function Dfn_js_con { Mvaluejs_class = 'spork'; Rvaluejs_class = 'spork'; Uvaluejs_class = 'spork'; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Sleeper tools //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

document.write(' ');

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // History analysis //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/History/monobook.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Find and replace //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

document.write(' ');

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AfD tools ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AfD nomination and voting tools //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

document.write(' ');

afdh_signature = ''+'~'; afdh_summaryprompt = true; afdh_useicons = false;

afdh_shortcuts = Array; afdh_shortcuts['d'] = 'Delete'; afdh_shortcuts['k'] = 'Keep'; afdh_shortcuts['m'] = 'Merge'; afdh_shortcuts['mv'] = 'Move'; afdh_shortcuts['rd'] = 'Redirect'; afdh_shortcuts['rw'] = 'Rewrite'; afdh_shortcuts['t'] = 'Transwiki'; afdh_shortcuts['wd'] = 'Weak delete'; afdh_shortcuts['sd'] = 'Strong delete'; afdh_shortcuts['sp'] = 'Speedy delete'; afdh_shortcuts['sk'] = 'Strong keep'; afdh_shortcuts['wk'] = 'Weak keep'; afdh_shortcuts['c'] = 'Comment';

afdh_icons = Array; afdh_icons['d'] = afdh_icons['wd'] = afdh_icons['sd'] = afdh_icons['sp'] = 'Symbol delete vote.svg'; afdh_icons['k'] = afdh_icons['sk'] = afdh_icons['wk'] = 'Symbol keep vote.svg'; afdh_icons['m'] = 'Symbol merge vote.svg'; afdh_icons['c'] = 'Symbol comment vote.svg';

afdh_commscs = Array; afdh_commscs['pn'] = 'per nom.';

function afd_helper { if (auto_mod) return;

var anchors = new Array; {   var oldanchors = document.getElementById('bodyContent').getElementsByTagName('a'); for (var i=0; i < oldanchors.length; i++) anchors[i] = oldanchors[i]; }   var url_re = /\?title=Wikipedia:Articles_for_deletion\/([^&]+)&action=edit&/; var url, matches; for (var i=0; i < anchors.length; i++) { if (!(matches = anchors[i].href.match(url_re))        || (matches[1].substr(0, 4) == 'Log/')) continue; var na = document.createElement('a'); na.href = "javascript:afd_vote('"+escape(anchors[i].href)+"')"; na.title = "Vote on deletion of "+unescape(matches[1]); var inlink = document.createElement('sup'); inlink.appendChild(document.createTextNode('vote')); na.appendChild(inlink); anchors[i].parentNode.insertBefore(na, anchors[i].nextSibling); }

if (am_get_title.indexOf(':') == -1) am_add_li('tb', 'javascript:afd_nominate', 'Nominate AFD', '', 'Nominate this article for deletion'); }

function afd_vote(edit_link) { var shortcuts_list = ''; for (var key in afdh_shortcuts) shortcuts_list += key + ': ' + afdh_shortcuts[key] + '; '; var vote = window.prompt("Enter your vote.  (Shortcuts available are: "+shortcuts_list+")"); if (!vote) return; var icon_link = ''; if (afdh_useicons && afdh_icons[vote.toLowerCase]) icon_link = ' '; if (afdh_shortcuts[vote.toLowerCase]) vote = afdh_shortcuts[vote.toLowerCase];

shortcuts_list = ''; for (var key in afdh_commscs) shortcuts_list += key + ': ' + afdh_commscs[key] + '; '; var comment = window.prompt("Enter your comment. (Shortcuts available are: "+shortcuts_list+")"); if (typeof comment != 'string') return; if (afdh_commscs[comment.toLowerCase]) comment = afdh_commscs[comment.toLowerCase];

var summary = vote; if (afdh_summaryprompt) if (!(summary = window.prompt("Enter the edit summary:", summary))) summary = vote; var url = edit_link + '&amaddafter='+escape("* "+icon_link+vote+" "+comment+" "+afdh_signature) + '&amsummary='+escape(summary);

if (window.location.href.indexOf("/Log/") == -1) window.location.href = url; else window.open(url, "afd_helper_vote"); }

function afd_nominate { var title = am_get_title; var log_date = window.prompt("This should be the date of the latest AFD log. Change it if necessary.", am_guess_date); if (!log_date) return; var reason = window.prompt("Please justify your AFD nomination of "+title+":"); if (!reason) return; window.open(am_make_url(title, , , 'nomination for deletion'), 'afdhn1'); window.open(am_make_url('Wikipedia:Articles for deletion/Log/'+log_date, , , 'Nominating '+title+' for deletion'), 'afdhn3'); window.location.href = am_make_url('Wikipedia:Articles for deletion/'+title, , , 'nominated for deletion'); }

addOnloadHook(afd_helper);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // AfD closing tools //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function closeafd(bold, notbold){ var form = document.editform; var txt = form.wpTextbox1; txt.value = " " + bold + " " + notbold + " \n" + txt.value + "\n\n"; form.wpSummary.value = "close discussion: " + bold; form.wpWatchthis.checked = false; }

function afdresult{ var form = document.editform; form.wpSummary.value = 'AFD result'; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

function afddelete{ document.forms.deleteconfirm.wpReason.value = 'Wikipedia( talk)?):/, ) + ; }

function cfddelete{ document.forms.deleteconfirm.wpReason.value = 'category emptied per Categories for discussion'; }

function replace{ var s = prompt("Search regexp?"); if(s){ var r = prompt("Replace regexp?"); if(!r && r != '') return; var txt = document.editform.wpTextbox1; txt.value = txt.value.replace(new RegExp(s, "g"), r); } }

function autoafd_relist { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "~" + "~" + "~"; f.wpSummary.value = "Relisting debate"; }

function autoafd_add_afd_tabs { // Only add for pages with the right string somewhere in the title if (document.title.indexOf("Editing Wikipedia:Articles for deletion/") != -1) {     addLink('p-cactions', 'javascript:autoafd_relist', "relist"); } }

addOnloadHook(autoafd_add_afd_tabs);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Tab customisation tools ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add tab tools (technical) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function edit_summary_watch(msg, summ, watch) { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += msg; f.wpSummary.value = summ; }

function edit_summary_watch2(summ, watch) { var f = document.editform, t = f.wpTextbox1; f.wpSummary.value = summ; }

function edit_summary_watch3(msg, summ, watch) { var f = document.editform, t = f.wpTextbox1; t.value = msg; f.wpSummary.value = summ; }

/* function testn(number) { var page = prompt("Which message do you want to issue?") var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += " ~" + "~" + "~"; t.value += '\n'; f.wpSummary.value = "vandalism warning"; } */

function blockuser(msg, other) { var f = document.getElementsByName('wpBlockReason')[0]; f.value = msg; var j = document.getElementsByName('wpBlockOther')[0]; j.value = other; }

function unblockuser(msg, other) { var f = document.getElementsByName('wpUnblockReason')[0]; f.value = msg; }

function testv(number) { var f = document.editform, t = f.wpTextbox1; t.value = ""; }

function protected{ var form = document.editform; form.wpSummary.value = ''; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

function vprotected{ var form = document.editform; form.wpSummary.value = ''; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

function sprotected{ var form = document.editform; form.wpSummary.value = ''; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

function deletedpage{ var form = document.editform; form.wpSummary.value = ''; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

function usertalkvprotect{ var form = document.editform; form.wpSummary.value = ''; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

function usertalksprotect{ var form = document.editform; form.wpSummary.value = ''; var txt = form.wpTextbox1; txt.value = ' \n' + txt.value; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Add tab tools (the actual tabs) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function add_tabs { var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0]; // Only add for pages with "Editing User talk:" somewhere in the title if (document.title.indexOf("Editing User talk:") != -1) {     addlimenu(tabs, 'Talk messages', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Welcome to Wikipedia!", true, 1)','Welcome', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Welcome to Wikipedia!", false, 1)','Anon', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "About your edits", false, 1)','Test one', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "About your edits", false, 1)','Test two', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "About your edits", false, 1)','Test three', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "About your edits", false, 1)','Vandal one', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Vandalism", false, 1)','Vandal two', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Warning", false, 1)','Vandal three', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Last warning", false, 1)','T4 l/w', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "One and only warning", false, 1)','Only warning', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "You have been blocked", false, 1)','Temp block', ''); addlilink(talkm,'javascript:edit_summary_watch("~", "You have been blocked", false, 1)','Perm block', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "You have been blocked", false, 1)','username', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Vandalism", false, 1)','Blatant', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Defamation/Vandalism", false, 1)','Defamation', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Vandalism", false, 1)','stop vandal!', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Vandalism", false, 1)','funny but', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "About the page you created", false, 1)','Vanity', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Adding links to Wikipedia", false, 1)','Spam1', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Spamming", false, 1)','Spam2', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Spamming", false, 1)','Spam3', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Last warning for spamming", false, 1)','Spam4', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "You have been blocked for spamming", false, 1)','Spam5', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Removing AfD notices", false, 1)','rem AfD', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "Blanking pages", false, 1)','blanking', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "About your edits", false, 1)','nothanks', ''); addlilink(talkm,'javascript:edit_summary_watch("-- ~", "", false, 1)','nothanks-sd', '');

}

if (document.title.indexOf("Editing User:") != -1) {     addlimenu(tabs, 'userpage tags', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch("", "blocked", false, 1)',"indefinite"); addlilink(talkm,'javascript:edit_summary_watch("", "username block", false, 1)',"username"); addlilink(talkm,'javascript:edit_summary_watch("", "blocked", false, 1)',"vandalism"); addlilink(talkm,'javascript:edit_summary_watch("", "username block", false, 1)',"non-latin"); addlilink(talkm,'javascript:edit_summary_watch("", "pageblankvandal", false, 1)',"page blank"); addlilink(talkm,'javascript:edit_summary_watch("", "pagemovevandal", false, 1)',"page move"); }

if (document.title.indexOf("Editing Image:") == 0) {     addlilink(tabs, 'javascript:edit_summary_watch("", "no licence", false, 1)',"licence"); }

if (document.title.indexOf("Editing User:") == 0) {     addlilink(tabs, 'javascript:testv(1)',""); }

if (document.title.indexOf("Editing User talk:") == 0) {     addlilink(tabs, 'javascript:testv(1)',""); }

if (document.title.indexOf("Editing Wikipedia:Articles for deletion") == 0) {       addlilink(tabs, 'javascript:closeafd(prompt("Result"), (prompt("Additional comments")))', 'Result'); } if (document.title.indexOf("Editing User:JoanneB/status") == 0) {     addlimenu(tabs, 'c/s', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch3("", "changing status (in)", true, 1)',"i"); addlilink(talkm,'javascript:edit_summary_watch3("", "changing status (out)", true, 1)',"o"); addlilink(talkm,'javascript:edit_summary_watch3("", "changing status (around)", true, 1)',"a"); addlilink(talkm,'javascript:edit_summary_watch3("", "changing status (busy)", true, 1)',"b"); }

if (document.title.indexOf("Editing Wikipedia:Administrator intervention against vandalism") == 0) {     addlimenu(tabs, 'admin intervention against vandalism', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch2("blocked, list empty", true, 1)',"blocked, empty"); addlilink(talkm,'javascript:edit_summary_watch2("blocked, list not empty", true, 1)',"blocked, not empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, content dispute, list empty", true, 1)',"content dispute, empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, content dispute, list not empty", true, 1)',"content dispute, not empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not vandalised since final warning", list empty", true, 1)',"no edit since warning, empty");     addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not vandalised since final warning", true, 1)',"no edit since warning, not empty");      addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not been sufficiently warned", list empty", true, 1)',"not sufficiently warned, empty"); addlilink(talkm,'javascript:edit_summary_watch2("not blocked, has not been sufficiently warned", true, 1)',"not sufficiently warned, not empty"); }

if (document.title.indexOf("Editing Category") == 0) {     addlimenu(tabs, 'cat', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:edit_summary_watch2("renaming of category per Categories for discussion", true, 1)',"!"); }

if (document.title.indexOf("Editing") == 0) {     addlimenu(tabs, 'protected', 'talkm'); var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0]; addlilink(talkm,'javascript:protected',"dispute"); addlilink(talkm,'javascript:vprotected',"vprotect"); addlilink(talkm,'javascript:sprotected',"sprotect"); addlilink(talkm,'javascript:deletedpage',"deleted"); }

if (document.title.indexOf("Block user") == 0) {	addlilink(tabs, 'javascript:blockuser("vandalism from this IP range, sorry. please see Advice to AOL users if you have been impacted by this block.", "90 minutes")', "range"); addlilink(tabs, 'javascript:blockuser("three revert rule violation", "24 hours")', "3RR"); addlilink(tabs, 'javascript:blockuser("vandalism", "15 minutes")', "15 mins"); addlilink(tabs, 'javascript:blockuser("vandalism", "3 hours")', "3 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "24 hours")', "24 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "48 hours")', "48 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "96 hours")', "96 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "192 hours")', "192 hrs"); addlilink(tabs, 'javascript:blockuser("vandalism", "indefinite")', "indefinite"); addlilink(tabs, 'javascript:blockuser("inappropriate username", "indefinite")', "username"); }

if (document.title.indexOf("Unblock user") == 0) {	addlilink(tabs, 'javascript:unblockuser("temporarily removing block to change duration")', "change duration"); addlilink(tabs, 'javascript:unblockuser("unblock requested (via email)")', "email"); addlilink(tabs, 'javascript:unblockuser("blocked mistakenly")', "mistake"); addlilink(tabs, 'javascript:unblockuser("collateral damage")', "collateral"); addlilink(tabs, 'javascript:unblockuser("release autoblock")', "autoblock"); }

if (document.title.indexOf("Confirm delete") == 0) {     addlilink(tabs, 'javascript:afddelete',"afd"); addlilink(tabs, 'javascript:cfddelete',"cfd"); }

if (document.title.indexOf("Editing Talk:") == 0) {     addlilink(tabs, 'javascript:afdresult',"afd"); }

}

if (window.addEventListener) window.addEventListener("load", add_tabs, false); else if (window.attachEvent) window.attachEvent("onload", add_tabs); function addtab(tabs, url, name, id){ var na = document.createElement('a'); na.href = url; na.id = id; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.appendChild(na); tabs.appendChild(li); return li; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Edit section zero //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function addEditSection0 { ta['ca-edit-0'] = ['', 'Edit the zeroth section of this page']; if (!document.getElementById) return; x = document.getElementById('ca-edit'); if(!x) return; y = document.createElement('LI'); y.id = 'ca-edit-0'; if (x.className == 'selected') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected'; } else { x.className = 'selected istalk'; } } else if (x.className == 'selected istalk') { if (/&action=edit&section=0$/.test(window.location.href)) { x.className = 'istalk'; y.className = 'selected istalk'; } else { y.className = 'istalk'; } } else { y.className = x.className; x.className = 'istalk'; } z = document.createElement('A'); if (x.children) { z.href = x.children[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling); } else { z.href = x.childNodes[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling); } }

if (document.title.indexOf("Editing ") == -1) { if (window.addEventListener) window.addEventListener("load", addEditSection0, false); else if (window.attachEvent) window.attachEvent("onload", addEditSection0); }

function getPname { z=document.getElementById("content").childNodes; for (var n=0;n<z.length;n++) { if (z[n].className=="firstHeading") return z[n].textContent; }; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Block, unblock, and block log tabs //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function add_block_tab { var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];

var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href; editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit')); editlk = editlk.substring(editlk.indexOf(':') + 1); var slloc = editlk.indexOf('/'); if (slloc > 0) editlk = editlk.substring(0, slloc);

addlilink(tabs, '/w/index.php?title=Special:Ipblocklist&action=unblock&ip=' + editlk, 'u'); addlilink(tabs, '/w/index.php?title=Special:Blockip&ip=' + editlk, 'b'); addlilink(tabs, '/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A' + editlk, 'l');

}

function do_onload { if (document.title.indexOf('User:') == 0      || document.title.indexOf('User talk:') == 0) add_block_tab; else if (document.title.indexOf('Block user') == 0) // could stand to be more robust do_blockip_stuff; }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Visual aids and changes to personal menus ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Personal menu, navigation, toolbox and more tab customisation //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (window.addEventListener) window.addEventListener("load", do_onload, false); else if (window.attachEvent) window.attachEvent("onload", do_onload);

if ( document.createElement && window.addEventListener ) { function SoFixItInit {

}

function SoFixItLoad { UserMenu = new PortletMenu( 'p-personal'  ); PageMenu = new PortletMenu( 'p-cactions'  ); NavMenu = new PortletMenu( 'p-navigation' ); ToolMenu = new PortletMenu( 'p-tb'        );

function GetByClass( sElem, sClass ) { var i, a2 = [], a = document.getElementsByTagName( sElem ); for ( i = 0; i < a.length; i++ ) if ( a[ i ].className == sClass ) a2.push( a[ i ] ); return a2; } var a, td = GetByClass( 'td', 'diff-otitle' ); if ( ( td = td[ 0 ] ) && ( a = td.getElementsByTagName( 'a' )[ 0 ] ) ) a.href = a.href + '&action=edit'; // need to change text, later

var userName = UserMenu.getText( 'pt-userpage' );

UserMenu.setText( 'pt-mytalk'   , 'Talk'  ); UserMenu.setText( 'pt-preferences', 'Preferences' ); UserMenu.setText( 'pt-watchlist', 'Watchlist' ); UserMenu.setText( 'pt-mycontris', 'Contributions' ); UserMenu.setText( 'pt-logout'   , 'Log out'   );

document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' )[0].style.textTransform = 'none';

UserMenu.append( 'pt-utc', UTCTime, 'javascript:void UserMenu.setText("pt-utc",UTCTime)' );

if ( PageMenu[ 'ca-history' ] ) // theory: if it has a history tab, then it's purgable { PageMenu.insertBefore( 'ca-history', 'ca-lastdiff', 'last', PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'diff=0' ) );

PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'action=purge');

PageMenu.setText( 'ca-edit'   , 'Edit this page'   );

PageMenu.setText( 'ca-history'   , 'History'   );

PageMenu.setText( 'ca-delete'   , 'Delete'   ); }

var x = 1; NavMenu.append( 'n-' + x++, 'monobook.js', 'http://en.wikipedia.org/w/index.php?title=User:JoanneB/monobook.js&action=edit' ); NavMenu.append( 'n-' + x++, 'monobook.css', 'http://en.wikipedia.org/w/index.php?title=User:JoanneB/monobook.css&action=edit' ); NavMenu.append( 'n-' + x++, 'Status', 'http://en.wikipedia.org/w/index.php?title=User:Wiki alf/status&action=edit' ); NavMenu.append( 'n- ' + x++, 'Purge', 'http://en.wikipedia.org/w/index.php?title=' + getPname + '&action=purge' ); ToolMenu.append( 'n-' + x++, 'Block IP', 'http://en.wikipedia.org/wiki/Special:Blockip' ); ToolMenu.append( 'n-' + x++, 'Unblock IP', 'http://en.wikipedia.org/w/index.php?title=Special:Ipblocklist&action=unblock' ); ToolMenu.append( 'n-' + x++, 'IP block list', 'http://en.wikipedia.org/wiki/Special:Ipblocklist' ); ToolMenu.append( 'n-' + x++, 'Autoblocks', 'http://tools.wikimedia.de/~pgk/autoblock.php?autoblock=&blocker=Wiki alf&blockee=&time=0&Submit=Submit+Query' ); ToolMenu.append( 'n-' + x++, 'Requests: AIV', 'http://en.wikipedia.org/wiki/Wikipedia:Administrator_intervention_against_vandalism' ); ToolMenu.append( 'n-' + x++, 'Requests: Unblock', 'http://en.wikipedia.org/wiki/Category:Requests_for_unblock' ); ToolMenu.append( 'n-' + x++, 'Requests: Helpme', 'http://en.wikipedia.org/wiki/Category:Wikipedians_looking_for_help' ); ToolMenu.append( 'n-' + x++, 'Requests: Adminship', 'http://en.wikipedia.org/wiki/Wikipedia:Requests_for_adminship' ); ToolMenu.append( 'n-' + x++, 'Speedy deletions', 'http://en.wikipedia.org/wiki/Category:Candidates_for_speedy_deletion' ); ToolMenu.append( 'n-' + x++, 'AfDs to be closed', 'http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Old' ); ToolMenu.append( 'n-' + x++, 'Todays AfDs', 'http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Log/Today' ); ToolMenu.append( 'n-' + x++, 'Yesterdays AfDs', 'http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Log/Yesterday' ); ToolMenu.append( 'n-' + x++, 'Noticeboard', 'http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard' ); ToolMenu.append( 'n-' + x++, 'Noticeboard: Incidents', 'http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard/Incidents' ); ToolMenu.append( 'n-' + x++, 'Noticeboard: 3RR', 'http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard/3RR' ); ToolMenu.append( 'n-' + x++, 'Edit count', 'http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=JoanneB&site=en.wikipedia.org' ); ToolMenu.append( 'n-' + x++, 'New users', 'http://en.wikipedia.org/w/index.php?title=Special:Log&type=newusers&user=&page=&limit=20&offset=0' ); }

function PortletMenu( id ) // constructor { this.menu = document.getElementById( id ); this.list = this.menu.getElementsByTagName( 'ul' )[ 0 ]; // bypass " Views ", etc.

var LIs = this.list.getElementsByTagName( 'li' );

for ( var i = 0; i < LIs.length; i++ ) { this[ LIs[ i ].id ] = LIs[ i ]; }

this.newItem = function( id, txt, url ) { var li = document.createElement( 'li' ); li.id  = id; var a = document.createElement( 'a'  );  a.href = url;

a.appendChild( document.createTextNode( txt ) ); li.appendChild( a );

this[ id ] = li; // watch this!!!

return li; }

this.append = function( id, txt, url ) { this.list.appendChild( this.newItem( id, txt, url ) ); } this.insertBefore = function( old, id, txt, url ) { this.list.insertBefore( this.newItem( id, txt, url ), this[ old ] ); }

this.getText = function( id     ) { return this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data } this.setText = function( id, txt ) {       this[ id ].getElementsByTagName( 'a' )[ 0 ].firstChild.data = txt }

this.getHref = function( id     ) { return this[ id ].getElementsByTagName( 'a' )[ 0 ].href       } this.setHref = function( id, url ) {       this[ id ].getElementsByTagName( 'a' )[ 0 ].href = url } }

function RemoveNode( id ) { var node = document.getElementById( id ) node.parentNode.removeChild( node ); }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Personal menu clock //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function UTCTime { var s = '', d = new Date, a = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); return d.getUTCDate + ' ' + a[ d.getUTCMonth ] + ' ' + d.getUTCFullYear + ' ' + ( '0' + d.getUTCHours  ).substr( -2 ) + ':' + ( '0' + d.getUTCMinutes ).substr( -2 ) + ' ' + 'UTC'; }

SoFixItInit; window.addEventListener( 'load', SoFixItLoad, false ); }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Page logs link in toolbox //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

addOnloadHook(function {

var pagetitleRe=/[^:]*:\/\/en\.wikipedia\.org\/(wiki\/|w\/index\.php\?title=)([^&?#]*)/; ptitle = pagetitleRe.exec(decodeURI(location.href))[2].split('_').join(' '); if( (window.location.href.indexOf("User:") != -1) || (window.location.href.indexOf("User_talk:") != -1) ) { regDropSubpages = /[User|User_talk]:([^&?\/]*)[\/]?.*/; user = regDropSubpages.exec(ptitle)[1]; url = "http://en.wikipedia.org/w/index.php?title=Special%3ALog&user=" + user; } else if(window.location.href.indexOf("Special:") != -1) { return; } else { url = "http://en.wikipedia.org/w/index.php?title=Special%3ALog&page=" + ptitle; } tabs = document.getElementById('p-tb').getElementsByTagName('ul')[0]; l = addlilink(tabs, url, "Logs", "pt-logs");

});

document.write('' +   ' .xdiff { width: 100%; background: white; }' +    ' .xdiff-row { width: 100%; margin: 0 0 3px 0; overflow: hidden; }' +    ' .xdiff-col { width: 49%; margin: 0; float: left; clear: none; position: relative; }' +    ' .xdiff-sign, .xdiff-outer, .xdiff-inner { display: block; margin: 0; }' +    ' .xdiff-sign { position: absolute; top: 0; left: 0; width: 2em; text-align: center; }' +    ' .xdiff-outer { padding: 0 0 0 2em; }' +    ' .xdiff-inner { overflow: auto; overflow-y: visible; width: 100%; }' +    ' .xdiff-inner.diff-addedline { font-size: 85%; background: #cfc; }' +    ' .xdiff-inner.diff-deletedline { font-size: 85%; background: #ffa; }' +    ' .xdiff-inner.diff-context { font-size: 85%; background: #eee; }' +    (!document.recalc ? '' : // IE kluge: ' * html .xdiff-inner { padding-bottom: expression(this.scrollWidth > this.offsetWidth ? "16px" : 0); }' + ' * html .xdiff-sign { top: expression((this.parentNode.clientHeight - this.offsetHeight)/2 + "px"); }') +   '<'+'/style>');

addOnloadHook(maybeStart); addOnloadHook(addMarvin);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Other / Uncategorised ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Interiot edit count (tool 2) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) { mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // End //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/* */