MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Sandboxgamer
(Die Seite wurde neu angelegt: „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: { "strikethrough": { label: 'Strike', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commo…“)
 
Markierung: Zurückgesetzt
Zeile 17: Zeile 17:
pre: "<s>",
pre: "<s>",
post: "</s>"
post: "</s>"
}
}
}
}
} );
$textarea.wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"strikethrough": {
label: 'Code',
type: 'button',
icon: 'http://gs.sandboxgamer.de/bilder/button/code.png',
action: {
type: 'encapsulate',
options: {
pre: "<code>",
post: "</code>"
}
}
}
}

Version vom 16. Februar 2022, 08:01 Uhr

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: {
				"strikethrough": {
					label: 'Strike',
					type: 'button',
					icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<s>",
							post: "</s>"
						}
					}
				}
			}
		} );
		$textarea.wikiEditor( 'addToToolbar', {
			
			section: 'advanced',
			group: 'format',
			tools: {
				"strikethrough": {
					label: 'Code',
					type: 'button',
					icon: 'http://gs.sandboxgamer.de/bilder/button/code.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: "<code>",
							post: "</code>"
						}
					}
				}
			}
		} );
	} );
}