MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

// haleyjd 20150624: Tab toggling code (function($) {  // tab data object   var TabCollection = function (elem) {      var tabContents = elem.closest('.dw-tabcontainer').parent.children('.dw-tabcontents'); // content container parent node

this.tabs      = elem.parent.children;                         // set of all tabs this.allContent = tabContents.children('.dw-tabcontent');          // all content containers this.myContent = tabContents.children.eq(this.tabs.index(elem)); // the content container belonging to this tab };  // run on document ready: $(function {      // add a click callback to every tab      $('.dw-tab').click(function  { var elem = $(this); var tc  = elem.data('dwTabCollection'); if(!tc) elem.data('dwTabCollection', (tc = new TabCollection(elem))); tc.tabs.removeClass('dw-tab-active'); // turn off all tabs elem.addClass('dw-tab-active');      // turn on this tab tc.allContent.css('display', 'none'); // hide all content tc.myContent.css('display', 'block'); // display own content });  }); })(jQuery);

// Load other modules when needed: if(mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit' || mw.config.get('wgCanonicalSpecialPageName') === 'Upload') { // scripts specific to editing pages // importScript('MediaWiki:Common.js/edit.js'); mw.loader.load('/w/index.php?title=MediaWiki:Common.js/edit.js&action=raw&ctype=text/javascript'); }

// 20180721: Countdown til Doom Eternal reveal (on that page only, until it gets closer anyways) if(wgTitle === 'Doom Eternal') { mw.loader.load('/w/index.php?title=MediaWiki:Common.js/countdown.js&action=raw&ctype=text/javascript'); }

// Hacks to disable proxy editing if($('#foreverproxy-top').length > 0 && wgAction == 'edit') { window.location = 'https://doomwiki.org'; }

$(function {   $('#page_controls li[forevermutated="true"]').css({ width: 0, height: 0, overflow: 'hidden', visibility: 'hidden' });   $('.editButtons[forevermutated="true"]').css({ width: 0, height: 0, overflow: 'hidden', visibility: 'hidden' }); });