User:NACGNOH/common.js: Difference between revisions

From Deadlock Wiki
Jump to navigation Jump to search
NACGNOH (talk | contribs)
WikiEditor/Toolbar customization Test
 
NACGNOH (talk | contribs)
m TEST
Tag: Replaced
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
// Check if we're editing a page.
console.log("User:NACGNOH/common.js Loading");
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', {
section: 'advanced',
group: 'format',
tools: {
comment: {
label: 'Comment',
type: 'button',
icon: 'https://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png',
action: {
type: 'encapsulate',
options: {
pre: '<!-- ',
post: ' -->'
}
}
}
}
} );
} );
}

Latest revision as of 16:51, 14 October 2024

console.log("User:NACGNOH/common.js Loading");