|
|
|
@ -2230,7 +2230,7 @@ a.vertex=!0;this.graph.setAttributeForCell(a,"placeholders","1");return this.cre
|
|
|
|
|
20,120,"","Curly Bracket"),this.createVertexTemplateEntry("line;strokeWidth=2;html=1;",160,10,"","Horizontal Line"),this.createVertexTemplateEntry("line;strokeWidth=2;direction=south;html=1;",10,160,"","Vertical Line"),this.createVertexTemplateEntry("line;strokeWidth=4;html=1;perimeter=backbonePerimeter;points=[];outlineConnect=0;",160,10,"","Horizontal Backbone",!1,null,"backbone bus network"),this.createVertexTemplateEntry("line;strokeWidth=4;direction=south;html=1;perimeter=backbonePerimeter;points=[];outlineConnect=0;",
|
|
|
|
|
10,160,"","Vertical Backbone",!1,null,"backbone bus network"),this.createVertexTemplateEntry("shape=crossbar;whiteSpace=wrap;html=1;rounded=1;",120,20,"","Crossbar",!1,null,"crossbar distance measure dimension unit"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;imageAspect=1;aspect=fixed;image="+this.gearImage,52,61,"","Image (Fixed Aspect)",!1,null,"fixed image icon symbol"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;imageAspect=0;image="+
|
|
|
|
|
this.gearImage,50,60,"","Image (Variable Aspect)",!1,null,"strechted image icon symbol"),this.createVertexTemplateEntry("icon;html=1;image="+this.gearImage,60,60,"Icon","Icon",!1,null,"icon image symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;image="+this.gearImage,140,60,"Label","Label 1",null,null,"label image icon symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;align=center;verticalAlign=bottom;spacingLeft=0;spacingBottom=4;imageAlign=center;imageVerticalAlign=top;image="+
|
|
|
|
|
this.gearImage,120,80,"Label","Label 2",null,null,"label image icon symbol"),this.addEntry("shape group container",function(){var a=new mxCell("",new mxGeometry(0,0,200,100),"html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;");a.vertex=!0;var b=new mxCell("",new mxGeometry(20,20,20,30),"triangle;html=1;whiteSpace=wrap;");b.vertex=!0;a.insert(b);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,"Shape Group")}),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;",
|
|
|
|
|
this.gearImage,120,80,"Label","Label 2",null,null,"label image icon symbol"),this.addEntry("shape group container",function(){var a=new mxCell("Label",new mxGeometry(0,0,200,100),"html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;");a.vertex=!0;var b=new mxCell("",new mxGeometry(20,20,20,30),"triangle;html=1;whiteSpace=wrap;");b.vertex=!0;a.insert(b);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,"Shape Group")}),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;",
|
|
|
|
|
120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;top=0;bottom=1;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createEdgeTemplateEntry("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;",50,50,"","Manual Line",null,"line lines connector connectors connection connections arrow arrows manual"),this.createEdgeTemplateEntry("shape=filledEdge;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;",
|
|
|
|
|
60,40,"","Filled Edge"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;",50,50,"","Horizontal Elbow",null,"line lines connector connectors connection connections arrow arrows elbow horizontal"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;",50,50,"","Vertical Elbow",null,"line lines connector connectors connection connections arrow arrows elbow vertical")];this.addPaletteFunctions("misc",mxResources.get("misc"),
|
|
|
|
|
null!=a?a:!0,c)};Sidebar.prototype.addAdvancedPalette=function(a){this.addPaletteFunctions("advanced",mxResources.get("advanced"),null!=a?a:!1,this.createAdvancedShapes())};
|
|
|
|
@ -6375,9 +6375,9 @@ StorageFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable()){var e=mxU
|
|
|
|
|
[a]),e,c):e()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,b,d){var c=this.getTitle();c!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(e){var f=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(c,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(c,b)}),d)});null!=e?this.ui.confirm(mxResources.get("replaceIt",[a]),f,d):f()})):b()};
|
|
|
|
|
StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,b,d){StorageFile.call(this,a,b,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,b,d){this.saveFile(a,!1,b,d)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
|
|
|
|
|
StorageLibrary.prototype.isRenamable=function(a,b,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,d){StorageFile.call(this,a,b,d);a=d;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,d){return!1};UrlLibrary.prototype.saveAs=function(a,b,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,d){function c(c,e,f,t,u,q){function w(){mxEvent.addListener(p,"click",null!=q?q:function(){f!=App.MODE_GOOGLE||a.isDriveDomain()?f==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,g.checked);b()})):(a.setMode(f,g.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var p=document.createElement("a");p.style.overflow="hidden";p.style.display=
|
|
|
|
|
mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.padding="8px 10px 12px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace="nowrap";p.setAttribute("title",e);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var h=document.createElement("div");h.style.textOverflow="ellipsis";h.style.overflow="hidden";if(null!=c){var y=document.createElement("img");
|
|
|
|
|
y.setAttribute("src",c);y.setAttribute("border","0");y.setAttribute("align","absmiddle");y.style.width="60px";y.style.height="60px";y.style.paddingBottom="6px";p.appendChild(y)}else h.style.paddingTop="5px",h.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(h.style.paddingTop="0px",h.style.marginTop="-2px");p.appendChild(h);mxUtils.write(h,e);if(null!=u)for(c=0;c<u.length;c++)mxUtils.br(h),mxUtils.write(h,u[c]);if(null!=t&&null==a[t]){y.style.visibility=
|
|
|
|
|
"hidden";mxUtils.setOpacity(h,10);var l=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});l.spin(p);var B=window.setTimeout(function(){null==a[t]&&(l.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[t]&&(window.clearTimeout(B),mxUtils.setOpacity(h,100),y.style.visibility="",l.stop(),w(),"drive"==t&&null!=n.parentNode&&n.parentNode.removeChild(n))}))}else w();
|
|
|
|
|
mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.padding="8px 10px 12px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace="nowrap";p.setAttribute("title",e);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var h=document.createElement("div");h.style.textOverflow="ellipsis";h.style.overflow="hidden";if(null!=c){var l=document.createElement("img");
|
|
|
|
|
l.setAttribute("src",c);l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.width="60px";l.style.height="60px";l.style.paddingBottom="6px";p.appendChild(l)}else h.style.paddingTop="5px",h.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(h.style.paddingTop="0px",h.style.marginTop="-2px");p.appendChild(h);mxUtils.write(h,e);if(null!=u)for(c=0;c<u.length;c++)mxUtils.br(h),mxUtils.write(h,u[c]);if(null!=t&&null==a[t]){l.style.visibility=
|
|
|
|
|
"hidden";mxUtils.setOpacity(h,10);var B=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});B.spin(p);var A=window.setTimeout(function(){null==a[t]&&(B.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[t]&&(window.clearTimeout(A),mxUtils.setOpacity(h,100),l.style.visibility="",B.stop(),w(),"drive"==t&&null!=n.parentNode&&n.parentNode.removeChild(n))}))}else w();
|
|
|
|
|
m.appendChild(p);++k>=d&&(mxUtils.br(m),k=0)}d=null!=d?d:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var f=a.addLanguageMenu(e,!0);null!=f&&(f.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){f=document.createElement("a");f.setAttribute("href","https://support.draw.io/display/DO/Selecting+Storage");f.setAttribute("title",mxResources.get("help"));f.setAttribute("target",
|
|
|
|
|
"_blank");f.style.position="absolute";f.style.textDecoration="none";f.style.cursor="pointer";f.style.fontSize="12px";f.style.bottom="28px";f.style.left="26px";f.style.color="gray";var h=document.createElement("img");h.setAttribute("border","0");h.setAttribute("valign","bottom");h.setAttribute("src",Editor.helpImage);h.style.marginRight="2px";f.appendChild(h);mxUtils.write(f,mxResources.get("help"));e.appendChild(f)}var l=document.createElement("div");l.style.position="absolute";l.style.cursor="pointer";
|
|
|
|
|
l.style.fontSize="12px";l.style.bottom="28px";l.style.color="gray";mxUtils.write(l,mxResources.get("decideLater"));a.isOfflineApp()?l.style.right="20px":(mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0)"),l.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)l.style.marginLeft=-Math.round(l.clientWidth/2)+"px"};e.appendChild(l);mxEvent.addListener(l,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,
|
|
|
|
@ -6412,15 +6412,15 @@ mxClient.IS_CHROMEAPP)){if(51200>b.length){var k=mxUtils.button("",function(){tr
|
|
|
|
|
" max)");k.style.verticalAlign="bottom";k.style.paddingTop="4px";k.style.minWidth="46px";k.className="geBtn";h.appendChild(k)}7168>b.length&&(k=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(l.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),g=document.createElement("img"),g.setAttribute("src",Editor.tweetImage),g.setAttribute("width",
|
|
|
|
|
"18"),g.setAttribute("height","18"),g.setAttribute("border","0"),g.style.marginBottom="5px",k.appendChild(g),k.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),k.style.verticalAlign="bottom",k.style.paddingTop="4px",k.style.minWidth="46px",k.className="geBtn",h.appendChild(k))}g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.appendChild(g);k=mxUtils.button(mxResources.get("copy"),function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
|
|
|
|
mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>b.length?mxClient.IS_SF||null!=document.documentMode?g.className="geBtn gePrimaryBtn":(h.appendChild(k),k.className="geBtn gePrimaryBtn",g.className="geBtn"):(h.appendChild(m),g.className="geBtn",m.className="geBtn gePrimaryBtn");c.appendChild(h);this.container=c},GoogleSitesDialog=function(a,b){function d(){var a=null!=C.getTitle()?C.getTitle():
|
|
|
|
|
this.defaultFilename;if(x.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<z.length&&(b+="&s="+z);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(w.checked?"1":"0");b+="&resize="+(t.checked?"1":"0");b+="&x0="+Number(k.value);b+="&y0="+m;e.mathEnabled&&(b+="&math=1");
|
|
|
|
|
y.checked?b+="&edit=_blank":B.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));g.value=b}else C.constructor==DriveFile||C.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=C.getHash().substring(1),b=C.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(k.value),b+="&height="+
|
|
|
|
|
this.defaultFilename;if(x.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<y.length&&(b+="&s="+y);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(w.checked?"1":"0");b+="&resize="+(t.checked?"1":"0");b+="&x0="+Number(k.value);b+="&y0="+m;e.mathEnabled&&(b+="&math=1");
|
|
|
|
|
B.checked?b+="&edit=_blank":A.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));g.value=b}else C.constructor==DriveFile||C.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=C.getHash().substring(1),b=C.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(k.value),b+="&height="+
|
|
|
|
|
a),g.value=b):g.value=""}var c=document.createElement("div"),e=a.editor.graph,f=e.getGraphBounds(),h=e.view.scale,l=Math.floor(f.x/h-e.view.translate.x),m=Math.floor(f.y/h-e.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","text");g.style.marginBottom="8px";g.style.marginTop="2px";g.style.width="410px";c.appendChild(g);mxUtils.br(c);this.init=function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
|
|
|
|
mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.setAttribute("size","4");k.style.marginRight="16px";k.style.marginLeft="4px";k.value=l;c.appendChild(k);mxUtils.write(c,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(f.height/h);c.appendChild(n);
|
|
|
|
|
mxUtils.br(c);f=document.createElement("hr");f.setAttribute("size","1");f.style.marginBottom="16px";f.style.marginTop="16px";c.appendChild(f);mxUtils.write(c,mxResources.get("publicDiagramUrl")+":");mxUtils.br(c);var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","28");p.style.marginBottom="8px";p.style.marginTop="2px";p.style.width="410px";p.value=b||"";c.appendChild(p);mxUtils.br(c);mxUtils.write(c,mxResources.get("borderWidth")+":");var u=document.createElement("input");
|
|
|
|
|
u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";c.appendChild(u);mxUtils.br(c);var q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";c.appendChild(q);mxUtils.write(c,mxResources.get("pan")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft=
|
|
|
|
|
"8px";c.appendChild(v);mxUtils.write(c,mxResources.get("zoom")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft="8px";B.setAttribute("title",window.location.href);c.appendChild(B);mxUtils.write(c,mxResources.get("edit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";c.appendChild(y);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var t=document.createElement("input");t.setAttribute("type",
|
|
|
|
|
"checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";c.appendChild(t);mxUtils.write(c,mxResources.get("resize")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.style.marginLeft="8px";c.appendChild(w);mxUtils.write(c,mxResources.get("fit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";c.appendChild(x);mxUtils.write(c,mxResources.get("embed")+" ");var z=a.getBasenames().join(";"),
|
|
|
|
|
C=a.getCurrentFile();mxEvent.addListener(q,"change",d);mxEvent.addListener(v,"change",d);mxEvent.addListener(t,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(B,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(n,"change",d);mxEvent.addListener(k,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(p,"change",d);d();mxEvent.addListener(g,"click",function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
|
|
|
|
"8px";c.appendChild(v);mxUtils.write(c,mxResources.get("zoom")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";A.setAttribute("title",window.location.href);c.appendChild(A);mxUtils.write(c,mxResources.get("edit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft="8px";c.appendChild(B);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var t=document.createElement("input");t.setAttribute("type",
|
|
|
|
|
"checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";c.appendChild(t);mxUtils.write(c,mxResources.get("resize")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.style.marginLeft="8px";c.appendChild(w);mxUtils.write(c,mxResources.get("fit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";c.appendChild(x);mxUtils.write(c,mxResources.get("embed")+" ");var y=a.getBasenames().join(";"),
|
|
|
|
|
C=a.getCurrentFile();mxEvent.addListener(q,"change",d);mxEvent.addListener(v,"change",d);mxEvent.addListener(t,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(A,"change",d);mxEvent.addListener(B,"change",d);mxEvent.addListener(x,"change",d);mxEvent.addListener(n,"change",d);mxEvent.addListener(k,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(p,"change",d);d();mxEvent.addListener(g,"click",function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
|
|
|
|
mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";h=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.className="geBtn gePrimaryBtn";f.appendChild(h);c.appendChild(f);this.container=c},CreateGraphDialog=function(a,b,d){var c=document.createElement("div");c.style.textAlign="right";this.init=function(){var b=document.createElement("div");b.style.position="relative";b.style.border=
|
|
|
|
|
"1px solid gray";b.style.width="100%";b.style.height="360px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);c.appendChild(b);var f=new Graph(b);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var h="curved=1;";f.cellRenderer.installCellOverlayListeners=function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,
|
|
|
|
|
arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};f.getAllConnectionConstraints=function(){return null};f.connectionHandler.marker.highlight.keepOnTop=!1;f.connectionHandler.createEdgeState=function(a){a=f.createEdge(null,null,
|
|
|
|
@ -6458,36 +6458,36 @@ m=[];a.editor.graph.getModel().beginUpdate();try{m=a.editor.graph.importCells(g.
|
|
|
|
|
m.setAttribute("value","table");mxUtils.write(m,mxResources.get("table"));l.appendChild(m);m=document.createElement("option");m.setAttribute("value","diagram");mxUtils.write(m,mxResources.get("diagram"));l.appendChild(m);m=document.createElement("option");m.setAttribute("value","plantUmlSvg");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");var g=document.createElement("option");g.setAttribute("value","plantUmlPng");mxUtils.write(g,mxResources.get("plantUml")+" ("+
|
|
|
|
|
mxResources.get("formatPng")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&(l.appendChild(m),l.appendChild(g));var k=c();h.value=k;f.appendChild(h);this.init=function(){h.focus()};Graph.fileSupport&&(h.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),h.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){h.value=a.target.result};
|
|
|
|
|
b.readAsText(a)}},!1));f.appendChild(l);mxEvent.addListener(l,"change",function(){var a=c();if(0==h.value.length||h.value==k)k=a,h.value=k});m=mxUtils.button(mxResources.get("close"),function(){h.value==k?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});m.className="geBtn";a.editor.cancelFirst&&f.appendChild(m);g=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();d(h.value,l.value)});f.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||
|
|
|
|
|
f.appendChild(m);this.container=f},NewDialog=function(a,b,d,c,e,f,h,l,m,g,k,n,p,u){function q(){for(var a=!0;H<V.length&&(a||0!=mxUtils.mod(H,30));)a=V[H++],y(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info),a=!1}function v(){if(S)a.hideDialog(),u(S,M,C.value);else if(c)d||a.hideDialog(),c(Q,C.value);else{var b=C.value;null!=b&&0<b.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?
|
|
|
|
|
a.mode:null,function(c){a.createFile(b,Q,null!=P&&0<P.length?P:null,null,function(){a.hideDialog()},null,c)})}}function B(a,b,c,d,g){null!=O&&(O.style.backgroundColor="transparent",O.style.border="1px solid transparent");E.removeAttribute("disabled");Q=b;P=c;O=a;S=d;M=g;O.style.backgroundColor=l;O.style.border=m}function y(a,b,c,d,g,k,e){var t=document.createElement("div");t.className="geTemplate";t.style.height=L+"px";t.style.width=X+"px";null!=d&&0<d.length&&t.setAttribute("title",d);if(null!=k)t.style.backgroundImage=
|
|
|
|
|
"url("+k+")",t.style.backgroundSize="contain",t.style.backgroundPosition="center center",t.style.backgroundRepeat="no-repeat",mxEvent.addListener(t,"click",function(b){B(t,null,null,a,e)}),mxEvent.addListener(t,"dblclick",function(a){v()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);t.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";var n=!1;mxEvent.addListener(t,"click",function(c){E.setAttribute("disabled",
|
|
|
|
|
"disabled");t.style.backgroundColor="transparent";t.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(B(t,a.getText(),b),n&&v())}))});mxEvent.addListener(t,"dblclick",function(a){n=!0})}else t.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(c)+"</td></tr></table>",g&&B(t),mxEvent.addListener(t,"click",function(a){B(t)}),mxEvent.addListener(t,"dblclick",function(a){v()});
|
|
|
|
|
f.appendChild(m);this.container=f},NewDialog=function(a,b,d,c,e,f,h,l,m,g,k,n,p,u){function q(){for(var a=!0;H<V.length&&(a||0!=mxUtils.mod(H,30));)a=V[H++],B(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info),a=!1}function v(){if(S)a.hideDialog(),u(S,M,C.value);else if(c)d||a.hideDialog(),c(Q,C.value);else{var b=C.value;null!=b&&0<b.length&&a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?
|
|
|
|
|
a.mode:null,function(c){a.createFile(b,Q,null!=P&&0<P.length?P:null,null,function(){a.hideDialog()},null,c)})}}function A(a,b,c,d,g){null!=O&&(O.style.backgroundColor="transparent",O.style.border="1px solid transparent");E.removeAttribute("disabled");Q=b;P=c;O=a;S=d;M=g;O.style.backgroundColor=l;O.style.border=m}function B(a,b,c,d,g,k,e){var t=document.createElement("div");t.className="geTemplate";t.style.height=L+"px";t.style.width=X+"px";null!=d&&0<d.length&&t.setAttribute("title",d);if(null!=k)t.style.backgroundImage=
|
|
|
|
|
"url("+k+")",t.style.backgroundSize="contain",t.style.backgroundPosition="center center",t.style.backgroundRepeat="no-repeat",mxEvent.addListener(t,"click",function(b){A(t,null,null,a,e)}),mxEvent.addListener(t,"dblclick",function(a){v()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);t.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,a.length-4)+".png)";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";var n=!1;mxEvent.addListener(t,"click",function(c){E.setAttribute("disabled",
|
|
|
|
|
"disabled");t.style.backgroundColor="transparent";t.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(A(t,a.getText(),b),n&&v())}))});mxEvent.addListener(t,"dblclick",function(a){n=!0})}else t.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(c)+"</td></tr></table>",g&&A(t),mxEvent.addListener(t,"click",function(a){A(t)}),mxEvent.addListener(t,"dblclick",function(a){v()});
|
|
|
|
|
J.appendChild(t)}function t(){mxEvent.addListener(J,"scroll",function(a){J.scrollTop+J.clientHeight>=J.scrollHeight&&(q(),mxEvent.consume(a))});var a=null,b;for(b in N){var c=document.createElement("div"),d=mxResources.get(b),k=N[b];null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1));18<d.length&&(d=d.substring(0,18)+"…");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";c.setAttribute("title",d+" ("+
|
|
|
|
|
k.length+")");mxUtils.write(c,c.getAttribute("title"));null!=g&&(c.style.padding=g);T.appendChild(c);null==a&&(a=c,a.style.backgroundColor=h);(function(b,d){mxEvent.addListener(c,"click",function(){a!=d&&(a.style.backgroundColor="",a=d,a.style.backgroundColor=h,J.scrollTop=0,J.innerHTML="",H=0,V=N[b],G=null,q())})})(b,c)}q()}d=null!=d?d:!0;e=null!=e?e:!1;h=null!=h?h:"#ebf2f9";l=null!=l?l:"#e6eff8";m=null!=m?m:"1px solid #ccd9ea";k=null!=k?k:TEMPLATE_PATH+"/index.xml";var w=document.createElement("div");
|
|
|
|
|
w.style.height="100%";var x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height="46px";d&&w.appendChild(x);var z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.width="40px";z.style.height="40px";z.style.marginRight="10px";z.style.paddingBottom="4px";z.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":
|
|
|
|
|
a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&d&&x.appendChild(z);d&&mxUtils.write(x,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");z=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?z=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?z=a.dropbox.extension:
|
|
|
|
|
a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?z=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?z=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(z=a.trello.extension);var C=document.createElement("input");C.setAttribute("value",a.defaultFilename+z);C.style.marginRight="20px";C.style.marginLeft="10px";C.style.width=b?"220px":"430px";this.init=function(){d&&(C.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?C.select():document.execCommand("selectAll",
|
|
|
|
|
!1,null))};d&&x.appendChild(C);var x=!1,H=0,E=mxUtils.button(mxResources.get("create"),function(){v()});E.className="geBtn gePrimaryBtn";if(n||p){var D=[],G=null,A=function(a){E.setAttribute("disabled","disabled");for(var b=0;b<D.length;b++)D[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},x=!0,z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="30px";w.appendChild(z);var F=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){T.style.display="";J.style.left=
|
|
|
|
|
"160px";A(0);J.scrollTop=0;J.innerHTML="";H=0;G!=V&&(V=G,q(),G=null)});D.push(F);z.appendChild(F);var I=function(a){T.style.display="none";J.style.left="30px";A(a?-1:1);null==G&&(G=V);J.scrollTop=0;J.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(J);H=0;var c=function(a,c){b.stop();V=a;c?J.innerHTML=c:0==a.length?J.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(J.innerHTML=
|
|
|
|
|
"",q())};a?p(K.value,c):n(c)};n&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){I()}),z.appendChild(F),D.push(F));if(p){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxResources.get("search")+":";z.appendChild(F);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(a){13==a.keyCode&&I(!0)});z.appendChild(K);F=mxUtils.button(mxResources.get("search"),
|
|
|
|
|
function(){I(!0)});F.className="geBtn";z.appendChild(F)}A(0)}var P=null,Q=null,O=null,S=null,M=null,J=document.createElement("div");J.style.border="1px solid #d3d3d3";J.style.position="absolute";J.style.left="160px";J.style.right="34px";x=(d?72:40)+(x?30:0);J.style.top=x+"px";J.style.bottom="68px";J.style.margin="6px 0 0 -1px";J.style.padding="6px";J.style.overflow="auto";var T=document.createElement("div");T.style.cssText="position:absolute;left:30px;width:128px;top:"+x+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
|
|
|
|
|
w.style.height="100%";var x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height="46px";d&&w.appendChild(x);var y=document.createElement("img");y.setAttribute("border","0");y.setAttribute("align","absmiddle");y.style.width="40px";y.style.height="40px";y.style.marginRight="10px";y.style.paddingBottom="4px";y.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":
|
|
|
|
|
a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&d&&x.appendChild(y);d&&mxUtils.write(x,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");y=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?y=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?y=a.dropbox.extension:
|
|
|
|
|
a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?y=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?y=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(y=a.trello.extension);var C=document.createElement("input");C.setAttribute("value",a.defaultFilename+y);C.style.marginRight="20px";C.style.marginLeft="10px";C.style.width=b?"220px":"430px";this.init=function(){d&&(C.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?C.select():document.execCommand("selectAll",
|
|
|
|
|
!1,null))};d&&x.appendChild(C);var x=!1,H=0,E=mxUtils.button(mxResources.get("create"),function(){v()});E.className="geBtn gePrimaryBtn";if(n||p){var D=[],G=null,z=function(a){E.setAttribute("disabled","disabled");for(var b=0;b<D.length;b++)D[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},x=!0,y=document.createElement("div");y.style.whiteSpace="nowrap";y.style.height="30px";w.appendChild(y);var F=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){T.style.display="";J.style.left=
|
|
|
|
|
"160px";z(0);J.scrollTop=0;J.innerHTML="";H=0;G!=V&&(V=G,q(),G=null)});D.push(F);y.appendChild(F);var I=function(a){T.style.display="none";J.style.left="30px";z(a?-1:1);null==G&&(G=V);J.scrollTop=0;J.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(J);H=0;var c=function(a,c){b.stop();V=a;c?J.innerHTML=c:0==a.length?J.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(J.innerHTML=
|
|
|
|
|
"",q())};a?p(K.value,c):n(c)};n&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){I()}),y.appendChild(F),D.push(F));if(p){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxResources.get("search")+":";y.appendChild(F);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(a){13==a.keyCode&&I(!0)});y.appendChild(K);F=mxUtils.button(mxResources.get("search"),
|
|
|
|
|
function(){I(!0)});F.className="geBtn";y.appendChild(F)}z(0)}var P=null,Q=null,O=null,S=null,M=null,J=document.createElement("div");J.style.border="1px solid #d3d3d3";J.style.position="absolute";J.style.left="160px";J.style.right="34px";x=(d?72:40)+(x?30:0);J.style.top=x+"px";J.style.bottom="68px";J.style.margin="6px 0 0 -1px";J.style.padding="6px";J.style.overflow="auto";var T=document.createElement("div");T.style.cssText="position:absolute;left:30px;width:128px;top:"+x+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
|
|
|
|
|
var L=140,X=140,N={},Y=1;N.basic=[{title:"blankDiagram",select:!0}];var V=N.basic;if(!b){w.appendChild(T);w.appendChild(J);var U=!1;mxUtils.get(k,function(a){if(!U){U=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=N[b];null==c&&(Y++,c=[],N[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=
|
|
|
|
|
a.nextSibling}t()}})}mxEvent.addListener(C,"keypress",function(a){13==a.keyCode&&v()});k=document.createElement("div");k.style.marginTop=b?"4px":"16px";k.style.textAlign="right";k.style.position="absolute";k.style.left="40px";k.style.bottom="24px";k.style.right="40px";x=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});x.className="geBtn";!a.editor.cancelFirst||e&&null==f||k.appendChild(x);b||a.isOffline()||!d||null!=c||e||(z=mxUtils.button(mxResources.get("help"),
|
|
|
|
|
function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",k.appendChild(z));b||"1"==urlParams.embed||e||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(C.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},
|
|
|
|
|
a.nextSibling}t()}})}mxEvent.addListener(C,"keypress",function(a){13==a.keyCode&&v()});k=document.createElement("div");k.style.marginTop=b?"4px":"16px";k.style.textAlign="right";k.style.position="absolute";k.style.left="40px";k.style.bottom="24px";k.style.right="40px";x=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});x.className="geBtn";!a.editor.cancelFirst||e&&null==f||k.appendChild(x);b||a.isOffline()||!d||null!=c||e||(y=mxUtils.button(mxResources.get("help"),
|
|
|
|
|
function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",k.appendChild(y));b||"1"==urlParams.embed||e||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(C.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},
|
|
|
|
|
mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",k.appendChild(b));k.appendChild(E);a.editor.cancelFirst||null!=c||e&&null==f||k.appendChild(x);w.appendChild(k);this.container=w},CreateDialog=function(a,b,d,c,e,f,h,l,m,g,k,n,p,u,q){function v(c,d,g,k){function e(){mxEvent.addListener(t,"click",function(){var c=g;if(h){var d=w.value,k=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>k){var c=null!=c?c:C.value,t="";c==App.MODE_GOOGLE?t=a.drive.extension:c==
|
|
|
|
|
App.MODE_GITHUB?t=a.gitHub.extension:c==App.MODE_TRELLO?t=a.trello.extension:c==App.MODE_DROPBOX?t=a.dropbox.extension:c==App.MODE_ONEDRIVE?t=a.oneDrive.extension:c==App.MODE_DEVICE&&(t=".xml");0<=k&&(d=d.substring(0,k));w.value=d+t}}B(g)})}var t=document.createElement("a");t.style.overflow="hidden";var f=document.createElement("img");f.src=c;f.setAttribute("border","0");f.setAttribute("align","absmiddle");f.style.width="60px";f.style.height="60px";f.style.paddingBottom="6px";t.style.display=mxClient.IS_QUIRKS?
|
|
|
|
|
App.MODE_GITHUB?t=a.gitHub.extension:c==App.MODE_TRELLO?t=a.trello.extension:c==App.MODE_DROPBOX?t=a.dropbox.extension:c==App.MODE_ONEDRIVE?t=a.oneDrive.extension:c==App.MODE_DEVICE&&(t=".xml");0<=k&&(d=d.substring(0,k));w.value=d+t}}A(g)})}var t=document.createElement("a");t.style.overflow="hidden";var f=document.createElement("img");f.src=c;f.setAttribute("border","0");f.setAttribute("align","absmiddle");f.style.width="60px";f.style.height="60px";f.style.paddingBottom="6px";t.style.display=mxClient.IS_QUIRKS?
|
|
|
|
|
"inline":"inline-block";t.className="geBaseButton";t.style.position="relative";t.style.margin="4px";t.style.padding="8px 8px 10px 8px";t.style.whiteSpace="nowrap";t.appendChild(f);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");t.style.color="gray";t.style.fontSize="11px";var p=document.createElement("div");t.appendChild(p);mxUtils.write(p,d);if(null!=k&&null==a[k]){f.style.visibility="hidden";mxUtils.setOpacity(p,10);var u=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,
|
|
|
|
|
color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(t);var l=window.setTimeout(function(){null==a[k]&&(u.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(l),mxUtils.setOpacity(p,100),f.style.visibility="",u.stop(),e())}))}else e();x.appendChild(t);++z==n&&(mxUtils.br(x),z=0)}function B(b){var c=w.value;if(null==b||null!=c&&0<c.length)a.hideDialog(),d(c,b)}h=null!=h?h:!0;l=null!=l?l:!0;n=null!=
|
|
|
|
|
n?n:4;var y=document.createElement("div");null==c&&a.addLanguageMenu(y);var t=document.createElement("h2");mxUtils.write(t,e||mxResources.get("create"));t.style.marginTop="0px";t.style.marginBottom="24px";y.appendChild(t);mxUtils.write(y,mxResources.get("filename")+":");var w=document.createElement("input");w.setAttribute("value",b);w.style.width="280px";w.style.marginLeft="10px";w.style.marginBottom="20px";this.init=function(){w.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
|
|
|
|
w.select():document.execCommand("selectAll",!1,null)};y.appendChild(w);null!=p&&null!=u&&"image/"==u.substring(0,6)&&(w.style.width="160px",e=null,"image/svg+xml"==u&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),q=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+q),p.setAttribute("width","120px"),p.setAttribute("height","80px")):(e=document.createElement("img"),e.setAttribute("src",
|
|
|
|
|
"data:"+u+(q?";base64,":";utf8,")+p)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),y.appendChild(e),m&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){B("_blank")})));mxUtils.br(y);var x=document.createElement("div");x.style.textAlign="center";var z=0;x.style.marginTop="6px";y.appendChild(x);var C=document.createElement("select");C.style.marginLeft=
|
|
|
|
|
color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(t);var l=window.setTimeout(function(){null==a[k]&&(u.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(l),mxUtils.setOpacity(p,100),f.style.visibility="",u.stop(),e())}))}else e();x.appendChild(t);++y==n&&(mxUtils.br(x),y=0)}function A(b){var c=w.value;if(null==b||null!=c&&0<c.length)a.hideDialog(),d(c,b)}h=null!=h?h:!0;l=null!=l?l:!0;n=null!=
|
|
|
|
|
n?n:4;var B=document.createElement("div");null==c&&a.addLanguageMenu(B);var t=document.createElement("h2");mxUtils.write(t,e||mxResources.get("create"));t.style.marginTop="0px";t.style.marginBottom="24px";B.appendChild(t);mxUtils.write(B,mxResources.get("filename")+":");var w=document.createElement("input");w.setAttribute("value",b);w.style.width="280px";w.style.marginLeft="10px";w.style.marginBottom="20px";this.init=function(){w.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
|
|
|
|
w.select():document.execCommand("selectAll",!1,null)};B.appendChild(w);null!=p&&null!=u&&"image/"==u.substring(0,6)&&(w.style.width="160px",e=null,"image/svg+xml"==u&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),q=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+q),p.setAttribute("width","120px"),p.setAttribute("height","80px")):(e=document.createElement("img"),e.setAttribute("src",
|
|
|
|
|
"data:"+u+(q?";base64,":";utf8,")+p)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),B.appendChild(e),m&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){A("_blank")})));mxUtils.br(B);var x=document.createElement("div");x.style.textAlign="center";var y=0;x.style.marginTop="6px";B.appendChild(x);var C=document.createElement("select");C.style.marginLeft=
|
|
|
|
|
"10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(e,mxResources.get("googleDrive")),C.appendChild(e),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(e,mxResources.get("oneDrive")),C.appendChild(e),a.mode==
|
|
|
|
|
App.MODE_ONEDRIVE&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(e,mxResources.get("dropbox")),C.appendChild(e),a.mode==App.MODE_DROPBOX&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(e=
|
|
|
|
|
document.createElement("option"),e.setAttribute("value",App.MODE_GITHUB),mxUtils.write(e,mxResources.get("github")),C.appendChild(e),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_TRELLO),mxUtils.write(e,mxResources.get("trello")),C.appendChild(e),v(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||
|
|
|
|
|
null!=a.getCurrentFile()&&!mxClient.IS_IOS)e=document.createElement("option"),e.setAttribute("value",App.MODE_DEVICE),mxUtils.write(e,mxResources.get("device")),C.appendChild(e),a.mode!=App.MODE_DEVICE&&l||e.setAttribute("selected","selected"),k&&v(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);l&&isLocalStorage&&"0"!=urlParams.browser&&(l=document.createElement("option"),l.setAttribute("value",App.MODE_BROWSER),mxUtils.write(l,mxResources.get("browser")),C.appendChild(l),
|
|
|
|
|
a.mode==App.MODE_BROWSER&&l.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="right";null!=g&&(e=mxUtils.button(mxResources.get("help"),function(){a.openLink(g)}),e.className="geBtn",l.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){null!=c?c():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});e.className=
|
|
|
|
|
"geBtn";a.editor.cancelFirst&&l.appendChild(e);null==c&&(p=mxUtils.button(mxResources.get("decideLater"),function(){B(null)}),p.className="geBtn",l.appendChild(p));m&&(m=mxUtils.button(mxResources.get("openInNewWindow"),function(){B("_blank")}),m.className="geBtn",l.appendChild(m));mxClient.IS_IOS||(f=mxUtils.button(f||mxResources.get("create"),function(){B(k?"download":App.MODE_DEVICE)}),f.className="geBtn gePrimaryBtn",l.appendChild(f));a.editor.cancelFirst||l.appendChild(e);mxEvent.addListener(w,
|
|
|
|
|
"keypress",function(b){13==b.keyCode?B(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});y.appendChild(l);this.container=y},PopupDialog=function(a,b,d,c,e){e=null!=e?e:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=c&&c()});h.className="geBtn";h.style.marginBottom="8px";h.style.width=
|
|
|
|
|
"geBtn";a.editor.cancelFirst&&l.appendChild(e);null==c&&(p=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),p.className="geBtn",l.appendChild(p));m&&(m=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),m.className="geBtn",l.appendChild(m));mxClient.IS_IOS||(f=mxUtils.button(f||mxResources.get("create"),function(){A(k?"download":App.MODE_DEVICE)}),f.className="geBtn gePrimaryBtn",l.appendChild(f));a.editor.cancelFirst||l.appendChild(e);mxEvent.addListener(w,
|
|
|
|
|
"keypress",function(b){13==b.keyCode?A(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});B.appendChild(l);this.container=B},PopupDialog=function(a,b,d,c,e){e=null!=e?e:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();null!=c&&c()});h.className="geBtn";h.style.marginBottom="8px";h.style.width=
|
|
|
|
|
"280px";f.appendChild(h);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=d&&d();a.openLink(b)});l.className="geBtn gePrimaryBtn";l.style.width=h.style.width;f.appendChild(l);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,b,d,c,e,f){f=null!=f?f:!0;var h=a.editor.graph,l=document.createElement("div");mxUtils.write(l,b);b=document.createElement("div");b.className="geTitle";b.style.backgroundColor=
|
|
|
|
|
"transparent";b.style.borderColor="transparent";b.style.whiteSpace="nowrap";b.style.textOverflow="clip";b.style.cursor="default";mxClient.IS_VML||(b.style.paddingRight="20px");var m=document.createElement("input");m.setAttribute("value",d);m.setAttribute("type","text");m.setAttribute("spellcheck","false");m.setAttribute("autocorrect","off");m.setAttribute("autocomplete","off");m.setAttribute("autocapitalize","off");m.style.marginTop="6px";m.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?
|
|
|
|
|
20:-20)+"px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+
|
|
|
|
@ -6501,20 +6501,20 @@ function(){var b=new CropImageDialog(a,m.value,function(a){m.value=a});a.showDia
|
|
|
|
|
b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),p.className="geBtn",d.appendChild(p),null!=a.drive&&"1"==urlParams.photos&&(p=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
|
|
|
|
|
a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),p.className="geBtn",d.appendChild(p)));mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&k(m.value)});p=mxUtils.button(mxResources.get("apply"),function(){k(m.value)});p.className="geBtn gePrimaryBtn";d.appendChild(p);a.editor.cancelFirst||d.appendChild(b);Graph.fileSupport&&(d.style.marginTop="120px",l.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",l.style.backgroundPosition=
|
|
|
|
|
"center 65%",l.style.backgroundRepeat="no-repeat",b=document.createElement("div"),b.style.position="absolute",b.style.width="420px",b.style.top="58%",b.style.textAlign="center",b.style.fontSize="18px",b.style.color="#a0c3ff",mxUtils.write(b,mxResources.get("dragImagesHere")),l.appendChild(b));l.appendChild(d);this.container=l},LinkDialog=function(a,b,d,c,e){function f(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";
|
|
|
|
|
b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);B.appendChild(c)}var h=document.createElement("div");mxUtils.write(h,mxResources.get("editLink")+":");var l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";mxClient.IS_VML||(l.style.paddingRight="20px");var m=document.createElement("input");
|
|
|
|
|
b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);A.appendChild(c)}var h=document.createElement("div");mxUtils.write(h,mxResources.get("editLink")+":");var l=document.createElement("div");l.className="geTitle";l.style.backgroundColor="transparent";l.style.borderColor="transparent";l.style.whiteSpace="nowrap";l.style.textOverflow="clip";l.style.cursor="default";mxClient.IS_VML||(l.style.paddingRight="20px");var m=document.createElement("input");
|
|
|
|
|
m.setAttribute("placeholder",mxResources.get("dragUrlsHere"));m.setAttribute("type","text");m.style.marginTop="6px";m.style.width="400px";m.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";m.style.backgroundRepeat="no-repeat";m.style.backgroundPosition="100% 50%";m.style.paddingRight="14px";var g=document.createElement("div");g.setAttribute("title",mxResources.get("reset"));g.style.position="relative";g.style.left="-16px";g.style.width="12px";g.style.height="14px";g.style.cursor="pointer";
|
|
|
|
|
g.style.display=mxClient.IS_VML?"inline":"inline-block";g.style.top=(mxClient.IS_VML?0:3)+"px";g.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(g,"click",function(){m.value="";m.focus()});var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","current-linkdialog");var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";
|
|
|
|
|
n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name","current-linkdialog");var p=document.createElement("select");p.style.width="380px";if(e&&null!=a.pages){null!=b&&a.editor.graph.isPageLink(b)?(n.setAttribute("checked","checked"),n.defaultChecked=!0):(m.setAttribute("value",b),k.setAttribute("checked","checked"),k.defaultChecked=!0);m.style.width="380px";l.appendChild(k);l.appendChild(m);l.appendChild(g);mxUtils.br(l);l.appendChild(n);e=!1;for(g=0;g<a.pages.length;g++){var u=
|
|
|
|
|
document.createElement("option");mxUtils.write(u,a.pages[g].getName()||mxResources.get("pageWithNumber",[g+1]));u.setAttribute("value","data:page/id,"+a.pages[g].getId());b==u.getAttribute("value")&&(u.setAttribute("selected","selected"),e=!0);p.appendChild(u)}if(!e&&n.checked){var q=document.createElement("option");mxUtils.write(q,mxResources.get("pageNotFound"));q.setAttribute("disabled","disabled");q.setAttribute("selected","selected");q.setAttribute("value","pageNotFound");p.appendChild(q);mxEvent.addListener(p,
|
|
|
|
|
"change",function(){null==q.parentNode||q.selected||q.parentNode.removeChild(q)})}l.appendChild(p)}else m.setAttribute("value",b),l.appendChild(m),l.appendChild(g);h.appendChild(l);var v=mxUtils.button(d,function(){a.hideDialog();c(n.checked?"pageNotFound"!==p.value?p.value:b:m.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){n.checked?p.focus():(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
|
|
|
|
m.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(p,"focus",function(){k.removeAttribute("checked");n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(m,"focus",function(){n.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});if(Graph.fileSupport){var b=h.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",
|
|
|
|
|
mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(m.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),k.setAttribute("checked","checked"),k.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var B=document.createElement("div");
|
|
|
|
|
B.style.marginTop="20px";B.style.textAlign="right";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&B.appendChild(d);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b=
|
|
|
|
|
mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(m.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),k.setAttribute("checked","checked"),k.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var A=document.createElement("div");
|
|
|
|
|
A.style.marginTop="20px";A.style.textAlign="right";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&A.appendChild(d);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b=
|
|
|
|
|
"https://"+b+"/#G"+a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?(b=DriveClient.prototype.newAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&(b="https://drive.google.com/#folders/"+a.docs[0].id);m.value=b;m.focus()}else LinkDialog.selectedDocs=null;m.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&f(IMAGE_PATH+"/google-drive-logo.svg",
|
|
|
|
|
mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=gapi.auth.getToken().access_token,c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),g=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),
|
|
|
|
|
b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(d).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
|
|
|
|
|
a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&f(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){m.value=a[0].link;m.focus()}})});null!=a.oneDrive&&f(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){m.value=b.value[0].webUrl;
|
|
|
|
|
m.focus()})});null!=a.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],d=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+b+"/"+c+"/blob/"+d+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),c(n.checked?p.value:m.value,LinkDialog.selectedDocs))});B.appendChild(v);a.editor.cancelFirst||B.appendChild(d);h.appendChild(B);this.container=
|
|
|
|
|
m.focus()})});null!=a.gitHub&&f(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],d=a[2];a=a.slice(3,a.length).join("/");m.value="https://github.com/"+b+"/"+c+"/blob/"+d+"/"+a;m.focus()}})});mxEvent.addListener(m,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),c(n.checked?p.value:m.value,LinkDialog.selectedDocs))});A.appendChild(v);a.editor.cancelFirst||A.appendChild(d);h.appendChild(A);this.container=
|
|
|
|
|
h},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):(d.setAttribute("width","176"),d.setAttribute("height","219"),d.style.width="170px",d.style.height="219px",d.setAttribute("src",IMAGE_PATH+
|
|
|
|
|
"/logo-flat.png"));b.appendChild(d);mxUtils.br(b);d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color="#505050";b.appendChild(d);mxUtils.br(b);mxUtils.br(b);d=document.createElement("small");d.style.color="#505050";d.innerHTML='© 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';b.appendChild(d);mxEvent.addListener(b,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=
|
|
|
|
|
b},FeedbackDialog=function(a){var b=document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";b.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");b.appendChild(d);var c=document.createElement("input");c.setAttribute("type","text");c.style.marginTop="6px";c.style.width="600px";var e=mxUtils.button(mxResources.get("sendMessage"),
|
|
|
|
@ -6525,36 +6525,36 @@ var l=document.createElement("span");mxUtils.write(l," "+mxResources.get("includ
|
|
|
|
|
b.appendChild(m);d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right";l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst?(d.appendChild(l),d.appendChild(e)):(d.appendChild(e),d.appendChild(l));b.appendChild(d);this.container=b};FeedbackDialog.maxAttachmentSize=1E6;
|
|
|
|
|
var RevisionDialog=function(a,b,d){var c=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));c.appendChild(e);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";c.appendChild(f);var h=document.createElement("div");h.style.position="absolute";h.style.border="1px solid lightGray";h.style.left="199px";h.style.width="470px";h.style.height=
|
|
|
|
|
"376px";h.style.overflow="hidden";mxEvent.disableContextMenu(h);c.appendChild(h);var l=new Graph(h);l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;var m=0,g=null,k=0,n=l.getGlobalVariable;l.getGlobalVariable=function(a){return"page"==a&&null!=g&&null!=g[k]?g[k].getAttribute("name"):"pagenumber"==a?k+1:n.apply(this,arguments)};l.getLinkForCell=function(){return null};Editor.MathJaxRender&&
|
|
|
|
|
l.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(l.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),q=null,v=null,B=null,y=null,t=mxUtils.button("",function(){null!=B&&l.zoomIn()});t.className="geSprite geSprite-zoomin";t.setAttribute("title",mxResources.get("zoomIn"));
|
|
|
|
|
t.style.outline="none";t.style.border="none";t.style.margin="2px";t.setAttribute("disabled","disabled");mxUtils.setOpacity(t,20);var w=mxUtils.button("",function(){null!=B&&l.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var x=mxUtils.button("",function(){null!=B&&(l.maxFitScale=8,l.fit(8),l.center())});x.className=
|
|
|
|
|
"geSprite geSprite-fit";x.setAttribute("title",mxResources.get("fit"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var z=mxUtils.button("",function(){null!=B&&(l.zoomActual(),l.center())});z.className="geSprite geSprite-actualsize";z.setAttribute("title",mxResources.get("actualSize"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var C=
|
|
|
|
|
document.createElement("div");C.style.position="absolute";C.style.textAlign="right";C.style.color="gray";C.style.marginTop="10px";C.style.backgroundColor="transparent";C.style.top="440px";C.style.right="32px";C.style.maxWidth="380px";C.style.cursor="default";var H=mxUtils.button(mxResources.get("download"),function(){if(null!=B){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(B.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
|
|
|
|
|
(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});H.className="geBtn";H.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("restore"),function(){null!=B&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
|
|
|
|
|
a.replaceFileData(y);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});E.className="geBtn";E.setAttribute("disabled","disabled");var D=document.createElement("select");D.setAttribute("disabled","disabled");D.style.maxWidth="80px";D.style.position="relative";D.style.top="-2px";D.style.verticalAlign="bottom";D.style.marginRight="6px";D.style.display="none";var G=null;mxEvent.addListener(D,"change",function(a){null!=
|
|
|
|
|
G&&(G(a),mxEvent.consume(a))});var A=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=B&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(B.documentElement)),window.openWindow(a.getUrl()))});A.className="geBtn";A.setAttribute("disabled","disabled");null!=d&&(A.style.display="none");var F=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl())});F.className="geBtn gePrimaryBtn";F.setAttribute("disabled",
|
|
|
|
|
l.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(l.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),q=null,v=null,A=null,B=null,t=mxUtils.button("",function(){null!=A&&l.zoomIn()});t.className="geSprite geSprite-zoomin";t.setAttribute("title",mxResources.get("zoomIn"));
|
|
|
|
|
t.style.outline="none";t.style.border="none";t.style.margin="2px";t.setAttribute("disabled","disabled");mxUtils.setOpacity(t,20);var w=mxUtils.button("",function(){null!=A&&l.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var x=mxUtils.button("",function(){null!=A&&(l.maxFitScale=8,l.fit(8),l.center())});x.className=
|
|
|
|
|
"geSprite geSprite-fit";x.setAttribute("title",mxResources.get("fit"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var y=mxUtils.button("",function(){null!=A&&(l.zoomActual(),l.center())});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");mxUtils.setOpacity(y,20);var C=
|
|
|
|
|
document.createElement("div");C.style.position="absolute";C.style.textAlign="right";C.style.color="gray";C.style.marginTop="10px";C.style.backgroundColor="transparent";C.style.top="440px";C.style.right="32px";C.style.maxWidth="380px";C.style.cursor="default";var H=mxUtils.button(mxResources.get("download"),function(){if(null!=A){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(A.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
|
|
|
|
|
(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});H.className="geBtn";H.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("restore"),function(){null!=A&&null!=B&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(B):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
|
|
|
|
|
a.replaceFileData(B);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});E.className="geBtn";E.setAttribute("disabled","disabled");var D=document.createElement("select");D.setAttribute("disabled","disabled");D.style.maxWidth="80px";D.style.position="relative";D.style.top="-2px";D.style.verticalAlign="bottom";D.style.marginRight="6px";D.style.display="none";var G=null;mxEvent.addListener(D,"change",function(a){null!=
|
|
|
|
|
G&&(G(a),mxEvent.consume(a))});var z=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=A&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(A.documentElement)),window.openWindow(a.getUrl()))});z.className="geBtn";z.setAttribute("disabled","disabled");null!=d&&(z.style.display="none");var F=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl())});F.className="geBtn gePrimaryBtn";F.setAttribute("disabled",
|
|
|
|
|
"disabled");null!=d&&(F.style.display="none",E.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var I=document.createElement("div");I.className="geToolbarContainer";I.style.backgroundColor="transparent";I.style.padding="2px";I.style.border="none";I.style.left="199px";I.style.top="442px";var K=null;if(null!=b&&0<b.length){h.style.cursor="move";var P=document.createElement("table");P.style.border=
|
|
|
|
|
"1px solid lightGray";P.style.borderCollapse="collapse";P.style.borderSpacing="0px";P.style.width="100%";var Q=document.createElement("tbody"),O=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(m=mxUtils.indexOf(a.pages,a.currentPage));for(var S=b.length-1;0<=S;S--){var M=function(c){var d=new Date(c.modifiedDate),e=null;if(0<=d.getTime()){var n=function(b){p.stop();var c=mxUtils.parseXml(b),n=a.editor.extractGraphModel(c.documentElement,!0);if(null!=n){var f=function(b){null!=b&&(b=
|
|
|
|
|
q(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},q=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};D.style.display="none";D.innerHTML="";B=c;y=b;g=parseSelectFunction=null;k=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");g=[];for(b=0;b<c.length;b++)g.push(c[b]);
|
|
|
|
|
q(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},q=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};D.style.display="none";D.innerHTML="";A=c;B=b;g=parseSelectFunction=null;k=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");g=[];for(b=0;b<c.length;b++)g.push(c[b]);
|
|
|
|
|
k=Math.min(m,g.length-1);0<g.length&&f(g[k]);if(1<g.length)for(D.removeAttribute("disabled"),D.style.display="",b=0;b<g.length;b++)c=document.createElement("option"),mxUtils.write(c,g[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==k&&c.setAttribute("selected","selected"),D.appendChild(c);G=function(){k=m=parseInt(D.value);f(g[m])}}else q(n);C.innerHTML="";mxUtils.write(C,d.toLocaleDateString()+" "+d.toLocaleTimeString());C.setAttribute("title",e.getAttribute("title"));
|
|
|
|
|
t.removeAttribute("disabled");w.removeAttribute("disabled");x.removeAttribute("disabled");z.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),H.removeAttribute("disabled"),F.removeAttribute("disabled"),A.removeAttribute("disabled"));mxUtils.setOpacity(t,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(z,60)}else D.style.display="none",D.innerHTML="",C.innerHTML="",mxUtils.write(C,mxResources.get("errorLoadingFile"))},
|
|
|
|
|
t.removeAttribute("disabled");w.removeAttribute("disabled");x.removeAttribute("disabled");y.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),H.removeAttribute("disabled"),F.removeAttribute("disabled"),z.removeAttribute("disabled"));mxUtils.setOpacity(t,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(y,60)}else D.style.display="none",D.innerHTML="",C.innerHTML="",mxUtils.write(C,mxResources.get("errorLoadingFile"))},
|
|
|
|
|
e=document.createElement("tr");e.style.borderBottom="1px solid lightGray";e.style.fontSize="12px";e.style.cursor="pointer";var f=document.createElement("td");f.style.padding="6px";f.style.whiteSpace="nowrap";c==b[b.length-1]?mxUtils.write(f,mxResources.get("current")):d.toDateString()===O?mxUtils.write(f,d.toLocaleTimeString()):mxUtils.write(f,d.toLocaleDateString()+" "+d.toLocaleTimeString());e.appendChild(f);e.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+
|
|
|
|
|
(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){v!=c&&(p.stop(),null!=q&&(q.style.backgroundColor=""),v=c,q=e,q.style.backgroundColor="#ebf2f9",y=B=null,C.removeAttribute("title"),C.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",l.getModel().clear(),E.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),z.setAttribute("disabled",
|
|
|
|
|
"disabled"),x.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),mxUtils.setOpacity(t,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(z,20),p.spin(h),c.getXml(function(a){v==c&&n(a)},function(a){p.stop();D.style.display="none";D.innerHTML="";C.innerHTML="";mxUtils.write(C,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){F.click();
|
|
|
|
|
(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){v!=c&&(p.stop(),null!=q&&(q.style.backgroundColor=""),v=c,q=e,q.style.backgroundColor="#ebf2f9",B=A=null,C.removeAttribute("title"),C.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",l.getModel().clear(),E.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),y.setAttribute("disabled",
|
|
|
|
|
"disabled"),x.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),mxUtils.setOpacity(t,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(y,20),p.spin(h),c.getXml(function(a){v==c&&n(a)},function(a){p.stop();D.style.display="none";D.innerHTML="";C.innerHTML="";mxUtils.write(C,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){F.click();
|
|
|
|
|
window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);Q.appendChild(e)}return e}(b[S]);null!=M&&S==b.length-1&&(K=M)}P.appendChild(Q);f.appendChild(P)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(h.style.display="none",I.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(h.style.display="none",I.style.display="none",mxUtils.write(f,
|
|
|
|
|
mxResources.get("noRevisions")));this.init=function(){null!=K&&K.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";I.appendChild(D);I.appendChild(t);I.appendChild(w);I.appendChild(z);I.appendChild(x);a.editor.cancelFirst?(e.appendChild(f),e.appendChild(H),e.appendChild(A),e.appendChild(E),e.appendChild(F)):(e.appendChild(H),e.appendChild(A),e.appendChild(E),e.appendChild(F),e.appendChild(f));c.appendChild(e);c.appendChild(I);c.appendChild(C);this.container=
|
|
|
|
|
mxResources.get("noRevisions")));this.init=function(){null!=K&&K.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";I.appendChild(D);I.appendChild(t);I.appendChild(w);I.appendChild(y);I.appendChild(x);a.editor.cancelFirst?(e.appendChild(f),e.appendChild(H),e.appendChild(z),e.appendChild(E),e.appendChild(F)):(e.appendChild(H),e.appendChild(z),e.appendChild(E),e.appendChild(F),e.appendChild(f));c.appendChild(e);c.appendChild(I);c.appendChild(C);this.container=
|
|
|
|
|
c},DraftDialog=function(a,b,d,c,e,f,h,l){var m=document.createElement("div"),g=document.createElement("div");g.style.marginTop="0px";g.style.whiteSpace="nowrap";g.style.overflow="auto";mxUtils.write(g,b);m.appendChild(g);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.marginTop="10px";k.style.width="640px";k.style.top="46px";k.style.bottom="74px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);m.appendChild(k);var n=new Graph(k);
|
|
|
|
|
n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;b=mxUtils.parseXml(d);var p=a.editor.extractGraphModel(b.documentElement,!0),u=0,q=null,v=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[u]?q[u].getAttribute("name"):"pagenumber"==a?u+1:v.apply(this,arguments)};n.getLinkForCell=function(){return null};b=mxUtils.button("",function(){n.zoomIn()});b.className=
|
|
|
|
|
"geSprite geSprite-zoomin";b.setAttribute("title",mxResources.get("zoomIn"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);d=mxUtils.button("",function(){n.zoomOut()});d.className="geSprite geSprite-zoomout";d.setAttribute("title",mxResources.get("zoomOut"));d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);g=mxUtils.button("",function(){n.maxFitScale=8;n.fit(8);n.center()});g.className="geSprite geSprite-fit";g.setAttribute("title",
|
|
|
|
|
mxResources.get("fit"));g.style.outline="none";g.style.border="none";g.style.margin="2px";mxUtils.setOpacity(g,60);var B=mxUtils.button("",function(){n.zoomActual();n.center()});B.className="geSprite geSprite-actualsize";B.setAttribute("title",mxResources.get("actualSize"));B.style.outline="none";B.style.border="none";B.style.margin="2px";mxUtils.setOpacity(B,60);e=mxUtils.button(h||mxResources.get("discard"),e);e.className="geBtn";var y=document.createElement("select");y.style.maxWidth="80px";y.style.position=
|
|
|
|
|
"relative";y.style.top="-2px";y.style.verticalAlign="bottom";y.style.marginRight="6px";y.style.display="none";c=mxUtils.button(f||mxResources.get("edit"),c);c.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.width="640px";f.style.textAlign="right";h=document.createElement("div");h.className="geToolbarContainer";h.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
|
|
|
|
|
this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(y,"change",function(a){u=parseInt(y.value);c(q[u]);mxEvent.consume(a)});if("mxfile"==p.nodeName){var d=p.getElementsByTagName("diagram");
|
|
|
|
|
q=[];for(var g=0;g<d.length;g++)q.push(d[g]);0<q.length&&c(q[u]);if(1<q.length)for(y.style.display="",g=0;g<q.length;g++)d=document.createElement("option"),mxUtils.write(d,q[g].getAttribute("name")||mxResources.get("pageWithNumber",[g+1])),d.setAttribute("value",g),g==u&&d.setAttribute("selected","selected"),y.appendChild(d)}else b(p)};h.appendChild(y);h.appendChild(b);h.appendChild(d);h.appendChild(B);h.appendChild(g);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className=
|
|
|
|
|
mxResources.get("fit"));g.style.outline="none";g.style.border="none";g.style.margin="2px";mxUtils.setOpacity(g,60);var A=mxUtils.button("",function(){n.zoomActual();n.center()});A.className="geSprite geSprite-actualsize";A.setAttribute("title",mxResources.get("actualSize"));A.style.outline="none";A.style.border="none";A.style.margin="2px";mxUtils.setOpacity(A,60);e=mxUtils.button(h||mxResources.get("discard"),e);e.className="geBtn";var B=document.createElement("select");B.style.maxWidth="80px";B.style.position=
|
|
|
|
|
"relative";B.style.top="-2px";B.style.verticalAlign="bottom";B.style.marginRight="6px";B.style.display="none";c=mxUtils.button(f||mxResources.get("edit"),c);c.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.position="absolute";f.style.bottom="30px";f.style.width="640px";f.style.textAlign="right";h=document.createElement("div");h.className="geToolbarContainer";h.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
|
|
|
|
|
this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(B,"change",function(a){u=parseInt(B.value);c(q[u]);mxEvent.consume(a)});if("mxfile"==p.nodeName){var d=p.getElementsByTagName("diagram");
|
|
|
|
|
q=[];for(var g=0;g<d.length;g++)q.push(d[g]);0<q.length&&c(q[u]);if(1<q.length)for(B.style.display="",g=0;g<q.length;g++)d=document.createElement("option"),mxUtils.write(d,q[g].getAttribute("name")||mxResources.get("pageWithNumber",[g+1])),d.setAttribute("value",g),g==u&&d.setAttribute("selected","selected"),B.appendChild(d)}else b(p)};h.appendChild(B);h.appendChild(b);h.appendChild(d);h.appendChild(A);h.appendChild(g);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className=
|
|
|
|
|
"geBtn";l=null!=l?mxUtils.button(mxResources.get("ignore"),l):null;null!=l&&(l.className="geBtn");a.editor.cancelFirst?(f.appendChild(b),null!=l&&f.appendChild(l),f.appendChild(e),f.appendChild(c)):(f.appendChild(c),f.appendChild(e),null!=l&&f.appendChild(l),f.appendChild(b));m.appendChild(f);m.appendChild(h);this.container=m},FindWindow=function(a,b,d,c,e){function f(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var d=0;d<b.length;d++)if("label"!=b[d].nodeName){var g=
|
|
|
|
|
mxUtils.trim(b[d].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&g.substring(0,c.length)===c||null!=a&&a.test(g))return!0}}return!1}function h(){var a=m.model.getDescendants(m.model.getRoot()),b=p.value.toLowerCase(),c=u.checked?new RegExp(b):null,d=null;g!=b&&(g=b,k=null);var e=null==k;if(0<b.length)for(var n=0;n<a.length;n++){var h=m.view.getState(a[n]);if(null!=h&&null!=h.cell.value&&(e||null==d)&&(m.model.isVertex(h.cell)||m.model.isEdge(h.cell))&&(m.isHtmlLabel(h.cell)?
|
|
|
|
|
(q.innerHTML=m.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([q])):label=m.getLabel(h.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||f(c,h.cell,b))||null!=c&&(c.test(label)||f(c,h.cell,b))))if(e){d=h;break}else null==d&&(d=h);e=e||h==k}null!=d?(k=d,m.scrollCellToVisible(k.cell),m.isEnabled()?m.setSelectionCell(k.cell):m.highlightCell(k.cell)):m.isEnabled()&&m.clearSelection();return 0==b.length||null!=d}
|
|
|
|
|
var l=a.actions.get("find"),m=a.editor.graph,g=null,k=null,n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",mxResources.get("find"));p.setAttribute("type","text");p.style.marginTop="4px";p.style.marginBottom="6px";p.style.width="170px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";n.appendChild(p);var u=document.createElement("input");
|
|
|
|
|
u.setAttribute("type","checkbox");n.appendChild(u);mxUtils.write(n,mxResources.get("regularExpression"));var q=document.createElement("div");mxUtils.br(n);var v=mxUtils.button(mxResources.get("reset"),function(){p.value="";p.style.backgroundColor="";g=k=null;p.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.style.backgroundColor="#f5f5f5";v.style.backgroundImage="none";v.className="geBtn";n.appendChild(v);v=mxUtils.button(mxResources.get("find"),
|
|
|
|
|
function(){try{p.style.backgroundColor=h()?"":"#ffcfcf"}catch(B){a.handleError(B)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.style.backgroundColor="#4d90fe";v.style.backgroundImage="none";v.className="geBtn gePrimaryBtn";n.appendChild(v);mxEvent.addListener(p,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)l.funct();else if(g!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=h()?"":"#ffcfcf"}catch(y){p.style.backgroundColor=
|
|
|
|
|
function(){try{p.style.backgroundColor=h()?"":"#ffcfcf"}catch(A){a.handleError(A)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.style.backgroundColor="#4d90fe";v.style.backgroundImage="none";v.className="geBtn gePrimaryBtn";n.appendChild(v);mxEvent.addListener(p,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)l.funct();else if(g!=p.value.toLowerCase()||13==a.keyCode)try{p.style.backgroundColor=h()?"":"#ffcfcf"}catch(B){p.style.backgroundColor=
|
|
|
|
|
"#ffcfcf"}});mxEvent.addListener(n,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(l.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),n,b,d,c,e,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
|
|
|
|
p.select():document.execCommand("selectAll",!1,null)):m.container.focus()}))},TagsWindow=function(a,b,d,c,e){function f(a){a=null!=a?a:l.model.getDescendants(l.model.getRoot());for(var b=k.value.split(" "),c=[],d=0;d<a.length;d++)if(l.model.isVertex(a[d])||l.model.isEdge(a[d])){var g=null!=a[d].value&&"object"==typeof a[d].value?mxUtils.trim(a[d].value.getAttribute(m)||""):"",e=!0;if(0<g.length)for(var g=g.toLowerCase().split(" "),n=0;n<b.length&&e;n++)var f=mxUtils.trim(b[n]).toLowerCase(),e=e&&
|
|
|
|
|
(0==f.length||0<=mxUtils.indexOf(g,f));else e=0==mxUtils.trim(k.value).length;e&&c.push(a[d])}return c}function h(a,b){l.model.beginUpdate();try{for(var c=0;c<a.length;c++)l.model.setVisible(a[c],b)}finally{l.model.endUpdate()}}var l=a.editor.graph,m="tags",g=document.createElement("div");g.style.userSelect="none";g.style.overflow="hidden";g.style.padding="10px";g.style.height="100%";var k=document.createElement("input");k.setAttribute("placeholder",mxResources.get("allTags"));k.setAttribute("type",
|
|
|
|
@ -6572,8 +6572,8 @@ function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName)null!=b.imageCall
|
|
|
|
|
b.id:null});0==g&&0==d&&n()})(b.entries[d])})(d[g]);c.style.padding="30px";c.appendChild(b);c.appendChild(e);c.appendChild(f);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=b.style.width,d.style.paddingTop="12px");var k=document.createElement("input");k.setAttribute("type",
|
|
|
|
|
"checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)b=document.createElement("span"),b.style.paddingRight="20px",b.appendChild(k),mxUtils.write(b," "+mxResources.get("rememberThisSetting")),k.checked=!0,k.defaultChecked=!0,mxEvent.addListener(b,"click",function(a){mxEvent.getSource(a)!=k&&(k.checked=!k.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.top="-6px"),d.appendChild(b);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className=
|
|
|
|
|
"geBtn";var n=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],c=0;c<l.length;c++){var d=l[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),k.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var p=document.createElement("table"),u=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";var q=document.createElement("tr");p.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),v=document.createElement("td"),
|
|
|
|
|
B=mxUtils.bind(this,function(b,c,d){var g=document.createElement("input");g.type="checkbox";p.appendChild(g);g.checked=a.sidebar.isEntryVisible(d);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");c.style.display="block";c.appendChild(g);c.appendChild(k);mxEvent.addListener(k,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return g.checked?d:null}});q.appendChild(b);q.appendChild(n);q.appendChild(v);u.appendChild(q);
|
|
|
|
|
p.appendChild(u);for(var l=[],y=0,g=0;g<d.length;g++)for(u=0;u<d[g].entries.length;u++)y++;for(var t=[b,n,v],w=0,g=0;g<d.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];l.push(B(t[Math.floor(w/(y/3))],c.title,c.id));w++}})(d[g]);c.appendChild(p);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,d.appendChild(k),b=document.createElement("span"),
|
|
|
|
|
A=mxUtils.bind(this,function(b,c,d){var g=document.createElement("input");g.type="checkbox";p.appendChild(g);g.checked=a.sidebar.isEntryVisible(d);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");c.style.display="block";c.appendChild(g);c.appendChild(k);mxEvent.addListener(k,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return g.checked?d:null}});q.appendChild(b);q.appendChild(n);q.appendChild(v);u.appendChild(q);
|
|
|
|
|
p.appendChild(u);for(var l=[],B=0,g=0;g<d.length;g++)for(u=0;u<d[g].entries.length;u++)B++;for(var t=[b,n,v],w=0,g=0;g<d.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];l.push(A(t[Math.floor(w/(B/3))],c.title,c.id));w++}})(d[g]);c.appendChild(p);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,d.appendChild(k),b=document.createElement("span"),
|
|
|
|
|
mxUtils.write(b," "+mxResources.get("rememberThisSetting")),d.appendChild(b),mxEvent.addListener(b,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)}));c.appendChild(d);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<l.length;c++){var d=l[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(0<b.length?b.join(";"):"",k.checked);a.hideDialog()});n.className=
|
|
|
|
|
"geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(b),d.appendChild(n)):(d.appendChild(n),d.appendChild(b));c.appendChild(d);this.container=c},PluginsDialog=function(a){function b(){if(0==e.length)c.innerHTML=mxResources.get("noPlugins");else{c.innerHTML="";for(var d=0;d<e.length;d++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var n=document.createElement("span");n.className="geSprite geSprite-delete";
|
|
|
|
|
n.style.position="relative";n.style.cursor="pointer";n.style.top="5px";n.style.marginRight="4px";n.style.display="inline-block";k.appendChild(n);mxUtils.write(k,e[d]);c.appendChild(k);mxUtils.br(c);mxEvent.addListener(n,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[c]+'"?',function(){e.splice(c,1);b()})}}(d))}}}var d=document.createElement("div"),c=document.createElement("div");c.style.height="120px";c.style.overflow="auto";var e=mxSettings.getPlugins().slice();
|
|
|
|
@ -6583,42 +6583,42 @@ m.appendChild(l)):(m.appendChild(f),m.appendChild(l),m.appendChild(h));d.appendC
|
|
|
|
|
g=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";this.init=function(){k.focus();k.select()};g.appendChild(k);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type",
|
|
|
|
|
"text");n.style.width="100px";n.value="0";g.appendChild(n);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("right")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value="0";g.appendChild(p);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");
|
|
|
|
|
mxUtils.write(m,mxResources.get("bottom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value="0";g.appendChild(u);h.appendChild(m);h.appendChild(g);f.appendChild(h);h=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("circle")+":");h.appendChild(m);var q=document.createElement("input");q.setAttribute("type","checkbox");g.appendChild(q);h.appendChild(g);f.appendChild(h);e.appendChild(f);
|
|
|
|
|
c.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,B=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),c=b.getContext("2d"),g=v.width,e=v.height,f=parseInt(k.value),h=parseInt(n.value),g=Math.max(1,g-f-parseInt(p.value)),e=Math.max(1,e-h-parseInt(u.value));b.width=g;b.height=e;q.checked&&(c.fillStyle="#000000",c.arc(g/2,e/2,Math.min(g/2,e/2),0,2*Math.PI),c.fill(),c.globalCompositeOperation=
|
|
|
|
|
"source-in");c.drawImage(v,f,h,g,e,0,0,g,e);d(b.toDataURL())});B.setAttribute("disabled","disabled");v.onload=function(){B.removeAttribute("disabled");l.innerHTML="";mxUtils.write(l,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+": "+v.height)};v.src=b;mxEvent.addListener(c,"keypress",function(a){13==a.keyCode&&B.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(B)):(b.appendChild(B),
|
|
|
|
|
c.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),c=b.getContext("2d"),g=v.width,e=v.height,f=parseInt(k.value),h=parseInt(n.value),g=Math.max(1,g-f-parseInt(p.value)),e=Math.max(1,e-h-parseInt(u.value));b.width=g;b.height=e;q.checked&&(c.fillStyle="#000000",c.arc(g/2,e/2,Math.min(g/2,e/2),0,2*Math.PI),c.fill(),c.globalCompositeOperation=
|
|
|
|
|
"source-in");c.drawImage(v,f,h,g,e,0,0,g,e);d(b.toDataURL())});A.setAttribute("disabled","disabled");v.onload=function(){A.removeAttribute("disabled");l.innerHTML="";mxUtils.write(l,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+": "+v.height)};v.src=b;mxEvent.addListener(c,"keypress",function(a){13==a.keyCode&&A.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(A)):(b.appendChild(A),
|
|
|
|
|
b.appendChild(e));c.appendChild(b);this.container=c},EditGeometryDialog=function(a,b){var d=a.editor.graph,c=1==b.length?d.getCellGeometry(b[0]):null,e=document.createElement("div"),f=document.createElement("table"),h=document.createElement("tbody"),l=document.createElement("tr"),m=document.createElement("td"),g=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(m,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";
|
|
|
|
|
k.value=null!=c?c.x:"";this.init=function(){k.focus();k.select()};g.appendChild(k);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=c?c.y:"";g.appendChild(n);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");
|
|
|
|
|
g=document.createElement("td");mxUtils.write(m,mxResources.get("width")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=c?c.width:"";g.appendChild(p);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("height")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=
|
|
|
|
|
c?c.height:"";g.appendChild(u);l.appendChild(m);l.appendChild(g);h.appendChild(l);l=document.createElement("tr");m=document.createElement("td");g=document.createElement("td");mxUtils.write(m,mxResources.get("rotation")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=1==b.length?mxUtils.getValue(d.getCellStyle(b[0]),mxConstants.STYLE_ROTATION,0):"";g.appendChild(q);l.appendChild(m);l.appendChild(g);h.appendChild(l);f.appendChild(h);e.appendChild(f);
|
|
|
|
|
var c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var c=0;c<b.length;c++){var g=d.getCellGeometry(b[c]);null!=g&&(g=g.clone(),d.isCellMovable(b[c])&&(0<mxUtils.trim(k.value).length&&(g.x=Number(k.value)),0<mxUtils.trim(n.value).length&&(g.y=Number(n.value))),d.isCellResizable(b[c])&&(0<mxUtils.trim(p.value).length&&(g.width=Number(p.value)),0<mxUtils.trim(u.value).length&&
|
|
|
|
|
(g.height=Number(u.value))),d.getModel().setGeometry(b[c],g));0<mxUtils.trim(q.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(q.value),[b[c]])}}finally{d.getModel().endUpdate()}});mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&v.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(c),f.appendChild(v)):(f.appendChild(v),f.appendChild(c));e.appendChild(f);this.container=e},LibraryDialog=function(a,
|
|
|
|
|
b,d,c,e,f){function h(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function l(b,c,d,g,e,n,f,p,m){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=f||null==v[b]){var y=function(){E.innerHTML="";E.style.cursor="pointer";E.style.whiteSpace="nowrap";E.style.textOverflow="ellipsis";mxUtils.write(E,null!=D.title&&0<D.title.length?D.title:mxResources.get("untitled"));
|
|
|
|
|
E.style.color=null==D.title||0==D.title.length?"#d0d0d0":""};u.style.backgroundImage="";q.style.display="none";var z=e,A=n;if(e>a.maxImageSize||n>a.maxImageSize){var C=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,n));e*=C;n*=C}z>A?(A=Math.round(100*A/z),z=100):(z=Math.round(100*z/A),A=100);var F=document.createElement("div");F.setAttribute("draggable","true");F.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";F.style.position="relative";F.style.cursor="move";
|
|
|
|
|
mxUtils.setPrefixedStyle(F.style,"transition","transform .1s ease-in-out");if(null!=b){var I=document.createElement("img");I.setAttribute("src",w.convert(b));I.style.width=z+"px";I.style.height=A+"px";I.style.margin="10px";I.style.paddingBottom=Math.floor((100-A)/2)+"px";I.style.paddingLeft=Math.floor((100-z)/2)+"px";F.appendChild(I)}else if(null!=f){var K=a.stringToCells(a.editor.graph.decompress(f.xml));0<K.length&&(a.sidebar.createThumb(K,100,100,F,null,!0,!1),F.firstChild.style.display=mxClient.IS_QUIRKS?
|
|
|
|
|
b,d,c,e,f){function h(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function l(b,c,d,g,e,n,f,p,m){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=f||null==v[b]){var B=function(){E.innerHTML="";E.style.cursor="pointer";E.style.whiteSpace="nowrap";E.style.textOverflow="ellipsis";mxUtils.write(E,null!=D.title&&0<D.title.length?D.title:mxResources.get("untitled"));
|
|
|
|
|
E.style.color=null==D.title||0==D.title.length?"#d0d0d0":""};u.style.backgroundImage="";q.style.display="none";var y=e,z=n;if(e>a.maxImageSize||n>a.maxImageSize){var C=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,n));e*=C;n*=C}y>z?(z=Math.round(100*z/y),y=100):(y=Math.round(100*y/z),z=100);var F=document.createElement("div");F.setAttribute("draggable","true");F.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";F.style.position="relative";F.style.cursor="move";
|
|
|
|
|
mxUtils.setPrefixedStyle(F.style,"transition","transform .1s ease-in-out");if(null!=b){var I=document.createElement("img");I.setAttribute("src",w.convert(b));I.style.width=y+"px";I.style.height=z+"px";I.style.margin="10px";I.style.paddingBottom=Math.floor((100-z)/2)+"px";I.style.paddingLeft=Math.floor((100-y)/2)+"px";F.appendChild(I)}else if(null!=f){var K=a.stringToCells(a.editor.graph.decompress(f.xml));0<K.length&&(a.sidebar.createThumb(K,100,100,F,null,!0,!1),F.firstChild.style.display=mxClient.IS_QUIRKS?
|
|
|
|
|
"inline":"inline-block",F.firstChild.style.cursor="")}var H=document.createElement("img");H.setAttribute("src",Editor.closeImage);H.setAttribute("border","0");H.setAttribute("title",mxResources.get("delete"));H.setAttribute("align","top");H.style.paddingTop="4px";H.style.marginLeft="-22px";H.style.cursor="pointer";mxEvent.addListener(H,"dragstart",function(a){mxEvent.consume(a)});null==b&&null!=f&&(H.style.position="relative");(function(a,b,c){mxEvent.addListener(H,"click",function(d){v[b]=null;for(var g=
|
|
|
|
|
0;g<k.length;g++)if(null!=k[g].data&&k[g].data==b||null!=k[g].xml&&null!=c&&k[g].xml==c.xml){k.splice(g,1);break}F.parentNode.removeChild(a);0==k.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(d)});mxEvent.addListener(H,"dblclick",function(a){mxEvent.consume(a)})})(F,b,f);F.appendChild(H);F.style.marginBottom="30px";var E=document.createElement("div");E.style.position="absolute";E.style.boxSizing="border-box";E.style.bottom="-18px";E.style.left=
|
|
|
|
|
"10px";E.style.right="10px";E.style.backgroundColor="#ffffff";E.style.overflow="hidden";E.style.textAlign="center";var D=null;null!=b?(D={data:b,w:e,h:n,title:m},null!=p&&(D.aspect=p),v[b]=I,k.push(D)):null!=f&&(f.aspect="fixed",k.push(f),D=f);mxEvent.addListener(E,"keydown",function(a){13==a.keyCode&&null!=t&&(t(),t=null,mxEvent.consume(a))});y();F.appendChild(E);mxEvent.addListener(E,"mousedown",function(a){"true"!=E.getAttribute("contentEditable")&&mxEvent.consume(a)});K=function(b){if(mxClient.IS_IOS||
|
|
|
|
|
mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,D.title||"",mxResources.get("ok"),function(a){null!=a&&(D.title=a,y())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=E.getAttribute("contentEditable")){null!=t&&(t(),t=null);if(null==D.title||0==D.title.length)E.innerHTML="";E.style.textOverflow="";E.style.whiteSpace="";E.style.cursor="text";E.style.color="";E.setAttribute("contentEditable",
|
|
|
|
|
"true");E.focus();document.execCommand("selectAll",!1,null);t=function(){E.removeAttribute("contentEditable");E.style.cursor="pointer";D.title=E.innerHTML;y()};mxEvent.consume(b)}};mxEvent.addListener(E,"click",K);mxEvent.addListener(F,"dblclick",K);u.appendChild(F);mxEvent.addListener(F,"dragstart",function(a){null==b&&null!=f&&(H.style.visibility="hidden",E.style.visibility="hidden");mxClient.IS_FF&&null!=f.xml&&a.dataTransfer.setData("Text",f.xml);B=h(a);mxClient.IS_GC&&(F.style.opacity="0.9");
|
|
|
|
|
window.setTimeout(function(){mxUtils.setPrefixedStyle(F.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(F,30);H.style.visibility="";E.style.visibility=""},0)});mxEvent.addListener(F,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",E.style.visibility="");B=null;mxUtils.setOpacity(F,100);mxUtils.setPrefixedStyle(F.style,"transform",null)})}else x||(x=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),z=mxUtils.parseXml(b),"mxlibrary"==
|
|
|
|
|
z.documentElement.nodeName){A=JSON.parse(mxUtils.getTextContent(z.documentElement));if(null!=A&&0<A.length)for(var G=0;G<A.length;G++)null!=A[G].xml?l(null,null,0,0,0,0,A[G]):l(A[G].data,null,0,0,A[G].w,A[G].h,null,"fixed",A[G].title);e=!0}else if("mxfile"==z.documentElement.nodeName){for(var P=z.documentElement.getElementsByTagName("diagram"),G=0;G<P.length;G++){var A=mxUtils.getTextContent(P[G]),K=a.stringToCells(a.editor.graph.decompress(A)),R=a.editor.graph.getBoundingBoxFromGeometry(K);l(null,
|
|
|
|
|
null,0,0,0,0,{xml:A,w:R.width,h:R.height})}e=!0}}catch(Z){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(Z){}return null}function m(a){a.dataTransfer.dropEffect=null!=B?"move":"copy";a.stopPropagation();a.preventDefault()}function g(b){b.stopPropagation();b.preventDefault();x=!1;y=h(b);if(null!=B)null!=y&&y<u.children.length?(k.splice(y>B?y-1:y,0,k.splice(B,1)[0]),u.insertBefore(u.children[B],u.children[y])):(k.push(k.splice(B,1)[0]),u.appendChild(u.children[B]));
|
|
|
|
|
else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,z(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){l(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var k=[];d=document.createElement("div");
|
|
|
|
|
"10px";E.style.right="10px";E.style.backgroundColor="#ffffff";E.style.overflow="hidden";E.style.textAlign="center";var D=null;null!=b?(D={data:b,w:e,h:n,title:m},null!=p&&(D.aspect=p),v[b]=I,k.push(D)):null!=f&&(f.aspect="fixed",k.push(f),D=f);mxEvent.addListener(E,"keydown",function(a){13==a.keyCode&&null!=t&&(t(),t=null,mxEvent.consume(a))});B();F.appendChild(E);mxEvent.addListener(E,"mousedown",function(a){"true"!=E.getAttribute("contentEditable")&&mxEvent.consume(a)});K=function(b){if(mxClient.IS_IOS||
|
|
|
|
|
mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,D.title||"",mxResources.get("ok"),function(a){null!=a&&(D.title=a,B())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=E.getAttribute("contentEditable")){null!=t&&(t(),t=null);if(null==D.title||0==D.title.length)E.innerHTML="";E.style.textOverflow="";E.style.whiteSpace="";E.style.cursor="text";E.style.color="";E.setAttribute("contentEditable",
|
|
|
|
|
"true");E.focus();document.execCommand("selectAll",!1,null);t=function(){E.removeAttribute("contentEditable");E.style.cursor="pointer";D.title=E.innerHTML;B()};mxEvent.consume(b)}};mxEvent.addListener(E,"click",K);mxEvent.addListener(F,"dblclick",K);u.appendChild(F);mxEvent.addListener(F,"dragstart",function(a){null==b&&null!=f&&(H.style.visibility="hidden",E.style.visibility="hidden");mxClient.IS_FF&&null!=f.xml&&a.dataTransfer.setData("Text",f.xml);A=h(a);mxClient.IS_GC&&(F.style.opacity="0.9");
|
|
|
|
|
window.setTimeout(function(){mxUtils.setPrefixedStyle(F.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(F,30);H.style.visibility="";E.style.visibility=""},0)});mxEvent.addListener(F,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",E.style.visibility="");A=null;mxUtils.setOpacity(F,100);mxUtils.setPrefixedStyle(F.style,"transform",null)})}else x||(x=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),y=mxUtils.parseXml(b),"mxlibrary"==
|
|
|
|
|
y.documentElement.nodeName){z=JSON.parse(mxUtils.getTextContent(y.documentElement));if(null!=z&&0<z.length)for(var G=0;G<z.length;G++)null!=z[G].xml?l(null,null,0,0,0,0,z[G]):l(z[G].data,null,0,0,z[G].w,z[G].h,null,"fixed",z[G].title);e=!0}else if("mxfile"==y.documentElement.nodeName){for(var P=y.documentElement.getElementsByTagName("diagram"),G=0;G<P.length;G++){var z=mxUtils.getTextContent(P[G]),K=a.stringToCells(a.editor.graph.decompress(z)),R=a.editor.graph.getBoundingBoxFromGeometry(K);l(null,
|
|
|
|
|
null,0,0,0,0,{xml:z,w:R.width,h:R.height})}e=!0}}catch(Z){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(Z){}return null}function m(a){a.dataTransfer.dropEffect=null!=A?"move":"copy";a.stopPropagation();a.preventDefault()}function g(b){b.stopPropagation();b.preventDefault();x=!1;B=h(b);if(null!=A)null!=B&&B<u.children.length?(k.splice(B>A?B-1:B,0,k.splice(A,1)[0]),u.insertBefore(u.children[A],u.children[B])):(k.push(k.splice(A,1)[0]),u.appendChild(u.children[A]));
|
|
|
|
|
else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,y(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){l(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var k=[];d=document.createElement("div");
|
|
|
|
|
d.style.height="100%";var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="40px";d.appendChild(n);mxUtils.write(n,mxResources.get("filename")+":");null==b&&(b=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",b);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==e||e.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==e||e.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||
|
|
|
|
|
5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};n.appendChild(p);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop="6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==k.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var q=
|
|
|
|
|
document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));d.appendChild(q);var v={},B=null,y=null,t=null;b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=t&&(t(),t=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",b);mxEvent.addListener(u,"pointerdown",b);mxEvent.addListener(u,"touchstart",
|
|
|
|
|
b);var w=new mxUrlConverter,x=!1;if(null!=c)for(b=0;b<c.length;b++)n=c[b],l(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(u,"dragleave",function(a){q.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==q){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var z=function(b){return function(c,d,g,k,e,n,t,f,h){null!=h&&(/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name))?a.importVisio(h,mxUtils.bind(this,function(c){a.spinner.stop();l(c,d,g,
|
|
|
|
|
document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));d.appendChild(q);var v={},A=null,B=null,t=null;b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=t&&(t(),t=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",b);mxEvent.addListener(u,"pointerdown",b);mxEvent.addListener(u,"touchstart",
|
|
|
|
|
b);var w=new mxUrlConverter,x=!1;if(null!=c)for(b=0;b<c.length;b++)n=c[b],l(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(u,"dragleave",function(a){q.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==q){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var y=function(b){return function(c,d,g,k,e,n,t,f,h){null!=h&&(/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name))?a.importVisio(h,mxUtils.bind(this,function(c){a.spinner.stop();l(c,d,g,
|
|
|
|
|
k,e,n,t,"fixed",mxEvent.isAltDown(b)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," "))})):null!=h&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,h.name)?a.parseFile(h,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(l(c.responseText,d,g,k,e,n,t,"fixed",mxEvent.isAltDown(b)?null:t.substring(0,t.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(l(c,d,g,k,e,n,t,"fixed",mxEvent.isAltDown(b)?null:t.substring(0,
|
|
|
|
|
t.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",m);mxEvent.addListener(u,"drop",g);mxEvent.addListener(q,"dragover",m);mxEvent.addListener(q,"drop",g);d.appendChild(u);c=document.createElement("div");c.style.textAlign="right";c.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("export"),
|
|
|
|
|
function(){var b=a.createLibraryDataFromImages(k),c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});n.setAttribute("id","btnDownload");n.className="geBtn";c.appendChild(n);var C=document.createElement("input");C.setAttribute("multiple","multiple");C.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(C,
|
|
|
|
|
"change",function(b){x=!1;a.importFiles(C.files,0,0,a.maxImageSize,function(a,c,d,g,k,e,n,t,f){z(b)(a,c,d,g,k,e,n,t,f);C.value=""});u.scrollTop=u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=t&&(t(),t=null);C.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=t&&(t(),t=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){x=!1;if(null!=a){if("data:image/"==
|
|
|
|
|
"change",function(b){x=!1;a.importFiles(C.files,0,0,a.maxImageSize,function(a,c,d,g,k,e,n,t,f){y(b)(a,c,d,g,k,e,n,t,f);C.value=""});u.scrollTop=u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=t&&(t(),t=null);C.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=t&&(t(),t=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){x=!1;if(null!=a){if("data:image/"==
|
|
|
|
|
a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}l(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})});n.setAttribute("id","btnAddImageUrl");n.className="geBtn";c.appendChild(n);this.saveBtnClickHandler=function(b,c,d,g){a.saveLibrary(b,c,d,g)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=t&&(t(),t=null);this.saveBtnClickHandler(p.value,k,e,f)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";c.appendChild(n);
|
|
|
|
|
a.editor.cancelFirst||c.appendChild(b);d.appendChild(c);this.container=d},EditShapeDialog=function(a,b,d,c,e){c=null!=c?c:300;e=null!=e?e:120;var f,h,l=document.createElement("table"),m=document.createElement("tbody");l.style.cellPadding="4px";f=document.createElement("tr");h=document.createElement("td");h.setAttribute("colspan","2");h.style.fontSize="10pt";mxUtils.write(h,d);f.appendChild(h);m.appendChild(f);f=document.createElement("tr");h=document.createElement("td");var g=document.createElement("textarea");
|
|
|
|
|
g.style.outline="none";g.style.resize="none";g.style.width=c-200+"px";g.style.height=e+"px";this.textarea=g;this.init=function(){g.focus();g.scrollTop=0};h.appendChild(g);f.appendChild(h);h=document.createElement("td");d=document.createElement("div");d.style.position="relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=e+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);h.appendChild(d);var k=new Graph(d);k.setEnabled(!1);
|
|
|
|
|
var n=a.editor.graph.cloneCells([b])[0];k.addCells([n]);d=k.view.getState(n);var p="";null!=d.shape&&null!=d.shape.stencil&&(p=mxUtils.getPrettyXml(d.shape.stencil.desc));mxUtils.write(g,p||"");d=k.getGraphBounds();e=Math.min(160/d.width,(e-40)/d.height);k.view.scaleAndTranslate(e,20/e-d.x,20/e-d.y);f.appendChild(h);m.appendChild(f);f=document.createElement("tr");h=document.createElement("td");h.setAttribute("colspan","2");h.style.paddingTop="2px";h.style.whiteSpace="nowrap";h.setAttribute("align",
|
|
|
|
|
"right");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&h.appendChild(e);a.isOffline()||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),d.className="geBtn",h.appendChild(d));var u=function(b,c,d){var k=g.value,e=mxUtils.parseXml(k),k=mxUtils.getPrettyXml(e.documentElement),e=e.documentElement.getElementsByTagName("parsererror");if(null!=e&&0<e.length)a.showError(mxResources.get("error"),
|
|
|
|
|
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),e=!b.model.contains(c),!d||e||k!=p){k=a.editor.graph.compress(k);b.getModel().beginUpdate();try{if(e){var n=a.editor.graph.getInsertPoint();c.geometry.x=n.x;c.geometry.y=n.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+k+")",[c])}catch(x){throw x;}finally{b.getModel().endUpdate()}e&&b.setSelectionCell(c)}};d=mxUtils.button(mxResources.get("preview"),function(){u(k,n,!1)});d.className="geBtn";
|
|
|
|
|
h.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,b,!0)});d.className="geBtn gePrimaryBtn";h.appendChild(d);a.editor.cancelFirst||h.appendChild(e);f.appendChild(h);m.appendChild(f);l.appendChild(m);this.container=l},CustomDialog=function(a,b,d,c,e,f,h){var l=document.createElement("div");l.appendChild(b);b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="right";null!=h&&b.appendChild(h);h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();
|
|
|
|
|
null!=c&&c()});h.className="geBtn";a.editor.cancelFirst&&b.appendChild(h);if(!a.isOffline()&&null!=f){var m=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)});m.className="geBtn";b.appendChild(m)}e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});b.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(h);l.appendChild(b);this.cancelBtn=h;this.okButton=e;this.container=l};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
|
|
|
|
|
h.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,b,!0)});d.className="geBtn gePrimaryBtn";h.appendChild(d);a.editor.cancelFirst||h.appendChild(e);f.appendChild(h);m.appendChild(f);l.appendChild(m);this.container=l},CustomDialog=function(a,b,d,c,e,f,h,l){var m=document.createElement("div");m.appendChild(b);b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="right";null!=h&&b.appendChild(h);h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();
|
|
|
|
|
null!=c&&c()});h.className="geBtn";l&&(h.style.display="none");a.editor.cancelFirst&&b.appendChild(h);a.isOffline()||null==f||(l=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),l.className="geBtn",b.appendChild(l));e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});b.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(h);m.appendChild(b);this.cancelBtn=h;this.okButton=e;this.container=m};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
|
|
|
|
|
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
|
|
|
|
|
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
|
|
|
|
|
IMAGE_PATH+"/spin.gif";Editor.tweetImage=IMAGE_PATH+"/tweet.png";Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.blankImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";Editor.hiResImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAh1BMVEUAAABMTExERERBQUFBQUFFRUVAQEBCQkJAQEA6OjpDQ0NKSkpBQUFBQUFERERERERBQUFCQkJCQkJCQkJJSUlBQUFCQkJDQ0NDQ0NCQkJDQ0NBQUFBQUFCQkJBQUFCQkJCQkJDQ0NCQkJHR0dBQUFCQkJCQkJAQEBCQkJDQ0NAQEBERERCQkIk1hS2AAAAKnRSTlMAAjj96BL7PgQFRwfu3TYazKuVjRXl1V1DPCn1uLGjnWNVIgy9hU40eGqPkM38AAACG0lEQVRYw+2X63KbMBCFzwZblgGDceN74muatpLe//m6MHV3gHGFAv2RjM94MAbxzdnVsQbBDKwH8AH8MDAyafzjqYeyOG04XE7RS8nIRDXg6BlT+rA0nmtAPh+NQRDxIASIMG44rAMrGunBgHwy3uUldxggIStGKp2f+DQc2O4h4eQsX3O2IFB/oEbsjOKbStnjAEA+zJ0ylZTbgvoDn8xNyn6Dbj5Kd4GsNpABa6duQPfSdEj88TgMAhKuCWjAkgmFXPLnsD0pWd3OFGdrMugQII/eOMPEiGOzqPMIeWrcSoMCg71W1pXBPvCP+gS/OdXqQ3uW23+93XGWLl/OaBb805bNcBPoEIcVJsnHzcxpZH86u5KZ9gDby5dQCcnKqdbke4ItI4Tzd7IW9hZQt4EO6GG9b9sYuuK9Wwn8TIr2xKbF2+3Nhr+qxChJ/AI6pIfCu4z4Zowp4ZUNihz79vewzctnHDwTvQO/hCdFBzrUGDOPn2Y/F8YKT4oOATLvlhOznzmBSdFBJWtc58y7r+UVFOCQczy3wpN6pegDqHtsCPTGvH9JuTO0Dyg8icldYPk+RB6g8Aofj4m2EKBvtTmUPD9xDd1pPcSReV2U5iD/ik2yrngtvvqBfPzOvKiDTKTsCdoHZJ7pLLffgTwlJ5vJdtJV2/jiAYaLvLGhMAEDO5QcDg2M/jOw/8Zn+K3ZwJvHT7ZffgC/NvA3zcybTeIfE4EAAAAASUVORK5CYII=":
|
|
|
|
@ -6673,26 +6673,26 @@ mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegist
|
|
|
|
|
[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",
|
|
|
|
|
STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
|
|
|
|
|
[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var q=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,d,g,k,e,n,f,h){if(null!=c&&null==mxMarker.markers[c]){var t=this.getPackageForType(c);null!=t&&mxStencilRegistry.getStencil(t)}return q.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){q.value=Math.max(1,
|
|
|
|
|
Math.min(n,Math.max(parseInt(q.value),parseInt(u.value))));u.value=Math.max(1,Math.min(n,Math.min(parseInt(q.value),parseInt(u.value))))}function d(b){function c(b,c,g){var k=b.getGraphBounds(),e=0,n=0,f=Z.get(),t=1/b.pageScale,h=y.checked;if(h)var t=parseInt(U.value),p=parseInt(R.value),t=Math.min(f.height*p/(k.height/b.view.scale),f.width*t/(k.width/b.view.scale));else t=parseInt(B.value)/(100*b.pageScale),isNaN(t)&&(d=1/b.pageScale,B.value="100 %");f=mxRectangle.fromRectangle(f);f.width=Math.ceil(f.width*
|
|
|
|
|
Math.min(n,Math.max(parseInt(q.value),parseInt(u.value))));u.value=Math.max(1,Math.min(n,Math.min(parseInt(q.value),parseInt(u.value))))}function d(b){function c(b,c,g){var k=b.getGraphBounds(),e=0,n=0,f=Z.get(),t=1/b.pageScale,h=B.checked;if(h)var t=parseInt(U.value),p=parseInt(R.value),t=Math.min(f.height*p/(k.height/b.view.scale),f.width*t/(k.width/b.view.scale));else t=parseInt(A.value)/(100*b.pageScale),isNaN(t)&&(d=1/b.pageScale,A.value="100 %");f=mxRectangle.fromRectangle(f);f.width=Math.ceil(f.width*
|
|
|
|
|
d);f.height=Math.ceil(f.height*d);t*=d;!h&&b.pageVisible?(k=b.getPageLayout(),e-=k.x*f.width,n-=k.y*f.height):h=!0;if(null==c){c=PrintDialog.createPrintPreview(b,t,f,0,e,n,h);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var l=c.writeHead;c.writeHead=function(b){l.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var u=c.renderPage;c.renderPage=
|
|
|
|
|
function(a,b,c,d,g,k){var e=u.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:e.className="geDisableMathJax";return e}}c.open(null,null,g,!0)}else{f=b.background;if(null==f||""==f||f==mxConstants.NONE)f="#ffffff";c.backgroundColor=f;c.autoOrigin=h;c.appendGraph(b,t,e,n,g,!0)}return c}var d=parseInt(W.value)/100;isNaN(d)&&(d=1,W.value="100 %");var d=.75*d,k=u.value,e=q.value,n=!p.checked,t=null;n&&(n=k==f&&e==f);if(!n&&null!=a.pages&&a.pages.length){var h=0,n=a.pages.length-1;p.checked||
|
|
|
|
|
(h=parseInt(k)-1,n=parseInt(e)-1);for(var l=h;l<=n;l++){var m=a.pages[l],k=m==a.currentPage?g:null;if(null==k){var k=a.createTemporaryGraph(g.getStylesheet()),e=!0,h=!1,w=null,v=null;null==m.viewState&&null==m.mapping&&null==m.root&&a.updatePageRoot(m);null!=m.viewState?(e=m.viewState.pageVisible,h=m.viewState.mathEnabled,w=m.viewState.background,v=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(h="0"!=m.mapping.diagramMap.get("mathEnabled"),w=m.mapping.diagramMap.get("background"),
|
|
|
|
|
v=m.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);k.background=w;k.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;k.pageVisible=e;k.mathEnabled=h;var A=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?l+1:A.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);k.model.setRoot(m.root)}t=c(k,t,l!=n);k!=g&&k.container.parentNode.removeChild(k.container)}}else t=c(g);t.mathEnabled&&
|
|
|
|
|
v=m.mapping.diagramMap.get("backgroundImage"),v=null!=v&&0<v.length?JSON.parse(v):null);k.background=w;k.backgroundImage=null!=v?new mxImage(v.src,v.width,v.height):null;k.pageVisible=e;k.mathEnabled=h;var z=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?l+1:z.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);k.model.setRoot(m.root)}t=c(k,t,l!=n);k!=g&&k.container.parentNode.removeChild(k.container)}}else t=c(g);t.mathEnabled&&
|
|
|
|
|
(n=t.wnd.document,n.writeln('<script type="text/x-mathjax-config">'),n.writeln("MathJax.Hub.Config({"),n.writeln('messageStyle: "none",'),n.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),n.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),n.writeln("TeX: {"),n.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),n.writeln("},"),n.writeln("tex2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("},"),
|
|
|
|
|
n.writeln("asciimath2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.writeln("}"),n.writeln("});"),b&&(n.writeln("MathJax.Hub.Queue(function () {"),n.writeln("window.print();"),n.writeln("});")),n.writeln("\x3c/script>"),n.writeln('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js">\x3c/script>'));t.closeDocument();!t.mathEnabled&&b&&PrintDialog.printPreview(t)}var g=a.editor.graph,k=document.createElement("div"),e=document.createElement("h3");
|
|
|
|
|
e.style.width="100%";e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,b||mxResources.get("print"));k.appendChild(e);var n=1,f=1,h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","all");p.setAttribute("type","radio");p.setAttribute("name","pages-printdialog");h.appendChild(p);e=document.createElement("span");
|
|
|
|
|
mxUtils.write(e,mxResources.get("printAllPages"));h.appendChild(e);mxUtils.br(h);var l=p.cloneNode(!0);p.setAttribute("checked","checked");l.setAttribute("value","range");h.appendChild(l);e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");h.appendChild(e);var u=document.createElement("input");u.style.cssText="margin:0 8px 0 8px;";u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.style.width="50px";h.appendChild(u);e=document.createElement("span");
|
|
|
|
|
mxUtils.write(e,mxResources.get("to"));h.appendChild(e);var q=u.cloneNode(!0);h.appendChild(q);mxEvent.addListener(u,"focus",function(){l.checked=!0});mxEvent.addListener(q,"focus",function(){l.checked=!0});mxEvent.addListener(u,"change",c);mxEvent.addListener(q,"change",c);if(null!=a.pages&&(n=a.pages.length,null!=a.currentPage))for(e=0;e<a.pages.length;e++)if(a.currentPage==a.pages[e]){f=e+1;u.value=f;q.value=f;break}u.setAttribute("max",n);q.setAttribute("max",n);1<n&&k.appendChild(h);var m=document.createElement("div");
|
|
|
|
|
m.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");m.appendChild(v);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));m.appendChild(e);var B=document.createElement("input");B.style.cssText="margin:0 8px 0 8px;";B.setAttribute("value","100 %");B.style.width="50px";m.appendChild(B);mxEvent.addListener(B,"focus",function(){v.checked=!0});
|
|
|
|
|
k.appendChild(m);var h=h.cloneNode(!1),y=v.cloneNode(!0);y.setAttribute("value","fit");v.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(y);h.appendChild(e);m=document.createElement("table");m.style.display="inline-block";var S=document.createElement("tbody"),M=document.createElement("tr"),J=M.cloneNode(!0),T=document.createElement("td"),L=T.cloneNode(!0),X=T.cloneNode(!0),N=T.cloneNode(!0),
|
|
|
|
|
m.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");m.appendChild(v);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));m.appendChild(e);var A=document.createElement("input");A.style.cssText="margin:0 8px 0 8px;";A.setAttribute("value","100 %");A.style.width="50px";m.appendChild(A);mxEvent.addListener(A,"focus",function(){v.checked=!0});
|
|
|
|
|
k.appendChild(m);var h=h.cloneNode(!1),B=v.cloneNode(!0);B.setAttribute("value","fit");v.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(B);h.appendChild(e);m=document.createElement("table");m.style.display="inline-block";var S=document.createElement("tbody"),M=document.createElement("tr"),J=M.cloneNode(!0),T=document.createElement("td"),L=T.cloneNode(!0),X=T.cloneNode(!0),N=T.cloneNode(!0),
|
|
|
|
|
Y=T.cloneNode(!0),V=T.cloneNode(!0);T.style.textAlign="right";N.style.textAlign="right";mxUtils.write(T,mxResources.get("fitTo"));var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","1");U.setAttribute("min","1");U.setAttribute("type","number");U.style.width="40px";L.appendChild(U);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));X.appendChild(e);mxUtils.write(N,mxResources.get("fitToBy"));var R=U.cloneNode(!0);Y.appendChild(R);
|
|
|
|
|
mxEvent.addListener(U,"focus",function(){y.checked=!0});mxEvent.addListener(R,"focus",function(){y.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));V.appendChild(e);M.appendChild(T);M.appendChild(L);M.appendChild(X);J.appendChild(N);J.appendChild(Y);J.appendChild(V);S.appendChild(M);S.appendChild(J);m.appendChild(S);h.appendChild(m);k.appendChild(h);h=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom=
|
|
|
|
|
mxEvent.addListener(U,"focus",function(){B.checked=!0});mxEvent.addListener(R,"focus",function(){B.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));V.appendChild(e);M.appendChild(T);M.appendChild(L);M.appendChild(X);J.appendChild(N);J.appendChild(Y);J.appendChild(V);S.appendChild(M);S.appendChild(J);m.appendChild(S);h.appendChild(m);k.appendChild(h);h=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom=
|
|
|
|
|
"12px";mxUtils.write(e,mxResources.get("paperSize"));h.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var Z=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);h.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));h.appendChild(e);var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","100 %");W.style.width="60px";h.appendChild(W);
|
|
|
|
|
k.appendChild(h);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&e.appendChild(h);a.isOffline()||(m=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",e.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
|
|
|
|
|
d(!1)}),m.className="geBtn",e.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});m.className="geBtn gePrimaryBtn";e.appendChild(m);a.editor.cancelFirst||e.appendChild(h);k.appendChild(e);this.container=k};var v=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=
|
|
|
|
|
this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(v.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=
|
|
|
|
|
this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))}})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.2.2";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.2.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
|
|
|
|
|
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
|
|
|
|
|
EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');svrc=EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=
|
|
|
|
|
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(u){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(q){}};c.src="data:image/svg+xml;base64,"+
|
|
|
|
@ -6769,7 +6769,7 @@ function(a,b,c,d,e,f,h){a=new ErrorDialog(this,a,b,c,d,e,f,h);this.showDialog(a.
|
|
|
|
|
d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,e=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(e,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&
|
|
|
|
|
"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",
|
|
|
|
|
!0,b),c.close());else if(mxClient.IS_IOS)b=new TextareaDialog(this,b+":",a,null,null,mxResources.get("close")),b.textarea.style.width="600px",b.textarea.style.height="380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var g=document.createElement("a"),k=!mxClient.IS_SF&&"undefined"!==typeof g.download;if(k||this.isOffline()){g.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?g.download=b:g.setAttribute("target","_blank");
|
|
|
|
|
document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(B){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=
|
|
|
|
|
document.body.appendChild(g);try{window.setTimeout(function(){URL.revokeObjectURL(g.href)},0),g.click(),g.parentNode.removeChild(g)}catch(A){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,f){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=f?"&base64="+f:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=
|
|
|
|
|
function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),g=Array(e),k=0;k<e;++k){for(var f=1024*k,h=Math.min(f+1024,d),t=Array(h-f),l=0;f<h;++l,++f)t[l]=c[f].charCodeAt(0);g[k]=new Uint8Array(t)}return new Blob(g,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,f,h){f=null!=f?f:!1;h=null!=h?h:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(f);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){try{if("_blank"==e)if(null==c||"image/"!=c.substring(0,
|
|
|
|
|
6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write(mxUtils.htmlEntities(a,!1)),g.document.close())}else this.openInNewWindow(a,c,d);else e==App.MODE_DEVICE?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(e,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,d,e,g)}catch(x){this.handleError(x)}}))}catch(w){this.handleError(w)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
|
|
|
|
mxResources.get("download"),!1,f,h,null,null,4<e?3:4,a,c,d);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+
|
|
|
|
@ -6779,7 +6779,7 @@ this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exp
|
|
|
|
|
this.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,
|
|
|
|
|
function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,
|
|
|
|
|
a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,g){return this.createEchoRequest(c,a,d,e,b,g)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,f,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var g=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,e){if("_blank"==e||null!=a&&0<a.length){var g=c("_blank"==e?null:a,e==App.MODE_DEVICE||null==e||"_blank"==e?"0":"1");null!=g&&(e==App.MODE_DEVICE||"_blank"==e?g.simulate(document,"_blank"):this.pickFolder(e,
|
|
|
|
|
mxUtils.bind(this,function(c){f=null!=f?f:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,f,!0,e,c)}catch(z){this.handleError(z)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(z){this.handleError(z)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),
|
|
|
|
|
mxUtils.bind(this,function(c){f=null!=f?f:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,f,!0,e,c)}catch(y){this.handleError(y)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,f,!0,e,c)}catch(y){this.handleError(y)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}),
|
|
|
|
|
mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,h,null,null,4<g?3:4,d,f,e);this.showDialog(a.container,380,g==(mxClient.IS_IOS?0:1)?160:4<g?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,f){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,f,h,l,m){if(this.spinner.spin(document.body,
|
|
|
|
|
mxResources.get("export"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;g=b?null:this.editor.graph.background;g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var k=this.editor.graph.getSvg(g,a,h,l,null,c);d&&this.editor.graph.addSvgShadow(k);var n=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?
|
|
|
|
|
b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),
|
|
|
|
@ -6798,20 +6798,20 @@ g.resize=!0);l&&c.push("layers");0<c.length&&(m&&c.push("lightbox"),g.toolbar=c.
|
|
|
|
|
var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","type-embedhtmldialog");g=f.cloneNode(!0);g.setAttribute("value","copy");k.appendChild(g);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(f);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));
|
|
|
|
|
k.appendChild(n);var h=this.getCurrentFile();null==c&&null!=h&&h.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(h.getId())})));g.setAttribute("checked","checked");null==c&&f.setAttribute("disabled","disabled");e.appendChild(k);var l=
|
|
|
|
|
this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight="12px";p.value="100%";e.appendChild(p);var C=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,H=H=this.addCheckbox(e,mxResources.get("allPages"),k,!k),E=this.addCheckbox(e,mxResources.get("layers"),!0),
|
|
|
|
|
D=this.addCheckbox(e,mxResources.get("lightbox"),!0),G=this.addEditButton(e,D),A=G.getEditInput();A.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&D.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(f.checked?c:null,m.checked,p.value,l.getTarget(),l.getColor(),C.checked,H.checked,
|
|
|
|
|
D=this.addCheckbox(e,mxResources.get("lightbox"),!0),G=this.addEditButton(e,D),z=G.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&D.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(f.checked?c:null,m.checked,p.value,l.getTarget(),l.getColor(),C.checked,H.checked,
|
|
|
|
|
E.checked,D.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,360,!0,!0);g.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,f){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";g.appendChild(k);var n=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=
|
|
|
|
|
n&&n.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace="normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));h.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())}));
|
|
|
|
|
l.style.marginTop="12px";l.className="geBtn";h.appendChild(l);g.appendChild(h);l=document.createElement("a");l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));h.appendChild(l);mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,
|
|
|
|
|
null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,p=null;if(null!=c||null!=d)a+=30,mxUtils.write(g,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",g.appendChild(m),mxUtils.write(g,mxResources.get("height")+
|
|
|
|
|
":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.width="50px",p.style.marginLeft="6px",p.style.marginBottom="10px",p.value=d+"px",g.appendChild(p),mxUtils.br(g);var q=this.addLinkSection(g,f);c=null!=this.pages&&1<this.pages.length;var u=null;if(null==n||n.constructor!=window.DriveFile||b)u=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var E=this.addCheckbox(g,mxResources.get("lightbox"),!0),D=this.addEditButton(g,E),G=D.getEditInput(),A=this.addCheckbox(g,mxResources.get("layers"),
|
|
|
|
|
!0);A.style.marginLeft=G.style.marginLeft;A.style.marginBottom="16px";A.style.marginTop="8px";mxEvent.addListener(E,"change",function(){E.checked?(A.removeAttribute("disabled"),G.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"));G.checked&&E.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){e(q.getTarget(),q.getColor(),null==u?
|
|
|
|
|
!0:u.checked,E.checked,D.getLink(),A.checked,null!=m?m.value:null,null!=p?p.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,246+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,
|
|
|
|
|
":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.width="50px",p.style.marginLeft="6px",p.style.marginBottom="10px",p.value=d+"px",g.appendChild(p),mxUtils.br(g);var q=this.addLinkSection(g,f);c=null!=this.pages&&1<this.pages.length;var u=null;if(null==n||n.constructor!=window.DriveFile||b)u=this.addCheckbox(g,mxResources.get("allPages"),c,!c);var E=this.addCheckbox(g,mxResources.get("lightbox"),!0),D=this.addEditButton(g,E),G=D.getEditInput(),z=this.addCheckbox(g,mxResources.get("layers"),
|
|
|
|
|
!0);z.style.marginLeft=G.style.marginLeft;z.style.marginBottom="16px";z.style.marginTop="8px";mxEvent.addListener(E,"change",function(){E.checked?(z.removeAttribute("disabled"),G.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"));G.checked&&E.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){e(q.getTarget(),q.getColor(),null==u?
|
|
|
|
|
!0:u.checked,E.checked,D.getLink(),z.checked,null!=m?m.value:null,null!=p?p.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,246+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,
|
|
|
|
|
mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(g);var k=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),f=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),!0);null!=f&&(f.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!k.checked,null!=f?f.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:146,!0,!0)};EditorUi.prototype.showExportDialog=
|
|
|
|
|
function(a,b,c,d,e,f,h,l){h=null!=h?h:!0;var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph,n="jpeg"==l?170:280,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";g.appendChild(m);mxUtils.write(g,mxResources.get("zoom")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.style.marginRight=
|
|
|
|
|
"12px";p.value=this.lastExportZoom||"100%";g.appendChild(p);mxUtils.write(g,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.value=this.lastExportBorder||"0";g.appendChild(q);mxUtils.br(g);var u=this.addCheckbox(g,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=l),v=this.addCheckbox(g,mxResources.get("selectionOnly"),
|
|
|
|
|
!1,k.isSelectionEmpty()),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.style.marginLeft="24px";B.setAttribute("disabled","disabled");B.setAttribute("type","checkbox");f&&(g.appendChild(B),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),n+=26,mxEvent.addListener(v,"change",function(){v.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(B.setAttribute("checked","checked"),B.defaultChecked=!0);var G=this.addCheckbox(g,
|
|
|
|
|
mxResources.get("shadow"),k.shadowVisible),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||A.setAttribute("disabled","disabled");b&&(g.appendChild(A),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),n+=26);var F=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=l),I=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(g,I?mxResources.get("allPages"):
|
|
|
|
|
"",I,!I,null,"jpeg"!=l);K.style.marginLeft="24px";K.style.marginBottom="16px";I||(K.style.visibility="hidden");mxEvent.addListener(F,"change",function(){F.checked&&I?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});h&&I||K.setAttribute("disabled","disabled");a=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=p.value;e(p.value,u.checked,!v.checked,G.checked,F.checked,A.checked,q.value,B.checked,!K.checked)}),null,c,d);this.showDialog(a.container,
|
|
|
|
|
!1,k.isSelectionEmpty()),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.style.marginLeft="24px";A.setAttribute("disabled","disabled");A.setAttribute("type","checkbox");f&&(g.appendChild(A),mxUtils.write(g,mxResources.get("crop")),mxUtils.br(g),n+=26,mxEvent.addListener(v,"change",function(){v.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(A.setAttribute("checked","checked"),A.defaultChecked=!0);var G=this.addCheckbox(g,
|
|
|
|
|
mxResources.get("shadow"),k.shadowVisible),z=document.createElement("input");z.style.marginTop="16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(g.appendChild(z),mxUtils.write(g,mxResources.get("embedImages")),mxUtils.br(g),n+=26);var F=this.addCheckbox(g,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=l),I=null!=this.pages&&1<this.pages.length,K=this.addCheckbox(g,I?mxResources.get("allPages"):
|
|
|
|
|
"",I,!I,null,"jpeg"!=l);K.style.marginLeft="24px";K.style.marginBottom="16px";I||(K.style.visibility="hidden");mxEvent.addListener(F,"change",function(){F.checked&&I?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")});h&&I||K.setAttribute("disabled","disabled");a=new CustomDialog(this,g,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=p.value;e(p.value,u.checked,!v.checked,G.checked,F.checked,z.checked,q.value,A.checked,!K.checked)}),null,c,d);this.showDialog(a.container,
|
|
|
|
|
320,n,!0,!0);p.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var g=document.createElement("div");g.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var f=document.createElement("h3");mxUtils.write(f,b);f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";g.appendChild(f)}var n=this.addCheckbox(g,mxResources.get("fit"),
|
|
|
|
|
!0),h=this.addCheckbox(g,mxResources.get("shadow"),k.shadowVisible&&d,!d),l=this.addCheckbox(g,c),m=this.addCheckbox(g,mxResources.get("lightbox"),!0),p=this.addEditButton(g,m),u=p.getEditInput(),H=1<k.model.getChildCount(k.model.getRoot()),E=this.addCheckbox(g,mxResources.get("layers"),H,!H);E.style.marginLeft=u.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(H&&E.removeAttribute("disabled"),u.removeAttribute("disabled")):
|
|
|
|
|
(E.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));u.checked&&m.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,g,mxUtils.bind(this,function(){a(n.checked,h.checked,l.checked,m.checked,p.getLink(),E.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,f,h,l){function g(b){var g=" ",n="";d&&(g=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
|
|
|
|
@ -6829,16 +6829,16 @@ mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,f,h,l,m){m=
|
|
|
|
|
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,h)}catch(w){this.spinner.stop(),this.handleError(w)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},g=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f<c.length;f++){var k=
|
|
|
|
|
c[f].indexOf(")");g.push('url("');g.push(e[b(c[f].substring(0,k))]);g.push('"'+c[f].substring(k))}this.editor.resolvedFontCss=g.join("");a()}});if(0<c.length)for(var f=1;f<c.length;f++){var h=c[f].indexOf(")"),l=null,t=c[f].indexOf("format(",h);0<t&&(l=b(c[f].substring(t+7,c[f].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b=
|
|
|
|
|
"application/x-font-opentype";else if("woff"==l||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==l||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==l||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==l||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;g()}),mxUtils.bind(this,
|
|
|
|
|
function(a){d--;g()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[f].substring(0,h)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,h,l,m,t,w,x,z,C){f=null!=f?f:!0;x=null!=x?x:this.editor.graph;z=null!=z?z:0;var g=m?null:x.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==m&&(g=this.editor.graph.defaultPageBackgroundColor);this.convertImages(x.getSvg(g,null,null,C,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
|
|
|
|
|
function(){try{var k=document.createElement("canvas"),h=parseInt(c.getAttribute("width")),n=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*n),b/h)):b/h);h=Math.ceil(l*h)+2*z;n=Math.ceil(l*n)+2*z;k.setAttribute("width",h);k.setAttribute("height",n);var t=k.getContext("2d");null!=g&&(t.beginPath(),t.rect(0,0,h,n),t.fillStyle=g,t.fill());t.scale(l,l);t.drawImage(d,z/l,z/l);a(k)}catch(P){null!=e&&e(P)}});d.onerror=function(a){null!=e&&e(a)};try{t&&this.editor.graph.addSvgShadow(c);
|
|
|
|
|
var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(x,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(A){null!=e&&e(A)}}),c,w)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,
|
|
|
|
|
function(a){d--;g()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[f].substring(0,h)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,h,l,m,t,w,x,y,C){f=null!=f?f:!0;x=null!=x?x:this.editor.graph;y=null!=y?y:0;var g=m?null:x.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==m&&(g=this.editor.graph.defaultPageBackgroundColor);this.convertImages(x.getSvg(g,null,null,C,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
|
|
|
|
|
function(){try{var k=document.createElement("canvas"),h=parseInt(c.getAttribute("width")),n=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*n),b/h)):b/h);h=Math.ceil(l*h)+2*y;n=Math.ceil(l*n)+2*y;k.setAttribute("width",h);k.setAttribute("height",n);var t=k.getContext("2d");null!=g&&(t.beginPath(),t.rect(0,0,h,n),t.fillStyle=g,t.fill());t.scale(l,l);t.drawImage(d,y/l,y/l);a(k)}catch(P){null!=e&&e(P)}});d.onerror=function(a){null!=e&&e(a)};try{t&&this.editor.graph.addSvgShadow(c);
|
|
|
|
|
var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(x,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(z){null!=e&&e(z)}}),c,w)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,
|
|
|
|
|
c=this;a.convert=function(d){if(null!=d){var e="http://"==d.substring(0,7)||"https://"==d.substring(0,8);e&&!navigator.onLine?d=c.svgBrokenImage.src:e&&d.substring(0,a.baseUrl.length)!=a.baseUrl?d=PROXY_URL+"?url="+encodeURIComponent(d):"chrome-extension://"!=d.substring(0,19)&&(d=b.apply(this,arguments))}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var e=0,g=c||{};c=mxUtils.bind(this,function(c,f){for(var k=a.getElementsByTagName(c),
|
|
|
|
|
h=0;h<k.length;h++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(f));if(null!=k&&"data:"!=k.substring(0,5)){var h=g[k];null==h?(e++,this.convertImageToDataUri(k,function(d){null!=d&&(g[k]=d,c.setAttribute(f,d));e--;0==e&&b(a)})):c.setAttribute(f,h)}else null!=k&&c.setAttribute(f,k)})(k[h])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,f){try{var g=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);e=
|
|
|
|
|
null!=e?e:!0;var k=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}f=null!=f?f:"data:image/png;base64,";d=f+this.base64Encode(d)}b(d)}}else null!=
|
|
|
|
|
c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:k})})});k()}catch(y){null!=c&&c(y)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,
|
|
|
|
|
c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:k})})});k()}catch(B){null!=c&&c(B)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,
|
|
|
|
|
23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,d=this;c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(v){b(d.svgBrokenImage.src)}};
|
|
|
|
|
c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var g=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var k=mxUtils.parseXml(a),h=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var n=h.getElementsByTagName("diagram");if(1==n.length)h=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(n[0]))).documentElement;else if(1<n.length){f.model.beginUpdate();
|
|
|
|
|
try{for(a=0;a<n.length;a++){var l=this.updatePageRoot(new DiagramPage(n[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=h&&"mxGraphModel"===h.nodeName&&(g=f.importGraphModel(h,b,c,d))}}catch(z){throw e||this.handleError(z,mxResources.get("invalidOrMissingFile")),z;}return g};EditorUi.prototype.importVisio=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
|
|
|
|
|
try{for(a=0;a<n.length;a++){var l=this.updatePageRoot(new DiagramPage(n[a])),m=this.pages.length;null==l.getName()&&l.setName(mxResources.get("pageWithNumber",[m+1]));f.model.execute(new ChangePage(this,l,l,m))}}finally{f.model.endUpdate()}}}null!=h&&"mxGraphModel"===h.nodeName&&(g=f.importGraphModel(h,b,c,d))}}catch(y){throw e||this.handleError(y,mxResources.get("invalidOrMissingFile")),y;}return g};EditorUi.prototype.importVisio=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
|
|
|
|
|
var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)try{this.doImportVisio(a,b,c)}catch(u){c(u)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(k){this.handleError(k)}});"undefined"!==typeof VsdxExport||
|
|
|
|
|
this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var g=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(v){this.handleError(v)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(g,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",
|
|
|
|
|
g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=[];if(null!=e.state){e=JSON.parse(e.state);for(var g in e.Pages)a.push(e.Pages[g]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var f=this.currentPage;for(b=1;b<a.length;b++)this.insertPage(),
|
|
|
|
@ -6855,13 +6855,13 @@ a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(
|
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}f=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&
|
|
|
|
|
15)<<2|(f&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,f,h,l,m,t,w,x){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var g=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=w||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){n=!0;break}var u=mxUtils.bind(this,function(){var n=this.editor.graph,
|
|
|
|
|
m=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,f,k,h,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,f,k,h,n,g,x)});f=null!=f?f:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,q=p,u=[],v=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--q){this.spinner.stop();if(null!=l)l(u);else{var c=[];n.getModel().beginUpdate();
|
|
|
|
|
try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}f(c)}}),z=0;z<p;z++)mxUtils.bind(this,function(g){var f=a[g],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==h||h(f))if("image/"==f.type.substring(0,6))if("image/svg"==f.type.substring(0,9)){var l=a.target.result,p=l.indexOf(","),q=decodeURIComponent(escape(atob(l.substring(p+1)))),u=mxUtils.parseXml(q),q=u.getElementsByTagName("svg");if(0<q.length){var q=q[0],A=x?null:q.getAttribute("content");
|
|
|
|
|
null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(A,!0)));null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A));null==A||"<mxfile "!==A.substring(0,8)&&"<mxGraphModel "!==A.substring(0,14)?v(g,mxUtils.bind(this,function(){try{if(l.substring(0,p+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var h=a[0],t=parseFloat(h.getAttribute("width")),w=parseFloat(h.getAttribute("height")),q=h.getAttribute("viewBox");if(null==q||0==q.length)h.setAttribute("viewBox",
|
|
|
|
|
"0 0 "+t+" "+w);else if(isNaN(t)||isNaN(w)){var A=q.split(" ");3<A.length&&(t=parseFloat(A[2]),w=parseFloat(A[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var x=Math.min(1,Math.min(d/Math.max(1,t)),d/Math.max(1,w)),v=e(l,f.type,b+g*m,c+g*m,Math.max(1,Math.round(t*x)),Math.max(1,Math.round(w*x)),f.name,k);if(isNaN(t)||isNaN(w)){var z=new Image;z.onload=mxUtils.bind(this,function(){t=Math.max(1,z.width);w=Math.max(1,z.height);v[0].geometry.width=t;v[0].geometry.height=w;h.setAttribute("viewBox",
|
|
|
|
|
"0 0 "+t+" "+w);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));n.setCellStyles("image",l,[v[0]])});z.src=this.createSvgDataUri(mxUtils.getXml(h))}return v}}}catch(aa){}return null})):v(g,mxUtils.bind(this,function(){return e(A,"text/xml",b+g*m,c+g*m,0,0,f.name)}))}}else{q=!1;if("image/png"==f.type){var z=x?null:this.extractGraphModelFromPng(a.target.result);if(null!=z&&0<z.length){var I=new Image;I.src=a.target.result;v(g,
|
|
|
|
|
mxUtils.bind(this,function(){return e(z,"text/xml",b+g*m,c+g*m,I.width,I.height,f.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,
|
|
|
|
|
try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}f(c)}}),y=0;y<p;y++)mxUtils.bind(this,function(g){var f=a[g],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==h||h(f))if("image/"==f.type.substring(0,6))if("image/svg"==f.type.substring(0,9)){var l=a.target.result,p=l.indexOf(","),q=decodeURIComponent(escape(atob(l.substring(p+1)))),u=mxUtils.parseXml(q),q=u.getElementsByTagName("svg");if(0<q.length){var q=q[0],z=x?null:q.getAttribute("content");
|
|
|
|
|
null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=unescape(window.atob?atob(z):Base64.decode(z,!0)));null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z));null==z||"<mxfile "!==z.substring(0,8)&&"<mxGraphModel "!==z.substring(0,14)?v(g,mxUtils.bind(this,function(){try{if(l.substring(0,p+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var h=a[0],t=parseFloat(h.getAttribute("width")),w=parseFloat(h.getAttribute("height")),q=h.getAttribute("viewBox");if(null==q||0==q.length)h.setAttribute("viewBox",
|
|
|
|
|
"0 0 "+t+" "+w);else if(isNaN(t)||isNaN(w)){var z=q.split(" ");3<z.length&&(t=parseFloat(z[2]),w=parseFloat(z[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var x=Math.min(1,Math.min(d/Math.max(1,t)),d/Math.max(1,w)),v=e(l,f.type,b+g*m,c+g*m,Math.max(1,Math.round(t*x)),Math.max(1,Math.round(w*x)),f.name,k);if(isNaN(t)||isNaN(w)){var y=new Image;y.onload=mxUtils.bind(this,function(){t=Math.max(1,y.width);w=Math.max(1,y.height);v[0].geometry.width=t;v[0].geometry.height=w;h.setAttribute("viewBox",
|
|
|
|
|
"0 0 "+t+" "+w);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));n.setCellStyles("image",l,[v[0]])});y.src=this.createSvgDataUri(mxUtils.getXml(h))}return v}}}catch(aa){}return null})):v(g,mxUtils.bind(this,function(){return e(z,"text/xml",b+g*m,c+g*m,0,0,f.name)}))}}else{q=!1;if("image/png"==f.type){var y=x?null:this.extractGraphModelFromPng(a.target.result);if(null!=y&&0<y.length){var I=new Image;I.src=a.target.result;v(g,
|
|
|
|
|
mxUtils.bind(this,function(){return e(y,"text/xml",b+g*m,c+g*m,I.width,I.height,f.name)}));q=!0}}q||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,
|
|
|
|
|
l,n){v(g,mxUtils.bind(this,function(){if(null!=h&&h.length<t){var p=k&&this.isResampleImage(a.target.result,w)?Math.min(1,Math.min(d/l,d/n)):1;return e(h,f.type,b+g*m,c+g*m,Math.round(l*p),Math.round(n*p),f.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,w)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,f.type,b+g*m,c+g*m,240,160,f.name,function(a){v(g,function(){return a})})});/(\.vsdx)($|\?)/i.test(f.name)||
|
|
|
|
|
/(\.vssx)($|\?)/i.test(f.name)?e(null,f.type,b+g*m,c+g*m,240,160,f.name,function(a){v(g,function(){return a})},f):"image"==f.type.substring(0,5)?l.readAsDataURL(f):l.readAsText(f)})(z)});n?this.confirmImageResize(function(a){k=a;u()},m):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?
|
|
|
|
|
/(\.vssx)($|\?)/i.test(f.name)?e(null,f.type,b+g*m,c+g*m,240,160,f.name,function(a){v(g,function(){return a})},f):"image"==f.type.substring(0,5)?l.readAsDataURL(f):l.readAsText(f)})(y)});n?this.confirmImageResize(function(a){k=a;u()},m):u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?
|
|
|
|
|
e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,
|
|
|
|
|
c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,f){e=null!=e?e:this.maxImageSize;var g=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,f))try{var h=Math.max(g/e,k/e);if(1<h){var l=Math.round(g/
|
|
|
|
|
h),n=Math.round(k/h),m=document.createElement("canvas");m.width=l;m.height=n;m.getContext("2d").drawImage(a,0,0,l,n);var p=m.toDataURL();if(p.length<b.length){var q=document.createElement("canvas");q.width=l;q.height=n;var u=q.toDataURL();p!==u&&(b=p,g=l,k=n)}}}catch(E){}c(b,g,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,e=0;8>e;e++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var e=0;e<d;e++)a=EditorUi.prototype.crcTable[(a^
|
|
|
|
@ -6872,20 +6872,20 @@ b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=dec
|
|
|
|
|
d=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=c.addClickHandler;c.addClickHandler=function(b,d,f){var g=d;d=function(b,d){if(null==d){var e=mxEvent.getSource(b);"a"==e.nodeName.toLowerCase()&&(d=e.getAttribute("href"))}null==
|
|
|
|
|
d||!c.isPageLink(d)||!mxEvent.isTouchEvent(b)&&mxEvent.isPopupTrigger(b)||(a(d),mxEvent.consume(b));null!=g&&g(b,d)};e.call(this,b,d,f)};f.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=c.getGlobalVariable;c.getGlobalVariable=function(a){return"page"==
|
|
|
|
|
a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var l=c.createLinkForHint;c.createLinkForHint=function(d,e){var f=c.isPageLink(d);if(f){var g=d.indexOf(",");0<g&&(g=b.getPageById(d.substring(g+1)),e=null!=g?g.getName():mxResources.get("pageNotFound"))}g=l.call(this,d,e);f&&mxEvent.addListener(g,"click",function(b){a(d);mxEvent.consume(b)});return g};var m=c.labelLinkClicked;c.labelLinkClicked=
|
|
|
|
|
function(b,d,e){var f=d.getAttribute("href");null==f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?m.apply(this,arguments):(c.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||!navigator.standalone);y.visible=y.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=
|
|
|
|
|
function(b,d,e){var f=d.getAttribute("href");null==f||!c.isPageLink(f)||!mxEvent.isTouchEvent(e)&&mxEvent.isPopupTrigger(e)?m.apply(this,arguments):(c.isEnabled()||a(f),mxEvent.consume(e))};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var B=this.actions.get("print");B.setEnabled(!mxClient.IS_IOS||!navigator.standalone);B.visible=B.isEnabled();if(!this.editor.chromeless||this.editor.editable){var t=
|
|
|
|
|
function(){window.setTimeout(function(){w.innerHTML=" ";w.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||c.container.addEventListener("paste",
|
|
|
|
|
mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});
|
|
|
|
|
else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(S){}}),!1);var w=document.createElement("div");w.style.position="absolute";w.style.whiteSpace="nowrap";w.style.overflow="hidden";w.style.display="block";w.contentEditable=!0;mxUtils.setOpacity(w,0);w.style.width="1px";w.style.height="1px";w.innerHTML=" ";var x=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,
|
|
|
|
|
null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var b=mxEvent.getSource(a);null==c.container||!c.isEnabled()||c.isMouseDown||c.isEditing()||null!=this.dialog||"INPUT"==b.nodeName||"TEXTAREA"==b.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||x||(w.style.left=c.container.scrollLeft+10+"px",w.style.top=c.container.scrollTop+10+"px",c.container.appendChild(w),x=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){w.focus();document.execCommand("selectAll",
|
|
|
|
|
!1,null)},0):(w.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var b=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!x||224!=b&&17!=b&&91!=b||(x=!1,c.isEditing()||null!=this.dialog||null==c.container||c.container.focus(),w.parentNode.removeChild(w))}),0)}));mxEvent.addListener(w,"copy",mxUtils.bind(this,function(a){c.isEnabled()&&(mxClipboard.copy(c),this.copyCells(w),t())}));mxEvent.addListener(w,"cut",mxUtils.bind(this,
|
|
|
|
|
function(a){c.isEnabled()&&(this.copyCells(w,!0),t())}));mxEvent.addListener(w,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(w.innerHTML=" ",w.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,w);w.innerHTML=" "}),0))}),!0);var z=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==w?!0:z.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
|
|
|
|
|
function(a){c.isEnabled()&&(this.copyCells(w,!0),t())}));mxEvent.addListener(w,"paste",mxUtils.bind(this,function(a){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(w.innerHTML=" ",w.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,w);w.innerHTML=" "}),0))}),!0);var y=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==w?!0:y.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||
|
|
|
|
|
0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();
|
|
|
|
|
a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");
|
|
|
|
|
/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,
|
|
|
|
|
"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){y=document.createElement("div");y.style.position="absolute";y.style.top="95px";y.style.left="250px";y.style.width="2000px";y.style.height="30px";y.style.background="whiteSmoke";document.body.appendChild(y);var C=document.createElement("div");C.style.position="absolute";C.style.top="125px";C.style.left="220px";
|
|
|
|
|
C.style.width="30px";C.style.height="1000px";C.style.background="whiteSmoke";document.body.appendChild(C);var H=document.createElement("div");H.style.position="absolute";H.style.top="95px";H.style.left="220px";H.style.width="30px";H.style.height="30px";H.style.background="whiteSmoke";document.body.appendChild(H);this.vRuler=new mxRuler(this.editor.graph,C,!0);this.hRuler=new mxRuler(this.editor.graph,y,!1)}if("1"==urlParams.test){y=document.getElementById("geFooter");null!=y&&(this.styleInput=document.createElement("input"),
|
|
|
|
|
this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),y.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,
|
|
|
|
|
mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}y=document.getElementById("geInfo");null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&
|
|
|
|
|
"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){B=document.createElement("div");B.style.position="absolute";B.style.top="95px";B.style.left="250px";B.style.width="2000px";B.style.height="30px";B.style.background="whiteSmoke";document.body.appendChild(B);var C=document.createElement("div");C.style.position="absolute";C.style.top="125px";C.style.left="220px";
|
|
|
|
|
C.style.width="30px";C.style.height="1000px";C.style.background="whiteSmoke";document.body.appendChild(C);var H=document.createElement("div");H.style.position="absolute";H.style.top="95px";H.style.left="220px";H.style.width="30px";H.style.height="30px";H.style.background="whiteSmoke";document.body.appendChild(H);this.vRuler=new mxRuler(this.editor.graph,C,!0);this.hRuler=new mxRuler(this.editor.graph,B,!1)}if("1"==urlParams.test){B=document.getElementById("geFooter");null!=B&&(this.styleInput=document.createElement("input"),
|
|
|
|
|
this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),B.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,
|
|
|
|
|
mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}B=document.getElementById("geInfo");null!=B&&B.parentNode.removeChild(B);if(Graph.fileSupport&&
|
|
|
|
|
(!this.editor.chromeless||this.editor.editable)){var D=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=D&&(D.parentNode.removeChild(D),D=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==D&&(!mxClient.IS_IE||10<document.documentMode)&&(D=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,
|
|
|
|
|
"drop",mxUtils.bind(this,function(a){null!=D&&(D.parentNode.removeChild(D),D=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,f=b.x/e-d.x,g=b.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?
|
|
|
|
|
a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var h=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=h;var l=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(l=!0)):(b=b.getElementsByTagName("a"),null!=b&&1==b.length&&
|
|
|
|
@ -6896,9 +6896,9 @@ mxUtils.bind(this,function(a,b){mxSettings.setCurrentEdgeStyle(this.editor.graph
|
|
|
|
|
mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);
|
|
|
|
|
mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;
|
|
|
|
|
if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===
|
|
|
|
|
c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(y){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);
|
|
|
|
|
this.isCompatibleString(k)&&(f=!0,e=k)}catch(y){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&
|
|
|
|
|
this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(y){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&
|
|
|
|
|
c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.importLucidChart(d,0,0),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var g=e.lastIndexOf("%3E");0<=g&&g<e.length-3&&(e=e.substring(0,g+3))}catch(B){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);
|
|
|
|
|
this.isCompatibleString(k)&&(f=!0,e=k)}catch(B){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&
|
|
|
|
|
this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(B){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&
|
|
|
|
|
12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);
|
|
|
|
|
else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):
|
|
|
|
|
0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash=
|
|
|
|
@ -6924,8 +6924,8 @@ try{l.init()}catch(I){g.postMessage(JSON.stringify({event:"draft",error:I.toStri
|
|
|
|
|
null,null,null,null,null,l?mxUtils.bind(this,function(a){this.recentReadyCallback=a;g.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==
|
|
|
|
|
k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==k.action)this.recentReadyCallback(k.list,k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,
|
|
|
|
|
n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var p=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,u=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(p);
|
|
|
|
|
g.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),B=q.getGlobalVariable,A=this.pages[0];q.getGlobalVariable=function(a){return"page"==
|
|
|
|
|
a?A.getName():"pagenumber"==a?1:B.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?
|
|
|
|
|
g.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);u(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),A=q.getGlobalVariable,z=this.pages[0];q.getGlobalVariable=function(a){return"page"==
|
|
|
|
|
a?z.getName():"pagenumber"==a?1:A.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?
|
|
|
|
|
u("data:image/png;base64,"+a.getText()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)p=this.editor.getGraphXml(),n.data=this.getHtml(p,this.editor.graph),
|
|
|
|
|
n.xml=mxUtils.getXml(p),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
|
|
|
|
|
this.spinner.stop();n.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(n),
|
|
|
|
@ -6937,15 +6937,15 @@ var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({eve
|
|
|
|
|
mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding=
|
|
|
|
|
"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);
|
|
|
|
|
this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=
|
|
|
|
|
function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",h="auto",l=40,m=40,w=0,x=this.editor.graph;x.getGraphBounds();for(var z=function(){x.setSelectionCells(U);x.scrollCellToVisible(x.getSelectionCell())},C=x.getFreeInsertPoint(),H=C.x,E=C.y,C=E,D=null,G="auto",A=[],F=null,I=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=
|
|
|
|
|
a.charAt(1)){var P=a.indexOf(":");if(0<P){var Q=mxUtils.trim(a.substring(1,P)),O=mxUtils.trim(a.substring(P+1));"label"==Q?D=x.sanitizeHtml(O):"style"==Q?e=O:"identity"==Q&&0<O.length&&"-"!=O?f=O:"width"==Q?g=O:"height"==Q?h=O:"ignore"==Q?I=O.split(","):"connect"==Q?A.push(JSON.parse(O)):"link"==Q?F=O:"padding"==Q?w=parseFloat(O):"edgespacing"==Q?l=parseFloat(O):"nodespacing"==Q?m=parseFloat(O):"layout"==Q&&(G=O)}}}var S=this.editor.csvToArray(b[K]);a=null;if(null!=f)for(var M=0;M<S.length;M++)if(f==
|
|
|
|
|
S[M]){a=M;break}null==D&&(D="%"+S[0]+"%");if(null!=A)for(var J=0;J<A.length;J++)null==d[A[J].to]&&(d[A[J].to]={});x.model.beginUpdate();try{for(M=K+1;M<b.length;M++){var T=this.editor.csvToArray(b[M]);if(T.length==S.length){var L=null,X=null!=a?T[a]:null;null!=X&&(L=x.model.getCell(X));null==L&&(L=new mxCell(D,new mxGeometry(H,C,0,0),e||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=X);for(var N=0;N<T.length;N++)x.setAttributeForCell(L,S[N],T[N]);x.setAttributeForCell(L,"placeholders","1");L.style=x.replacePlaceholders(L,
|
|
|
|
|
L.style);for(J=0;J<A.length;J++)d[A[J].to][L.getAttribute(A[J].to)]=L;null!=F&&"link"!=F&&(x.setLinkForCell(L,L.getAttribute(F)),x.setAttributeForCell(L,F,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var Y=this.editor.graph.getPreferredSizeForCell(L);L.geometry.width="auto"==g?Y.width+w:parseFloat(g);L.geometry.height="auto"==h?Y.height+w:parseFloat(h);C+=L.geometry.height+m;c.push(x.addCell(L))}}for(var V=c.slice(),U=c.slice(),J=0;J<A.length;J++)for(var R=A[J],M=0;M<c.length;M++){var L=
|
|
|
|
|
function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,g="auto",h="auto",l=40,m=40,w=0,x=this.editor.graph;x.getGraphBounds();for(var y=function(){x.setSelectionCells(U);x.scrollCellToVisible(x.getSelectionCell())},C=x.getFreeInsertPoint(),H=C.x,E=C.y,C=E,D=null,G="auto",z=[],F=null,I=null,K=0;K<b.length&&"#"==b[K].charAt(0);){a=b[K];for(K++;K<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[K].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[K].substring(1)),K++;if("#"!=
|
|
|
|
|
a.charAt(1)){var P=a.indexOf(":");if(0<P){var Q=mxUtils.trim(a.substring(1,P)),O=mxUtils.trim(a.substring(P+1));"label"==Q?D=x.sanitizeHtml(O):"style"==Q?e=O:"identity"==Q&&0<O.length&&"-"!=O?f=O:"width"==Q?g=O:"height"==Q?h=O:"ignore"==Q?I=O.split(","):"connect"==Q?z.push(JSON.parse(O)):"link"==Q?F=O:"padding"==Q?w=parseFloat(O):"edgespacing"==Q?l=parseFloat(O):"nodespacing"==Q?m=parseFloat(O):"layout"==Q&&(G=O)}}}var S=this.editor.csvToArray(b[K]);a=null;if(null!=f)for(var M=0;M<S.length;M++)if(f==
|
|
|
|
|
S[M]){a=M;break}null==D&&(D="%"+S[0]+"%");if(null!=z)for(var J=0;J<z.length;J++)null==d[z[J].to]&&(d[z[J].to]={});x.model.beginUpdate();try{for(M=K+1;M<b.length;M++){var T=this.editor.csvToArray(b[M]);if(T.length==S.length){var L=null,X=null!=a?T[a]:null;null!=X&&(L=x.model.getCell(X));null==L&&(L=new mxCell(D,new mxGeometry(H,C,0,0),e||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=X);for(var N=0;N<T.length;N++)x.setAttributeForCell(L,S[N],T[N]);x.setAttributeForCell(L,"placeholders","1");L.style=x.replacePlaceholders(L,
|
|
|
|
|
L.style);for(J=0;J<z.length;J++)d[z[J].to][L.getAttribute(z[J].to)]=L;null!=F&&"link"!=F&&(x.setLinkForCell(L,L.getAttribute(F)),x.setAttributeForCell(L,F,null));x.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var Y=this.editor.graph.getPreferredSizeForCell(L);L.geometry.width="auto"==g?Y.width+w:parseFloat(g);L.geometry.height="auto"==h?Y.height+w:parseFloat(h);C+=L.geometry.height+m;c.push(x.addCell(L))}}for(var V=c.slice(),U=c.slice(),J=0;J<z.length;J++)for(var R=z[J],M=0;M<c.length;M++){var L=
|
|
|
|
|
c[M],Z=L.getAttribute(R.from);if(null!=Z){x.setAttributeForCell(L,R.from,null);for(var W=Z.split(","),N=0;N<W.length;N++){var ba=d[R.to][W[N]];null!=ba&&(D=R.label,null!=R.fromlabel&&(D=(L.getAttribute(R.fromlabel)||"")+(D||"")),null!=R.tolabel&&(D=(D||"")+(ba.getAttribute(R.tolabel)||"")),U.push(x.insertEdge(null,null,D||"",R.invert?ba:L,R.invert?L:ba,R.style||x.createCurrentEdgeStyle())),mxUtils.remove(R.invert?L:ba,V))}}}if(null!=I)for(M=0;M<c.length;M++)for(L=c[M],N=0;N<I.length;N++)x.setAttributeForCell(L,
|
|
|
|
|
mxUtils.trim(I[N]),null);var ca=new mxParallelEdgeLayout(x);ca.spacing=l;var ga=function(){ca.execute(x.getDefaultParent());for(var a=0;a<c.length;a++){var b=x.getCellGeometry(c[a]);b.x=Math.round(x.snap(b.x));b.y=Math.round(x.snap(b.y));"auto"==g&&(b.width=Math.round(x.snap(b.width)));"auto"==h&&(b.height=Math.round(x.snap(b.height)))}};if("circle"==G){var da=new mxCircleLayout(x);da.resetEdges=!1;var ha=da.isVertexIgnored;da.isVertexIgnored=function(a){return ha.apply(this,arguments)||0>mxUtils.indexOf(c,
|
|
|
|
|
a)};this.executeLayout(function(){da.execute(x.getDefaultParent());ga()},!0,z);z=null}else if("horizontaltree"==G||"verticaltree"==G||"auto"==G&&U.length==2*c.length-1&&1==V.length){x.view.validate();var ea=new mxCompactTreeLayout(x,"horizontaltree"==G);ea.levelDistance=m;ea.edgeRouting=!1;ea.resetEdges=!1;this.executeLayout(function(){ea.execute(x.getDefaultParent(),0<V.length?V[0]:null)},!0,z);z=null}else if("horizontalflow"==G||"verticalflow"==G||"auto"==G&&1==V.length){x.view.validate();var fa=
|
|
|
|
|
new mxHierarchicalLayout(x,"horizontalflow"==G?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=m;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),U);x.moveCells(U,H,E)},!0,z);z=null}else if("organic"==G||"auto"==G&&U.length>c.length){x.view.validate();var aa=new mxFastOrganicLayout(x);aa.forceConstant=3*m;aa.resetEdges=!1;var ia=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};
|
|
|
|
|
ca=new mxParallelEdgeLayout(x);ca.spacing=l;this.executeLayout(function(){aa.execute(x.getDefaultParent());ga()},!0,z);z=null}this.hideDialog()}finally{x.model.endUpdate()}null!=z&&z()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};
|
|
|
|
|
a)};this.executeLayout(function(){da.execute(x.getDefaultParent());ga()},!0,y);y=null}else if("horizontaltree"==G||"verticaltree"==G||"auto"==G&&U.length==2*c.length-1&&1==V.length){x.view.validate();var ea=new mxCompactTreeLayout(x,"horizontaltree"==G);ea.levelDistance=m;ea.edgeRouting=!1;ea.resetEdges=!1;this.executeLayout(function(){ea.execute(x.getDefaultParent(),0<V.length?V[0]:null)},!0,y);y=null}else if("horizontalflow"==G||"verticalflow"==G||"auto"==G&&1==V.length){x.view.validate();var fa=
|
|
|
|
|
new mxHierarchicalLayout(x,"horizontalflow"==G?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);fa.intraCellSpacing=m;fa.disableEdgeStyle=!1;this.executeLayout(function(){fa.execute(x.getDefaultParent(),U);x.moveCells(U,H,E)},!0,y);y=null}else if("organic"==G||"auto"==G&&U.length>c.length){x.view.validate();var aa=new mxFastOrganicLayout(x);aa.forceConstant=3*m;aa.resetEdges=!1;var ia=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};
|
|
|
|
|
ca=new mxParallelEdgeLayout(x);ca.spacing=l;this.executeLayout(function(){aa.execute(x.getDefaultParent());ga()},!0,y);y=null}this.hideDialog()}finally{x.model.endUpdate()}null!=y&&y()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};
|
|
|
|
|
EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,
|
|
|
|
|
440,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/
|
|
|
|
|
b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=
|
|
|
|
@ -7240,7 +7240,7 @@ GitHubClient.prototype.getFile=function(a,b,d,c,e){c=null!=c?c:!1;var f=a.split(
|
|
|
|
|
"/repos/"+h+"/"+l+"/contents/"+a+"?ref="+m,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.createGitHubFile(h,l,m,JSON.parse(a.getText()),c))}catch(k){d(k)}}),d))};
|
|
|
|
|
GitHubClient.prototype.createGitHubFile=function(a,b,d,c,e){a={org:a,repo:b,ref:d,name:c.name,path:c.path,sha:c.sha,html_url:c.html_url,download_url:c.download_url};b=c.content;"base64"===c.encoding&&(/\.jpe?g$/i.test(c.name)?b="data:image/jpeg;base64,"+b:/\.gif$/i.test(c.name)?b="data:image/gif;base64,"+b:/\.png$/i.test(c.name)?(c=this.ui.extractGraphModelFromPng(b),b=null!=c&&0<c.length?c:"data:image/png;base64,"+b):b=Base64.decode(b));return e?new GitHubLibrary(this.ui,b,a):new GitHubFile(this.ui,
|
|
|
|
|
b,a)};GitHubClient.prototype.insertLibrary=function(a,b,d,c,e){this.insertFile(a,b,d,c,!0,e,!1)};
|
|
|
|
|
GitHubClient.prototype.insertFile=function(a,b,d,c,e,f,h){e=null!=e?e:!1;f=f.split("/");var l=f[0],m=f[1],g=f[2],k=f.slice(3,f.length).join("/");0<k.length&&(k+="/");k+=a;this.checkExists(l+"/"+m+"/"+g+"/"+k,!0,mxUtils.bind(this,function(f,p){f?e?(h||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(l,m,g,k,a,b,p,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());d(this.createGitHubFile(l,m,g,b.content,e))}catch(B){c(B)}}),c)}),c)):d(new GitHubFile(this.ui,
|
|
|
|
|
GitHubClient.prototype.insertFile=function(a,b,d,c,e,f,h){e=null!=e?e:!1;f=f.split("/");var l=f[0],m=f[1],g=f[2],k=f.slice(3,f.length).join("/");0<k.length&&(k+="/");k+=a;this.checkExists(l+"/"+m+"/"+g+"/"+k,!0,mxUtils.bind(this,function(f,p){f?e?(h||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(l,m,g,k,a,b,p,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());d(this.createGitHubFile(l,m,g,b.content,e))}catch(A){c(A)}}),c)}),c)):d(new GitHubFile(this.ui,
|
|
|
|
|
b,{org:l,repo:m,ref:g,name:a,path:k,sha:p,isNew:!0})):c()}))};GitHubClient.prototype.showCommitDialog=function(a,b,d,c){var e=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(b?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){e();d(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){c()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
|
|
|
|
|
GitHubClient.prototype.writeFile=function(a,b,d,c,e,f,h,l,m){f.length>=this.maxFileSize?m({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 1 MB)"}):(d={path:c,branch:decodeURIComponent(d),message:e,content:f},null!=h&&(d.sha=h),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+b+"/contents/"+c,JSON.stringify(d),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){l(a)}),m))};
|
|
|
|
|
GitHubClient.prototype.checkExists=function(a,b,d){this.getFile(a,mxUtils.bind(this,function(c){if(b&&null!=c.meta){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();d(!0,c.meta.sha)},function(){e();d(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){d(!1)})}),mxUtils.bind(this,function(a){d(!0)}),null,!0)};
|
|
|
|
@ -7249,16 +7249,16 @@ mxResources.get("cancel"),mxUtils.bind(this,function(){d()}),null,mxResources.ge
|
|
|
|
|
Base64.encode(a.getData()))}),mxUtils.bind(this,function(){d()}))};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
|
|
|
|
|
GitHubClient.prototype.showGitHubDialog=function(a,b){var d=null,c=null,e=null,f=null,h=document.createElement("div");h.style.whiteSpace="nowrap";h.style.overflow="hidden";h.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,mxResources.get(a?"selectFile":"selectFolder"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";h.appendChild(l);var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.height="194px";
|
|
|
|
|
h.appendChild(m);var g=new CustomDialog(this.ui,h,mxUtils.bind(this,function(){b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+f)}));this.ui.showDialog(g.container,340,270,!0,!0);a&&g.okButton.parentNode.removeChild(g.okButton);var k=mxUtils.bind(this,function(a,b){var c=document.createElement("a");c.setAttribute("href","javascript:void(0);");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);return c}),n=mxUtils.bind(this,function(a){var b=document.createElement("div");b.style.marginBottom="8px";b.appendChild(k(d+
|
|
|
|
|
"/"+c,mxUtils.bind(this,function(){f=null;y()})));a||(mxUtils.write(b," / "),b.appendChild(k(decodeURIComponent(e),mxUtils.bind(this,function(){f=null;B()}))));if(null!=f&&0<f.length){var g=f.split("/");for(a=0;a<g.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(k(g[a],mxUtils.bind(this,function(){f=g.slice(0,a+1).join("/");u()})))})(a)}m.appendChild(b)}),p=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
|
|
|
|
|
(f=e=c=d=null,y()):this.ui.hideDialog()}))}),u=mxUtils.bind(this,function(){var h=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/contents/"+f+"?ref="+encodeURIComponent(e),null,"GET");g.okButton.removeAttribute("disabled");m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));this.executeRequest(h,mxUtils.bind(this,function(g){n();this.ui.spinner.stop();var h=JSON.parse(g.getText());m.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,y();else{var a=f.split("/");
|
|
|
|
|
f=a.slice(0,a.length-1).join("/");u()}})));mxUtils.br(m);null==h||0==h.length?mxUtils.write(m,mxResources.get("noFiles")):(g=mxUtils.bind(this,function(g){for(var l=0;l<h.length;l++)mxUtils.bind(this,function(h){g==("dir"==h.type)&&(m.appendChild(k(h.name+("dir"==h.type?"/":""),mxUtils.bind(this,function(){"dir"==h.type?(f=h.path,u()):a&&"file"==h.type&&(this.ui.hideDialog(),b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+h.path))}))),mxUtils.br(m))})(h[l])}),g(!0),a&&g(!1))}),p)}),q=null,v=null,B=mxUtils.bind(this,
|
|
|
|
|
"/"+c,mxUtils.bind(this,function(){f=null;B()})));a||(mxUtils.write(b," / "),b.appendChild(k(decodeURIComponent(e),mxUtils.bind(this,function(){f=null;A()}))));if(null!=f&&0<f.length){var g=f.split("/");for(a=0;a<g.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(k(g[a],mxUtils.bind(this,function(){f=g.slice(0,a+1).join("/");u()})))})(a)}m.appendChild(b)}),p=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
|
|
|
|
|
(f=e=c=d=null,B()):this.ui.hideDialog()}))}),u=mxUtils.bind(this,function(){var h=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/contents/"+f+"?ref="+encodeURIComponent(e),null,"GET");g.okButton.removeAttribute("disabled");m.innerHTML="";this.ui.spinner.spin(m,mxResources.get("loading"));this.executeRequest(h,mxUtils.bind(this,function(g){n();this.ui.spinner.stop();var h=JSON.parse(g.getText());m.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");
|
|
|
|
|
f=a.slice(0,a.length-1).join("/");u()}})));mxUtils.br(m);null==h||0==h.length?mxUtils.write(m,mxResources.get("noFiles")):(g=mxUtils.bind(this,function(g){for(var l=0;l<h.length;l++)mxUtils.bind(this,function(h){g==("dir"==h.type)&&(m.appendChild(k(h.name+("dir"==h.type?"/":""),mxUtils.bind(this,function(){"dir"==h.type?(f=h.path,u()):a&&"file"==h.type&&(this.ui.hideDialog(),b(d+"/"+c+"/"+encodeURIComponent(e)+"/"+h.path))}))),mxUtils.br(m))})(h[l])}),g(!0),a&&g(!1))}),p)}),q=null,v=null,A=mxUtils.bind(this,
|
|
|
|
|
function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/repos/"+d+"/"+c+"/branches?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(m,
|
|
|
|
|
"scroll",v);B(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(n(!0),m.appendChild(k("../ [Up]",mxUtils.bind(this,function(){f=null;y()}))),mxUtils.br(m));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){m.appendChild(k(a.name,mxUtils.bind(this,function(){e=a.name;f="";u()})));mxUtils.br(m)})(b[c]);100==b.length&&(m.appendChild(q),
|
|
|
|
|
v=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&h()},mxEvent.addListener(m,"scroll",v))}}),p)}),y=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");
|
|
|
|
|
mxUtils.write(q,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",v);y(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==a&&(m.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,
|
|
|
|
|
function(a){if(null!=a){var b=a.split("/");if(1<b.length){a=b[0];var g=b[1];3>b.length?(d=a,c=g,f=e=null,B()):this.ui.spinner.spin(m,mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+g+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();d=a.meta.org;c=a.meta.repo;e=decodeURIComponent(a.meta.ref);f="";u()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
|
|
|
|
|
"scroll",v);A(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(n(!0),m.appendChild(k("../ [Up]",mxUtils.bind(this,function(){f=null;B()}))),mxUtils.br(m));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){m.appendChild(k(a.name,mxUtils.bind(this,function(){e=a.name;f="";u()})));mxUtils.br(m)})(b[c]);100==b.length&&(m.appendChild(q),
|
|
|
|
|
v=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&h()},mxEvent.addListener(m,"scroll",v))}}),p)}),B=mxUtils.bind(this,function(a){null==a&&(m.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(m,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");
|
|
|
|
|
mxUtils.write(q,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",v);B(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==a&&(m.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,
|
|
|
|
|
function(a){if(null!=a){var b=a.split("/");if(1<b.length){a=b[0];var g=b[1];3>b.length?(d=a,c=g,f=e=null,A()):this.ui.spinner.spin(m,mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+g+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();d=a.meta.org;c=a.meta.repo;e=decodeURIComponent(a.meta.ref);f="";u()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
|
|
|
|
|
this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m),mxUtils.br(m));for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){m.appendChild(k(a.full_name,mxUtils.bind(this,function(){d=a.owner.login;c=a.name;e=a.default_branch;f="";u()})));mxUtils.br(m)})(b[g])}100==b.length&&(m.appendChild(q),v=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&h()},mxEvent.addListener(m,"scroll",
|
|
|
|
|
v))}),p)});y()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,b,d){DrawioFile.call(this,a,b);this.meta=d;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};
|
|
|
|
|
v))}),p)});B()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,b,d){DrawioFile.call(this,a,b);this.meta=d;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};
|
|
|
|
|
TrelloFile.prototype.save=function(a,b,d){this.doSave(this.getTitle(),b,d)};TrelloFile.prototype.saveAs=function(a,b,d){this.doSave(a,b,d)};TrelloFile.prototype.doSave=function(a,b,d){var c=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=c;this.saveFile(a,!1,b,d)};
|
|
|
|
|
TrelloFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&(this.saveNeededCounter++,c({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),h=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});h();this.ui.trello.saveFile(this,mxUtils.bind(this,function(f){this.savingFile=!1;this.isModified=e;this.meta=f;this.contentChanged();null!=d&&d();0<this.saveNeededCounter&&
|
|
|
|
|
(this.saveNeededCounter--,this.saveFile(a,b,d,c))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){h();b()}}c(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(e);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,
|
|
|
|
@ -7343,7 +7343,7 @@ App.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable
|
|
|
|
|
App.prototype.getThumbnail=function(a,b){var d=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var c=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),e=c.getGlobalVariable,f=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(f.root)}if(mxClient.IS_CHROMEAPP||!c.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
|
|
|
|
|
function(a){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(a)}),a,this.thumbImageCache,"#ffffff",function(){b()},null,null,null,null,null,null,c),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var h=document.createElement("canvas"),l=c.getGraphBounds(),m=a/l.width,m=Math.min(1,Math.min(3*a/(4*l.height),m)),g=Math.floor(l.x),k=Math.floor(l.y);h.setAttribute("width",Math.ceil(m*(l.width+4)));h.setAttribute("height",Math.ceil(m*(l.height+4)));var n=h.getContext("2d");
|
|
|
|
|
n.scale(m,m);n.translate(-g,-k);var p=c.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";n.save();n.fillStyle=p;n.fillRect(g,k,Math.ceil(l.width+4),Math.ceil(l.height+4));n.restore();var u=new mxJsCanvas(h),q=new mxAsyncCanvas(this.thumbImageCache);u.images=this.thumbImageCache.images;var v=new mxImageExport;v.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};v.drawText=function(a,
|
|
|
|
|
b){};v.drawState(c.getView().getState(c.model.root),q);q.finish(mxUtils.bind(this,function(){v.drawState(c.getView().getState(c.model.root),u);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(h)}));d=!0}}catch(B){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}return d};
|
|
|
|
|
b){};v.drawState(c.getView().getState(c.model.root),q);q.finish(mxUtils.bind(this,function(){v.drawState(c.getView().getState(c.model.root),u);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);b(h)}));d=!0}}catch(A){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}return d};
|
|
|
|
|
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
|
|
|
|
|
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(b,d){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(d)if(isLocalStorage)localStorage.setItem(".mode",b);else if("undefined"!=typeof Storage){var c=new Date;c.setYear(c.getFullYear()+1);document.cookie="MODE="+b+"; expires="+c.toUTCString()}null!=this.appIcon&&(c=this.getCurrentFile(),b=null!=c?c.getMode():null,b==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
|
|
|
|
|
[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):b==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):b==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default"))}})();
|
|
|
|
@ -7408,10 +7408,10 @@ mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=nu
|
|
|
|
|
window.location.hash=a.getHash()}))})))}),e=this.getCurrentFile(),f=mxUtils.bind(this,function(){null!=e&&e.isModified()?this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=e&&(window.location.hash=e.getHash())}),c,mxResources.get("cancel"),mxResources.get("discardChanges")):c()});null==a||0==a.length?f():null!=e&&e.isModified()&&!b?window.openWindow(this.getUrl()+"#"+a,null,f):f()};
|
|
|
|
|
App.prototype.getLibraryStorageHint=function(a){var b=a.getTitle();a.constructor!=LocalLibrary&&(b+="\n"+a.getHash());a.constructor==DriveLibrary?b+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?b+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?b+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?b+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?b+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?b+=" ("+
|
|
|
|
|
mxResources.get("browser")+")":a.constructor==LocalLibrary&&(b+=" ("+mxResources.get("device")+")");return b};
|
|
|
|
|
App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a){mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=mxUtils.bind(this,function(b,c){var d=0,f=[],h=mxUtils.bind(this,function(){if(0==d){for(var a=b.length-1;0<=a;a--)null!=f[a]&&this.loadLibrary(f[a]);null!=c&&c()}});if(null!=b)for(var l=0;l<b.length;l++){var m=encodeURIComponent(decodeURIComponent(b[l]));mxUtils.bind(this,
|
|
|
|
|
App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a){mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=mxUtils.bind(this,function(b,c){var d=0,f=[],h=mxUtils.bind(this,function(){if(0==d){if(null!=b)for(var a=b.length-1;0<=a;a--)null!=f[a]&&this.loadLibrary(f[a]);null!=c&&c()}});if(null!=b)for(var l=0;l<b.length;l++){var m=encodeURIComponent(decodeURIComponent(b[l]));mxUtils.bind(this,
|
|
|
|
|
function(b,c){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){d++;var e=mxUtils.bind(this,function(a){delete this.pendingLibraries[b];f[c]=a;d--;h()}),g=mxUtils.bind(this,function(){a(b);d--;h()});this.pendingLibraries[b]=!0;var k=b.substring(0,1);if("L"==k)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var a=decodeURIComponent(b.substring(1));this.getLocalData(a,mxUtils.bind(this,function(b){".scratchpad"==a&&null==
|
|
|
|
|
b&&(b=this.emptyLibraryXml);null!=b?e(new StorageLibrary(this,b,a)):g()}))}catch(y){g()}}),0);else if("U"==k){var l=decodeURIComponent(b.substring(1));if(!this.isOffline()){k=l;this.isCorsEnabledForUrl(k)||(k="t="+(new Date).getTime(),k=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+k);try{mxUtils.get(k,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{e(new UrlLibrary(this,a.getText(),l))}catch(y){g()}else g()}),function(){g()})}catch(B){g()}}}else{var m=null;"G"==k?null!=
|
|
|
|
|
this.drive&&null!=this.drive.user&&(m=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(m=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(m=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(m=this.dropbox):"W"==k&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(m=this.oneDrive);null!=m?m.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(y){g()}}),function(a){g()}):(delete this.pendingLibraries[b],
|
|
|
|
|
b&&(b=this.emptyLibraryXml);null!=b?e(new StorageLibrary(this,b,a)):g()}))}catch(B){g()}}),0);else if("U"==k){var l=decodeURIComponent(b.substring(1));if(!this.isOffline()){k=l;this.isCorsEnabledForUrl(k)||(k="t="+(new Date).getTime(),k=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+k);try{mxUtils.get(k,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{e(new UrlLibrary(this,a.getText(),l))}catch(B){g()}else g()}),function(){g()})}catch(A){g()}}}else{var m=null;"G"==k?null!=
|
|
|
|
|
this.drive&&null!=this.drive.user&&(m=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(m=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(m=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(m=this.dropbox):"W"==k&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(m=this.oneDrive);null!=m?m.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(B){g()}}),function(a){g()}):(delete this.pendingLibraries[b],
|
|
|
|
|
g())}}})(m,l)}h()});b(mxSettings.getCustomLibraries(),function(){b((urlParams.clibs||"").split(";"))})}};
|
|
|
|
|
App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile?null==this.shareButton&&(this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.padding="0 10px 0 10px",this.shareButton.style.marginTop="-4px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight="28px",this.shareButton.style.minWidth=
|
|
|
|
|
"0px",this.shareButton.style.cssFloat="right",a=document.createElement("img"),a.setAttribute("src",this.shareImage),a.setAttribute("align","absmiddle"),a.style.marginRight="4px",a.style.marginTop="-3px",this.shareButton.appendChild(a),mxUtils.write(this.shareButton,mxResources.get("share")),mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()})),this.buttonContainer.appendChild(this.shareButton)):null!=this.shareButton&&(this.shareButton.parentNode.removeChild(this.shareButton),
|
|
|
|
@ -7531,10 +7531,10 @@ App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(documen
|
|
|
|
|
function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,
|
|
|
|
|
function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://www.draw.io/app")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://download.draw.io")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=
|
|
|
|
|
this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var v="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle - fromText".split(" "),
|
|
|
|
|
B=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},y=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted",
|
|
|
|
|
"cells",[a]))}finally{d.getModel().endUpdate()}d.container.focus();d.setSelectionCell(a);d.scrollCellToVisible(a);return a};a.actions.addAction("insertText",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(y("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&
|
|
|
|
|
y("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=f;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=f;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=f;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,
|
|
|
|
|
"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<v.length;c++)"-"==v[c]?a.addSeparator(b):B(a,b,mxResources.get(v[c])+"...",v[c])})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);
|
|
|
|
|
A=function(b,c,d,e){b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e){var b=new ParseDialog(a,d);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},B=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted",
|
|
|
|
|
"cells",[a]))}finally{d.getModel().endUpdate()}d.container.focus();d.setSelectionCell(a);d.scrollCellToVisible(a);return a};a.actions.addAction("insertText",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(B("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&
|
|
|
|
|
B("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=f;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&B("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=f;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&B("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=f;this.put("insert",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,
|
|
|
|
|
"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),b);a.addSeparator(b);for(var c=0;c<v.length;c++)"-"==v[c]?a.addSeparator(b):A(a,b,mxResources.get(v[c])+"...",v[c])})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);
|
|
|
|
|
b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+
|
|
|
|
|
"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):l&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):m&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):g&&b.addItem(mxResources.get("trello")+
|
|
|
|
|
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&
|
|
|
|
@ -7607,24 +7607,24 @@ a))}for(h=0;h<f.length;h++)this.model.setVisible(f[h],!a);d=e;d=b.apply(this,arg
|
|
|
|
|
return b}function d(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function l(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<
|
|
|
|
|
a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function m(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=q.cloneCells([d[0],a]);q.model.setTerminal(e[0],q.model.getTerminal(d[0],!0),!0);var f=l(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+
|
|
|
|
|
10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=a.geometry.x+a.geometry.width-e[1].geometry.width);q.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=q.view.getState(a),k=q.view.scale;if(null!=h){var m=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var n=q.getOutgoingEdges(q.model.getTerminal(d[0],
|
|
|
|
|
!0));if(null!=n){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<n.length;t++){var u=q.model.getTerminal(n[t],!1);if(f==l(u)){var A=q.view.getState(u);u!=a&&null!=A&&(p&&b!=A.getCenterX()<h.getCenterX()||!p&&b!=A.getCenterY()<h.getCenterY())&&mxUtils.intersects(m,A)&&(d=10+Math.max(d,(Math.min(m.x+m.width,A.x+A.width)-Math.max(m.x,A.x))/k),g=10+Math.max(g,(Math.min(m.y+m.height,A.y+A.height)-Math.max(m.y,A.y))/k))}}p?g=0:d=0;for(t=0;t<n.length;t++)if(u=q.model.getTerminal(n[t],
|
|
|
|
|
!1),f==l(u)&&(A=q.view.getState(u),u!=a&&null!=A&&(p&&b!=A.getCenterX()<h.getCenterX()||!p&&b!=A.getCenterY()<h.getCenterY()))){var v=[];q.traverse(A.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});q.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function g(a){q.model.beginUpdate();try{var b=l(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],d[1],!1);q.model.setTerminal(d[0],d[1],!0);q.model.setTerminal(d[0],a,!1);
|
|
|
|
|
!0));if(null!=n){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<n.length;t++){var u=q.model.getTerminal(n[t],!1);if(f==l(u)){var z=q.view.getState(u);u!=a&&null!=z&&(p&&b!=z.getCenterX()<h.getCenterX()||!p&&b!=z.getCenterY()<h.getCenterY())&&mxUtils.intersects(m,z)&&(d=10+Math.max(d,(Math.min(m.x+m.width,z.x+z.width)-Math.max(m.x,z.x))/k),g=10+Math.max(g,(Math.min(m.y+m.height,z.y+z.height)-Math.max(m.y,z.y))/k))}}p?g=0:d=0;for(t=0;t<n.length;t++)if(u=q.model.getTerminal(n[t],
|
|
|
|
|
!1),f==l(u)&&(z=q.view.getState(u),u!=a&&null!=z&&(p&&b!=z.getCenterX()<h.getCenterX()||!p&&b!=z.getCenterY()<h.getCenterY()))){var v=[];q.traverse(z.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});q.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function g(a){q.model.beginUpdate();try{var b=l(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],d[1],!1);q.model.setTerminal(d[0],d[1],!0);q.model.setTerminal(d[0],a,!1);
|
|
|
|
|
var e=q.model.getParent(a),f=e.geometry,g=[];q.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);q.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,k=-40):b==mxConstants.DIRECTION_WEST?(h=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);q.moveCells(g,h,k);return q.addCells(d,e)}finally{q.model.endUpdate()}}function k(a){q.model.beginUpdate();try{var b=
|
|
|
|
|
q.model.getParent(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],a]);q.model.setTerminal(d[0],a,!0);var c=q.getOutgoingEdges(a),e=b.geometry,f=[];q.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=q.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=q.view.getBounds(f),m=l(a),n=q.view.translate,p=q.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x-e.x+10,d[1].geometry.y+=a.geometry.height-
|
|
|
|
|
e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=m==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-n.y+-e.y+10);return q.addCells(d,b)}finally{q.model.endUpdate()}}function n(a,
|
|
|
|
|
b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function p(a,b){var c=l(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
|
|
|
|
|
c==mxConstants.DIRECTION_WEST)==d&&c!=b?u.actions.get("selectParent").funct():c==b?(d=q.getOutgoingEdges(a),null!=d&&0<d.length&&q.setSelectionCell(q.model.getTerminal(d[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(d=n(q.model.getTerminal(c[0],!0),d,a),c=q.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&q.setSelectionCell(d[c].cell)))))}var u=this,q=u.editor.graph,v=q.getModel();mxResources.parse("selectChildren=Select Children");
|
|
|
|
|
mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var B=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){B.apply(this,arguments);if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(q.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(q.getSelectionCell())&&
|
|
|
|
|
mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var A=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){A.apply(this,arguments);if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(q.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(q.getSelectionCell())&&
|
|
|
|
|
(a.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};u.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),
|
|
|
|
|
a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",
|
|
|
|
|
function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+T");var y=q.removeCells;q.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];v.isEdge(g)&&c(g)&&(e.push(g),g=v.getTerminal(g,!1));b(g)?(q.traverse(g,!0,
|
|
|
|
|
function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=q.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return y.apply(this,arguments)};u.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var t=q.duplicateCells;q.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
|
|
|
|
|
function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+T");var B=q.removeCells;q.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];v.isEdge(g)&&c(g)&&(e.push(g),g=v.getTerminal(g,!1));b(g)?(q.traverse(g,!0,
|
|
|
|
|
function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=q.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return B.apply(this,arguments)};u.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var t=q.duplicateCells;q.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],
|
|
|
|
|
a)}this.model.beginUpdate();try{var h=t.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=q.getIncomingEdges(h[e]),g=q.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var l=this.cloneCells([g[0]])[0];this.addEdge(l,q.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var w=q.moveCells;q.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);
|
|
|
|
|
if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<a.length;p++)if(b(a[p])||q.model.isEdge(a[p])&&null==q.model.getTerminal(a[p],!0)){f=q.model.getParent(a[p]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var t=q.getIncomingEdges(a[0]);if(0<t.length){var u=q.view.getState(q.model.getTerminal(t[0],!0));if(null!=u){var v=q.view.getState(l);null!=v&&(c=(v.getCenterX()-u.getCenterX())/q.view.scale,d=(v.getCenterY()-u.getCenterY())/q.view.scale)}}}}k=w.apply(this,arguments);
|
|
|
|
|
if(null!=k&&null!=a&&k.length==a.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))b(l)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],l,!0);else if(b(a[p])&&(t=q.getIncomingEdges(a[p]),0<t.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],l,!0);else if(0==q.getIncomingEdges(k[p]).length){m=l;if(null==m||m==q.model.getParent(a[p]))m=q.model.getTerminal(t[0],!0);e=this.cloneCells([t[0]])[0];this.addEdge(e,
|
|
|
|
|
q.getDefaultParent(),m,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var x=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=x.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=q.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var z={88:u.actions.get("selectChildren"),
|
|
|
|
|
q.getDefaultParent(),m,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var x=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=x.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=q.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var y={88:u.actions.get("selectChildren"),
|
|
|
|
|
84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},C=u.onKeyDown;u.onKeyDown=function(a){try{if(q.isEnabled()&&!q.isEditing()&&b(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?g(q.getSelectionCell()):k(q.getSelectionCell()):13==a.which&&(c=m(q.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],
|
|
|
|
|
!1)):q.setSelectionCell(c[c.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(q.view.getState(q.getSelectionCell())),q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=z[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(q.getSelectionCell(),
|
|
|
|
|
!1)):q.setSelectionCell(c[c.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(q.view.getState(q.getSelectionCell())),q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=y[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(q.getSelectionCell(),
|
|
|
|
|
mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(K){console.log("error",K)}mxEvent.isConsumed(a)||C.apply(this,arguments)};var H=q.connectVertex;q.connectVertex=function(a,c,d,e,f,h){var n=q.getIncomingEdges(a);return b(a)&&0<n.length?(d=l(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,f=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?k(a):e==f?g(a):m(a,c!=mxConstants.DIRECTION_NORTH&&
|
|
|
|
|
c!=mxConstants.DIRECTION_WEST)):H.call(this,a,c,d,e,f,h)};q.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&q.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var E=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){E.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
|
|
|
|
|
this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);
|
|
|
|
|