Utilizador:Jorge Morais/monobook.js
Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.
- Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
- Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
- Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
- Opera: Pressione Ctrl-F5.
/*global jQuery, mediaWiki */
( function ( mw, $ ) {
'use strict';
var addExtraButtons = function(){
mw.toolbar.addButton( {
imageFile: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
speedTip: '<s></s>',
tagOpen: '<s>',
tagClose: '</s>',
sampleText: '',
imageId: 'button-strike'
} );
/* If you want more buttons, copy and adapt the examples above and paste the modified version before this comment */
};
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 ([[bugzilla:52542#c3]])
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
// Use something like [[m:User:Krinkle/Scripts/InsertWikiEditorButton#Example]]
} else if ( mw.user.options.get( 'showtoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'mediawiki.action.edit' ),
$.ready
).then( addExtraButtons );
}
} );
}
}( mediaWiki, jQuery ) );
if ( mw.config.get( 'wgAction' ) === 'edit' || mw.config.get( 'wgAction' ) === 'submit' ) {
// [[File:User:He7d3r/Tools/TemplateScript.js]] (workaround for [[bugzilla:33355]])
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:He7d3r/Tools/TemplateScript.js&action=raw&ctype=text/javascript' );
}