Hopp til innhald

Brukar:Sigmund/common.js: Skilnad mellom versjonar

Frå Setesdalswiki
Inkje endringssamandrag
Tømde sida
Merke: Tømming
 
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', {


                'section': 'main',
                'group': 'format',
                'tools': {
                    'quote': {
                        label: 'Anførselstegn',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/a/ac/Norwegian_quote_sign.png',
                        action: {
                            type: 'encapsulate',
                            options: {
                                pre: "«",
                                //peri: "«»",
                                post: "»"
                            }
                        }
                    }
                }
            });
$textarea.wikiEditor( 'addToToolbar', {
                'section': 'main',
                'group': 'format',
                'tools': {
                    'link': {
                        label: 'Lenkeparenteser',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/b/ba/Norwegian_link_sign.png',
                        action: {
                            type: 'encapsulate',
                            options: {
                                pre: "[[",
                                //peri: "[[]]",
                                post: "]]"
                            }
                        }
                    }
                }
         
} );
$textarea.wikiEditor( 'addToToolbar', {
                'section': 'main',
                'group': 'format',
                'tools': {
                    'link': {
                        label: 'Malparenteser',
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/4/4a/Norwegian_template_sign.png',
                        action: {
                            type: 'encapsulate',
                            options: {
                                pre: "{{",
                                //peri: "{{}}",
                                post: "}}"
                            }
                        }
                    }
                }
            });
} );
}

Siste versjonen frå 26. mars 2023 kl. 01:20