User:Gryllida/WikiEditorEmoticons.js

mw.loader.using(['mediawiki.api'], function {	var customizeToolbar = function  {		// add emotions		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'main', 'group': 'insert', 'tools': { // smiling 'addSmilingFace': { label: 'Add a smiling face', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/85/Smiley.svg/22px-Smiley.svg.png', action: { type: 'encapsulate', options: { pre: "" // text to be inserted }					}				},				// smiling end // File:Smiley XD.svg // laughing 'addLaughingFace': { label: 'Add a laughing face', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Smiley_XD.svg/22px-Smiley_XD.svg.png', action: { type: 'encapsulate', options: { pre: "" // text to be inserted }					}				},				// frowning // Frowning-smiley.svg 'addFrowningFace': { label: 'Add a frowning face', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/thumb/6/62/Frowning-smiley.svg/22px-Frowning-smiley.svg.png', action: { type: 'encapsulate', options: { pre: "" // text to be inserted }					}				},			}		} );		console.log(4);	};	// 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 { console.log(1); // 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' ), $.ready				).then( customizeToolbar ); }		} );	}	// == WikiEditor codes end == });