drawio/war/js/embed.min.js
Gaudenz Alder b3a060a194 5.6.0.0 release
Former-commit-id: 648b0f02cb
2016-09-06 16:07:11 +02:00

20 lines
No EOL
10 KiB
JavaScript

(function(x,r){function L(){if(!s){s=!0;window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config({"HTML-CSS":{availableFonts:[],webFont:"STIX-Web",imageFont:null}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<q.length;a++)MathJax.Hub.Queue(["Typeset",MathJax.Hub,q[a]])})}};var a=document.createElement("script");a.type="text/javascript";a.src="https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config\x3dTeX-MML-AM_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(a)}}function M(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.container]):q.push(a.container);a.addListener(mxEvent.SIZE,function(d,m){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.container])})}mxStencilRegistry.dynamicLoading=!1;try{var d=document.createElement("style");d.type="text/css";d.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}";
document.getElementsByTagName("head")[0].appendChild(d)}catch(S){}var F=mxClient.NO_FO,s="undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub,q=[];mxGraph.prototype.getImageFromBundles=function(a){return null!=a?("http://"!=a.substring(0,7)&&("https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10))&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a="https://www.draw.io/"+a),a):null};if(null!=r)for(d=0;d<r.length;d++){var y=mxUtils.parseXml(r[d]);mxStencilRegistry.parseStencilSet(y.documentElement)}mxClient.IS_TOUCH&&
(mxPanningHandler.prototype.isPanningTrigger=function(a){return!0});(function(){function a(a){try{for(var e=a.firstChild;null!=e&&e.nodeType!=mxConstants.NODETYPE_ELEMENT;)e=e.nextSibling;var h=mxUtils.trim(e.innerHTML);a.innerHTML="";var b=new Graph(a),h="\x26lt;"==h.substring(0,4)?h.replace(/&lt;/g,"\x3c").replace(/&gt;/g,"\x3e").replace(/&amp;gt;/g,"\x26gt;").replace(/&amp;lt;/g,"\x26lt;").replace(/&amp;quot;/g,"\x26quot;").replace(/&#xa;/g,"\n"):"%3C"==h.substring(0,3)?decodeURIComponent(h):b.decompress(h),
g=mxUtils.parseXml(h),d=e=null;null!=g.documentElement&&"mxfile"==g.documentElement.nodeName&&(d=g.documentElement.getElementsByTagName("diagram"),e=g.documentElement,0<d.length&&(h=mxUtils.getTextContent(d[0]),h=b.decompress(h),g=mxUtils.parseXml(h)));if(null!=g.documentElement&&"mxGraphModel"==g.documentElement.nodeName){var l=new mxCodec(g),m=g.documentElement;null==e&&(e=m);b.resetViewOnRootChange=!1;b.setEnabled(!1);if(null!=d&&0<d.length){var r=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==
b?d[0].getAttribute("name")||"Page-1":"pagenumber"==b?1:r.apply(this,arguments)}}b.foldingEnabled="1"==e.getAttribute("nav");b.cellRenderer.forceControlClickHandler=b.foldingEnabled;var q=e.getAttribute("tooltips");"0"!=q?b.setTooltips(!0):b.setTooltips(!1);if(mxClient.IS_VML){var z=b.view.getCanvas();null!=z&&"DIV"==z.nodeName&&(z.style.position="relative")}if(null!=x){var s=mxUtils.parseXml(x);(new mxCodec(s)).decode(s.documentElement,b.getStylesheet())}var A=e.getAttribute("math");"1"==A&&(mxClient.NO_FO=
!0,L());"0"!=e.getAttribute("pan")?(b.panningHandler.useLeftButtonForPanning=!0,b.panningHandler.ignoreCell=!0,a.style.cursor="move",b.setPanning(!0)):a.style.cursor="default";var B=e.getAttribute("resize"),u=Number(e.getAttribute("border")||0);b.border=u;var C=e.getAttribute("fit");"100%"!=a.style.width&&"1"!=C&&"0"!=B||""==a.style.width&&""==a.style.height?(b.resizeContainer=!0,b.centerZoom=!1):"0"!=B&&"100%"==a.style.width&&""==a.style.height?(b.resizeContainer=!0,b.centerZoom=!1,b.doResizeContainer=
function(b,a){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var c=this.getBorderSizes();b+=Math.max(2,c.x+c.width+1);a+=Math.max(2,c.y+c.height+1)}else 9<=document.documentMode?(b+=3,a+=5):(b+=1,a+=1);else a+=1;null!=this.maximumContainerSize&&(Math.min(this.maximumContainerSize.width,b),a=Math.min(this.maximumContainerSize.height,a));this.container.style.height=Math.ceil(a+18)+"px"}):b.centerZoom=!0;var y=e.getAttribute("links"),v=e.getAttribute("highlight");if("0"!=y||"0"!=q){var N=a.style.cursor,H=
b.getTolerance();b.addMouseListener({currentState:null,currentLink:null,highlight:null!=v&&""!=v&&v!=mxConstants.NONE?new mxCellHighlight(b,v,2):null,startX:0,startY:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY()},mouseMove:function(a,f){if(b.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-f.getGraphX()),e=Math.abs(this.startY-f.getGraphY());(c>H||e>H)&&this.clear()}}else null!=this.currentState&&(f.getState()==this.currentState||null==f.getState())&&
b.intersects(this.currentState,f.getGraphX(),f.getGraphY())||(c=b.view.getState(f.getCell()),c!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=c,null!=this.currentState&&this.activate(this.currentState)))},mouseUp:function(b,a){var c=this.currentLink;this.clear();null!=c&&("#"==c.charAt(0)?window.location.hash=c:window.open(c))},activate:function(G){this.currentLink=b.getLinkForCell(G.cell);null!=this.currentLink&&(a.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(G))},
clear:function(){a.style.cursor=N;this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}})}var O=Number(e.getAttribute("x0")||0),P=Number(e.getAttribute("y0")||0);b.view.translate.x=-O+u;b.view.translate.y=-P+u;var I=function(a){a=a.getAttribute("backgroundImage");null!=a&&(a=JSON.parse(a),b.setBackgroundImage(new mxImage(a.src,a.width,a.height)),b.view.validateBackgroundImage());"0"!=C&&b.fit(u);"1"==A&&M(b);a=b.container.getElementsByTagName("a");if(null!=a)for(var f=
0;f<a.length;f++){var c=a[f].getAttribute("href");null!=c&&("#"==c.charAt(0)&&"_blank"==a[f].getAttribute("target"))&&a[f].removeAttribute("target")}},n=e.getAttribute("url");if(null!=n)try{var p=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;p.open("GET",n);p.onload=mxUtils.bind(this,function(){try{"1"==A&&(mxClient.NO_FO=!0);var a=null!=p.getText?p.getText():p.responseText;if(null!=a){var f=mxUtils.parseXml(a);if(null!=f&&"html"==f.documentElement.nodeName){var c=
f.documentElement.getElementsByTagName("div");if(0<c.length&&"mxgraph"==c[0].getAttribute("class")){var e=c[0].getElementsByTagName("div");0<e.length&&(a=mxUtils.getTextContent(e[0]),a=b.decompress(a),0<a.length&&(f=mxUtils.parseXml(a)))}}if(null!=f&&"svg"==f.documentElement.nodeName){var d=f.documentElement.getAttribute("content");null!=d&&("\x3c"!=d.charAt(0)&&"%"!=d.charAt(0))&&(d=unescape(window.atob?atob(d):Base64.decode(cont,d)));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&
0<d.length&&(f=mxUtils.parseXml(d))}if("mxfile"==f.documentElement.nodeName){var g=f.documentElement.getElementsByTagName("diagram");0<g.length&&(a=b.decompress(mxUtils.getTextContent(g[0])),f=mxUtils.parseXml(a))}l=new mxCodec(f);l.decode(f.documentElement,b.getModel());I(f.documentElement)}else b.container.innerHTML="Cannot load "+n;mxClient.NO_FO=F}catch(k){b.container.innerHTML="Cannot load "+n+": "+k.message}});p.onerror=function(){b.container.innerHTML="Cannot load "+n};p.send()}catch(Q){b.container.innerHTML=
"Cannot load "+n+": "+Q.message}else l.decode(m,b.getModel()),I(m);"100%"!=a.style.width&&("0"!=C&&"1"==B)&&(b.resizeContainer=!0,b.centerZoom=!1);var k=document.createElement("div");k.style.position="absolute";k.style.overflow="visible";k.style.cursor="pointer";var J=b.getBorderSizes(),D=0,K=10,t=16,w=16;mxClient.IS_QUIRKS?(t-=1,w-=1):mxClient.IS_TOUCH&&(w=t=24,K=14);g=function(a,b){var c=document.createElement("div");c.style.position="absolute";c.style.border="1px solid gray";c.style.textAlign=
"center";c.style.cursor="hand";c.style.width=t+"px";c.style.height=w+"px";c.style.left=D+"px";c.style.top="0px";c.style.backgroundColor="white";mxUtils.setOpacity(c,50);var d=document.createElement("table");d.style.borderWidth="0px";d.style.width="100%";d.style.height="100%";var e=document.createElement("tbody"),g=document.createElement("tr"),h=document.createElement("td");h.style.verticalAlign="middle";h.style.textAlign="center";h.style.fontSize=K+"px";h.style.padding="0px";mxUtils.write(h,a);g.appendChild(h);
e.appendChild(g);d.appendChild(e);c.appendChild(d);mxEvent.addListener(c,mxClient.IS_POINTER?"pointerdown":"mousedown",function(a){mxEvent.consume(a)});mxEvent.addListener(c,mxClient.IS_POINTER?"pointerup":"mouseup",function(a){b();mxEvent.consume(a)});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.addListener(c,"touchstart",function(a){mxEvent.consume(a)}),mxEvent.addListener(c,"touchend",function(a){b();mxEvent.consume(a)}));D+=t;k.appendChild(c);return c};"0"!=e.getAttribute("zoom")&&(g("+",
function(){b.zoomIn()}),g("-",function(){b.zoomOut()}));var E=e.getAttribute("edit");null!=E&&(g("",function(){if("_blank"==E)if(null!=n)window.open("https://www.draw.io/?url\x3d"+encodeURIComponent(n));else{var a=null,b=function(c){"ready"==c.data&&c.source==a&&(a.postMessage(h,"*"),window.removeEventListener("message",b))};window.addEventListener("message",b);a=window.open("https://www.draw.io/?client\x3d1")}else window.open(E)}).innerHTML="...");g=function(){k.style.top=a.offsetTop+J.y+"px";k.style.left=
a.offsetLeft+J.x+"px";k.style.visibility="visible"};!mxClient.IS_POINTER&&!mxClient.IS_TOUCH?(e=function(){k.style.visibility="hidden"},mxEvent.addListener(a,"mouseover",g),mxEvent.addListener(k,"mouseover",g),mxEvent.addListener(a,"mouseout",e),mxEvent.addListener(k,"mouseout",e),e()):g();null!=k.firstChild&&(null!=a.nextSibling?a.parentNode.insertBefore(k,a.nextSibling):a.parentNode.appendChild(k));"function"==typeof window.mxClientOnCreate&&window.mxClientOnCreate(b)}}catch(R){null!=window.console&&
console.log("Error:",R)}mxClient.NO_FO=F;return b}if("function"==typeof mxClientOnLoad)mxClientOnLoad(x,a);else if(mxClient.isBrowserSupported()){for(var d=document.getElementsByTagName("*"),m=[],l=0;l<d.length;l++)m.push(d[l]);for(l=0;l<m.length;l++)0<=m[l].className.toString().indexOf("mxgraph")&&a(m[l])}})()