MediaWiki:Common.js: Difference between revisions

From All Skies Encyclopaedia
Sushoff (talk | contribs)
Created page with "→Any JavaScript here will be loaded for all users on every page load.: // Check if we're editing a page. if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) { // Add a hook handler. mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) { // Configure a new toolbar entry on the given $textarea jQuery object. $textarea.wikiEditor( 'addToToolbar', { →Your code goes here: } ); } ); }"
 
Sushoff (talk | contribs)
No edit summary
 
Line 10: Line 10:
} );
} );
}
}
$(function () {
    $('#ca-disclaimer').remove();
    $('<li id="ca-disclaimer" class="new">'
        + '<a href="/index.php/MediaWiki:Copyright" title="Disclaimer">'
        + 'Disclaimer</a></li>')
        .insertAfter('#ca-talk');
});

Latest revision as of 06:59, 10 October 2026

/* Any JavaScript here will be loaded for all users on every page load. */
// Check if we're editing a page.
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
	// Add a hook handler.
	mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
		// Configure a new toolbar entry on the given $textarea jQuery object.
		$textarea.wikiEditor( 'addToToolbar', {
			/* Your code goes here */
		} );
	} );
}
$(function () {
    $('#ca-disclaimer').remove();

    $('<li id="ca-disclaimer" class="new">'
        + '<a href="/index.php/MediaWiki:Copyright" title="Disclaimer">'
        + 'Disclaimer</a></li>')
        .insertAfter('#ca-talk');
});