Benutzer:Taurec/common.js

Aus Schauungen, Visionen & Prophezeiungen

Hinweis: Leeren Sie nach dem Veröffentlichen 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 / Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
  • Opera: Gehen Sie zu Menü → Einstellungen (Opera → Einstellungen auf dem Mac) und dann auf Datenschutz & Sicherheit → Browserdaten löschen → Gespeicherte Bilder und Dateien.
var customizeToolbar = function() {
	/* Your code goes here */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'main',
	'groups': {
		'custom': {
			'label': 'Eigene' // or use labelMsg for a localized label, see above
		}
	}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'main',
	'group': 'custom',
	'tools': {
		'firstquotation': {
			label: '„“',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/quote1.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "„",
					post: "“"
				}
			}
		},
		'secondquotation': {
			label: '‚‘',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/quote2.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "‚",
					post: "‘"
				}
			}
		},
		'gedankenstrich': {
			label: 'Gedankenstrich',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/gedankenstrich.png',
			action: {
				type: 'replace',
				options: {
					peri: " – "
				}
			}
		},
		'apostroph': {
			label: 'Apostroph',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/apostroph.png',
			action: {
				type: 'replace',
				options: {
					peri: "’"
				}
			}
		},
		'dots': {
			label: '…',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/dots.png',
			action: {
				type: 'replace',
				options: {
					peri: "…"
				}
			}
		},
		'break': {
			label: 'Zeilenumbruch',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/break.png',
			action: {
				type: 'replace',
				options: {
					peri: "<br>"
				}
			}
		},
		'blockquote': {
			label: 'Blockzitat',
			type: 'button',
			icon: 'https://schauungen.de/wiki/extensions/WikiEditor/modules/images/toolbar/blockzitat.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<blockquote><poem>",
					post: "</poem></blockquote>"
				}
			}
		}
	}
} );
};

/* 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', 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 );
		}
	} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );