|
|
|
@ -2451,7 +2451,7 @@ b.getProperty("event"),d=b.getProperty("cell");null==d?(c=mxUtils.convertPoint(t
|
|
|
|
|
mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var E=this.updateMouseEvent;this.updateMouseEvent=function(a){a=E.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}this.currentTranslate=new mxPoint(0,0)};
|
|
|
|
|
Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;
|
|
|
|
|
Graph.createSvgImage=function(a,c,d){d=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+c+'px" version="1.1">'+d+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0)),a,c)};
|
|
|
|
|
Graph.zapGremlins=function(a){for(var c=[],d=0;d<a.length;d++){var b=a.charCodeAt(d);(32<=b||9==b||10==b||13==b)&&c.push(a.charAt(d))}return c.join("")};Graph.stringToBytes=function(a){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]=a.charCodeAt(d);return c};Graph.bytesToString=function(a){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]=String.fromCharCode(a[d]);return c.join("")};Graph.compressNode=function(a){return Graph.compress(Graph.zapGremlins(mxUtils.getXml(a)))};
|
|
|
|
|
Graph.zapGremlins=function(a){for(var c=[],d=0;d<a.length;d++){var b=a.charCodeAt(d);(32<=b||9==b||10==b||13==b)&&65535!=b&&c.push(a.charAt(d))}return c.join("")};Graph.stringToBytes=function(a){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]=a.charCodeAt(d);return c};Graph.bytesToString=function(a){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]=String.fromCharCode(a[d]);return c.join("")};Graph.compressNode=function(a){return Graph.compress(Graph.zapGremlins(mxUtils.getXml(a)))};
|
|
|
|
|
Graph.compress=function(a,c){if(null==a||0==a.length||"undefined"===typeof pako)return a;var d=Graph.bytesToString(c?pako.deflate(encodeURIComponent(a)):pako.deflateRaw(encodeURIComponent(a)));return window.btoa?btoa(d):Base64.encode(d,!0)};Graph.decompress=function(a,c){if(null==a||0==a.length||"undefined"===typeof pako)return a;var d=window.atob?atob(a):Base64.decode(a,!0);return Graph.zapGremlins(decodeURIComponent(Graph.bytesToString(c?pako.inflate(d):pako.inflateRaw(d))))};
|
|
|
|
|
mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";
|
|
|
|
|
Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.absoluteUrlPattern=/^(?:[a-z]+:)?\/\//i;Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};
|
|
|
|
@ -2693,7 +2693,7 @@ Format.prototype.isLineJumpState=function(a){var c=mxUtils.getValue(a.style,mxCo
|
|
|
|
|
Format.prototype.isComicState=function(a){a=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);return 0<=mxUtils.indexOf("label rectangle internalStorage corner parallelogram note collate swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput singleArrow doubleArrow flexArrow filledEdge card umlLifeline connector folder component sortShape cross umlFrame cube isoCube isoRectangle partialRectangle".split(" "),a)};
|
|
|
|
|
Format.prototype.isAutoSizeState=function(a){return"1"==mxUtils.getValue(a.style,mxConstants.STYLE_AUTOSIZE,null)};Format.prototype.isImageState=function(a){a=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);return"label"==a||"image"==a};Format.prototype.isShadowState=function(a){return"image"!=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null)};
|
|
|
|
|
Format.prototype.clear=function(){this.container.innerHTML="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]};
|
|
|
|
|
Format.prototype.refresh=function(){if("0px"!=this.container.style.width){this.clear();var a=this.editorUi,c=a.editor.graph,d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.color="rgb(112, 112, 112)";d.style.textAlign="left";d.style.cursor="default";var b=document.createElement("div");b.className="geFormatSection";b.style.textAlign="center";b.style.fontWeight="bold";b.style.paddingTop="8px";b.style.fontSize="14px";b.style.borderWidth="0px 0px 1px 1px";b.style.borderStyle="solid";
|
|
|
|
|
Format.prototype.refresh=function(){if("0px"!=this.container.style.width){this.clear();var a=this.editorUi,c=a.editor.graph,d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.color="rgb(112, 112, 112)";d.style.textAlign="left";d.style.cursor="default";var b=document.createElement("div");b.className="geFormatSection";b.style.textAlign="center";b.style.fontWeight="bold";b.style.paddingTop="8px";b.style.fontSize="13px";b.style.borderWidth="0px 0px 1px 1px";b.style.borderStyle="solid";
|
|
|
|
|
b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.height=mxClient.IS_QUIRKS?"34px":"25px";b.style.overflow="hidden";b.style.width="100%";this.container.appendChild(d);mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));if(c.isSelectionEmpty())mxUtils.write(b,mxResources.get("diagram")),b.style.borderLeftWidth="0px",this.showCloseButton&&(c=document.createElement("img"),c.setAttribute("border","0"),c.setAttribute("src",
|
|
|
|
|
Dialog.prototype.closeImage),c.setAttribute("title",mxResources.get("hide")),c.style.position="absolute",c.style.display="block",c.style.right="0px",c.style.top="8px",c.style.cursor="pointer",c.style.marginTop="1px",c.style.marginRight="17px",c.style.border="1px solid transparent",c.style.padding="1px",c.style.opacity=.5,b.appendChild(c),mxEvent.addListener(c,"click",function(){a.actions.get("formatPanel").funct()})),d.appendChild(b),this.panels.push(new DiagramFormatPanel(this,a,d));else if(c.isEditing())mxUtils.write(b,
|
|
|
|
|
mxResources.get("text")),d.appendChild(b),this.panels.push(new TextFormatPanel(this,a,d));else{var f=this.getSelectionState().containsLabel,e=null,h=null,c=mxUtils.bind(this,function(a,b,c){var d=mxUtils.bind(this,function(d){e!=a&&(f?this.labelIndex=c:this.currentIndex=c,null!=e&&(e.style.backgroundColor=this.inactiveTabBackgroundColor,e.style.borderBottomWidth="1px"),e=a,e.style.backgroundColor="",e.style.borderBottomWidth="0px",h!=b&&(null!=h&&(h.style.display="none"),h=b,h.style.display=""))});
|
|
|
|
@ -7712,10 +7712,10 @@ StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,argum
|
|
|
|
|
StorageLibrary.prototype.isRenamable=function(a,c,b){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(a,c,b){DrawioFile.call(this,a,c);this.title=b;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(a,c,b){RemoteFile.call(this,a,c,b.title);this.libObj=b};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(a,c,b){};
|
|
|
|
|
RemoteLibrary.prototype.saveAs=function(a,c,b){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(a,c,b){StorageFile.call(this,a,c,b);a=b;c=a.lastIndexOf("/");0<=c&&(a=a.substring(c+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,c,b){return!1};UrlLibrary.prototype.saveAs=function(a,c,b){};UrlLibrary.prototype.open=function(){};/*
|
|
|
|
|
mxClient.IS_IOS || */
|
|
|
|
|
var StorageDialog=function(a,c,b){function d(d,p,u,y,g,e){function v(){mxEvent.addListener(t,"click",null!=e?e:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,q.checked);c()})):u==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,q.checked);
|
|
|
|
|
var StorageDialog=function(a,c,b){function d(d,p,u,y,e,g){function v(){mxEvent.addListener(t,"click",null!=g?g:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,q.checked);c()})):u==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,q.checked);
|
|
|
|
|
c()})):(a.setMode(u,q.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}var t=document.createElement("a");t.style.overflow="hidden";t.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.boxSizing="border-box";t.style.fontSize="11px";t.style.position="relative";t.style.margin="4px";t.style.padding="8px 10px 12px 10px";t.style.width="88px";t.style.height="100px";t.style.whiteSpace="nowrap";t.setAttribute("title",p);mxClient.IS_QUIRKS&&
|
|
|
|
|
(t.style.cssFloat="left",t.style.zoom="1");var x=document.createElement("div");x.style.textOverflow="ellipsis";x.style.overflow="hidden";if(null!=d){var l=document.createElement("img");l.setAttribute("src",d);l.setAttribute("border","0");l.setAttribute("align","absmiddle");l.style.width="60px";l.style.height="60px";l.style.paddingBottom="6px";t.appendChild(l)}else x.style.paddingTop="5px",x.style.whiteSpace="normal",mxClient.IS_IOS?(t.style.padding="0px 10px 20px 10px",t.style.top="6px"):mxClient.IS_FF&&
|
|
|
|
|
(x.style.paddingTop="0px",x.style.marginTop="-2px");t.appendChild(x);mxUtils.write(x,p);if(null!=g)for(d=0;d<g.length;d++)mxUtils.br(x),mxUtils.write(x,g[d]);if(null!=y&&null==a[y]){l.style.visibility="hidden";mxUtils.setOpacity(x,10);var m=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});m.spin(t);var C=window.setTimeout(function(){null==a[y]&&(m.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",
|
|
|
|
|
(x.style.paddingTop="0px",x.style.marginTop="-2px");t.appendChild(x);mxUtils.write(x,p);if(null!=e)for(d=0;d<e.length;d++)mxUtils.br(x),mxUtils.write(x,e[d]);if(null!=y&&null==a[y]){l.style.visibility="hidden";mxUtils.setOpacity(x,10);var m=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});m.spin(t);var C=window.setTimeout(function(){null==a[y]&&(m.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",
|
|
|
|
|
mxUtils.bind(this,function(b,c){null!=a[y]&&c.getProperty("client")==a[y]&&(window.clearTimeout(C),mxUtils.setOpacity(x,100),l.style.visibility="",m.stop(),v(),"drive"==y&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else v();n.appendChild(t);++f>=b&&(mxUtils.br(n),f=0)}b=null!=b?b:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var g=a.addLanguageMenu(e,!0);null!=g&&(g.style.bottom=parseInt("28px")-
|
|
|
|
|
3+"px");if(!a.isOffline()&&1<a.getServiceCount()){g=document.createElement("a");g.setAttribute("href","https://about.draw.io/support/");g.setAttribute("title",mxResources.get("help"));g.setAttribute("target","_blank");g.style.position="absolute";g.style.textDecoration="none";g.style.cursor="pointer";g.style.fontSize="12px";g.style.bottom="28px";g.style.left="26px";g.style.color="gray";var l=document.createElement("img");mxUtils.setOpacity(l,50);l.style.height="16px";l.style.width="16px";l.setAttribute("border",
|
|
|
|
|
"0");l.setAttribute("valign","bottom");l.setAttribute("src",Editor.helpImage);l.style.marginRight="2px";g.appendChild(l);mxUtils.write(g,mxResources.get("help"));e.appendChild(g)}var m=document.createElement("div");m.style.position="absolute";m.style.cursor="pointer";m.style.fontSize="12px";m.style.bottom="28px";m.style.color="gray";mxUtils.write(m,mxResources.get("decideLater"));a.isOfflineApp()?m.style.right="20px":(mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)"),m.style.left=
|
|
|
|
@ -7749,29 +7749,29 @@ a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawin
|
|
|
|
|
mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img"),q.setAttribute("src",Editor.tweetImage),q.setAttribute("width","18"),q.setAttribute("height","18"),q.setAttribute("border","0"),q.style.marginBottom="5px",f.appendChild(q),f.setAttribute("title",
|
|
|
|
|
mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",g.appendChild(f))}q=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.appendChild(q);f=mxUtils.button(mxResources.get("copy"),function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});
|
|
|
|
|
5E5>c.length?mxClient.IS_SF||null!=document.documentMode?q.className="geBtn gePrimaryBtn":(g.appendChild(f),f.className="geBtn gePrimaryBtn",q.className="geBtn"):(g.appendChild(n),q.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(g);this.container=d};EmbedDialog.showPreviewOption=!0;
|
|
|
|
|
var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(I.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<G.length&&(b+="&s="+G);""!=v.value&&"0"!=v.value&&(b+="&border="+v.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(x.checked?"1":"0");b+="&fit="+(C.checked?"1":"0");
|
|
|
|
|
var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(K.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<F.length&&(b+="&s="+F);""!=v.value&&"0"!=v.value&&(b+="&border="+v.value);""!=k.value&&(b+="&height="+k.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(x.checked?"1":"0");b+="&fit="+(C.checked?"1":"0");
|
|
|
|
|
b+="&resize="+(y.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;e.mathEnabled&&(b+="&math=1");u.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));q.value=b}else A.constructor==DriveFile||A.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=A.getHash().substring(1),b=A.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
|
|
|
|
|
a&&(b+="&title="+encodeURIComponent(a)),""!=k.value&&(a=parseInt(k.value)+parseInt(f.value),b+="&height="+a),q.value=b):q.value=""}var d=document.createElement("div"),e=a.editor.graph,g=e.getGraphBounds(),l=e.view.scale,m=Math.floor(g.x/l-e.view.translate.x),n=Math.floor(g.y/l-e.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";
|
|
|
|
|
d.appendChild(q);mxUtils.br(d);this.init=function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=m;d.appendChild(f);mxUtils.write(d,mxResources.get("height")+":");var k=document.createElement("input");k.setAttribute("type",
|
|
|
|
|
"text");k.setAttribute("size","4");k.style.marginLeft="4px";k.value=Math.ceil(g.height/l);d.appendChild(k);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);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=c||"";
|
|
|
|
|
d.appendChild(p);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");v.setAttribute("size","3");v.style.marginBottom="8px";v.style.marginLeft="4px";v.value="0";d.appendChild(v);mxUtils.br(d);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";d.appendChild(t);mxUtils.write(d,mxResources.get("pan")+" ");var x=document.createElement("input");
|
|
|
|
|
x.setAttribute("type","checkbox");x.setAttribute("checked","checked");x.defaultChecked=!0;x.style.marginLeft="8px";d.appendChild(x);mxUtils.write(d,mxResources.get("zoom")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";z.setAttribute("title",window.location.href);d.appendChild(z);mxUtils.write(d,mxResources.get("edit")+" ");var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginLeft="8px";d.appendChild(u);mxUtils.write(d,
|
|
|
|
|
mxResources.get("asNew")+" ");mxUtils.br(d);var y=document.createElement("input");y.setAttribute("type","checkbox");y.setAttribute("checked","checked");y.defaultChecked=!0;y.style.marginLeft="16px";d.appendChild(y);mxUtils.write(d,mxResources.get("resize")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft="8px";d.appendChild(C);mxUtils.write(d,mxResources.get("fit")+" ");var I=document.createElement("input");I.setAttribute("type","checkbox");I.style.marginLeft=
|
|
|
|
|
"8px";d.appendChild(I);mxUtils.write(d,mxResources.get("embed")+" ");var G=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(t,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(I,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(p,"change",b);b();
|
|
|
|
|
mxResources.get("asNew")+" ");mxUtils.br(d);var y=document.createElement("input");y.setAttribute("type","checkbox");y.setAttribute("checked","checked");y.defaultChecked=!0;y.style.marginLeft="16px";d.appendChild(y);mxUtils.write(d,mxResources.get("resize")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft="8px";d.appendChild(C);mxUtils.write(d,mxResources.get("fit")+" ");var K=document.createElement("input");K.setAttribute("type","checkbox");K.style.marginLeft=
|
|
|
|
|
"8px";d.appendChild(K);mxUtils.write(d,mxResources.get("embed")+" ");var F=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(t,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(K,"change",b);mxEvent.addListener(k,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(p,"change",b);b();
|
|
|
|
|
mxEvent.addListener(q,"click",function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)});g=document.createElement("div");g.style.paddingTop="12px";g.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";g.appendChild(l);d.appendChild(g);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign=
|
|
|
|
|
"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var g=new Graph(c);g.setCellsCloneable(!0);g.setPanning(!0);g.setAllowDanglingEdges(!1);g.connectionHandler.select=!1;g.view.setTranslate(20,20);g.border=20;g.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";g.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))})};g.getAllConnectionConstraints=function(){return null};g.connectionHandler.marker.highlight.keepOnTop=
|
|
|
|
|
!1;g.connectionHandler.createEdgeState=function(a){a=g.createEdge(null,null,null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var m=g.getDefaultParent(),n=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){g.connectionHandler.reset();g.clearSelection();var f=g.getCellGeometry(a),d;k(function(){d=g.insertVertex(m,null,"Entry",f.x,f.y,80,30,"rounded=1;");n(d);g.view.refresh(d);
|
|
|
|
|
g.insertEdge(m,null,"",a,d,l)},function(){g.scrollCellToVisible(d)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),f=b.getProperty("state");g.popupMenuHandler.hideMenu();g.stopEditing(!1);var k=mxUtils.convertPoint(g.container,mxEvent.getClientX(c),mxEvent.getClientY(c));g.connectionHandler.start(f,k.x,k.y);g.isMouseDown=!0;g.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});g.addCellOverlay(a,b)});g.getModel().beginUpdate();var q;try{q=g.insertVertex(m,null,"Start",
|
|
|
|
|
g.insertEdge(m,null,"",a,d,l)},function(){g.scrollCellToVisible(d)})});b.addListener("pointerdown",function(a,b){var c=b.getProperty("event"),f=b.getProperty("state");g.popupMenuHandler.hideMenu();g.stopEditing(!1);var d=mxUtils.convertPoint(g.container,mxEvent.getClientX(c),mxEvent.getClientY(c));g.connectionHandler.start(f,d.x,d.y);g.isMouseDown=!0;g.isMouseTrigger=mxEvent.isMouseEvent(c);mxEvent.consume(c)});g.addCellOverlay(a,b)});g.getModel().beginUpdate();var q;try{q=g.insertVertex(m,null,"Start",
|
|
|
|
|
0,0,80,30,"ellipse"),n(q)}finally{g.getModel().endUpdate()}var f;"horizontalTree"==b?(f=new mxCompactTreeLayout(g),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==b?(f=new mxCompactTreeLayout(g,!1),f.edgeRouting=!1,f.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==b?(f=new mxRadialTreeLayout(g,!1),f.edgeRouting=!1,f.levelDistance=80):"verticalFlow"==b?f=new mxHierarchicalLayout(g,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
|
|
|
|
|
b?f=new mxHierarchicalLayout(g,mxConstants.DIRECTION_WEST):"organic"==b?(f=new mxFastOrganicLayout(g,!1),f.forceConstant=80):"circle"==b&&(f=new mxCircleLayout(g));if(null!=f){var k=function(a,b){g.getModel().beginUpdate();try{null!=a&&a(),f.execute(g.getDefaultParent(),q)}catch(y){throw y;}finally{var c=new mxMorphing(g);c.addListener(mxEvent.DONE,mxUtils.bind(this,function(){g.getModel().endUpdate();null!=b&&b()}));c.startAnimation()}},p=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
|
|
|
|
|
function(a,b,c,f,d){p.apply(this,arguments);k()};g.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);k()};g.connectionHandler.addListener(mxEvent.CONNECT,function(){k()})}var v=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(g.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});v.className="geBtn";a.editor.cancelFirst&&d.appendChild(v);var t=mxUtils.button(mxResources.get("insert"),function(){g.clearCellOverlays();
|
|
|
|
|
var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,k=f.getBounds(b);k.x-=f.translate.x;k.y-=f.translate.y;a.editor.graph.scrollRectToVisible(k);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(g.destroy(),c.parentNode.removeChild(c));a.hideDialog()});d.appendChild(t);t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(v)};this.container=d};
|
|
|
|
|
var b=a.editor.graph.getFreeInsertPoint(),b=a.editor.graph.importCells(g.getModel().getChildren(g.getDefaultParent()),b.x,b.y),f=a.editor.graph.view,d=f.getBounds(b);d.x-=f.translate.x;d.y-=f.translate.y;a.editor.graph.scrollRectToVisible(d);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(g.destroy(),c.parentNode.removeChild(c));a.hideDialog()});d.appendChild(t);t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(v)};this.container=d};
|
|
|
|
|
CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":
|
|
|
|
|
IMAGE_PATH+"/handle-connect.png",26,26);
|
|
|
|
|
var BackgroundImageDialog=function(a,c){var b=document.createElement("div");b.style.whiteSpace="nowrap";var d=document.createElement("h2");mxUtils.write(d,mxResources.get("backgroundImage"));d.style.marginTop="0px";b.appendChild(d);mxUtils.write(b,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(b);var d=a.editor.graph.backgroundImage,e=document.createElement("input");e.setAttribute("type","text");e.style.marginTop="4px";e.style.marginBottom="4px";e.style.width="350px";e.value=
|
|
|
|
|
null!=d?d.src:"";var g=!1,l=function(){g||""==e.value||a.isOffline()?(m.value="",n.value=""):a.loadImage(mxUtils.trim(e.value),function(a){m.value=a.width;n.value=a.height},function(){a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));e.value="";m.value="";n.value=""})};this.init=function(){e.focus();if(Graph.fileSupport){e.setAttribute("placeholder",mxResources.get("dragImagesHere"));var c=b.parentNode,f=null;mxEvent.addListener(c,"dragleave",function(a){null!=
|
|
|
|
|
f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(c));b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,f,k,d){e.value=a;l()},function(){},
|
|
|
|
|
f&&(f.parentNode.removeChild(f),f=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==f&&(!mxClient.IS_IE||10<document.documentMode)&&(f=a.highlightElement(c));b.stopPropagation();b.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=f&&(f.parentNode.removeChild(f),f=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxBackgroundSize,function(a,b,c,f,d,k){e.value=a;l()},function(){},
|
|
|
|
|
function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0,a.maxBackgroundBytes,a.maxBackgroundBytes);else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&(e.value=decodeURIComponent(c),l())}b.stopPropagation();b.preventDefault()}),!1)}};b.appendChild(e);mxUtils.br(b);mxUtils.br(b);mxUtils.write(b,mxResources.get("width")+":");var m=document.createElement("input");
|
|
|
|
|
m.setAttribute("type","text");m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight="16px";m.value=null!=d?d.width:"";b.appendChild(m);mxUtils.write(b,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="16px";n.value=null!=d?d.height:"";b.appendChild(n);d=mxUtils.button(mxResources.get("reset"),function(){e.value="";m.value="";n.value="";g=!1});mxEvent.addListener(d,"mousedown",
|
|
|
|
|
function(){g=!0});mxEvent.addListener(d,"touchstart",function(){g=!0});d.className="geBtn";d.width="100";b.appendChild(d);mxUtils.br(b);mxEvent.addListener(e,"change",l);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(e.value=a.url,l()));e.focus()};d=document.createElement("div");d.style.marginTop="40px";d.style.textAlign="right";var q=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});
|
|
|
|
@ -7788,8 +7788,8 @@ mxUtils.trim(y.substring(12)),"("==y.charAt(y.length-1)&&(y=y.substring(0,y.last
|
|
|
|
|
y=d.getGraphBounds(),d.setSelectionCells(d.importCells(v,Math.ceil(Math.max(0,y.x/f.scale-f.translate.x)+4*d.gridSize),Math.ceil(Math.max(0,(y.y+y.height)/f.scale-f.translate.y)+4*d.gridSize))),d.scrollCellToVisible(d.getSelectionCell()))}else if("list"==c){if(0<f.length){d=a.editor.graph;e=new mxCell(f[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");
|
|
|
|
|
e.vertex=!0;y=d.getPreferredSizeForCell(e);null!=y&&e.geometry.width<y.width+10&&(e.geometry.width=y.width+10);n=[e];if(1<f.length)for(A=1;A<f.length;A++)"--"==f[A]?(y=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),y.vertex=!0,e.geometry.height+=y.geometry.height,e.insert(y),n.push(y)):0<f[A].length&&";"!=f[A].charAt(0)&&(l=new mxCell(f[A],
|
|
|
|
|
new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),l.vertex=!0,y=d.getPreferredSizeForCell(l),null!=y&&l.geometry.width<y.width&&(l.geometry.width=y.width),e.geometry.width=Math.max(e.geometry.width,l.geometry.width),e.geometry.height+=l.geometry.height,e.insert(l),n.push(l));d.getModel().beginUpdate();try{e=d.importCells([e],g.x,g.y)[0],d.fireEvent(new mxEventObject("cellsInserted",
|
|
|
|
|
"cells",[e].concat(e.children)))}finally{d.getModel().endUpdate()}d.setSelectionCell(e);d.scrollCellToVisible(d.getSelectionCell())}}else{for(var n=function(a){var b=q[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,q[a]=b,v.push(b));return b},q={},v=[],A=0;A<f.length;A++)if(";"!=f[A].charAt(0)){var D=f[A].split("->");if(2<=D.length){var m=n(D[0]),H=n(D[D.length-1]),D=new mxCell(2<D.length?D[1]:"",new mxGeometry);D.edge=!0;m.insertEdge(D,!0);H.insertEdge(D,
|
|
|
|
|
!1);v.push(D)}}if(0<v.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);d=new Graph(f);d.getModel().beginUpdate();try{v=d.importCells(v);for(A=0;A<v.length;A++)d.getModel().isVertex(v[A])&&(y=d.getPreferredSizeForCell(v[A]),v[A].geometry.width=Math.max(v[A].geometry.width,y.width),v[A].geometry.height=Math.max(v[A].geometry.height,y.height));e=new mxFastOrganicLayout(d);e.disableEdgeStyle=!1;e.forceConstant=120;e.execute(d.getDefaultParent());l=new mxParallelEdgeLayout(d);
|
|
|
|
|
"cells",[e].concat(e.children)))}finally{d.getModel().endUpdate()}d.setSelectionCell(e);d.scrollCellToVisible(d.getSelectionCell())}}else{for(var n=function(a){var b=q[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,q[a]=b,v.push(b));return b},q={},v=[],A=0;A<f.length;A++)if(";"!=f[A].charAt(0)){var G=f[A].split("->");if(2<=G.length){var m=n(G[0]),H=n(G[G.length-1]),G=new mxCell(2<G.length?G[1]:"",new mxGeometry);G.edge=!0;m.insertEdge(G,!0);H.insertEdge(G,
|
|
|
|
|
!1);v.push(G)}}if(0<v.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);d=new Graph(f);d.getModel().beginUpdate();try{v=d.importCells(v);for(A=0;A<v.length;A++)d.getModel().isVertex(v[A])&&(y=d.getPreferredSizeForCell(v[A]),v[A].geometry.width=Math.max(v[A].geometry.width,y.width),v[A].geometry.height=Math.max(v[A].geometry.height,y.height));e=new mxFastOrganicLayout(d);e.disableEdgeStyle=!1;e.forceConstant=120;e.execute(d.getDefaultParent());l=new mxParallelEdgeLayout(d);
|
|
|
|
|
l.spacing=20;l.execute(d.getDefaultParent())}finally{d.getModel().endUpdate()}d.clearCellOverlays();n=[];a.editor.graph.getModel().beginUpdate();try{n=a.editor.graph.importCells(d.getModel().getChildren(d.getDefaultParent()),g.x,g.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",n))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(n);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());d.destroy();f.parentNode.removeChild(f)}}}function e(){return"list"==
|
|
|
|
|
m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":"table"==m.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==m.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
|
|
|
|
|
"plantUmlSvg"==m.value||"plantUmlTxt"==m.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var g=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var l=document.createElement("textarea");l.style.resize="none";l.style.width="100%";l.style.height=
|
|
|
|
@ -7797,32 +7797,32 @@ m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setNa
|
|
|
|
|
n=document.createElement("option");n.setAttribute("value","diagram");mxUtils.write(n,mxResources.get("diagram"));"plantUml"!=b&&m.appendChild(n);n=document.createElement("option");n.setAttribute("value","plantUmlSvg");mxUtils.write(n,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==b&&n.setAttribute("selected","selected");var q=document.createElement("option");q.setAttribute("value","plantUmlPng");mxUtils.write(q,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
|
|
|
|
|
")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(m.appendChild(n),m.appendChild(q),m.appendChild(f));var k=e();l.value=k;c.appendChild(l);this.init=function(){l.focus()};Graph.fileSupport&&(l.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),l.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){l.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(m);mxEvent.addListener(m,"change",function(){var a=e();if(0==l.value.length||l.value==k)k=a,l.value=k});b=mxUtils.button(mxResources.get("close"),function(){l.value==k?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("insert"),
|
|
|
|
|
function(){a.hideDialog();d(l.value,m.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,e,g,l,m,n,q,f,k,p,v,t,x){function z(){var a=!0;if(null!=S)for(;F<S.length&&(a||0!=mxUtils.mod(F,30));)a=S[F++],C(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview),a=!1}function u(){if(Y)b||a.hideDialog(),v(Y,fa,J.value);else if(d)b||a.hideDialog(),d(V,J.value);else{var c=J.value;
|
|
|
|
|
function(){a.hideDialog();d(l.value,m.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,e,g,l,m,n,q,f,k,p,v,t,x){function z(){var a=!0;if(null!=S)for(;E<S.length&&(a||0!=mxUtils.mod(E,30));)a=S[E++],C(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview),a=!1}function u(){if(Y)b||a.hideDialog(),v(Y,fa,J.value);else if(d)b||a.hideDialog(),d(V,J.value);else{var c=J.value;
|
|
|
|
|
null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,V,null!=U&&0<U.length?U:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function y(a,b,c,f,d){null!=W&&(W.style.backgroundColor="transparent",W.style.border="1px solid transparent");H.removeAttribute("disabled");V=b;U=c;W=a;Y=f;fa=d;W.style.backgroundColor=m;W.style.border=n}function C(b,c,f,d,k,p,e,g,v){var t=document.createElement("div");t.className="geTemplate";
|
|
|
|
|
t.style.height=O+"px";t.style.width=R+"px";null!=d&&0<d.length&&t.setAttribute("title",d);if(null!=p)t.style.backgroundImage="url("+p+")",t.style.backgroundSize="contain",t.style.backgroundPosition="center center",t.style.backgroundRepeat="no-repeat",mxEvent.addListener(t,"click",function(a){y(t,null,null,b,e)}),mxEvent.addListener(t,"dblclick",function(a){u()});else if(null!=b&&0<b.length){f=v||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";t.style.backgroundImage="url("+f+")";t.style.backgroundPosition=
|
|
|
|
|
"center center";t.style.backgroundRepeat="no-repeat";var A=!1;mxEvent.addListener(t,"click",function(f){H.setAttribute("disabled","disabled");t.style.backgroundColor="transparent";t.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;D.spin(N);mxUtils.get(f,mxUtils.bind(this,function(a){D.stop();200<=a.getStatus()&&299>=a.getStatus()&&(y(t,a.getText(),c),A&&u())}))});mxEvent.addListener(t,"dblclick",
|
|
|
|
|
function(a){A=!0})}else t.innerHTML='<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",k&&y(t),null!=g?mxEvent.addListener(t,"click",g):(mxEvent.addListener(t,"click",function(a){y(t)}),mxEvent.addListener(t,"dblclick",function(a){u()}));N.appendChild(t)}function I(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(z(),mxEvent.consume(a))});var a=null,b;for(b in aa){var c=
|
|
|
|
|
t.style.height=Q+"px";t.style.width=R+"px";null!=d&&0<d.length&&t.setAttribute("title",d);if(null!=p)t.style.backgroundImage="url("+p+")",t.style.backgroundSize="contain",t.style.backgroundPosition="center center",t.style.backgroundRepeat="no-repeat",mxEvent.addListener(t,"click",function(a){y(t,null,null,b,e)}),mxEvent.addListener(t,"dblclick",function(a){u()});else if(null!=b&&0<b.length){f=v||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";t.style.backgroundImage="url("+f+")";t.style.backgroundPosition=
|
|
|
|
|
"center center";t.style.backgroundRepeat="no-repeat";var A=!1;mxEvent.addListener(t,"click",function(f){H.setAttribute("disabled","disabled");t.style.backgroundColor="transparent";t.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;G.spin(N);mxUtils.get(f,mxUtils.bind(this,function(a){G.stop();200<=a.getStatus()&&299>=a.getStatus()&&(y(t,a.getText(),c),A&&u())}))});mxEvent.addListener(t,"dblclick",
|
|
|
|
|
function(a){A=!0})}else t.innerHTML='<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",k&&y(t),null!=g?mxEvent.addListener(t,"click",g):(mxEvent.addListener(t,"click",function(a){y(t)}),mxEvent.addListener(t,"dblclick",function(a){u()}));N.appendChild(t)}function K(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(z(),mxEvent.consume(a))});var a=null,b;for(b in aa){var c=
|
|
|
|
|
document.createElement("div"),f=mxResources.get(b),d=aa[b];null==f&&(f=b.substring(0,1).toUpperCase()+b.substring(1));18<f.length&&(f=f.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",f+" ("+d.length+")");mxUtils.write(c,c.getAttribute("title"));null!=q&&(c.style.padding=q);Z.appendChild(c);null==a&&(a=c,a.style.backgroundColor=l);(function(b,f){mxEvent.addListener(c,
|
|
|
|
|
"click",function(){a!=f&&(a.style.backgroundColor="",a=f,a.style.backgroundColor=l,N.scrollTop=0,N.innerHTML="",F=0,S=aa[b],K=null,z())})})(b,c)}z()}b=null!=b?b:!0;e=null!=e?e:!1;l=null!=l?l:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var G=document.createElement("div");G.style.height="100%";var A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.height="46px";b&&G.appendChild(A);var E=document.createElement("img");E.setAttribute("border",
|
|
|
|
|
"0");E.setAttribute("align","absmiddle");E.style.width="40px";E.style.height="40px";E.style.marginRight="10px";E.style.paddingBottom="4px";E.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";
|
|
|
|
|
!c&&b&&A.appendChild(E);b&&mxUtils.write(A,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");E=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?E=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?E=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?E=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?E=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(E=a.trello.extension);var J=
|
|
|
|
|
document.createElement("input");J.setAttribute("value",a.defaultFilename+E);J.style.marginLeft="10px";J.style.width=c?"220px":"430px";this.init=function(){b&&(J.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?J.select():document.execCommand("selectAll",!1,null))};b&&(A.appendChild(J),null!=a.editor.fileExtensions&&(E=FilenameDialog.createTypeHint(a,J,a.editor.fileExtensions),E.style.marginTop="12px",A.appendChild(E)));var A=!1,F=0,D=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}),H=mxUtils.button(x||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");u();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";if(k||p){var B=[],K=null,M=function(a){H.setAttribute("disabled","disabled");for(var b=0;b<B.length;b++)B[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},A=!0;x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height=
|
|
|
|
|
"30px";G.appendChild(x);E=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";N.style.left="160px";M(0);N.scrollTop=0;N.innerHTML="";F=0;K!=S&&(S=K,z(),K=null)});B.push(E);x.appendChild(E);var P=function(a){Z.style.display="none";N.style.left="30px";M(a?-1:1);null==K&&(K=S);N.scrollTop=0;N.innerHTML="";D.spin(N);F=0;var b=function(a,b){D.stop();S=a;b?N.innerHTML=b:0==a.length?N.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
|
|
|
|
|
(N.innerHTML="",z())};a?p(Q.value,b):k(b)};k&&(E=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){P()}),x.appendChild(E),B.push(E));if(p){E=document.createElement("span");E.style.marginLeft="10px";E.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");x.appendChild(E);var Q=document.createElement("input");Q.style.marginRight="10px";Q.style.marginLeft="10px";Q.style.width="220px";mxEvent.addListener(Q,"keypress",function(a){13==a.keyCode&&P(!0)});x.appendChild(Q);E=mxUtils.button(mxResources.get("search"),
|
|
|
|
|
function(){P(!0)});E.className="geBtn";x.appendChild(E)}M(0)}var U=null,V=null,W=null,Y=null,fa=null,N=document.createElement("div");N.style.border="1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";A=(b?72:40)+(A?30:0);N.style.top=A+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+A+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
|
|
|
|
|
var O=140,R=140,aa={},T=1;aa.basic=[{title:"blankDiagram",select:!0}];var S=aa.basic;if(!c){G.appendChild(Z);G.appendChild(N);var ba=!1;/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)&&(f=PROXY_URL+"?url="+encodeURIComponent(f));mxUtils.get(f,function(a){if(!ba){ba=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=aa[c];null==
|
|
|
|
|
b&&(T++,b=[],aa[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview")})}}a=a.nextSibling}I()}})}mxEvent.addListener(J,"keypress",function(b){a.dialog.container.firstChild==G&&13==b.keyCode&&u()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";A=mxUtils.button(mxResources.get("cancel"),
|
|
|
|
|
"click",function(){a!=f&&(a.style.backgroundColor="",a=f,a.style.backgroundColor=l,N.scrollTop=0,N.innerHTML="",E=0,S=aa[b],I=null,z())})})(b,c)}z()}b=null!=b?b:!0;e=null!=e?e:!1;l=null!=l?l:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var F=document.createElement("div");F.style.height="100%";var A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.height="46px";b&&F.appendChild(A);var D=document.createElement("img");D.setAttribute("border",
|
|
|
|
|
"0");D.setAttribute("align","absmiddle");D.style.width="40px";D.style.height="40px";D.style.marginRight="10px";D.style.paddingBottom="4px";D.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";
|
|
|
|
|
!c&&b&&A.appendChild(D);b&&mxUtils.write(A,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");D=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?D=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?D=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?D=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?D=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(D=a.trello.extension);var J=
|
|
|
|
|
document.createElement("input");J.setAttribute("value",a.defaultFilename+D);J.style.marginLeft="10px";J.style.width=c?"220px":"430px";this.init=function(){b&&(J.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?J.select():document.execCommand("selectAll",!1,null))};b&&(A.appendChild(J),null!=a.editor.fileExtensions&&(D=FilenameDialog.createTypeHint(a,J,a.editor.fileExtensions),D.style.marginTop="12px",A.appendChild(D)));var A=!1,E=0,G=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}),H=mxUtils.button(x||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");u();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";if(k||p){var B=[],I=null,M=function(a){H.setAttribute("disabled","disabled");for(var b=0;b<B.length;b++)B[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},A=!0;x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height=
|
|
|
|
|
"30px";F.appendChild(x);D=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";N.style.left="160px";M(0);N.scrollTop=0;N.innerHTML="";E=0;I!=S&&(S=I,z(),I=null)});B.push(D);x.appendChild(D);var O=function(a){Z.style.display="none";N.style.left="30px";M(a?-1:1);null==I&&(I=S);N.scrollTop=0;N.innerHTML="";G.spin(N);E=0;var b=function(a,b){G.stop();S=a;b?N.innerHTML=b:0==a.length?N.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
|
|
|
|
|
(N.innerHTML="",z())};a?p(P.value,b):k(b)};k&&(D=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){O()}),x.appendChild(D),B.push(D));if(p){D=document.createElement("span");D.style.marginLeft="10px";D.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");x.appendChild(D);var P=document.createElement("input");P.style.marginRight="10px";P.style.marginLeft="10px";P.style.width="220px";mxEvent.addListener(P,"keypress",function(a){13==a.keyCode&&O(!0)});x.appendChild(P);D=mxUtils.button(mxResources.get("search"),
|
|
|
|
|
function(){O(!0)});D.className="geBtn";x.appendChild(D)}M(0)}var U=null,V=null,W=null,Y=null,fa=null,N=document.createElement("div");N.style.border="1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";A=(b?72:40)+(A?30:0);N.style.top=A+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+A+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";
|
|
|
|
|
var Q=140,R=140,aa={},T=1;aa.basic=[{title:"blankDiagram",select:!0}];var S=aa.basic;if(!c){F.appendChild(Z);F.appendChild(N);var ba=!1;/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)&&(f=PROXY_URL+"?url="+encodeURIComponent(f));mxUtils.get(f,function(a){if(!ba){ba=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=aa[c];null==
|
|
|
|
|
b&&(T++,b=[],aa[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview")})}}a=a.nextSibling}K()}})}mxEvent.addListener(J,"keypress",function(b){a.dialog.container.firstChild==F&&13==b.keyCode&&u()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";A=mxUtils.button(mxResources.get("cancel"),
|
|
|
|
|
function(){null!=g&&g();a.hideDialog(!0)});A.className="geBtn";!a.editor.cancelFirst||e&&null==g||f.appendChild(A);c||a.isOffline()||!b||null!=d||e||(x=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),x.className="geBtn",f.appendChild(x));c||"1"==urlParams.embed||e||(c=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(J.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()}),c.className="geBtn",f.appendChild(c));Graph.fileSupport&&t&&(t=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,
|
|
|
|
|
"change",function(c){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",f.appendChild(t));f.appendChild(H);a.editor.cancelFirst||null!=d||e&&null==g||f.appendChild(A);G.appendChild(f);this.container=G},CreateDialog=function(a,c,b,d,e,g,l,m,n,q,f,k,p,v,t,x){function z(b,f,d,p){function e(){mxEvent.addListener(g,"click",function(){var b=d;if(l){var f=C.value,k=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?
|
|
|
|
|
"change",function(c){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",f.appendChild(t));f.appendChild(H);a.editor.cancelFirst||null!=d||e&&null==g||f.appendChild(A);F.appendChild(f);this.container=F},CreateDialog=function(a,c,b,d,e,g,l,m,n,q,f,k,p,v,t,x){function z(b,f,d,p){function e(){mxEvent.addListener(g,"click",function(){var b=d;if(l){var f=C.value,k=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?
|
|
|
|
|
p=a.gitHub.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension:b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".xml");0<=k&&(f=f.substring(0,k));C.value=f+p}}u(d)})}var g=document.createElement("a");g.style.overflow="hidden";var y=document.createElement("img");y.src=b;y.setAttribute("border","0");y.setAttribute("align","absmiddle");y.style.width="60px";y.style.height="60px";y.style.paddingBottom="6px";g.style.display=mxClient.IS_QUIRKS?"inline":
|
|
|
|
|
"inline-block";g.className="geBaseButton";g.style.position="relative";g.style.margin="4px";g.style.padding="8px 8px 10px 8px";g.style.whiteSpace="nowrap";g.appendChild(y);mxClient.IS_QUIRKS&&(g.style.cssFloat="left",g.style.zoom="1");g.style.color="gray";g.style.fontSize="11px";var t=document.createElement("div");g.appendChild(t);mxUtils.write(t,f);if(null!=p&&null==a[p]){y.style.visibility="hidden";mxUtils.setOpacity(t,10);var v=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});v.spin(g);var x=window.setTimeout(function(){null==a[p]&&(v.stop(),g.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(x),mxUtils.setOpacity(t,100),y.style.visibility="",v.stop(),e())}))}else e();I.appendChild(g);++G==k&&(mxUtils.br(I),G=0)}function u(c){var f=C.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}l=null!=l?l:!0;m=null!=m?m:!0;k=null!=k?k:4;g=
|
|
|
|
|
speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(g);var x=window.setTimeout(function(){null==a[p]&&(v.stop(),g.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(x),mxUtils.setOpacity(t,100),y.style.visibility="",v.stop(),e())}))}else e();K.appendChild(g);++F==k&&(mxUtils.br(K),F=0)}function u(c){var f=C.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}l=null!=l?l:!0;m=null!=m?m:!0;k=null!=k?k:4;g=
|
|
|
|
|
document.createElement("div");null==d&&a.addLanguageMenu(g);var y=document.createElement("h2");mxUtils.write(y,e||mxResources.get("create"));y.style.marginTop="0px";y.style.marginBottom="24px";g.appendChild(y);mxUtils.write(g,mxResources.get("filename")+":");var C=document.createElement("input");C.setAttribute("value",c);C.style.width="280px";C.style.marginLeft="10px";C.style.marginBottom="20px";this.init=function(){C.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
|
|
|
|
C.select():document.execCommand("selectAll",!1,null)};g.appendChild(C);null!=x&&g.appendChild(FilenameDialog.createTypeHint(a,C,x));null!=p&&null!=v&&"image/"==v.substring(0,6)&&(C.style.width="160px",e=null,"image/svg+xml"==v&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],v=parseInt(p.getAttribute("width")),t=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+v+" "+t),p.setAttribute("width","120px"),p.setAttribute("height",
|
|
|
|
|
"80px")):(e=document.createElement("img"),e.setAttribute("src","data:"+v+(t?";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%)"),g.appendChild(e),n&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){u("_blank")})));mxUtils.br(g);var I=document.createElement("div");I.style.textAlign="center";var G=0;I.style.marginTop=
|
|
|
|
|
"6px";g.appendChild(I);var A=document.createElement("select");A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),A.appendChild(p),z(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),
|
|
|
|
|
"80px")):(e=document.createElement("img"),e.setAttribute("src","data:"+v+(t?";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%)"),g.appendChild(e),n&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){u("_blank")})));mxUtils.br(g);var K=document.createElement("div");K.style.textAlign="center";var F=0;K.style.marginTop=
|
|
|
|
|
"6px";g.appendChild(K);var A=document.createElement("select");A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),A.appendChild(p),z(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),
|
|
|
|
|
mxUtils.write(p,mxResources.get("oneDrive")),A.appendChild(p),a.mode==App.MODE_ONEDRIVE&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(p,mxResources.get("dropbox")),A.appendChild(p),a.mode==App.MODE_DROPBOX&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),
|
|
|
|
|
App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITHUB),mxUtils.write(p,mxResources.get("github")),A.appendChild(p),z(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),"function"===typeof window.TrelloClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_TRELLO),mxUtils.write(p,mxResources.get("trello")),A.appendChild(p),z(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),
|
|
|
|
|
App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(p=document.createElement("option"),p.setAttribute("value",App.MODE_DEVICE),mxUtils.write(p,mxResources.get("device")),A.appendChild(p),a.mode!=App.MODE_DEVICE&&m||p.setAttribute("selected","selected"),f&&z(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE));m&&isLocalStorage&&"0"!=urlParams.browser&&(m=document.createElement("option"),m.setAttribute("value",App.MODE_BROWSER),
|
|
|
|
@ -7835,8 +7835,8 @@ null,!0)});m.className="geBtn gePrimaryBtn";m.style.width=l.style.width;g.append
|
|
|
|
|
n.style.backgroundPosition="100% 50%";n.style.paddingRight="14px";b=document.createElement("div");b.setAttribute("title",mxResources.get("reset"));b.style.position="relative";b.style.left="-16px";b.style.width="12px";b.style.height="14px";b.style.cursor="pointer";b.style.display=mxClient.IS_VML?"inline":"inline-block";b.style.top=(mxClient.IS_VML?0:3)+"px";b.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(b,"click",function(){n.value="";n.focus()});c.appendChild(n);c.appendChild(b);
|
|
|
|
|
m.appendChild(c);var q=function(b,c,f,k){var p="data:"==b.substring(0,5);!a.isOffline()||p&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(p){a.spinner.stop();a.hideDialog();var u=!1===k?1:null!=c&&null!=f?Math.max(c/p.width,f/p.height):Math.min(1,Math.min(520/p.width,520/p.height));g&&(b=a.convertDataUri(b));d(b,Math.round(Number(p.width)*u),Math.round(Number(p.height)*u))},function(){a.spinner.stop();d(null);a.showError(mxResources.get("error"),
|
|
|
|
|
mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),d(b)):(b=a.convertDataUri(b),c=null==c?120:c,f=null==f?100:f,a.hideDialog(),d(b,c,f))},f=function(b,c){if(null!=b){var f=e?null:l.getModel().getGeometry(l.getSelectionCell());null!=f?q(b,f.width,f.height,c):q(b,null,null,c)}else a.hideDialog(),d(null)};this.init=function(){n.focus();if(Graph.fileSupport){n.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=m.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(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,d,k,p,g,e){f(a,
|
|
|
|
|
e)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&f(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),
|
|
|
|
|
function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(a,b,c,d,k,p,e,g){f(a,
|
|
|
|
|
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(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var d=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(d)&&f(decodeURIComponent(d))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),
|
|
|
|
|
function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(n.value=a.url));n.focus()};if(Graph.fileSupport){var k=document.createElement("input");k.setAttribute("multiple","multiple");k.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(k,"change",function(b){a.importFiles(k.files,
|
|
|
|
|
0,0,a.maxImageSize,function(a,b,c,d,k,p){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var p=mxUtils.button(mxResources.get("open"),function(){k.click()});p.className="geBtn";b.appendChild(p)}}document.createElement("canvas").getContext&&"data:image/"==n.value.substring(0,11)&&"data:image/svg"!=n.value.substring(0,14)&&(p=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,n.value,function(a){n.value=
|
|
|
|
|
a});a.showDialog(b.container,200,185,!0,!0);b.init()}),p.className="geBtn",b.appendChild(p));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(p=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),
|
|
|
|
@ -7868,23 +7868,23 @@ c.appendChild(n);b=document.createElement("div");b.style.marginTop="26px";b.styl
|
|
|
|
|
var RevisionDialog=function(a,c,b){var d=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));d.appendChild(e);var g=document.createElement("div");g.style.position="absolute";g.style.overflow="auto";g.style.width="170px";g.style.height="378px";d.appendChild(g);var l=document.createElement("div");l.style.position="absolute";l.style.border="1px solid lightGray";l.style.left="199px";l.style.width="470px";l.style.height=
|
|
|
|
|
"376px";l.style.overflow="hidden";mxEvent.disableContextMenu(l);d.appendChild(l);var m=new Graph(l);m.setTooltips(!1);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;var n=0,q=null,f=0,k=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[f]?q[f].getAttribute("name"):"pagenumber"==a?f+1:k.apply(this,arguments)};m.getLinkForCell=function(){return null};
|
|
|
|
|
Editor.MathJaxRender&&m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.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%"}),v=a.getCurrentFile(),t=null,x=null,z=null,u=null,y=mxUtils.button("",function(){null!=z&&m.zoomIn()});y.className="geSprite geSprite-zoomin";y.setAttribute("title",
|
|
|
|
|
mxResources.get("zoomIn"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");mxUtils.setOpacity(y,20);var C=mxUtils.button("",function(){null!=z&&m.zoomOut()});C.className="geSprite geSprite-zoomout";C.setAttribute("title",mxResources.get("zoomOut"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var I=mxUtils.button("",function(){null!=z&&(m.maxFitScale=8,m.fit(8),
|
|
|
|
|
m.center())});I.className="geSprite geSprite-fit";I.setAttribute("title",mxResources.get("fit"));I.style.outline="none";I.style.border="none";I.style.margin="2px";I.setAttribute("disabled","disabled");mxUtils.setOpacity(I,20);var G=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});G.className="geSprite geSprite-actualsize";G.setAttribute("title",mxResources.get("actualSize"));G.style.outline="none";G.style.border="none";G.style.margin="2px";G.setAttribute("disabled","disabled");
|
|
|
|
|
mxUtils.setOpacity(G,20);var A=document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var E=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".xml";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b="undefined"===typeof pako?
|
|
|
|
|
"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});E.className="geBtn";E.setAttribute("disabled","disabled");var J=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=u&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(u):a.spinner.spin(document.body,mxResources.get("restoring"))&&v.save(!0,function(b){a.spinner.stop();a.replaceFileData(u);
|
|
|
|
|
a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});J.className="geBtn";J.setAttribute("disabled","disabled");var F=document.createElement("select");F.setAttribute("disabled","disabled");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";var D=null;mxEvent.addListener(F,"change",function(a){null!=D&&(D(a),mxEvent.consume(a))});
|
|
|
|
|
var H=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});H.className="geBtn";H.setAttribute("disabled","disabled");null!=b&&(H.style.display="none");var B=mxUtils.button(mxResources.get("show"),function(){null!=x&&a.openLink(x.getUrl(F.selectedIndex))});B.className="geBtn gePrimaryBtn";B.setAttribute("disabled","disabled");null!=b&&(B.style.display=
|
|
|
|
|
"none",J.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var M=null;if(null!=c&&0<c.length){l.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"),U=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var V=c.length-1;0<=V;V--){var W=function(b){var d=new Date(b.modifiedDate),k=null;if(0<=d.getTime()){var g=function(c){p.stop();var g=mxUtils.parseXml(c),e=a.editor.extractGraphModel(g.documentElement,!0);if(null!=e){var t=function(a){null!=a&&(a=x(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));
|
|
|
|
|
return a},x=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};F.style.display="none";F.innerHTML="";z=g;u=c;q=parseSelectFunction=null;f=0;if("mxfile"==e.nodeName){g=e.getElementsByTagName("diagram");q=[];for(c=0;c<g.length;c++)q.push(g[c]);f=Math.min(n,q.length-1);0<q.length&&t(q[f]);if(1<q.length)for(F.removeAttribute("disabled"),
|
|
|
|
|
F.style.display="",c=0;c<q.length;c++)g=document.createElement("option"),mxUtils.write(g,q[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),g.setAttribute("value",c),c==f&&g.setAttribute("selected","selected"),F.appendChild(g);D=function(){try{var b=parseInt(F.value);t(q[b]);f=n=b}catch(L){F.value=n,a.handleError(L)}}}else x(e);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+d.toLocaleDateString()+" "+d.toLocaleTimeString());
|
|
|
|
|
A.setAttribute("title",k.getAttribute("title"));y.removeAttribute("disabled");C.removeAttribute("disabled");I.removeAttribute("disabled");G.removeAttribute("disabled");null!=v&&v.isRestricted()||(a.editor.graph.isEnabled()&&J.removeAttribute("disabled"),E.removeAttribute("disabled"),B.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(y,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(I,60);mxUtils.setOpacity(G,60)}else F.style.display="none",F.innerHTML="",A.innerHTML="",
|
|
|
|
|
mxUtils.write(A,mxResources.get("errorLoadingFile"))},k=document.createElement("tr");k.style.borderBottom="1px solid lightGray";k.style.fontSize="12px";k.style.cursor="pointer";var e=document.createElement("td");e.style.padding="6px";e.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(e,mxResources.get("current")):d.toDateString()===U?mxUtils.write(e,d.toLocaleTimeString()):mxUtils.write(e,d.toLocaleDateString()+" "+d.toLocaleTimeString());k.appendChild(e);k.setAttribute("title",d.toLocaleDateString()+
|
|
|
|
|
" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(k,"click",function(a){x!=b&&(p.stop(),null!=t&&(t.style.backgroundColor=""),x=b,t=k,t.style.backgroundColor="#ebf2f9",u=z=null,A.removeAttribute("title"),A.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",m.getModel().clear(),J.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),
|
|
|
|
|
y.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(y,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(I,20),mxUtils.setOpacity(G,20),p.spin(l),b.getXml(function(a){if(x==b)try{g(a)}catch(T){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+T.message)}},function(a){p.stop();
|
|
|
|
|
F.style.display="none";F.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(k,"dblclick",function(a){B.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);Q.appendChild(k)}return k}(c[V]);null!=W&&V==c.length-1&&(M=W)}P.appendChild(Q);g.appendChild(P)}else null==v||null==a.drive&&v.constructor==window.DriveFile||null==a.dropbox&&v.constructor==
|
|
|
|
|
window.DropboxFile?(l.style.display="none",K.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(l.style.display="none",K.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";K.appendChild(F);K.appendChild(y);K.appendChild(C);K.appendChild(G);K.appendChild(I);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(E),e.appendChild(H),
|
|
|
|
|
e.appendChild(J),e.appendChild(B)):(e.appendChild(E),e.appendChild(H),e.appendChild(J),e.appendChild(B),e.appendChild(g));d.appendChild(e);d.appendChild(K);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,e,g,l,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q);var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";
|
|
|
|
|
mxResources.get("zoomIn"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");mxUtils.setOpacity(y,20);var C=mxUtils.button("",function(){null!=z&&m.zoomOut()});C.className="geSprite geSprite-zoomout";C.setAttribute("title",mxResources.get("zoomOut"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var K=mxUtils.button("",function(){null!=z&&(m.maxFitScale=8,m.fit(8),
|
|
|
|
|
m.center())});K.className="geSprite geSprite-fit";K.setAttribute("title",mxResources.get("fit"));K.style.outline="none";K.style.border="none";K.style.margin="2px";K.setAttribute("disabled","disabled");mxUtils.setOpacity(K,20);var F=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});F.className="geSprite geSprite-actualsize";F.setAttribute("title",mxResources.get("actualSize"));F.style.outline="none";F.style.border="none";F.style.margin="2px";F.setAttribute("disabled","disabled");
|
|
|
|
|
mxUtils.setOpacity(F,20);var A=document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var D=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".xml";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b="undefined"===typeof pako?
|
|
|
|
|
"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});D.className="geBtn";D.setAttribute("disabled","disabled");var J=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=u&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(u):a.spinner.spin(document.body,mxResources.get("restoring"))&&v.save(!0,function(b){a.spinner.stop();a.replaceFileData(u);
|
|
|
|
|
a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});J.className="geBtn";J.setAttribute("disabled","disabled");var E=document.createElement("select");E.setAttribute("disabled","disabled");E.style.maxWidth="80px";E.style.position="relative";E.style.top="-2px";E.style.verticalAlign="bottom";E.style.marginRight="6px";E.style.display="none";var G=null;mxEvent.addListener(E,"change",function(a){null!=G&&(G(a),mxEvent.consume(a))});
|
|
|
|
|
var H=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});H.className="geBtn";H.setAttribute("disabled","disabled");null!=b&&(H.style.display="none");var B=mxUtils.button(mxResources.get("show"),function(){null!=x&&a.openLink(x.getUrl(E.selectedIndex))});B.className="geBtn gePrimaryBtn";B.setAttribute("disabled","disabled");null!=b&&(B.style.display=
|
|
|
|
|
"none",J.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 M=null;if(null!=c&&0<c.length){l.style.cursor="move";var O=document.createElement("table");O.style.border="1px solid lightGray";O.style.borderCollapse=
|
|
|
|
|
"collapse";O.style.borderSpacing="0px";O.style.width="100%";var P=document.createElement("tbody"),U=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var V=c.length-1;0<=V;V--){var W=function(b){var d=new Date(b.modifiedDate),k=null;if(0<=d.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),g=a.editor.extractGraphModel(e.documentElement,!0);if(null!=g){var t=function(a){null!=a&&(a=x(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));
|
|
|
|
|
return a},x=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};E.style.display="none";E.innerHTML="";z=e;u=c;q=parseSelectFunction=null;f=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");q=[];for(c=0;c<e.length;c++)q.push(e[c]);f=Math.min(n,q.length-1);0<q.length&&t(q[f]);if(1<q.length)for(E.removeAttribute("disabled"),
|
|
|
|
|
E.style.display="",c=0;c<q.length;c++)e=document.createElement("option"),mxUtils.write(e,q[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),E.appendChild(e);G=function(){try{var b=parseInt(E.value);t(q[b]);f=n=b}catch(L){E.value=n,a.handleError(L)}}}else x(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+d.toLocaleDateString()+" "+d.toLocaleTimeString());
|
|
|
|
|
A.setAttribute("title",k.getAttribute("title"));y.removeAttribute("disabled");C.removeAttribute("disabled");K.removeAttribute("disabled");F.removeAttribute("disabled");null!=v&&v.isRestricted()||(a.editor.graph.isEnabled()&&J.removeAttribute("disabled"),D.removeAttribute("disabled"),B.removeAttribute("disabled"),H.removeAttribute("disabled"));mxUtils.setOpacity(y,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(K,60);mxUtils.setOpacity(F,60)}else E.style.display="none",E.innerHTML="",A.innerHTML="",
|
|
|
|
|
mxUtils.write(A,mxResources.get("errorLoadingFile"))},k=document.createElement("tr");k.style.borderBottom="1px solid lightGray";k.style.fontSize="12px";k.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):d.toDateString()===U?mxUtils.write(g,d.toLocaleTimeString()):mxUtils.write(g,d.toLocaleDateString()+" "+d.toLocaleTimeString());k.appendChild(g);k.setAttribute("title",d.toLocaleDateString()+
|
|
|
|
|
" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(k,"click",function(a){x!=b&&(p.stop(),null!=t&&(t.style.backgroundColor=""),x=b,t=k,t.style.backgroundColor="#ebf2f9",u=z=null,A.removeAttribute("title"),A.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",m.getModel().clear(),J.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),
|
|
|
|
|
y.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(y,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(K,20),mxUtils.setOpacity(F,20),p.spin(l),b.getXml(function(a){if(x==b)try{e(a)}catch(T){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+T.message)}},function(a){p.stop();
|
|
|
|
|
E.style.display="none";E.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(k,"dblclick",function(a){B.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);P.appendChild(k)}return k}(c[V]);null!=W&&V==c.length-1&&(M=W)}O.appendChild(P);g.appendChild(O)}else null==v||null==a.drive&&v.constructor==window.DriveFile||null==a.dropbox&&v.constructor==
|
|
|
|
|
window.DropboxFile?(l.style.display="none",I.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(l.style.display="none",I.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";I.appendChild(E);I.appendChild(y);I.appendChild(C);I.appendChild(F);I.appendChild(K);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(D),e.appendChild(H),
|
|
|
|
|
e.appendChild(J),e.appendChild(B)):(e.appendChild(D),e.appendChild(H),e.appendChild(J),e.appendChild(B),e.appendChild(g));d.appendChild(e);d.appendChild(I);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,e,g,l,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q);var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";
|
|
|
|
|
f.style.marginTop="10px";f.style.width="640px";f.style.top="46px";f.style.bottom="74px";f.style.overflow="hidden";mxEvent.disableContextMenu(f);n.appendChild(f);var k=new Graph(f);k.setEnabled(!1);k.setPanning(!0);k.panningHandler.ignoreCell=!0;k.panningHandler.useLeftButtonForPanning=!0;k.minFitScale=null;k.maxFitScale=null;k.centerZoom=!0;c=mxUtils.parseXml(b);var p=a.editor.extractGraphModel(c.documentElement,!0),v=0,t=null,x=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a&&
|
|
|
|
|
null!=t&&null!=t[v]?t[v].getAttribute("name"):"pagenumber"==a?v+1:x.apply(this,arguments)};k.getLinkForCell=function(){return null};c=mxUtils.button("",function(){k.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);b=mxUtils.button("",function(){k.zoomOut()});b.className="geSprite geSprite-zoomout";b.setAttribute("title",mxResources.get("zoomOut"));b.style.outline=
|
|
|
|
|
"none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);q=mxUtils.button("",function(){k.maxFitScale=8;k.fit(8);k.center()});q.className="geSprite geSprite-fit";q.setAttribute("title",mxResources.get("fit"));q.style.outline="none";q.style.border="none";q.style.margin="2px";mxUtils.setOpacity(q,60);var z=mxUtils.button("",function(){k.zoomActual();k.center()});z.className="geSprite geSprite-actualsize";z.setAttribute("title",mxResources.get("actualSize"));z.style.outline="none";
|
|
|
|
@ -7917,7 +7917,7 @@ d.appendChild(f);d.appendChild(k);b=document.createElement("div");b.className="g
|
|
|
|
|
n.style.paddingRight="20px",n.appendChild(x),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),x.checked=!0,x.defaultChecked=!0,mxEvent.addListener(n,"click",function(a){mxEvent.getSource(a)!=x&&(x.checked=!x.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(n.style.position="relative",n.style.top="-6px"),b.appendChild(n);n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=
|
|
|
|
|
[],c=0;c<v.length;c++){var f=v[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),x.checked,!0)});c.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),n=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";m=document.createElement("tr");z.style.width="100%";c=document.createElement("td");var e=document.createElement("td"),l=document.createElement("td"),u=mxUtils.bind(this,function(b,c,f){var d=document.createElement("input");
|
|
|
|
|
d.type="checkbox";z.appendChild(d);d.checked=a.sidebar.isEntryVisible(f);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");c.style.display="block";c.appendChild(d);c.appendChild(k);mxEvent.addListener(k,"click",function(a){d.checked=!d.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return d.checked?f:null}});m.appendChild(c);m.appendChild(e);m.appendChild(l);n.appendChild(m);z.appendChild(n);for(var v=[],y=0,g=0;g<b.length;g++)for(n=0;n<b[g].entries.length;n++)y++;
|
|
|
|
|
for(var C=[c,e,l],I=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];v.push(u(C[Math.floor(I/(y/3))],c.title,c.id));I++}})(b[g]);d.appendChild(z);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";x=document.createElement("input");isLocalStorage&&(x.setAttribute("type","checkbox"),x.checked=!0,x.defaultChecked=!0,b.appendChild(x),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),
|
|
|
|
|
for(var C=[c,e,l],K=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];v.push(u(C[Math.floor(K/(y/3))],c.title,c.id));K++}})(b[g]);d.appendChild(z);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";x=document.createElement("input");isLocalStorage&&(x.setAttribute("type","checkbox"),x.checked=!0,x.defaultChecked=!0,b.appendChild(x),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),
|
|
|
|
|
mxEvent.addListener(n,"click",function(a){x.checked=!x.checked;mxEvent.consume(a)}));d.appendChild(b);n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<v.length;c++){var f=v[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(0<b.length?b.join(";"):"",x.checked);a.hideDialog()});c.className="geBtn gePrimaryBtn";b=document.createElement("div");b.style.marginTop="26px";
|
|
|
|
|
b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(n),b.appendChild(c)):(b.appendChild(c),b.appendChild(n));d.appendChild(b);this.container=d},PluginsDialog=function(a){function c(){if(0==e.length)d.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{d.innerHTML="";for(var b=0;b<e.length;b++){var k=document.createElement("span");k.style.whiteSpace="nowrap";var p=document.createElement("span");p.className="geSprite geSprite-delete";p.style.position="relative";p.style.cursor=
|
|
|
|
|
"pointer";p.style.top="5px";p.style.marginRight="4px";p.style.display="inline-block";k.appendChild(p);mxUtils.write(k,e[b]);d.appendChild(k);mxUtils.br(d);mxEvent.addListener(p,"click",function(b){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[b]+'"?',function(){e.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var e=mxSettings.getPlugins().slice();b.appendChild(d);c();var g=mxUtils.button(mxResources.get("add"),
|
|
|
|
@ -7938,32 +7938,32 @@ q.appendChild(x);m.appendChild(n);m.appendChild(q);l.appendChild(m);m=document.c
|
|
|
|
|
mxResources.get("rotation")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=1==c.length?mxUtils.getValue(b.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";q.appendChild(u);m.appendChild(n);m.appendChild(q);l.appendChild(m);g.appendChild(l);e.appendChild(g);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";var y=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();
|
|
|
|
|
try{for(var d=0;d<c.length;d++){var e=b.getCellGeometry(c[d]);null!=e&&(e=e.clone(),b.isCellMovable(c[d])&&(e.relative=f.checked,0<mxUtils.trim(k.value).length&&(e.x=Number(k.value)),0<mxUtils.trim(p.value).length&&(e.y=Number(p.value)),0<mxUtils.trim(v.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.x=Number(v.value)),0<mxUtils.trim(t.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.y=Number(t.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(x.value).length&&(e.width=
|
|
|
|
|
Number(x.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),b.getModel().setGeometry(c[d],e));0<mxUtils.trim(u.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(u.value),[c[d]])}}finally{b.getModel().endUpdate()}});y.className="geBtn gePrimaryBtn";mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&y.click()});g=document.createElement("div");g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(y)):(g.appendChild(y),
|
|
|
|
|
g.appendChild(d));e.appendChild(g);this.container=e},LibraryDialog=function(a,c,b,d,e,g){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=v;)a=a.parentNode;var b=null;if(null!=a)for(var c=v.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function m(b,c,d,k,p,e,g,u,A){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==x[b]){var n=function(){D.innerHTML="";D.style.cursor="pointer";D.style.whiteSpace="nowrap";D.style.textOverflow=
|
|
|
|
|
"ellipsis";mxUtils.write(D,null!=F.title&&0<F.title.length?F.title:mxResources.get("untitled"));D.style.color=null==F.title||0==F.title.length?"#d0d0d0":""};v.style.backgroundImage="";t.style.display="none";var E=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=B;e*=B}E>q?(q=Math.round(100*q/E),E=100):(E=Math.round(100*E/q),q=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=
|
|
|
|
|
mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var G=document.createElement("img");G.setAttribute("src",C.convert(b));G.style.width=E+"px";G.style.height=q+"px";G.style.margin="10px";G.style.paddingBottom=Math.floor((100-q)/2)+"px";G.style.paddingLeft=Math.floor((100-E)/2)+"px";H.appendChild(G)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0<J.length&&
|
|
|
|
|
(a.sidebar.createThumb(J,100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var K=document.createElement("img");K.setAttribute("src",Editor.closeImage);K.setAttribute("border","0");K.setAttribute("title",mxResources.get("delete"));K.setAttribute("align","top");K.style.paddingTop="4px";K.style.position="absolute";K.style.marginLeft="-12px";K.style.zIndex="1";K.style.cursor="pointer";mxEvent.addListener(K,"dragstart",function(a){mxEvent.consume(a)});
|
|
|
|
|
(function(a,b,c){mxEvent.addListener(K,"click",function(d){x[b]=null;for(var k=0;k<f.length;k++)if(null!=f[k].data&&f[k].data==b||null!=f[k].xml&&null!=c&&f[k].xml==c.xml){f.splice(k,1);break}H.parentNode.removeChild(a);0==f.length&&(v.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(d)});mxEvent.addListener(K,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(K);H.style.marginBottom="30px";var D=document.createElement("div");D.style.position=
|
|
|
|
|
"absolute";D.style.boxSizing="border-box";D.style.bottom="-18px";D.style.left="10px";D.style.right="10px";D.style.backgroundColor="#ffffff";D.style.overflow="hidden";D.style.textAlign="center";var F=null;null!=b?(F={data:b,w:p,h:e,title:A},null!=u&&(F.aspect=u),x[b]=G,f.push(F)):null!=g&&(g.aspect="fixed",f.push(g),F=g);mxEvent.addListener(D,"keydown",function(a){13==a.keyCode&&null!=y&&(y(),y=null,mxEvent.consume(a))});n();H.appendChild(D);mxEvent.addListener(D,"mousedown",function(a){"true"!=D.getAttribute("contentEditable")&&
|
|
|
|
|
mxEvent.consume(a)});J=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,F.title||"",mxResources.get("ok"),function(a){null!=a&&(F.title=a,n())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=D.getAttribute("contentEditable")){null!=y&&(y(),y=null);if(null==F.title||0==F.title.length)D.innerHTML="";D.style.textOverflow="";D.style.whiteSpace=
|
|
|
|
|
"";D.style.cursor="text";D.style.color="";D.setAttribute("contentEditable","true");D.focus();document.execCommand("selectAll",!1,null);y=function(){D.removeAttribute("contentEditable");D.style.cursor="pointer";F.title=D.innerHTML;n()};mxEvent.consume(b)}};mxEvent.addListener(D,"click",J);mxEvent.addListener(H,"dblclick",J);v.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(K.style.visibility="hidden",D.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",
|
|
|
|
|
g.xml);z=l(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);K.style.visibility="";D.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==K.style.visibility&&(K.style.visibility="",D.style.visibility="");z=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else I||(I=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=
|
|
|
|
|
!1;try{if(a.spinner.stop(),E=mxUtils.parseXml(b),"mxlibrary"==E.documentElement.nodeName){q=JSON.parse(mxUtils.getTextContent(E.documentElement));if(null!=q&&0<q.length)for(var M=0;M<q.length;M++)null!=q[M].xml?m(null,null,0,0,0,0,q[M]):m(q[M].data,null,0,0,q[M].w,q[M].h,null,"fixed",q[M].title);p=!0}else if("mxfile"==E.documentElement.nodeName){for(var P=E.documentElement.getElementsByTagName("diagram"),M=0;M<P.length;M++){var q=mxUtils.getTextContent(P[M]),J=a.stringToCells(Graph.decompress(q)),
|
|
|
|
|
S=a.editor.graph.getBoundingBoxFromGeometry(J);m(null,null,0,0,0,0,{xml:q,w:S.width,h:S.height})}p=!0}}catch(ba){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}function n(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function q(b){b.stopPropagation();b.preventDefault();I=!1;u=l(b);if(null!=z)null!=u&&u<v.children.length?(f.splice(u>z?u-1:u,0,f.splice(z,1)[0]),v.insertBefore(v.children[z],v.children[u])):
|
|
|
|
|
(f.push(f.splice(z,1)[0]),v.appendChild(v.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,G(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){m(c,null,0,0,a.width,a.height);v.scrollTop=v.scrollHeight})}b.stopPropagation();b.preventDefault()}
|
|
|
|
|
g.appendChild(d));e.appendChild(g);this.container=e},LibraryDialog=function(a,c,b,d,e,g){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=v;)a=a.parentNode;var b=null;if(null!=a)for(var c=v.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function m(b,c,d,k,p,e,g,u,A){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==x[b]){var n=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow=
|
|
|
|
|
"ellipsis";mxUtils.write(I,null!=E.title&&0<E.title.length?E.title:mxResources.get("untitled"));I.style.color=null==E.title||0==E.title.length?"#d0d0d0":""};v.style.backgroundImage="";t.style.display="none";var D=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=B;e*=B}D>q?(q=Math.round(100*q/D),D=100):(D=Math.round(100*D/q),q=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=
|
|
|
|
|
mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var F=document.createElement("img");F.setAttribute("src",C.convert(b));F.style.width=D+"px";F.style.height=q+"px";F.style.margin="10px";F.style.paddingBottom=Math.floor((100-q)/2)+"px";F.style.paddingLeft=Math.floor((100-D)/2)+"px";H.appendChild(F)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0<J.length&&
|
|
|
|
|
(a.sidebar.createThumb(J,100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var G=document.createElement("img");G.setAttribute("src",Editor.closeImage);G.setAttribute("border","0");G.setAttribute("title",mxResources.get("delete"));G.setAttribute("align","top");G.style.paddingTop="4px";G.style.position="absolute";G.style.marginLeft="-12px";G.style.zIndex="1";G.style.cursor="pointer";mxEvent.addListener(G,"dragstart",function(a){mxEvent.consume(a)});
|
|
|
|
|
(function(a,b,c){mxEvent.addListener(G,"click",function(d){x[b]=null;for(var k=0;k<f.length;k++)if(null!=f[k].data&&f[k].data==b||null!=f[k].xml&&null!=c&&f[k].xml==c.xml){f.splice(k,1);break}H.parentNode.removeChild(a);0==f.length&&(v.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(d)});mxEvent.addListener(G,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(G);H.style.marginBottom="30px";var I=document.createElement("div");I.style.position=
|
|
|
|
|
"absolute";I.style.boxSizing="border-box";I.style.bottom="-18px";I.style.left="10px";I.style.right="10px";I.style.backgroundColor="#ffffff";I.style.overflow="hidden";I.style.textAlign="center";var E=null;null!=b?(E={data:b,w:p,h:e,title:A},null!=u&&(E.aspect=u),x[b]=F,f.push(E)):null!=g&&(g.aspect="fixed",f.push(g),E=g);mxEvent.addListener(I,"keydown",function(a){13==a.keyCode&&null!=y&&(y(),y=null,mxEvent.consume(a))});n();H.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&
|
|
|
|
|
mxEvent.consume(a)});J=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,E.title||"",mxResources.get("ok"),function(a){null!=a&&(E.title=a,n())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=I.getAttribute("contentEditable")){null!=y&&(y(),y=null);if(null==E.title||0==E.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace=
|
|
|
|
|
"";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable","true");I.focus();document.execCommand("selectAll",!1,null);y=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";E.title=I.innerHTML;n()};mxEvent.consume(b)}};mxEvent.addListener(I,"click",J);mxEvent.addListener(H,"dblclick",J);v.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(G.style.visibility="hidden",I.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",
|
|
|
|
|
g.xml);z=l(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);G.style.visibility="";I.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==G.style.visibility&&(G.style.visibility="",I.style.visibility="");z=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else K||(K=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=
|
|
|
|
|
!1;try{if(a.spinner.stop(),D=mxUtils.parseXml(b),"mxlibrary"==D.documentElement.nodeName){q=JSON.parse(mxUtils.getTextContent(D.documentElement));if(null!=q&&0<q.length)for(var M=0;M<q.length;M++)null!=q[M].xml?m(null,null,0,0,0,0,q[M]):m(q[M].data,null,0,0,q[M].w,q[M].h,null,"fixed",q[M].title);p=!0}else if("mxfile"==D.documentElement.nodeName){for(var O=D.documentElement.getElementsByTagName("diagram"),M=0;M<O.length;M++){var q=mxUtils.getTextContent(O[M]),J=a.stringToCells(Graph.decompress(q)),
|
|
|
|
|
S=a.editor.graph.getBoundingBoxFromGeometry(J);m(null,null,0,0,0,0,{xml:q,w:S.width,h:S.height})}p=!0}}catch(ba){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}function n(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function q(b){b.stopPropagation();b.preventDefault();K=!1;u=l(b);if(null!=z)null!=u&&u<v.children.length?(f.splice(u>z?u-1:u,0,f.splice(z,1)[0]),v.insertBefore(v.children[z],v.children[u])):
|
|
|
|
|
(f.push(f.splice(z,1)[0]),v.appendChild(v.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,F(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){m(c,null,0,0,a.width,a.height);v.scrollTop=v.scrollHeight})}b.stopPropagation();b.preventDefault()}
|
|
|
|
|
var f=[];b=document.createElement("div");b.style.height="100%";var k=document.createElement("div");k.style.whiteSpace="nowrap";k.style.height="40px";b.appendChild(k);mxUtils.write(k,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",c);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)};k.appendChild(p);var v=document.createElement("div");v.style.borderWidth="1px 0px 1px 0px";v.style.borderColor="#d3d3d3";v.style.borderStyle="solid";v.style.marginTop="6px";v.style.overflow="auto";v.style.height="340px";v.style.backgroundPosition="center center";v.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(v.style.backgroundImage="url('"+IMAGE_PATH+
|
|
|
|
|
"/droptarget.png')");var t=document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));b.appendChild(t);var x={},z=null,u=null,y=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=y&&(y(),y=null,mxEvent.consume(a))};mxEvent.addListener(v,"mousedown",c);mxEvent.addListener(v,"pointerdown",c);mxEvent.addListener(v,
|
|
|
|
|
"touchstart",c);var C=new mxUrlConverter,I=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],m(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(v,"dragleave",function(a){t.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==v||b==t){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var G=function(b){return function(c,f,d,k,p,e,g,u,y){null!=y&&(/(\.vsdx)($|\?)/i.test(y.name)||/(\.vssx)($|\?)/i.test(y.name))?a.importVisio(y,mxUtils.bind(this,function(c){a.spinner.stop();
|
|
|
|
|
"touchstart",c);var C=new mxUrlConverter,K=!1;if(null!=d)for(c=0;c<d.length;c++)k=d[c],m(k.data,null,0,0,k.w,k.h,k,k.aspect,k.title);mxEvent.addListener(v,"dragleave",function(a){t.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==v||b==t){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var F=function(b){return function(c,f,d,k,p,e,g,u,y){null!=y&&(/(\.vsdx)($|\?)/i.test(y.name)||/(\.vssx)($|\?)/i.test(y.name))?a.importVisio(y,mxUtils.bind(this,function(c){a.spinner.stop();
|
|
|
|
|
m(c,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," "))})):null!=y&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,y.name)?a.parseFile(y,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(m(c.responseText,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),v.scrollTop=v.scrollHeight))})):(m(c,f,d,k,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,
|
|
|
|
|
g.lastIndexOf(".")).replace(/_/g," ")),v.scrollTop=v.scrollHeight)}};mxEvent.addListener(v,"dragover",n);mxEvent.addListener(v,"drop",q);mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,"drop",q);b.appendChild(v);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);k=mxUtils.button(mxResources.get("export"),
|
|
|
|
|
function(){var b=a.createLibraryDataFromImages(f),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")});k.setAttribute("id","btnDownload");k.className="geBtn";d.appendChild(k);var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(A,
|
|
|
|
|
"change",function(b){I=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,d,k,p,e,g,u){G(b)(a,c,f,d,k,p,e,g,u);A.value=""});v.scrollTop=v.scrollHeight}),k=mxUtils.button(mxResources.get("import"),function(){null!=y&&(y(),y=null);A.click()}),k.setAttribute("id","btnAddImage"),k.className="geBtn",d.appendChild(k));k=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=y&&(y(),y=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){I=!1;if(null!=a){if("data:image/"==
|
|
|
|
|
"change",function(b){K=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,d,k,p,e,g,u){F(b)(a,c,f,d,k,p,e,g,u);A.value=""});v.scrollTop=v.scrollHeight}),k=mxUtils.button(mxResources.get("import"),function(){null!=y&&(y(),y=null);A.click()}),k.setAttribute("id","btnAddImage"),k.className="geBtn",d.appendChild(k));k=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=y&&(y(),y=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){K=!1;if(null!=a){if("data:image/"==
|
|
|
|
|
a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}m(a,null,0,0,b,c);v.scrollTop=v.scrollHeight}})});k.setAttribute("id","btnAddImageUrl");k.className="geBtn";d.appendChild(k);this.saveBtnClickHandler=function(b,c,f,d){a.saveLibrary(b,c,f,d)};k=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=y&&(y(),y=null);this.saveBtnClickHandler(p.value,f,e,g)}));k.setAttribute("id","btnSave");k.className="geBtn gePrimaryBtn";d.appendChild(k);
|
|
|
|
|
a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,e){d=null!=d?d:300;e=null!=e?e:120;var g,l,m=document.createElement("table"),n=document.createElement("tbody");m.style.cellPadding="4px";g=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,b);g.appendChild(l);n.appendChild(g);g=document.createElement("tr");l=document.createElement("td");var q=document.createElement("textarea");
|
|
|
|
|
q.style.outline="none";q.style.resize="none";q.style.width=d-200+"px";q.style.height=e+"px";this.textarea=q;this.init=function(){q.focus();q.scrollTop=0};l.appendChild(q);g.appendChild(l);l=document.createElement("td");b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=e+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);l.appendChild(b);var f=new Graph(b);f.setEnabled(!1);
|
|
|
|
|
var k=a.editor.graph.cloneCell(c);f.addCells([k]);b=f.view.getState(k);var p="";null!=b.shape&&null!=b.shape.stencil&&(p=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(q,p||"");b=f.getGraphBounds();e=Math.min(160/b.width,(e-40)/b.height);f.view.scaleAndTranslate(e,20/e-b.x,20/e-b.y);g.appendChild(l);n.appendChild(g);g=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");
|
|
|
|
|
e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&l.appendChild(e);a.isOffline()||(b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),b.className="geBtn",l.appendChild(b));var v=function(b,c,f){var d=q.value,k=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(k.documentElement),k=k.documentElement.getElementsByTagName("parsererror");if(null!=k&&0<k.length)a.showError(mxResources.get("error"),
|
|
|
|
|
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(f&&a.hideDialog(),k=!b.model.contains(c),!f||k||d!=p){d=Graph.compress(d);b.getModel().beginUpdate();try{if(k){var e=a.editor.graph.getInsertPoint();c.geometry.x=e.x;c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[c])}catch(I){throw I;}finally{b.getModel().endUpdate()}k&&b.setSelectionCell(c)}};b=mxUtils.button(mxResources.get("preview"),function(){v(f,k,!1)});b.className="geBtn";l.appendChild(b);
|
|
|
|
|
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(f&&a.hideDialog(),k=!b.model.contains(c),!f||k||d!=p){d=Graph.compress(d);b.getModel().beginUpdate();try{if(k){var e=a.editor.graph.getInsertPoint();c.geometry.x=e.x;c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[c])}catch(K){throw K;}finally{b.getModel().endUpdate()}k&&b.setSelectionCell(c)}};b=mxUtils.button(mxResources.get("preview"),function(){v(f,k,!1)});b.className="geBtn";l.appendChild(b);
|
|
|
|
|
b=mxUtils.button(mxResources.get("apply"),function(){v(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";l.appendChild(b);a.editor.cancelFirst||l.appendChild(e);g.appendChild(l);n.appendChild(g);m.appendChild(n);this.container=m},CustomDialog=function(a,c,b,d,e,g,l,m){var n=document.createElement("div");n.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=l&&c.appendChild(l);l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();
|
|
|
|
|
null!=d&&d()});l.className="geBtn";m&&(l.style.display="none");a.editor.cancelFirst&&c.appendChild(l);a.isOffline()||null==g||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(g)}),m.className="geBtn",c.appendChild(m));e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(l);n.appendChild(c);this.cancelBtn=l;this.okButton=e;this.container=n},TemplatesDialog=function(){var a=
|
|
|
|
|
'<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+
|
|
|
|
@ -7971,27 +7971,27 @@ mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNew
|
|
|
|
|
mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">🛈 '+
|
|
|
|
|
mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg";
|
|
|
|
|
var a=window.innerWidth,b=window.innerHeight,d=987,e=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<e&&(e=Math.max(.9*b,300),c.style.height=e+"px");this.width=d;this.height=e;this.container=c};
|
|
|
|
|
TemplatesDialog.prototype.init=function(a,c,b,d,e,g,l,m,n,q){function f(){null!=J&&(J.style.fontWeight="normal",J.style.textDecoration="none",J=null)}function k(a,b,c,f,d,k,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";G.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");G.querySelector("."+b).src="/images/"+c+"-sel.svg";G.querySelector("."+d).src="/images/"+
|
|
|
|
|
k+".svg";return!0}function p(a){function b(a){Y.removeChild(f);G.removeChild(c);Y.scrollTop=k}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";G.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
|
|
|
|
|
a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var k=Y.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);Y.appendChild(f);Y.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function v(a,b,c){if(null!=F){for(var f=F.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}F.className=f.join(" ")}null!=a?(F=a,F.className+=" "+b,D=c,O.className="geTempDlgCreateBtn"):(D=F=null,O.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
|
|
|
|
|
function t(b){if(null!=D){var f=D;D=null;O.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function x(a){a=a?"":"none";for(var b=G.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
|
|
|
|
|
a}function z(a,b,c){function f(){O.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));x(!b)}U.innerHTML="";v();M=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=
|
|
|
|
|
TemplatesDialog.prototype.init=function(a,c,b,d,e,g,l,m,n,q){function f(){null!=J&&(J.style.fontWeight="normal",J.style.textDecoration="none",J=null)}function k(a,b,c,f,d,k,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";F.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");F.querySelector("."+b).src="/images/"+c+"-sel.svg";F.querySelector("."+d).src="/images/"+
|
|
|
|
|
k+".svg";return!0}function p(a){function b(a){Y.removeChild(f);F.removeChild(c);Y.scrollTop=k}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";F.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
|
|
|
|
|
a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var k=Y.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);Y.appendChild(f);Y.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function v(a,b,c){if(null!=E){for(var f=E.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}E.className=f.join(" ")}null!=a?(E=a,E.className+=" "+b,G=c,Q.className="geTempDlgCreateBtn"):(G=E=null,Q.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
|
|
|
|
|
function t(b){if(null!=G){var f=G;G=null;Q.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function x(a){a=a?"":"none";for(var b=F.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
|
|
|
|
|
a}function z(a,b,c){function f(){Q.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));x(!b)}U.innerHTML="";v();M=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=
|
|
|
|
|
mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));k.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));k.appendChild(e);d.appendChild(k);U.appendChild(d)}for(k=0;k<a.length;k++){a[k].isExternal=!b;var g=a[k].url,e=mxUtils.htmlEntities(a[k].title),u=a[k].tooltip||a[k].title,y=a[k].imgUrl,l=mxUtils.htmlEntities(a[k].changedBy||""),A=mxUtils.htmlEntities(a[k].lastModifiedOn||
|
|
|
|
|
"");y||(y=TEMPLATE_PATH+"/"+g.substring(0,g.length-4)+".png");g=c?50:15;null!=e&&e.length>g&&(e=e.substring(0,g)+"…");if(c){var m=document.createElement("tr"),y=document.createElement("td"),n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramListPreviewBtn";n.setAttribute("title",mxResources.get("preview"));y.appendChild(n);u=document.createElement("span");u.className="geTempDlgDiagramTitle";u.innerHTML=e;y.appendChild(u);m.appendChild(y);y=document.createElement("td");
|
|
|
|
|
y.innerHTML=l;m.appendChild(y);y=document.createElement("td");y.innerHTML=A;m.appendChild(y);d.appendChild(m);null==F&&(f(),v(m,"geTempDlgDiagramsListGridActive",a[k]));(function(a,b){mxEvent.addListener(m,"click",function(){F!=b&&(f(),v(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(m,"dblclick",t);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],m)}else{var z=document.createElement("div");z.className="geTempDlgDiagramTile";z.setAttribute("title",u);null==F&&(f(),v(z,"geTempDlgDiagramTileActive",
|
|
|
|
|
y.innerHTML=l;m.appendChild(y);y=document.createElement("td");y.innerHTML=A;m.appendChild(y);d.appendChild(m);null==E&&(f(),v(m,"geTempDlgDiagramsListGridActive",a[k]));(function(a,b){mxEvent.addListener(m,"click",function(){E!=b&&(f(),v(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(m,"dblclick",t);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],m)}else{var z=document.createElement("div");z.className="geTempDlgDiagramTile";z.setAttribute("title",u);null==E&&(f(),v(z,"geTempDlgDiagramTileActive",
|
|
|
|
|
a[k]));l=document.createElement("div");l.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var C=document.createElement("img");C.style.display="none";(function(a,b){C.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};C.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(C,l);C.src=y;l.appendChild(C);z.appendChild(l);l=document.createElement("div");l.className="geTempDlgDiagramTileLbl";l.innerHTML=null!=e?e:"";z.appendChild(l);
|
|
|
|
|
n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));z.appendChild(n);(function(a,b){mxEvent.addListener(z,"click",function(){F!=b&&(f(),v(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(z,"dblclick",t);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],z);U.appendChild(z)}}}function u(a,b){Z.innerHTML="";v();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory=!0;
|
|
|
|
|
var k=document.createElement("div"),p=mxResources.get(d.title);null==p&&(p=d.title.substring(0,1).toUpperCase()+d.title.substring(1));k.className="geTempDlgNewDiagramCatItem";k.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"…");null==F&&(O.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),x(),v(k,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img");
|
|
|
|
|
g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);k.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;k.appendChild(e);Z.appendChild(k);(function(a,b){mxEvent.addListener(k,"click",function(){F!=b&&(O.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),x(),v(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",t)})(d,k)}Q.style.display=5>a.length?"none":""}function y(a){var b=G.querySelector(".geTemplatesList"),
|
|
|
|
|
n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));z.appendChild(n);(function(a,b){mxEvent.addListener(z,"click",function(){E!=b&&(f(),v(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(z,"dblclick",t);mxEvent.addListener(n,"click",function(){p(a)})})(a[k],z);U.appendChild(z)}}}function u(a,b){Z.innerHTML="";v();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory=!0;
|
|
|
|
|
var k=document.createElement("div"),p=mxResources.get(d.title);null==p&&(p=d.title.substring(0,1).toUpperCase()+d.title.substring(1));k.className="geTempDlgNewDiagramCatItem";k.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"…");null==E&&(Q.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),x(),v(k,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img");
|
|
|
|
|
g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);k.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;k.appendChild(e);Z.appendChild(k);(function(a,b){mxEvent.addListener(k,"click",function(){E!=b&&(Q.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),x(),v(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",t)})(d,k)}P.style.display=5>a.length?"none":""}function y(a){var b=F.querySelector(".geTemplatesList"),
|
|
|
|
|
c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),k=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",d+" ("+k.length+")");d=mxUtils.htmlEntities(d);15<d.length&&(d=d.substring(0,15)+"…");f.innerHTML=d+" ("+k.length+")";b.appendChild(f);(function(b,c,d){mxEvent.addListener(f,"click",function(){J!=d&&(null!=J?(J.style.fontWeight="normal",J.style.textDecoration="none"):(N.style.display="none",fa.style.minHeight=
|
|
|
|
|
"100%"),J=d,J.style.fontWeight="bold",J.style.textDecoration="underline",Y.scrollTop=0,A&&(E=!0),V.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,d,f)}}function C(a){l&&(Y.scrollTop=0,U.innerHTML="",R.spin(U),E=!1,A=!0,V.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),P=null,l(L,a?null:g))}function I(a){f();Y.scrollTop=0;U.innerHTML="";R.spin(U);E=!1;A=!0;ea=null;V.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+
|
|
|
|
|
mxUtils.htmlEntities(a)+'"';m(a,L,B?null:g);P=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";e=null!=e?e:NEW_DIAGRAM_CATS_PATH+"/index.xml";var G=this.container,A=!1,E=!1,J=null,F=null,D=null,H=!1,B=!0,K=!1,M=[],P,Q=G.querySelector(".geTempDlgShowAllBtn"),U=G.querySelector(".geTempDlgDiagramsTiles"),V=G.querySelector(".geTempDlgDiagramsListTitle"),W=G.querySelector(".geTempDlgDiagramsListBtns"),Y=G.querySelector(".geTempDlgContent"),fa=G.querySelector(".geTempDlgDiagramsList"),N=G.querySelector(".geTempDlgNewDiagramCat"),
|
|
|
|
|
Z=G.querySelector(".geTempDlgNewDiagramCatList"),O=G.querySelector(".geTempDlgCreateBtn"),R=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(G.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();N.style.display="";fa.style.minHeight="calc(100% - 280px)";C(B)});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
|
|
|
|
|
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(B=!0,null==P?C(B):I(P))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(B=!1,null==P?C(B):I(P))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
|
|
|
|
|
"tiles",!1)&&(K=!0,z(M,!1,K))});mxEvent.addListener(G.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(M,!1,K))});mxEvent.addListener(Q,"click",function(){H?(N.style.height="280px",Z.style.height="190px",Q.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),u(ba)):(N.style.height="440px",Z.style.height="355px",Q.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
|
|
|
|
|
"100%"),J=d,J.style.fontWeight="bold",J.style.textDecoration="underline",Y.scrollTop=0,A&&(D=!0),V.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,d,f)}}function C(a){l&&(Y.scrollTop=0,U.innerHTML="",R.spin(U),D=!1,A=!0,V.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),O=null,l(L,a?null:g))}function K(a){f();Y.scrollTop=0;U.innerHTML="";R.spin(U);D=!1;A=!0;ea=null;V.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+' "'+
|
|
|
|
|
mxUtils.htmlEntities(a)+'"';m(a,L,B?null:g);O=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";e=null!=e?e:NEW_DIAGRAM_CATS_PATH+"/index.xml";var F=this.container,A=!1,D=!1,J=null,E=null,G=null,H=!1,B=!0,I=!1,M=[],O,P=F.querySelector(".geTempDlgShowAllBtn"),U=F.querySelector(".geTempDlgDiagramsTiles"),V=F.querySelector(".geTempDlgDiagramsListTitle"),W=F.querySelector(".geTempDlgDiagramsListBtns"),Y=F.querySelector(".geTempDlgContent"),fa=F.querySelector(".geTempDlgDiagramsList"),N=F.querySelector(".geTempDlgNewDiagramCat"),
|
|
|
|
|
Z=F.querySelector(".geTempDlgNewDiagramCatList"),Q=F.querySelector(".geTempDlgCreateBtn"),R=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(F.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();N.style.display="";fa.style.minHeight="calc(100% - 280px)";C(B)});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){k(this,"geTempDlgAllDiagramsBtnImg",
|
|
|
|
|
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(B=!0,null==O?C(B):K(O))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){k(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(B=!1,null==O?C(B):K(O))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){k(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
|
|
|
|
|
"tiles",!1)&&(I=!0,z(M,!1,I))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){k(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(I=!1,z(M,!1,I))});mxEvent.addListener(P,"click",function(){H?(N.style.height="280px",Z.style.height="190px",P.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),u(ba)):(N.style.height="440px",Z.style.height="355px",P.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
|
|
|
|
|
null,"- Show less")),u(ba,!0));H=!H});var aa=!1,T=!1,S={},ba=[],ga=1;mxUtils.get(d,function(a){if(!aa){aa=!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=S[b];null==c&&(ga++,c=[],S[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=a.nextSibling}y(S)}});mxUtils.get(e,
|
|
|
|
|
function(a){if(!T){T=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ba.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;u(ba)}});var L=function(a,b){W.style.display="";R.stop();A=!1;E?E=!1:b?U.innerHTML=b:0==a.length?U.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):z(a,!1,K)};C(B);var ea=null;m&&mxEvent.addListener(G.querySelector(".geTempDlgSearchBox"),
|
|
|
|
|
"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?I(b.value):ea=setTimeout(function(){I(b.value)},500)});mxEvent.addListener(O,"click",t);mxEvent.addListener(G.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(G.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
|
|
|
|
|
function(a){if(!T){T=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ba.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;u(ba)}});var L=function(a,b){W.style.display="";R.stop();A=!1;D?D=!1:b?U.innerHTML=b:0==a.length?U.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):z(a,!1,I)};C(B);var ea=null;m&&mxEvent.addListener(F.querySelector(".geTempDlgSearchBox"),
|
|
|
|
|
"keyup",function(a){var b=this;null!=ea&&clearTimeout(ea);13==a.keyCode?K(b.value):ea=setTimeout(function(){K(b.value)},500)});mxEvent.addListener(Q,"click",t);mxEvent.addListener(F.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(F.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})};
|
|
|
|
|
var BtnDialog=function(a,c,b,d){var e=document.createElement("div");e.style.textAlign="center";var g=document.createElement("p");g.style.fontSize="16pt";g.style.padding="0px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("done"));var l="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
|
|
|
|
|
(l=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.trello&&(l=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[l],"You are now authorized in {1}"));b=mxUtils.button(b,d);b.insertBefore(m,b.firstChild);
|
|
|
|
|
b.style.marginTop="6px";b.className="geBigButton";e.appendChild(g);e.appendChild(a);e.appendChild(b);this.container=e};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];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":
|
|
|
|
@ -8026,7 +8026,7 @@ b.getElementsByTagName("parsererror");if(null!=c&&0<c.length){var c=c[0],f=c.get
|
|
|
|
|
else if(f=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=f){var d=new mxCodec(f.ownerDocument);d.decode(f,this.graph.getStylesheet())}this.graph.currentStyle=c;this.graph.mathEnabled="1"==urlParams.math||"1"==b.getAttribute("math");c=b.getAttribute("backgroundImage");null!=c?(c=JSON.parse(c),this.graph.setBackgroundImage(new mxImage(c.src,c.width,c.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
|
|
|
|
|
!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==b.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var c=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var b=c.apply(this,
|
|
|
|
|
arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&b.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&b.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));b.setAttribute("math",this.graph.mathEnabled?"1":"0");b.setAttribute("shadow",this.graph.shadowVisible?"1":"0");return b};Editor.prototype.isDataSvg=function(a){try{var b=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=b&&(null!=b&&"<"!=
|
|
|
|
|
b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(F){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=c&&0<c.length)for(var d=0;d<c.length;d++)if("mxgraph"==c[d].getAttribute("class")){f.push(c[d]);
|
|
|
|
|
b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b)),null!=b&&0<b.length)){var c=mxUtils.parseXml(b).documentElement;return"mxfile"==c.nodeName||"mxGraphModel"==c.nodeName}}catch(E){}return!1};Editor.prototype.extractGraphModel=function(a,b){if(null!=a&&"undefined"!==typeof pako){var c=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=c&&0<c.length)for(var d=0;d<c.length;d++)if("mxgraph"==c[d].getAttribute("class")){f.push(c[d]);
|
|
|
|
|
break}0<f.length&&(c=f[0].getAttribute("data-mxgraph"),null!=c?(f=JSON.parse(c),null!=f&&null!=f.xml&&(f=mxUtils.parseXml(f.xml),a=f.documentElement)):(f=f[0].getElementsByTagName("div"),0<f.length&&(c=mxUtils.getTextContent(f[0]),c=Graph.decompress(c),0<c.length&&(f=mxUtils.parseXml(c),a=f.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(c=a.getAttribute("content"),null!=c&&"<"!=c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&
|
|
|
|
|
(c=decodeURIComponent(c)),null!=c&&0<c.length)a=mxUtils.parseXml(c).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||b||(f=null,"diagram"==a.nodeName?f=a:"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),0<c.length&&(f=c[Math.max(0,Math.min(c.length-1,urlParams.page||0))])),null!=f&&(c=Graph.decompress(mxUtils.getTextContent(f)),null!=c&&0<c.length&&(a=mxUtils.parseXml(c).documentElement)));null==a||"mxGraphModel"==a.nodeName||b&&"mxfile"==a.nodeName||(a=null);
|
|
|
|
|
return a};var b=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();b.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=
|
|
|
|
@ -8048,7 +8048,7 @@ if("svg"==g||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==g||"embed
|
|
|
|
|
(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){d[a]=b;f--;k()}),mxUtils.bind(this,function(a){f--;k()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[p].substring(0,e)),g)}}else a()};Editor.prototype.convertMath=function(a,b,c,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=
|
|
|
|
|
function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,b,c,f,d,k,p,e,g,u,y,t,v,l){k=null!=k?k:!0;t=null!=t?t:this.graph;v=null!=v?v:0;var x=g?null:t.background;x==mxConstants.NONE&&(x=null);null==x&&(x=f);null==x&&0==g&&(x=this.graph.defaultPageBackgroundColor);this.convertImages(t.getSvg(x,null,null,l,null,null!=p?p:!0,null,null,null,u),mxUtils.bind(this,function(c){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var p=
|
|
|
|
|
document.createElement("canvas"),g=parseInt(c.getAttribute("width")),u=parseInt(c.getAttribute("height"));e=null!=e?e:1;null!=b&&(e=k?Math.min(1,Math.min(3*b/(4*u),b/g)):b/g);g=Math.ceil(e*g)+2*v;u=Math.ceil(e*u)+2*v;p.setAttribute("width",g);p.setAttribute("height",u);var y=p.getContext("2d");null!=x&&(y.beginPath(),y.rect(0,0,g,u),y.fillStyle=x,y.fill());y.scale(e,e);mxClient.IS_SF?window.setTimeout(function(){y.drawImage(f,v/e,v/e);a(p)},0):(y.drawImage(f,v/e,v/e),a(p))}catch(S){null!=d&&d(S)}});
|
|
|
|
|
f.onerror=function(a){null!=d&&d(a)};try{u&&this.graph.addSvgShadow(c);var p=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(t,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(p)}catch(O){null!=d&&d(O)}}),c,y)};Editor.prototype.writeGraphModelToPng=function(a,b,c,f,
|
|
|
|
|
f.onerror=function(a){null!=d&&d(a)};try{u&&this.graph.addSvgShadow(c);var p=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(t,c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(p)}catch(Q){null!=d&&d(Q)}}),c,y)};Editor.prototype.writeGraphModelToPng=function(a,b,c,f,
|
|
|
|
|
d){function k(a,b){var c=g;g+=b;return a.substring(c,g)}function p(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function e(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var g=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(k(a,4),"IHDR"!=k(a,4))null!=d&&d();else{k(a,17);d=a.substring(0,g);do{var u=p(a);
|
|
|
|
|
if("IDAT"==k(a,4)){d=a.substring(0,g-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+f;f=4294967295;f=EditorUi.prototype.updateCRC(f,b,0,4);f=EditorUi.prototype.updateCRC(f,c,0,c.length);d+=e(c.length)+b+c+e(f^4294967295);d+=a.substring(g-8,a.length);break}d+=a.substring(g-8,g-4+u);k(a,u);k(a,4)}while(u);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";
|
|
|
|
|
var e=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,b){e.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var g=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){g.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(a,b){var c=null;null!=a.editor.graph.getModel().getParent(b)?c=b.getId():null!=a.currentPage&&
|
|
|
|
@ -8094,7 +8094,7 @@ p.value,a=0==a.length&&"string"!=x?0:a;u.allowAuto&&("auto"==a.trim().toLowerCas
|
|
|
|
|
a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&k()});p.focus();mxEvent.addListener(p,"blur",function(){k()})})));u.isDeletable&&(v=mxUtils.button("-",mxUtils.bind(y,function(a){f(b,"",u,u.index);mxEvent.consume(a)})),v.style.height="16px",v.style.width="25px",v.style["float"]="right",v.className="geColorBtn",n.appendChild(v));m.appendChild(n);return m}var y=this,t=this.editorUi.editor.graph,v=[];a.style.position="relative";a.style.padding="0";var l=document.createElement("table");
|
|
|
|
|
l.style.whiteSpace="nowrap";l.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;m.appendChild(n);mxUtils.write(m,mxResources.get("property"));x.style.cursor="pointer";var A=function(){var b=l.querySelectorAll(".gePropNonHeaderRow"),c;if(y.editorUi.propertiesCollapsed){n.src=Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-
|
|
|
|
|
1;0<=f;f--)try{var d=a.childNodes[f],k=d.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(d)}catch(da){}}else n.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(x,"click",function(){y.editorUi.propertiesCollapsed=!y.editorUi.propertiesCollapsed;A()});x.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");x.appendChild(m);l.appendChild(x);var z=!1,C=!1,q;for(q in b)if(x=
|
|
|
|
|
b[q],"function"!=typeof x.isVisible||x.isVisible(c)){var I=null!=c.style[q]?mxUtils.htmlEntities(c.style[q]+""):x.defVal;if("separator"==x.type)C=!C;else{if("staticArr"==x.type)x.size=parseInt(c.style[x.sizeProperty]||b[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var G=x.dependentProps,E=[],J=[],m=0;m<G.length;m++){var L=c.style[G[m]];J.push(b[G[m]].subDefVal);E.push(null!=L?L.split(","):[])}x.dependentPropsDefVal=J;x.dependentPropsVals=E}l.appendChild(u(q,I,x,z,C));z=!z}}for(m=
|
|
|
|
|
b[q],"function"!=typeof x.isVisible||x.isVisible(c)){var K=null!=c.style[q]?mxUtils.htmlEntities(c.style[q]+""):x.defVal;if("separator"==x.type)C=!C;else{if("staticArr"==x.type)x.size=parseInt(c.style[x.sizeProperty]||b[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var F=x.dependentProps,D=[],J=[],m=0;m<F.length;m++){var L=c.style[F[m]];J.push(b[F[m]].subDefVal);D.push(null!=L?L.split(","):[])}x.dependentPropsDefVal=J;x.dependentPropsVals=D}l.appendChild(u(q,K,x,z,C));z=!z}}for(m=
|
|
|
|
|
0;m<v.length;m++)for(x=v[m],b=x.parentRow,c=0;c<x.values.length;c++)q=u(x.name,x.values[c],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:c,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==c%2,x.flipBkg),b.parentNode.insertBefore(q,b.nextSibling),b=q;a.appendChild(l);A();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var d=
|
|
|
|
|
f.getModel().getStyle(c[b]),p=0;p<k.length;p++)d=mxUtils.removeStylename(d,k[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,
|
|
|
|
|
null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,
|
|
|
|
@ -8140,25 +8140,25 @@ Math.max(1,Math.min(e,Math.min(parseInt(l.value),parseInt(v.value))))}function f
|
|
|
|
|
(k=b.getPageLayout(),p-=k.x*g.width,e-=k.y*g.height):y=!0;if(null==c){c=PrintDialog.createPrintPreview(b,u,g,0,p,e,y);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var v=c.writeHead;c.writeHead=function(b){v.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 l=c.renderPage;c.renderPage=function(a,b,c,f,d,k){var p=mxClient.NO_FO;mxClient.NO_FO=
|
|
|
|
|
this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=l.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,d,!0)}else{g=b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=y;c.appendGraph(b,u,p,e,d,!0)}return c}var f=parseInt(ca.value)/100;isNaN(f)&&(f=1,ca.value="100 %");var f=.75*f,k=v.value,p=l.value,e=!y.checked,
|
|
|
|
|
u=null;e&&(e=k==g&&p==g);if(!e&&null!=a.pages&&a.pages.length){var t=0,e=a.pages.length-1;y.checked||(t=parseInt(k)-1,e=parseInt(p)-1);for(var x=t;x<=e;x++){var m=a.pages[x],k=m==a.currentPage?d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),p=!0,t=!1,C=null,q=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(p=m.viewState.pageVisible,t=m.viewState.mathEnabled,C=m.viewState.background,q=m.viewState.backgroundImage);k.background=C;k.backgroundImage=null!=
|
|
|
|
|
q?new mxImage(q.src,q.width,q.height):null;k.pageVisible=p;k.mathEnabled=t;var I=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?x+1:I.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);k.model.setRoot(m.root)}u=c(k,u,x!=e);k!=d&&k.container.parentNode.removeChild(k.container)}}else u=c(d);null==u?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(u.mathEnabled&&(e=u.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),
|
|
|
|
|
q?new mxImage(q.src,q.width,q.height):null;k.pageVisible=p;k.mathEnabled=t;var K=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?x+1:K.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);k.model.setRoot(m.root)}u=c(k,u,x!=e);k!=d&&k.container.parentNode.removeChild(k.container)}}else u=c(d);null==u?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(u.mathEnabled&&(e=u.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),
|
|
|
|
|
e.writeln("MathJax.Hub.Config({"),e.writeln("showMathMenu: false,"),e.writeln('messageStyle: "none",'),e.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),e.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),e.writeln('"HTML-CSS": {'),e.writeln("imageFont: null"),e.writeln("},"),e.writeln("TeX: {"),e.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),e.writeln("},"),e.writeln("tex2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),
|
|
|
|
|
e.writeln("},"),e.writeln("asciimath2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("}"),e.writeln("});"),b&&(e.writeln("MathJax.Hub.Queue(function () {"),e.writeln("window.print();"),e.writeln("});")),e.writeln("\x3c/script>"),e.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),u.closeDocument(),!u.mathEnabled&&b&&PrintDialog.printPreview(u))}var d=a.editor.graph,k=document.createElement("div"),p=document.createElement("h3");
|
|
|
|
|
p.style.width="100%";p.style.textAlign="center";p.style.marginTop="0px";mxUtils.write(p,b||mxResources.get("print"));k.appendChild(p);var e=1,g=1,u=document.createElement("div");u.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var y=document.createElement("input");y.style.cssText="margin-right:8px;margin-bottom:8px;";y.setAttribute("value","all");y.setAttribute("type","radio");y.setAttribute("name","pages-printdialog");u.appendChild(y);p=document.createElement("span");
|
|
|
|
|
mxUtils.write(p,mxResources.get("printAllPages"));u.appendChild(p);mxUtils.br(u);var t=y.cloneNode(!0);y.setAttribute("checked","checked");t.setAttribute("value","range");u.appendChild(t);p=document.createElement("span");mxUtils.write(p,mxResources.get("pages")+":");u.appendChild(p);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","1");v.setAttribute("type","number");v.setAttribute("min","1");v.style.width="50px";u.appendChild(v);p=document.createElement("span");
|
|
|
|
|
mxUtils.write(p,mxResources.get("to"));u.appendChild(p);var l=v.cloneNode(!0);u.appendChild(l);mxEvent.addListener(v,"focus",function(){t.checked=!0});mxEvent.addListener(l,"focus",function(){t.checked=!0});mxEvent.addListener(v,"change",c);mxEvent.addListener(l,"change",c);if(null!=a.pages&&(e=a.pages.length,null!=a.currentPage))for(p=0;p<a.pages.length;p++)if(a.currentPage==a.pages[p]){g=p+1;v.value=g;l.value=g;break}v.setAttribute("max",e);l.setAttribute("max",e);1<e&&k.appendChild(u);var x=document.createElement("div");
|
|
|
|
|
x.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");x.appendChild(m);p=document.createElement("span");mxUtils.write(p,mxResources.get("adjustTo"));x.appendChild(p);var n=document.createElement("input");n.style.cssText="margin:0 8px 0 8px;";n.setAttribute("value","100 %");n.style.width="50px";x.appendChild(n);mxEvent.addListener(n,"focus",function(){m.checked=!0});
|
|
|
|
|
k.appendChild(x);var u=u.cloneNode(!1),z=m.cloneNode(!0);z.setAttribute("value","fit");m.setAttribute("checked","checked");p=document.createElement("div");p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";p.appendChild(z);u.appendChild(p);x=document.createElement("table");x.style.display="inline-block";var C=document.createElement("tbody"),q=document.createElement("tr"),I=q.cloneNode(!0),A=document.createElement("td"),G=A.cloneNode(!0),E=A.cloneNode(!0),ga=A.cloneNode(!0),
|
|
|
|
|
L=A.cloneNode(!0),ea=A.cloneNode(!0);A.style.textAlign="right";ga.style.textAlign="right";mxUtils.write(A,mxResources.get("fitTo"));var X=document.createElement("input");X.style.cssText="margin:0 8px 0 8px;";X.setAttribute("value","1");X.setAttribute("min","1");X.setAttribute("type","number");X.style.width="40px";G.appendChild(X);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));E.appendChild(p);mxUtils.write(ga,mxResources.get("fitToBy"));var ia=X.cloneNode(!0);
|
|
|
|
|
L.appendChild(ia);mxEvent.addListener(X,"focus",function(){z.checked=!0});mxEvent.addListener(ia,"focus",function(){z.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));ea.appendChild(p);q.appendChild(A);q.appendChild(G);q.appendChild(E);I.appendChild(ga);I.appendChild(L);I.appendChild(ea);C.appendChild(q);C.appendChild(I);x.appendChild(C);u.appendChild(x);k.appendChild(u);u=document.createElement("div");p=document.createElement("div");p.style.fontWeight=
|
|
|
|
|
k.appendChild(x);var u=u.cloneNode(!1),z=m.cloneNode(!0);z.setAttribute("value","fit");m.setAttribute("checked","checked");p=document.createElement("div");p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";p.appendChild(z);u.appendChild(p);x=document.createElement("table");x.style.display="inline-block";var C=document.createElement("tbody"),q=document.createElement("tr"),K=q.cloneNode(!0),A=document.createElement("td"),F=A.cloneNode(!0),D=A.cloneNode(!0),ga=A.cloneNode(!0),
|
|
|
|
|
L=A.cloneNode(!0),ea=A.cloneNode(!0);A.style.textAlign="right";ga.style.textAlign="right";mxUtils.write(A,mxResources.get("fitTo"));var X=document.createElement("input");X.style.cssText="margin:0 8px 0 8px;";X.setAttribute("value","1");X.setAttribute("min","1");X.setAttribute("type","number");X.style.width="40px";F.appendChild(X);p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsAcross"));D.appendChild(p);mxUtils.write(ga,mxResources.get("fitToBy"));var ia=X.cloneNode(!0);
|
|
|
|
|
L.appendChild(ia);mxEvent.addListener(X,"focus",function(){z.checked=!0});mxEvent.addListener(ia,"focus",function(){z.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));ea.appendChild(p);q.appendChild(A);q.appendChild(F);q.appendChild(D);K.appendChild(ga);K.appendChild(L);K.appendChild(ea);C.appendChild(q);C.appendChild(K);x.appendChild(C);u.appendChild(x);k.appendChild(u);u=document.createElement("div");p=document.createElement("div");p.style.fontWeight=
|
|
|
|
|
"bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));u.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(p,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);u.appendChild(p);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageScale"));u.appendChild(p);var ca=document.createElement("input");ca.style.cssText="margin:0 8px 0 8px;";ca.setAttribute("value","100 %");
|
|
|
|
|
ca.style.width="60px";u.appendChild(ca);k.appendChild(u);p=document.createElement("div");p.style.cssText="text-align:right;margin:48px 0 0 0;";u=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});u.className="geBtn";a.editor.cancelFirst&&p.appendChild(u);a.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",p.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),
|
|
|
|
|
function(){a.hideDialog();f(!1)}),x.className="geBtn",p.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});x.className="geBtn gePrimaryBtn";p.appendChild(x);a.editor.cancelFirst||p.appendChild(u);k.appendChild(p);this.container=k};var C=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)):(C.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))};Editor.prototype.useCanvasForExport=!1;try{var I=document.createElement("canvas"),G=new Image;G.onload=function(){try{I.getContext("2d").drawImage(G,0,0);var a=I.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(E){}};G.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(A){}})();
|
|
|
|
|
null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var K=document.createElement("canvas"),F=new Image;F.onload=function(){try{K.getContext("2d").drawImage(F,0,0);var a=K.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(D){}};F.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(A){}})();
|
|
|
|
|
var ErrorDialog=function(a,c,b,d,e,g,l,m,n,q,f){n=null!=n?n:!0;var k=document.createElement("div");k.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="10px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";p.style.whiteSpace="nowrap";p.style.textOverflow="ellipsis";p.style.overflow="hidden";mxUtils.write(p,c);p.setAttribute("title",c);k.appendChild(p)}c=
|
|
|
|
|
document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;k.appendChild(c);b=document.createElement("div");b.style.marginTop="12px";b.style.textAlign="center";null!=g&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=q&&(q=mxUtils.button(q,function(){null!=f&&f()}),q.className="geBtn",b.appendChild(q));var v=mxUtils.button(d,function(){n&&a.hideDialog();null!=e&&e()});
|
|
|
|
|
v.className="geBtn";b.appendChild(v);null!=l&&(d=mxUtils.button(l,function(){n&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn",b.appendChild(d));this.init=function(){v.focus()};k.appendChild(b);this.container=k};
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.3.5";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.3.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=
|
|
|
|
|
EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",k=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=k+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+
|
|
|
|
|
encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+encodeURIComponent(e.stack):"")}}catch(u){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):
|
|
|
|
|
"")}catch(p){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(p){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
|
|
|
|
@ -8170,9 +8170,9 @@ EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0"
|
|
|
|
|
b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(t){}})();EditorUi.prototype.openLink=function(a,b,c){return this.editor.graph.openLink(a,b,c)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);null!=c&&c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=
|
|
|
|
|
function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||
|
|
|
|
|
"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var f=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),d=f.spin;f.spin=function(c,k){var p=!1;this.active||(d.call(this,c),this.active=!0,null!=k&&(p=document.createElement("div"),p.style.position="absolute",p.style.whiteSpace="nowrap",p.style.background="#4B4243",p.style.color="white",
|
|
|
|
|
p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6px",p.style.paddingLeft="10px",p.style.paddingRight="10px",p.style.zIndex=2E9,p.style.left=Math.max(0,a)+"px",p.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(p.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(p.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=k.substring(k.length-3,k.length)&&(k+="..."),p.innerHTML=k,c.appendChild(p),
|
|
|
|
|
f.status=p,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(p.style.left=Math.round(Math.max(0,a-p.offsetWidth/2))+"px",p.style.top=Math.round(Math.max(0,b+70-p.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,k)}));this.stop();return a}),p=!0);return p};var k=f.stop;f.stop=function(){k.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),f.status=null)};
|
|
|
|
|
f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=d(a);var p=f(a,4);if(null!=b&&b(k-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)break}while(c)}};
|
|
|
|
|
p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6px",p.style.paddingLeft="10px",p.style.paddingRight="10px",p.style.zIndex=2E9,p.style.left=Math.max(0,a)+"px",p.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(p.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(p.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=k.substring(k.length-3,k.length)&&"!"!=k.charAt(k.length-1)&&
|
|
|
|
|
(k+="..."),p.innerHTML=k,c.appendChild(p),f.status=p,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(p.style.left=Math.round(Math.max(0,a-p.offsetWidth/2))+"px",p.style.top=Math.round(Math.max(0,b+70-p.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,k)}));this.stop();return a}),p=!0);return p};var k=f.stop;f.stop=function(){k.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),
|
|
|
|
|
f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=d(a);var p=f(a,4);if(null!=b&&b(k-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)break}while(c)}};
|
|
|
|
|
EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(v){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("<mxfile ");if(0<=f){var d=b.lastIndexOf("</mxfile>");d>f&&(c=b.substring(f,d+15).replace(/>/g,">").replace(/</g,
|
|
|
|
|
"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}catch(z){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=
|
|
|
|
|
function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,f=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<f.length||1==f.length&&f[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=f.length-1;0<=d;d--){var e=this.updatePageRoot(new DiagramPage(f[d]));
|
|
|
|
@ -8200,15 +8200,15 @@ b=b[0].getElementsByTagName("div"),0<b.length&&(a=mxUtils.getTextContent(b[0])),
|
|
|
|
|
null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var b=this.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||/(\.html)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.png)$/i.test(b)||/(\.drawio)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&
|
|
|
|
|
(b=b+"-"+this.currentPage.getName());return b};EditorUi.prototype.downloadFile=function(a,b,c,d,e,g,l){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),k=f+"."+a;if("xml"==a){var p='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(k,a,p,"text/xml")}else if("html"==a)p=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(k,a,p,"text/html");else if("svg"!=
|
|
|
|
|
a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=f+".png":"jpeg"==a&&(k=f+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(b,c){try{var f=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(b,a,d,c,l,e);this.editor.graph.pageVisible=f;return k}catch(B){this.handleError(B)}}));else{var t=null,v=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
|
|
|
|
|
mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});if("svg"==a){var x=this.editor.graph.background;if(l||x==mxConstants.NONE)x=null;var m=this.editor.graph.getSvg(x,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(m);this.convertImages(m,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();v('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=
|
|
|
|
|
mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});if("svg"==a){var m=this.editor.graph.background;if(l||m==mxConstants.NONE)m=null;var x=this.editor.graph.getSvg(m,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(x);this.convertImages(x,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();v('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=
|
|
|
|
|
f+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();v(a)}),d)}}catch(J){this.handleError(J)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e,g){var f=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var k="",p="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&
|
|
|
|
|
null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){k="&from="+g;break}g=this.editor.graph.background;"png"==b&&e&&(g=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+k+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,
|
|
|
|
|
f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?
|
|
|
|
|
parseInt(a.interval):6E4,e=null,p=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(p,
|
|
|
|
|
k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();p()}));g();p()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||f.warningImage,a.tooltip,a.align,a.valign,
|
|
|
|
|
a.offset);b.addListener(mxEvent.CLICK,function(b,c){d.alert(a.tooltip)});return b}var c=null,d=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,e=f.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var u=e.getCell(a.getAttribute("id"));if(null!=u){try{var y=a.getAttribute("value");if(null!=y){var l=mxUtils.parseXml(y).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))e.setValue(u,
|
|
|
|
|
l);else for(var m=l.attributes,n=0;n<m.length;n++)f.setAttributeForCell(u,m[n].nodeName,0<m[n].nodeValue.length?m[n].nodeValue:null)}}catch(K){null!=window.console&&console.log("Error in value for "+u.id+": "+K)}try{var q=a.getAttribute("style");null!=q&&f.model.setStyle(u,q)}catch(K){null!=window.console&&console.log("Error in style for "+u.id+": "+K)}try{var E=a.getAttribute("icon");if(null!=E){var J=0<E.length?JSON.parse(E):null;null!=J&&J.append||f.removeCellOverlays(u);null!=J&&f.addCellOverlay(u,
|
|
|
|
|
b(J))}}catch(K){null!=window.console&&console.log("Error in icon for "+u.id+": "+K)}try{var F=a.getAttribute("geometry");if(null!=F){var F=JSON.parse(F),D=f.getCellGeometry(u);if(null!=D){D=D.clone();for(key in F){var H=parseFloat(F[key]);"dx"==key?D.x+=H:"dy"==key?D.y+=H:"dw"==key?D.width+=H:"dh"==key?D.height+=H:D[key]=parseFloat(F[key])}f.model.setGeometry(u,D)}}}catch(K){null!=window.console&&console.log("Error in icon for "+u.id+": "+K)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=
|
|
|
|
|
l);else for(var m=l.attributes,n=0;n<m.length;n++)f.setAttributeForCell(u,m[n].nodeName,0<m[n].nodeValue.length?m[n].nodeValue:null)}}catch(I){null!=window.console&&console.log("Error in value for "+u.id+": "+I)}try{var q=a.getAttribute("style");null!=q&&f.model.setStyle(u,q)}catch(I){null!=window.console&&console.log("Error in style for "+u.id+": "+I)}try{var D=a.getAttribute("icon");if(null!=D){var J=0<D.length?JSON.parse(D):null;null!=J&&J.append||f.removeCellOverlays(u);null!=J&&f.addCellOverlay(u,
|
|
|
|
|
b(J))}}catch(I){null!=window.console&&console.log("Error in icon for "+u.id+": "+I)}try{var E=a.getAttribute("geometry");if(null!=E){var E=JSON.parse(E),G=f.getCellGeometry(u);if(null!=G){G=G.clone();for(key in E){var H=parseFloat(E[key]);"dx"==key?G.x+=H:"dy"==key?G.y+=H:"dw"==key?G.width+=H:"dh"==key?G.height+=H:G[key]=parseFloat(E[key])}f.model.setGeometry(u,G)}}}catch(I){null!=window.console&&console.log("Error in icon for "+u.id+": "+I)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=
|
|
|
|
|
B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(f.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))f.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=
|
|
|
|
|
g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var k=new Date,f=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),y=k.getHours(),l=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(f+"-"+e+"-"+g+"-"+y+"-"+l+"-"+k));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a,b){var c=
|
|
|
|
|
this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var d=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var f=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&null!=window.location.hash&&0<window.location.hash.length&&
|
|
|
|
@ -8228,16 +8228,16 @@ null;this.removeLibrarySidebar(a.getHash());var f=null,k=mxUtils.bind(this,funct
|
|
|
|
|
"shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);c=null!=c&&0<c.length?c:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),
|
|
|
|
|
c,!0,mxUtils.bind(this,function(a){k(b,a)}));this.repositionLibrary(d);var p=g.parentNode.previousSibling;c=p.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&p.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(l.style.backgroundColor="inherit");p.style.position="relative";var m=document.createElement("img");
|
|
|
|
|
m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title",mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):
|
|
|
|
|
c();mxEvent.consume(b)}}));if(a.isEditable()){var q=this.editor.graph,E=null,J=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),F=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=E&&null!=E.parentNode&&E.parentNode.removeChild(E),E=m.cloneNode(!1),E.setAttribute("src",Editor.spinImage),E.setAttribute("title",mxResources.get("saving")),E.style.cursor="default",E.style.marginRight="2px",E.style.marginTop="-2px",l.insertBefore(E,
|
|
|
|
|
l.firstChild),p.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=E&&null!=E.parentNode&&(E.parentNode.removeChild(E),p.style.paddingRight=18*l.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),l.insertBefore(n,l.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==
|
|
|
|
|
LocalLibrary,!0,function(){null==n||a.isModified()||(p.style.paddingRight=18*l.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*l.childNodes.length+"px")}),D=mxUtils.bind(this,function(a,c,d,k){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var p=q.getCellGeometry(a[e]);null!=p&&p.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),
|
|
|
|
|
w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);F(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=q.getSelectionCells(),c=q.view.getBounds(b),d=q.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=q.view.translate.x;
|
|
|
|
|
c.y-=q.view.translate.y;D(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",g.style.backgroundColor="#f1f3f4",g.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),
|
|
|
|
|
c();mxEvent.consume(b)}}));if(a.isEditable()){var q=this.editor.graph,D=null,J=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),E=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=D&&null!=D.parentNode&&D.parentNode.removeChild(D),D=m.cloneNode(!1),D.setAttribute("src",Editor.spinImage),D.setAttribute("title",mxResources.get("saving")),D.style.cursor="default",D.style.marginRight="2px",D.style.marginTop="-2px",l.insertBefore(D,
|
|
|
|
|
l.firstChild),p.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=D&&null!=D.parentNode&&(D.parentNode.removeChild(D),p.style.paddingRight=18*l.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),l.insertBefore(n,l.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==
|
|
|
|
|
LocalLibrary,!0,function(){null==n||a.isModified()||(p.style.paddingRight=18*l.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*l.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,c,d,k){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var p=q.getCellGeometry(a[e]);null!=p&&p.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),
|
|
|
|
|
w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);E(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=q.getSelectionCells(),c=q.view.getBounds(b),d=q.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=q.view.translate.x;
|
|
|
|
|
c.y-=q.view.translate.y;G(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",g.style.backgroundColor="#f1f3f4",g.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),
|
|
|
|
|
mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(g.style.backgroundColor="",g.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",g.style.backgroundColor="",g.style.cursor="",q.autoScroll=
|
|
|
|
|
!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){g.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(a){g.style.cursor="";g.style.backgroundColor="";0<a.dataTransfer.files.length&&
|
|
|
|
|
this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,p,u,y,l,t,m){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,u,y),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,u,y),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var v=
|
|
|
|
|
!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);F(a);this.spinner.stop();v=!0}catch(L){}else if("mxfile"==e.documentElement.nodeName)try{for(var u=e.documentElement.getElementsByTagName("diagram"),e=0;e<u.length;e++){var p=mxUtils.getTextContent(u[e]),y=this.stringToCells(Graph.decompress(p)),l=this.editor.graph.getBoundingBoxFromGeometry(y);
|
|
|
|
|
D(y,new mxRectangle(0,0,l.width,l.height),a)}v=!0}catch(L){null!=window.console&&console.log("error in drop handler:",L)}}v||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=m&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(m,function(a){n(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
|
|
|
|
|
this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,p,u,y,l,t,m){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,u,y),c)],c[0].vertex=!0,G(c,new mxRectangle(0,0,u,y),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var v=
|
|
|
|
|
!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);E(a);this.spinner.stop();v=!0}catch(L){}else if("mxfile"==e.documentElement.nodeName)try{for(var u=e.documentElement.getElementsByTagName("diagram"),e=0;e<u.length;e++){var p=mxUtils.getTextContent(u[e]),y=this.stringToCells(Graph.decompress(p)),l=this.editor.graph.getBoundingBoxFromGeometry(y);
|
|
|
|
|
G(y,new mxRectangle(0,0,l.width,l.height),a)}v=!0}catch(L){null!=window.console&&console.log("error in drop handler:",L)}}v||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=m&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(m,function(a){n(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
|
|
|
|
|
l)&&null!=m?this.parseFile(m,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?n(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):n(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){g.style.cursor="";g.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",
|
|
|
|
|
Editor.editImage);m.setAttribute("title",mxResources.get("edit"));l.insertBefore(m,l.firstChild);mxEvent.addListener(m,"click",J);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&J(a)});c=m.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));l.insertBefore(c,l.firstChild);mxEvent.addListener(c,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",
|
|
|
|
|
mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),l.insertBefore(c,l.firstChild))}p.appendChild(l);p.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
|
|
|
|
@ -8259,8 +8259,8 @@ function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.cr
|
|
|
|
|
function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",!1,null)};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{var f=document.createElement("a"),k=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),k=65==(g?parseInt(g[2],10):!1)?!1:k;if(k||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);
|
|
|
|
|
try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(y){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=
|
|
|
|
|
b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var g=1024*k,y=Math.min(g+1024,d),l=Array(y-g),m=0;g<y;++m,++g)l[m]=c[g].charCodeAt(0);e[k]=new Uint8Array(l)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,l){g=null!=g?g:!1;l=null!=l?l:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||
|
|
|
|
|
"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(G){this.handleError(G)}}))}catch(I){this.handleError(I)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
|
|
|
|
b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var g=1024*k,l=Math.min(g+1024,d),m=Array(l-g),n=0;g<l;++n,++g)m[n]=c[g].charCodeAt(0);e[k]=new Uint8Array(m)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,l){g=null!=g?g:!1;l=null!=l?l:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||
|
|
|
|
|
"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(F){this.handleError(F)}}))}catch(K){this.handleError(K)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
|
|
|
|
mxResources.get("download"),!1,g,l,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?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||null==d.document?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))+
|
|
|
|
|
'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=d&&null!=d.document||mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
|
|
|
|
|
this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding=
|
|
|
|
@ -8287,26 +8287,26 @@ null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":""
|
|
|
|
|
"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("html"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(e);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText=
|
|
|
|
|
"margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value","copy");k.appendChild(e);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(p);mxUtils.br(k);k.appendChild(g);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));k.appendChild(p);var l=this.getCurrentFile();
|
|
|
|
|
null==c&&null!=l&&l.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),k.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));e.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(k);var m=this.addLinkSection(f),n=this.addCheckbox(f,
|
|
|
|
|
mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.style.marginRight="12px";v.value="100%";f.appendChild(v);var q=this.addCheckbox(f,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,J=J=this.addCheckbox(f,mxResources.get("allPages"),k,!k),F=this.addCheckbox(f,mxResources.get("layers"),!0),D=this.addCheckbox(f,mxResources.get("lightbox"),
|
|
|
|
|
!0),H=this.addEditButton(f,D),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&D.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,n.checked,v.value,m.getTarget(),m.getColor(),q.checked,J.checked,F.checked,D.checked,H.getLink())}),null,a,
|
|
|
|
|
mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.style.marginRight="12px";v.value="100%";f.appendChild(v);var q=this.addCheckbox(f,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,J=J=this.addCheckbox(f,mxResources.get("allPages"),k,!k),E=this.addCheckbox(f,mxResources.get("layers"),!0),G=this.addCheckbox(f,mxResources.get("lightbox"),
|
|
|
|
|
!0),H=this.addEditButton(f,G),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&G.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,n.checked,v.value,m.getTarget(),m.getColor(),q.checked,J.checked,E.checked,G.checked,H.getLink())}),null,a,
|
|
|
|
|
b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.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";f.appendChild(k);var p=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=p&&p.constructor==window.DriveFile&&
|
|
|
|
|
!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var m=document.createElement("div");m.style.whiteSpace="normal";mxUtils.write(m,mxResources.get("linkAccountRequired"));l.appendChild(m);m=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(p.getId())}));m.style.marginTop=
|
|
|
|
|
"12px";m.className="geBtn";l.appendChild(m);f.appendChild(l);m=document.createElement("a");m.style.paddingLeft="12px";m.style.color="gray";m.style.fontSize="11px";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("check"));l.appendChild(m);mxEvent.addListener(m,"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 n=null,t=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",f.appendChild(n),mxUtils.write(f,mxResources.get("height")+":"),
|
|
|
|
|
t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",f.appendChild(t),mxUtils.br(f);var v=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var x=null;if(null==p||p.constructor!=window.DriveFile||b)x=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var q=this.addCheckbox(f,mxResources.get("lightbox"),!0),D=this.addEditButton(f,q),H=D.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),
|
|
|
|
|
!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&q.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(v.getTarget(),v.getColor(),null==x?
|
|
|
|
|
!0:x.checked,q.checked,D.getLink(),B.checked,null!=n?n.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,
|
|
|
|
|
t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",f.appendChild(t),mxUtils.br(f);var v=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null;if(null==p||p.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var x=this.addCheckbox(f,mxResources.get("lightbox"),!0),G=this.addEditButton(f,x),H=G.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),
|
|
|
|
|
!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(x,"change",function(){x.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&x.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(v.getTarget(),v.getColor(),null==q?
|
|
|
|
|
!0:q.checked,x.checked,G.getLink(),B.checked,null!=n?n.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):v.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,
|
|
|
|
|
mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(e);var k=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),!0),e=this.editor.graph,p=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=p&&(p.style.marginBottom="16px");a=new CustomDialog(this,f,
|
|
|
|
|
mxUtils.bind(this,function(){c(!k.checked,null!=g?g.checked:!1,null!=p?p.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,l,u){l=null!=l?l:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=this.editor.graph,p="jpeg"==u?196:300,m=document.createElement("h3");mxUtils.write(m,a);m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(m);mxUtils.write(f,mxResources.get("zoom")+
|
|
|
|
|
":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";f.appendChild(n);mxUtils.write(f,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.value=this.lastExportBorder||"0";f.appendChild(t);mxUtils.br(f);var v=this.addCheckbox(f,
|
|
|
|
|
mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=u),x=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),q=document.createElement("input");q.style.marginTop="16px";q.style.marginRight="8px";q.style.marginLeft="24px";q.setAttribute("disabled","disabled");q.setAttribute("type","checkbox");g&&(f.appendChild(q),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),p+=26,mxEvent.addListener(x,"change",function(){x.checked?q.removeAttribute("disabled"):q.setAttribute("disabled",
|
|
|
|
|
"disabled")}));k.isSelectionEmpty()||(q.setAttribute("checked","checked"),q.defaultChecked=!0);var z=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(f.appendChild(B),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),p+=26);var K=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),
|
|
|
|
|
l,null,null,"jpeg"!=u),M=null!=this.pages&&1<this.pages.length,P=this.addCheckbox(f,M?mxResources.get("allPages"):"",M,!M,null,"jpeg"!=u);P.style.marginLeft="24px";P.style.marginBottom="16px";M||(P.style.display="none");mxEvent.addListener(K,"change",function(){K.checked&&M?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled")});l&&M||P.setAttribute("disabled","disabled");var Q=document.createElement("select");Q.style.maxWidth="260px";Q.style.marginLeft="8px";Q.style.marginRight="10px";
|
|
|
|
|
Q.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));Q.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));Q.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));Q.appendChild(a);"svg"==u&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(Q),mxUtils.br(f),
|
|
|
|
|
mxUtils.br(f),p+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=n.value;e(n.value,v.checked,!x.checked,z.checked,K.checked,B.checked,t.value,q.checked,!P.checked,Q.value)}),null,c,d);this.showDialog(c.container,340,p,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var f=document.createElement("div");
|
|
|
|
|
mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=u),q=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight="8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type","checkbox");g&&(f.appendChild(x),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),p+=26,mxEvent.addListener(q,"change",function(){q.checked?x.removeAttribute("disabled"):x.setAttribute("disabled",
|
|
|
|
|
"disabled")}));k.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var z=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(f.appendChild(B),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),p+=26);var I=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),
|
|
|
|
|
l,null,null,"jpeg"!=u),M=null!=this.pages&&1<this.pages.length,O=this.addCheckbox(f,M?mxResources.get("allPages"):"",M,!M,null,"jpeg"!=u);O.style.marginLeft="24px";O.style.marginBottom="16px";M||(O.style.display="none");mxEvent.addListener(I,"change",function(){I.checked&&M?O.removeAttribute("disabled"):O.setAttribute("disabled","disabled")});l&&M||O.setAttribute("disabled","disabled");var P=document.createElement("select");P.style.maxWidth="260px";P.style.marginLeft="8px";P.style.marginRight="10px";
|
|
|
|
|
P.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));P.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));P.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));P.appendChild(a);"svg"==u&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(P),mxUtils.br(f),
|
|
|
|
|
mxUtils.br(f),p+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=t.value;this.lastExportZoom=n.value;e(n.value,v.checked,!q.checked,z.checked,I.checked,B.checked,t.value,x.checked,!O.checked,P.value)}),null,c,d);this.showDialog(c.container,340,p,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var f=document.createElement("div");
|
|
|
|
|
f.style.whiteSpace="nowrap";var k=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(g)}var p=this.addCheckbox(f,mxResources.get("fit"),!0),l=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible&&d,!d),m=this.addCheckbox(f,c),n=this.addCheckbox(f,mxResources.get("lightbox"),!0),t=this.addEditButton(f,n),v=t.getEditInput(),q=1<k.model.getChildCount(k.model.getRoot()),
|
|
|
|
|
F=this.addCheckbox(f,mxResources.get("layers"),q,!q);F.style.marginLeft=v.style.marginLeft;F.style.marginBottom="12px";F.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(q&&F.removeAttribute("disabled"),v.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"));v.checked&&n.checked?t.getEditSelect().removeAttribute("disabled"):t.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,
|
|
|
|
|
function(){a(p.checked,l.checked,m.checked,n.checked,t.getLink(),F.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,g,l,u){function f(b){var f=" ",p="";d&&(f=" 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('"+
|
|
|
|
|
E=this.addCheckbox(f,mxResources.get("layers"),q,!q);E.style.marginLeft=v.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(q&&E.removeAttribute("disabled"),v.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"));v.checked&&n.checked?t.getEditSelect().removeAttribute("disabled"):t.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,
|
|
|
|
|
function(){a(p.checked,l.checked,m.checked,n.checked,t.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,g,l,u){function f(b){var f=" ",p="";d&&(f=" 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('"+
|
|
|
|
|
EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",p+="cursor:pointer;");a&&(p+="max-width:100%;");var u="";c&&(u=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');l('<img src="'+b+'"'+u+(""!=p?' style="'+p+'"':"")+f+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");f(a)}),null,null,null,
|
|
|
|
|
mxUtils.bind(this,function(a){u({message:mxResources.get("unknownError")})}),null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),k.width*k.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var p="";c&&(p="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var m=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+p+"&xml="+encodeURIComponent(b));m.send(mxUtils.bind(this,function(){200<=m.getStatus()&&299>=m.getStatus()?f("data:image/png;base64,"+m.getText()):u({message:mxResources.get("unknownError")})}))}else u({message:mxResources.get("drawingTooLarge")})};
|
|
|
|
|
EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,g,l){var f=this.editor.graph.getSvg(),k=f.getElementsByTagName("a");if(null!=k)for(var p=0;p<k.length;p++){var m=k[p].getAttribute("href");null!=m&&"#"==m.charAt(0)&&"_blank"==k[p].getAttribute("target")&&k[p].removeAttribute("target")}d&&f.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(f);if(c){var n=" ",t="";d&&(n="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('"+
|
|
|
|
@ -8314,16 +8314,16 @@ EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(g?"&layers=1":"
|
|
|
|
|
EditorUi.drawHost+"/?client=1&lightbox=1"+(e?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),t+="cursor:pointer;"),a&&(a=parseInt(f.getAttribute("width")),b=parseInt(f.getAttribute("height")),f.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),t+="max-width:100%;max-height:"+b+"px;",f.removeAttribute("height")),""!=t&&f.setAttribute("style",t),l(mxUtils.getXml(f))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years");
|
|
|
|
|
b=Math.floor(a/2592E3);if(1<b)return b+" "+mxResources.get("months");b=Math.floor(a/86400);if(1<b)return b+" "+mxResources.get("days");b=Math.floor(a/3600);if(1<b)return b+" "+mxResources.get("hours");b=Math.floor(a/60);return 1<b?b+" "+mxResources.get("minutes"):1==b?b+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,c,d){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
|
|
|
|
|
function(){d()}))}),0)):d()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0<d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=Graph.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=
|
|
|
|
|
this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(x){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){var d=this.editor.graph,f=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),f=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),
|
|
|
|
|
this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(x){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){try{var d=this.editor.graph,f=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),f=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),
|
|
|
|
|
e=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(C){null!=
|
|
|
|
|
b&&b(C)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,g,l){l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
|
|
|
|
b&&b(C)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(u){null!=b&&b(u)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,g,l){l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
|
|
|
|
mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(g)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,l,u,m){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();
|
|
|
|
|
try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,u):null,m)}catch(G){"Invalid image"==G.message?this.downloadFile(m):this.handleError(G)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,l)}catch(I){this.spinner.stop(),this.handleError(I)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
|
|
|
|
|
try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,u):null,m)}catch(F){"Invalid image"==F.message?this.downloadFile(m):this.handleError(F)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,l)}catch(K){this.spinner.stop(),this.handleError(K)}}};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,f={},e=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],g=1;g<c.length;g++){var k=c[g].indexOf(")");e.push('url("');e.push(f[b(c[g].substring(0,k))]);e.push('"'+c[g].substring(k))}this.editor.resolvedFontCss=e.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var l=c[g].indexOf(")"),m=null,n=c[g].indexOf("format(",l);0<n&&(m=b(c[g].substring(n+7,c[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==
|
|
|
|
|
f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=
|
|
|
|
|
a;/^https?:\/\//.test(c)&&!this.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,l,u,m,n,q,G,A,E){g=null!=g?g:!0;G=null!=G?G:this.editor.graph;A=null!=A?A:0;var f=m?null:G.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==
|
|
|
|
|
f&&0==m&&(f="#ffffff");this.convertImages(G.getSvg(f,null,null,E,null,null!=l?l:!0,null,null,null,n),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));u=null!=u?u:1;null!=b&&(u=g?Math.min(1,Math.min(3*b/(4*l),b/p)):b/p);p=Math.ceil(u*p)+2*A;l=Math.ceil(u*l)+2*A;k.setAttribute("width",p);k.setAttribute("height",l);var m=k.getContext("2d");null!=f&&(m.beginPath(),
|
|
|
|
|
m.rect(0,0,p,l),m.fillStyle=f,m.fill());m.scale(u,u);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(d,A/u,A/u);a(k)},0):(m.drawImage(d,A/u,A/u),a(k))}catch(Q){null!=e&&e(Q)}});d.onerror=function(a){null!=e&&e(a)};try{n&&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(G,
|
|
|
|
|
a;/^https?:\/\//.test(c)&&!this.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,l)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,l,u,m,n,q,F,A,D){g=null!=g?g:!0;F=null!=F?F:this.editor.graph;A=null!=A?A:0;var f=m?null:F.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==
|
|
|
|
|
f&&0==m&&(f="#ffffff");this.convertImages(F.getSvg(f,null,null,D,null,null!=l?l:!0,null,null,null,n),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),l=parseInt(c.getAttribute("height"));u=null!=u?u:1;null!=b&&(u=g?Math.min(1,Math.min(3*b/(4*l),b/p)):b/p);p=Math.ceil(u*p)+2*A;l=Math.ceil(u*l)+2*A;k.setAttribute("width",p);k.setAttribute("height",l);var m=k.getContext("2d");null!=f&&(m.beginPath(),
|
|
|
|
|
m.rect(0,0,p,l),m.fillStyle=f,m.fill());m.scale(u,u);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(d,A/u,A/u);a(k)},0):(m.drawImage(d,A/u,A/u),a(k))}catch(P){null!=e&&e(P)}});d.onerror=function(a){null!=e&&e(a)};try{n&&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(F,
|
|
|
|
|
c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(B){null!=e&&e(B)}}),c,q)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.editor.isCorsEnabledForUrl(d)?"chrome-extension://"!=
|
|
|
|
|
d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,e=c||{};c=mxUtils.bind(this,function(c,g){for(var k=a.getElementsByTagName(c),p=0;p<k.length;p++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(g));if(null!=k&&"data:"!=k.substring(0,5)){var p=e[k];null==p?(f++,this.convertImageToDataUri(k,function(d){null!=d&&(e[k]=d,c.setAttribute(g,
|
|
|
|
|
d));f--;0==f&&b(a)})):c.setAttribute(g,p)}else null!=k&&c.setAttribute(g,k)})(k[p])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g,l){try{var f=!l&&(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(f){if((9==document.documentMode||10==document.documentMode)&&
|
|
|
|
@ -8337,7 +8337,7 @@ var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGra
|
|
|
|
|
"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(t){c(t)}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline()?
|
|
|
|
|
window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,f=null;d.getModel().beginUpdate();try{f=d.insertVertex(null,null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=center;verticalAlign=middle;"),d.updateCellSize(f,!0)}finally{d.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,g,l){g=null!=g?g:!0;
|
|
|
|
|
l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var f=this.editor.graph;if("data:image/png;base64,"==
|
|
|
|
|
a.substring(0,22)){var k=this.extractGraphModelFromPng(a),p=this.importXml(k,b,c,g,!0);if(0<p.length)return p}if("data:image/svg+xml;"==a.substring(0,19))try{if(k=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(k=a.substring(a.indexOf(",")+1),k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0)):k=decodeURIComponent(a.substring(a.indexOf(",")+1)),p=this.importXml(k,b,c,g,!0),0<p.length)return p}catch(I){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,
|
|
|
|
|
a.substring(0,22)){var k=this.extractGraphModelFromPng(a),p=this.importXml(k,b,c,g,!0);if(0<p.length)return p}if("data:image/svg+xml;"==a.substring(0,19))try{if(k=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(k=a.substring(a.indexOf(",")+1),k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0)):k=decodeURIComponent(a.substring(a.indexOf(",")+1)),p=this.importXml(k,b,c,g,!0),0<p.length)return p}catch(K){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,
|
|
|
|
|
a,mxUtils.bind(this,function(a,d,e){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),g=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),g,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
|
|
|
|
a+";"))}}),mxUtils.bind(this,function(){var e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,a,f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(e),f.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{f.getModel().endUpdate()}f.setSelectionCell(e)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,g);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,
|
|
|
|
|
function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,g))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted","cells",[e])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),e.value=a,f.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(e.value)&&
|
|
|
|
@ -8349,18 +8349,18 @@ function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary
|
|
|
|
|
a+";")])):/(\.*<graphml )/.test(a)?(f=!0,this.importGraphML(a,p)):null!=m&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(f=!0,this.importVisio(m,p)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(f=!0,this.parseFile(null!=m?m:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?p(a.responseText):null!=u&&u(null))}),l)):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||
|
|
|
|
|
(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,n));f||null==u||u(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,g;c<d;){f=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);b+="==";break}e=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);
|
|
|
|
|
b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);b+=
|
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,l,u,m,n,q,G){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;n=null!=n?n:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var y=q||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>y){p=!0;break}var v=mxUtils.bind(this,function(){var p=this.editor.graph,m=p.gridSize;
|
|
|
|
|
e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,l,p){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,g,k,l,p,f,G)});g=null!=g?g:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var y=a.length,t=y,v=[],x=mxUtils.bind(this,function(a,b){v[a]=b;if(0==--t){this.spinner.stop();if(null!=u)u(v);else{var c=[];p.getModel().beginUpdate();
|
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,l,u,m,n,q,F){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;n=null!=n?n:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var y=q||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>y){p=!0;break}var v=mxUtils.bind(this,function(){var p=this.editor.graph,m=p.gridSize;
|
|
|
|
|
e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,l,p){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,g,k,l,p,f,F)});g=null!=g?g:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var y=a.length,t=y,v=[],x=mxUtils.bind(this,function(a,b){v[a]=b;if(0==--t){this.spinner.stop();if(null!=u)u(v);else{var c=[];p.getModel().beginUpdate();
|
|
|
|
|
try{for(var d=0;d<v.length;d++){var f=v[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}g(c)}}),C=0;C<y;C++)mxUtils.bind(this,function(f){var g=a[f];if(null!=g){var u=new FileReader;u.onload=mxUtils.bind(this,function(a){if(null==l||l(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var u=a.target.result,y=u.indexOf(","),t=decodeURIComponent(escape(atob(u.substring(y+1)))),v=mxUtils.parseXml(t),t=v.getElementsByTagName("svg");if(0<t.length){var t=t[0],
|
|
|
|
|
C=G?null:t.getAttribute("content");null!=C&&"<"!=C.charAt(0)&&"%"!=C.charAt(0)&&(C=unescape(window.atob?atob(C):Base64.decode(C,!0)));null!=C&&"%"==C.charAt(0)&&(C=decodeURIComponent(C));null==C||"<mxfile "!==C.substring(0,8)&&"<mxGraphModel "!==C.substring(0,14)?x(f,mxUtils.bind(this,function(){try{if(u.substring(0,y+1),null!=v){var a=v.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=parseFloat(k.getAttribute("width")),n=parseFloat(k.getAttribute("height")),t=k.getAttribute("viewBox");if(null==
|
|
|
|
|
t||0==t.length)k.setAttribute("viewBox","0 0 "+l+" "+n);else if(isNaN(l)||isNaN(n)){var q=t.split(" ");3<q.length&&(l=parseFloat(q[2]),n=parseFloat(q[3]))}u=this.createSvgDataUri(mxUtils.getXml(k));var x=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,n)),C=e(u,g.type,b+f*m,c+f*m,Math.max(1,Math.round(l*x)),Math.max(1,Math.round(n*x)),g.name);if(isNaN(l)||isNaN(n)){var I=new Image;I.onload=mxUtils.bind(this,function(){l=Math.max(1,I.width);n=Math.max(1,I.height);C[0].geometry.width=l;C[0].geometry.height=
|
|
|
|
|
n;k.setAttribute("viewBox","0 0 "+l+" "+n);u=this.createSvgDataUri(mxUtils.getXml(k));var a=u.indexOf(";");0<a&&(u=u.substring(0,a)+u.substring(u.indexOf(",",a+1)));p.setCellStyles("image",u,[C[0]])});I.src=this.createSvgDataUri(mxUtils.getXml(k))}return C}}}catch(pa){}return null})):x(f,mxUtils.bind(this,function(){return e(C,"text/xml",b+f*m,c+f*m,0,0,g.name)}))}else x(f,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==g.type){var I=G?null:this.extractGraphModelFromPng(a.target.result);
|
|
|
|
|
if(null!=I&&0<I.length){var A=new Image;A.src=a.target.result;x(f,mxUtils.bind(this,function(){return e(I,"text/xml",b+f*m,c+f*m,A.width,A.height,g.name)}));t=!0}}t||(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(l){this.resizeImage(l,
|
|
|
|
|
C=F?null:t.getAttribute("content");null!=C&&"<"!=C.charAt(0)&&"%"!=C.charAt(0)&&(C=unescape(window.atob?atob(C):Base64.decode(C,!0)));null!=C&&"%"==C.charAt(0)&&(C=decodeURIComponent(C));null==C||"<mxfile "!==C.substring(0,8)&&"<mxGraphModel "!==C.substring(0,14)?x(f,mxUtils.bind(this,function(){try{if(u.substring(0,y+1),null!=v){var a=v.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=parseFloat(k.getAttribute("width")),n=parseFloat(k.getAttribute("height")),t=k.getAttribute("viewBox");if(null==
|
|
|
|
|
t||0==t.length)k.setAttribute("viewBox","0 0 "+l+" "+n);else if(isNaN(l)||isNaN(n)){var q=t.split(" ");3<q.length&&(l=parseFloat(q[2]),n=parseFloat(q[3]))}u=this.createSvgDataUri(mxUtils.getXml(k));var x=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,n)),C=e(u,g.type,b+f*m,c+f*m,Math.max(1,Math.round(l*x)),Math.max(1,Math.round(n*x)),g.name);if(isNaN(l)||isNaN(n)){var K=new Image;K.onload=mxUtils.bind(this,function(){l=Math.max(1,K.width);n=Math.max(1,K.height);C[0].geometry.width=l;C[0].geometry.height=
|
|
|
|
|
n;k.setAttribute("viewBox","0 0 "+l+" "+n);u=this.createSvgDataUri(mxUtils.getXml(k));var a=u.indexOf(";");0<a&&(u=u.substring(0,a)+u.substring(u.indexOf(",",a+1)));p.setCellStyles("image",u,[C[0]])});K.src=this.createSvgDataUri(mxUtils.getXml(k))}return C}}}catch(pa){}return null})):x(f,mxUtils.bind(this,function(){return e(C,"text/xml",b+f*m,c+f*m,0,0,g.name)}))}else x(f,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==g.type){var K=F?null:this.extractGraphModelFromPng(a.target.result);
|
|
|
|
|
if(null!=K&&0<K.length){var A=new Image;A.src=a.target.result;x(f,mxUtils.bind(this,function(){return e(K,"text/xml",b+f*m,c+f*m,A.width,A.height,g.name)}));t=!0}}t||(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(l){this.resizeImage(l,
|
|
|
|
|
a.target.result,mxUtils.bind(this,function(l,p,u){x(f,mxUtils.bind(this,function(){if(null!=l&&l.length<n){var y=k&&this.isResampleImage(a.target.result,q)?Math.min(1,Math.min(d/p,d/u)):1;return e(l,g.type,b+f*m,c+f*m,Math.round(p*y),Math.round(u*y),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,q)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*m,c+f*m,240,160,g.name,
|
|
|
|
|
function(a){x(f,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*m,c+f*m,240,160,g.name,function(a){x(f,function(){return a})},g):"image"==g.type.substring(0,5)?u.readAsDataURL(g):u.readAsText(g)}})(C)});p?this.confirmImageResize(function(a){k=a;v()},m):v()};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,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(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):f(!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 f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.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,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),k=Math.max(1,a.height);
|
|
|
|
|
if(d&&this.isResampleImage(b,g))try{var l=Math.max(f/e,k/e);if(1<l){var p=Math.round(f/l),m=Math.round(k/l),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var t=n.toDataURL();if(t.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=m;var v=q.toDataURL();t!==v&&(b=t,f=p,k=m)}}}catch(F){}c(b,f,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var e=d,g=0;8>g;g++)e=1==(e&1)?3988292384^e>>>1:e>>>1,EditorUi.prototype.crcTable[d]=
|
|
|
|
|
if(d&&this.isResampleImage(b,g))try{var l=Math.max(f/e,k/e);if(1<l){var p=Math.round(f/l),m=Math.round(k/l),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var t=n.toDataURL();if(t.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=m;var v=q.toDataURL();t!==v&&(b=t,f=p,k=m)}}}catch(E){}c(b,f,k)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var e=d,g=0;8>g;g++)e=1==(e&1)?3988292384^e>>>1:e>>>1,EditorUi.prototype.crcTable[d]=
|
|
|
|
|
e;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=l;l+=b;return a.substring(c,l)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
|
|
|
|
|
8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var l=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,l);do{var p=g(a);if("IDAT"==f(a,4)){e=a.substring(0,l-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;
|
|
|
|
|
d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(l-8,a.length);break}e+=a.substring(l-8,l-4+p);f(a,p);f(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,f){a=d.substring(a+8,a+8+f);"zTXt"==
|
|
|
|
@ -8372,19 +8372,19 @@ arguments)};var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=
|
|
|
|
|
arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var u=this.actions.get("print");u.setEnabled(!mxClient.IS_IOS||!navigator.standalone);u.visible=u.isEnabled();if(!this.editor.chromeless||this.editor.editable){var n=function(){window.setTimeout(function(){q.innerHTML=" ";
|
|
|
|
|
q.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_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||
|
|
|
|
|
b.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,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,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(V){}}),!1);var q=document.createElement("div");q.style.position="absolute";q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.display="block";q.contentEditable=!0;mxUtils.setOpacity(q,0);q.style.width="1px";q.style.height="1px";q.innerHTML=" ";var I=!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 c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||I||(q.style.left=b.container.scrollLeft+10+"px",q.style.top=b.container.scrollTop+10+"px",b.container.appendChild(q),
|
|
|
|
|
I=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){q.focus();document.execCommand("selectAll",!1,null)},0):(q.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!I||224!=c&&17!=c&&91!=c||(I=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),q.parentNode.removeChild(q),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(q,
|
|
|
|
|
"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q),n())}));mxEvent.addListener(q,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q,!0),n())}));mxEvent.addListener(q,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(q.innerHTML=" ",q.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,q);q.innerHTML=" "}),0))}),!0);var G=this.isSelectionAllowed;this.isSelectionAllowed=
|
|
|
|
|
function(a){return mxEvent.getSource(a)==q?!0:G.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()}),
|
|
|
|
|
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(V){}}),!1);var q=document.createElement("div");q.style.position="absolute";q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.display="block";q.contentEditable=!0;mxUtils.setOpacity(q,0);q.style.width="1px";q.style.height="1px";q.innerHTML=" ";var K=!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 c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||K||(q.style.left=b.container.scrollLeft+10+"px",q.style.top=b.container.scrollTop+10+"px",b.container.appendChild(q),
|
|
|
|
|
K=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){q.focus();document.execCommand("selectAll",!1,null)},0):(q.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!K||224!=c&&17!=c&&91!=c||(K=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),q.parentNode.removeChild(q),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(q,
|
|
|
|
|
"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q),n())}));mxEvent.addListener(q,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q,!0),n())}));mxEvent.addListener(q,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(q.innerHTML=" ",q.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,q);q.innerHTML=" "}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=
|
|
|
|
|
function(a){return mxEvent.getSource(a)==q?!0:F.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,f,e,g){b.insertImage(a,e,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 f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):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){u=document.createElement("div");u.style.position="absolute";u.style.top="95px";u.style.left="250px";u.style.width="2000px";u.style.height="30px";u.style.background=
|
|
|
|
|
"whiteSmoke";document.body.appendChild(u);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);var E=document.createElement("div");E.style.position="absolute";E.style.top="95px";E.style.left="220px";E.style.width="30px";E.style.height="30px";E.style.background="whiteSmoke";document.body.appendChild(E);this.vRuler=new mxRuler(this.editor.graph,
|
|
|
|
|
"whiteSmoke";document.body.appendChild(u);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);var D=document.createElement("div");D.style.position="absolute";D.style.top="95px";D.style.left="220px";D.style.width="30px";D.style.height="30px";D.style.background="whiteSmoke";document.body.appendChild(D);this.vRuler=new mxRuler(this.editor.graph,
|
|
|
|
|
A,!0);this.hRuler=new mxRuler(this.editor.graph,u,!1)}if("1"==urlParams.styledev){u=document.getElementById("geFooter");null!=u&&(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)})),u.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 J=this.isSelectionAllowed;
|
|
|
|
|
this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:J.apply(this,arguments)}}u=document.getElementById("geInfo");null!=u&&u.parentNode.removeChild(u);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var F=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=F&&(F.parentNode.removeChild(F),F=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==
|
|
|
|
|
F&&(!mxClient.IS_IE||10<document.documentMode)&&(F=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=F&&(F.parentNode.removeChild(F),F=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,
|
|
|
|
|
this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:J.apply(this,arguments)}}u=document.getElementById("geInfo");null!=u&&u.parentNode.removeChild(u);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E),E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==
|
|
|
|
|
E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,
|
|
|
|
|
e,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,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var p=null,d=c.getElementsByTagName("img");
|
|
|
|
|
null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var u=!0,m=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,e,g,!0,p,null,u))});p&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){u=a;m()},mxEvent.isControlDown(a)):m()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,
|
|
|
|
|
function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+k+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(k,e,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
|
|
|
|
@ -8404,7 +8404,7 @@ c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.
|
|
|
|
|
"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,f;if(null==a){f=document.body;var e=document.documentElement;d=(f.clientWidth||e.clientWidth)-3;f=Math.max(f.clientHeight||0,e.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,f=a.clientHeight;e=document.createElement("div");e.style.zIndex=mxPopupMenu.prototype.zIndex+
|
|
|
|
|
2;e.style.border="3px dotted rgb(254, 137, 12)";e.style.pointerEvents="none";e.style.position="absolute";e.style.top=b+"px";e.style.left=c+"px";e.style.width=Math.max(0,d-3)+"px";e.style.height=Math.max(0,f-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(e):document.body.appendChild(e);return e};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
|
|
|
|
|
d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{var d=c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=
|
|
|
|
|
mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(I){this.handleError(I,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,
|
|
|
|
|
mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,
|
|
|
|
|
function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));
|
|
|
|
|
else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,
|
|
|
|
|
c.target.result,a.name))}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(C){this.handleError(C)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,
|
|
|
|
@ -8417,10 +8417,10 @@ a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabCo
|
|
|
|
|
this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=
|
|
|
|
|
function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,f=null,e=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});
|
|
|
|
|
this.editor.graph.model.addListener(mxEvent.CHANGE,e);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){if(e.source==(window.opener||window.parent)){var k=e.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&
|
|
|
|
|
("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=Graph.decompress(a)))}catch(M){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(K){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();l=new FilenameDialog(this,
|
|
|
|
|
("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=Graph.decompress(a)))}catch(M){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(I){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();l=new FilenameDialog(this,
|
|
|
|
|
k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){var p=l(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),p,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",
|
|
|
|
|
result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
|
|
|
|
|
try{l.init()}catch(K){g.postMessage(JSON.stringify({event:"draft",error:K.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();l=1==k.enableRecent;p=1==k.enableSearch;l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,
|
|
|
|
|
try{l.init()}catch(I){g.postMessage(JSON.stringify({event:"draft",error:I.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();l=1==k.enableRecent;p=1==k.enableSearch;l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,
|
|
|
|
|
null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,p?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):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("textContent"==
|
|
|
|
|
k.action){l=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:l,message:k}),"*");return}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 m=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,
|
|
|
|
|
m):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 u=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=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(u);
|
|
|
|
@ -8431,7 +8431,7 @@ k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.backgro
|
|
|
|
|
this.createSvgDataUri(a);g.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("load"==
|
|
|
|
|
k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(p=document.createElement("span"),mxUtils.write(p,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop=
|
|
|
|
|
"6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(p),this.embedFilenameSpan=p),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");
|
|
|
|
|
return}}var z=mxUtils.bind(this,function(e,k){c=!0;try{a(e,k)}catch(Q){this.handleError(Q)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");e.xml=d;d=JSON.stringify(e);(window.opener||window.parent).postMessage(d,
|
|
|
|
|
return}}var z=mxUtils.bind(this,function(e,k){c=!0;try{a(e,k)}catch(P){this.handleError(P)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");e.xml=d;d=JSON.stringify(e);(window.opener||window.parent).postMessage(d,
|
|
|
|
|
"*")}f=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
|
|
|
|
|
b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(l="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+1)),function(a){z(a,e)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=k&&"function"===typeof k.substring&&
|
|
|
|
|
!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&z(a.responseText,e)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,mxUtils.bind(this,function(a){z(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(k=l(k),z(k,e))}}));var g=
|
|
|
|
@ -8439,17 +8439,17 @@ window.opener||window.parent,e="json"==urlParams.proto?JSON.stringify({event:"in
|
|
|
|
|
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,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,k=null,l=null,m="",n="auto",q="auto",A=null,E=null,J=40,F=40,D=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var K=function(){null!=b?b(ca):(B.setSelectionCells(ca),B.scrollCellToVisible(B.getSelectionCell()))},M=B.getFreeInsertPoint(),P=M.x,Q=M.y,M=Q,U=null,V="auto",l=null,W=[],Y=null,fa=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,
|
|
|
|
|
a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var O=mxUtils.trim(a.substring(1,Z)),R=mxUtils.trim(a.substring(Z+1));"label"==O?U=B.sanitizeHtml(R):"style"==O?f=R:"parentstyle"==O?g=R:"identity"==O&&0<R.length&&"-"!=R?k=R:"parent"==O&&0<R.length&&"-"!=R?l=R:"namespace"==O&&0<R.length&&"-"!=R?m=R:"width"==O?n=R:"height"==O?q=R:"left"==O&&0<R.length?A=R:"top"==O&&0<R.length?E=R:"ignore"==O?fa=R.split(","):"connect"==O?W.push(JSON.parse(R)):"link"==
|
|
|
|
|
O?Y=R:"padding"==O?H=parseFloat(R):"edgespacing"==O?J=parseFloat(R):"nodespacing"==O?F=parseFloat(R):"levelspacing"==O?D=parseFloat(R):"layout"==O&&(V=R)}}}var aa=this.editor.csvToArray(c[N]),O=Z=null;if(null!=k||null!=l)for(var T=0;T<aa.length;T++)k==aa[T]&&(Z=T),l==aa[T]&&(O=T);null==U&&(U="%"+aa[0]+"%");if(null!=W)for(var S=0;S<W.length;S++)null==e[W[S].to]&&(e[W[S].to]={});B.model.beginUpdate();try{for(T=N+1;T<c.length;T++){var ba=this.editor.csvToArray(c[T]);if(null==ba){var ga=40<c[T].length?
|
|
|
|
|
c[T].substring(0,40)+"...":c[T];throw Error(T+" ("+ga+") "+mxResources.get("containsValidationErrors"));}if(ba.length==aa.length){var L=null,ea=null!=Z?m+ba[Z]:null;null!=ea&&(L=B.model.getCell(ea));null==L&&(L=new mxCell(U,new mxGeometry(P,M,0,0),f||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=ea);for(var X=0;X<ba.length;X++)B.setAttributeForCell(L,aa[X],ba[X]);B.setAttributeForCell(L,"placeholders","1");L.style=B.replacePlaceholders(L,L.style);for(S=0;S<W.length;S++)e[W[S].to][L.getAttribute(W[S].to)]=
|
|
|
|
|
L;null!=Y&&"link"!=Y&&(B.setLinkForCell(L,L.getAttribute(Y)),B.setAttributeForCell(L,Y,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var ia=this.editor.graph.getPreferredSizeForCell(L);L.vertex&&(null!=A&&null!=L.getAttribute(A)&&(L.geometry.x=P+parseFloat(L.getAttribute(A))),null!=E&&null!=L.getAttribute(E)&&(L.geometry.y=Q+parseFloat(L.getAttribute(E))),"@"==n.charAt(0)&&null!=L.getAttribute(n.substring(1))?L.geometry.width=parseFloat(L.getAttribute(n.substring(1))):L.geometry.width=
|
|
|
|
|
"auto"==n?ia.width+H:parseFloat(n),"@"==q.charAt(0)&&null!=L.getAttribute(q.substring(1))?L.geometry.height=parseFloat(L.getAttribute(q.substring(1))):L.geometry.height="auto"==q?ia.height+H:parseFloat(q),M+=L.geometry.height+F);l=null!=O?B.model.getCell(m+ba[O]):null;null!=l?(l.style=B.replacePlaceholders(l,g),B.addCell(L,l)):d.push(B.addCell(L))}}for(var ha=d.slice(),ca=d.slice(),S=0;S<W.length;S++)for(var da=W[S],T=0;T<d.length;T++){var L=d[T],qa=L.getAttribute(da.from);if(null!=qa){B.setAttributeForCell(L,
|
|
|
|
|
function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,k=null,l=null,m="",n="auto",q="auto",A=null,D=null,J=40,E=40,G=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var I=function(){null!=b?b(ca):(B.setSelectionCells(ca),B.scrollCellToVisible(B.getSelectionCell()))},M=B.getFreeInsertPoint(),O=M.x,P=M.y,M=P,U=null,V="auto",l=null,W=[],Y=null,fa=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,
|
|
|
|
|
a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var Q=mxUtils.trim(a.substring(1,Z)),R=mxUtils.trim(a.substring(Z+1));"label"==Q?U=B.sanitizeHtml(R):"style"==Q?f=R:"parentstyle"==Q?g=R:"identity"==Q&&0<R.length&&"-"!=R?k=R:"parent"==Q&&0<R.length&&"-"!=R?l=R:"namespace"==Q&&0<R.length&&"-"!=R?m=R:"width"==Q?n=R:"height"==Q?q=R:"left"==Q&&0<R.length?A=R:"top"==Q&&0<R.length?D=R:"ignore"==Q?fa=R.split(","):"connect"==Q?W.push(JSON.parse(R)):"link"==
|
|
|
|
|
Q?Y=R:"padding"==Q?H=parseFloat(R):"edgespacing"==Q?J=parseFloat(R):"nodespacing"==Q?E=parseFloat(R):"levelspacing"==Q?G=parseFloat(R):"layout"==Q&&(V=R)}}}var aa=this.editor.csvToArray(c[N]),Q=Z=null;if(null!=k||null!=l)for(var T=0;T<aa.length;T++)k==aa[T]&&(Z=T),l==aa[T]&&(Q=T);null==U&&(U="%"+aa[0]+"%");if(null!=W)for(var S=0;S<W.length;S++)null==e[W[S].to]&&(e[W[S].to]={});B.model.beginUpdate();try{for(T=N+1;T<c.length;T++){var ba=this.editor.csvToArray(c[T]);if(null==ba){var ga=40<c[T].length?
|
|
|
|
|
c[T].substring(0,40)+"...":c[T];throw Error(T+" ("+ga+") "+mxResources.get("containsValidationErrors"));}if(ba.length==aa.length){var L=null,ea=null!=Z?m+ba[Z]:null;null!=ea&&(L=B.model.getCell(ea));null==L&&(L=new mxCell(U,new mxGeometry(O,M,0,0),f||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=ea);for(var X=0;X<ba.length;X++)B.setAttributeForCell(L,aa[X],ba[X]);B.setAttributeForCell(L,"placeholders","1");L.style=B.replacePlaceholders(L,L.style);for(S=0;S<W.length;S++)e[W[S].to][L.getAttribute(W[S].to)]=
|
|
|
|
|
L;null!=Y&&"link"!=Y&&(B.setLinkForCell(L,L.getAttribute(Y)),B.setAttributeForCell(L,Y,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var ia=this.editor.graph.getPreferredSizeForCell(L);L.vertex&&(null!=A&&null!=L.getAttribute(A)&&(L.geometry.x=O+parseFloat(L.getAttribute(A))),null!=D&&null!=L.getAttribute(D)&&(L.geometry.y=P+parseFloat(L.getAttribute(D))),"@"==n.charAt(0)&&null!=L.getAttribute(n.substring(1))?L.geometry.width=parseFloat(L.getAttribute(n.substring(1))):L.geometry.width=
|
|
|
|
|
"auto"==n?ia.width+H:parseFloat(n),"@"==q.charAt(0)&&null!=L.getAttribute(q.substring(1))?L.geometry.height=parseFloat(L.getAttribute(q.substring(1))):L.geometry.height="auto"==q?ia.height+H:parseFloat(q),M+=L.geometry.height+E);l=null!=Q?B.model.getCell(m+ba[Q]):null;null!=l?(l.style=B.replacePlaceholders(l,g),B.addCell(L,l)):d.push(B.addCell(L))}}for(var ha=d.slice(),ca=d.slice(),S=0;S<W.length;S++)for(var da=W[S],T=0;T<d.length;T++){var L=d[T],qa=L.getAttribute(da.from);if(null!=qa){B.setAttributeForCell(L,
|
|
|
|
|
da.from,null);for(var pa=qa.split(","),X=0;X<pa.length;X++){var ja=e[da.to][pa[X]];null!=ja&&(U=da.label,null!=da.fromlabel&&(U=(L.getAttribute(da.fromlabel)||"")+(U||"")),null!=da.tolabel&&(U=(U||"")+(ja.getAttribute(da.tolabel)||"")),ca.push(B.insertEdge(null,null,U||"",da.invert?ja:L,da.invert?L:ja,da.style||B.createCurrentEdgeStyle())),mxUtils.remove(da.invert?L:ja,ha))}}}if(null!=fa)for(T=0;T<d.length;T++)for(L=d[T],X=0;X<fa.length;X++)B.setAttributeForCell(L,mxUtils.trim(fa[X]),null);var ma=
|
|
|
|
|
new mxParallelEdgeLayout(B);ma.spacing=J;var ra=function(){ma.execute(B.getDefaultParent());for(var a=0;a<d.length;a++){var b=B.getCellGeometry(d[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==n&&(b.width=Math.round(B.snap(b.width)));"auto"==q&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==V){var na=new mxCircleLayout(B);na.resetEdges=!1;var sa=na.isVertexIgnored;na.isVertexIgnored=function(a){return sa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){na.execute(B.getDefaultParent());
|
|
|
|
|
ra()},!0,K);K=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&ca.length==2*d.length-1&&1==ha.length){B.view.validate();var oa=new mxCompactTreeLayout(B,"horizontaltree"==V);oa.levelDistance=F;oa.edgeRouting=!1;oa.resetEdges=!1;this.executeLayout(function(){oa.execute(B.getDefaultParent(),0<ha.length?ha[0]:null)},!0,K);K=null}else if("horizontalflow"==V||"verticalflow"==V||"auto"==V&&1==ha.length){B.view.validate();var ka=new mxHierarchicalLayout(B,"horizontalflow"==V?mxConstants.DIRECTION_WEST:
|
|
|
|
|
mxConstants.DIRECTION_NORTH);ka.intraCellSpacing=F;ka.parallelEdgeSpacing=J;ka.interRankCellSpacing=D;ka.disableEdgeStyle=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),ca);B.moveCells(ca,P,Q)},!0,K);K=null}else if("organic"==V||"auto"==V&&ca.length>d.length){B.view.validate();var la=new mxFastOrganicLayout(B);la.forceConstant=3*F;la.resetEdges=!1;var ua=la.isVertexIgnored;la.isVertexIgnored=function(a){return ua.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ma=new mxParallelEdgeLayout(B);
|
|
|
|
|
ma.spacing=J;this.executeLayout(function(){la.execute(B.getDefaultParent());ra()},!0,K);K=null}this.hideDialog()}finally{B.model.endUpdate()}null!=K&&K()}}catch(ta){this.handleError(ta)}};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=
|
|
|
|
|
ra()},!0,I);I=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&ca.length==2*d.length-1&&1==ha.length){B.view.validate();var oa=new mxCompactTreeLayout(B,"horizontaltree"==V);oa.levelDistance=E;oa.edgeRouting=!1;oa.resetEdges=!1;this.executeLayout(function(){oa.execute(B.getDefaultParent(),0<ha.length?ha[0]:null)},!0,I);I=null}else if("horizontalflow"==V||"verticalflow"==V||"auto"==V&&1==ha.length){B.view.validate();var ka=new mxHierarchicalLayout(B,"horizontalflow"==V?mxConstants.DIRECTION_WEST:
|
|
|
|
|
mxConstants.DIRECTION_NORTH);ka.intraCellSpacing=E;ka.parallelEdgeSpacing=J;ka.interRankCellSpacing=G;ka.disableEdgeStyle=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),ca);B.moveCells(ca,O,P)},!0,I);I=null}else if("organic"==V||"auto"==V&&ca.length>d.length){B.view.validate();var la=new mxFastOrganicLayout(B);la.forceConstant=3*E;la.resetEdges=!1;var ua=la.isVertexIgnored;la.isVertexIgnored=function(a){return ua.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ma=new mxParallelEdgeLayout(B);
|
|
|
|
|
ma.spacing=J;this.executeLayout(function(){la.execute(B.getDefaultParent());ra()},!0,I);I=null}this.hideDialog()}finally{B.model.endUpdate()}null!=I&&I()}}catch(ta){this.handleError(ta)}};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,480,130,!0,!0);a.init()};var m=
|
|
|
|
|
EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.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=this.source.getPagePadding();
|
|
|
|
@ -8473,7 +8473,7 @@ c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutur
|
|
|
|
|
break}}return d};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length;c++){var d=a;this.currentPage!=this.pages[c]&&(d=this.createTemporaryGraph(a.getStylesheet()),d.model.setRoot(this.pages[c].root));b+=this.pages[c].getName()+" "+d.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b=
|
|
|
|
|
{},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<img src="/images/spin.gif">';var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var l=g[a];if("R"==l.substring(0,1)){var m=
|
|
|
|
|
JSON.parse(decodeURIComponent(l.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(C){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},function(){this.handleError(null,mxResources.get("errorGettingConfLibs",null,"An error occured while getting Confluence libraries list"))});
|
|
|
|
|
c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,
|
|
|
|
|
c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,
|
|
|
|
|
mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}));this.showDialog(c.container,340,375,!0,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],
|
|
|
|
|
"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,d,e){c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:d,error:e});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,
|
|
|
|
|
msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),
|
|
|
|
@ -8487,8 +8487,8 @@ a.getParent(e),null!=e&&(l=e.getId()))),null!=l&&(b(l).moved[g.previous]=n));ret
|
|
|
|
|
EditorUi.prototype.patchPage=function(a,c,b,d){var e=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),g=this.createParentLookup(e,c);e.beginUpdate();try{var l=e.updateEdgeParent,m=new mxDictionary,n=[];e.updateEdgeParent=function(a,b){!m.get(a)&&d&&(m.put(a,!0),n.push(a))};var q=g[""],f=null!=q&&null!=q.inserted?q.inserted[""]:null,k=null;null!=f&&(k=this.getCellForJson(f));if(null==k){var p=null!=q&&null!=q.moved?q.moved[""]:null;null!=p&&(k=e.getCell(p))}null!=k&&(e.setRoot(k),
|
|
|
|
|
a.root=k);this.patchCellRecursive(a,e,e.root,g,c);if(null!=c[EditorUi.DIFF_REMOVE])for(var v=0;v<c[EditorUi.DIFF_REMOVE].length;v++){var t=e.getCell(c[EditorUi.DIFF_REMOVE][v]);null!=t&&e.remove(t)}if(null!=c[EditorUi.DIFF_UPDATE]){var x=null!=b&&null!=b.cells?b.cells[EditorUi.DIFF_UPDATE]:null;for(p in c[EditorUi.DIFF_UPDATE])this.patchCell(e,e.getCell(p),c[EditorUi.DIFF_UPDATE][p],null!=x?x[p]:null)}if(null!=c[EditorUi.DIFF_INSERT])for(v=0;v<c[EditorUi.DIFF_INSERT].length;v++)f=c[EditorUi.DIFF_INSERT][v],
|
|
|
|
|
t=e.getCell(f.id),null!=t&&(e.setTerminal(t,e.getCell(f.source),!0),e.setTerminal(t,e.getCell(f.target),!1));e.updateEdgeParent=l;if(d&&0<n.length)for(v=0;v<n.length;v++)e.contains(n[v])&&e.updateEdgeParent(n[v])}finally{e.endUpdate()}};
|
|
|
|
|
EditorUi.prototype.patchCellRecursive=function(a,c,b,d,e){if(null!=b){for(var g=d[b.getId()],l=null!=g&&null!=g.inserted?g.inserted:{},g=null!=g&&null!=g.moved?g.moved:{},m=0,n=c.getChildCount(b),q="",f=0;f<n;f++){var k=c.getChildAt(b,f).getId();null==g[q]&&(null==e[EditorUi.DIFF_UPDATE]||null==e[EditorUi.DIFF_UPDATE][k]||null==e[EditorUi.DIFF_UPDATE][k].previous&&null==e[EditorUi.DIFF_UPDATE][k].parent)&&(g[q]=k);q=k}n=mxUtils.bind(this,function(f,g){var k=null!=f?f.getId():"";if(null!=f&&g){var l=
|
|
|
|
|
c.getCell(k);null!=l&&l!=f&&(f=null)}null!=f&&(c.getChildAt(b,m)!=f&&c.add(b,f,m),this.patchCellRecursive(a,c,f,d,e),m++);return k});for(q=[null];0<q.length;)if(f=q.shift(),f=n(null!=f?f.child:null,null!=f?f.insert:!1),k=g[f],null!=k&&(delete g[f],q.push({child:c.getCell(k)})),k=l[f],null!=k&&(delete l[f],q.push({child:this.getCellForJson(k),insert:!0})),0==q.length){for(f in g)q.push({child:c.getCell(g[f])}),delete g[f];for(f in l)q.push({child:this.getCellForJson(l[f]),insert:!0}),delete l[f]}}};
|
|
|
|
|
EditorUi.prototype.patchCellRecursive=function(a,c,b,d,e){if(null!=b){for(var g=d[b.getId()],l=null!=g&&null!=g.inserted?g.inserted:{},g=null!=g&&null!=g.moved?g.moved:{},m=0,n=c.getChildCount(b),q="",f=0;f<n;f++){var k=c.getChildAt(b,f).getId();null==g[q]&&(null==e[EditorUi.DIFF_UPDATE]||null==e[EditorUi.DIFF_UPDATE][k]||null==e[EditorUi.DIFF_UPDATE][k].previous&&null==e[EditorUi.DIFF_UPDATE][k].parent)&&(g[q]=k);q=k}n=mxUtils.bind(this,function(f,g){var l=null!=f?f.getId():"";if(null!=f&&g){var k=
|
|
|
|
|
c.getCell(l);null!=k&&k!=f&&(f=null)}null!=f&&(c.getChildAt(b,m)!=f&&c.add(b,f,m),this.patchCellRecursive(a,c,f,d,e),m++);return l});for(q=[null];0<q.length;)if(f=q.shift(),f=n(null!=f?f.child:null,null!=f?f.insert:!1),k=g[f],null!=k&&(delete g[f],q.push({child:c.getCell(k)})),k=l[f],null!=k&&(delete l[f],q.push({child:this.getCellForJson(k),insert:!0})),0==q.length){for(f in g)q.push({child:c.getCell(g[f])}),delete g[f];for(f in l)q.push({child:this.getCellForJson(l[f]),insert:!0}),delete l[f]}}};
|
|
|
|
|
EditorUi.prototype.patchCell=function(a,c,b,d){if(null!=c&&null!=b){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))"value"in b?a.setValue(c,b.value):null!=b.xmlValue&&a.setValue(c,mxUtils.parseXml(b.xmlValue).documentElement);null!=d&&null!=d.style||null==b.style||a.setStyle(c,b.style);null!=b.visible&&a.setVisible(c,1==b.visible);null!=b.collapsed&&a.setCollapsed(c,1==b.collapsed);null!=b.vertex&&(c.vertex=1==b.vertex);null!=b.edge&&(c.edge=1==b.edge);null!=b.connectable&&(c.connectable=
|
|
|
|
|
1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var e in b)this.cellProperties[e]||(c[e]=b[e])}};
|
|
|
|
|
EditorUi.prototype.getPagesForNode=function(a,c){var b=this.editor.extractGraphModel(a,!0);null!=b&&(a=b);var b=a.getElementsByTagName(c||"diagram"),d=[];if(0<b.length)for(var e=0;e<b.length;e++){var g=new DiagramPage(b[e]);this.updatePageRoot(g);d.push(g)}else"mxGraphModel"==a.nodeName&&(g=new DiagramPage(a.ownerDocument.createElement("diagram")),g.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(g.node,Graph.compressNode(a)),d.push(g));return d};
|
|
|
|
@ -8583,13 +8583,14 @@ a=Math.round(a)-.5;n=Math.round(n)-.5;null!=this.state.fontBackgroundColor&&(thi
|
|
|
|
|
mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(a){0==this.waitCounter?a():this.onComplete=a};DrawioClient=function(a,c){mxEventSource.call(this);this.ui=a;this.cookieName=c;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(a){this.user=a;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user};
|
|
|
|
|
DrawioClient.prototype.clearPersistentToken=function(){if(isLocalStorage)localStorage.removeItem("."+this.cookieName),sessionStorage.removeItem("."+this.cookieName);else if("undefined"!=typeof Storage){var a=new Date;a.setYear(a.getFullYear()-1);document.cookie=this.cookieName+"=; expires="+a.toUTCString()}};
|
|
|
|
|
DrawioClient.prototype.getPersistentToken=function(a){var c=null;isLocalStorage&&(c=localStorage.getItem("."+this.cookieName),null==c&&a&&(c=sessionStorage.getItem("."+this.cookieName)));if(null==c&&"undefined"!=typeof Storage){var b=document.cookie;a=this.cookieName+"=";var d=b.indexOf(a);0<=d&&(d+=a.length,c=b.indexOf(";",d),0>c?c=b.length:postCookie=b.substring(c),c=b.substring(d,c),c=0<c.length?c:null,null!=c&&isLocalStorage&&(b=new Date,b.setYear(b.getFullYear()-1),document.cookie=a+"; expires="+
|
|
|
|
|
b.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+10);b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+b.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()};DrawioUser=function(a,c,b,d,e){this.id=a;this.email=c;this.displayName=b;this.pictureUrl=d;this.locale=e};DriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.desc=b};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.autosaveDelay=2E3;DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted};
|
|
|
|
|
b.toUTCString(),localStorage.setItem("."+this.cookieName,c)))}return c};DrawioClient.prototype.setPersistentToken=function(a,c){if(null!=a)if(isLocalStorage)c?sessionStorage.setItem("."+this.cookieName,a):localStorage.setItem("."+this.cookieName,a);else{if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()+10);b=this.cookieName+"="+a+"; path=/"+(c?"":"; expires="+b.toUTCString());"https"==document.location.protocol.toLowerCase()&&(b+=";secure");document.cookie=b}}else this.clearPersistentToken()};DrawioUser=function(a,c,b,d,e){this.id=a;this.email=c;this.displayName=b;this.pictureUrl=d;this.locale=e};DriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.desc=b};mxUtils.extend(DriveFile,DrawioFile);DriveFile.prototype.saveDelay=0;DriveFile.prototype.allChangesSavedKey="allChangesSavedInDrive";DriveFile.prototype.getSize=function(){return this.desc.fileSize};DriveFile.prototype.isRestricted=function(){return null!=this.desc.userPermission&&null!=this.desc.labels&&"reader"==this.desc.userPermission.role&&this.desc.labels.restricted};
|
|
|
|
|
DriveFile.prototype.isConflict=function(a){return null!=a&&null!=a.error&&412==a.error.code};DriveFile.prototype.getCurrentUser=function(){return null!=this.ui.drive?this.ui.drive.user:null};DriveFile.prototype.getMode=function(){return App.MODE_GOOGLE};
|
|
|
|
|
DriveFile.prototype.getPublicUrl=function(a){gapi.client.drive.permissions.list({fileId:this.desc.id}).execute(mxUtils.bind(this,function(c){if(null!=c&&null!=c.items)for(var b=0;b<c.items.length;b++)if("anyoneWithLink"===c.items[b].id||"anyone"===c.items[b].id){a(this.desc.webContentLink);return}a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};
|
|
|
|
|
DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.save=function(a,c,b,d,e){DrawioFile.prototype.save.apply(this,arguments);this.saveFile(null,a,c,b,d,e)};
|
|
|
|
|
DriveFile.prototype.saveFile=function(a,c,b,d,e,g){if(!this.isEditable())null!=b&&b();else if(!this.savingFile){var l=mxUtils.bind(this,function(a,g){var m=this.desc,f=this.isModified();this.setModified(!1);this.savingFile=!0;var k=this.isModified;this.isModified=function(){return!0};this.ui.drive.saveFile(this,g,mxUtils.bind(this,function(a,e){this.isModified=k;this.savingFile=!1;0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.min(8E3,Math.max(this.saveDelay+500,
|
|
|
|
|
DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(e,m,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b(a)}),d)):(this.setModified(f||this.isModified()),null!=d&&d(a))}),mxUtils.bind(this,function(b,c){this.savingFile=!1;this.isModified=k;this.setModified(f||this.isModified());this.isConflict(b)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(c,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();
|
|
|
|
|
l(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(b)}),e,e,a)});l(g,c)}};DriveFile.prototype.copyFile=function(a,c){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,c)}catch(b){c(b)}}),c,!0)};
|
|
|
|
|
DriveFile.prototype.saveFile=function(a,c,b,d,e,g){try{if(!this.isEditable())null!=b&&b();else if(!this.savingFile){var l=mxUtils.bind(this,function(a,g){try{var m=this.desc,f=this.isModified();this.setModified(!1);this.savingFile=!0;var k=this.isModified;this.isModified=function(){return!0};this.ui.drive.saveFile(this,g,mxUtils.bind(this,function(a,e){try{this.isModified=k,this.savingFile=!1,0!=a?(c&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.min(8E3,Math.max(this.saveDelay+
|
|
|
|
|
500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(e,m,mxUtils.bind(this,function(){this.contentChanged();null!=b&&b(a)}),d)):(this.setModified(f||this.isModified()),null!=d&&d(a))}catch(t){if(this.setModified(f||this.isModified()),null!=d)d(t);else throw t;}}),mxUtils.bind(this,function(b,c){try{this.savingFile=!1,this.isModified=k,this.setModified(f||this.isModified()),this.isConflict(b)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(c,mxUtils.bind(this,
|
|
|
|
|
function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=d&&d()}))):null!=d&&d()):null!=d&&d(b)}catch(t){if(this.setModified(f||this.isModified()),null!=d)d(t);else throw t;}}),e,e,a)}catch(p){if(null!=d)d(p);else throw p;}});l(g,c)}}catch(m){if(null!=d)d(m);else throw m;}};
|
|
|
|
|
DriveFile.prototype.copyFile=function(a,c){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,c)}catch(b){c(b)}}),c,!0)};
|
|
|
|
|
DriveFile.prototype.makeCopy=function(a,c,b){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,b),mxUtils.bind(this,function(b){this.desc=b;this.ui.spinner.stop();this.setModified(!1);this.backupPatch=null;this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();a()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=c&&c()}))};DriveFile.prototype.saveAs=function(a,c,b){this.ui.drive.copyFile(this.getId(),a,c,b)};
|
|
|
|
|
DriveFile.prototype.rename=function(a,c,b){var d=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(e){this.hasSameExtension(a,this.getTitle())?(this.desc=e,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(d),null!=c&&c(e)):(this.desc=e,null!=this.sync&&this.sync.descriptorChanged(d),this.save(!0,c,b))}),b)};
|
|
|
|
|
DriveFile.prototype.move=function(a,c,b){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=c&&c(a)}),b)};DriveFile.prototype.getTitle=function(){return this.desc.title};DriveFile.prototype.getHash=function(){return"G"+this.getId()};DriveFile.prototype.getId=function(){return this.desc.id};DriveFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&this.desc.editable};
|
|
|
|
@ -8607,52 +8608,55 @@ DriveClient.prototype.setUserId=function(a,c){if(c)if(isLocalStorage)localStorag
|
|
|
|
|
DriveClient.prototype.getUserId=function(){var a=null;null!=this.user&&(a=this.user.id);null==a&&isLocalStorage&&(a=localStorage.getItem(".guid"));if(null==a&&"undefined"!=typeof Storage){for(var c=document.cookie.split(";"),b=0;b<c.length;b++){var d=mxUtils.trim(c[b]);if("GUID="==d.substring(0,5)){a=d.substring(5);break}}null!=a&&isLocalStorage&&(c=new Date,c.setYear(c.getFullYear()-1),document.cookie="GUID=; expires="+c.toUTCString(),localStorage.setItem(".guid",a))}return a};
|
|
|
|
|
DriveClient.prototype.execute=function(a){var c=mxUtils.bind(this,function(b){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();a()}),mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.ui.drive.clearUserId();this.ui.drive.setUser(null);gapi.auth.signOut();this.ui.showError(mxResources.get("error"),
|
|
|
|
|
b,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,c)};
|
|
|
|
|
DriveClient.prototype.executeRequest=function(a,c,b){var d=!0,e=null,g=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var l=mxUtils.bind(this,function(){this.requestThread=null;this.currentRequest=a;null!=e&&window.clearTimeout(e);e=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);a.execute(mxUtils.bind(this,function(m){window.clearTimeout(e);if(d)if(null!=m&&null==m.error)null!=c&&c(m);else{var n=null!=m&&null!=
|
|
|
|
|
m.error?null!=m.error.data?m.error.data:m.error.errors:null,n=null!=n&&0<n.length?n[0].reason:null;null==b||null==m||null==m.error||-1!=m.error.code&&(403!=m.error.code||"domainPolicy"!=n&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=n)?403==m.error.code&&null!=this.user||401==m.error.code&&null!=this.user&&"authError"==n?null!=b&&b(m):this.execute(l):null!=m&&null!=m.error&&412!=m.error.code&&
|
|
|
|
|
404!=m.error.code&&400!=m.error.code&&this.currentRequest==a&&g<this.maxRetries?(g++,this.requestThread=window.setTimeout(l,Math.round(Math.pow(2,g)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=b&&b(m):b(m)}}))});null==gapi.auth.getToken()?this.execute(l):l()};
|
|
|
|
|
DriveClient.prototype.authorize=function(a,c,b,d){var e=this.getUserId();null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(e=this.ui.stateArg.userId);if(a&&null==e)null!=b&&b();else{var g={scope:this.scopes,client_id:this.clientId};a&&null!=e?(g.immediate=!0,g.user_id=e):(g.immediate=!1,g.authuser=-1);gapi.auth.authorize(g,mxUtils.bind(this,function(g){null!=g&&null==g.error?null!=this.user&&a&&this.user.id==e?null!=c&&c():this.updateUser(c,b,d):null!=b&&b(g);this.resetTokenRefresh(g)}))}};
|
|
|
|
|
DriveClient.prototype.executeRequest=function(a,c,b){try{var d=!0,e=null,g=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var l=mxUtils.bind(this,function(){try{this.requestThread=null,this.currentRequest=a,null!=e&&window.clearTimeout(e),e=window.setTimeout(mxUtils.bind(this,function(){d=!1;null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout),a.execute(mxUtils.bind(this,function(m){try{if(window.clearTimeout(e),d)if(null!=m&&null==m.error)null!=c&&c(m);else{var n=
|
|
|
|
|
null!=m&&null!=m.error?null!=m.error.data?m.error.data:m.error.errors:null,q=null!=n&&0<n.length?n[0].reason:null;null==b||null==m||null==m.error||-1!=m.error.code&&(403!=m.error.code||"domainPolicy"!=q&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=q)?403==m.error.code&&null!=this.user||401==m.error.code&&null!=this.user&&"authError"==q?null!=b&&b(m):this.execute(l):null!=m&&null!=m.error&&412!=
|
|
|
|
|
m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==a&&g<this.maxRetries?(g++,this.requestThread=window.setTimeout(l,Math.round(Math.pow(2,g)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=b&&b(m):b(m)}}catch(f){if(null!=b)b(f);else throw f;}}))}catch(m){if(null!=b)b(m);else throw m;}});null==gapi.auth.getToken()?this.execute(l):l()}catch(m){if(null!=b)b(m);else throw m;}};
|
|
|
|
|
DriveClient.prototype.authorize=function(a,c,b,d){try{var e=this.getUserId();null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(e=this.ui.stateArg.userId);if(a&&null==e)null!=b&&b();else{var g={scope:this.scopes,client_id:this.clientId};a&&null!=e?(g.immediate=!0,g.user_id=e):(g.immediate=!1,g.authuser=-1);gapi.auth.authorize(g,mxUtils.bind(this,function(g){try{null!=g&&null==g.error?null!=this.user&&a&&this.user.id==e?null!=c&&c():this.updateUser(c,b,d):null!=b&&b(g),this.resetTokenRefresh(g)}catch(m){if(null!=
|
|
|
|
|
b)b(m);else throw m;}}))}}catch(l){if(null!=b)b(l);else throw l;}};
|
|
|
|
|
DriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=a&&null==a.error&&0<a.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(a.expires_in),this.lastTokenRefresh=(new Date).getTime(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*a.expires_in))};
|
|
|
|
|
DriveClient.prototype.checkToken=function(a){var c=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();c&&this.fireEvent(new mxEventObject("disconnected"))})):a()};
|
|
|
|
|
DriveClient.prototype.updateUser=function(a,c,b){var d=gapi.auth.getToken().access_token;this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token="+d,mxUtils.bind(this,function(d){var e=JSON.parse(d);this.executeRequest(gapi.client.drive.about.get(),mxUtils.bind(this,function(c){var d=mxResources.get("notAvailable"),g=d,l=null;null!=c&&null!=c.user&&(d=c.user.emailAddress,g=c.user.displayName,l=null!=c.user.picture?c.user.picture.url:null);this.setUser(new DrawioUser(e.id,
|
|
|
|
|
d,g,l,e.locale));this.setUserId(e.id,b);null!=a&&a()}),c)}),c)};DriveClient.prototype.copyFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(gapi.client.drive.files.copy({fileId:a,fields:this.allFields,supportsTeamDrives:!0,resource:{title:c,properties:[{key:"channel",value:Editor.guid()}]}}),b,d)};DriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),b,d)};
|
|
|
|
|
DriveClient.prototype.updateUser=function(a,c,b){try{var d=gapi.auth.getToken().access_token;this.ui.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token="+d,mxUtils.bind(this,function(d){var e=JSON.parse(d);this.executeRequest(gapi.client.drive.about.get(),mxUtils.bind(this,function(c){var d=mxResources.get("notAvailable"),g=d,l=null;null!=c&&null!=c.user&&(d=c.user.emailAddress,g=c.user.displayName,l=null!=c.user.picture?c.user.picture.url:null);this.setUser(new DrawioUser(e.id,
|
|
|
|
|
d,g,l,e.locale));this.setUserId(e.id,b);null!=a&&a()}),c)}),c)}catch(e){if(null!=c)c(e);else throw e;}};DriveClient.prototype.copyFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(gapi.client.drive.files.copy({fileId:a,fields:this.allFields,supportsTeamDrives:!0,resource:{title:c,properties:[{key:"channel",value:Editor.guid()}]}}),b,d)};DriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),b,d)};
|
|
|
|
|
DriveClient.prototype.moveFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:c}]}),b,d)};DriveClient.prototype.createDriveRequest=function(a,c){return gapi.client.request({path:"/drive/v2/files/"+a,method:"PUT",params:{uploadType:"multipart",supportsTeamDrives:!0},headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(c)})};DriveClient.prototype.getLibrary=function(a,c,b){return this.getFile(a,c,b,!0,!0)};
|
|
|
|
|
DriveClient.prototype.loadDescriptor=function(a,c,b,d){this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:null!=d?d:this.allFields,supportsTeamDrives:!0}),c,b)};DriveClient.prototype.getCustomProperty=function(a,c){var b=a.properties,d=null;if(null!=b)for(var e=0;e<b.length;e++)if(b[e].key==c){d=b[e].value;break}return d};
|
|
|
|
|
DriveClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;e=null!=e?e:!1;null!=urlParams.rev?this.executeRequest(gapi.client.drive.revisions.get({fileId:a,revisionId:urlParams.rev,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){a.title=a.originalFilename;this.getXmlFile(a,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){if(null!=this.user){var g=/\.png$/i.test(a.title);/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&g?(g=a.downloadUrl+
|
|
|
|
|
"&access_token="+gapi.auth.getToken().access_token,this.ui.convertFile(g,a.title,a.mimeType,this.extension,c,b)):d||e||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,e):this.isGoogleRealtimeMimeType(a.mimeType)?this.convertRealtimeFile(a,c,b):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}),b)};DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
|
|
|
|
|
DriveClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;e=null!=e?e:!1;null!=urlParams.rev?this.executeRequest(gapi.client.drive.revisions.get({fileId:a,revisionId:urlParams.rev,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){a.title=a.originalFilename;this.getXmlFile(a,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var g=/\.png$/i.test(a.title);if(/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&g){var m=
|
|
|
|
|
a.downloadUrl+"&access_token="+gapi.auth.getToken().access_token;this.ui.convertFile(m,a.title,a.mimeType,this.extension,c,b)}else d||e||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,e):this.isGoogleRealtimeMimeType(a.mimeType)?this.convertRealtimeFile(a,c,b):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(n){if(null!=b)b(n);else throw n;}}),b)};
|
|
|
|
|
DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
|
|
|
|
|
DriveClient.prototype.getRealtimeData=function(a,c,b,d){this.executeRequest(gapi.client.drive.realtime.get({fileId:a,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d=null!=d.result?d.result.data:null;null!=d&&null!=d.value&&null!=d.value.diagrams?c(d):null!=b&&b({message:"realtime.get returned invalid data for "+a})}),mxUtils.bind(this,function(e){null==d&&(d=0);3>d?window.setTimeout(mxUtils.bind(this,function(){this.getRealtimeData(a,c,b,d+1)}),100*(d+1)):null!=b&&b({message:"realtime.get failed for "+
|
|
|
|
|
a})}))};DriveClient.prototype.loadRealtime=function(a,c,b){"1"==urlParams.ignoremime||"420247213240"!=this.appId||"application/vnd.jgraph.mxfile.realtime"!=a.mimeType&&"application/mxr"!=a.mimeType?c():this.redirectToNewApp(b,a.id)};
|
|
|
|
|
DriveClient.prototype.getXmlFile=function(a,c,b,d,e){d=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+d,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||e)a.mimeType!=this.libraryMimeType||e?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var g=d.lastIndexOf(",");if(0<g){var m=this.ui.extractGraphModelFromPng(d.substring(g+
|
|
|
|
|
1));if(null!=m&&0<m.length)d=m;else try{var n=atob(d.substring(g+1));null==n||"<mxfile "!==n.substring(0,8)&&"<mxGraphModel "!==n.substring(0,14)&&"<mxGraphModel>"!==n.substring(0,14)||(d=n)}catch(q){}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(n=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));c(new DriveFile(this.ui,d,a))}}catch(q){if(null!=b)b(q);else throw q;}}),b,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,
|
|
|
|
|
9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))};
|
|
|
|
|
DriveClient.prototype.saveFile=function(a,c,b,d,e,g,l,m){if(a.isEditable()){var n=(new Date).getTime(),q=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var f=mxUtils.bind(this,function(e,f,k){var p=null,t=!1,u={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)&&(u.mimeType=this.xmlMimeType,p=a.desc,t=c=!0);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&
|
|
|
|
|
m.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",value:Editor.guid(32)}));k||(null!=e||g||(e=this.placeholderThumbnail,f=this.placeholderMimeType),null!=e&&null!=f&&(u.thumbnail={image:e,mimeType:f}));var y=a.getData(),v=mxUtils.bind(this,function(c){a.saveDelay=(new Date).getTime()-n;b(c,y);null!=p&&(this.executeRequest(gapi.client.drive.revisions.get({fileId:p.id,revisionId:p.headRevisionId,supportsTeamDrives:!0}),
|
|
|
|
|
mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:p.id,revisionId:p.headRevisionId,resource:a}))}))),EditorUi.logEvent({category:"RT-CONVERT-"+a.convertedFrom,action:"from-"+p.id+"."+p.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId+"-",label:null!=this.user?this.user.id:"unknown-user"}))}),I=mxUtils.bind(this,function(b,f){null!=m&&(u.properties=m);var g=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=
|
|
|
|
|
DrawioFile.SYNC?null:a.getCurrentEtag(),k=0,n=mxUtils.bind(this,function(e){var l=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),u,b,c||e||l,f,e?null:g,t),v,mxUtils.bind(this,function(b){a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){if(null!=c&&c.etag==g)if(k<this.maxRetries)k++,
|
|
|
|
|
window.setTimeout(n,2*k*this.coolOff*(1+.1*(Math.random()-.5)));else{n(!0);try{EditorUi.sendReport("Warning: Stale Etag Overwrite "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")),EditorUi.logError("Warning: Stale Etag Overwrite",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(P){}}else null!=d&&d(b,c)}),mxUtils.bind(this,function(){null!=d&&d(b)})):
|
|
|
|
|
d(b)}))});if(q&&null==e){var p=new Image;p.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/p.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(p.height*a);b.getContext("2d").drawImage(p,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");u.thumbnail={image:c,mimeType:"image/png"};n(!1)}catch(M){n(!1)}});p.src="data:image/png;base64,"+b}else n(!1)});q?this.ui.getEmbeddedPng(mxUtils.bind(this,
|
|
|
|
|
function(a){I(a,!0)}),d,this.ui.getCurrentFile()!=a?y:null):I(y,!1)}),k=mxUtils.bind(this,function(){(g||q||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(t){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,
|
|
|
|
|
"_");f(b,"image/png")})))&&f(null,null,a.constructor!=DriveLibrary)});e||!c?k():this.verifyMimeType(a.getId(),k,!0)}else this.ui.editor.graph.reset(),null!=d&&d({message:mxResources.get("readOnly")})};
|
|
|
|
|
DriveClient.prototype.getXmlFile=function(a,c,b,d,e){try{var g=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+g,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||e)a.mimeType!=this.libraryMimeType||e?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var g=d.lastIndexOf(",");if(0<g){var l=this.ui.extractGraphModelFromPng(d.substring(g+
|
|
|
|
|
1));if(null!=l&&0<l.length)d=l;else try{var q=atob(d.substring(g+1));null==q||"<mxfile "!==q.substring(0,8)&&"<mxGraphModel "!==q.substring(0,14)&&"<mxGraphModel>"!==q.substring(0,14)||(d=q)}catch(f){}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(q=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(q):Base64.decode(q));c(new DriveFile(this.ui,d,a))}}catch(f){if(null!=b)b(f);else throw f;}}),b,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,
|
|
|
|
|
9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))}catch(l){if(null!=b)b(l);else throw l;}};
|
|
|
|
|
DriveClient.prototype.saveFile=function(a,c,b,d,e,g,l,m){var n=mxUtils.bind(this,function(b){try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(t){}if(null!=d)d(b);else throw b;});try{if(a.isEditable()){var q=(new Date).getTime(),f=this.ui.useCanvasForExport&&
|
|
|
|
|
/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var k=mxUtils.bind(this,function(e,k,p){try{var t=null,u=!1,y={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)&&(y.mimeType=this.xmlMimeType,t=a.desc,u=c=!0);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&m.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",
|
|
|
|
|
value:Editor.guid(32)}));p||(null!=e||g||(e=this.placeholderThumbnail,k=this.placeholderMimeType),null!=e&&null!=k&&(y.thumbnail={image:e,mimeType:k}));var x=a.getData(),v=mxUtils.bind(this,function(c){try{a.saveDelay=(new Date).getTime()-q,b(c,x),null!=t&&(this.executeRequest(gapi.client.drive.revisions.get({fileId:t.id,revisionId:t.headRevisionId,supportsTeamDrives:!0}),mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:t.id,
|
|
|
|
|
revisionId:t.headRevisionId,resource:a}))}))),EditorUi.logEvent({category:"RT-CONVERT-"+a.convertedFrom,action:"from-"+t.id+"."+t.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId+"-",label:null!=this.user?this.user.id:"unknown-user"}))}catch(D){n(D)}}),F=mxUtils.bind(this,function(b,g){try{null!=m&&(y.properties=m);var k=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),p=0,q=mxUtils.bind(this,function(e){try{var f=a.desc.mimeType!=this.xmlMimeType&&
|
|
|
|
|
a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),y,b,c||e||f,g,e?null:k,u),v,mxUtils.bind(this,function(b){try{a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){try{if(null!=c&&c.etag==k)if(p<this.maxRetries)p++,window.setTimeout(q,2*p*this.coolOff*(1+.1*(Math.random()-.5)));else{q(!0);try{EditorUi.sendReport("Warning: Stale Etag Overwrite "+
|
|
|
|
|
(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")),EditorUi.logError("Warning: Stale Etag Overwrite",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(P){}}else null!=d&&d(b,c)}catch(P){n(P)}}),mxUtils.bind(this,function(){null!=d&&d(b)})):d(b)}catch(O){n(O)}}))}catch(M){n(M)}});if(f&&null==e){var t=new Image;t.onload=mxUtils.bind(this,function(){try{var a=
|
|
|
|
|
this.thumbnailWidth/t.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(t.height*a);b.getContext("2d").drawImage(t,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");y.thumbnail={image:c,mimeType:"image/png"};q(!1)}catch(O){q(!1)}});t.src="data:image/png;base64,"+b}else q(!1)}catch(B){n(B)}});f?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){F(a,!0)}),d,this.ui.getCurrentFile()!=a?x:null):F(x,
|
|
|
|
|
!1)}catch(A){n(A)}}),p=mxUtils.bind(this,function(){(g||f||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(x){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");k(b,"image/png")}catch(x){n(x)}})))&&
|
|
|
|
|
k(null,null,a.constructor!=DriveLibrary)});e||!c?p():this.verifyMimeType(a.getId(),p,!0)}else this.ui.editor.graph.reset(),null!=d&&d({message:mxResources.get("readOnly")})}catch(v){n(v)}};
|
|
|
|
|
DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(b||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=
|
|
|
|
|
c&&c()})))};
|
|
|
|
|
DriveClient.prototype.redirectToNewApp=function(a,c){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+this.newAppHostname+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#G"+c,d=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null!=a?this.ui.confirm(mxResources.get("redirectToNewApp"),d,mxUtils.bind(this,function(){this.redirectDialogShowing=
|
|
|
|
|
!1;null!=a&&a()})):this.ui.alert(mxResources.get("redirectToNewApp"),d)}};DriveClient.prototype.insertFile=function(a,c,b,d,e,g,l){g=null!=g?g:this.xmlMimeType;a={mimeType:g,title:a};null!=b&&(a.parents=[{kind:"drive#fileLink",id:b}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,l),mxUtils.bind(this,function(a){g==this.libraryMimeType?d(new DriveLibrary(this.ui,c,a)):0==a?null!=e&&e({message:mxResources.get("errorSavingFile")}):d(new DriveFile(this.ui,c,a))}),e)};
|
|
|
|
|
DriveClient.prototype.createUploadRequest=function(a,c,b,d,e,g,l){e=null!=e?e:!1;var m={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=g&&(m["If-Match"]=g);a={path:"/upload/drive/v2/files"+(null!=a?"/"+a:""),method:null!=a?"PUT":"POST",params:{uploadType:"multipart"},headers:m,body:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+
|
|
|
|
|
(null!=b?e?b:Base64.encode(b):"")+"\r\n---------314159265358979323846--"};d||(a.params.newRevision=!1);l&&(a.params.pinned=!0);a.params.supportsTeamDrives=!0;a.params.fields=this.allFields;return gapi.client.request(a)};
|
|
|
|
|
DriveClient.prototype.pickFile=function(a,c){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,d=c?"genericPicker":"filePicker",e=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==
|
|
|
|
|
mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",e),this[d].setVisible(!1))});if(null==this[d]||this[d+"Token"]!=a){this[d+"Token"]=a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),g=(new google.picker.DocsView).setIncludeFolders(!0),l=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),m=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(a.setMimeTypes("*/*"),g.setMimeTypes("*/*"),l.setMimeTypes("*/*")):
|
|
|
|
|
(a.setMimeTypes(this.mimeTypes),g.setMimeTypes(this.mimeTypes),l.setMimeTypes(this.mimeTypes));this[d]=(new google.picker.PickerBuilder).setOAuthToken(this[d+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(a).addView(g).addView(l).addView(google.picker.ViewId.RECENTLY_PICKED).addView(m).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
|
|
|
|
|
"click",e);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",e);this[d].setVisible(!0)}))};
|
|
|
|
|
DriveClient.prototype.pickFolder=function(a,c){this.folderPickerCallback=a;var b=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,b=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",b),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=
|
|
|
|
|
a){this.folderPickerToken=a;var a=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),l=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=
|
|
|
|
|
(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(a).addView(c).addView(l).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
|
|
|
|
|
"click",b);this.folderPickerCallback(a)})).build()}mxEvent.addListener(document,"click",b);this.folderPicker.setVisible(!0)}))});c?b():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){b()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)};
|
|
|
|
|
DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(b).className&&
|
|
|
|
|
(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))}),b=gapi.auth.getToken().access_token;if(null==this.libraryPicker||this.libraryPickerToken!=b){this.libraryPickerToken=b;var b=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),d=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),
|
|
|
|
|
e=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),g=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(b).addView(d).addView(e).addView(google.picker.ViewId.RECENTLY_PICKED).addView(g).setCallback(mxUtils.bind(this,
|
|
|
|
|
function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}))};
|
|
|
|
|
DriveClient.prototype.showPermissions=function(a){var c=mxUtils.bind(this,function(){var b=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(b.container,360,190,!0,!0);b.init()});this.sharingFailed?c():this.checkToken(mxUtils.bind(this,function(){var b=new gapi.drive.share.ShareClient(this.appId);
|
|
|
|
|
DriveClient.prototype.pickFile=function(a,c){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,d=c?"genericPicker":"filePicker",e=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==
|
|
|
|
|
mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",e),this[d].setVisible(!1))});if(null==this[d]||this[d+"Token"]!=a){this[d+"Token"]=a;var g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),l=(new google.picker.DocsView).setIncludeFolders(!0),m=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(g.setMimeTypes("*/*"),l.setMimeTypes("*/*"),m.setMimeTypes("*/*")):
|
|
|
|
|
(g.setMimeTypes(this.mimeTypes),l.setMimeTypes(this.mimeTypes),m.setMimeTypes(this.mimeTypes));this[d]=(new google.picker.PickerBuilder).setOAuthToken(this[d+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(g).addView(l).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).addView(n).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
|
|
|
|
|
"click",e);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",e);this[d].setVisible(!0)}catch(q){this.ui.spinner.stop(),this.ui.handleError(q)}}))};
|
|
|
|
|
DriveClient.prototype.pickFolder=function(a,c){this.folderPickerCallback=a;var b=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=gapi.auth.getToken().access_token,b=mxUtils.bind(this,function(a){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(a).className&&(mxEvent.removeListener(document,"click",b),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||
|
|
|
|
|
this.folderPickerToken!=a){this.folderPickerToken=a;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),l=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),m=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");
|
|
|
|
|
this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(l).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
|
|
|
|
|
"click",b);this.folderPickerCallback(a)})).build()}mxEvent.addListener(document,"click",b);this.folderPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))}catch(d){this.ui.handleError(d)}});c?b():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){b()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)};
|
|
|
|
|
DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==
|
|
|
|
|
mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))}),b=gapi.auth.getToken().access_token;if(null==this.libraryPicker||this.libraryPickerToken!=b){this.libraryPickerToken=b;var d=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),e=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+
|
|
|
|
|
",application/xml,text/plain,application/octet-stream"),g=(new google.picker.DocsView).setEnableTeamDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),l=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(d).addView(e).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(l).setCallback(mxUtils.bind(this,
|
|
|
|
|
function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}catch(m){this.ui.spinner.stop(),this.ui.handleError(m)}}))};
|
|
|
|
|
DriveClient.prototype.showPermissions=function(a){var c=mxUtils.bind(this,function(){var b=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(b.container,360,190,!0,!0);b.init()});this.sharingFailed?c():this.checkToken(mxUtils.bind(this,function(){try{var b=new gapi.drive.share.ShareClient(this.appId);
|
|
|
|
|
b.setOAuthToken(gapi.auth.getToken().access_token);b.setItemIds([a]);b.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,d=0;d<a.length;d++)for(var l=0;l<a[d].addedNodes.length;l++){var m=a[d].addedNodes[l];"BUTTON"==m.nodeName&&"ok"==m.getAttribute("name")&&null!=m.parentNode&&null!=m.parentNode.parentNode&&"dialog"==m.parentNode.parentNode.getAttribute("role")?
|
|
|
|
|
(this.sharingFailed=!0,m.click(),c(),b=!0):"DIV"==m.nodeName&&"shr-q-shr-r-shr-xb"==m.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}))};DriveClient.prototype.getRealtimeAge=function(a,c){var b=null!=c&&null!=c.value&&null!=c.value.modifiedDate?c.value.modifiedDate.json:null,d=0;null!=b&&0<b&&(b=new Date(b),d=(new Date(a.modifiedDate)).getTime()-b.getTime());return d};
|
|
|
|
|
(this.sharingFailed=!0,m.click(),c(),b=!0):"DIV"==m.nodeName&&"shr-q-shr-r-shr-xb"==m.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(d){this.ui.handleError(d)}}))};DriveClient.prototype.getRealtimeAge=function(a,c){var b=null!=c&&null!=c.value&&null!=c.value.modifiedDate?c.value.modifiedDate.json:null,d=0;null!=b&&0<b&&(b=new Date(b),d=(new Date(a.modifiedDate)).getTime()-b.getTime());return d};
|
|
|
|
|
DriveClient.prototype.convertRealtimeFile=function(a,c,b){var d=mxUtils.bind(this,function(a){a.convertedFrom="xml";c(a)}),e=mxUtils.bind(this,function(a){a.convertedFrom="json";c(a)});this.getRealtimeData(a.id,mxUtils.bind(this,function(c){try{3E5>this.getRealtimeAge(a,c)?e(new DriveFile(this.ui,mxUtils.getXml(this.convertJsonToXml(c)),a)):this.getXmlFile(a,d,mxUtils.bind(this,function(){try{e(new DriveFile(this.ui,mxUtils.getXml(this.convertJsonToXml(c)),a))}catch(l){this.getXmlFile(a,d,b)}}))}catch(l){this.getXmlFile(a,
|
|
|
|
|
d,b)}}),mxUtils.bind(this,function(){this.getXmlFile(a,d,b)}))};DriveClient.prototype.convertJsonToXml=function(a,c){if(null==a.value||null==a.value.diagrams)throw Error("Invalid JSON: no diagrams in root map");for(var b=mxUtils.createXmlDocument().createElement("mxfile"),d=a.value.diagrams.value,e=0;e<d.length;e++)try{var g=this.decodeJsonPage(d[e].value,b.ownerDocument.createElement("diagram"),c);b.appendChild(g)}catch(l){throw Error("Error on page "+e+": "+l.stack);}return b};
|
|
|
|
|
DriveClient.prototype.decodeJsonPage=function(a,c,b){if(null==a)throw Error("Invalid JSON: json for page is null");var d=new mxCodec,e=this.createJsonCell(a.root,d);if(null==e)throw Error("Invalid JSON: no root cell for page");d=d.encode(new mxGraphModel(e));this.decodeJsonViewState(a,d);b?c.appendChild(d):mxUtils.setTextContent(c,Graph.compressNode(d));null!=a.id?c.setAttribute("id",a.id.json):c.setAttribute("id",Editor.guid());null!=a.name&&c.setAttribute("name",a.name.json);return c};
|
|
|
|
@ -8660,7 +8664,13 @@ DriveClient.prototype.decodeJsonViewState=function(a,c){var b=null!=a.pageFormat
|
|
|
|
|
"0");c.setAttribute("pageScale",null!=a.pageScale?a.pageScale.json:mxGraph.prototype.pageScale);c.setAttribute("math",null!=a.mathEnabled?a.mathEnabled.json:"0");c.setAttribute("shadow",null!=a.shadowVisible?a.shadowVisible.json:"0");return c};
|
|
|
|
|
DriveClient.prototype.createJsonCell=function(a,c){if(null!=a&&null!=a.id){var b=a.value,d=this.jsonToCell(b,c);c.putObject(a.id,d);d.source=null!=b.source?this.createJsonCell(b.source,c):null;d.target=null!=b.target?this.createJsonCell(b.target,c):null;this.createJsonCell(b.parent,c);for(var e=0;e<b.children.value.length;e++){var g=this.createJsonCell(b.children.value[e],c);if(null!=g)d.insert(g);else throw Error("Invalid JSON: no child "+e+" for cell "+a.id);}return d}return null!=a&&null!=a.ref?
|
|
|
|
|
c.objects[a.ref]:null};
|
|
|
|
|
DriveClient.prototype.jsonToCell=function(a,c){var b=new mxCell;b.id=a.cellId.json;b.vertex="vertex"==a.type.json;b.edge="edge"==a.type.json;b.connectable="0"!=a.connectable.json;b.collapsed="1"==a.collapsed.json;b.visible="0"!=a.visible.json;b.style=null!=a.style?a.style.json:null;b.value=null!=a.xmlValue?mxUtils.parseXml(a.xmlValue.json).documentElement:null!=a.value?a.value.json:null;b.geometry=null!=a.geometry?c.decode(mxUtils.parseXml(a.geometry.json).documentElement):null;return b};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};
|
|
|
|
|
DriveClient.prototype.jsonToCell=function(a,c){var b=new mxCell;b.id=a.cellId.json;b.vertex="vertex"==a.type.json;b.edge="edge"==a.type.json;b.connectable="0"!=a.connectable.json;b.collapsed="1"==a.collapsed.json;b.visible="0"!=a.visible.json;b.style=null!=a.style?a.style.json:null;b.value=null!=a.xmlValue?mxUtils.parseXml(a.xmlValue.json).documentElement:null!=a.value?a.value.json:null;b.geometry=null!=a.geometry?c.decode(mxUtils.parseXml(a.geometry.json).documentElement):null;return b};
|
|
|
|
|
DriveClient.prototype.convertRealtimeFiles=function(){var a=document.createElement("div");a.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:8px;background:#ffffff;z-index:2;overflow:auto;white-space:nowrap;line-height:1.5em;";document.body.appendChild(a);var c=mxUtils.bind(this,function(b,c){a.innerHTML+=b+(c?"":"<br>");a.scrollTop=a.scrollHeight});c("draw.io is searching files to be converted...");this.ui.spinner.spin(document.body,"Searching files...")?this.checkToken(mxUtils.bind(this,
|
|
|
|
|
function(){if(null!=this.user){var a={},d=0,e=0,g=0,l=0,m=mxUtils.bind(this,function(){this.ui.spinner.stop();c("<br>Conversion complete. Successfully converted "+d+" file(s).",!0);0<e?c(" Failed to convert "+e+' file(s).<br><br><b>ACTION REQUIRED:</b><br><ul><li>Click <a target="_blank" href="https://drive.google.com/drive/u/0/search?q=type:application/vnd.jgraph.mxfile.realtime">here</a> to list all affected files</li><li>Open each file in turn by right-clicking the file and selecting open with draw.io</li><li>Open each file in turn. When loaded, select File->Save</li></ul>'):
|
|
|
|
|
c("<br><br>This window can now be closed.")});this.executeRequest(gapi.client.drive.files.list({maxResults:1E4,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(b){this.ui.spinner.stop();l=null!=b&&null!=b.items?b.items.length:0;if(this.ui.spinner.spin(document.body,"Converting "+l+" file(s)")){c("Found "+l+" file(s). This will take up to "+Math.ceil(15E3*l/6E4)+" minute(s). <b>Please do not close this window!</b><br>");
|
|
|
|
|
var n=mxUtils.bind(this,function(b,k){var f={maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0};null!=b&&(f.pageToken=b);this.executeRequest(gapi.client.drive.files.list(f),mxUtils.bind(this,function(b){var f=mxUtils.bind(this,function(){null!=b.nextPageToken?n(b.nextPageToken):null!=b.nextPageToken?n(b.nextPageToken):m()});if(null==b||null!=b.items&&0!=b.items.length||null==b.nextPageToken)if(null!=b&&null!=b.items&&0<b.items.length){var p=
|
|
|
|
|
b.items[0].id;this.ui.spinner.stop();g++;this.ui.spinner.spin(document.body,"Converting file "+g+" of "+l)&&(c("Converting "+g+" of "+l+': "'+mxUtils.htmlEntities(b.items[0].title)+'" ('+p+")... ",!0),window.setTimeout(mxUtils.bind(this,function(){null==a[p]?(a[p]=!0,this.getFile(p,mxUtils.bind(this,function(a){this.saveFile(a,null,mxUtils.bind(this,function(){d++;c('<img src="'+Editor.checkmarkImage+'" border="0" valign="middle"/>');f()}),mxUtils.bind(this,function(a){a=null!=a&&null!=a.error&&null!=
|
|
|
|
|
a.error.message?a.error.message:"";e++;c('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+a);f()}))}))):(this.ui.spinner.stop(),c("Search returned duplicate file "+p+". Exiting.<br><br>This window can now be closed."))}),null!=k?k:15E3))}else m();else n(b.nextPageToken,1E4)}))});n()}}))}else this.ui.spinner.stop(),c("Not logged in. Exiting.<br><br>This window can now be closed.")})):(this.ui.spinner.stop(),c("Busy. <br><br>This window can now be closed."))};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};
|
|
|
|
|
DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};
|
|
|
|
|
DropboxFile.prototype.getRevisions=function(a,c){var b=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});b.then(mxUtils.bind(this,function(b){try{for(var d=[],g=b.entries.length-1;0<=g;g--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+
|
|
|
|
|
a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[g]);a(d)}catch(l){c(l)}}));b["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,b){this.doSave(this.getTitle(),c,b)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};
|
|
|
|
@ -8793,7 +8803,7 @@ mxUtils.bind(this,function(a){this.ui.spinner.stop();m.appendChild(n("../ [Up]",
|
|
|
|
|
null!=q&&q(b)}))});a()}),k=null,p=null,v=mxUtils.bind(this,function(g){null==g&&(e=0,m.innerHTML="",g=1);this.ui.spinner.spin(m,mxResources.get("loading"));null!=k&&null!=k.parentNode&&k.parentNode.removeChild(k);k=document.createElement("a");k.style.display="block";k.setAttribute("href","javascript:void(0);");mxUtils.write(k,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(m,"scroll",p);v(g+1)});mxEvent.addListener(k,"click",l);var t=mxUtils.bind(this,function(){Trello.get("search",
|
|
|
|
|
{query:""==mxUtils.trim(d)?"is:open":d,cards_limit:100,cards_page:g-1},mxUtils.bind(this,function(e){this.ui.spinner.stop();e=null!=e?e.cards:null;if(null==e||0==e.length)mxUtils.write(m,mxResources.get("noFiles"));else{1==g&&(m.appendChild(n(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,d,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(d=a,v())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
|
|
|
|
|
this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(m));for(var u=0;u<e.length;u++)mxUtils.bind(this,function(d){m.appendChild(n(d.name,mxUtils.bind(this,function(){a?(b=d.id,f()):(this.ui.hideDialog(),c(d.id))})))})(e[u]);100==e.length&&(m.appendChild(k),p=function(){m.scrollTop>=m.scrollHeight-m.offsetHeight&&l()},mxEvent.addListener(m,"scroll",p))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(t,q,!0):null!=q&&q({message:a.responseText})}))});t()});v()};
|
|
|
|
|
TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};App=function(a,c,b){EditorUi.call(this,a,c,null!=b?b:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&a.isModified()&&null!=this.drive&&EditorUi.logEvent({category:"Unload-Modified",action:a.getId(),label:null!=this.drive.user?this.drive.user.id:"unknown-user"})});mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
|
|
|
|
|
TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};App=function(a,c,b){EditorUi.call(this,a,c,null!=b?b:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&a.isModified()&&null!=this.drive&&EditorUi.logEvent({category:"Unload-Modified",action:a.getId(),label:null!=this.drive.user?this.drive.user.id:"unknown-user"})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
|
|
|
|
|
(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,b,c){var d=null;try{d=window.open(a)}catch(m){}null==d||void 0===d?this.showDialog((new PopupDialog(this,a,b,c)).container,320,140,!0,!0):null!=b&&b()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=
|
|
|
|
|
App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(d){null!=window.console&&console.log("Plugin Error:",d,App.DrawPlugins[a])}window.Draw.loadPlugin=mxUtils.bind(this,function(a){a(this)})}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";
|
|
|
|
|
App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL="js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":"js/onedrive/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.FOOTER_PLUGIN_URL="https://www.jgraph.com/drawio-footer.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";
|
|
|
|
@ -8831,10 +8841,10 @@ typeof window.Trello?(this.trello=new TrelloClient(this),this.trello.addListener
|
|
|
|
|
"420247213240"==this.drive.appId&&this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&(a=document.getElementById("geFooterItem2"),null!=a&&(a.innerHTML='<a href="https://support.draw.io/display/DO/2014/11/27/Switching+application+in+Google+Drive" target="_blank" title="IMPORTANT NOTICE">IMPORTANT NOTICE</a>'))}));this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries();
|
|
|
|
|
this.checkLicense()}));this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:"+App.GOOGLE_APIS,mxUtils.bind(this,function(b){null!=gapi.client&&gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null!=gapi.client.drive&&a()}))}))})),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=
|
|
|
|
|
b)});b()}if("1"!=urlParams.embed||"1"==urlParams.db){var d=mxUtils.bind(this,function(){"function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose?(window.DrawDropboxClientCallback=null,this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))):null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=d)});
|
|
|
|
|
d()}if("1"!=urlParams.embed){this.bg=this.createBackground();document.body.appendChild(this.bg);this.diagramContainer.style.visibility="hidden";this.formatContainer.style.visibility="hidden";this.hsplit.style.display="none";this.sidebarContainer.style.display="none";this.sidebarFooterContainer.style.display="none";"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode;var e=!0,g=window.setTimeout(mxUtils.bind(this,function(){e=!1;EditorUi.logEvent({category:"Cache",action:"alive",label:408})}),
|
|
|
|
|
this.timeout),l=(new Date).getTime();mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(a){window.clearTimeout(g);e&&EditorUi.logEvent({category:"Cache",action:"alive",label:a.getStatus()+"."+((new Date).getTime()-l)})}))}else null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();null!=this.menubar&&(this.buttonContainer=document.createElement("div"),this.buttonContainer.style.display="inline-block",this.buttonContainer.style.paddingRight="48px",this.buttonContainer.style.position=
|
|
|
|
|
"absolute",this.buttonContainer.style.right="0px",this.menubar.container.appendChild(this.buttonContainer));"atlas"==uiTheme&&null!=this.menubar&&(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display="none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.style.paddingTop="11px",this.icon.style.marginLeft="4px",this.icon.style.marginRight="6px",
|
|
|
|
|
mxClient.IS_QUIRKS&&(this.icon.style.marginTop="12px"),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild))};App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"cdn.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"jgraph.github.io"==window.location.hostname)};
|
|
|
|
|
d()}if("1"!=urlParams.embed){if(this.bg=this.createBackground(),document.body.appendChild(this.bg),this.diagramContainer.style.visibility="hidden",this.formatContainer.style.visibility="hidden",this.hsplit.style.display="none",this.sidebarContainer.style.display="none",this.sidebarFooterContainer.style.display="none","1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp){var e=!0,g=window.setTimeout(mxUtils.bind(this,function(){e=!1;
|
|
|
|
|
EditorUi.logEvent({category:"Cache",action:"alive",label:408})}),this.timeout),l=(new Date).getTime();mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(a){window.clearTimeout(g);e&&EditorUi.logEvent({category:"Cache",action:"alive",label:a.getStatus()+"."+((new Date).getTime()-l)})}))}}else null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();null!=this.menubar&&(this.buttonContainer=document.createElement("div"),this.buttonContainer.style.display=
|
|
|
|
|
"inline-block",this.buttonContainer.style.paddingRight="48px",this.buttonContainer.style.position="absolute",this.buttonContainer.style.right="0px",this.menubar.container.appendChild(this.buttonContainer));"atlas"==uiTheme&&null!=this.menubar&&(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display="none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),
|
|
|
|
|
this.icon.style.paddingTop="11px",this.icon.style.marginLeft="4px",this.icon.style.marginRight="6px",mxClient.IS_QUIRKS&&(this.icon.style.marginTop="12px"),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild))};App.prototype.isDriveDomain=function(){return"0"!=urlParams.drive&&("test.draw.io"==window.location.hostname||"cdn.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"jgraph.github.io"==window.location.hostname)};
|
|
|
|
|
App.prototype.isLegacyDriveDomain=function(){return 0==urlParams.drive||"legacy.draw.io"==window.location.hostname};App.prototype.getPusher=function(){null==this.pusher&&"function"===typeof window.Pusher&&(this.pusher=new Pusher(App.PUSHER_KEY,{cluster:App.PUSHER_CLUSTER,encrypted:!0}));return this.pusher};
|
|
|
|
|
App.prototype.checkLicense=function(){var a=this.drive.getUser(),c=("1"==urlParams.dev?urlParams.lic:null)||(null!=a?a.email:null);if(!this.isOffline()&&!this.editor.chromeless&&null!=c){var b=c.lastIndexOf("@"),d=c;0<=b&&(d=c.substring(b+1),c=this.crc32(c.substring(0,b))+"@"+d);mxUtils.post("/license","domain="+encodeURIComponent(d)+"&email="+encodeURIComponent(c)+"&ds="+encodeURIComponent(a.displayName)+"&lc="+encodeURIComponent(a.locale)+"&ts="+(new Date).getTime(),mxUtils.bind(this,function(a){try{if(200<=
|
|
|
|
|
a.getStatus()&&299>=a.getStatus()){var b=a.getText();if(0<b.length){var c=JSON.parse(b);null!=c&&this.handleLicense(c,d)}}}catch(m){}}))}};App.prototype.handleLicense=function(a,c){null!=a&&null!=a.plugins&&App.loadPlugins(a.plugins.split(";"),!0)};App.prototype.getEditBlankXml=function(){var a=this.getCurrentFile();return null!=a&&this.editor.isChromelessView()&&this.editor.graph.isLightboxView()?a.getData():this.getFileData(!0)};
|
|
|
|
@ -8857,7 +8867,7 @@ App.prototype.open=function(){try{if(null!=window.opener){var a=urlParams.create
|
|
|
|
|
-1:".png"==c.substring(c.length-4))&&(c=c.substring(0,c.length-4)+".xml");this.fileLoaded(mxClient.IS_IOS?new StorageFile(this,a,c):new LocalFile(this,a,c,e))}))}}catch(b){}};
|
|
|
|
|
App.prototype.loadGapi=function(a){"undefined"!==typeof gapi&&gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:"+App.GOOGLE_APIS,mxUtils.bind(this,function(c){null==gapi.client?(this.mode=this.drive=null,a()):gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null==gapi.client.drive&&(this.mode=this.drive=null);a()}))}))}))};
|
|
|
|
|
App.prototype.load=function(){if("1"!=urlParams.embed){if(this.spinner.spin(document.body,mxResources.get("starting"))){try{this.stateArg=null!=urlParams.state&&null!=this.drive?JSON.parse(decodeURIComponent(urlParams.state)):null}catch(a){}this.editor.graph.setEnabled(null!=this.getCurrentFile());null!=window.location.hash&&0!=window.location.hash.length||null==this.drive||null==this.stateArg||null==this.stateArg.userId||this.drive.setUserId(this.stateArg.userId);null!=urlParams.fileId?(window.location.hash=
|
|
|
|
|
"G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,function(){this.start()}))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})};
|
|
|
|
|
"G"+urlParams.fileId,window.location.search=this.getSearch(["fileId"])):null==this.drive?(this.mode==App.MODE_GOOGLE&&(this.mode=null),this.start()):this.loadGapi(mxUtils.bind(this,function(){"1"==urlParams["convert-realtime"]?(this.spinner.stop(),this.confirm("You are about to convert realtime files",mxUtils.bind(this,function(){this.drive.convertRealtimeFiles()}),mxUtils.bind(this,function(){this.start()}))):this.start()}))}}else this.restoreLibraries(),"1"==urlParams.gapi&&this.loadGapi(function(){})};
|
|
|
|
|
App.prototype.showRefreshDialog=function(a,c){if(!this.showingRefreshDialog&&(this.showingRefreshDialog=!0,this.showError(a||mxResources.get("externalChanges"),c||mxResources.get("redirectToNewApp"),mxResources.get("refresh"),mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.setModified(!1);this.spinner.spin(document.body,mxResources.get("connecting"));this.editor.graph.setEnabled(!1);window.location.reload()}),null,null,null,null,null,340,180),null!=this.dialog&&null!=this.dialog.container)){var b=
|
|
|
|
|
this.createRealtimeNotice();b.style.left="0";b.style.right="0";b.style.borderRadius="0";b.style.borderLeftStyle="none";b.style.borderRightStyle="none";b.style.marginBottom="26px";b.style.padding="8px 0 8px 0";this.dialog.container.appendChild(b)}};
|
|
|
|
|
App.prototype.showAlert=function(a){if(null!=a&&0<a.length){var c=document.createElement("div");c.className="geAlert";c.style.zIndex=2E9;c.style.left="50%";c.style.top="-100%";mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(c.style,"transition","all 1s ease");c.innerHTML=a;a=document.createElement("a");a.className="geAlertLink";a.style.textAlign="right";a.style.marginTop="20px";a.style.display="block";a.setAttribute("title",mxResources.get("close"));a.innerHTML=
|
|
|
|
@ -8876,18 +8886,18 @@ mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash
|
|
|
|
|
App.prototype.addLanguageMenu=function(a,c){var b=null;if((!this.isOfflineApp()||mxClient.IS_CHROMEAPP)&&null!=this.menus.get("language")){b=document.createElement("div");b.setAttribute("title",mxResources.get("language"));b.className="geIcon geSprite geSprite-globe";b.style.position="absolute";b.style.cursor="pointer";b.style.bottom="20px";b.style.right="20px";if(c){b.style.direction="rtl";b.style.textAlign="right";b.style.right="24px";var d=document.createElement("span");d.style.display="inline-block";
|
|
|
|
|
d.style.fontSize="12px";d.style.margin="5px 24px 0 0";d.style.color="gray";mxUtils.write(d,mxResources.get("language"));b.appendChild(d)}mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var c=new mxPopupMenu(this.menus.get("language").funct);c.div.className+=" geMenubarMenu";c.smartSeparators=!0;c.showDisabled=!0;c.autoExpand=!0;c.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(c,arguments);c.destroy()});var d=mxUtils.getOffset(b);
|
|
|
|
|
c.popup(d.x,d.y+b.offsetHeight,null,a);this.setCurrentMenu(c)}));a.appendChild(b)}return b};
|
|
|
|
|
App.prototype.pickFile=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var c=this.getPeerForMode(a);if(null!=c)c.pickFile();else if(a==App.MODE_DEVICE&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,
|
|
|
|
|
App.prototype.pickFile=function(a){try{if(a=null!=a?a:this.mode,a==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var c=this.getPeerForMode(a);if(null!=c)c.pickFile();else if(a==App.MODE_DEVICE&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,
|
|
|
|
|
"change",mxUtils.bind(this,function(){null!=b.files&&this.openFiles(b.files)}));b.click()}else{this.hideDialog();window.openNew=null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";var d=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,function(b,c){this.useCanvasForExport||".png"!=c.substring(c.length-4)||(c=c.substring(0,c.length-4)+".xml");this.fileLoaded(a==App.MODE_BROWSER?
|
|
|
|
|
new StorageFile(this,b,c):new LocalFile(this,b,c))}));var e=this.dialog,g=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;g.apply(e,arguments);null==this.getCurrentFile()&&this.showSplash()})}}};
|
|
|
|
|
new StorageFile(this,b,c):new LocalFile(this,b,c))}));var e=this.dialog,g=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;g.apply(e,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(l){this.handleError(l)}};
|
|
|
|
|
App.prototype.pickLibrary=function(a){a=null!=a?a:this.mode;if(a==App.MODE_GOOGLE||a==App.MODE_DROPBOX||a==App.MODE_ONEDRIVE||a==App.MODE_GITHUB||a==App.MODE_TRELLO){var c=a==App.MODE_GOOGLE?this.drive:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_TRELLO?this.trello:this.dropbox;null!=c&&c.pickLibrary(mxUtils.bind(this,function(a,b){if(null!=b)try{this.loadLibrary(b)}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}else this.spinner.spin(document.body,
|
|
|
|
|
mxResources.get("loading"))&&c.getLibrary(a,mxUtils.bind(this,function(a){this.spinner.stop();try{this.loadLibrary(a)}catch(m){this.handleError(m,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(a){this.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)}))}))}else if(a!=App.MODE_DEVICE||!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11){window.openNew=!1;window.openKey="open";var b=Editor.useLocalStorage;Editor.useLocalStorage=a==App.MODE_BROWSER;window.openFile=
|
|
|
|
|
new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,c){try{this.loadLibrary(a==App.MODE_BROWSER?new StorageLibrary(this,b,c):new LocalLibrary(this,b,c))}catch(l){this.handleError(l,mxResources.get("errorLoadingFile"))}}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=b;window.openFile=null})}else{var d=document.createElement("input");
|
|
|
|
|
d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){if(null!=d.files)for(var a=0;a<d.files.length;a++)mxUtils.bind(this,function(a){var b=new FileReader;b.onload=mxUtils.bind(this,function(b){try{this.loadLibrary(new LocalLibrary(this,b.target.result,a.name))}catch(n){this.handleError(n,mxResources.get("errorLoadingFile"))}});b.readAsText(a)})(d.files[a])}));d.click()}};
|
|
|
|
|
App.prototype.saveLibrary=function(a,c,b,d,e,g,l){d=null!=d?d:this.mode;e=null!=e?e:!1;g=null!=g?g:!1;var m=this.createLibraryDataFromImages(c),n=mxUtils.bind(this,function(a){this.spinner.stop();null!=l&&l();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==b&&d==App.MODE_DEVICE&&(b=new LocalLibrary(this,m,a));if(null==b)this.pickFolder(d,mxUtils.bind(this,function(b){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.drive.insertFile(a,
|
|
|
|
|
m,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,m,mxUtils.bind(this,
|
|
|
|
|
function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();
|
|
|
|
|
App.prototype.saveLibrary=function(a,c,b,d,e,g,l){try{d=null!=d?d:this.mode;e=null!=e?e:!1;g=null!=g?g:!1;var m=this.createLibraryDataFromImages(c),n=mxUtils.bind(this,function(a){this.spinner.stop();null!=l&&l();this.handleError(a,null!=a?mxResources.get("errorSavingFile"):null)});null==b&&d==App.MODE_DEVICE&&(b=new LocalLibrary(this,m,a));if(null==b)this.pickFolder(d,mxUtils.bind(this,function(b){d==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?
|
|
|
|
|
this.drive.insertFile(a,m,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,this.drive.libraryMimeType):d==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(a,
|
|
|
|
|
m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,m,mxUtils.bind(this,function(a){this.spinner.stop();
|
|
|
|
|
this.hideDialog(!0);this.libraryLoaded(a,c)}),n,b):d==App.MODE_BROWSER?(b=mxUtils.bind(this,function(){var b=new StorageLibrary(this,m,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,c)}),n)}),null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(e||this.spinner.spin(document.body,mxResources.get("saving"))){b.setData(m);var q=mxUtils.bind(this,
|
|
|
|
|
function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);g||this.libraryLoaded(b,c);null!=l&&l()}),n)});if(a!=b.getTitle()){var f=b.getHash();b.rename(a,mxUtils.bind(this,function(a){b.constructor!=LocalLibrary&&f!=b.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(b.getHash()));this.removeLibrarySidebar(f);q()}),n)}else q()}};
|
|
|
|
|
function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);g||this.libraryLoaded(b,c);null!=l&&l()}),n)});if(a!=b.getTitle()){var f=b.getHash();b.rename(a,mxUtils.bind(this,function(a){b.constructor!=LocalLibrary&&f!=b.getHash()&&(mxSettings.removeCustomLibrary(f),mxSettings.addCustomLibrary(b.getHash()));this.removeLibrarySidebar(f);q()}),n)}else q()}}catch(k){this.handleError(k)}};
|
|
|
|
|
App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();this.getCurrentFile()==b||b.isModified()||(b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==b.getTitle()||null==this.mode){var e=null!=b.getTitle()?b.getTitle():this.defaultFilename,g=!mxClient.IS_IOS||!navigator.standalone,l=this.mode,m=this.getServiceCount(!0);
|
|
|
|
|
isLocalStorage&&m++;var n=4>=m?2:6<m?4:3,e=new CreateDialog(this,e,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==l&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
|
|
|
|
|
this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,g,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,n,null,null,null,this.editor.fileExtensions);this.showDialog(e.container,460,m>n?390:270,!0,!0);e.init()}else this.save(b.getTitle(),
|
|
|
|
@ -9033,17 +9043,17 @@ a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var
|
|
|
|
|
null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var f=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),k=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),l=d.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,m,n){f=g?Math.min(1,Math.min(a.maxImageSize/
|
|
|
|
|
m,a.maxImageSize/n)):1;a.importFile(b,c,k,l,Math.round(m*f),Math.round(n*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,k,l,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b=
|
|
|
|
|
"text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},
|
|
|
|
|
c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("gh")+"...",null,function(){e(a.gitHub)},c);null!=a.trello?b.addItem(mxResources.get("trello")+
|
|
|
|
|
"...",null,function(){e(a.trello)},c):n&&"function"===typeof window.TrelloClient&&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.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=
|
|
|
|
|
new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){f(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}))).isEnabled=e;this.put("theme",new Menu(mxUtils.bind(this,
|
|
|
|
|
function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&b.addCheckmark(e,Editor.checkmarkImage);
|
|
|
|
|
e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();
|
|
|
|
|
a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,Editor.checkmarkImage)})));q=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&a!=b.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&
|
|
|
|
|
b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,
|
|
|
|
|
c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},c);null!=a.trello?
|
|
|
|
|
b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},c):n&&"function"===typeof window.TrelloClient&&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.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+
|
|
|
|
|
"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){f(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}))).isEnabled=e;this.put("theme",
|
|
|
|
|
new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&b.addCheckmark(e,
|
|
|
|
|
Editor.checkmarkImage);e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");
|
|
|
|
|
mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,Editor.checkmarkImage)})));q=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&a!=b.getTitle()&&this.editorUi.spinner.spin(document.body,
|
|
|
|
|
mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,
|
|
|
|
|
340,90,!0,!0);c.init()}}));q.isEnabled=function(){return this.enabled&&e.apply(this,arguments)};q.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.saveAs(c,mxUtils.bind(this,function(c){b.desc=
|
|
|
|
|
c;b.save(!1,mxUtils.bind(this,function(){a.spinner.stop();b.setModified(!1);b.addAllSavedStatus()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):a.createFile(c,a.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,a.editor.fileExtensions),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();if(b.getMode()==App.MODE_GOOGLE||b.getMode()==App.MODE_ONEDRIVE){var c=!1;if(b.getMode()==App.MODE_GOOGLE&&null!=b.desc.parents)for(var d=0;d<b.desc.parents.length;d++)if(b.desc.parents[d].isRoot){c=!0;break}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)}))}),
|
|
|
|
|
null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));
|
|
|
|
|
null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var b=a.getCurrentFile();null!=b&&a.drive.showPermissions(b.getId())}catch(y){a.handleError(y)}}));
|
|
|
|
|
this.put("embed",new Menu(mxUtils.bind(this,function(b,c){var d=a.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);"1"==urlParams.embed||a.isOffline()||this.addMenuItems(b,["-","googleDocs","googleSlides"],c)})));var t=function(b,c,d,e){("plantUml"!=
|
|
|
|
|
e||EditorUi.enablePlantUml&&!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);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)},x=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.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,l,m,n){b=parseInt(b);
|
|
|
|
@ -9062,7 +9072,7 @@ c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,functi
|
|
|
|
|
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+
|
|
|
|
|
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&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.pickLibrary(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(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){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.editor.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=
|
|
|
|
|
c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(E){a.handleError(E,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confCloud",null,"Confluence Cloud")+
|
|
|
|
|
c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(D){a.handleError(D,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confCloud",null,"Confluence Cloud")+
|
|
|
|
|
"...",null,function(){a.showRemotelyStoredLibrary(mxResources.get("confCloudLibs",null,"Confluence Cloud Libraries"))},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?
|
|
|
|
|
["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",
|
|
|
|
|
c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,
|
|
|
|
@ -9132,7 +9142,7 @@ this.model.setCollapsed(d[g],a))}for(g=0;g<f.length;g++)this.model.setVisible(f[
|
|
|
|
|
b?b.style:t.getCellStyle(a)).containerType);return b}function d(a){var b=!1;null!=a&&(a=x.getParent(a),b=t.view.getState(a),t.view.getState(a),b=null!=(null!=b?b.style:t.getCellStyle(a)).childLayout);return b}function m(a){a=t.view.getState(a);if(null!=a){var b=t.getIncomingEdges(a.cell);if(0<b.length&&(b=t.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 n(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=t.cloneCells([d[0],a]);t.model.setTerminal(e[0],t.model.getTerminal(d[0],!0),!0);var f=m(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;t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=t.view.getState(a),l=t.view.scale;if(null!=k){var n=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=t.getOutgoingEdges(t.model.getTerminal(d[0],!0));if(null!=p){for(var q=f==mxConstants.DIRECTION_SOUTH||
|
|
|
|
|
f==mxConstants.DIRECTION_NORTH,u=g=d=0;u<p.length;u++){var x=t.model.getTerminal(p[u],!1);if(f==m(x)){var v=t.view.getState(x);x!=a&&null!=v&&(q&&b!=v.getCenterX()<k.getCenterX()||!q&&b!=v.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,v)&&(d=10+Math.max(d,(Math.min(n.x+n.width,v.x+v.width)-Math.max(n.x,v.x))/l),g=10+Math.max(g,(Math.min(n.y+n.height,v.y+v.height)-Math.max(n.y,v.y))/l))}}q?g=0:d=0;for(u=0;u<p.length;u++)if(x=t.model.getTerminal(p[u],!1),f==m(x)&&(v=t.view.getState(x),x!=a&&null!=
|
|
|
|
|
f==mxConstants.DIRECTION_NORTH,x=g=d=0;x<p.length;x++){var u=t.model.getTerminal(p[x],!1);if(f==m(u)){var v=t.view.getState(u);u!=a&&null!=v&&(q&&b!=v.getCenterX()<k.getCenterX()||!q&&b!=v.getCenterY()<k.getCenterY())&&mxUtils.intersects(n,v)&&(d=10+Math.max(d,(Math.min(n.x+n.width,v.x+v.width)-Math.max(n.x,v.x))/l),g=10+Math.max(g,(Math.min(n.y+n.height,v.y+v.height)-Math.max(n.y,v.y))/l))}}q?g=0:d=0;for(x=0;x<p.length;x++)if(u=t.model.getTerminal(p[x],!1),f==m(u)&&(v=t.view.getState(u),u!=a&&null!=
|
|
|
|
|
v&&(q&&b!=v.getCenterX()<k.getCenterX()||!q&&b!=v.getCenterY()<k.getCenterY()))){var y=[];t.traverse(v.cell,!0,function(a,b){null!=b&&y.push(b);y.push(a);return!0});t.moveCells(y,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function q(a){t.model.beginUpdate();try{var b=m(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=
|
|
|
|
|
e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);t.moveCells(g,k,l);return t.addCells(d,e)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=t.model.getParent(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],
|
|
|
|
|
a]);t.model.setTerminal(d[0],a,!0);var c=t.getOutgoingEdges(a),e=b.geometry,f=[];t.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=t.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var l=t.view.getBounds(f),n=m(a),p=t.view.translate,q=t.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/q-p.x-e.x+10,d[1].geometry.y+=d[1].geometry.height-e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=
|
|
|
|
@ -9144,16 +9154,16 @@ a=t.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(t.mod
|
|
|
|
|
v.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);null!=a&&0<a.length&&t.setSelectionCell(t.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");v.actions.addAction("selectDescendants",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),b=[];t.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});t.setSelectionCells(b)}},null,null,"Alt+Shift+D");var u=t.removeCells;
|
|
|
|
|
t.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];x.isEdge(g)&&c(g)&&(e.push(g),g=x.getTerminal(g,!1));b(g)?(t.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=t.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return u.apply(this,arguments)};v.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
|
|
|
|
|
d))};var y=t.duplicateCells;t.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=y.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=t.getIncomingEdges(k[e]),g=t.getIncomingEdges(a[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,
|
|
|
|
|
t.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var C=t.moveCells;t.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||t.model.isEdge(a[q])&&null==t.model.getTerminal(a[q],!0)){f=t.model.getParent(a[q]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=
|
|
|
|
|
t.getIncomingEdges(a[0]);if(0<u.length){var x=t.view.getState(t.model.getTerminal(u[0],!0));if(null!=x){var v=t.view.getState(m);null!=v&&(c=(v.getCenterX()-x.getCenterX())/t.view.scale,d=(v.getCenterY()-x.getCenterY())/t.view.scale)}}}}l=C.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],m,!0);else if(b(a[q])&&(u=t.getIncomingEdges(a[q]),0<u.length))if(!e)b(m)&&
|
|
|
|
|
0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],m,!0);else if(0==t.getIncomingEdges(l[q]).length){n=m;if(null==n||n==t.model.getParent(a[q]))n=t.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,t.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=v.sidebar){var I=v.sidebar.dropAndConnect;v.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=I.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
|
|
|
|
|
null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var G={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},A=v.onKeyDown;v.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&&b(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&
|
|
|
|
|
(9==a.which?c=mxEvent.isShiftDown(a)?q(t.getSelectionCell()):f(t.getSelectionCell()):13==a.which&&(c=n(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=v.hoverIcons&&v.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=G[a.keyCode];
|
|
|
|
|
null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(M){console.log("error",M)}mxEvent.isConsumed(a)||A.apply(this,arguments)};var E=t.connectVertex;t.connectVertex=
|
|
|
|
|
function(a,c,d,e,g,k){var l=t.getIncomingEdges(a);return b(a)&&0<l.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?f(a):e==g?q(a):n(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):E.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&t.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 J=
|
|
|
|
|
t.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var C=t.moveCells;t.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||t.model.isEdge(a[q])&&null==t.model.getTerminal(a[q],!0)){f=t.model.getParent(a[q]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var x=
|
|
|
|
|
t.getIncomingEdges(a[0]);if(0<x.length){var u=t.view.getState(t.model.getTerminal(x[0],!0));if(null!=u){var v=t.view.getState(m);null!=v&&(c=(v.getCenterX()-u.getCenterX())/t.view.scale,d=(v.getCenterY()-u.getCenterY())/t.view.scale)}}}}l=C.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],m,!0);else if(b(a[q])&&(x=t.getIncomingEdges(a[q]),0<x.length))if(!e)b(m)&&
|
|
|
|
|
0>mxUtils.indexOf(a,this.model.getTerminal(x[0],!0))&&this.model.setTerminal(x[0],m,!0);else if(0==t.getIncomingEdges(l[q]).length){n=m;if(null==n||n==t.model.getParent(a[q]))n=t.model.getTerminal(x[0],!0);e=this.cloneCell(x[0]);this.addEdge(e,t.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=v.sidebar){var K=v.sidebar.dropAndConnect;v.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=K.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
|
|
|
|
|
null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var F={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},A=v.onKeyDown;v.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&&b(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&
|
|
|
|
|
(9==a.which?c=mxEvent.isShiftDown(a)?q(t.getSelectionCell()):f(t.getSelectionCell()):13==a.which&&(c=n(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=v.hoverIcons&&v.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=F[a.keyCode];
|
|
|
|
|
null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(M){console.log("error",M)}mxEvent.isConsumed(a)||A.apply(this,arguments)};var D=t.connectVertex;t.connectVertex=
|
|
|
|
|
function(a,c,d,e,g,k){var l=t.getIncomingEdges(a);return b(a)&&0<l.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?f(a):e==g?q(a):n(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):D.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&t.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 J=
|
|
|
|
|
mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){J.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);this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};
|
|
|
|
|
var F=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){F.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var D=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){D.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),
|
|
|
|
|
var E=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){E.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),
|
|
|
|
|
this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.graph;return a.concat([this.addEntry("tree container",function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",
|
|
|
|
|
function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");
|
|
|
|
|
c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
|
|
|
|
@ -9225,15 +9235,15 @@ b=mxResources.get(b);m.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":"")
|
|
|
|
|
"position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;visibility:hidden;";var g=k.diagramContainer.parentNode,v=document.createElement("div");v.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var H=k.menus.get("viewZoom");if(null!=H){this.tabContainer.style.right="70px";var B=p.addMenu("100%",
|
|
|
|
|
H.funct);B.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");B.style.whiteSpace="nowrap";B.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";B.style.backgroundPosition="right 6px center";B.style.backgroundRepeat="no-repeat";B.style.backgroundColor="#ffffff";B.style.paddingRight="10px";B.style.display="block";B.style.position="absolute";B.style.textDecoration="none";B.style.textDecoration="none";B.style.right="0px";B.style.bottom="0px";B.style.overflow="hidden";B.style.visibility=
|
|
|
|
|
"hidden";B.style.textAlign="center";B.style.color="#000";B.style.fontSize="12px";B.style.color="#707070";B.style.width="59px";B.style.cursor="pointer";B.style.borderTop="1px solid lightgray";B.style.borderLeft="1px solid lightgray";B.style.height=parseInt(k.tabContainerHeight)-1+"px";B.style.lineHeight=parseInt(k.tabContainerHeight)+1+"px";v.appendChild(B);H=mxUtils.bind(this,function(){B.innerHTML=Math.round(100*k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,
|
|
|
|
|
H);k.editor.addListener("resetGraphView",H);k.editor.addListener("pageSelected",H);var K=k.setGraphEnabled;k.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(B.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}v.appendChild(k.tabContainer);v.appendChild(m);v.appendChild(k.diagramContainer);g.appendChild(v);k.updateTabContainer();var M=null;f();mxEvent.addListener(window,
|
|
|
|
|
H);k.editor.addListener("resetGraphView",H);k.editor.addListener("pageSelected",H);var I=k.setGraphEnabled;k.setGraphEnabled=function(){I.apply(this,arguments);null!=this.tabContainer&&(B.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}v.appendChild(k.tabContainer);v.appendChild(m);v.appendChild(k.diagramContainer);g.appendChild(v);k.updateTabContainer();var M=null;f();mxEvent.addListener(window,
|
|
|
|
|
"resize",function(){f();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}};
|
|
|
|
|
(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,g,l){var d=c.y,e=c.x,q=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var k=this,p=new mxCellState,v=this.graph.getView().scale,t=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+e;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var x=[],z=[],u=0;u<this.states.length;u++){var y=this.states[u];y instanceof mxCellState&&(l||!this.graph.isCellSelected(y.cell))&&((p.x>=y.x&&p.x<=y.x+y.width||y.x>=p.x&&y.x<=p.x+p.width)&&(p.y>
|
|
|
|
|
y.y+y.height+4||p.y+p.height+4<y.y)?x.push(y):(p.y>=y.y&&p.y<=y.y+y.height||y.y>=p.y&&y.y<=p.y+p.height)&&(p.x>y.x+y.width+4||p.x+p.width+4<y.x)&&z.push(y))}var C=0,I=0,G=y=0,A=0,E=0,J=0,F=0,D=5*v;if(1<x.length){x.push(p);x.sort(function(a,b){return a.y-b.y});var H=!1,u=p==x[0],v=p==x[x.length-1];if(!u&&!v)for(u=1;u<x.length-1;u++)if(p==x[u]){v=x[u-1];u=x[u+1];y=I=G=(u.y-v.y-v.height-p.height)/2;break}for(u=0;u<x.length-1;u++){var v=x[u],B=x[u+1],K=p==v||p==B,B=B.y-v.y-v.height,H=H|p==v;if(0==I&&
|
|
|
|
|
0==C)I=B,C=1;else if(Math.abs(I-B)<=(K||1==u&&H?t:0))C+=1;else if(1<C&&H){x=x.slice(0,u+1);break}else if(3<=x.length-u&&!H)C=0,y=I=0!=G?G:0,x.splice(0,0==u?1:u),u=-1;else break;0!=y||K||(I=y=B)}3==x.length&&x[1]==p&&(y=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});H=!1;u=p==z[0];v=p==z[z.length-1];if(!u&&!v)for(u=1;u<z.length-1;u++)if(p==z[u]){v=z[u-1];u=z[u+1];J=E=F=(u.x-v.x-v.width-p.width)/2;break}for(u=0;u<z.length-1;u++){v=z[u];B=z[u+1];K=p==v||p==B;B=B.x-v.x-v.width;H|=p==
|
|
|
|
|
v;if(0==E&&0==A)E=B,A=1;else if(Math.abs(E-B)<=(K||1==u&&H?t:0))A+=1;else if(1<A&&H){z=z.slice(0,u+1);break}else if(3<=z.length-u&&!H)A=0,J=E=0!=F?F:0,z.splice(0,0==u?1:u),u=-1;else break;0!=J||K||(E=J=B)}3==z.length&&z[1]==p&&(J=0)}t=function(a,b,c,d){var e=[],f;d?(d=D,f=0):(d=0,f=D);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
|
|
|
|
|
mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(k.graph.getView().getOverlayPane());return a};E=function(a,b){if(a&&null!=k.guidesArrHor)for(var c=0;c<k.guidesArrHor.length;c++)k.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=k.guidesArrVer)for(c=0;c<k.guidesArrVer.length;c++)k.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];F=k.guidesArrHor;q=[];e=0;u=z[0]==p?1:0;H=z[u].y+z[u].height;if(0<J)for(u=0;u<z.length-1;u++)v=
|
|
|
|
|
z[u],B=z[u+1],p==v?(e=B.x-v.width-J,q.push(new mxPoint(e+v.width+D,H)),q.push(new mxPoint(B.x-D,H))):p==B?(q.push(new mxPoint(v.x+v.width+D,H)),e=v.x+v.width+J,q.push(new mxPoint(e-D,H))):(q.push(new mxPoint(v.x+v.width+D,H)),q.push(new mxPoint(B.x-D,H)));else v=z[0],u=z[2],e=v.x+v.width+(u.x-v.x-v.width-p.width)/2,q.push(new mxPoint(v.x+v.width+D,H)),q.push(new mxPoint(e-D,H)),q.push(new mxPoint(e+p.width+D,H)),q.push(new mxPoint(u.x-D,H));for(u=0;u<q.length;u+=2)z=q[u],J=q[u+1],z=t(z,J,null!=F?
|
|
|
|
|
F[u/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(u=q.length/2;null!=F&&u<F.length;u++)F[u].destroy();k.guidesArrHor=A;e-=b.x;q=!0}else E(!0);if(1<C&&C==x.length-1){A=[];F=k.guidesArrVer;f=[];d=0;u=x[0]==p?1:0;C=x[u].x+x[u].width;if(0<y)for(u=0;u<x.length-1;u++)v=x[u],B=x[u+1],p==v?(d=B.y-v.height-y,f.push(new mxPoint(C,d+v.height+D)),f.push(new mxPoint(C,B.y-D))):p==B?(f.push(new mxPoint(C,v.y+v.height+D)),d=v.y+v.height+y,f.push(new mxPoint(C,d-D))):(f.push(new mxPoint(C,v.y+
|
|
|
|
|
v.height+D)),f.push(new mxPoint(C,B.y-D)));else v=x[0],u=x[2],d=v.y+v.height+(u.y-v.y-v.height-p.height)/2,f.push(new mxPoint(C,v.y+v.height+D)),f.push(new mxPoint(C,d-D)),f.push(new mxPoint(C,d+p.height+D)),f.push(new mxPoint(C,u.y-D));for(u=0;u<f.length;u+=2)z=f[u],J=f[u+1],z=t(z,J,null!=F?F[u/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(u=f.length/2;null!=F&&u<F.length;u++)F[u].destroy();k.guidesArrVer=A;d-=b.y;f=!0}else E(!1,!0)}if(q||f)return p=new mxPoint(e,d),x=a.call(this,
|
|
|
|
|
b,p,g,l),q&&!f?p.y=x.y:f&&!q&&(p.x=x.x),x.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),x.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;E(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
|
|
|
|
|
y.y+y.height+4||p.y+p.height+4<y.y)?x.push(y):(p.y>=y.y&&p.y<=y.y+y.height||y.y>=p.y&&y.y<=p.y+p.height)&&(p.x>y.x+y.width+4||p.x+p.width+4<y.x)&&z.push(y))}var C=0,K=0,F=y=0,A=0,D=0,J=0,E=0,G=5*v;if(1<x.length){x.push(p);x.sort(function(a,b){return a.y-b.y});var H=!1,u=p==x[0],v=p==x[x.length-1];if(!u&&!v)for(u=1;u<x.length-1;u++)if(p==x[u]){v=x[u-1];u=x[u+1];y=K=F=(u.y-v.y-v.height-p.height)/2;break}for(u=0;u<x.length-1;u++){var v=x[u],B=x[u+1],I=p==v||p==B,B=B.y-v.y-v.height,H=H|p==v;if(0==K&&
|
|
|
|
|
0==C)K=B,C=1;else if(Math.abs(K-B)<=(I||1==u&&H?t:0))C+=1;else if(1<C&&H){x=x.slice(0,u+1);break}else if(3<=x.length-u&&!H)C=0,y=K=0!=F?F:0,x.splice(0,0==u?1:u),u=-1;else break;0!=y||I||(K=y=B)}3==x.length&&x[1]==p&&(y=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});H=!1;u=p==z[0];v=p==z[z.length-1];if(!u&&!v)for(u=1;u<z.length-1;u++)if(p==z[u]){v=z[u-1];u=z[u+1];J=D=E=(u.x-v.x-v.width-p.width)/2;break}for(u=0;u<z.length-1;u++){v=z[u];B=z[u+1];I=p==v||p==B;B=B.x-v.x-v.width;H|=p==
|
|
|
|
|
v;if(0==D&&0==A)D=B,A=1;else if(Math.abs(D-B)<=(I||1==u&&H?t:0))A+=1;else if(1<A&&H){z=z.slice(0,u+1);break}else if(3<=z.length-u&&!H)A=0,J=D=0!=E?E:0,z.splice(0,0==u?1:u),u=-1;else break;0!=J||I||(D=J=B)}3==z.length&&z[1]==p&&(J=0)}t=function(a,b,c,d){var e=[],f;d?(d=G,f=0):(d=0,f=G);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
|
|
|
|
|
mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(k.graph.getView().getOverlayPane());return a};D=function(a,b){if(a&&null!=k.guidesArrHor)for(var c=0;c<k.guidesArrHor.length;c++)k.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=k.guidesArrVer)for(c=0;c<k.guidesArrVer.length;c++)k.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];E=k.guidesArrHor;q=[];e=0;u=z[0]==p?1:0;H=z[u].y+z[u].height;if(0<J)for(u=0;u<z.length-1;u++)v=
|
|
|
|
|
z[u],B=z[u+1],p==v?(e=B.x-v.width-J,q.push(new mxPoint(e+v.width+G,H)),q.push(new mxPoint(B.x-G,H))):p==B?(q.push(new mxPoint(v.x+v.width+G,H)),e=v.x+v.width+J,q.push(new mxPoint(e-G,H))):(q.push(new mxPoint(v.x+v.width+G,H)),q.push(new mxPoint(B.x-G,H)));else v=z[0],u=z[2],e=v.x+v.width+(u.x-v.x-v.width-p.width)/2,q.push(new mxPoint(v.x+v.width+G,H)),q.push(new mxPoint(e-G,H)),q.push(new mxPoint(e+p.width+G,H)),q.push(new mxPoint(u.x-G,H));for(u=0;u<q.length;u+=2)z=q[u],J=q[u+1],z=t(z,J,null!=E?
|
|
|
|
|
E[u/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(u=q.length/2;null!=E&&u<E.length;u++)E[u].destroy();k.guidesArrHor=A;e-=b.x;q=!0}else D(!0);if(1<C&&C==x.length-1){A=[];E=k.guidesArrVer;f=[];d=0;u=x[0]==p?1:0;C=x[u].x+x[u].width;if(0<y)for(u=0;u<x.length-1;u++)v=x[u],B=x[u+1],p==v?(d=B.y-v.height-y,f.push(new mxPoint(C,d+v.height+G)),f.push(new mxPoint(C,B.y-G))):p==B?(f.push(new mxPoint(C,v.y+v.height+G)),d=v.y+v.height+y,f.push(new mxPoint(C,d-G))):(f.push(new mxPoint(C,v.y+
|
|
|
|
|
v.height+G)),f.push(new mxPoint(C,B.y-G)));else v=x[0],u=x[2],d=v.y+v.height+(u.y-v.y-v.height-p.height)/2,f.push(new mxPoint(C,v.y+v.height+G)),f.push(new mxPoint(C,d-G)),f.push(new mxPoint(C,d+p.height+G)),f.push(new mxPoint(C,u.y-G));for(u=0;u<f.length;u+=2)z=f[u],J=f[u+1],z=t(z,J,null!=E?E[u/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(u=f.length/2;null!=E&&u<E.length;u++)E[u].destroy();k.guidesArrVer=A;d-=b.y;f=!0}else D(!1,!0)}if(q||f)return p=new mxPoint(e,d),x=a.call(this,
|
|
|
|
|
b,p,g,l),q&&!f?p.y=x.y:f&&!q&&(p.x=x.x),x.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),x.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;D(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
|
|
|
|
|
d)for(l=0;l<d.length;l++)d[l].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var g=0;g<a.length;g++)a[g].destroy();this.guidesArrVer=null}if(null!=c){for(g=0;g<c.length;g++)c[g].destroy();this.guidesArrHor=null}}})();
|
|
|
|
|