User:Mister Matt/monobook.js

// User:Lupin/popups.js

//document.write(' ');

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") == -1) 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); } });

function OngletGoogle { var a = document.getElementById("p-cactions"); if (a) {

var pageName = document.title.replace(" - Wikipedia, the free encyclopedia", ""); pageName = pageName.replace(/^(Talk|User|Wikipedia|Image|MediaWiki|Template|Help|Category|Portal)(_talk)?:/, ''); b = a.getElementsByTagName("ul"); if(b.length > 0) {           b[0].innerHTML = b[0].innerHTML + '' + '' + 'Google wiki' + '' + 'Google' + ''; }       }      }

addLoadEvent(OngletGoogle);

function addLoadEvent(func) {        if (window.addEventListener) window.addEventListener("load", func, false); else if (window.attachEvent) window.attachEvent("onload", func); }

var title = document.title;

function OptimizedNavig { var a = document.getElementById("p-navigation"); if (a) {   b = a.getElementsByTagName("ul"); if(b.length > 0) {     b[0].innerHTML = b[0].innerHTML + ' '     + ' ' + 'Signpost' + ' ' + ' ' + 'Announcements' + ' ' + ' ' + '<a href="/wiki/Wikipedia:WikiProject_Missing_encyclopedic articles">Missing articles</a>' + ' </li>' + ' '   }  } }

addLoadEvent(OptimizedNavig);

function OptimizedToolBox { var a = document.getElementById("p-tb"); if (a) {   b = a.getElementsByTagName("ul"); if(b.length > 0) { if (RegExp('User:','i').test(title)) var appendInteriotLink = 'true'; if (RegExp('User talk:','i').test(title)) var appendInteriotLink = 'true'; if (appendInteriotLink) {

username=title; username = username.replace("User:",""); username = username.replace("User talk:",""); username = username.replace(" - Wikipedia, the free encyclopedia","");

b[0].innerHTML = b[0].innerHTML

+ ' '     + '<li> ' + '<a href="http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user='+username+'">Edit count</a>' + ' </li>'

}   }  } }

addLoadEvent(OptimizedToolBox);