instiki/public/MathJax/jax/output/HTML-CSS/autoload/mtable.js
Jacques Distler 1663d9f5c8 MathJax
For those without MathML-capable browsers,
we present MathJax. It's crappy 'n slow,
but it's better than nothing.
2010-10-17 22:30:56 -05:00

18 lines
7.9 KiB
JavaScript

/*
* ../SourceForge/trunk/mathjax/jax/output/HTML-CSS/autoload/mtable.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,b){var c="1.0";a.mtable','.Augment({toHTML:function(','X){X','=this.HTMLcreateSpan(','X);if(','this.data','.length','===0){return X}var aJ','=this.getValues("','columnalign','","','rowalign','","','columnspacing','","','rowspacing','","','columnwidth','","','equalcolumns','","equalrows","','columnlines','","rowlines","frame","framespacing","align","useHeight","width","side","','minlabelspacing','");var r=','aJ.width','.match(/%$/);var ag=','b.createStack(','X);var am=this.HTMLgetScale();var aH=-1;var w=[],I=[],l=[],O=[],K=[],aF,aE,v=-1,aC,t,ay,R;var aL','=b.FONTDATA.','baselineskip*am*aJ.useHeight,Z',29,'lineH*am,af',29,'lineD*am;','for(aF=0,aC=',5,'.length;aF<aC;aF++){','R=',5,'[aF];ay=(R.','type==="mlabeledtr"?aH:0);','O[aF]=[];w[aF]=I[aF]=0;for(aE=ay,t=R.data',6,'+ay;aE<t;aE++){if(l[aE]==null){if(aE>v){v=aE}K[aE]=',27,'b.createBox(','ag));l[aE]=-b.BIGDIMEN}O[aF][aE]=',46,'K[aE]);b.Measured','(R.data[aE-ay].','toHTML(O[aF][aE]),O[aF][aE]);if',50,'isMultiline){O[aF][aE].','style.width="100','%"}if(','O[aF][aE].bbox','.h>w[aF]){w[aF]=',56,'.h}if(',56,'.d>I[aF]){I[aF]=',56,'.d}if(',56,'.w>l[aE]){l[aE]=',56,'.w}}}if(w[0]+I[0]){w[0',']=Math.max(','w[0],Z)}if(w[','O.length-1',']+I[',70,']){I[',70,68,'I[',70,'],af)}var al=aJ.',13,'.split(/ /),','S=aJ.',15,80,'ah=aJ.',9,80,'L=aJ.',11,80,'N=aJ.',21,80,'k=','aJ.rowlines',80,'ap=aJ.',17,80,'au=[];',35,'al',37,'al[aF]=','b.length2em(','al[aF])}',35,'S',37,'S[aF]=',104,'S[aF])}while(al',6,'<v){al.push(al[al','.length-1])}while(','ah',6,'<=v){ah.push(ah[ah',114,'N',6,'<v){N.push(N[N',114,'ap',6,'<=v){ap.push(ap[ap',114,'S',6,'<O',6,'){S.push(S[S',114,'L',6,'<=O',6,'){L.push(L[L',114,'k',6,'<O',6,'){k.push(k[k',6,'-1])}if(K[aH]){ah[aH]=(aJ.side.substr(0,1)==="l"?"left":"right");al[aH]=-l[aH]}',35,'O',37,'R=',5,'[aF];au[aF]=[];if(R.',11,'){L[aF]=R.',11,'}if(R.',9,'){au[aF]=R.',9,'.split(/ /);while(au[aF].length<=v){au[aF].push(au[aF][au[aF].length-1])}}}var az=w[0]+I[',70,'];',35,70,';aF<aC;aF++){','az+=','Math.max((w[aF]+I[aF]?aL:0),I[aF]+w[aF+1]+S[aF','])}var ac=0,aa=0,aA,aI=az',';if(aJ.frame!=="none','"||(aJ.',21,'+',94,').match(/solid|dashed/)){ac=',104,'aJ.framespacing.split(/[, ]+/)[','0]);aa=',104,175,'1]);aI=az+2*aa}var h,ax;if(String(aJ.align).match(/^\\d+$/)){h=az/2+','b.TeX.axis_height*am-','w[0];ax=-(az/2+aa)}else{h=({top:-(w[0]+aa),bottom:az+aa-w[0],center:az/2-w[0],baseline:az/2-w[0],axis:az/2+',180,'w[0]})[aJ.align];ax=({top:-(az+2*aa),bottom:0,center:-(az/2+aa),baseline:-(az/2+aa),axis:',180,'az/2-aa})[aJ.align]}var aq,aw=0,U=0,V=0,aB=0,aG=0,o=[],B=[],ai=1;if(aJ.',19,'&&',25,'!=="auto"){if(r){aq=(100/(v+1)).toFixed(2).replace(/\\.?0+$/,"")+"%";','for(aF=0,aC=Math.min(v+1,','ap','.length);aF<aC;aF++){','ap[aF]=aq}aq=0;aw=1;aG=v+1;',190,'al',192,'aq+=al[aF',']}}else{aq=',104,25,');',190,'al',192,'aq-=al[aF',']}aq/=v+1;',190,'ap',192,'l[aF]=aq}}}else{',190,'ap',192,'if(ap[aF]==="auto"){','U+=l[aF]}else{if(ap[aF',']==="fit"){B[aG]=aF;aG++;',215,'].match(/%$/)){','o[aB]=aF;aB++;V+=l[aF];aw+=',104,'ap[aF],1)}else{l[aF]=',104,'ap[aF]);U+=l[aF]}}}}if(r){aq=0;',35,'Math.min(v,al',192,197,']}','if(aw>0.98){ai=','0.98/aw;aw=0.98}}else{if(',25,'==="auto"){',229,'V/(U+V);aq=U+V}else{aq=U/(1-aw)}}else{aq=',104,25,');',190,'al',192,205,']}}',35,'o',37,'l[o[aF]]=',104,'ap[o[aF]],aq*ai);U+=l[o[aF]]}if(Math.abs(aq-U)>0.01){if(aG&&aq>U){aq=(aq-U)/aG;',35,'B',37,'l[B[aF]]+=aq}}else{aq=aq/U;','for(aE=0;aE<=v;aE++){','l[aE]*=aq}}}if(aJ.',19,'){var ad','=Math.max.apply(Math,','l);',253,'l[aE]=ad}}}}if(aJ.equalrows){var T',257,'w),ao',257,'I);',35,'O',37,'ay=((T+ao)-(w[aF]+I[aF]))/2;w[aF]+=ay;I[aF]+=ay}}var ar=h,n,u,aD;ay=(K[aH]?aH:0);for(aE=ay;aE<=v;aE++){',35,'O',37,'if(O[aF][aE]){ay=(',5,'[aF].',41,'var ak=',5,'[aF].data[aE-ay];','if(ak.HTMLcanStretch("','Horizontal")){',56,'=ak.','HTMLstretchH','(K[aE],l[aE]).bbox}else{',279,'Vertical")){var z=ak.CoreMO();var ab=z.symmetric;z.symmetric=false;',56,'=ak.','HTMLstretchV','(K[aE],w[aF],I[aF]).bbox;z.symmetric=ab}}aD=ak.',11,'||',5,'[aF].',11,'||L[aF];n=({top:w[aF]-',56,'.h,bottom:',56,'.d-I[aF],center:((w[aF]-I[aF])-(',56,'.h-',56,'.d))/2,baseline:0,axis:0})[aD];aD=(ak.',9,'||au[aF][aE]||ah[aE]);b.alignBox(O[aF][aE],aD,ar+n)}if(aF<',70,'){ar-=',166,'])}}ar=h}if(r){var q=',46,'ag);q.style.left=q.style.top=0;q.style.right=b.Em(aq+2*ac);q.style','.display="inline-block";','q','.style.height','="0px";','if(b.msieRelativeWidthBug){','q=',46,'q);q.','style.position="relative','";q',315,'="1em";q.',54,'%";q.','bbox=ag.bbox','}var an=0,av=ac,aK,g;if(aG){aK=100*(1-aw)/aG,g=U/aG}else{aK=100*(1-aw)/(v+1);g=U/(v+1)}',253,'b.placeBox(','K[aE].parentNode',',0,0);K[aE].',321,'";K[aE].style.left=b.Em(av);K[aE].',54,'%";',331,'.parentNode.removeChild(',331,');var e=',46,'q',');b.addBox(','e,K[aE]);K[aE]=e;var ae=e.style;ae',313,'ae.left=an+"%";if(ap[aE',218,'var G=parseFloat(ap[aE])*ai;if(','aG===0){ae.width','=(aK+G)+"%";an+=aK+G;','e=b.createBox(e);b.addBox(e,K[aE].firstChild);e.style.left=0;e.style.right=b.Em(g',');av-=g','}else{ae.width=','G+"%";an+=G}}else{if(ap[aE]==="fit"||',349,'=aK+"%";',351,'-','l[aE]);av+=l[aE',']-g;an+=aK',353,'b.Em(',359,']}}',317,'b.addText(e.','firstChild',',b.NBSP);e.',367,'.',321,'"}av+=','al[aE];if(N[aE]!=="none"&&aE<v&&aE!==aH){u=b.','createBox(q);u.style.left=an+"%";u=b.createRule(u,aI,0,','1.25/b.em',');u.style.position="absolute";','u.bbox={h:aI,d:0,w:0,rw:1.25/b.em,lw:0};','u','.parentNode.',327,';',330,'u,av','-al[aE]/2,ax,true);u.style.borderStyle=N[aE]}}}','else{var at=ac;',253,'if(!','K[aE].bbox.width','){b.setStackWidth(K[aE],l[aE])}if(ap[aE]!=="auto"&&ap[aE]!=="fit"){',388,'=l[aE];K[aE].bbox.isFixed=true}',330,331,',at,0);at+=l[aE]+',373,'createRule(ag,','aI,0,',375,343,'ag,u);',377,330,'u,at',384,'aA=ag.bbox.w+ac;var d',168,'"){','d=b.createFrame(ag,aI,0,aA,',375,',aJ.frame);','b.addBox(ag,d);b.placeBox(d,0,ax,true);','if(r){d.',54,'%"}}ar=h;',35,70,164,'n=Math.max(aL,I[aF]+w[aF+1]+S[aF]);if(k[aF]!=="none"){u=b.',396,375,',0,aA',343,'ag,u);u.bbox={h:',375,',d:0,w:aA,rw:aA,lw:0};',330,'u,0,ar-I[aF]-(n-I[aF]-w[aF+1])/2,true);if(k[aF]==="dashed"||r){u.style.borderTop=u',315,'+" "+k[aF];u',315,'=0;u','.style.width=','u.style.borderLeftWidth;u.style.borderLeft="";if(r){u.',54,'%"}}}ar-=n}if(r){X.bbox.width=',25,';ag.',54,55,'K[aH]){var Q',8,'indentalignfirst','","','indentshiftfirst','","indentalign","indentshift");if(Q.',442,'!==a.INDENTALIGN.','INDENTALIGN){','Q.indentalign','=Q.',442,'}if(',449,'===a.INDENTALIGN.AUTO){',449,'=this.displayAlign}if(Q.',444,'!==a.INDENTSHIFT.INDENTSHIFT){','Q.indentshift','=Q.',444,'}if(',459,232,459,'=this.displayIndent}var E=',27,'X,false,"100%");b.addBox(E,ag);b.alignBox(ag,',449,',0);if(',459,'&&',449,447,'CENTER){ag.style[{left:"Left",right:"Right"}[',449,']]=b.Em(',104,459,'))}','K[aH].parentNode',338,481,343,'E,K[aH]);b.alignBox(K[aH],ah[aH],0);',317,'ag.style.top=','K[aH].style.','top=""}if(r){ag',432,25,';X.bbox.width="100%"}',488,'marginRight=',488,'marginLeft=b.Em(',104,'aJ.',23,'))}if(!r){this.','HTMLhandleSpace','(X)}var aj=','this.HTMLhandleColor(',4,'aj&&r){if(!d){',408,'0,"none");',411,'d.',54,'%"}d','.style.backgroundColor','=aj',512,';d',379,'insertBefore(d,d',379,367,');aj',338,'aj)}return X},',501,':function(d){d.style.paddingLeft=d.style.paddingRight=".1667em"}});a.mtd',1,'e,d,g){e',3,'e);if(',5,'[0]){var f=b.Measured(',5,'[0].','toHTML(e),e);if(g!=null){b.Remeasured(',5,532,289,'(e,d,g),e)}else{if(d!=null){b.Remeasured(',5,532,283,'(e,d),e)}}e.bbox=f.bbox}this.',501,'(e);',503,'e);return e},',283,':a.mbase.',283,',',289,547,289,'});MathJax.Hub.Startup.signal.Post("HTML-CSS mtable Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/mtable.js")})(MathJax.ElementJax.mml,MathJax.OutputJax["HTML-CSS"]);']
]);