Update MathJax to Version 1.1-beta

This commit is contained in:
Jacques Distler 2011-01-27 19:12:00 -06:00
parent 27a99e0146
commit 7d3f9db8f0
543 changed files with 4509 additions and 5114 deletions

View file

@ -1,5 +1,5 @@
/*
* ../SourceForge/trunk/mathjax/extensions/toMathML.js
* /MathJax/extensions/toMathML.js
*
* Copyright (c) 2010 Design Science, Inc.
*
@ -12,7 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Unpack([
['MathJax.Hub.Register.','LoadHook("[','MathJax',']/jax/element/mml/jax.js",','function(){','var b="1.0";var a=',2,'.ElementJax.mml;a.mbase','.Augment({toMathML:function(','k){var g=(this.inferred&&this.parent.inferRow);if(k==null){k=""}var e','=this.','type,d',10,'MathMLattributes','();if(e==="mspace"){','return k+"<"+e+d','+" />"}','var j=[];var h=(','this.isToken','?"":k+(g?"":" "));for(var f=0,c',10,'data.length;f<c;f++){if(','this.data[','f]){j.push(',22,'f].toMathML(h))}else{if(!',18,'){j.push(','h+"<mrow />")}}}if(',18,'){',15,'+">"+j.join("")+"</"+e+">"}if(g){return j.join("\\n")}if(j.length===0||(j.length===1&&j[0]==="")){',15,16,15,'+">\\n"+j.join("\\n")+"\\n"+k+"</"+e+">"},',13,':',4,'var j=[],g',10,'defaults;var c',10,'copyAttributes',',l',10,'skipAttributes',';','if(this.type==="','math"){j.push(\'xmlns="http://www.w3.org/1998/Math/MathML"\')}',49,'mstyle"){g=a.math.prototype.defaults}for(var d in g){if(!l[d]&&g.hasOwnProperty(d)){var e=(d==="open"||d==="close");if(this[d]!=null&&(e||this[d]!==g[d])){var k=this[d];delete this[d];if(e||this.Get(d)!==k',27,'d+\'="\'+','this.quoteHTML(','k)+\'"\')}this[d]=k}}}for(var h=0,f=c.length;h<f;h++){if(this[c[h]]!=null',27,'c[h]+\'="\'+',55,'this[c[h]])+\'"\')}}if(j.length){return" "+j.join(" ")}else{return""}},',44,':["fontfamily","fontsize","fontweight","fontstyle","color","background","id","class","href","style"],',47,':{texClass:1,useHeight:1,texprimestyle:1},quoteHTML:function(e){e=String(e).split("");for(var f=0,d=e.length;f<d;f++){var h=e[f].charCodeAt(0);if(h<32||h>126){e[f]="&#x"+h.toString(16).toUpperCase()+";"}else{var g={"&":"&amp;","<":"&lt;",">":"&gt;",\'"\':"&quot;"}[e[f]];if(g){e[f]=g}}}return e.join("")}});a.msubsup',8,'h){var e=this.type;if(this.data[this.','sup',']==null){e="','msub"}if(',22,'this.sub',68,'msup','"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\\n"+g.join("\\n")+"\\n"+h+"</"+e+">"}});a.','munderover',8,66,'under',68,'mover"}if(',22,'this.over',68,'munder',74,'TeXAtom',8,'c){return',' c+"<mrow>\\n"+',22,'0].toMathML(c+" ")+"\\n"+c+"</mrow>"}});a.chars',8,88,'(c||"")+',55,'this.toString','())}});a.entity',8,88,'(c||"")+"&"+',22,'0]+";<!-- "+',96,'()+" -->"}});',0,'StartupHook("TeX mathchoice Ready",',4,'a.TeXmathchoice',8,88,' this.Core().toMathML(c)}})});',2,'.Hub.Startup.signal.Post("toMathML Ready")});',2,'.Ajax.loadComplete("[',2,']/extensions/toMathML.js");']
]);
MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function(){var b="1.0";var a=MathJax.ElementJax.mml;a.mbase.Augment({toMathML:function(k){var g=(this.inferred&&this.parent.inferRow);if(k==null){k=""}var e=this.type,d=this.MathMLattributes();if(e==="mspace"){return k+"<"+e+d+" />"}var j=[];var h=(this.isToken?"":k+(g?"":" "));for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){j.push(this.data[f].toMathML(h))}else{if(!this.isToken){j.push(h+"<mrow />")}}}if(this.isToken){return k+"<"+e+d+">"+j.join("")+"</"+e+">"}if(g){return j.join("\n")}if(j.length===0||(j.length===1&&j[0]==="")){return k+"<"+e+d+" />"}return k+"<"+e+d+">\n"+j.join("\n")+"\n"+k+"</"+e+">"},MathMLattributes:function(){var j=[],g=this.defaults;var c=this.copyAttributes,l=this.skipAttributes;if(this.type==="math"){j.push('xmlns="http://www.w3.org/1998/Math/MathML"')}if(this.type==="mstyle"){g=a.math.prototype.defaults}for(var d in g){if(!l[d]&&g.hasOwnProperty(d)){var e=(d==="open"||d==="close");if(this[d]!=null&&(e||this[d]!==g[d])){var k=this[d];delete this[d];if(e||this.Get(d)!==k){j.push(d+'="'+this.quoteHTML(k)+'"')}this[d]=k}}}for(var h=0,f=c.length;h<f;h++){if(this[c[h]]!=null){j.push(c[h]+'="'+this.quoteHTML(this[c[h]])+'"')}}if(j.length){return" "+j.join(" ")}else{return""}},copyAttributes:["fontfamily","fontsize","fontweight","fontstyle","color","background","id","class","href","style"],skipAttributes:{texClass:1,useHeight:1,texprimestyle:1},quoteHTML:function(e){e=String(e).split("");for(var f=0,d=e.length;f<d;f++){var h=e[f].charCodeAt(0);if(h<32||h>126){e[f]="&#x"+h.toString(16).toUpperCase()+";"}else{var g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e[f]];if(g){e[f]=g}}}return e.join("")}});a.msubsup.Augment({toMathML:function(h){var e=this.type;if(this.data[this.sup]==null){e="msub"}if(this.data[this.sub]==null){e="msup"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\n"+g.join("\n")+"\n"+h+"</"+e+">"}});a.munderover.Augment({toMathML:function(h){var e=this.type;if(this.data[this.under]==null){e="mover"}if(this.data[this.over]==null){e="munder"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\n"+g.join("\n")+"\n"+h+"</"+e+">"}});a.TeXAtom.Augment({toMathML:function(c){return c+"<mrow>\n"+this.data[0].toMathML(c+" ")+"\n"+c+"</mrow>"}});a.chars.Augment({toMathML:function(c){return(c||"")+this.quoteHTML(this.toString())}});a.entity.Augment({toMathML:function(c){return(c||"")+"&"+this.data[0]+";<!-- "+this.toString()+" -->"}});MathJax.Hub.Register.StartupHook("TeX mathchoice Ready",function(){a.TeXmathchoice.Augment({toMathML:function(c){return this.Core().toMathML(c)}})});MathJax.Hub.Startup.signal.Post("toMathML Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/toMathML.js");