User:Markhurd/hidetopcontrib.js: Difference between revisions

Content deleted Content added
Markhurd (talk | contribs)
change user setting setup
Markhurd (talk | contribs)
Fix issue reported by User talk:Markhurd/hidetopcontrib.js#Bug Lenore. Add userHideAllSubsequent documentation.
Line 5:
// 090615 MEH Cater for new <span class="mw-uctop">
// Add userHideAllSubsequent user setting.
// Fix issue reported by [[User talk:Markhurd/hidetopcontrib.js#Bug Lenore]].
 
// 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.
 
if (typeof userHideAllSubsequent=='undefined')
Line 22 ⟶ 24:
while(++i<li.length)
{
var s,t,links;
links=li[i].getElementsByTagName("a");
t=li[i].innerHTML.match(/"\/wiki\/([^"]*)"/); // " fix simple WP syntax highlighter
 
if (t!typeof links=='undefined' || links.length<4)
t=t[1] continue;
else
{
t=li[i].innerHTML.match(/"\/w\/index\.php\?title\=([^&]*)\&amp\;redirect\=no"/);
 
if(t!=undefined)links[3].innerHTML;
t=t[1];
else
continue;
}
 
if(li[i].getElementsByTagName("strong").length>0||li[i].innerHTML.match(/\<span +class\="mw\-uctop"\>/)!=undefined)