common.js
-
- vor 8 Jahren zuletzt von Romana bearbeitet
-
Hinweis: Leere nach dem Speichern den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Internet Explorer: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
- Opera: Gehe zu Menü → Einstellungen (Opera → Einstellungen auf dem Mac) und dann auf Datenschutz & Sicherheit → Browserdaten löschen → Gespeicherte Bilder und Dateien.
var customizeToolbar = function () {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'userformat': {
'type': 'toolbar', // Can also be 'booklet'
groups: {
format: {
tools: {
greenhook: {
labelMsg: 'wikieditor-toolbar-tool-bold',
type: 'button',
offset: {
'default': [ 2, -574 ],
},
icon: {
'default': 'format-bold-F.png',
},
action: {
type: 'encapsulate',
options: {
// eslint-disable-next-line quotes
pre: "<span class='green_hook>'",
periMsg: 'wikieditor-toolbar-tool-bold-example',
// eslint-disable-next-line quotes
post: "</span>"
}
}
},
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
mw.loader.using( 'user.options' ).then( function () {
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready
).then( customizeToolbar );
}
} );
}