User:AoV2/specials.js

importScript("User:AoV2/query_string.js");

function specials{ if(wgNamespaceNumber != -1) return; ul = document.getElementById("bodyContent").getElementsByTagName("ul"); if(!ul.length) return; switch(wgCanonicalSpecialPageName) { case "Contributions": li = ul[0].getElementsByTagName("li"); for(i = 0; i < li.length; i++) li[i].className += " aov-contrib-" + (getElementsByClassName(li[i], "span", "mw-uctop").length ? "cur" : "old"); return; case "Watchlist": for(i = 0; i < ul.length; i++) if(ul[i].className.match(/\bspecial\b/)) { li = ul[i].getElementsByTagName("li"); for(ii = 0; ii < li.length; ii++) if(t = get_qs(li[ii].getElementsByTagName("a")[0].href).title) li[ii].innerHTML = '(unwatch) ' + li[ii].innerHTML; }		return; case "Search": r = getElementsByClassName(document, "ul", "mw-search-results"); if(r.length) { r[0].className += " plainlinks plainlinksneverexpand"; li = r[0].getElementsByTagName("li"); for(i = 0; i < li.length; i++) if(t = get_qs(li[i].getElementsByTagName("a")[0].href).title) li[i].innerHTML = '(edit) ' + li[i].innerHTML; }		return; }	}

addOnloadHook(specials);