MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Schauungen, Visionen & Prophezeiungen
KKeine Bearbeitungszusammenfassung
KKeine Bearbeitungszusammenfassung
Zeile 16: Zeile 16:
options: {
options: {
pre: "<blockqote><poem>",
pre: "<blockqote><poem>",
periMsg: "Text einfügen",
post: "</poem></blockquote>"
post: "</poem></blockquote>"
}
}

Version vom 7. März 2023, 08:12 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>",
							post: "</poem></blockquote>"
						}
					}
				}
			}
		} );
	} );
}