User:Robinr78/common.js: Difference between revisions
Jump to navigation
Jump to search
m (Robinr78 moved page User:Robinr78/Common.js to User:Robinr78/common.js without leaving a redirect) |
(Removed redirect to User:Robinr78/common.js) Tag: Removed redirect |
||
Line 1: | Line 1: | ||
/ | // 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 */ | |||
} ); | |||
} ); | |||
} |
Revision as of 23:10, 27 December 2022
// 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 */ } ); } ); }