User:CptnMisc/monobook.js

// User:Lupin/popups.js -

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

// Filter changes live // User:Lupin/recent2.js - please include this line mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

$(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);    }