Difference between revisions of "MediaWiki:Common.js"

From Mechanics
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
/* add extra time to load math equations on mobile screens */
function waitForMathJax($content) {
  if (typeof MathJax === 'undefined') {
    setTimeout(function () { waitForMathJax($content); }, 4000);
  } else {
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, $content[0]]).execute();
  }
}
mw.hook('wikipage.content').add(waitForMathJax);

Revision as of 10:57, 16 February 2022

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