Content deleted Content added
Cater better for new pages. |
m fix handy script to work with revdelete |
||
Line 10:
// 100413 MEH Cater for new pages.
// 100428 MEH Cater better for new pages.
// This script hides lines according to who has the top contribution for a page.
// If userHideAllSubsequent=true, all subsequent contributions are hidden too, more like watchlists.
//<pre><nowiki>
if (typeof userHideAllSubsequent=='undefined')
userHideAllSubsequent=false;
function hidetopcontrib()
{
Line 28:
while(++i<li.length)
{
var s,t,links,b;
links=li[i].getElementsByTagName("a");
if (typeof links=='undefined' || links.length<3)▼
if(li[i].innerHTML.match(/<abbr +[^>]*class *= *"newpage"/)==undefined) b++;
if(li[i].innerHTML.match(/class *= *"mw-revdelundel-link"/)!=undefined) b++;
continue;
▲ else
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 + "'";
Line 54 ⟶ 55:
}
}
addOnloadHook(function () {
if((___location.href.indexOf("Special:Contributions")!=-1||
Line 61 ⟶ 62:
"Show/hide pages for which you're the top contributor", '');
});
//</nowiki></pre>
//[[Category:Wikipedia scripts]]
|