MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus Schauungen, Visionen & Prophezeiungen
Taurec (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
Taurec (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
||
Zeile 9: | Zeile 9: | ||
'tools': { | 'tools': { | ||
'pretext': { | 'pretext': { | ||
label: ' | label: 'vorformatiertes Blockzitat', | ||
type: 'button', | type: 'button', | ||
oouiIcon: 'quotes', | |||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "< | pre: "<blockqote><poem>", | ||
periMsg: " | periMsg: "Text einfügen", | ||
post: "</ | post: "</poem></blockquote>" | ||
} | } | ||
} | } |
Version vom 7. März 2023, 08:09 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': {
'pretext': {
label: 'vorformatiertes Blockzitat',
type: 'button',
oouiIcon: 'quotes',
action: {
type: 'encapsulate',
options: {
pre: "<blockqote><poem>",
periMsg: "Text einfügen",
post: "</poem></blockquote>"
}
}
}
}
} );
} );
}