Disable MathPlayer for IE10 and above.

This commit is contained in:
Davide P. Cervone 2014-08-22 13:31:55 -04:00
parent 58c20a9a4c
commit 60f197f16c
2 changed files with 31 additions and 23 deletions

View File

@ -3118,11 +3118,17 @@ MathJax.Hub.Startup = {
MSIE: function (browser) { MSIE: function (browser) {
browser.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance)); browser.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance));
MathJax.HTML.setScriptBug = !browser.isIE9 || document.documentMode < 9; MathJax.HTML.setScriptBug = !browser.isIE9 || document.documentMode < 9;
var MathPlayer = false; //
try {new ActiveXObject("MathPlayer.Factory.1"); browser.hasMathPlayer = MathPlayer = true} // MathPlayer doesn't function properly in IE10, and not at all in IE11,
catch (err) {} // so don't even try to load it.
//
if (document.documentMode < 10 && !STARTUP.params.NoMathPlayer) {
try { try {
if (MathPlayer && !STARTUP.params.NoMathPlayer) { new ActiveXObject("MathPlayer.Factory.1");
browser.hasMathPlayer = true;
} catch (err) {}
try {
if (browser.hasMathPlayer) {
var mathplayer = document.createElement("object"); var mathplayer = document.createElement("object");
mathplayer.id = "mathplayer"; mathplayer.classid = "clsid:32F66A20-7614-11D4-BD11-00104BD3F987"; mathplayer.id = "mathplayer"; mathplayer.classid = "clsid:32F66A20-7614-11D4-BD11-00104BD3F987";
document.getElementsByTagName("head")[0].appendChild(mathplayer); document.getElementsByTagName("head")[0].appendChild(mathplayer);
@ -3141,6 +3147,7 @@ MathJax.Hub.Startup = {
} }
} catch (err) {} } catch (err) {}
} }
}
}); });
HUB.Browser.Select(MathJax.Message.browsers); HUB.Browser.Select(MathJax.Message.browsers);

View File

@ -156,7 +156,7 @@
this.Mouseout = HOVER.Mouseout; this.Mouseout = HOVER.Mouseout;
this.Mousemove = HOVER.Mousemove; this.Mousemove = HOVER.Mousemove;
if (!isMSIE) { if (!HUB.Browser.hasMathPlayer) {
// Used in preTranslate to get scaling factors // Used in preTranslate to get scaling factors
this.EmExSpan = HTML.Element("span", this.EmExSpan = HTML.Element("span",
{style:{position:"absolute","font-size-adjust":"none"}}, {style:{position:"absolute","font-size-adjust":"none"}},
@ -173,10 +173,11 @@
}, },
// //
// Set up MathPlayer for IE on the first time through. // Set up MathPlayer for IE on the first time through.
// Get the ex and em sizes.
// //
InitializeMML: function () { InitializeMML: function () {
this.initialized = true; this.initialized = true;
if (isMSIE) { if (HUB.Browser.hasMathPlayer) {
try { try {
// //
// Insert data needed to use MathPlayer for MathML output // Insert data needed to use MathPlayer for MathML output