MediaWiki:Common.js

From EvoLudo
Revision as of 02:33, 21 February 2025 by Hauert (talk | contribs)

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. 
 * Ignored on mobile devices, see MediaWiki:Mobile.js
 */
mw.loader.load( 'https://wiki.evoludo.org/gwt/evoludoweb/evoludoweb.nocache.js' );
/* 250221 doesn't enable equation numbering... why?
 * see https://docs.mathjax.org/en/latest/input/tex/eqnumbers.html
window.MathJax = {
  tex: {
    tags: 'ams'
  }
};
 */
var mathTags = $('.mwe-math-mathml-a11y');
if (mathTags.length > 0){ //only do something when there's math on the page
  window.MathJax = { //hook into MathJax's configuration
    AuthorInit: function () {
      MathJax.Hub.Register.StartupHook("End",function () { //when MathJax is done...
        MathJax.Hub.Queue(
            function(){
             mathTags.removeClass('mwe-math-mathml-a11y'); // .. make the span around MathML (now MathJax output) visible
             $('.mwe-math-fallback-image-inline').addClass('mwe-math-mathml-a11y'); //hide fallback images
            }
        );
      });
    }
  };
}