User:VarunFEB2003/sigAlways.js

// First hide the original signature button var customizeToolbar = function { $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } ); };

/* 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' ), $.ready ).then( customizeToolbar );		}	} ); }

//Now add a new one via Extra Edit buttons! $.ajax({	url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript',	dataType: 'script',	cache: true }).done(function {

krInsertWikiEditorButton({		id: "mw-customeditbutton-myspecialbutton",		icon: "https://upload.wikimedia.org/wikipedia/en/7/79/Insert-signature.png",		label: 'Signature and Timestamp',		insertBefore: ,		insertAfter: ,		sampleText: ''	}); });