/* * ../SourceForge/trunk/mathjax/extensions/MathMenu.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(','b,c,f','){var ','i=','b.Browser.','isPC,g=',5,'isMSIE;var e=(i?null:"5px");var j=b.Insert({delay:150,helpURL',':"http://www.mathjax.org','/Help-User/",','showRenderer',':true,','showFontMenu',':false,','showContext',14,'windowSettings',':{status:"no",toolbar:"no",locationbar:"no",menubar:"no",directories:"no",personalbar:"no",resizable:"yes",scrollbars:"yes",width:100,height:50},styles:{".','MathJax_Menu','":{','position:"absolute','","','background-color','":"white",color:"black",width:"auto",','padding:(i?"2px','":"5px 0px"),border:"','1px solid #CCCCCC','",margin:0,','cursor:"default','",font:"menu","','text-align":"','left','","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none","z-index":201,"','border-radius":e',',"-','webkit-',34,',"-','moz-',34,',"-','khtml-',34,',"','box-shadow":"0px 10px 20px #808080','","-',36,45,46,39,45,46,42,45,'",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color=\'gray\', Positive=\'true','\')"},".','MathJax_MenuItem','":{',25,' 2em":"1px 2em"),background:"transparent','"},".','MathJax_MenuTitle','":{"',23,'":"#CCCCCC",margin:(i?"-1px -1px 1px -1px":"-5px 0 0 0"),"',31,'center","','font-style":"','italic','","font-size":"80','%",color:"#444444",padding:"2px 0",overflow:"hidden',61,'MathJax_MenuArrow','":{',21,'",right:".5em",color:"#666666','","font-family":(g?"\'Arial unicode MS\'":null)},".','MathJax_MenuActive',' .',73,'":{color:"','white',61,'MathJax_MenuCheck','":{',21,'",left:".7em',77,'MathJax_MenuRadioCheck','":{',21,'",left:(i?"1em":".7em")},".','MathJax_MenuLabel','":{',25,' 2em 4px 1.33em":"1px 2em 3px 1.33em"),"',68,69,61,'MathJax_MenuRule',63,'border-top":(i?"',27,'":"1px solid #DDDDDD"),margin:(i?"4px 1px 0px":"4px 3px")},".','MathJax_MenuDisabled',81,'GrayText',61,78,63,23,'":(i?"Highlight":"#606872"),color:(i?"HighlightText":"white")}}},(b.config.MathMenu||{}));var d=',1,'k){if(!k){k','=window.event}','if(','k){if(','k.preventDefault','){',118,'()}if(','k.stopPropagation','){',122,'()}k.cancelBubble=true;k.returnValue=false}','return ','false};var a=MathJax.Menu','=MathJax.Object.Subclass({','items:[],posted',14,'title:null,margin:5,Init:',1,'k){this.items=[].','slice.call(arguments,','0)},With:',1,'k){if(k){b.Insert(this,k)}return this},','Post:',1,'l,u){if(!l){l',115,'var s=(!this.title?null:[["div",{','className:"',62,'"},[this.','title]]]);var k','=document.getElementById("MathJax_MenuFrame','");if(!k){k','=a.Background(','this)}var n=c','.addElement(','k',',"div",{','onmouseup:a.Mouseup,','ondblclick',':this.False,ondragstart:this.False,onselectstart:this.False,','oncontextmenu',':this.False,','menuItem',':this,',143,19,'"},s);for(var p=0,o=this.items.length;p',168,166,'-this.margin','){t=',168,166,'-n.',166,183,'}a.skipUp=true}else{var q="left",v=u.',166,';t=u.',166,'-2;r=0;while(u&&u!==k){t+=u.offsetLeft;r+=u.offsetTop;u=u.parentNode}if(t+n.',166,'>',168,166,183,'){q="right";t=Math.max(this.margin,t-v-n.',166,'+6)}if(!i){n.style["borderRadiusTop','"+q]=0;n.style["','WebkitBorderRadiusTop',203,'MozBorderRadiusTop',203,'KhtmlBorderRadiusTop"+q]=0}}n.style.left=t+"px";n.style.top=r+"px";if(','document.selection','&&',209,'.empty){',209,'.empty()}','return this.False(','l)},Remove:',1,'k,l){','var m',147,'");if(m){m.','parentNode.removeChild(','m',');if(this.','msieBackgroundBug','){detachEvent("onresize",a.Resize)}}},Mouseup:',1,218,'if(a.skipUp){delete a.skipUp}else{','this.Remove(k,l',')}},False:d},{config:j,div:null,Remove:',1,'k){a.Event(k,this,"','Remove")},Mouseover:',1,233,'Mouseover")},Mouseout:',1,233,'Mouseout")},Mousedown:',1,233,'Mousedown")},Mouseup:',1,233,'Mouseup")},Mousemove:',1,233,'Mousemove")},Event:',1,'m,n,k){if(!m){m',115,'var l=n.',159,';if(l&&l[k]){',126,'l[k](m,n)}',126,'null},BGSTYLE:{',21,'",left:0,top:0,"z-index":200,width:"100%",height:"100%",border:0,padding:0,margin:0},Background:',1,'l',3,'m=c',151,'document.','body,"','div",{style:this.BGSTYLE,','id:"MathJax_MenuFrame"},[["',269,159,':l,','onmousedown',':this.Remove}]]);var k=m.','firstChild',';if(l.',225,'){k.style.backgroundColor="white";k.style.filter="alpha(opacity=0)";m.width=m.height=0;this.Resize();attachEvent("onresize",this.Resize)}else{k','.style.position="','fixed"}',126,'m},Resize:','function(){','setTimeout(a.SetWH,0)},SetWH:','function(){var ','k',147,'");if(k){k=k.',276,';k',164,'=k.style.height="1px";k',164,'=',168,'scrollWidth+"px";k.style.height=',168,'scrollHeight','+"px"}},saveCookie:',284,'c.Cookie.Set("menu",this.cookie)},getCookie:',284,'this.cookie=c.Cookie.Get("menu")}});var h=a.ITEM',128,'name:"",Create:',1,'l){if(!','this.hidden',3,'k={onmouseover:a.Mouseover,onmouseout:a.Mouseout,',154,274,156,'onselectend',158,143,57,'",',159,':this};if(this.disabled){','k.className+=" ',105,'"}c',151,'l,"div",k,this.Label(k,l))}},Mouseover:',1,'p,r','){if(!this.disabled){','this.Activate(r)}','if(!this.menu||!this.menu.posted){','var q',147,'").childNodes,','l=r','.parentNode.childNodes;for(var ','n=0,k=l.length;n=0','&&r','.parentNode.',159,'!==q[k].',159,'){q[k].',159,'.posted=false;','q[k].',222,'q[k]);k--}if(this.Timer){this.Timer(p,r)}}},Mouseout:',1,218,331,'this.Deactivate(','l)}','if(this.timer){clearTimeout(this.timer',');delete this.timer','}},Mouseup:',1,218,126,230,')},Remove:',1,218,'l=l',344,159,';',126,'l.Remove(k,l)},Activate:',1,'k){',357,'k);',322,78,'"},Deactivate:',1,'k){k.className=k.className.replace(/ ',78,'/,"")},With:',1,137,'False:d});a.ITEM.COMMAND','=a.ITEM.Subclass({','action:function(){},Init:',1,'k,m',',l){this.name=k;this.','action=m;this.With(l)},Label:',1,218,'return[this.name',']},Mouseup:',1,'k,l',329,230,');this.action.call(this)}',215,'k',')}});a.ITEM.','SUBMENU',389,'menu:null,marker:(i&&!',5,'isSafari?"\\u25B6":"\\u25B8"),Init:',1,'k,m){this.name=k;var l=1;if(!(m instanceof a.ITEM)){this.With(m),l++}this.menu=a.apply(a,[].',134,'l))},Label:',1,218,'k.onmousemove=a.Mousemove;this.menu',350,397,'+" ",["span",{',143,73,145,'marker]]]},Timer:',1,218,359,')}k={clientX:k.clientX,clientY:k.clientY};this.timer=setTimeout(MathJax.Callback(["Mouseup",this,k,l]),j.delay)},Mouseup:',1,'l,o',329,'if(!this',340,359,360,'}this.menu.Post(l,o)}else{var n',147,334,'k=n',342,3,'p=n[k];p.',159,350,'p.',222,'p);if(p.',159,'===this.menu){break}k--}}}',215,'l',406,'RADIO',389,'variable:null,marker',':(i?"\\u25CF":"\\u2713"),Init:',1,'l,k,m){this.name=l;this.variable=k;this.With(m',224,'value==null){this.value=this.name}},Label:',1,'l,m){var k={className:"',89,'"};if(','j.settings[this.variable',']!==this.value){k={','style:{display:"','none"}}}return[["span",k,[this.marker]]," "+this.name]},Mouseup:',1,'o,p',329,'var q=p',336,'l=0,k=q.length;l/g,">");m.',267,'open();','m.document.write','("MathJax Equation Source");',703,'("
"+q+"
");',703,'("");m.',267,'close();var o=m.',168,276,';var n=(m.outerHeight-m.innerHeight)||30,l=(m.outerWidth-m.innerWidth)||30;l','=Math.min(Math.floor(0.5*screen.','width),o.',166,'+l+25);n',714,'height),o.offsetHeight+n+25);m.resizeTo(l,n);if(p&&p.screenX!=null',3,'k','=Math.max(0,Math.min(p.','screenX-Math.floor(l/2),screen.width-l-20)),r',722,'screenY-Math.floor(n/2),screen.height-n-20));m.moveTo(k,r)}delete ',655,'w};a.Scale=',286,'l=',548,549,'"],k=',548,'.NativeMML;var n=(l?l','.config.scale',':k',735,');var m=prompt("Scale all mathematics (compared to surrounding text) by",n+"%");if(m){if(m.match(/^\\s*\\d+\\s*%?\\s*$/)){m=parseInt(m);if(m){if(m!==n){if(l){l',735,'=m}if(k){k',735,'=m}a.cookie.scale=m;a.saveCookie();b.Reprocess()}}','else{alert("The scale should ','not be zero")}}',743,'be a perentage (e.g., 120%)")}}};a.Zoom=',284,'if(!MathJax.Extension.MathZoom){',665,'MathZoom.js")}};a.Renderer=',286,'k=b.config.outputJax["jax/mml"];if(k[0]!==',651,'renderer','){',663,'(["Require','",f,"[MathJax]/','jax/output/"+',651,754,'+"/config.js"],[',286,'o=',548,'[',651,754,'];for(var n=0,l=k.length;n7;a.Augment({margin:20,',225,':(l||!m),msieAboutBug:l})}});j.settings=b.config.menuSettings;if(!',651,'format){',651,'format=(',553,'.TeX?"TeX":"MathML")}if(typeof(',651,11,')!=="undefined"){j.',11,'=',651,11,'}if(typeof(',651,13,797,13,'=',651,13,'}if(typeof(',651,15,797,15,'=',651,15,'}a.getCookie();a.menu=a(h.COMMAND("Show Source",a.ShowSource),','h.SUBMENU("','Format",h.RADIO("MathML","format"),h.RADIO("TeX","format",{disabled:!',553,'.TeX})),h.RULE(),',819,'Settings",',819,'Zoom Trigger",h.RADIO("Hover','","zoom",{action:a.Zoom}),h.RADIO("','Click',827,'Double-Click',827,'No Zoom","zoom",{value:"None"}),h.','RULE(),h.','LABEL("Trigger Requires:"),h.CHECKBOX((',5,'isMac?"Option":"Alt"),"ALT"),h.CHECKBOX("Command","CMD",{hidden:!',5,'isMac}),h.CHECKBOX("','Control","CTRL",{hidden:',5,838,'Shift","Shift")),',819,'Zoom Factor",h.RADIO("125','%","zscale"),h.RADIO("','133',845,'150',845,'175',845,'200',845,'250',845,'300',845,'400%","zscale")),h.RULE(),',819,'Math Renderer','",{hidden:!j.',11,'},h.RADIO("','HTML-CSS','","renderer",{action:a.Renderer','}),h.RADIO("MathML',865,',value:"NativeMML"})),',819,'Font Preference',861,13,'},h.LABEL("For HTML-CSS:"),h.RADIO("Auto","','font",{action:a.Font}),h.',833,'RADIO("TeX (','local)","',874,876,'web)","',874,876,'image)","',874,833,'RADIO("STIX (local)","font",{action:a.Font})),',819,'Contextual Menu',861,15,863,'MathJax","context"),h.RADIO("Browser","context")),h.COMMAND("Scale All Math ...",a.Scale)),h.',833,'COMMAND("About MathJax",a.About),h.COMMAND("MathJax Help",a.Help));a.',11,'=',1,'k){a.cookie.',11,'=j.',11,'=k;a.saveCookie();a.menu.items[3].menu.','item[3','].hidden=!k};','a.',13,'=',1,898,13,'=j.',13,902,'items[4',904,'a.',15,'=',1,898,15,'=j.',15,902,'items[5',904,663,'(["Styles",f,j.styles],["Post",b.Startup.signal,"MathMenu Ready"],["loadComplete',758,'extensions/MathMenu.js"])})(MathJax.Hub,',566,',MathJax.Ajax);'] ]);