User:DannyS712 test/errors.js

// Install with: // // or with //  // // Special thanks to User:Enterprisey and their script, User:Enterprisey/user-tabs-on-contribs.js, which I partially forked. // If forking this script, please note my contributions / give me credit

if( mw.config.get( "wgPageName" ).indexOf( "Main_Page" ) > -1 ) { if ( !( mw.config.get( "wgPageName" ).indexOf("Main_Page/Errors") > -1 )) { console.log(mw.config.get( "wgPageName" )); $.when(	       mw.loader.using( [ "mediawiki.api", "mediawiki.util" ] ),	        $.ready	    ).then( function  {	    	$( "#ca-talk" ).after( utocMakeTab( "Errors", "Wikipedia:Main Page/Errors", null, "ca-errors" ) );	    } ); } } function utocMakeTab( label, pageName, accesskey, id ) { var tab = $( "" ).append( $( " " ).append( $( "" ) .text( label ) .attr( "accesskey", accesskey ) .attr( "title", pageName + " (access key " + accesskey + ")" ) .attr( "href", mw.util.getUrl( pageName ) ) ) ) .attr( "id", id ); return tab; }