Jump to content

User:DannyS712 test/errors.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DannyS712 test (talk | contribs) at 05:00, 5 January 2019 (don't show on errors page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if( mw.config.get( "wgPageName" ).indexOf( "Main_Page" ) > -1 ) {
	if ( mw.config.get( "wgPageName" ).indexOf("Main_Page/Errors") > -1 ) return;
	console.log(mw.config.get( "wgPageName" ));
    $.when(
        mw.loader.using( [ "mediawiki.api", "mediawiki.util", "jquery.accessKeyLabel" ] ),
        $.ready
    ).then( function () {
    	$( "#ca-talk" ).after( utocMakeTab( "Errors", "Wikipedia:Main Page/Errors", null, "ca-errors" ) );
    } );
}
function utocMakeTab( label, pageName, accesskey, id ) {
    var tab = $( "<li>" ).append( $( "<span>" ).append( $( "<a>" )
                .text( label )
                .attr( "accesskey", accesskey )
                .attr( "title", pageName + " (access key " + accesskey + ")" )
                .attr( "href", mw.util.getUrl( pageName ) ) ) )
            .attr( "id", id );
    return tab;
}