/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/MathZoom.js * * Implements the zoom feature for enlarging math expressions. It is * loaded automatically when the Zoom menu selection changes from "None". * * --------------------------------------------------------------------- * * Copyright (c) 2010-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(function(l,m,p,w,x){var q=l.CombineConfig("MathZoom",{styles:{"#MathJax_Zoom":{position:"absolute","background-color":"#F0F0F0",overflow:"auto",display:"block","z-index":301,padding:".5em",border:"1px solid black",margin:0,"font-weight":"normal","font-style":"normal","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","box-shadow":"5px 5px 15px #AAAAAA","-webkit-box-shadow":"5px 5px 15px #AAAAAA","-moz-box-shadow":"5px 5px 15px #AAAAAA","-khtml-box-shadow":"5px 5px 15px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX\x3d2, OffY\x3d2, Color\x3d'gray', Positive\x3d'true')"},"#MathJax_ZoomOverlay":{position:"absolute",left:0,top:0,"z-index":300,display:"inline-block",width:"100%",height:"100%",border:0,padding:0,margin:0,"background-color":"white",opacity:0,filter:"alpha(opacity\x3d0)"},"#MathJax_ZoomFrame":{position:"relative",display:"inline-block",height:0,width:0},"#MathJax_ZoomEventTrap":{position:"absolute",left:0,top:0,"z-index":302,display:"inline-block",border:0,padding:0,margin:0,"background-color":"white",opacity:0,filter:"alpha(opacity\x3d0)"}}}),r,t,v;MathJax.Hub.Register.StartupHook("MathEvents Ready",function(){v=MathJax.Extension.MathEvents.Event;r=MathJax.Extension.MathEvents.Event.False;t=MathJax.Extension.MathEvents.Hover});var c=MathJax.Extension.MathZoom={version:"2.2",settings:l.config.menuSettings,scrollSize:18,HandleEvent:function(b,a,d){return c.settings.CTRL&&!b.ctrlKey||c.settings.ALT&&!b.altKey||c.settings.CMD&&!b.metaKey||c.settings.Shift&&!b.shiftKey||!c[a]?!0:c[a](b,d)},Click:function(b,a){if("Click"===this.settings.zoom)return this.Zoom(b,a)},DblClick:function(b,a){if("Double-Click"===this.settings.zoom)return this.Zoom(b,a)},Hover:function(b,a){return"Hover"===this.settings.zoom?(this.Zoom(b,a),!0):!1},Zoom:function(b,a){this.Remove();t.ClearHoverTimer();v.ClearSelection();var d=MathJax.OutputJax[a.jaxID],c=d.getJaxFromMath(a);c.hover&&t.UnHover(c);var g=Math.floor(.85*document.body.clientWidth),h=Math.floor(.85*Math.max(document.body.clientHeight,document.documentElement.clientHeight)),k=m.Element("span",{id:"MathJax_ZoomFrame"},[["span",{id:"MathJax_ZoomOverlay",onmousedown:this.Remove}],["span",{id:"MathJax_Zoom",onclick:this.Remove,style:{visibility:"hidden",fontSize:this.settings.zscale,"max-width":g+"px","max-height":h+"px"}},[["span",{style:{display:"inline-block","white-space":"nowrap"}}]]]]),e=k.lastChild,u=e.firstChild,p=k.firstChild;a.parentNode.insertBefore(k,a);a.parentNode.insertBefore(a,k);u.addEventListener&&u.addEventListener("mousedown",this.Remove,!0);if(this.msieTrapEventBug){var n=m.Element("span",{id:"MathJax_ZoomEventTrap",onmousedown:this.Remove});k.insertBefore(n,e)}this.msieZIndexBug&&(m.addElement(document.body,"img",{src:"about:blank",id:"MathJax_ZoomTracker",width:0,height:0,style:{width:0,height:0,position:"relative"}}),k.style.position="relative",k.style.zIndex=q.styles["#MathJax_ZoomOverlay"]["z-index"]);d=d.Zoom(c,u,a,g,h);this.msiePositionBug&&(this.msieSizeBug&&(e.style.height=d.zH+"px",e.style.width=d.zW+"px"),e.offsetHeight>h&&(e.style.height=h+"px",e.style.width=d.zW+this.scrollSize+"px"),e.offsetWidth>g&&(e.style.width=g+"px",e.style.height=d.zH+this.scrollSize+"px"));this.operaPositionBug&&(e.style.width=Math.min(g,d.zW)+"px");e.offsetWidth&&e.offsetWidth=a;c.msieInlineBlockAlignBug=7>=a;c.msieTrapEventBug=!window.addEventListener;"BackCompat"===document.compatMode&&(c.scrollSize=52);d&&delete q.styles["#MathJax_Zoom"].filter},Opera:function(b){c.operaPositionBug=!0;c.operaRefreshBug=!0}});c.topImg=c.msieInlineBlockAlignBug?m.Element("img",{style:{width:0,height:0,position:"relative"},src:"about:blank"}):m.Element("span",{style:{width:0,height:0,display:"inline-block"}});if(c.operaPositionBug||c.msieTopBug)c.topImg.style.border="1px solid";MathJax.Callback.Queue(["StartupHook",MathJax.Hub.Register,"Begin Styles",{}],["Styles",p,q.styles],["Post",l.Startup.signal,"MathZoom Ready"],["loadComplete",p,"[MathJax]/extensions/MathZoom.js"])})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax["HTML-CSS"],MathJax.OutputJax.NativeMML);