Have ElementJax store input and output jax ID's rather than pointers (to help avoid circular references for cleanup purposes)
This commit is contained in:
parent
98c56a56ab
commit
944aed1ac1
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
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
|
@ -12,5 +12,5 @@
|
|||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
|
||||
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.1",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -12,5 +12,5 @@
|
|||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}(function(b){if(b.isMSIE){var a=document.createElement("object");a.id="mathplayer";a.classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987";document.getElementsByTagName("head")[0].appendChild(a);document.namespaces.add("mjx","http://www.w3.org/1998/Math/MathML");document.namespaces.mjx.doImport("#mathplayer")}})(MathJax.Hub.Browser);MathJax.OutputJax.NativeMML.loadComplete("config.js");
|
||||
MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1.1",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}(function(b){if(b.isMSIE){var a=document.createElement("object");a.id="mathplayer";a.classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987";document.getElementsByTagName("head")[0].appendChild(a);document.namespaces.add("mjx","http://www.w3.org/1998/Math/MathML");document.namespaces.mjx.doImport("#mathplayer")}})(MathJax.Hub.Browser);MathJax.OutputJax.NativeMML.loadComplete("config.js");
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1361,11 +1361,12 @@ MathJax.Hub = {
|
|||
// FIXME: Have intputJax determine if things have changed?
|
||||
if (jax && jax.originalText === (script.text == "" ? script.innerHTML : script.text))
|
||||
{script.MathJax.state = jax.STATE.PROCESSED} else
|
||||
{jax.outputJax.Remove(jax); script.MathJax.state = jax.STATE.UPDATE}
|
||||
{MathJax.OutputJax[jax.outputJax].Remove(jax); script.MathJax.state = jax.STATE.UPDATE}
|
||||
},
|
||||
Reprocess: function (script) {
|
||||
var jax = script.MathJax.elementJax;
|
||||
if (jax) {jax.outputJax.Remove(jax); script.MathJax.state = jax.STATE.UPDATE}
|
||||
if (jax)
|
||||
{MathJax.OutputJax[jax.outputJax].Remove(jax); script.MathJax.state = jax.STATE.UPDATE}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1421,7 +1422,6 @@ MathJax.Hub = {
|
|||
processScripts: function (scripts,start,n) {
|
||||
if (arguments.callee.disabled) {return null}
|
||||
var result, STATE = MathJax.ElementJax.STATE;
|
||||
var inputJax = this.inputJax, outputJax = this.outputJax;
|
||||
try {
|
||||
if (!start) {start = new Date().getTime()}
|
||||
var i = 0, script, prev;
|
||||
|
@ -1433,21 +1433,22 @@ MathJax.Hub = {
|
|||
if (!script.MathJax || script.MathJax.state === STATE.PROCESSED) {i++; continue};
|
||||
if (!script.MathJax.elementJax || script.MathJax.state === STATE.UPDATE) {
|
||||
this.checkScriptSiblings(script);
|
||||
result = inputJax[type].Process(script);
|
||||
result = this.inputJax[type].Process(script);
|
||||
if (typeof result === 'function') {
|
||||
if (result.called) continue; // go back and call Process() again
|
||||
this.RestartAfter(result);
|
||||
}
|
||||
result.Attach(script,inputJax[type]);
|
||||
result.Attach(script,this.inputJax[type].id);
|
||||
script.MathJax.state = STATE.OUTPUT;
|
||||
}
|
||||
var jax = script.MathJax.elementJax;
|
||||
if (!outputJax[jax.mimeType]) {
|
||||
if (!this.outputJax[jax.mimeType]) {
|
||||
script.MathJax.state = STATE.UPDATE;
|
||||
throw Error("No output jax registered for "+jax.mimeType);
|
||||
}
|
||||
jax.outputJax = outputJax[jax.mimeType][0];
|
||||
result = jax.outputJax.Process(script);
|
||||
var outputJax = this.outputJax[jax.mimeType][0];
|
||||
jax.outputJax = outputJax.id;
|
||||
result = outputJax.Process(script);
|
||||
if (typeof result === 'function') {
|
||||
if (result.called) continue; // go back and call Process() again
|
||||
this.RestartAfter(result);
|
||||
|
@ -1520,8 +1521,7 @@ MathJax.Hub.Insert(MathJax.Hub.config.styles,MathJax.Message.styles);
|
|||
MathJax.Hub.Insert(MathJax.Hub.config.styles,{".MathJax_Error":MathJax.Hub.config.errorSettings.style});
|
||||
|
||||
//
|
||||
// Storage area for preprocessors and extensions
|
||||
// (should these be classes?)
|
||||
// Storage area for extensions and preprocessors
|
||||
//
|
||||
MathJax.Extension = {};
|
||||
|
||||
|
@ -1918,7 +1918,7 @@ MathJax.Hub.Startup = {
|
|||
return HUB.Process(script,callback);
|
||||
},
|
||||
Remove: function () {
|
||||
this.outputJax.Remove(this);
|
||||
MathJax.OutputJax[this.outputJax].Remove(this);
|
||||
HUB.signal.Post(["Remove Math",this.inputID]); // wait for this to finish?
|
||||
this.Detach();
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
(function (HUB,HTML,AJAX,HTMLCSS,nMML) {
|
||||
var VERSION = "1.1";
|
||||
var VERSION = "1.1.1";
|
||||
|
||||
var CONFIG = HUB.CombineConfig("MathZoom",{
|
||||
delay: 400, // mouse must be still this long (milliseconds)
|
||||
|
@ -148,8 +148,8 @@
|
|||
if (parent.parentNode.className === "MathJax_MathContainer") {parent = parent.parentNode.parentNode}
|
||||
var script = (String(parent.className).match(/^MathJax_(MathML|Display)$/) ? parent : math).nextSibling;
|
||||
var jax = HUB.getJaxFor(script), root = jax.root;
|
||||
var JAX = (HTMLCSS && jax.outputJax.isa(HTMLCSS.constructor) ? "HTMLCSS" :
|
||||
(nMML && jax.outputJax.isa(nMML.constructor) ? "MathML" : null));
|
||||
var JAX = (HTMLCSS && jax.outputJax === "HTML-CSS" ? "HTMLCSS" :
|
||||
(nMML && jax.outputJax === "NativeMML" ? "MathML" : null));
|
||||
if (!JAX) return; // FIXME: report an error?
|
||||
|
||||
//
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
|
||||
id: "HTML-CSS",
|
||||
version: "1.1",
|
||||
version: "1.1.1",
|
||||
directory: MathJax.OutputJax.directory + "/HTML-CSS",
|
||||
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
|
||||
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",
|
||||
|
@ -108,7 +108,7 @@ MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) {
|
|||
minBrowserTranslate: function (script) {
|
||||
var MJ = HUB.getJaxFor(script), text = ["[Math]"], delim;
|
||||
var span = document.createElement("span",{className: "MathJax_Preview"});
|
||||
if (MJ.inputJax.id === "TeX") {
|
||||
if (MJ.inputJax === "TeX") {
|
||||
if (MJ.root.Get("displaystyle")) {
|
||||
delim = CONFIG.displayMathDelimiters;
|
||||
text = [delim[0]+MJ.originalText+delim[1]];
|
||||
|
|
|
@ -418,7 +418,7 @@
|
|||
var math = (this.parentNode.className === "MathJax_Display" ? this.parentNode : this)
|
||||
MENU.jax = HUB.getJaxFor(math.nextSibling);
|
||||
MENU.menu.items[1].menu.items[1].name =
|
||||
(MENU.jax.inputJax.id === "MathML" ? "Original" : MENU.jax.inputJax.id);
|
||||
(MENU.jax.inputJax === "MathML" ? "Original" : MENU.jax.inputJax);
|
||||
return MENU.menu.Post(event);
|
||||
} else {
|
||||
if (!AJAX.loadingMathMenu) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
MathJax.OutputJax.NativeMML = MathJax.OutputJax({
|
||||
id: "NativeMML",
|
||||
version: "1.1",
|
||||
version: "1.1.1",
|
||||
directory: MathJax.OutputJax.directory + "/NativeMML",
|
||||
extensionDir: MathJax.OutputJax.extensionDir + "/NativeMML",
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
var script = (isMSIE ? this.parentNode.parentNode.nextSibling : this.parentNode.nextSibling);
|
||||
MENU.jax = HUB.getJaxFor(script);
|
||||
MENU.menu.items[1].menu.items[1].name =
|
||||
(MENU.jax.inputJax.id === "MathML" ? "Original" : MENU.jax.inputJax.id);
|
||||
(MENU.jax.inputJax === "MathML" ? "Original" : MENU.jax.inputJax);
|
||||
delete nMML.trapClick; delete nMML.trapUp;
|
||||
return MENU.menu.Post(event);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user