MathJax: Remove support for wikEd and AjaxPreview
With the new renderTex hook of https://gerrit.wikimedia.org/r/61183 there is no need for hardcoded support for these 2 scripts. The scripts in question should call the hook themselves. PS2: Fix wikEd reference of jsHint Supersedes: https://gerrit.wikimedia.org/r/23073 Bug: 35478 Change-Id: I9811832430e9ddd8a4c03f265d07529a76efc38a
This commit is contained in:
parent
6d99438a7c
commit
d1035123e1
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* From https://en.wikipedia.org/wiki/User:Nageh/mathJax.js
|
* From https://en.wikipedia.org/wiki/User:Nageh/mathJax.js
|
||||||
*/
|
*/
|
||||||
/*global mathJax:true, MathJax, wikEd:true */
|
/*global mathJax:true, MathJax */
|
||||||
( function ( mw, $ ) {
|
( function ( mw, $ ) {
|
||||||
if ( typeof mathJax === 'undefined' ) {
|
if ( typeof mathJax === 'undefined' ) {
|
||||||
mathJax = {};
|
mathJax = {};
|
||||||
|
@ -86,39 +86,8 @@
|
||||||
return false;
|
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 () {
|
$( document ).ready( function () {
|
||||||
mathJax.Init();
|
mathJax.Load();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
}( mediaWiki, jQuery ) );
|
}( mediaWiki, jQuery ) );
|
||||||
|
|
Loading…
Reference in New Issue