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({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,','fontSize',':','this.testSize','[0],','fontWeight',':"normal",','fontStyle',':"normal"}},[""]);this.text=',10,'.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.',35,'(j[h])){return j[h',']}}return null},',35,':',1,'f','){return',' this.testFont(this.FontInfo[f])},testFont:',1,'h){if(h.','isWebFont','&&e.FontFaceBug){','this.div.style.',26,'=',57,28,'="normal"}else{',57,26,'=(h.weight||"normal");',57,28,'=(h.style||"normal")}','var g=this.','getComparisonWidths','(h.',5,',','h.noStyleChar',');if(g){',57,'fontFamily','="\'"+h.family+"\',"+','this.comparisonFont','[0];if(','this.div.offsetWidth','==g[0]){',57,77,'="\'"+h.family+"\',"+',79,'[g[2]];if(',81,'==g[1]){','return false','}}if(',81,'!=g[3]){if(',74,'||!e.FONTDATA||!','e.FONTDATA.','hasStyleChar',51,' true',38,'j=0,f=',24,'.length;','j<f;j++){',43,'testStyleChar','(h,',24,'[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=',57,22,';',57,22,'=j;if(e.msieItalicWidthBug&&h.style==="italic"){this.text.nodeValue=g=','this.compChar',';i=',81,'}','if(e.safariTextNodeBug){this.div.innerHTML=',130,'+g','}else{this.text.nodeValue=',130,'+g}','var f=',81,'-i;',134,'this.styleChar','+g',137,144,'+g}var k','=Math.floor((',81,'-i)/f+0.5);if(k===m){',134,'this.',114,'+g',137,'this.',114,'+g}h.version',149,81,'-i)/f+1.5)/2}',57,22,'=l;return(k===m)},',70,':',1,'j,h){if(e.FONTDATA&&',96,97,'&&!h){j+=',144,'+" "+',130,'}',134,'j',137,'j}',57,77,'=',79,'[0];var g=',81,',l=-1;if(','e.safariWebFontSerif','){',57,77,'=',188,'[0];l=',81,38,'k=1,f=',79,103,'k<f;k++){',57,77,'=',79,'[k];if(',81,'!=g',51,'[g,',81,',k,l',46,'loadWebFont',':',1,'f){','d.Startup.signal.Post("HTML-CSS Jax - ','Web-Font',' "+e.fontInUse+"/"+f.directory',');var h','=','MathJax.Message.','File("Web-Font',219,');var g=',3,'.Callback','(["loadComplete",this,f,h]);c.timer.start(c,[this.checkWebFont,f,g],1);',37,'},loadComplete:',1,'g,i,f){if(f!==c.STATUS.OK){this.loadError(g);if(d.Browser.isFirefox&&e','.allowWebFonts','){var h=','document.location.','protocol+"//"+',235,'hostname;if(',235,'port!=""){h+=":"+',235,'port}h+="/";if(','c.fileURL(e.webfontDir',').substr(0,h.length)!==h){this.','firefoxFontError','(g)}}}',222,'Clear(i)},loadError:',1,'f){',222,'Set("Can\'t ','load web font',219,',null,2000)},',245,':',1,'f){',222,'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){var i=','e',233,';var g=',243,'+"/"+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,279,55,')){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","',286,291,'line-height',291,'font-size":"100%","','font-size-adjust":"none','","text-indent":0,"text-align":"left","text-transform":"none","letter-spacing',291,'word-spacing',291,'word-wrap',291,'white-space":"nowrap","float":"none",','border:0,padding:0,margin:0','},".','MathJax_Displ
['de(55349),NBSP:String.fromCharCode(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(',21,'[g]){',21,'[g].toHTML(','l)}}var o=','this.HTMLcomputeBBox(','l);var k=l.bbox.h,n=l.bbox.d;for(',20,'o',22,'o[g].','HTMLstretchV','(l,k,n)}if(o',7,'){',29,'l,true)}','this.HTMLhandleSpace(','l',');this.HTMLhandleColor(','l);',9,'l},',4,':function(){','var k=[[0,this]];','for(var h=0,f=',21,'.length;h<f;h++){','if(',21,'[h]){','var l=',21,'[h].lineBreak',5,'l!=="none"){var g=(l==="after"?h+1:h);if(k',7,'===0||k[k',7,'-1]!==g){k.push([g,',21,'[h]])}else{k[k',7,'-1]=[g,',21,'[h]]}}}}k.push([',21,7,',k[k',7,'-1][1]]);',9,'k},',11,':function(','f){a.mbase.','HTMLautoloadFile','("multiline")},','HTMLcomputeBBox',79,'l,k,j,','f){if(','j','==null){','j=0}if(f',88,'f=',21,7,'}var h=','l.bbox={},n=[];while(j<f','){var g','=',21,'[j];if(!g){continue}if(!k&&g.','HTMLcanStretch','("Vertical")){','n.push(g);g=(g.CoreMO()||g)}',10,'HTMLcombineBBoxes','(g,h);j++}',10,'HTMLcleanBBox','(h);',9,'n},',104,79,'f,g){if(g.w',88,10,'HTMLemptyBBox','(g)}var i=f.','HTMLspanElement','();if(!i||!i.bbox){return',94,'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',122,')*(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+=',124,'i',129,127,'h.width){g.width=h.width}},',116,79,'f','){f.h=f.d=f.H=f.D=f.','rw=-','e.BIGDIMEN',';f.w=0;f.lw=',141,';',9,'f},',107,79,86,'f.h===',10,'BIGDIMEN',139,'w=f.rw=f.lw=0}if(f.D<=f.d){delete f.D}if(f.H<=f.h){delete f.H}},','HTMLzeroBBox',48,'return{h:0,d:0,w:0,lw:0,rw:0}},',100,79,'f){',15,'isEmbellished','()){',9,10,'Core().',100,'(f)}',9,'false},','HTMLstretchH',79,'g,f){',9,10,118,'()},',35,79,'g,f,i){',9,10,118,177,'HTMLnotEmpty',79,'f){while(f){if((f.type!=="mrow"&&f.type!=="texatom")||f.data',7,'>1){',9,'true}f=f.data[0]}',9,170,'HTMLmeasureChild',79,173,'if(',21,'[g]!=null){','e.Measured(',21,27,'f),f)}else{f.bbox',3,155,'()}},HTMLcreateSpan',79,'f){',15,'spanID',96,3,118,5,'g){while(g','.firstChild','){g','.removeChild(','g',216,')}g','.bbox={w:0,h:0,d:0,lw:0,','rw:0};g.scale=1;g.isMultChar=null;g','.style.cssText','="";',9,'g}}',15,'href){f','=','e.addElement(','f,"a",{href:',10,'href})}f=',231,'f,"span",{className:',10,'type});if(e.imgHeightBug){f.style.display="inline-block"}if(this["class"]!=null){f.className+=" "+this["class"]}',15,'style){f',224,3,'style;if(f','.style.fontSize','){',10,'mathsize','=f',244,';f',244,'=""}}',10,'spanID=','e.GetID();f.id=(','this.id||"MathJax-Span-"+this.spanID)+e.idPostfix',';f',222,'lr:0};',15,229,'.parentNode','.bbox=f.bbox}',9,'f},',118,48,'if(!',10,210,'){',9,'null}',9,'document.getElementById','((',256,')},','HTMLhandleVariant',79,'g,f,h){e.handleVariant(g,f,h)},HTMLhandleSize',79,'f){if(!','f.scale){f.scale','=this.HTMLgetScale',5,'f.scale!==1){f',244,'=e.Percent(f.scale)}}',9,'f},','HTMLhandleColor',79,'k){var m','=this.getValues("','mathcolor','","color");if(this','.mathbackground','){m',298,'=this',298,'}if(','this.background','){m.','background','=',304,'}',15,'style&&k.style.','backgroundColor','){m',298,'=k.style.',312,'}if(m.','color&&!',10,296,305,296,'=m.color',317,306,'&&!this',298,'){m',298,'=m.',306,317,296,'){k.style.color=m.',296,'}if(m',298,'&&m',298,'!==a.COLOR.TRANSPARENT){','var n=','1/e.em,j=0,i=0;',15,'isToken){j=k.bbox.lw;i=','k.bbox.rw','-k.bbox.w','}if(k',122,'!==""){j+=',124,'k',122,')*(k.scale||1)}','if(k',129,'!==""){i-=',124,'k',129,353,'var h','=Math.max(','0,e.getW(k)+(e.PaddingWidthBug?0:i-j));if(e.','msieCharPaddingWidthBug','&&k',122,'!==""){h+=',124,'k',122,353,56,'k.bbox.h+k.bbox.d',',f=-k.bbox.d;if(h>0){h+=2*n;j-=n}if(l>0){l+=2*n;f-=n}i=-h-j;var g=e.Element("span",{id:"','MathJax-Color-"+this.spanID
]);