MediaWiki:Gadget-ContributorsHack.js
$( function() {
var cats = document.getElementById( 'mw-hidden-catlinks' );
if ( !cats ) {
return;
}
function addContribsLink () {
var contribsLink = $( ' ')
.addClass( 'contributorslink-test plainlinks metadata nomobile noprint' )
.append( $('')
.addClass( 'external' )
.attr( 'href',
'https://xtools.wmflabs.org/articleinfo/'
+ mw.config.get( 'wgServerName' )
+ '/'
+ encodeURIComponent( mw.config.get( 'wgPageName' ) ) )
.text( 'Contributors' )
);
contribsLink.insertAfter( $( '#siteSub' ) );
}
cats = cats.getElementsByTagName( 'a' );
for ( var i = 0; i < cats.length; i++ ) {
if ( cats[i].title === 'Category:Articles with contributors link' ) {
addContribsLink();
break;
}
}
} );