instiki/public/MathJax/jax/output/HTML-CSS/jax.js

20 lines
46 KiB
JavaScript
Raw Normal View History

/*
* ../SourceForge/trunk/mathjax/jax/output/HTML-CSS/jax.js
*
* Copyright (c) 2010 Design Science, Inc.
*
* Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Unpack([
['(','function(','a,c,d,e){var b=','MathJax','.Object.Subclass({timeout:5*1000,FontInfo:{STIX:{family:"STIXSizeOneSym",','testString',':"() {} []"},TeX:{family:"MathJax_Size1",',5,':"() {} []"}},','comparisonFont',':["sans-serif","monospace","script","Times","Courier","Arial","Helvetica"],testSize:["40px","50px","60px","30px","20px"],Init:','function(){','this.div','=','MathJax.HTML.','addElement','(','document.body',',"div','",{style:{','position:"absolute','",','visibility:"hidden",','top:0,left:0,','width:"auto",padding:0,border:0,margin:0,textAlign:"left",textIndent:0,textTransform:"none",lineHeight:"normal",letterSpacing:"normal",wordSpacing:"normal','",','fontSize',':','this.testSize','[0],','fontWeight',':"normal",','fontStyle',':"normal"}},[""]);this.text=',12,'.firstChild','},findFont:',1,'j,g){if(g&&this.','testCollection','(g)){','return g','}for(var ','h=0,f=j','.length;h<f;h++){','if(j[h]===g','){continue}','if(this.',39,'(j[h])){return j[h',']}}return null},',39,':',1,'f','){return',' this.testFont(this.FontInfo[f])},testFont:',1,'h){if(h.','isWebFont','&&e.FontFaceBug){','this.div.style.',30,'=',61,32,'="normal"}else{',61,30,'=(h.weight||"normal");',61,32,'=(h.style||"normal")}','var g=this.','getComparisonWidths','(h.',5,',','h.noStyleChar',');if(g){',61,'fontFamily="\'"+h.family+"\',"+this.comparisonFont[','0];if(','this.div.offsetWidth','==g[0]){',61,81,'g[2]];if(',83,'==g[1]){','return false','}}if(',83,'!=g[3]){if(',78,'||!e.FONTDATA||!','e.FONTDATA.','hasStyleChar',55,' true',42,'j=0,f=',28,'.length;','j<f;j++){',47,'testStyleChar','(h,',28,'[j])){return true}}}}',90,'},styleChar:','String.fromCharCode(','61437),','versionChar',':',112,'61438),compChar:',112,'61439),',106,':',1,'h,j){var m=3+(h.weight?2:0)+(h.style?4:0);var g="",i=0;var l=',61,26,';',61,26,'=j;if(e.msieItalicWidthBug&&h.style==="italic"){this.text.nodeValue=g=','this.compChar',';i=',83,'}','if(e.safariTextNodeBug){this.div.innerHTML=',130,'+g','}else{this.text.nodeValue=',130,'+g}','var f=',83,'-i;',134,'this.styleChar','+g',137,144,'+g}var k','=Math.floor((',83,'-i)/f+0.5);if(k===m){',134,'this.',114,'+g',137,'this.',114,'+g}h.version',149,83,'-i)/f+1.5)/2}',61,26,'=l;return(k===m)},',74,':',1,'j,h){if(e.FONTDATA&&',96,97,'&&!h){j+=',144,'+" "+',130,'}',134,'j',137,'j}',61,'fontFamily=this.comparisonFont[','0];var g=',83,',l=-1;if(','e.safariWebFontSerif','){',61,'fontFamily=',186,'[0];l=',83,42,'k=1,f=this.',9,103,'k<f;k++){',61,182,'k];if(',83,'!=g',55,'[g,',83,',k,l',50,'loadWebFont',':',1,'g){','d.Startup.signal.Post("HTML-CSS Jax - ','Web-Font "+e.fontInUse+"/"+g.directory);var ','i=','MathJax.Message.','File("',213,'f=','MathJax.Callback','({});','var h=',219,'(["loadComplete",this,g,i,f]);c.timer.start(c,[this.checkWebFont,g,h],1,this.timeout',');return ','f},loadComplete:',1,'h,j,g,f){',215,'Clear(j);if(f===c.STATUS.OK){g();return}this.loadError(h);if(d.Browser.isFirefox&&e','.allowWebFonts','){var i=','document.location.','protocol+"//"+',232,'hostname;if(',232,'port!=""){i+=":"+',232,'port}i+="/";if(','c.fileURL(e.webfontDir',').substr(0,i.length)!==i){this.','firefoxFontError','(h)}}e.','loadWebFontError','(h,g)},loadError:',1,'f){',215,'Set("Can\'t ','load web font "+e.fontInUse+"/"+f.directory,null,2000)},',242,':',1,'f){',215,'Set("Firefox can\'t load web fonts from a remote host",null,3000)},checkWebFont:',1,'f,g,h){if(f.time(h)){return}if(','e.Font.testFont(','g)){h(f.STATUS.OK',')}else{','setTimeout(f,f.delay)}},fontFace:',1,'h',231,'e',230,';var g=',240,'+"/"+i);',140,'h.replace(/-b/,"-B").replace(/-i/,"-I").replace(/-Bold-/,"-Bold");if(!f.match(/-/)){f+="-Regular"}if(i==="svg"){f+=".svg#"+f}else{f+="."+i}var j={"','font-family":',96,'FONTS[h].','family,src:"url(\'"+g+"/"+f+"\')"};if(i==="svg"){j.src+=" format(\'svg\')"}','if(!(e.FontFaceBug&&',96,275,59,')){if(h.match(/-bold/)){j["','font-weight','"]="bold"}if(h.match(/-italic/)){j["font-style"]="italic"}}return j}});e.Augment({config:{useOldImageData:true,styles:{".',3,'":{display:"inline','","font-family":"serif","font-style','":"normal","',282,287,'line-heig
[':0.288888,sub1:0.15,sub2:0.247217,sup_drop:0.386108,sub_drop:0.05,delim1:2.39,delim2:1,axis_height:0.25,rule_thickness:0.06,','big_op_spacing1',':0.111111,','big_op_spacing2',':0.166666,','big_op_spacing3',':0.2,','big_op_spacing4',':0.6,','big_op_spacing5',':0.1,scriptspace:0.1,nulldelimiterspace:0.12,delimiterfactor:901,delimitershortfall:0.1,min_rule_thickness:1.25},PLANE1',':String.fromCharCode(','55349),NBSP',11,'160),rfuzz:0});a.mbase','.Augment({toHTML:function(','l){','var j=this.','HTMLlineBreaks','();if(','j','.length','>2','){return ','this.','toHTMLmultiline','(l,j)}l=','this.HTMLcreateSpan(','l);','if(this.','type!="mrow"){l','=this.HTMLhandleSize(','l)}for(var g=0,f=','this.data.length',';g<f;g++){','if(','this.data[','g]){',36,'g].toHTML(','l)}}var o=','this.HTMLcomputeBBox(','l);var k=l.bbox.h,n=l','.bbox.d;for(g=0,f=','o',21,34,'o[g].','HTMLstretchV','(l,k,n)}if(o',21,'){',41,'l,true)}','this.HTMLhandleSpace(','l',');this.HTMLhandleColor(','l',');return ','l},',18,':function(){var ','k=[[0,this]];','for(var h=0,f=',33,';h<f;h++){','if(',36,'h]){','var l=',36,'h].lineBreak',19,'l!=="none"){var g=(l==="after"?h+1:h);if(k',21,'===0||k[k',21,'-1]!==g){k.push([g,',36,'h]])}else{k[k',21,'-1]=[g,',36,'h]]}}}}k.push([',33,',k[k',21,'-1][1]]);','return ','k},',25,':function(','f){a.mbase.','HTMLautoloadFile','("multiline")},','HTMLcomputeBBox',91,'l,k,j,','f){if(','j==null){j=0}if(f==null){f=',33,'}var h=','l.bbox={},n=[];while(j<f','){var g=',36,'j];if(!g){continue}if(!k&&g.','HTMLcanStretch','("Vertical")){','n.push(g);g=(g.CoreMO()||g)}this.','HTMLcombineBBoxes','(g,h);j++}this.','HTMLcleanBBox','(h',58,'n},',109,91,'f,g){if(g.w==null){this.','HTMLemptyBBox','(g)}var i=f.','HTMLspanElement','();if(!i||!i.bbox){return',101,'i.bbox;if(h.d>g.d){g.d=h.d}if(h.h>g.h){g.h=h.h}if(h.D!=null&&h.D>g.D){g.D=h.D}if(h.H!=null&&h.H>g.H){g.H=h.H}if(i','.style.paddingLeft','){g.w+=','parseFloat(','i',124,')*(i.scale||1)}if(','g.w+h.lw<g.lw){g.lw=g.w+h.lw}if(g.w+h.rw>g.rw){g.rw=g.w+h.rw}g.w+=h.w;if(i','.style.paddingRight','){g.w+=',126,'i',131,129,'h.width){g.width=h.width}},',118,91,'f','){f.h=f.d=f.H=f.D=f.','rw=-','e.BIGDIMEN',';f.w=0;f.lw=',143,';','return f},',111,91,98,'f.h===this.BIGDIMEN',141,'w=f.rw=f.lw=0}if(f.D<=f.d){delete f.D}if(f.H<=f.h){delete f.H}},HTMLzeroBBox',':function(){','return{h:0,d:0,w:0,lw:0,rw:0}},',106,91,'f){',29,'isEmbellished','()){',88,'this.Core().',106,'(f)}','return false},','HTMLstretchH',91,'g,f',23,'this.HTMLspanElement','()},',48,91,'g,f,i',23,171,172,'HTMLnotEmpty',91,'f){while(f){if((f.type!=="mrow"&&f.type!=="texatom")||f.data',21,'>1',23,'true}f=f.data[0]}',166,'HTMLmeasureChild',91,'g,',98,36,'g]!=null){','e.Measured(',36,39,'f),f)}else{f.bbox=','this.HTMLzeroBBox','()}},HTMLcreateSpan',91,'f){',29,'spanID',103,171,19,'g){while(g','.firstChild','){g','.removeChild(','g',207,')}g','.bbox={w:0,h:0,d:0,lw:0,','rw:0};g.scale=1;g.isMultChar=null;g','.style.cssText','="";',88,'g}}',29,'href){f','=','e.addElement(','f,"a",{href:this.href})}f=',222,'f,"span",{className:','this.type','});if(e.imgHeightBug){f.style.display="inline-block"}if(this["class"]!=null){f.className+=" "+this["class"]}',29,'style){f',215,'=this.style;if(f','.style.fontSize','){this.mathsize=f',232,';f',232,'=""}}','this.spanID=','e.GetID();f.id=(','this.id||"MathJax-Span-"+this.spanID)+e.idPostfix',';f',213,'lr:0};',29,220,'.parentNode','.bbox=f.bbox}',147,120,154,'if(!this.spanID',23,'null}',88,'document.getElementById','((',240,')},','HTMLhandleVariant',91,'g,f,h){e.handleVariant(g,f,h)},HTMLhandleSize',91,'f){if(!f.scale){f.scale','=this.HTMLgetScale',19,'f.scale!==1){f',232,'=e.Percent(f.scale)}}',147,'HTMLhandleColor',91,'k){var m','=this.getValues("','mathcolor','","color");if(this','.mathbackground','){m',276,'=this',276,'}if(','this.background','){m.','background','=',282,'}',29,'style&&','k.style.backgroundColor','){m',276,'=',290,';',290,'="transparent"}if(m.color','&&!this.',274,283,274,'=m.color','}if(m.',284,'&&!this',276,'){m',276,'=m.',284,303,274,'){k.style.color=m.',274,'}if(m',276,'&&m',276,'!==a.
]);