drawio/war/js/embed.min.js
Gaudenz Alder ff9a93bfc6 6.5.0 release
Former-commit-id: 41ed65dd57
2017-04-13 15:11:49 +02:00

20 lines
No EOL
10 KiB
JavaScript

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