User:Þjarkur/Not latest contributions.js

/**

Only shows contributions where the user is not the last contributor to that page. (Note: Works best on the first page of the contributions,   later pages may show articles where the user has made later edits) CC0

$.ready.then(function {	var url = $('#pt-mycontris a').attr('href')	$('#pt-mycontris').append(` (not latest)`)

if (mw.util.getParamValue('not_latest') && mw.config.get('wgCanonicalSpecialPageName') === 'Contributions') {

let last_contributor_list = []

$('.mw-uctop').each(function {			last_contributor_list.push($(this).closest('li').find('.mw-contributions-title').attr('href'))		})

let already_seen = []

$('.mw-contributions-list > li .mw-contributions-title').each(function {			if ( last_contributor_list.includes($(this).attr('href')) || already_seen.includes($(this).attr('href')) ) {				$(this).closest('li').remove			} else {				already_seen.push($(this).attr('href'))			}		}) } })