Benutzer:WikiSysop/common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
KKeine Bearbeitungszusammenfassung |
KKeine Bearbeitungszusammenfassung |
||
| Zeile 5: | Zeile 5: | ||
// Configure a new toolbar entry on the given $textarea jQuery object. | // Configure a new toolbar entry on the given $textarea jQuery object. | ||
$textarea.wikiEditor( 'addToToolbar', { | $textarea.wikiEditor( 'addToToolbar', { | ||
section: 'advanced', | section: 'advanced', | ||
group: 'format', | group: 'format', | ||
tools: { | tools: { | ||
code: { | |||
label: 'InlineCode', | label: 'InlineCode', | ||
type: 'button', | type: 'button', | ||
oouiIcon: 'markup', | oouiIcon: 'markup', | ||
action: { | action: { | ||
| Zeile 23: | Zeile 21: | ||
} | } | ||
} | } | ||
} ); | } ); | ||
} ); | } ); | ||
} | } | ||
Version vom 18. Dezember 2024, 11:50 Uhr
// 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: 'advanced',
group: 'format',
tools: {
code: {
label: 'InlineCode',
type: 'button',
oouiIcon: 'markup',
action: {
type: 'encapsulate',
options: {
pre: '<tt>',
post: '</tt>'
}
}
}
}
} );
} );
}