User:NACGNOH/common.js: Difference between revisions

From Deadlock Wiki
Jump to navigation Jump to search
NACGNOH (talk | contribs)
mNo edit summary
NACGNOH (talk | contribs)
m TEST
Tag: Replaced
 
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: {
                AlignCenter: {
                    label: 'Center',
                    type: 'button',
                    oouiIcon: 'alignCenter',
                    action: {
                        type: 'encapsulate',
                        options: {
                            pre: "<center>",
                            post: "</center>"
                        }
                    }
                }
            }
        } );
    } );
}

Latest revision as of 16:51, 14 October 2024

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