Brukar:Sigmund/common.js: Skilnad mellom versjonar
Utsjånad
Inkje endringssamandrag |
Inkje endringssamandrag |
||
| 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', | 'group': 'format', | ||
'tools': { | 'tools': { | ||
| Line 61: | Line 21: | ||
} | } | ||
} | } | ||
} ); | |||
} ); | |||
} | |||
// add quote signs to the format group in the main section | // add quote signs to the format group in the main section | ||
| Line 105: | Line 69: | ||
} | } | ||
}); | }); | ||
Versjonen frå 26. mars 2023 kl. 01:09
// 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: "»"
}
}
}
} );
} );
}
// add quote signs to the format group in the main section
$( '#wpTextbox1' ).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: "]]"
}
}
}
}
});
// add quote signs to the format group in the main section
$( '#wpTextbox1' ).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: "}}"
}
}
}
}
});