UNPKG

@zklogic/draw.io

Version:

Draw.IO - Graph Editor integration in Angular-cli

1 lines 3.46 kB
MathJax.Hub.Register.StartupHook("SVG Jax Ready",(function(){var t,e,a,o=MathJax.ElementJax.mml,i=MathJax.OutputJax.SVG,s=i.config.tooltip=MathJax.Hub.Insert({delayPost:600,delayClear:600,offsetX:10,offsetY:5},i.config.tooltip||{});o.maction.Augment({SVGtooltip:MathJax.HTML.addElement(document.body,"div",{id:"MathJax_SVG_Tooltip"}),toSVG:function(t,e){this.SVGgetStyles();var a=this.SVG();return"null"==this.selected().type?(this.SVGsaveData(a),a):(a.Add(this.SVGdataStretched(this.Get("selection")-1,t,e)),a.removeable=!1,this.SVGhandleHitBox(a),this.SVGhandleSpace(a),this.SVGhandleColor(a),this.SVGsaveData(a),a)},SVGhandleHitBox:function(t){var e=i.Element("rect",{width:t.w,height:t.h+t.d,y:-t.d,fill:"none","pointer-events":"all"});t.element.insertBefore(e,t.element.firstChild);var a=this.Get("actiontype");this.SVGaction[a]&&this.SVGaction[a].call(this,t,t.element,this.Get("selection"))},SVGstretchH:o.mbase.prototype.SVGstretchH,SVGstretchV:o.mbase.prototype.SVGstretchV,SVGaction:{toggle:function(t,e,a){this.selection=a,i.Element(e,{cursor:"pointer"}),e.onclick=MathJax.Callback(["SVGclick",this])},statusline:function(t,e,a){e.onmouseover=MathJax.Callback(["SVGsetStatus",this]),e.onmouseout=MathJax.Callback(["SVGclearStatus",this]),e.onmouseover.autoReset=e.onmouseout.autoReset=!0},tooltip:function(t,e,a){e.onmouseover=MathJax.Callback(["SVGtooltipOver",this]),e.onmouseout=MathJax.Callback(["SVGtooltipOut",this]),e.onmouseover.autoReset=e.onmouseout.autoReset=!0}},SVGclick:function(t){this.selection++,this.selection>this.data.length&&(this.selection=1);for(var e=this;"math"!==e.type;)e=e.inherit;return MathJax.Hub.getJaxFor(e.inputID).Update(),MathJax.Extension.MathEvents.Event.False(t)},SVGsetStatus:function(t){this.messageID=MathJax.Message.Set(this.data[1]&&this.data[1].isToken?this.data[1].data.join(""):this.data[1].toString())},SVGclearStatus:function(t){this.messageID&&MathJax.Message.Clear(this.messageID,0),delete this.messageID},SVGtooltipOver:function(t){t||(t=window.event),a&&(clearTimeout(a),a=null),e&&clearTimeout(e);var o=t.pageX,i=t.pageY;null==o&&(o=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i=t.clientY+document.body.scrollTop+document.documentElement.scrollTop);var l=MathJax.Callback(["SVGtooltipPost",this,o+s.offsetX,i+s.offsetY]);e=setTimeout(l,s.delayPost)},SVGtooltipOut:function(t){e&&(clearTimeout(e),e=null),a&&clearTimeout(a);var o=MathJax.Callback(["SVGtooltipClear",this,80]);a=setTimeout(o,s.delayClear)},SVGtooltipPost:function(i,s){e=null,a&&(clearTimeout(a),a=null);var l=this.SVGtooltip;if(l.style.display="block",l.style.opacity="",this!==t){l.style.left=i+"px",l.style.top=s+"px",l.innerHTML="";for(var n=MathJax.HTML.addElement(l,"span"),h=this;"math"!==h.type;)h=h.inherit;var c=MathJax.Hub.getJaxFor(h.inputID);this.em=o.mbase.prototype.em=c.SVG.em,this.ex=c.SVG.ex,this.linebreakWidth=c.SVG.lineWidth,this.cwidth=c.SVG.cwidth;var r=this.data[1];h=o.math(r);try{h.toSVG(n,l)}catch(t){if(this.SetData(1,r),l.style.display="none",!t.restart)throw t;return void MathJax.Callback.After(["SVGtooltipPost",this,i,s],t.restart)}this.SetData(1,r),t=this}},SVGtooltipClear:function(t){var e=this.SVGtooltip;t<=0?(e.style.display="none",e.style.opacity="",a=null):(e.style.opacity=t/100,a=setTimeout(MathJax.Callback(["SVGtooltipClear",this,t-20]),50))}}),MathJax.Hub.Startup.signal.Post("SVG maction Ready"),MathJax.Ajax.loadComplete(i.autoloadDir+"/maction.js")}));