User:Id508317/common.js

var customizeToolbar = function {

/* TRANSLATE GROUP */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {	'section': 'main',	'groups': {		'translate': {			'label': 'Translate' // or use labelMsg for a localized label, see above		}	} } ); /* TRANSLATE GROUP END */

/* LANGUAGES BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', {	section: 'main',	group: 'translate',	tools: {		"languages": {			label: 'Languages',			type: 'button',			icon: 'http://i.imgur.com/xK639GB.png',			action: {				type: 'encapsulate',				options: {					pre: "<"+"languages/>",					post: ""				}			}		}	} }); /* LANGUAGES BUTTON END */

/* TRANSLATE BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', {	section: 'main',	group: 'translate',	tools: {		"translate": {			label: 'Translate',			type: 'button',			icon: 'http://i.imgur.com/9X8miYP.png',			action: {				type: 'encapsulate',				options: {					pre: "",					post: ""				}			}		}	} }); /* TRANSLATE BUTTON END */

/* TVAR BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', {	section: 'main',	group: 'translate',	tools: {		"tvar": {			label: 'Variable',			type: 'button',			icon: 'http://i.imgur.com/fgCaMZr.png',			action: {				type: 'encapsulate',				options: {					pre: "",					post: ""				}			}		}	} }); /* TVAR BUTTON END */

};

/* TOOLBAR CONFIG */ /* 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 (T54542)		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 ); /* TOOLBAR CONFIG END */