User:Sean Whitton/monobook.js

/* */

if (wgPageName == "Main_Page") { window.location = "http://en.wikipedia.org/wiki/User:Sean_Whitton/Useful"; }

/*** navigation popups (User:Lupin/popupsdev.js) ***/

document.write('');

popupDelay = 1; popupStructure = 'menus'; popupAdminLinks = true; popupShortcutKeys = true; popupFixRedirs = true; popupWatchRedirredPages = true; popupRedlinkRemoval = true; popupFixDabs = true; popupWatchDisambiggedPages = true; imagePopupsForImages = false; // popupMaxWidth = 550; popupEditCounterTool = 'custom'; popupEditCounterUrl = 'http://tools.wikimedia.de/~essjay/edit_count/Count.php?username=$1';

popupRevertSummary = 'rv to %s - '; popupRevertSummaryPrompt = true; popupQueriedRevertSummary = 'rv to $1 at $2 by $3 - '; popupQueriedRevertToPreviousSummary = 'rv to $1 at $2 by $3 - '; popupFixRedirsSummary = 'rp %s with %s - '; popupFixDabsSummary = 'rp %s with %s - '; popupRedlinkSummary = 'rm %s - ';

// WP:TWINKLE

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

// WP:FRIENDLY

importScript('User:Ioeth/friendly.js');

// Helper tools document.write('');

//Diff page links //importScript('User:Voice_of_All/Revert/monobook.js');

//UTC clock document.write('');

//Admin tools //document.write('');

function fixtabs { 	if(document.getElementById('ca-delete')) { document.getElementById('ca-delete').firstChild.innerHTML = 'del'; } 	if(document.getElementById('ca-move')) { document.getElementById('ca-move').firstChild.innerHTML = 'mv'; } 	if(document.getElementById('ca-watch')) { document.getElementById('ca-watch').firstChild.innerHTML = 'w'; } 	if(document.getElementById('ca-unwatch')) { document.getElementById('ca-unwatch').firstChild.innerHTML = 'uw'; }	if(document.getElementById('ca-edit')) { document.getElementById('ca-edit').firstChild.innerHTML = 'ed'; }	if(document.getElementById('ca-history')) { document.getElementById('ca-history').firstChild.innerHTML = 'hist'; }	if(document.getElementById('ca-talk')) { document.getElementById('ca-talk').firstChild.innerHTML = 'talk'; }	if(document.getElementById('ca-addsection')) { document.getElementById('ca-addsection').firstChild.innerHTML = '+'; }	if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'p (off)'; }	if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'p (on)'; } } addOnloadHook(fixtabs);

/**** Get a clock that autoupdates! ****/

function showtime {   var timerID; var now = new Date; var timeValue = now.toUTCString.replace(/GMT/, "UTC"); document.getElementById('utcdate').firstChild.innerHTML = timeValue; timerID = setTimeout('showtime', 100); }

// Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present. function do_blockip_stuff { // focus on Reason field document.getElementsByName('wpBlockReason')[0].focus;

// Look for a &faketarget= for the username/ip var l = location.search.substring(1).split('&'); var target = ''; for (var i = 0; i < l.length; ++i) {     var n = l[i].indexOf('='); if (l[i].substring(0, n) == 'faketarget') {	 target = l[i].substring(n + 1); break; }   }

if (target == '') return;

// put account name in "IP Address/username" field var addr = document.getElementsByName('wpBlockAddress')[0]; addr.value = unescape(target);

// add "blocklog" tab var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0]; tabs.appendChild(addlilink('/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A' + target, 'blocklog')); }

// Unwatch Links //

addOnloadHook(function {    var query_prefix = "title=Special:Watchlist&action=submit&remove=1&id[]=";    //var query_prefix = "action=unwatch&title=";

if (window.location.href.indexOf("Special:Watchlist") < 0) return; if (window.location.href.indexOf("Special:Watchlist/edit") >= 0) return;

var links = document.getElementById('content').getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].href.substring(links[i].href.length-15) != '&action=history') continue; var unwatch = document.createElement('a'); unwatch.href = "/w/index.php?" + query_prefix + encodeURIComponent(links[i].title); unwatch.title = "Unwatch "+links[i].title; unwatch.appendChild(document.createTextNode("unwatch")); links[i].parentNode.insertBefore(unwatch, links[i].nextSibling); // kluge to handle case where "diff" is unlinked: var delim = links[i].previousSibling; delim = (delim.nodeType == 3 ? delim.nodeValue : ""); links[i].parentNode.insertBefore(document.createTextNode(delim.replace(/^.*diff/, "")), unwatch); } });

//Death to editing on redlinks //

addOnloadHook(function {    var len=document.links.length;    for(var i=0; i<len; ++i) {        var l=document.links[i];        if (l.className=='new') {            l.href=l.href.replace('&action=edit', '');        }    } });

// Always check "block anons only" on Special:Blockip // // Another success from User:Lupin //

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

// Add an [edit top] link to pages addOnloadHook(function {  // if this is preview page or generated page, stop  if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// get the page title var pageTitle = document.title.split(" - ")[0].replace(" ", "_");

// create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = ' [edit top] ';

// insert divContainer into the DOM before the h1 if(window.location.href.indexOf("&action=edit") == -1) document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);

if(window.location.href.indexOf("&action=edit&section=0") != -1) document.getElementById("wpSummary").value = "/* Intro */ "; });

// install User:Cacycle/wikEd in-browser text editor //document.write(' ');

// AFD closure script

//importScript('Wikipedia:WikiProject_User_scripts/Scripts/CloseAFD.js'); importScript('User:Mr.Z-man/closeAFD.js');

// Ais523's !vote symbol script

importScript('User:Ais523/votesymbols.js');

/** function TransformeEnDiscussion { var transformeEnPDD = document.getElementById("transformeEnPageDeDiscussion"); if(transformeEnPDD) document.body.className = "ns-1"; } addOnloadHook(TransformeEnDiscussion);
 * Transformer certaines pages en page de discussion avec le modèle

/* */