User:Train2104/vector.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
The accompanying .css page for this skin can be added at User:Train2104/vector.css. |
- Report page listing warnings and errors.
//[[:en:User:Markhurd/hidetopcontrib.js]]
userHideAllSubsequent=true;
function hidetopcontrib()
{
var i,li,a;
li=document.getElementById("bodyContent");
li=li.getElementsByTagName("li");
i=-1;
a=new Array();
while(++i<li.length)
{
var s,t,links,b;
links=li[i].getElementsByTagName("a");
b = 2;
if(li[i].innerHTML.match(/<abbr +[^>]*class *= *"newpage"/)==undefined) b++;
if(li[i].innerHTML.match(/class *= *"mw-revdelundel-link"/)!=undefined) b++;
if (typeof links=='undefined' || links.length<(b+1))
continue;
t=links[b].innerHTML;
if(li[i].getElementsByTagName("strong").length>0||li[i].innerHTML.match(/mw\-uctop/)!=undefined)
s="none";
else
s="";
if(a[t]!=undefined)
s=userHideAllSubsequent?"none":a[t];
else
a[t]=s;
if(s!="")
// li[i].innerHTML=li[i].innerHTML + ":'" + s + "'";
li[i].style.display=(li[i].style.display=="none"?"list-item":"none");
}
}
$(function () {
if(wgCanonicalSpecialPageName == 'Contributions')
mw.util.addPortletLink('p-cactions', 'javascript:hidetopcontrib()', 'show/hide top', 'ca-hidetop',
"Show/hide pages for which you're the top contributor", '');
});