User:Markhurd/hidetopcontrib.js: Difference between revisions

Content deleted Content added
Add another check, for links with class ''mw-changeslist-al'' to help with compatibility with User:Ale jrb/Scripts/userhist.js; See Special:PermaLink/836110102
Add changes by User:Suffusion of Yellow: use the new mw-contributions-title to make things much easier (Discussed here)
 
(One intermediate revision by the same user not shown)
Line 18:
// 150121 MEH Remove legacy Javascript.
// 170608 Fixed dependency declaration for mediawiki.util
// 180413 User:Amorymeltzer allow for compatibility with a couple other scripts present on contributions page
// 200107 User:Suffusion_of_Yellow use mw-contributions-title class instead of guessing which link is to the title
 
// This script hides lines according to who has the top contribution for a page.
Line 44 ⟶ 46:
while ( ++i < li.length )
{
var s,t,links,b;
links = li[i].getElementsByTagNamegetElementsByClassName( "amw-contributions-title" );
if ( typeof links == 'undefined' || links.length<( b +!= 1 ) )
b = 2;
if ( li[i].innerHTML.match( /<abbr +[^>]*class *= *(['"])?newpage\1/i ) == undefined )
b++;
if ( li[i].innerHTML.match( /class *= *(['"])?mw-revdelundel-link\1/i ) != undefined )
b++;
if ( li[i].innerHTML.match( /class *= *(['"])?mw-changeslist-all\1/i ) != undefined )
b++;
if ( typeof links == 'undefined' || links.length<( b + 1 ) )
continue;
t = links[b0].innerHTML;
if ( /* li[i].getElementsByTagName("strong").length>0|| */ li[i].innerHTML.match(/mw\-uctop/i) != undefined )