User:Xyzu/monobook.js

/* */

/*** 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 - ';

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

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

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

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

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

/**** 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')); }

//importScript('User:Interiot/Tool2/code.js');

// Unwatch Links //

$(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 //

$(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 //

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

// Add an [edit top] link to pages $(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 */ "; });

document.getElementById('p-navigation').innerText=(' Xyzu's Navigation '); /* */