User:Currentlybiscuit/vector.js

$(function {   if (document.location.href.indexOf("Special:Watchlist") < 0) return;    var temp = document.getElementsByTagName("a");    var links = [];    for (var i = 0; i < temp.length; i++) {        links.push(temp[i]);    }    for (var i = links.length - 1; i >= 0; i--) {        var link = links[i];        var nextOne = link.nextSibling;        if (!nextOne || !nextOne.nodeValue) continue;        var s = nextOne.nodeValue.toString;        if (nextOne.nodeType != 3) continue;        if (s.charCodeAt(0) != 8206 || s.charCodeAt(1) != 32) continue;        if (link.href.indexOf("/wiki/") >= 0 && link.className != "unwatch-link" && link.innerHTML != "talk" && link.innerHTML != "contribs" && link.href.indexOf("#") < 0) {           var s = link.href.indexOf("/wiki/");            var articleName = link.href.substr(s + 6, link.href.length);            console.info(articleName);            var e = document.createElement("a");            e.setAttribute("href", "/w/index.php?title=" + articleName + "&action=unwatch");            e.innerHTML = "[x] ";            e.className = "unwatch-link"            link.parentNode.insertBefore(e, link);        }    } });

// Twinkle configuration

if( typeof( TwinkleConfig ) == 'undefined' ) TwinkleConfig = {}; TwinkleConfig.portletId = 'p-views'; // This tool taken directly from en:User:Ilmari Karonen/rollbacksummary.js // // Prompt for an edit summary when clicking a rollback link $(function { var serverRe = wgServer.replace(/([^A-Za-z0-9_])/g, "\\$1"); var scriptRe = wgScript.replace(/([^A-Za-z0-9_])/g, "\\$1"); var rollbackRe = new RegExp ("^(" + serverRe + ")?" + scriptRe + "\\?([^#]*&)?action=rollback(&|$)"); var promptSummary = function { var summary = prompt("Enter rollback summary (or leave as \"default\" to use default summary):", "default"); if (summary == null || summary == "") return false; if (summary == "default") return true; this.href = this.href.replace("?", "?summary=" + encodeURIComponent(summary) + "&"); return true; }; var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { if (rollbackRe.test(links[i].href)) links[i].onclick = promptSummary; } });