Handle setup of MathPlayer better for IE10. Separate hasMathPlayer from having the namespace set up

This commit is contained in:
Davide P. Cervone 2012-03-11 09:47:27 -04:00
parent 4d717dbea4
commit c36c15f58b
9 changed files with 12 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2388,14 +2388,15 @@ MathJax.Hub.Startup = {
browser.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance));
MathJax.HTML.setScriptBug = !browser.isIE9 || document.documentMode < 9;
var MathPlayer = false;
try {new ActiveXObject("MathPlayer.Factory.1"); MathPlayer = true} catch (err) {}
try {new ActiveXObject("MathPlayer.Factory.1"); browser.hasMathPlayer = MathPlayer = true}
catch (err) {}
try {
if (MathPlayer && !STARTUP.params.NoMathPlayer) {
var mathplayer = document.createElement("object");
mathplayer.id = "mathplayer"; mathplayer.classid = "clsid:32F66A20-7614-11D4-BD11-00104BD3F987";
document.getElementsByTagName("head")[0].appendChild(mathplayer);
document.namespaces.add("m","http://www.w3.org/1998/Math/MathML");
browser.hasMathPlayer = true;
browser.mpNamespace = true;
if (document.readyState && (document.readyState === "loading" ||
document.readyState === "interactive")) {
document.write('<?import namespace="m" implementation="#MathPlayer">');

View File

@ -98,12 +98,12 @@
//
// Insert data needed to use MathPlayer for MathML output
//
if (!HUB.Browser.hasMathPlayer) {
if (!HUB.Browser.mpNamespace) {
var mathplayer = document.createElement("object");
mathplayer.id = "mathplayer"; mathplayer.classid = "clsid:32F66A20-7614-11D4-BD11-00104BD3F987";
document.getElementsByTagName("head")[0].appendChild(mathplayer);
document.namespaces.add("m","http://www.w3.org/1998/Math/MathML");
HUB.Browser.hasMathPlayer = true;
HUB.Browser.mpNamespace = true;
}
if (!HUB.Browser.mpImported) {
document.namespaces.m.doImport("#mathplayer");