|
|
(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: ' -->'
| |
| }
| |
| }
| |
| }
| |
| }
| |
| } );
| |
| } );
| |
| }
| |
console.log("User:NACGNOH/common.js Loading");