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:
Derk-Jan Hartman 2013-04-27 16:04:21 +02:00 committed by Gerrit Code Review
parent 6d99438a7c
commit d1035123e1
1 changed files with 2 additions and 33 deletions

View File

@ -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 ) );