Benutzer:WikiSysop/common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
K |
K |
||
Zeile 12: | Zeile 12: | ||
label: 'InlineCode', | label: 'InlineCode', | ||
type: 'button', | type: 'button', | ||
− | oouiIcon: ' | + | oouiIcon: 'toolbar_tt', |
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', |
Version vom 18. Dezember 2024, 00:05 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: { math: { label: 'InlineCode', type: 'button', oouiIcon: 'toolbar_tt', action: { type: 'encapsulate', options: { pre: '<tt>', post: '</tt>' } } } } } ); } ); }