Jump to content

User:Music1201/introNotice.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Music1201 (talk | contribs) at 03:39, 20 July 2016 (+). 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.
/* Defines the function "addEditNotice" */
function addEditNotice( name ) {
    $( '.mw-editsection, #ca-addsection, #ca-edit' ).find( 'a' ).each( function ( i, el ) {
        el.href = $( this ).attr( 'href' ) + '&editintro=' + name;
    } );
}

/* Defines the variable "page" */
    $( function () {
    	var page = mw.config.get('wgPageName');
    	if (!page) {
    		return;
    	}
/* Adds editnotice for Village pump/Proposals */
    	if (mw.config.get( 'wgPageName' ) === 'Wikipedia:Village_pump_(proposals)') {
    		addEditNotice('User:Music1201/introNoticeTemplates/VPP');
  }
    }
    );

/* Defines the variable "cat" */
    $( function () {
        var cat = mw.config.get('wgCategories');
        if ( !cat ) {
            return;
        }
/* Adds editnotice for Category:ParserFunction errors */
        if ( $.inArray( 'ParserFunction errors', cat ) !== -1 ) {
            addEditIntro( 'User:Music1201/introNoticeTemplates/ParserFunctions );
        }
    } );
}
} );