MediaWiki:Gadget-EditLinks.js

/** * Adds edit links to Special:WhatLinksHere * * @author JBed (Final Fantasy Wiki) * @author Cqm * @author Hairr */

( function ( $, mw, rswiki ) {

'use strict';

rswiki.gadgets = rswiki.gadgets || {};

rswiki.gadgets.editLinks = function {

if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'Whatlinkshere' ) { return; }

if ( $( '.mw-whatlinkshere-edit' ).length ) { return; }

$( '#mw-whatlinkshere-list li' ).each( function {

var href = $( $( this ).children( 'a' )[ 0 ] ).attr( 'href' ), span = $( ' ' ).attr( 'class', 'mw-whatlinkshere-edit' ), join = href.indexOf( '?' ) > -1 ? '&' : '?';

span.html( '(edit) ' ); $( $( this ).children( '.mw-whatlinkshere-tools' ) ).before( span );

} );   };

$( rswiki.gadgets.editLinks );

}( this.jQuery, this.mediaWiki, this.rswiki = this.rswiki || {} ) );

/* */