« MediaWiki:Common.js » : différence entre les versions

De Keyla project
Aller à : navigation, rechercher
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 3 : Ligne 3 :
mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
// 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', {
 
sections: {
$('#wpTextbox1').wikiEditor('addToToolbar', {
emoticons: {
section: 'main',
type: 'toolbar', // Can also be 'booklet',
group: 'format',
label: 'Emoticons'
tools: {
// or label: mw.msg( 'section-emoticons-label' ) for a localized label
"strikethrough": {
label: 'Barrer',
type: 'button',
icon: wgScriptPath+ '/skins/DarkVector/images/cjnext_toolbar/stroke_icon.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
}
}
}
}
} );
});
 
 
} );
} );
}
}

Version du 29 août 2023 à 09:30

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.

$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'main',
	group: 'format',
	tools: {
		"strikethrough": {
			label: 'Barrer',
			type: 'button',
			icon: wgScriptPath+ '/skins/DarkVector/images/cjnext_toolbar/stroke_icon.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<s>",
					post: "</s>"
				}
			}
		}
	}
});


} );
}