diff --git a/modules/ext.math.mathjax.enabler.js b/modules/ext.math.mathjax.enabler.js index f3ab7cd..fe6de6c 100644 --- a/modules/ext.math.mathjax.enabler.js +++ b/modules/ext.math.mathjax.enabler.js @@ -1,7 +1,7 @@ /** * From https://en.wikipedia.org/wiki/User:Nageh/mathJax.js */ -/*global mathJax:true, MathJax, wikEd:true */ +/*global mathJax:true, MathJax */ ( function ( mw, $ ) { if ( typeof mathJax === 'undefined' ) { mathJax = {}; @@ -86,39 +86,8 @@ return false; }; - mathJax.Init = function () { - this.Load( document.getElementById('bodyContent') || document.body ); - - // compatibility with wikEd - if ( typeof wikEd === 'undefined' ) { - wikEd = {}; - } - if ( wikEd.config === undefined ) { - wikEd.config = {}; - } - if ( wikEd.config.previewHook === undefined ) { - wikEd.config.previewHook = []; - } - wikEd.config.previewHook.push( function (){ - if (window.mathJax.Load(document.getElementById('wikEdPreviewBox') || document.body)) { - MathJax.Hub.Queue(['Typeset', MathJax.Hub, 'wikEdPreviewBox']); - } - } ); - - // compatibility with ajaxPreview - this.oldAjaxPreviewExec = window.ajaxPreviewExec; - window.ajaxPreviewExec = function (previewArea) { - if ( mathJax.oldAjaxPreviewExec !== undefined ) { - mathJax.oldAjaxPreviewExec(previewArea); - } - if ( mathJax.Load(previewArea) ) { - MathJax.Hub.Queue( ['Typeset', MathJax.Hub, previewArea] ); - } - }; - }; - $( document ).ready( function () { - mathJax.Init(); + mathJax.Load(); } ); }( mediaWiki, jQuery ) );