MediaWiki:Common.js: Difference between revisions

From openpipeflow.org
Jump to navigation Jump to search
(SimpleMathJax, wait for rendering)
(No difference)

Revision as of 14:00, 28 January 2020

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

function waitForMathJax($content) {
  if (typeof MathJax === 'undefined') {
    setTimeout(function () { waitForMathJax($content); }, 1000);
  } else {
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, $content[0]]).execute();
  }
}

mw.hook('wikipage.content').add(waitForMathJax);