MediaWiki:Common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */ // Check if we are editing a page. if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) { // Add a hook handler. mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) { // Remove the reference button and its help $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'reference' }); $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'help', 'page': 'reference' }); // Remove big and small text buttons $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'size', 'tool': 'big' }); $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'size', 'tool': 'small' }); // Remove insert file button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'file' }); // Remove picture gallery button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'insert', 'tool': 'gallery' }); } ); } // Easter egg $(document).ready(function(){ var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! if (mm == '04' && dd == '01') { var str = '<div class="pacman-wrapper">' + '<div class="pacman"></div>' + Array(10).join('<div class="food"></div>') '</div>'; $('body.page-Pacman .mw-first-heading').html(str); } });