|
|
|
@ -9457,7 +9457,7 @@ DrawioFile.prototype.updateFile=function(a,c,e,b){null!=e&&e()||(this.ui.getCurr
|
|
|
|
|
DrawioFile.prototype.mergeFile=function(a,c,e,b){var g=!0;try{this.stats.fileMerged++;var f=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),l=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=l&&0<l.length){this.shadowPages=l;this.backupPatch=this.isModified()?this.ui.diffPages(f,this.ui.pages):null;var n=[this.ui.diffPages(null!=b?b:f,this.shadowPages)];if(!this.ignorePatches(n)){var d=this.ui.patchPages(f,
|
|
|
|
|
n[0]);b={};var k=this.ui.getHashValueForPages(d,b),f={},m=this.ui.getHashValueForPages(this.shadowPages,f);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",n,"checksum",m==k,k);if(null!=k&&k!=m){var p=this.compressReportData(this.getAnonymizedXmlForPages(l)),u=this.compressReportData(this.getAnonymizedXmlForPages(d)),q=this.ui.hashValue(a.getCurrentEtag()),t=this.ui.hashValue(this.getCurrentEtag());this.checksumError(e,n,"Shadow Details: "+JSON.stringify(b)+
|
|
|
|
|
"\nChecksum: "+k+"\nCurrent: "+m+"\nCurrent Details: "+JSON.stringify(f)+"\nFrom: "+q+"\nTo: "+t+"\n\nFile Data:\n"+p+"\nPatched Shadow:\n"+u,null,"mergeFile");return}this.patch(n,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw g=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=c&&c()}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
|
|
|
|
|
null!=e&&e(x);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var v=this.getCurrentUser(),y=null!=v?v.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,x)}}catch(A){}}};
|
|
|
|
|
null!=e&&e(x);try{if(g)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var v=this.getCurrentUser(),y=null!=v?v.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,x)}}catch(B){}}};
|
|
|
|
|
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),e=c.document.createElement("mxfile");if(null!=a)for(var b=0;b<a.length;b++){var g=c.encode(new mxGraphModel(a[b].root));"1"!=urlParams.dev&&(g=this.ui.anonymizeNode(g,!0));g.setAttribute("id",a[b].getId());a[b].viewState&&this.ui.editor.graph.saveViewState(a[b].viewState,g,!0);e.appendChild(g)}return mxUtils.getPrettyXml(e)};
|
|
|
|
|
DrawioFile.prototype.compressReportData=function(a,c,e){c=null!=c?c:1E4;null!=e&&null!=a&&a.length>e?a=a.substring(0,e)+"[...]":null!=a&&a.length>c&&(a=Graph.compress(a)+"\n");return a};
|
|
|
|
|
DrawioFile.prototype.checksumError=function(a,c,e,b,g){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var f=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(c,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
|
|
|
|
@ -9538,8 +9538,8 @@ RemoteLibrary.prototype.saveAs=function(a,c,e){};RemoteLibrary.prototype.updateF
|
|
|
|
|
var StorageDialog=function(a,c,e){function b(b,k,f,g,t,v){function m(){mxEvent.addListener(p,"click",null!=v?v:function(){f!=App.MODE_GOOGLE||a.isDriveDomain()?f==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,!0);c()})):f==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,!0);c()})):
|
|
|
|
|
(a.setMode(f,!0),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}++l>e&&(mxUtils.br(n),l=0);var p=document.createElement("a");p.style.overflow="hidden";p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";p.className="geBaseButton";p.style.boxSizing="border-box";p.style.fontSize="11px";p.style.position="relative";p.style.margin="4px";p.style.marginTop="8px";p.style.marginBottom="0px";p.style.padding="8px 10px 8px 10px";p.style.width="88px";p.style.height="100px";p.style.whiteSpace=
|
|
|
|
|
"nowrap";p.setAttribute("title",k);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var q=document.createElement("div");q.style.textOverflow="ellipsis";q.style.overflow="hidden";q.style.position="absolute";q.style.bottom="8px";q.style.left="0px";q.style.right="0px";mxUtils.write(q,k);p.appendChild(q);if(null!=b){var u=document.createElement("img");u.setAttribute("src",b);u.setAttribute("border","0");u.setAttribute("align","absmiddle");u.style.width="60px";u.style.height="60px";u.style.paddingBottom=
|
|
|
|
|
"6px";p.appendChild(u)}else q.style.paddingTop="5px",q.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(q.style.paddingTop="0px",q.style.marginTop="-2px");if(null!=t)for(b=0;b<t.length;b++)mxUtils.br(q),mxUtils.write(q,t[b]);if(null!=g&&null==a[g]){u.style.visibility="hidden";mxUtils.setOpacity(q,10);var B=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,
|
|
|
|
|
hwaccel:!1,top:"40%",zIndex:2E9});B.spin(p);var C=window.setTimeout(function(){null==a[g]&&(B.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,e){null!=a[g]&&e.getProperty("client")==a[g]&&(window.clearTimeout(C),mxUtils.setOpacity(q,100),u.style.visibility="",B.stop(),m(),"drive"==g&&null!=d.parentNode&&d.parentNode.removeChild(d))}))}else m();n.appendChild(p)}e=null!=e?e:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace=
|
|
|
|
|
"6px";p.appendChild(u)}else q.style.paddingTop="5px",q.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(q.style.paddingTop="0px",q.style.marginTop="-2px");if(null!=t)for(b=0;b<t.length;b++)mxUtils.br(q),mxUtils.write(q,t[b]);if(null!=g&&null==a[g]){u.style.visibility="hidden";mxUtils.setOpacity(q,10);var A=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});A.spin(p);var C=window.setTimeout(function(){null==a[g]&&(A.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,e){null!=a[g]&&e.getProperty("client")==a[g]&&(window.clearTimeout(C),mxUtils.setOpacity(q,100),u.style.visibility="",A.stop(),m(),"drive"==g&&null!=d.parentNode&&d.parentNode.removeChild(d))}))}else m();n.appendChild(p)}e=null!=e?e:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace=
|
|
|
|
|
"nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var f=document.createElement("div");f.style.border="1px solid #d3d3d3";f.style.borderWidth="1px 0px 1px 0px";f.style.padding="10px 0px 20px 0px";mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");var l=0,n=document.createElement("div");n.style.paddingTop="2px";f.appendChild(n);var d=document.createElement("p"),k=document.createElement("p");k.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";
|
|
|
|
|
mxUtils.write(k,mxResources.get("saveDiagramsTo")+":");g.appendChild(k);g.appendChild(f);l=0;"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");b(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||
|
|
|
|
|
b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&b(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=a.gitHub&&b(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=a.gitLab&&b(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");f=document.createElement("span");f.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";
|
|
|
|
@ -9565,22 +9565,22 @@ encodeURIComponent(d.value);a.openLink(b)}catch(q){a.handleError({message:q.mess
|
|
|
|
|
c.length&&(p=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent(l)+"&url="+encodeURIComponent(d.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),m=document.createElement("img"),m.setAttribute("src",Editor.tweetImage),m.setAttribute("width","18"),m.setAttribute("height","18"),m.setAttribute("border","0"),m.style.marginBottom="5px",p.appendChild(m),p.setAttribute("title",mxResources.get("twitter")+
|
|
|
|
|
" ("+a.formatFileSize(7168)+" max)"),p.style.verticalAlign="bottom",p.style.paddingTop="4px",p.style.minWidth="46px",p.className="geBtn",f.appendChild(p))}m=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.appendChild(m);p=mxUtils.button(mxResources.get("copy"),function(){d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?d.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});
|
|
|
|
|
5E5>c.length?mxClient.IS_SF||null!=document.documentMode?m.className="geBtn gePrimaryBtn":(f.appendChild(p),p.className="geBtn gePrimaryBtn",m.className="geBtn"):(f.appendChild(k),m.className="geBtn",k.className="geBtn gePrimaryBtn");b.appendChild(f);this.container=b};EmbedDialog.showPreviewOption=!0;
|
|
|
|
|
var GoogleSitesDialog=function(a,c){function e(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(B.checked&&""!=u.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(u.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<C.length&&(b+="&s="+C);""!=q.value&&"0"!=q.value&&(b+="&border="+q.value);""!=p.value&&(b+="&height="+p.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(z.checked?"1":"0");
|
|
|
|
|
b+="&resize="+(A.checked?"1":"0");b+="&x0="+Number(m.value);b+="&y0="+d;g.mathEnabled&&(b+="&math=1");x.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));k.value=b}else D.constructor==DriveFile||D.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?b+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(b+=D.getHash().substring(1),b=D.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
|
|
|
|
|
var GoogleSitesDialog=function(a,c){function e(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(A.checked&&""!=u.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(u.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<C.length&&(b+="&s="+C);""!=q.value&&"0"!=q.value&&(b+="&border="+q.value);""!=p.value&&(b+="&height="+p.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(z.checked?"1":"0");
|
|
|
|
|
b+="&resize="+(B.checked?"1":"0");b+="&x0="+Number(m.value);b+="&y0="+d;g.mathEnabled&&(b+="&math=1");x.checked?b+="&edit=_blank":y.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));k.value=b}else D.constructor==DriveFile||D.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?b+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(b+=D.getHash().substring(1),b=D.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
|
|
|
|
|
a&&(b+="&title="+encodeURIComponent(a)),""!=p.value&&(a=parseInt(p.value)+parseInt(m.value),b+="&height="+a),k.value=b):k.value=""}var b=document.createElement("div"),g=a.editor.graph,f=g.getGraphBounds(),l=g.view.scale,n=Math.floor(f.x/l-g.view.translate.x),d=Math.floor(f.y/l-g.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var k=document.createElement("input");k.setAttribute("type","text");k.style.marginBottom="8px";k.style.marginTop="2px";k.style.width="410px";
|
|
|
|
|
b.appendChild(k);mxUtils.br(b);this.init=function(){k.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null)};mxUtils.write(b,mxResources.get("top")+":");var m=document.createElement("input");m.setAttribute("type","text");m.setAttribute("size","4");m.style.marginRight="16px";m.style.marginLeft="4px";m.value=n;b.appendChild(m);mxUtils.write(b,mxResources.get("height")+":");var p=document.createElement("input");p.setAttribute("type",
|
|
|
|
|
"text");p.setAttribute("size","4");p.style.marginLeft="4px";p.value=Math.ceil(f.height/l);b.appendChild(p);mxUtils.br(b);f=document.createElement("hr");f.setAttribute("size","1");f.style.marginBottom="16px";f.style.marginTop="16px";b.appendChild(f);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","28");u.style.marginBottom="8px";u.style.marginTop="2px";u.style.width="410px";u.value=c||"";
|
|
|
|
|
b.appendChild(u);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","3");q.style.marginBottom="8px";q.style.marginLeft="4px";q.value="0";b.appendChild(q);mxUtils.br(b);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";b.appendChild(t);mxUtils.write(b,mxResources.get("pan")+" ");var v=document.createElement("input");
|
|
|
|
|
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";b.appendChild(v);mxUtils.write(b,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);b.appendChild(y);mxUtils.write(b,mxResources.get("edit")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";b.appendChild(x);mxUtils.write(b,
|
|
|
|
|
mxResources.get("asNew")+" ");mxUtils.br(b);var A=document.createElement("input");A.setAttribute("type","checkbox");A.setAttribute("checked","checked");A.defaultChecked=!0;A.style.marginLeft="16px";b.appendChild(A);mxUtils.write(b,mxResources.get("resize")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";b.appendChild(z);mxUtils.write(b,mxResources.get("fit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft=
|
|
|
|
|
"8px";b.appendChild(B);mxUtils.write(b,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(t,"change",e);mxEvent.addListener(v,"change",e);mxEvent.addListener(A,"change",e);mxEvent.addListener(z,"change",e);mxEvent.addListener(y,"change",e);mxEvent.addListener(x,"change",e);mxEvent.addListener(B,"change",e);mxEvent.addListener(p,"change",e);mxEvent.addListener(m,"change",e);mxEvent.addListener(q,"change",e);mxEvent.addListener(u,"change",e);e();
|
|
|
|
|
mxResources.get("asNew")+" ");mxUtils.br(b);var B=document.createElement("input");B.setAttribute("type","checkbox");B.setAttribute("checked","checked");B.defaultChecked=!0;B.style.marginLeft="16px";b.appendChild(B);mxUtils.write(b,mxResources.get("resize")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";b.appendChild(z);mxUtils.write(b,mxResources.get("fit")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft=
|
|
|
|
|
"8px";b.appendChild(A);mxUtils.write(b,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(t,"change",e);mxEvent.addListener(v,"change",e);mxEvent.addListener(B,"change",e);mxEvent.addListener(z,"change",e);mxEvent.addListener(y,"change",e);mxEvent.addListener(x,"change",e);mxEvent.addListener(A,"change",e);mxEvent.addListener(p,"change",e);mxEvent.addListener(m,"change",e);mxEvent.addListener(q,"change",e);mxEvent.addListener(u,"change",e);e();
|
|
|
|
|
mxEvent.addListener(k,"click",function(){k.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?k.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";f.appendChild(l);b.appendChild(f);this.container=b},CreateGraphDialog=function(a,c,e){var b=document.createElement("div");b.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);b.appendChild(c);var f=new Graph(c);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";f.cellRenderer.installCellOverlayListeners=
|
|
|
|
|
function(a,d,b){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(b.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(b){d.fireEvent(new mxEventObject("pointerdown","event",b,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(b.node,"touchstart",function(b){d.fireEvent(new mxEventObject("pointerdown","event",b,"state",a))})};f.getAllConnectionConstraints=function(){return null};f.connectionHandler.marker.highlight.keepOnTop=
|
|
|
|
|
!1;f.connectionHandler.createEdgeState=function(a){a=f.createEdge(null,null,null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var n=f.getDefaultParent(),d=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,e){f.connectionHandler.reset();f.clearSelection();var c=f.getCellGeometry(a),k;p(function(){k=f.insertVertex(n,null,"Entry",c.x,c.y,80,30,"rounded=1;");d(k);f.view.refresh(k);
|
|
|
|
|
f.insertEdge(n,null,"",a,k,l)},function(){f.scrollCellToVisible(k)})});b.addListener("pointerdown",function(a,d){var b=d.getProperty("event"),e=d.getProperty("state");f.popupMenuHandler.hideMenu();f.stopEditing(!1);var c=mxUtils.convertPoint(f.container,mxEvent.getClientX(b),mxEvent.getClientY(b));f.connectionHandler.start(e,c.x,c.y);f.isMouseDown=!0;f.isMouseTrigger=mxEvent.isMouseEvent(b);mxEvent.consume(b)});f.addCellOverlay(a,b)});f.getModel().beginUpdate();var k;try{k=f.insertVertex(n,null,"Start",
|
|
|
|
|
0,0,80,30,"ellipse"),d(k)}finally{f.getModel().endUpdate()}var m;"horizontalTree"==e?(m=new mxCompactTreeLayout(f),m.edgeRouting=!1,m.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==e?(m=new mxCompactTreeLayout(f,!1),m.edgeRouting=!1,m.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==e?(m=new mxRadialTreeLayout(f,!1),m.edgeRouting=!1,m.levelDistance=80):"verticalFlow"==e?m=new mxHierarchicalLayout(f,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
|
|
|
|
|
e?m=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==e?(m=new mxFastOrganicLayout(f,!1),m.forceConstant=80):"circle"==e&&(m=new mxCircleLayout(f));if(null!=m){var p=function(a,d){f.getModel().beginUpdate();try{null!=a&&a(),m.execute(f.getDefaultParent(),k)}catch(A){throw A;}finally{var b=new mxMorphing(f);b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=d&&d()}));b.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
|
|
|
|
|
e?m=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==e?(m=new mxFastOrganicLayout(f,!1),m.forceConstant=80):"circle"==e&&(m=new mxCircleLayout(f));if(null!=m){var p=function(a,d){f.getModel().beginUpdate();try{null!=a&&a(),m.execute(f.getDefaultParent(),k)}catch(B){throw B;}finally{var b=new mxMorphing(f);b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=d&&d()}));b.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
|
|
|
|
|
function(a,d,b,e,c){u.apply(this,arguments);p()};f.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);p()};f.connectionHandler.addListener(mxEvent.CONNECT,function(){p()})}var q=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=c.parentNode&&(f.destroy(),c.parentNode.removeChild(c));a.hideDialog()})});q.className="geBtn";a.editor.cancelFirst&&b.appendChild(q);var t=mxUtils.button(mxResources.get("insert"),function(d){f.clearCellOverlays();
|
|
|
|
|
var b=f.getModel().getChildren(f.getDefaultParent());d=mxEvent.isAltDown(d)?a.editor.graph.getFreeInsertPoint():a.editor.graph.getCenterInsertPoint(f.getBoundingBoxFromGeometry(b,!0));b=a.editor.graph.importCells(b,d.x,d.y);d=a.editor.graph.view;var e=d.getBounds(b);e.x-=d.translate.x;e.y-=d.translate.y;a.editor.graph.scrollRectToVisible(e);a.editor.graph.setSelectionCells(b);null!=c.parentNode&&(f.destroy(),c.parentNode.removeChild(c));a.hideDialog()});b.appendChild(t);t.className="geBtn gePrimaryBtn";
|
|
|
|
|
a.editor.cancelFirst||b.appendChild(q)};this.container=b};
|
|
|
|
@ -9614,12 +9614,12 @@ mxUtils.write(d,mxResources.get("diagram"));"plantUml"!=e&&n.appendChild(d);d=do
|
|
|
|
|
"plantUmlTxt");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==e&&(n.appendChild(d),n.appendChild(k),n.appendChild(m));var p=g();l.value=p;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 d=new FileReader;d.onload=function(a){l.value=a.target.result};d.readAsText(a)}},!1));c.appendChild(n);mxEvent.addListener(n,"change",function(){var a=g();if(0==l.value.length||l.value==p)p=a,l.value=p});a.isOffline()||"mermaid"!=e&&"plantUml"!=e||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("mermaid"==e?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),d.className="geBtn",c.appendChild(d));d=mxUtils.button(mxResources.get("close"),
|
|
|
|
|
function(){l.value==p?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});d.className="geBtn";a.editor.cancelFirst&&c.appendChild(d);k=mxUtils.button(mxResources.get("insert"),function(d){a.hideDialog();b(l.value,n.value,d)});c.appendChild(k);k.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(d);this.container=c},NewDialog=function(a,c,e,b,g,f,l,n,d,k,m,p,u,q,t,v,y){function x(){var a=!0;if(null!=ja)for(;H<ja.length&&(a||0!=mxUtils.mod(H,30));){var d=
|
|
|
|
|
ja[H++],d=B(d.url,d.libs,d.title,d.tooltip?d.tooltip:d.title,d.select,d.imgUrl,d.info,d.onClick,d.preview,d.noImg,d.clibs);a&&d.click();a=!1}}function A(){if(X)e||a.hideDialog(),q(X,da,E.value);else if(b)e||a.hideDialog(),b(Y,E.value,fa,aa);else{var d=E.value;null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,Y,null!=aa&&0<aa.length?aa:null,null,function(){a.hideDialog()},null,b,null,null!=ga&&0<ga.length?ga:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}
|
|
|
|
|
function z(a,b,e,c,k,m,f){null!=V&&(V.style.backgroundColor="transparent",V.style.border="1px solid transparent");I.removeAttribute("disabled");Y=b;aa=e;ga=m;V=a;X=c;fa=f;da=k;V.style.backgroundColor=n;V.style.border=d}function B(d,b,e,c,k,m,f,p,g,q,u){var l=document.createElement("div");l.className="geTemplate";l.style.height=R+"px";l.style.width=P+"px";"dark"==uiTheme&&(l.style.filter="invert(100%)");null!=e?l.setAttribute("title",mxResources.get(e,null,e)):null!=c&&0<c.length&&l.setAttribute("title",
|
|
|
|
|
c);if(null!=m)l.style.backgroundImage="url("+m+")",l.style.backgroundSize="contain",l.style.backgroundPosition="center center",l.style.backgroundRepeat="no-repeat",mxEvent.addListener(l,"click",function(a){z(l,null,null,d,f,u)}),mxEvent.addListener(l,"dblclick",function(a){A()});else if(!q&&null!=d&&0<d.length){c=g||TEMPLATE_PATH+"/"+d.substring(0,d.length-4)+".png";l.style.backgroundImage="url("+c+")";l.style.backgroundPosition="center center";l.style.backgroundRepeat="no-repeat";null!=e&&(l.innerHTML=
|
|
|
|
|
ja[H++],d=A(d.url,d.libs,d.title,d.tooltip?d.tooltip:d.title,d.select,d.imgUrl,d.info,d.onClick,d.preview,d.noImg,d.clibs);a&&d.click();a=!1}}function B(){if(X)e||a.hideDialog(),q(X,da,E.value);else if(b)e||a.hideDialog(),b(Y,E.value,fa,aa);else{var d=E.value;null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,Y,null!=aa&&0<aa.length?aa:null,null,function(){a.hideDialog()},null,b,null,null!=ga&&0<ga.length?ga:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}
|
|
|
|
|
function z(a,b,e,c,k,m,f){null!=V&&(V.style.backgroundColor="transparent",V.style.border="1px solid transparent");I.removeAttribute("disabled");Y=b;aa=e;ga=m;V=a;X=c;fa=f;da=k;V.style.backgroundColor=n;V.style.border=d}function A(d,b,e,c,k,m,f,p,g,q,u){var l=document.createElement("div");l.className="geTemplate";l.style.height=R+"px";l.style.width=P+"px";"dark"==uiTheme&&(l.style.filter="invert(100%)");null!=e?l.setAttribute("title",mxResources.get(e,null,e)):null!=c&&0<c.length&&l.setAttribute("title",
|
|
|
|
|
c);if(null!=m)l.style.backgroundImage="url("+m+")",l.style.backgroundSize="contain",l.style.backgroundPosition="center center",l.style.backgroundRepeat="no-repeat",mxEvent.addListener(l,"click",function(a){z(l,null,null,d,f,u)}),mxEvent.addListener(l,"dblclick",function(a){B()});else if(!q&&null!=d&&0<d.length){c=g||TEMPLATE_PATH+"/"+d.substring(0,d.length-4)+".png";l.style.backgroundImage="url("+c+")";l.style.backgroundPosition="center center";l.style.backgroundRepeat="no-repeat";null!=e&&(l.innerHTML=
|
|
|
|
|
'<table width="100%" height="100%" style="line-height:1.3em;'+("dark"==uiTheme?"":"background:rgba(255,255,255,0.85);")+'border:inherit;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:rgba(255,255,255,0.85);overflow:hidden;text-overflow:ellipsis;max-width:'+(R-34)+'px;">'+mxUtils.htmlEntities(mxResources.get(e,null,e))+"</span></td></tr></table>");var t=!1;mxEvent.addListener(l,"click",function(e){I.setAttribute("disabled",
|
|
|
|
|
"disabled");l.style.backgroundColor="transparent";l.style.border="1px solid transparent";var c=d,c=/^https?:\/\//.test(c)&&!a.editor.isCorsEnabledForUrl(c)?PROXY_URL+"?url="+encodeURIComponent(c):TEMPLATE_PATH+"/"+c;J.spin(O);mxUtils.get(c,mxUtils.bind(this,function(a){J.stop();200<=a.getStatus()&&299>=a.getStatus()&&(z(l,a.getText(),b,null,null,u,c),t&&A())}))});mxEvent.addListener(l,"dblclick",function(a){t=!0})}else l.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:#ffffff;overflow:hidden;text-overflow:ellipsis;max-width:'+
|
|
|
|
|
(R-34)+'px;">'+mxUtils.htmlEntities(mxResources.get(e,null,e))+"</span></td></tr></table>",k&&z(l),null!=p?mxEvent.addListener(l,"click",p):(mxEvent.addListener(l,"click",function(a){z(l,null,null,d,f)}),mxEvent.addListener(l,"dblclick",function(a){A()}));O.appendChild(l);return l}function C(){ha&&(ha=!1,mxEvent.addListener(O,"scroll",function(a){O.scrollTop+O.clientHeight>=O.scrollHeight&&(x(),mxEvent.consume(a))}));var a=null;if(0<ba){var d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";
|
|
|
|
|
"disabled");l.style.backgroundColor="transparent";l.style.border="1px solid transparent";var c=d,c=/^https?:\/\//.test(c)&&!a.editor.isCorsEnabledForUrl(c)?PROXY_URL+"?url="+encodeURIComponent(c):TEMPLATE_PATH+"/"+c;J.spin(O);mxUtils.get(c,mxUtils.bind(this,function(a){J.stop();200<=a.getStatus()&&299>=a.getStatus()&&(z(l,a.getText(),b,null,null,u,c),t&&B())}))});mxEvent.addListener(l,"dblclick",function(a){t=!0})}else l.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:#ffffff;overflow:hidden;text-overflow:ellipsis;max-width:'+
|
|
|
|
|
(R-34)+'px;">'+mxUtils.htmlEntities(mxResources.get(e,null,e))+"</span></td></tr></table>",k&&z(l),null!=p?mxEvent.addListener(l,"click",p):(mxEvent.addListener(l,"click",function(a){z(l,null,null,d,f)}),mxEvent.addListener(l,"dblclick",function(a){B()}));O.appendChild(l);return l}function C(){ha&&(ha=!1,mxEvent.addListener(O,"scroll",function(a){O.scrollTop+O.clientHeight>=O.scrollHeight&&(x(),mxEvent.consume(a))}));var a=null;if(0<ba){var d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";
|
|
|
|
|
mxUtils.write(d,mxResources.get("custom"));W.appendChild(d);for(var b in S){var c=document.createElement("div"),d=b,e=S[b];18<d.length&&(d=d.substring(0,18)+"…");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";c.setAttribute("title",d+" ("+e.length+")");mxUtils.write(c,c.getAttribute("title"));null!=k&&(c.style.padding=k);W.appendChild(c);(function(d,b){mxEvent.addListener(c,"click",function(){a!=
|
|
|
|
|
b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=l,O.scrollTop=0,O.innerHTML="",H=0,ja=S[d],M=null,x())})})(b,c)}d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(d,"draw.io");W.appendChild(d)}for(b in ca)c=document.createElement("div"),d=mxResources.get(b),e=ca[b],null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1)),18<d.length&&(d=d.substring(0,18)+"…"),c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;",
|
|
|
|
|
c.setAttribute("title",d+" ("+e.length+")"),mxUtils.write(c,c.getAttribute("title")),null!=k&&(c.style.padding=k),W.appendChild(c),null==a&&0<e.length&&(a=c,a.style.backgroundColor=l,ja=e),function(d,b){mxEvent.addListener(c,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=l,O.scrollTop=0,O.innerHTML="",H=0,ja=ca[d],M=null,x())})}(b,c);x()}e=null!=e?e:!0;g=null!=g?g:!1;l=null!=l?l:"#ebf2f9";n=null!=n?n:"dark"==uiTheme?"#a2a2a2":"#e6eff8";d=null!=d?d:"dark"==uiTheme?
|
|
|
|
@ -9627,30 +9627,30 @@ c.setAttribute("title",d+" ("+e.length+")"),mxUtils.write(c,c.getAttribute("titl
|
|
|
|
|
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_GITLAB?IMAGE_PATH+"/gitlab-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&&e&&F.appendChild(G);e&&mxUtils.write(F,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
|
|
|
|
|
mxResources.get("filename"))+":");G=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?G=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?G=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?G=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?G=a.gitHub.extension:a.mode==App.MODE_GITLAB&&null!=a.gitLab?G=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(G=a.trello.extension);var E=document.createElement("input");E.setAttribute("value",a.defaultFilename+
|
|
|
|
|
G);E.style.marginLeft="10px";E.style.width=c?"144px":"244px";this.init=function(){e&&(E.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?E.select():document.execCommand("selectAll",!1,null))};e&&(F.appendChild(E),null!=a.editor.diagramFileTypes&&(G=FilenameDialog.createFileTypes(a,E,a.editor.diagramFileTypes),G.style.marginLeft="6px",G.style.width=c?"80px":"180px",F.appendChild(G)),null!=a.editor.fileExtensions&&(G=FilenameDialog.createTypeHint(a,E,a.editor.fileExtensions),
|
|
|
|
|
G.style.marginTop="12px",F.appendChild(G)));var F=!1,H=0,J=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}),I=mxUtils.button(v||mxResources.get("create"),function(){I.setAttribute("disabled","disabled");A();I.removeAttribute("disabled")});I.className="geBtn gePrimaryBtn";if(p||u){var K=[],M=null,N=null,U=null,L=function(a){I.setAttribute("disabled","disabled");for(var d=0;d<K.length;d++)K[d].className=d==a?"geBtn gePrimaryBtn":
|
|
|
|
|
G.style.marginTop="12px",F.appendChild(G)));var F=!1,H=0,J=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}),I=mxUtils.button(v||mxResources.get("create"),function(){I.setAttribute("disabled","disabled");B();I.removeAttribute("disabled")});I.className="geBtn gePrimaryBtn";if(p||u){var K=[],M=null,N=null,U=null,L=function(a){I.setAttribute("disabled","disabled");for(var d=0;d<K.length;d++)K[d].className=d==a?"geBtn gePrimaryBtn":
|
|
|
|
|
"geBtn"},F=!0;v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";D.appendChild(v);G=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){W.style.display="";O.style.left="160px";L(0);O.scrollTop=0;O.innerHTML="";H=0;M!=ja&&(ja=M,ca=N,ba=U,W.innerHTML="",C(),M=null)});K.push(G);v.appendChild(G);var T=function(a){W.style.display="none";O.style.left="30px";L(a?-1:1);null==M&&(M=ja);O.scrollTop=0;O.innerHTML="";J.spin(O);var d=function(a,d,b){H=0;J.stop();
|
|
|
|
|
ja=a;b=b||{};var c=0,e;for(e in b)c+=b[e].length;if(d)O.innerHTML=d;else if(0==a.length&&0==c)O.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(O.innerHTML="",0<c){W.style.display="";O.style.left="160px";W.innerHTML="";ba=0;ca={"draw.io":a};for(e in b)ca[e]=b[e];C()}else x()};a?u(Z.value,d):p(d)};p&&(G=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){T()}),v.appendChild(G),K.push(G));if(u){G=document.createElement("span");G.style.marginLeft=
|
|
|
|
|
"10px";G.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");v.appendChild(G);var Z=document.createElement("input");Z.style.marginRight="10px";Z.style.marginLeft="10px";Z.style.width="220px";mxEvent.addListener(Z,"keypress",function(a){13==a.keyCode&&T(!0)});v.appendChild(Z);G=mxUtils.button(mxResources.get("search"),function(){T(!0)});G.className="geBtn";v.appendChild(G)}L(0)}var aa=null,ga=null,Y=null,V=null,X=null,fa=null,da=null,O=document.createElement("div");O.style.border="1px solid #d3d3d3";
|
|
|
|
|
O.style.position="absolute";O.style.left="160px";O.style.right="34px";v=(e?72:40)+(F?30:0);O.style.top=v+"px";O.style.bottom="68px";O.style.margin="6px 0 0 -1px";O.style.padding="6px";O.style.overflow="auto";var W=document.createElement("div");W.style.cssText="position:absolute;left:30px;width:128px;top:"+v+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var R=140,P=140,ca={},S={},ba=0,ha=!0;ca.basic=[{title:"blankDiagram",select:!0}];var ja=ca.basic;if(!c){var Q=function(){mxUtils.get(ea,
|
|
|
|
|
function(a){if(!ka){ka=!0;a=a.getXml().documentElement.firstChild;for(var d={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var b=a.getAttribute("name"),c=a.getElementsByTagName("add"),e=[],k=0;k<c.length;k++)e.push(encodeURIComponent(mxUtils.getTextContent(c[k])));null!=b&&0<e.length&&(d[b]=e.join(";"))}else b=a.getAttribute("url"),null!=b&&(c=a.getAttribute("section"),null==c&&(c=b.indexOf("/"),c=b.substring(0,c)),b=ca[c],null==b&&(b=[],ca[c]=b),c=a.getAttribute("clibs"),
|
|
|
|
|
null!=d[c]&&(c=d[c]),b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:c}));a=a.nextSibling}J.stop();C()}})};D.appendChild(W);D.appendChild(O);var ka=!1,ea=m;/^https?:\/\//.test(ea)&&!a.editor.isCorsEnabledForUrl(ea)&&(ea=PROXY_URL+"?url="+encodeURIComponent(ea));J.spin(O);null!=y?y(function(a,d){S=a;U=ba=d;Q()},Q):Q();N=ca}mxEvent.addListener(E,"keypress",function(d){a.dialog.container.firstChild==
|
|
|
|
|
D&&13==d.keyCode&&A()});m=document.createElement("div");m.style.marginTop=c?"4px":"16px";m.style.textAlign="right";m.style.position="absolute";m.style.left="40px";m.style.bottom="24px";m.style.right="40px";c||a.isOffline()||!e||null!=b||g||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",m.appendChild(y));y=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});y.className=
|
|
|
|
|
D&&13==d.keyCode&&B()});m=document.createElement("div");m.style.marginTop=c?"4px":"16px";m.style.textAlign="right";m.style.position="absolute";m.style.left="40px";m.style.bottom="24px";m.style.right="40px";c||a.isOffline()||!e||null!=b||g||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",m.appendChild(y));y=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});y.className=
|
|
|
|
|
"geBtn";!a.editor.cancelFirst||g&&null==f||m.appendChild(y);c||"1"==urlParams.embed||g||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var d=new FilenameDialog(a,"",mxResources.get("create"),function(d){null!=d&&0<d.length&&(d=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(E.value)+"&create="+encodeURIComponent(d)),null==a.getCurrentFile()?window.location.href=d:window.openWindow(d))},mxResources.get("url"));a.showDialog(d.container,300,80,!0,!0);d.init()}),
|
|
|
|
|
c.className="geBtn",m.appendChild(c));Graph.fileSupport&&t&&(t=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var d=document.createElement("input");d.setAttribute("multiple","multiple");d.setAttribute("type","file");mxEvent.addListener(d,"change",function(b){a.openFiles(d.files,!0);d.value=""});d.style.display="none";document.body.appendChild(d);a.newDlgFileInputElt=d}a.newDlgFileInputElt.click()}),t.className="geBtn",m.appendChild(t));m.appendChild(I);a.editor.cancelFirst||
|
|
|
|
|
null!=b||g&&null==f||m.appendChild(y);D.appendChild(m);this.container=D},CreateDialog=function(a,c,e,b,g,f,l,n,d,k,m,p,u,q,t,v,y){function x(d,b,e,k){function m(){mxEvent.addListener(f,"click",function(){var d=e;if(l){var b=B.value,k=b.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var d=null!=d?d:F.value,m="";d==App.MODE_GOOGLE?m=a.drive.extension:d==App.MODE_GITHUB?m=a.gitHub.extension:d==App.MODE_GITLAB?m=a.gitLab.extension:d==App.MODE_TRELLO?m=a.trello.extension:d==App.MODE_DROPBOX?m=a.dropbox.extension:
|
|
|
|
|
d==App.MODE_ONEDRIVE?m=a.oneDrive.extension:d==App.MODE_DEVICE&&(m=".drawio");0<=k&&(b=b.substring(0,k));B.value=b+m}}A(e)})}var f=document.createElement("a");f.style.overflow="hidden";var g=document.createElement("img");g.src=d;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding=
|
|
|
|
|
null!=b||g&&null==f||m.appendChild(y);D.appendChild(m);this.container=D},CreateDialog=function(a,c,e,b,g,f,l,n,d,k,m,p,u,q,t,v,y){function x(d,b,e,k){function m(){mxEvent.addListener(f,"click",function(){var d=e;if(l){var b=A.value,k=b.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>k){var d=null!=d?d:F.value,m="";d==App.MODE_GOOGLE?m=a.drive.extension:d==App.MODE_GITHUB?m=a.gitHub.extension:d==App.MODE_GITLAB?m=a.gitLab.extension:d==App.MODE_TRELLO?m=a.trello.extension:d==App.MODE_DROPBOX?m=a.dropbox.extension:
|
|
|
|
|
d==App.MODE_ONEDRIVE?m=a.oneDrive.extension:d==App.MODE_DEVICE&&(m=".drawio");0<=k&&(b=b.substring(0,k));A.value=b+m}}B(e)})}var f=document.createElement("a");f.style.overflow="hidden";var g=document.createElement("img");g.src=d;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding=
|
|
|
|
|
"8px 8px 10px 8px";f.style.whiteSpace="nowrap";f.appendChild(g);mxClient.IS_QUIRKS&&(f.style.cssFloat="left",f.style.zoom="1");f.style.color="gray";f.style.fontSize="11px";var q=document.createElement("div");f.appendChild(q);mxUtils.write(q,b);if(null!=k&&null==a[k]){g.style.visibility="hidden";mxUtils.setOpacity(q,10);var u=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(f);var z=window.setTimeout(function(){null==
|
|
|
|
|
a[k]&&(u.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(z),mxUtils.setOpacity(q,100),g.style.visibility="",u.stop(),m())}))}else m();C.appendChild(f);++D==p&&(mxUtils.br(C),D=0)}function A(d){var b=B.value;if(null==d||null!=b&&0<b.length)y&&a.hideDialog(),e(b,d,B)}l=null!=l?l:!0;n=null!=n?n:!0;p=null!=p?p:4;y=null!=y?y:!0;f=document.createElement("div");f.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(f);var z=
|
|
|
|
|
document.createElement("h2");mxUtils.write(z,g||mxResources.get("create"));z.style.marginTop="0px";z.style.marginBottom="24px";f.appendChild(z);mxUtils.write(f,mxResources.get("filename")+":");var B=document.createElement("input");B.setAttribute("value",c);B.style.width="200px";B.style.marginLeft="10px";B.style.marginBottom="20px";B.style.maxWidth="70%";this.init=function(){B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?B.select():document.execCommand("selectAll",
|
|
|
|
|
!1,null)};f.appendChild(B);null!=v&&(null!=a.editor.diagramFileTypes&&(g=FilenameDialog.createFileTypes(a,B,a.editor.diagramFileTypes),g.style.marginLeft="6px",g.style.width="80px",f.appendChild(g)),f.appendChild(FilenameDialog.createTypeHint(a,B,v)));null==u||null==q||"image/"!=q.substring(0,6)||"image/svg"==q.substring(0,9)&&!mxClient.IS_SVG||(B.style.width="160px",v=document.createElement("img"),u=t?u:btoa(unescape(encodeURIComponent(u))),v.setAttribute("src","data:"+q+";base64,"+u),v.style.position=
|
|
|
|
|
"absolute",v.style.top="70px",v.style.right="100px",v.style.maxWidth="120px",v.style.maxHeight="80px",mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)"),f.appendChild(v),d&&Editor.popupsAllowed&&(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(){A("_blank")})));mxUtils.br(f);var C=document.createElement("div");C.style.textAlign="center";var D=0;C.style.marginTop="6px";f.appendChild(C);var F=document.createElement("select");F.style.marginLeft="10px";a.isOfflineApp()||
|
|
|
|
|
a[k]&&(u.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(z),mxUtils.setOpacity(q,100),g.style.visibility="",u.stop(),m())}))}else m();C.appendChild(f);++D==p&&(mxUtils.br(C),D=0)}function B(d){var b=A.value;if(null==d||null!=b&&0<b.length)y&&a.hideDialog(),e(b,d,A)}l=null!=l?l:!0;n=null!=n?n:!0;p=null!=p?p:4;y=null!=y?y:!0;f=document.createElement("div");f.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(f);var z=
|
|
|
|
|
document.createElement("h2");mxUtils.write(z,g||mxResources.get("create"));z.style.marginTop="0px";z.style.marginBottom="24px";f.appendChild(z);mxUtils.write(f,mxResources.get("filename")+":");var A=document.createElement("input");A.setAttribute("value",c);A.style.width="200px";A.style.marginLeft="10px";A.style.marginBottom="20px";A.style.maxWidth="70%";this.init=function(){A.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",
|
|
|
|
|
!1,null)};f.appendChild(A);null!=v&&(null!=a.editor.diagramFileTypes&&(g=FilenameDialog.createFileTypes(a,A,a.editor.diagramFileTypes),g.style.marginLeft="6px",g.style.width="80px",f.appendChild(g)),f.appendChild(FilenameDialog.createTypeHint(a,A,v)));null==u||null==q||"image/"!=q.substring(0,6)||"image/svg"==q.substring(0,9)&&!mxClient.IS_SVG||(A.style.width="160px",v=document.createElement("img"),u=t?u:btoa(unescape(encodeURIComponent(u))),v.setAttribute("src","data:"+q+";base64,"+u),v.style.position=
|
|
|
|
|
"absolute",v.style.top="70px",v.style.right="100px",v.style.maxWidth="120px",v.style.maxHeight="80px",mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)"),f.appendChild(v),d&&Editor.popupsAllowed&&(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(){B("_blank")})));mxUtils.br(f);var C=document.createElement("div");C.style.textAlign="center";var D=0;C.style.marginTop="6px";f.appendChild(C);var F=document.createElement("select");F.style.marginLeft="10px";a.isOfflineApp()||
|
|
|
|
|
a.isOffline()||("function"===typeof window.DriveClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(q,mxResources.get("googleDrive")),F.appendChild(q),x(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(q,mxResources.get("oneDrive")),F.appendChild(q),a.mode==App.MODE_ONEDRIVE&&
|
|
|
|
|
q.setAttribute("selected","selected"),x(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(q,mxResources.get("dropbox")),F.appendChild(q),a.mode==App.MODE_DROPBOX&&q.setAttribute("selected","selected"),x(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(q=document.createElement("option"),
|
|
|
|
|
q.setAttribute("value",App.MODE_GITHUB),mxUtils.write(q,mxResources.get("github")),F.appendChild(q),x(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GITLAB),mxUtils.write(q,mxResources.get("gitlab")),F.appendChild(q),x(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(q=document.createElement("option"),q.setAttribute("value",
|
|
|
|
|
App.MODE_TRELLO),mxUtils.write(q,mxResources.get("trello")),F.appendChild(q),x(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(q=document.createElement("option"),q.setAttribute("value",App.MODE_DEVICE),mxUtils.write(q,mxResources.get("device")),F.appendChild(q),a.mode!=App.MODE_DEVICE&&n||q.setAttribute("selected","selected"),m&&x(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),
|
|
|
|
|
App.MODE_DEVICE));n&&isLocalStorage&&"0"!=urlParams.browser&&(n=document.createElement("option"),n.setAttribute("value",App.MODE_BROWSER),mxUtils.write(n,mxResources.get("browser")),F.appendChild(n),a.mode==App.MODE_BROWSER&&n.setAttribute("selected","selected"),x(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=k&&(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(k)}),
|
|
|
|
|
m.className="geBtn",n.appendChild(m));m=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});m.className="geBtn";a.editor.cancelFirst&&n.appendChild(m);null==b&&(q=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),q.className="geBtn",n.appendChild(q));d&&Editor.popupsAllowed&&(d=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),d.className="geBtn",n.appendChild(d));
|
|
|
|
|
CreateDialog.showDownloadButton&&(d=mxUtils.button(mxResources.get("download"),function(){A("download")}),d.className="geBtn",n.appendChild(d));a.editor.cancelFirst||n.appendChild(m);mxEvent.addListener(B,"keypress",function(d){13==d.keyCode?A(App.MODE_DEVICE):27==d.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(n);this.container=f};CreateDialog.showDownloadButton=!0;
|
|
|
|
|
m.className="geBtn",n.appendChild(m));m=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});m.className="geBtn";a.editor.cancelFirst&&n.appendChild(m);null==b&&(q=mxUtils.button(mxResources.get("decideLater"),function(){B(null)}),q.className="geBtn",n.appendChild(q));d&&Editor.popupsAllowed&&(d=mxUtils.button(mxResources.get("openInNewWindow"),function(){B("_blank")}),d.className="geBtn",n.appendChild(d));
|
|
|
|
|
CreateDialog.showDownloadButton&&(d=mxUtils.button(mxResources.get("download"),function(){B("download")}),d.className="geBtn",n.appendChild(d));a.editor.cancelFirst||n.appendChild(m);mxEvent.addListener(A,"keypress",function(d){13==d.keyCode?B(App.MODE_DEVICE):27==d.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(n);this.container=f};CreateDialog.showDownloadButton=!0;
|
|
|
|
|
var PopupDialog=function(a,c,e,b,g){g=null!=g?g:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){g&&a.hideDialog();null!=b&&b()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";f.appendChild(l);mxUtils.br(f);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){g&&a.hideDialog();null!=e&&e();a.openLink(c,
|
|
|
|
|
null,!0)});n.className="geBtn gePrimaryBtn";n.style.width=l.style.width;f.appendChild(n);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,c,e,b,g,f){f=null!=f?f:!0;var l=a.editor.graph,n=document.createElement("div");mxUtils.write(n,c);c=document.createElement("div");c.className="geTitle";c.style.backgroundColor="transparent";c.style.borderColor="transparent";c.style.whiteSpace="nowrap";c.style.textOverflow="clip";c.style.cursor=
|
|
|
|
|
"default";mxClient.IS_VML||(c.style.paddingRight="20px");var d=document.createElement("input");d.setAttribute("value",e);d.setAttribute("type","text");d.setAttribute("spellcheck","false");d.setAttribute("autocorrect","off");d.setAttribute("autocomplete","off");d.setAttribute("autocapitalize","off");d.style.marginTop="6px";d.style.width=(Graph.fileSupport?460:340)+(mxClient.IS_QUIRKS?20:-20)+"px";d.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";d.style.backgroundRepeat="no-repeat";
|
|
|
|
@ -9686,9 +9686,9 @@ mxUtils.write(f,mxResources.get("feedback"));g.appendChild(f);var m=document.cre
|
|
|
|
|
e.appendChild(f));g.appendChild(e);this.container=g};FeedbackDialog.maxAttachmentSize=1E6;
|
|
|
|
|
var RevisionDialog=function(a,c,e){var b=document.createElement("div"),g=document.createElement("h3");g.style.marginTop="0px";mxUtils.write(g,mxResources.get("revisionHistory"));b.appendChild(g);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";b.appendChild(f);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);b.appendChild(l);var n=new Graph(l);n.setTooltips(!1);n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;var d=0,k=null,m=0,p=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=k&&null!=k[m]?k[m].getAttribute("name"):"pagenumber"==a?m+1:"pagecount"==a?null!=k?k.length:1:p.apply(this,arguments)};n.getLinkForCell=
|
|
|
|
|
function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(d,b){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var u=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%"}),q=a.getCurrentFile(),t=null,v=null,y=null,x=null,A=mxUtils.button("",function(){null!=y&&n.zoomIn()});A.className="geSprite geSprite-zoomin";
|
|
|
|
|
A.setAttribute("title",mxResources.get("zoomIn"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var z=mxUtils.button("",function(){null!=y&&n.zoomOut()});z.className="geSprite geSprite-zoomout";z.setAttribute("title",mxResources.get("zoomOut"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var B=mxUtils.button("",function(){null!=y&&
|
|
|
|
|
(n.maxFitScale=8,n.fit(8),n.center())});B.className="geSprite geSprite-fit";B.setAttribute("title",mxResources.get("fit"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var C=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled",
|
|
|
|
|
function(){return null};Editor.MathJaxRender&&n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(d,b){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var u=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%"}),q=a.getCurrentFile(),t=null,v=null,y=null,x=null,B=mxUtils.button("",function(){null!=y&&n.zoomIn()});B.className="geSprite geSprite-zoomin";
|
|
|
|
|
B.setAttribute("title",mxResources.get("zoomIn"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var z=mxUtils.button("",function(){null!=y&&n.zoomOut()});z.className="geSprite geSprite-zoomout";z.setAttribute("title",mxResources.get("zoomOut"));z.style.outline="none";z.style.border="none";z.style.margin="2px";z.setAttribute("disabled","disabled");mxUtils.setOpacity(z,20);var A=mxUtils.button("",function(){null!=y&&
|
|
|
|
|
(n.maxFitScale=8,n.fit(8),n.center())});A.className="geSprite geSprite-fit";A.setAttribute("title",mxResources.get("fit"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var C=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled",
|
|
|
|
|
"disabled");mxUtils.setOpacity(C,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var d=mxUtils.getXml(y.documentElement),b=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml"):(d=
|
|
|
|
|
"undefined"===typeof pako?"&xml="+encodeURIComponent(d):"&data="+encodeURIComponent(Graph.compress(d)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+d)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=x&&a.confirm(mxResources.get("areYouSure"),function(){null!=e?e(x):a.spinner.spin(document.body,mxResources.get("restoring"))&&q.save(!0,function(d){a.spinner.stop();
|
|
|
|
|
a.replaceFileData(x);a.hideDialog()},function(d){a.spinner.stop();a.editor.setStatus("");a.handleError(d,null!=d?mxResources.get("errorSavingFile"):null)})})});G.className="geBtn";G.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 H=null;mxEvent.addListener(E,"change",function(a){null!=
|
|
|
|
@ -9697,21 +9697,21 @@ H&&(H(a),mxEvent.consume(a))});var J=mxUtils.button(mxResources.get("edit"),func
|
|
|
|
|
"1px solid lightGray";N.style.borderCollapse="collapse";N.style.borderSpacing="0px";N.style.width="100%";var U=document.createElement("tbody"),L=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(d=mxUtils.indexOf(a.pages,a.currentPage));for(var T=c.length-1;0<=T;T--){var Z=function(b){var e=new Date(b.modifiedDate),f=null;if(0<=e.getTime()){var p=function(c){u.stop();var p=mxUtils.parseXml(c),g=a.editor.extractGraphModel(p.documentElement,!0);if(null!=g){var t=function(a){null!=a&&(a=
|
|
|
|
|
K(Editor.parseDiagramNode(a)));return a},K=function(a){var d=a.getAttribute("background");if(null==d||""==d||d==mxConstants.NONE)d="#ffffff";l.style.backgroundColor=d;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return a};E.style.display="none";E.innerHTML="";y=p;x=c;k=parseSelectFunction=null;m=0;if("mxfile"==g.nodeName){p=g.getElementsByTagName("diagram");k=[];for(c=0;c<p.length;c++)k.push(p[c]);m=Math.min(d,k.length-1);0<k.length&&t(k[m]);if(1<k.length)for(E.removeAttribute("disabled"),
|
|
|
|
|
E.style.display="",c=0;c<k.length;c++)p=document.createElement("option"),mxUtils.write(p,k[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),p.setAttribute("value",c),c==m&&p.setAttribute("selected","selected"),E.appendChild(p);H=function(){try{var b=parseInt(E.value);m=d=b;t(k[b])}catch(ca){E.value=d,a.handleError(ca)}}}else K(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");D.innerHTML="";mxUtils.write(D,(null!=c?c+" ":"")+e.toLocaleDateString()+" "+
|
|
|
|
|
e.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));A.removeAttribute("disabled");z.removeAttribute("disabled");B.removeAttribute("disabled");C.removeAttribute("disabled");null!=q&&q.isRestricted()||(a.editor.graph.isEnabled()&&G.removeAttribute("disabled"),F.removeAttribute("disabled"),I.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(A,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(B,60);mxUtils.setOpacity(C,60)}else E.style.display="none",E.innerHTML=
|
|
|
|
|
e.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));B.removeAttribute("disabled");z.removeAttribute("disabled");A.removeAttribute("disabled");C.removeAttribute("disabled");null!=q&&q.isRestricted()||(a.editor.graph.isEnabled()&&G.removeAttribute("disabled"),F.removeAttribute("disabled"),I.removeAttribute("disabled"),J.removeAttribute("disabled"));mxUtils.setOpacity(B,60);mxUtils.setOpacity(z,60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(C,60)}else E.style.display="none",E.innerHTML=
|
|
|
|
|
"",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},f=document.createElement("tr");f.style.borderBottom="1px solid lightGray";f.style.fontSize="12px";f.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")):e.toDateString()===L?mxUtils.write(g,e.toLocaleTimeString()):mxUtils.write(g,e.toLocaleDateString()+" "+e.toLocaleTimeString());f.appendChild(g);f.setAttribute("title",
|
|
|
|
|
e.toLocaleDateString()+" "+e.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(f,"click",function(a){v!=b&&(u.stop(),null!=t&&(t.style.backgroundColor=""),v=b,t=f,t.style.backgroundColor="#ebf2f9",x=y=null,D.removeAttribute("title"),D.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),l.style.backgroundColor="#ffffff",n.getModel().clear(),G.setAttribute("disabled",
|
|
|
|
|
"disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(A,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(C,20),u.spin(l),b.getXml(function(a){if(v==b)try{p(a)}catch(O){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
|
|
|
|
|
"disabled"),F.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(B,20),mxUtils.setOpacity(z,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(C,20),u.spin(l),b.getXml(function(a){if(v==b)try{p(a)}catch(O){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
|
|
|
|
|
": "+O.message)}},function(a){u.stop();E.style.display="none";E.innerHTML="";D.innerHTML="";mxUtils.write(D,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(f,"dblclick",function(a){I.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);U.appendChild(f)}return f}(c[T]);null!=Z&&T==c.length-1&&(M=Z)}N.appendChild(U);f.appendChild(N)}else null==q||null==a.drive&&q.constructor==window.DriveFile||
|
|
|
|
|
null==a.dropbox&&q.constructor==window.DropboxFile?(l.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(l.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";K.appendChild(E);K.appendChild(A);K.appendChild(z);K.appendChild(C);K.appendChild(B);a.editor.cancelFirst?(g.appendChild(f),g.appendChild(F),
|
|
|
|
|
null==a.dropbox&&q.constructor==window.DropboxFile?(l.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(l.style.display="none",K.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";K.appendChild(E);K.appendChild(B);K.appendChild(z);K.appendChild(C);K.appendChild(A);a.editor.cancelFirst?(g.appendChild(f),g.appendChild(F),
|
|
|
|
|
g.appendChild(J),g.appendChild(G),g.appendChild(I)):(g.appendChild(F),g.appendChild(J),g.appendChild(G),g.appendChild(I),g.appendChild(f));b.appendChild(g);b.appendChild(K);b.appendChild(D);this.container=b},DraftDialog=function(a,c,e,b,g,f,l,n,d){var k=document.createElement("div"),m=document.createElement("div");m.style.marginTop="0px";m.style.whiteSpace="nowrap";m.style.overflow="auto";m.style.lineHeight="normal";mxUtils.write(m,c);k.appendChild(m);var p=document.createElement("select"),u=mxUtils.bind(this,
|
|
|
|
|
function(){A=mxUtils.parseXml(d[p.value].data);z=a.editor.extractGraphModel(A.documentElement,!0);B=0;this.init()});if(null!=d){p.style.marginLeft="4px";for(c=0;c<d.length;c++){var q=document.createElement("option");q.setAttribute("value",c);var t=new Date(d[c].created),v=new Date(d[c].modified);mxUtils.write(q,t.toLocaleDateString()+" "+t.toLocaleTimeString()+" - "+(t.toDateString(),v.toDateString(),v.toLocaleDateString())+" "+v.toLocaleTimeString());p.appendChild(q)}m.appendChild(p);mxEvent.addListener(p,
|
|
|
|
|
"change",u)}null==e&&(e=d[0].data);var y=document.createElement("div");y.style.position="absolute";y.style.border="1px solid lightGray";y.style.marginTop="10px";y.style.left="40px";y.style.right="40px";y.style.top="46px";y.style.bottom="74px";y.style.overflow="hidden";mxEvent.disableContextMenu(y);k.appendChild(y);var x=new Graph(y);x.setEnabled(!1);x.setPanning(!0);x.panningHandler.ignoreCell=!0;x.panningHandler.useLeftButtonForPanning=!0;x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;var A=
|
|
|
|
|
mxUtils.parseXml(e),z=a.editor.extractGraphModel(A.documentElement,!0),B=0,C=null,D=x.getGlobalVariable;x.getGlobalVariable=function(a){return"page"==a&&null!=C&&null!=C[B]?C[B].getAttribute("name"):"pagenumber"==a?B+1:"pagecount"==a?null!=C?C.length:1:D.apply(this,arguments)};x.getLinkForCell=function(){return null};e=mxUtils.button("",function(){x.zoomIn()});e.className="geSprite geSprite-zoomin";e.setAttribute("title",mxResources.get("zoomIn"));e.style.outline="none";e.style.border="none";e.style.margin=
|
|
|
|
|
function(){B=mxUtils.parseXml(d[p.value].data);z=a.editor.extractGraphModel(B.documentElement,!0);A=0;this.init()});if(null!=d){p.style.marginLeft="4px";for(c=0;c<d.length;c++){var q=document.createElement("option");q.setAttribute("value",c);var t=new Date(d[c].created),v=new Date(d[c].modified);mxUtils.write(q,t.toLocaleDateString()+" "+t.toLocaleTimeString()+" - "+(t.toDateString(),v.toDateString(),v.toLocaleDateString())+" "+v.toLocaleTimeString());p.appendChild(q)}m.appendChild(p);mxEvent.addListener(p,
|
|
|
|
|
"change",u)}null==e&&(e=d[0].data);var y=document.createElement("div");y.style.position="absolute";y.style.border="1px solid lightGray";y.style.marginTop="10px";y.style.left="40px";y.style.right="40px";y.style.top="46px";y.style.bottom="74px";y.style.overflow="hidden";mxEvent.disableContextMenu(y);k.appendChild(y);var x=new Graph(y);x.setEnabled(!1);x.setPanning(!0);x.panningHandler.ignoreCell=!0;x.panningHandler.useLeftButtonForPanning=!0;x.minFitScale=null;x.maxFitScale=null;x.centerZoom=!0;var B=
|
|
|
|
|
mxUtils.parseXml(e),z=a.editor.extractGraphModel(B.documentElement,!0),A=0,C=null,D=x.getGlobalVariable;x.getGlobalVariable=function(a){return"page"==a&&null!=C&&null!=C[A]?C[A].getAttribute("name"):"pagenumber"==a?A+1:"pagecount"==a?null!=C?C.length:1:D.apply(this,arguments)};x.getLinkForCell=function(){return null};e=mxUtils.button("",function(){x.zoomIn()});e.className="geSprite geSprite-zoomin";e.setAttribute("title",mxResources.get("zoomIn"));e.style.outline="none";e.style.border="none";e.style.margin=
|
|
|
|
|
"2px";mxUtils.setOpacity(e,60);m=mxUtils.button("",function(){x.zoomOut()});m.className="geSprite geSprite-zoomout";m.setAttribute("title",mxResources.get("zoomOut"));m.style.outline="none";m.style.border="none";m.style.margin="2px";mxUtils.setOpacity(m,60);c=mxUtils.button("",function(){x.maxFitScale=8;x.fit(8);x.center()});c.className="geSprite geSprite-fit";c.setAttribute("title",mxResources.get("fit"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);
|
|
|
|
|
q=mxUtils.button("",function(){x.zoomActual();x.center()});q.className="geSprite geSprite-actualsize";q.setAttribute("title",mxResources.get("actualSize"));q.style.outline="none";q.style.border="none";q.style.margin="2px";mxUtils.setOpacity(q,60);l=mxUtils.button(l||mxResources.get("discard"),function(){g.apply(this,[p.value,mxUtils.bind(this,function(){null!=p.parentNode&&(p.options[p.selectedIndex].parentNode.removeChild(p.options[p.selectedIndex]),0<p.options.length?(p.value=p.options[0].value,
|
|
|
|
|
u()):a.hideDialog(!0))})])});l.className="geBtn";var F=document.createElement("select");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";f=mxUtils.button(f||mxResources.get("edit"),function(){b.apply(this,[p.value])});f.className="geBtn gePrimaryBtn";t=document.createElement("div");t.style.position="absolute";t.style.bottom="30px";t.style.right="40px";t.style.textAlign="right";v=document.createElement("div");
|
|
|
|
|
v.className="geToolbarContainer";v.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var d=a.getAttribute("background");if(null==d||""==d||d==mxConstants.NONE)d="dark"==uiTheme?"transparent":"#ffffff";y.style.backgroundColor=d;(new mxCodec(a.ownerDocument)).decode(a,x.getModel());x.maxFitScale=1;x.fit(8);x.center()}return a}function d(d){null!=d&&(d=a(Editor.parseDiagramNode(d)));
|
|
|
|
|
return d}mxEvent.addListener(F,"change",function(a){B=parseInt(F.value);d(C[B]);mxEvent.consume(a)});if("mxfile"==z.nodeName){var b=z.getElementsByTagName("diagram");C=[];for(var c=0;c<b.length;c++)C.push(b[c]);0<C.length&&d(C[B]);F.innerHTML="";if(1<C.length)for(F.style.display="",c=0;c<C.length;c++)b=document.createElement("option"),mxUtils.write(b,C[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),b.setAttribute("value",c),c==B&&b.setAttribute("selected","selected"),F.appendChild(b);
|
|
|
|
|
return d}mxEvent.addListener(F,"change",function(a){A=parseInt(F.value);d(C[A]);mxEvent.consume(a)});if("mxfile"==z.nodeName){var b=z.getElementsByTagName("diagram");C=[];for(var c=0;c<b.length;c++)C.push(b[c]);0<C.length&&d(C[A]);F.innerHTML="";if(1<C.length)for(F.style.display="",c=0;c<C.length;c++)b=document.createElement("option"),mxUtils.write(b,C[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),b.setAttribute("value",c),c==A&&b.setAttribute("selected","selected"),F.appendChild(b);
|
|
|
|
|
else F.style.display="none"}else a(z)};v.appendChild(F);v.appendChild(e);v.appendChild(m);v.appendChild(q);v.appendChild(c);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.className="geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(t.appendChild(e),null!=n&&t.appendChild(n),t.appendChild(l),t.appendChild(f)):(t.appendChild(f),t.appendChild(l),null!=n&&t.appendChild(n),t.appendChild(e));k.appendChild(t);
|
|
|
|
|
k.appendChild(v);this.container=k},FindWindow=function(a,c,e,b,g){function f(a,d,b){if("object"===typeof d.value&&null!=d.value.attributes){d=d.value.attributes;for(var c=0;c<d.length;c++)if("label"!=d[c].nodeName){var e=mxUtils.trim(d[c].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&e.substring(0,b.length)===b||null!=a&&a.test(e))return!0}}return!1}function l(b){var c=d.model.getDescendants(d.model.getRoot()),e=q.value.toLowerCase(),g=t.checked?new RegExp(e):null,
|
|
|
|
|
u=null;k!=e&&(k=e,m=null,p=!1);var z=null==m;if(0<e.length){if(p){p=!1;for(var n,v=0;v<a.pages.length;v++)if(a.currentPage==a.pages[v]){n=v;break}b=(n+1)%a.pages.length;m=null;do p=!1,c=a.pages[b],d=a.createTemporaryGraph(d.getStylesheet()),a.updatePageRoot(c),d.model.setRoot(c.root),b=(b+1)%a.pages.length;while(!l(!0)&&b!=n);m&&(m=null,a.selectPage(c));p=!1;d=a.editor.graph;return l(!0)}for(v=0;v<c.length;v++){n=d.view.getState(c[v]);if(null!=n&&null!=n.cell.value&&(z||null==u)&&(d.model.isVertex(n.cell)||
|
|
|
|
@ -9720,10 +9720,10 @@ d.setSelectionCell(m.cell):d.highlightCell(m.cell)}else{if(!b&&y.checked)return
|
|
|
|
|
"6px";q.style.width="200px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";u.appendChild(q);mxUtils.br(u);var t=document.createElement("input");t.setAttribute("id","geFindWinRegExChck");t.setAttribute("type","checkbox");t.style.marginRight="4px";u.appendChild(t);var v=document.createElement("label");v.setAttribute("for","geFindWinRegExChck");u.appendChild(v);mxUtils.write(v,mxResources.get("regularExpression"));u.appendChild(v);v=a.menus.createHelpLink("https://www.diagrams.net/doc/faq/find-shapes");
|
|
|
|
|
v.style.position="relative";v.style.marginLeft="6px";v.style.top="-1px";u.appendChild(v);mxUtils.br(u);var y=document.createElement("input");y.setAttribute("id","geFindWinAllPagesChck");y.setAttribute("type","checkbox");y.style.marginRight="4px";u.appendChild(y);v=document.createElement("label");v.setAttribute("for","geFindWinAllPagesChck");u.appendChild(v);mxUtils.write(v,mxResources.get("allPages"));u.appendChild(v);var x=document.createElement("div");mxUtils.br(u);v=mxUtils.button(mxResources.get("reset"),
|
|
|
|
|
function(){q.value="";q.style.backgroundColor="";k=m=null;p=!1;q.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.style.marginLeft=(b-20-156)/2+"px";v.className="geBtn";u.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(z){a.handleError(z)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";u.appendChild(v);
|
|
|
|
|
mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||93==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(k!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(B){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(u,"keydown",function(d){70==d.keyCode&&a.keyHandler.isControlDown(d)&&!mxEvent.isShiftDown(d)&&(n.funct(),mxEvent.consume(d))});this.window=new mxWindow(mxResources.get("find"),u,c,e,b,g,!0,!0);this.window.destroyOnClose=
|
|
|
|
|
mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||93==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(k!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(A){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(u,"keydown",function(d){70==d.keyCode&&a.keyHandler.isControlDown(d)&&!mxEvent.isShiftDown(d)&&(n.funct(),mxEvent.consume(d))});this.window=new mxWindow(mxResources.get("find"),u,c,e,b,g,!0,!0);this.window.destroyOnClose=
|
|
|
|
|
!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null),null!=a.pages&&1<a.pages.length?y.removeAttribute("disabled"):(y.checked=!1,y.setAttribute("disabled","disabled"))):d.container.focus()}));this.window.setLocation=function(a,
|
|
|
|
|
d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var A=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,
|
|
|
|
|
"resize",A);this.destroy=function(){mxEvent.removeListener(window,"resize",A);this.window.destroy()}},FreehandWindow=function(a,c,e,b,g){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var l=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});l.setAttribute("title",mxResources.get("startDrawing"));l.style.marginTop="8px";l.style.marginRight=
|
|
|
|
|
d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var B=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,
|
|
|
|
|
"resize",B);this.destroy=function(){mxEvent.removeListener(window,"resize",B);this.window.destroy()}},FreehandWindow=function(a,c,e,b,g){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var l=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});l.setAttribute("title",mxResources.get("startDrawing"));l.style.marginTop="8px";l.style.marginRight=
|
|
|
|
|
"4px";l.style.width="160px";l.style.overflow="hidden";l.style.textOverflow="ellipsis";l.style.textAlign="center";l.className="geBtn gePrimaryBtn";a.appendChild(l);var n=l.cloneNode(!1);mxUtils.write(n,mxResources.get("stopDrawing"));n.setAttribute("title",mxResources.get("stopDrawing"));n.style.marginTop="4px";mxEvent.addListener(n,"click",function(){f.freehand.stopDrawing()});a.appendChild(n);this.window=new mxWindow(mxResources.get("freehand"),a,c,e,b,g,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
|
|
|
|
|
this.window.setResizable(!1);this.window.setClosable(!0);f.addListener("freehandStateChanged",mxUtils.bind(this,function(){n.className="geBtn"+(f.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){f.freehand.isDrawing()&&f.freehand.stopDrawing()}));this.window.setLocation=function(a,d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;
|
|
|
|
|
a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var d=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,"resize",d);this.destroy=function(){mxEvent.removeListener(window,"resize",d);this.window.destroy()}},
|
|
|
|
@ -9747,7 +9747,7 @@ var u=null,q=[],t=document.createElement("div");t.style.position="relative";t.st
|
|
|
|
|
"12px");var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)f=document.createElement("span"),f.style.paddingRight="20px",f.appendChild(v),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),v.checked=!0,v.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){mxEvent.getSource(a)!=v&&(v.checked=!v.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(f.style.position="relative",f.style.top="-6px"),e.appendChild(f);f=mxUtils.button(mxResources.get("cancel"),
|
|
|
|
|
function(){a.hideDialog()});f.className="geBtn";d=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var d=[],b=0;b<q.length;b++){var c=q[b].apply(this,arguments);null!=c&&d.push(c)}a.sidebar.showEntries(d.join(";"),v.checked,!0)});d.className="geBtn gePrimaryBtn"}else{var y=document.createElement("table"),f=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";d=document.createElement("tr");y.style.width="100%";c=document.createElement("td");var g=document.createElement("td"),
|
|
|
|
|
l=document.createElement("td"),x=mxUtils.bind(this,function(d,b,c){var e=document.createElement("input");e.type="checkbox";y.appendChild(e);e.checked=a.sidebar.isEntryVisible(c);var k=document.createElement("span");mxUtils.write(k,b);b=document.createElement("div");b.style.display="block";b.appendChild(e);b.appendChild(k);mxEvent.addListener(k,"click",function(a){e.checked=!e.checked;mxEvent.consume(a)});d.appendChild(b);return function(){return e.checked?c:null}});d.appendChild(c);d.appendChild(g);
|
|
|
|
|
d.appendChild(l);f.appendChild(d);y.appendChild(f);for(var q=[],A=0,f=0;f<e.length;f++)for(d=0;d<e[f].entries.length;d++)A++;for(var z=[c,g,l],B=0,f=0;f<e.length;f++)(function(a){for(var d=0;d<a.entries.length;d++){var b=a.entries[d];q.push(x(z[Math.floor(B/(A/3))],b.title,b.id));B++}})(e[f]);b.appendChild(y);e=document.createElement("div");e.style.marginTop="18px";e.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=
|
|
|
|
|
d.appendChild(l);f.appendChild(d);y.appendChild(f);for(var q=[],B=0,f=0;f<e.length;f++)for(d=0;d<e[f].entries.length;d++)B++;for(var z=[c,g,l],A=0,f=0;f<e.length;f++)(function(a){for(var d=0;d<a.entries.length;d++){var b=a.entries[d];q.push(x(z[Math.floor(A/(B/3))],b.title,b.id));A++}})(e[f]);b.appendChild(y);e=document.createElement("div");e.style.marginTop="18px";e.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=
|
|
|
|
|
!0,e.appendChild(v),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),e.appendChild(f),mxEvent.addListener(f,"click",function(a){v.checked=!v.checked;mxEvent.consume(a)}));b.appendChild(e);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";d=mxUtils.button(mxResources.get("apply"),function(){for(var d=["search"],b=0;b<q.length;b++){var c=q[b].apply(this,arguments);null!=c&&d.push(c)}a.sidebar.showEntries(0<d.length?
|
|
|
|
|
d.join(";"):"",v.checked);a.hideDialog()});d.className="geBtn gePrimaryBtn";e=document.createElement("div");e.style.marginTop="26px";e.style.textAlign="right"}a.editor.cancelFirst?(e.appendChild(f),e.appendChild(d)):(e.appendChild(d),e.appendChild(f));b.appendChild(e);this.container=b},PluginsDialog=function(a,c,e){function b(){if(0==l.length)f.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{f.innerHTML="";for(var d=0;d<l.length;d++){var c=document.createElement("span");c.style.whiteSpace=
|
|
|
|
|
"nowrap";var k=document.createElement("span");k.className="geSprite geSprite-delete";k.style.position="relative";k.style.cursor="pointer";k.style.top="5px";k.style.marginRight="4px";k.style.display="inline-block";c.appendChild(k);mxUtils.write(c,l[d]);f.appendChild(c);mxUtils.br(f);mxEvent.addListener(k,"click",function(d){return function(){a.confirm(mxResources.get("delete")+' "'+l[d]+'"?',function(){null!=e&&e(l[d]);l.splice(d,1);b()})}}(d))}}}var g=document.createElement("div"),f=document.createElement("div");
|
|
|
|
@ -9764,38 +9764,38 @@ mxUtils.write(d,mxResources.get("left")+":");var p=document.createElement("input
|
|
|
|
|
n.appendChild(k);l.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("dx")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=b&&null!=b.offset?b.offset.x:"";k.appendChild(q);n.appendChild(d);n.appendChild(k);l.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("dy")+
|
|
|
|
|
":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=b&&null!=b.offset?b.offset.y:"";k.appendChild(t);n.appendChild(d);n.appendChild(k);l.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("width")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=b?b.width:"";k.appendChild(v);n.appendChild(d);n.appendChild(k);
|
|
|
|
|
l.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("height")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=b?b.height:"";k.appendChild(y);n.appendChild(d);n.appendChild(k);l.appendChild(n);n=document.createElement("tr");d=document.createElement("td");k=document.createElement("td");mxUtils.write(d,mxResources.get("rotation")+":");var x=document.createElement("input");
|
|
|
|
|
x.setAttribute("type","text");x.style.width="100px";x.value=1==c.length?mxUtils.getValue(e.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";k.appendChild(x);n.appendChild(d);n.appendChild(k);l.appendChild(n);f.appendChild(l);g.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e.getModel().beginUpdate();try{for(var d=0;d<c.length;d++){var b=e.getCellGeometry(c[d]);null!=
|
|
|
|
|
x.setAttribute("type","text");x.style.width="100px";x.value=1==c.length?mxUtils.getValue(e.getCellStyle(c[0]),mxConstants.STYLE_ROTATION,0):"";k.appendChild(x);n.appendChild(d);n.appendChild(k);l.appendChild(n);f.appendChild(l);g.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e.getModel().beginUpdate();try{for(var d=0;d<c.length;d++){var b=e.getCellGeometry(c[d]);null!=
|
|
|
|
|
b&&(b=b.clone(),e.isCellMovable(c[d])&&(b.relative=m.checked,0<mxUtils.trim(p.value).length&&(b.x=Number(p.value)),0<mxUtils.trim(u.value).length&&(b.y=Number(u.value)),0<mxUtils.trim(q.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.x=Number(q.value)),0<mxUtils.trim(t.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.y=Number(t.value))),e.isCellResizable(c[d])&&(0<mxUtils.trim(v.value).length&&(b.width=Number(v.value)),0<mxUtils.trim(y.value).length&&(b.height=Number(y.value))),
|
|
|
|
|
e.getModel().setGeometry(c[d],b));0<mxUtils.trim(x.value).length&&e.setCellStyles(mxConstants.STYLE_ROTATION,Number(x.value),[c[d]])}}finally{e.getModel().endUpdate()}});A.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&A.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(b),f.appendChild(A)):(f.appendChild(A),f.appendChild(b));g.appendChild(f);this.container=g},LibraryDialog=function(a,
|
|
|
|
|
e.getModel().setGeometry(c[d],b));0<mxUtils.trim(x.value).length&&e.setCellStyles(mxConstants.STYLE_ROTATION,Number(x.value),[c[d]])}}finally{e.getModel().endUpdate()}});B.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&B.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(b),f.appendChild(B)):(f.appendChild(B),f.appendChild(b));g.appendChild(f);this.container=g},LibraryDialog=function(a,
|
|
|
|
|
c,e,b,g,f){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=q;)a=a.parentNode;var d=null;if(null!=a)for(var b=q.firstChild,d=0;null!=b&&b!=a;)b=b.nextSibling,d++;return d}function n(d,b,c,e,k,f,p,g,u){try{if(a.spinner.stop(),null==b||"image/"==b.substring(0,6))if(null==d&&null!=p||null==v[d]){var K=function(){H.innerHTML="";H.style.cursor="pointer";H.style.whiteSpace="nowrap";H.style.textOverflow="ellipsis";mxUtils.write(H,null!=G.title&&0<G.title.length?G.title:
|
|
|
|
|
mxResources.get("untitled"));H.style.color=null==G.title||0==G.title.length?"#d0d0d0":""};q.style.backgroundImage="";t.style.display="none";var M=k,x=f;if(k>a.maxImageSize||f>a.maxImageSize){var C=Math.min(1,Math.min(a.maxImageSize/Math.max(1,k)),a.maxImageSize/Math.max(1,f));k*=C;f*=C}M>x?(x=Math.round(100*x/M),M=100):(M=Math.round(100*M/x),x=100);var N=document.createElement("div");N.setAttribute("draggable","true");N.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";N.style.position="relative";
|
|
|
|
|
N.style.cursor="move";mxUtils.setPrefixedStyle(N.style,"transition","transform .1s ease-in-out");if(null!=d){var D=document.createElement("img");D.setAttribute("src",z.convert(d));D.style.width=M+"px";D.style.height=x+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-x)/2)+"px";D.style.paddingLeft=Math.floor((100-M)/2)+"px";N.appendChild(D)}else if(null!=p){var F=a.stringToCells(Graph.decompress(p.xml));0<F.length&&(a.sidebar.createThumb(F,100,100,N,null,!0,!1),N.firstChild.style.display=
|
|
|
|
|
mxClient.IS_QUIRKS?"inline":"inline-block",N.firstChild.style.cursor="")}var I=document.createElement("img");I.setAttribute("src",Editor.closeImage);I.setAttribute("border","0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.position="absolute";I.style.marginLeft="-12px";I.style.zIndex="1";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});(function(a,d,b){mxEvent.addListener(I,"click",function(c){v[d]=
|
|
|
|
|
null;for(var e=0;e<m.length;e++)if(null!=m[e].data&&m[e].data==d||null!=m[e].xml&&null!=b&&m[e].xml==b.xml){m.splice(e,1);break}N.parentNode.removeChild(a);0==m.length&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(c)});mxEvent.addListener(I,"dblclick",function(a){mxEvent.consume(a)})})(N,d,p);N.appendChild(I);N.style.marginBottom="30px";var H=document.createElement("div");H.style.position="absolute";H.style.boxSizing="border-box";H.style.bottom=
|
|
|
|
|
"-18px";H.style.left="10px";H.style.right="10px";H.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var G=null;null!=d?(G={data:d,w:k,h:f,title:u},null!=g&&(G.aspect=g),v[d]=D,m.push(G)):null!=p&&(p.aspect="fixed",m.push(p),G=p);mxEvent.addListener(H,"keydown",function(a){13==a.keyCode&&null!=A&&(A(),A=null,mxEvent.consume(a))});K();N.appendChild(H);mxEvent.addListener(H,"mousedown",function(a){"true"!=H.getAttribute("contentEditable")&&
|
|
|
|
|
mxEvent.consume(a)});F=function(d){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,G.title||"",mxResources.get("ok"),function(a){null!=a&&(G.title=a,K())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(d)}else if("true"!=H.getAttribute("contentEditable")){null!=A&&(A(),A=null);if(null==G.title||0==G.title.length)H.innerHTML="";H.style.textOverflow="";H.style.whiteSpace=
|
|
|
|
|
"";H.style.cursor="text";H.style.color="";H.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(H.style,"user-select","text");H.focus();document.execCommand("selectAll",!1,null);A=function(){H.removeAttribute("contentEditable");H.style.cursor="pointer";G.title=H.innerHTML;K()};mxEvent.consume(d)}};mxEvent.addListener(H,"click",F);mxEvent.addListener(N,"dblclick",F);q.appendChild(N);mxEvent.addListener(N,"dragstart",function(a){null==d&&null!=p&&(I.style.visibility="hidden",H.style.visibility=
|
|
|
|
|
"hidden");mxClient.IS_FF&&null!=p.xml&&a.dataTransfer.setData("Text",p.xml);y=l(a);mxClient.IS_GC&&(N.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(N.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(N,30);I.style.visibility="";H.style.visibility=""},0)});mxEvent.addListener(N,"dragend",function(a){"hidden"==I.style.visibility&&(I.style.visibility="",H.style.visibility="");y=null;mxUtils.setOpacity(N,100);mxUtils.setPrefixedStyle(N.style,"transform",null)})}else B||
|
|
|
|
|
(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{k=!1;try{if(M=mxUtils.parseXml(d),"mxlibrary"==M.documentElement.nodeName){x=JSON.parse(mxUtils.getTextContent(M.documentElement));if(null!=x&&0<x.length)for(var E=0;E<x.length;E++)null!=x[E].xml?n(null,null,0,0,0,0,x[E]):n(x[E].data,null,0,0,x[E].w,x[E].h,null,"fixed",x[E].title);k=!0}else if("mxfile"==M.documentElement.nodeName){for(var J=M.documentElement.getElementsByTagName("diagram"),E=0;E<J.length;E++){var x=mxUtils.getTextContent(J[E]),
|
|
|
|
|
F=a.stringToCells(Graph.decompress(x)),W=a.editor.graph.getBoundingBoxFromGeometry(F);n(null,null,0,0,0,0,{xml:x,w:W.width,h:W.height})}k=!0}}catch(R){}k||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(R){}return null}function d(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function k(d){d.stopPropagation();d.preventDefault();B=!1;x=l(d);if(null!=y)null!=x&&x<q.children.length?(m.splice(x>y?x-1:x,0,m.splice(y,1)[0]),
|
|
|
|
|
"-18px";H.style.left="10px";H.style.right="10px";H.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var G=null;null!=d?(G={data:d,w:k,h:f,title:u},null!=g&&(G.aspect=g),v[d]=D,m.push(G)):null!=p&&(p.aspect="fixed",m.push(p),G=p);mxEvent.addListener(H,"keydown",function(a){13==a.keyCode&&null!=B&&(B(),B=null,mxEvent.consume(a))});K();N.appendChild(H);mxEvent.addListener(H,"mousedown",function(a){"true"!=H.getAttribute("contentEditable")&&
|
|
|
|
|
mxEvent.consume(a)});F=function(d){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,G.title||"",mxResources.get("ok"),function(a){null!=a&&(G.title=a,K())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(d)}else if("true"!=H.getAttribute("contentEditable")){null!=B&&(B(),B=null);if(null==G.title||0==G.title.length)H.innerHTML="";H.style.textOverflow="";H.style.whiteSpace=
|
|
|
|
|
"";H.style.cursor="text";H.style.color="";H.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(H.style,"user-select","text");H.focus();document.execCommand("selectAll",!1,null);B=function(){H.removeAttribute("contentEditable");H.style.cursor="pointer";G.title=H.innerHTML;K()};mxEvent.consume(d)}};mxEvent.addListener(H,"click",F);mxEvent.addListener(N,"dblclick",F);q.appendChild(N);mxEvent.addListener(N,"dragstart",function(a){null==d&&null!=p&&(I.style.visibility="hidden",H.style.visibility=
|
|
|
|
|
"hidden");mxClient.IS_FF&&null!=p.xml&&a.dataTransfer.setData("Text",p.xml);y=l(a);mxClient.IS_GC&&(N.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(N.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(N,30);I.style.visibility="";H.style.visibility=""},0)});mxEvent.addListener(N,"dragend",function(a){"hidden"==I.style.visibility&&(I.style.visibility="",H.style.visibility="");y=null;mxUtils.setOpacity(N,100);mxUtils.setPrefixedStyle(N.style,"transform",null)})}else A||
|
|
|
|
|
(A=!0,a.handleError({message:mxResources.get("fileExists")}));else{k=!1;try{if(M=mxUtils.parseXml(d),"mxlibrary"==M.documentElement.nodeName){x=JSON.parse(mxUtils.getTextContent(M.documentElement));if(null!=x&&0<x.length)for(var E=0;E<x.length;E++)null!=x[E].xml?n(null,null,0,0,0,0,x[E]):n(x[E].data,null,0,0,x[E].w,x[E].h,null,"fixed",x[E].title);k=!0}else if("mxfile"==M.documentElement.nodeName){for(var J=M.documentElement.getElementsByTagName("diagram"),E=0;E<J.length;E++){var x=mxUtils.getTextContent(J[E]),
|
|
|
|
|
F=a.stringToCells(Graph.decompress(x)),W=a.editor.graph.getBoundingBoxFromGeometry(F);n(null,null,0,0,0,0,{xml:x,w:W.width,h:W.height})}k=!0}}catch(R){}k||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(R){}return null}function d(a){a.dataTransfer.dropEffect=null!=y?"move":"copy";a.stopPropagation();a.preventDefault()}function k(d){d.stopPropagation();d.preventDefault();A=!1;x=l(d);if(null!=y)null!=x&&x<q.children.length?(m.splice(x>y?x-1:x,0,m.splice(y,1)[0]),
|
|
|
|
|
q.insertBefore(q.children[y],q.children[x])):(m.push(m.splice(y,1)[0]),q.appendChild(q.children[y]));else if(0<d.dataTransfer.files.length)a.importFiles(d.dataTransfer.files,0,0,a.maxImageSize,C(d));else if(0<=mxUtils.indexOf(d.dataTransfer.types,"text/uri-list")){var b=decodeURIComponent(d.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(b)||/(\.png)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b)||/(\.svg)($|\?)/i.test(b))&&a.loadImage(b,function(a){n(b,null,0,0,a.width,a.height);q.scrollTop=
|
|
|
|
|
q.scrollHeight})}d.stopPropagation();d.preventDefault()}var m=[];e=document.createElement("div");e.style.height="100%";var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.height="40px";e.appendChild(p);mxUtils.write(p,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var u=document.createElement("input");u.setAttribute("value",c);u.style.marginRight="20px";u.style.marginLeft="10px";u.style.width="500px";null==g||g.isRenamable()||u.setAttribute("disabled",
|
|
|
|
|
"true");this.init=function(){if(null==g||g.isRenamable())u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};p.appendChild(u);var q=document.createElement("div");q.style.borderWidth="1px 0px 1px 0px";q.style.borderColor="#d3d3d3";q.style.borderStyle="solid";q.style.marginTop="6px";q.style.overflow="auto";q.style.height="340px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";0==
|
|
|
|
|
m.length&&Graph.fileSupport&&(q.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"));e.appendChild(t);var v={},y=null,x=null,A=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=A&&(A(),A=null,mxEvent.consume(a))};mxEvent.addListener(q,
|
|
|
|
|
"mousedown",c);mxEvent.addListener(q,"pointerdown",c);mxEvent.addListener(q,"touchstart",c);var z=new mxUrlConverter,B=!1;if(null!=b)for(c=0;c<b.length;c++)p=b[c],n(p.data,null,0,0,p.w,p.h,p,p.aspect,p.title);mxEvent.addListener(q,"dragleave",function(a){t.style.cursor="";for(var d=mxEvent.getSource(a);null!=d;){if(d==q||d==t){a.stopPropagation();a.preventDefault();break}d=d.parentNode}});var C=function(d){return function(b,c,e,k,m,f,p,g,l){null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l.name)||/(\.vs(x|sx?))($|\?)/i.test(l.name))?
|
|
|
|
|
m.length&&Graph.fileSupport&&(q.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"));e.appendChild(t);var v={},y=null,x=null,B=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=B&&(B(),B=null,mxEvent.consume(a))};mxEvent.addListener(q,
|
|
|
|
|
"mousedown",c);mxEvent.addListener(q,"pointerdown",c);mxEvent.addListener(q,"touchstart",c);var z=new mxUrlConverter,A=!1;if(null!=b)for(c=0;c<b.length;c++)p=b[c],n(p.data,null,0,0,p.w,p.h,p,p.aspect,p.title);mxEvent.addListener(q,"dragleave",function(a){t.style.cursor="";for(var d=mxEvent.getSource(a);null!=d;){if(d==q||d==t){a.stopPropagation();a.preventDefault();break}d=d.parentNode}});var C=function(d){return function(b,c,e,k,m,f,p,g,l){null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l.name)||/(\.vs(x|sx?))($|\?)/i.test(l.name))?
|
|
|
|
|
a.importVisio(l,mxUtils.bind(this,function(a){n(a,c,e,k,m,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," "))})):null!=l&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(b,l.name)?a.parseFile(l,mxUtils.bind(this,function(b){4==b.readyState&&(a.spinner.stop(),200<=b.status&&299>=b.status&&(n(b.responseText,c,e,k,m,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight))})):(n(b,c,
|
|
|
|
|
e,k,m,f,p,"fixed",mxEvent.isAltDown(d)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight)}};mxEvent.addListener(q,"dragover",d);mxEvent.addListener(q,"drop",k);mxEvent.addListener(t,"dragover",d);mxEvent.addListener(t,"drop",k);e.appendChild(q);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&
|
|
|
|
|
b.appendChild(c);"draw.io"!=a.getServiceName()||null==g||g.constructor!=DriveLibrary&&g.constructor!=GitHubLibrary||(p=mxUtils.button(mxResources.get("link"),function(){a.spinner.spin(document.body,mxResources.get("loading"))&&g.getPublicUrl(function(d){a.spinner.stop();if(null!=d){var b=a.getSearch("create title mode url drive splash state clibs ui".split(" ")),b=b+((0==b.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(d));d=new EmbedDialog(a,window.location.protocol+"//"+window.location.host+
|
|
|
|
|
"/"+b,null,null,null,null,"Check out the library I made using @drawio");a.showDialog(d.container,440,240,!0);d.init()}else g.constructor==DriveLibrary?a.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){a.drive.showPermissions(g.getId())}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):a.handleError({message:mxResources.get("diagramIsNotPublic")})})}),p.className="geBtn",b.appendChild(p));p=mxUtils.button(mxResources.get("export"),
|
|
|
|
|
function(){var d=a.createLibraryDataFromImages(m),b=u.value;/(\.xml)$/i.test(b)||(b+=".xml");a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml",null,null,!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml&xml="+encodeURIComponent(d))).simulate(document,"_blank")});p.setAttribute("id","btnDownload");p.className="geBtn";b.appendChild(p);if(Graph.fileSupport){if(null==a.libDlgFileInputElt){var D=document.createElement("input");D.setAttribute("multiple","multiple");
|
|
|
|
|
D.setAttribute("type","file");mxEvent.addListener(D,"change",function(d){B=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,b,c,e,k,m,f,p,g){null!=D.files&&(C(d)(a,b,c,e,k,m,f,p,g),D.type="",D.type="file",D.value="")});q.scrollTop=q.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt=D}p=mxUtils.button(mxResources.get("import"),function(){null!=A&&(A(),A=null);a.libDlgFileInputElt.click()});p.setAttribute("id","btnAddImage");p.className="geBtn";b.appendChild(p)}p=
|
|
|
|
|
mxUtils.button(mxResources.get("addImages"),function(){null!=A&&(A(),A=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,d,b){B=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var c=a.indexOf(",");0<c&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))}n(a,null,0,0,d,b);q.scrollTop=q.scrollHeight}})});p.setAttribute("id","btnAddImageUrl");p.className="geBtn";b.appendChild(p);this.saveBtnClickHandler=function(d,b,c,e){a.saveLibrary(d,b,c,e)};p=mxUtils.button(mxResources.get("save"),
|
|
|
|
|
mxUtils.bind(this,function(){null!=A&&(A(),A=null);this.saveBtnClickHandler(u.value,m,g,f)}));p.setAttribute("id","btnSave");p.className="geBtn gePrimaryBtn";b.appendChild(p);a.editor.cancelFirst||b.appendChild(c);e.appendChild(b);this.container=e},EditShapeDialog=function(a,c,e,b,g){b=null!=b?b:300;g=null!=g?g:120;var f,l,n=document.createElement("table"),d=document.createElement("tbody");n.style.cellPadding="4px";f=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan",
|
|
|
|
|
D.setAttribute("type","file");mxEvent.addListener(D,"change",function(d){A=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,b,c,e,k,m,f,p,g){null!=D.files&&(C(d)(a,b,c,e,k,m,f,p,g),D.type="",D.type="file",D.value="")});q.scrollTop=q.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt=D}p=mxUtils.button(mxResources.get("import"),function(){null!=B&&(B(),B=null);a.libDlgFileInputElt.click()});p.setAttribute("id","btnAddImage");p.className="geBtn";b.appendChild(p)}p=
|
|
|
|
|
mxUtils.button(mxResources.get("addImages"),function(){null!=B&&(B(),B=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,d,b){A=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var c=a.indexOf(",");0<c&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))}n(a,null,0,0,d,b);q.scrollTop=q.scrollHeight}})});p.setAttribute("id","btnAddImageUrl");p.className="geBtn";b.appendChild(p);this.saveBtnClickHandler=function(d,b,c,e){a.saveLibrary(d,b,c,e)};p=mxUtils.button(mxResources.get("save"),
|
|
|
|
|
mxUtils.bind(this,function(){null!=B&&(B(),B=null);this.saveBtnClickHandler(u.value,m,g,f)}));p.setAttribute("id","btnSave");p.className="geBtn gePrimaryBtn";b.appendChild(p);a.editor.cancelFirst||b.appendChild(c);e.appendChild(b);this.container=e},EditShapeDialog=function(a,c,e,b,g){b=null!=b?b:300;g=null!=g?g:120;var f,l,n=document.createElement("table"),d=document.createElement("tbody");n.style.cellPadding="4px";f=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan",
|
|
|
|
|
"2");l.style.fontSize="10pt";mxUtils.write(l,e);f.appendChild(l);d.appendChild(f);f=document.createElement("tr");l=document.createElement("td");var k=document.createElement("textarea");k.style.outline="none";k.style.resize="none";k.style.width=b-200+"px";k.style.height=g+"px";this.textarea=k;this.init=function(){k.focus();k.scrollTop=0};l.appendChild(k);f.appendChild(l);l=document.createElement("td");e=document.createElement("div");e.style.position="relative";e.style.border="1px solid gray";e.style.top=
|
|
|
|
|
"6px";e.style.width="200px";e.style.height=g+4+"px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);l.appendChild(e);var m=new Graph(e);m.setEnabled(!1);var p=a.editor.graph.cloneCell(c);m.addCells([p]);e=m.view.getState(p);var u="";null!=e.shape&&null!=e.shape.stencil&&(u=mxUtils.getPrettyXml(e.shape.stencil.desc));mxUtils.write(k,u||"");e=m.getGraphBounds();g=Math.min(160/e.width,(g-40)/e.height);m.view.scaleAndTranslate(g,20/g-e.x,20/g-e.y);f.appendChild(l);
|
|
|
|
|
d.appendChild(f);f=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");a.isOffline()||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/doc/faq/shape-complex-create-edit")}),g.className="geBtn",l.appendChild(g));g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);
|
|
|
|
|
var q=function(d,b,c){var e=k.value,m=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(m.documentElement),m=m.documentElement.getElementsByTagName("parsererror");if(null!=m&&0<m.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),m=!d.model.contains(b),!c||m||e!=u){e=Graph.compress(e);d.getModel().beginUpdate();try{if(m){var f=a.editor.graph.getFreeInsertPoint();b.geometry.x=f.x;b.geometry.y=f.y;d.addCell(b)}d.setCellStyles(mxConstants.STYLE_SHAPE,
|
|
|
|
|
"stencil("+e+")",[b])}catch(B){throw B;}finally{d.getModel().endUpdate()}m&&(d.setSelectionCell(b),d.scrollCellToVisible(b))}};e=mxUtils.button(mxResources.get("preview"),function(){q(m,p,!1)});e.className="geBtn";l.appendChild(e);e=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,c,!0)});e.className="geBtn gePrimaryBtn";l.appendChild(e);a.editor.cancelFirst||l.appendChild(g);f.appendChild(l);d.appendChild(f);n.appendChild(d);this.container=n},CustomDialog=function(a,c,e,b,g,f,
|
|
|
|
|
"stencil("+e+")",[b])}catch(A){throw A;}finally{d.getModel().endUpdate()}m&&(d.setSelectionCell(b),d.scrollCellToVisible(b))}};e=mxUtils.button(mxResources.get("preview"),function(){q(m,p,!1)});e.className="geBtn";l.appendChild(e);e=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,c,!0)});e.className="geBtn gePrimaryBtn";l.appendChild(e);a.editor.cancelFirst||l.appendChild(g);f.appendChild(l);d.appendChild(f);n.appendChild(d);this.container=n},CustomDialog=function(a,c,e,b,g,f,
|
|
|
|
|
l,n,d,k){var m=document.createElement("div");m.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=l&&c.appendChild(l);a.isOffline()||null==f||(l=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),l.className="geBtn",c.appendChild(l));d=mxUtils.button(d||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b()});d.className="geBtn";n&&(d.style.display="none");a.editor.cancelFirst&&c.appendChild(d);g=mxUtils.button(g||mxResources.get("ok"),
|
|
|
|
|
mxUtils.bind(this,function(){k||a.hideDialog(null,null,this.container);if(null!=e){var d=e();if("string"===typeof d){a.showError(mxResources.get("error"),d);return}}k&&a.hideDialog(null,null,this.container)}));c.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(d);m.appendChild(c);this.cancelBtn=d;this.okButton=g;this.container=m},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">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+
|
|
|
|
@ -9810,23 +9810,23 @@ function t(b){if(null!=H){var e=H;H=null;X.className="geTempDlgCreateBtn geTempD
|
|
|
|
|
a}function y(a,d,b){function c(){X.innerHTML=d?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));v(!d)}L.innerHTML="";q();M=a;var e=null;if(b){e=document.createElement("table");e.className="geTempDlgDiagramsListGrid";var k=document.createElement("tr"),m=document.createElement("th");m.style.width="50%";m.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));k.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=
|
|
|
|
|
mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));k.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));k.appendChild(m);e.appendChild(k);L.appendChild(e)}for(k=0;k<a.length;k++){a[k].isExternal=!d;var f=a[k].url,m=mxUtils.htmlEntities(a[k].title),p=a[k].tooltip||a[k].title,g=a[k].imgUrl,l=mxUtils.htmlEntities(a[k].changedBy||""),n=mxUtils.htmlEntities(a[k].lastModifiedOn||
|
|
|
|
|
"");g||(g=TEMPLATE_PATH+"/"+f.substring(0,f.length-4)+".png");f=b?50:15;null!=m&&m.length>f&&(m=m.substring(0,f)+"…");if(b){var z=document.createElement("tr"),g=document.createElement("td"),K=document.createElement("img");K.src="/images/icon-search.svg";K.className="geTempDlgDiagramListPreviewBtn";K.setAttribute("title",mxResources.get("preview"));g.appendChild(K);p=document.createElement("span");p.className="geTempDlgDiagramTitle";p.innerHTML=m;g.appendChild(p);z.appendChild(g);g=document.createElement("td");
|
|
|
|
|
g.innerHTML=l;z.appendChild(g);g=document.createElement("td");g.innerHTML=n;z.appendChild(g);e.appendChild(z);null==E&&(c(),q(z,"geTempDlgDiagramsListGridActive",a[k]));(function(a,d){mxEvent.addListener(z,"click",function(){E!=d&&(c(),q(d,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(z,"dblclick",t);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],z)}else{var B=document.createElement("div");B.className="geTempDlgDiagramTile";B.setAttribute("title",p);null==E&&(c(),q(B,"geTempDlgDiagramTileActive",
|
|
|
|
|
a[k]));l=document.createElement("div");l.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var x=document.createElement("img");x.style.display="none";(function(a,d){x.onload=function(){d.className="geTempDlgDiagramTileImg";a.style.display=""};x.onerror=function(){d.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(x,l);x.src=g;l.appendChild(x);B.appendChild(l);l=document.createElement("div");l.className="geTempDlgDiagramTileLbl";l.innerHTML=null!=m?m:"";B.appendChild(l);
|
|
|
|
|
K=document.createElement("img");K.src="/images/icon-search.svg";K.className="geTempDlgDiagramPreviewBtn";K.setAttribute("title",mxResources.get("preview"));B.appendChild(K);(function(a,d){mxEvent.addListener(B,"click",function(){E!=d&&(c(),q(d,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(B,"dblclick",t);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],B);L.appendChild(B)}}}function x(a,d){V.innerHTML="";q();for(var b=!d&&5<a.length?5:a.length,c=0;c<b;c++){var e=a[c];e.isCategory=!0;
|
|
|
|
|
g.innerHTML=l;z.appendChild(g);g=document.createElement("td");g.innerHTML=n;z.appendChild(g);e.appendChild(z);null==E&&(c(),q(z,"geTempDlgDiagramsListGridActive",a[k]));(function(a,d){mxEvent.addListener(z,"click",function(){E!=d&&(c(),q(d,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(z,"dblclick",t);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],z)}else{var A=document.createElement("div");A.className="geTempDlgDiagramTile";A.setAttribute("title",p);null==E&&(c(),q(A,"geTempDlgDiagramTileActive",
|
|
|
|
|
a[k]));l=document.createElement("div");l.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var x=document.createElement("img");x.style.display="none";(function(a,d){x.onload=function(){d.className="geTempDlgDiagramTileImg";a.style.display=""};x.onerror=function(){d.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(x,l);x.src=g;l.appendChild(x);A.appendChild(l);l=document.createElement("div");l.className="geTempDlgDiagramTileLbl";l.innerHTML=null!=m?m:"";A.appendChild(l);
|
|
|
|
|
K=document.createElement("img");K.src="/images/icon-search.svg";K.className="geTempDlgDiagramPreviewBtn";K.setAttribute("title",mxResources.get("preview"));A.appendChild(K);(function(a,d){mxEvent.addListener(A,"click",function(){E!=d&&(c(),q(d,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(A,"dblclick",t);mxEvent.addListener(K,"click",function(){u(a)})})(a[k],A);L.appendChild(A)}}}function x(a,d){V.innerHTML="";q();for(var b=!d&&5<a.length?5:a.length,c=0;c<b;c++){var e=a[c];e.isCategory=!0;
|
|
|
|
|
var k=document.createElement("div"),m=mxResources.get(e.title);null==m&&(m=e.title.substring(0,1).toUpperCase()+e.title.substring(1));k.className="geTempDlgNewDiagramCatItem";k.setAttribute("title",m);m=mxUtils.htmlEntities(m);15<m.length&&(m=m.substring(0,15)+"…");null==E&&(X.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),q(k,"geTempDlgNewDiagramCatItemActive",e));var f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemImg";var p=document.createElement("img");
|
|
|
|
|
p.src=NEW_DIAGRAM_CATS_PATH+"/"+e.img;f.appendChild(p);k.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=m;k.appendChild(f);V.appendChild(k);(function(a,d){mxEvent.addListener(k,"click",function(){E!=d&&(X.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),q(d,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",t)})(e,k)}U.style.display=5>a.length?"none":""}function A(a){var d=C.querySelector(".geTemplatesList"),
|
|
|
|
|
p.src=NEW_DIAGRAM_CATS_PATH+"/"+e.img;f.appendChild(p);k.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=m;k.appendChild(f);V.appendChild(k);(function(a,d){mxEvent.addListener(k,"click",function(){E!=d&&(X.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),q(d,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(k,"dblclick",t)})(e,k)}U.style.display=5>a.length?"none":""}function B(a){var d=C.querySelector(".geTemplatesList"),
|
|
|
|
|
b;for(b in a){var c=document.createElement("div"),e=mxResources.get(b),k=a[b];null==e&&(e=b.substring(0,1).toUpperCase()+b.substring(1));c.className="geTemplateCatLink";c.setAttribute("title",e+" ("+k.length+")");e=mxUtils.htmlEntities(e);15<e.length&&(e=e.substring(0,15)+"…");c.innerHTML=e+" ("+k.length+")";d.appendChild(c);(function(d,b,e){mxEvent.addListener(c,"click",function(){G!=e&&(null!=G?(G.style.fontWeight="normal",G.style.textDecoration="none"):(Y.style.display="none",ga.style.minHeight=
|
|
|
|
|
"100%"),G=e,G.style.fontWeight="bold",G.style.textDecoration="underline",aa.scrollTop=0,D&&(F=!0),T.innerHTML=b,Z.style.display="none",y(a[d],!0))})})(b,e,c)}}function z(a){l&&(aa.scrollTop=0,L.innerHTML="",fa.spin(L),F=!1,D=!0,T.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,l(ca,a?null:f))}function B(a){m();aa.scrollTop=0;L.innerHTML="";fa.spin(L);F=!1;D=!0;S=null;T.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
|
|
|
|
|
"100%"),G=e,G.style.fontWeight="bold",G.style.textDecoration="underline",aa.scrollTop=0,D&&(F=!0),T.innerHTML=b,Z.style.display="none",y(a[d],!0))})})(b,e,c)}}function z(a){l&&(aa.scrollTop=0,L.innerHTML="",fa.spin(L),F=!1,D=!0,T.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,l(ca,a?null:f))}function A(a){m();aa.scrollTop=0;L.innerHTML="";fa.spin(L);F=!1;D=!0;S=null;T.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
|
|
|
|
|
' "'+mxUtils.htmlEntities(a)+'"';n(a,ca,I?null:f);N=a}b=null!=b?b:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var C=this.container,D=!1,F=!1,G=null,E=null,H=null,J=!1,I=!0,K=!1,M=[],N,U=C.querySelector(".geTempDlgShowAllBtn"),L=C.querySelector(".geTempDlgDiagramsTiles"),T=C.querySelector(".geTempDlgDiagramsListTitle"),Z=C.querySelector(".geTempDlgDiagramsListBtns"),aa=C.querySelector(".geTempDlgContent"),ga=C.querySelector(".geTempDlgDiagramsList"),Y=C.querySelector(".geTempDlgNewDiagramCat"),
|
|
|
|
|
V=C.querySelector(".geTempDlgNewDiagramCatList"),X=C.querySelector(".geTempDlgCreateBtn"),fa=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(C.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){m();Y.style.display="";ga.style.minHeight="calc(100% - 280px)";z(I)});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){p(this,"geTempDlgAllDiagramsBtnImg",
|
|
|
|
|
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(I=!0,null==N?z(I):B(N))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){p(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(I=!1,null==N?z(I):B(N))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){p(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
|
|
|
|
|
"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(I=!0,null==N?z(I):A(N))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){p(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(I=!1,null==N?z(I):A(N))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){p(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
|
|
|
|
|
"tiles",!1)&&(K=!0,y(M,!1,K))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){p(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,y(M,!1,K))});mxEvent.addListener(U,"click",function(){J?(Y.style.height="280px",V.style.height="190px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),x(R)):(Y.style.height="440px",V.style.height="355px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
|
|
|
|
|
null,"- Show less")),x(R,!0));J=!J});var da=!1,O=!1,W={},R=[],P=1;mxUtils.get(b,function(a){if(!da){da=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var d=a.getAttribute("url");if(null!=d){var b=d.indexOf("/"),d=d.substring(0,b),b=W[d];null==b&&(P++,b=[],W[d]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=
|
|
|
|
|
a.nextSibling}A(W)}});mxUtils.get(g,function(a){if(!O){O=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&R.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;x(R)}});var ca=function(a,d){Z.style.display="";fa.stop();D=!1;F?F=!1:d?L.innerHTML=d:0==a.length?L.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
|
|
|
|
|
y(a,!1,K)};z(I);var S=null;n&&mxEvent.addListener(C.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var d=this;null!=S&&clearTimeout(S);13==a.keyCode?B(d.value):S=setTimeout(function(){B(d.value)},500)});mxEvent.addListener(X,"click",t);mxEvent.addListener(C.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(C.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=e&&e();a.hideDialog(!0)})};
|
|
|
|
|
a.nextSibling}B(W)}});mxUtils.get(g,function(a){if(!O){O=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&R.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;x(R)}});var ca=function(a,d){Z.style.display="";fa.stop();D=!1;F?F=!1:d?L.innerHTML=d:0==a.length?L.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
|
|
|
|
|
y(a,!1,K)};z(I);var S=null;n&&mxEvent.addListener(C.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var d=this;null!=S&&clearTimeout(S);13==a.keyCode?A(d.value):S=setTimeout(function(){A(d.value)},500)});mxEvent.addListener(X,"click",t);mxEvent.addListener(C.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(C.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=e&&e();a.hideDialog(!0)})};
|
|
|
|
|
var BtnDialog=function(a,c,e,b){var g=document.createElement("div");g.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding="0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("done"));var l="Unknown",n=document.createElement("img");n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.marginRight="10px";c==a.drive?(l=mxResources.get("googleDrive"),n.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox?
|
|
|
|
|
(l=mxResources.get("dropbox"),n.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(l=mxResources.get("oneDrive"),n.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(l=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(l=mxResources.get("gitlab"),n.src=IMAGE_PATH+"/gitlab-logo.svg"):c==a.trello&&(l=mxResources.get("trello"),n.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[l],"You are now authorized in {1}"));
|
|
|
|
|
e=mxUtils.button(e,b);e.insertBefore(n,e.firstChild);e.style.marginTop="6px";e.className="geBigButton";e.style.fontSize="18px";e.style.padding="14px";g.appendChild(f);g.appendChild(a);g.appendChild(e);this.container=g},FontDialog=function(a,c,e,b,g){function f(a){this.style.border="";13==a.keyCode&&A.click()}var l,n,d,k=document.createElement("table"),m=document.createElement("tbody");k.style.marginTop="8px";l=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace=
|
|
|
|
|
e=mxUtils.button(e,b);e.insertBefore(n,e.firstChild);e.style.marginTop="6px";e.className="geBigButton";e.style.fontSize="18px";e.style.padding="14px";g.appendChild(f);g.appendChild(a);g.appendChild(e);this.container=g},FontDialog=function(a,c,e,b,g){function f(a){this.style.border="";13==a.keyCode&&B.click()}var l,n,d,k=document.createElement("table"),m=document.createElement("tbody");k.style.marginTop="8px";l=document.createElement("tr");n=document.createElement("td");n.colSpan=2;n.style.whiteSpace=
|
|
|
|
|
"nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","sysfonts");p.setAttribute("type","radio");p.setAttribute("name","current-fontdialog");p.setAttribute("id","fontdialog-sysfonts");n.appendChild(p);d=document.createElement("label");d.setAttribute("for","fontdialog-sysfonts");mxUtils.write(d,mxResources.get("sysFonts",null,"System Fonts"));n.appendChild(d);l.appendChild(n);m.appendChild(l);
|
|
|
|
|
l=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");l.appendChild(n);var u=document.createElement("input");"s"==b&&u.setAttribute("value",c);u.style.marginLeft="4px";u.style.width="250px";u.className="dlg_fontName_s";n=document.createElement("td");n.appendChild(u);l.appendChild(n);m.appendChild(l);l=document.createElement("tr");
|
|
|
|
|
n=document.createElement("td");n.colSpan=2;n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.fontWeight="bold";var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;";q.setAttribute("value","googlefonts");q.setAttribute("type","radio");q.setAttribute("name","current-fontdialog");q.setAttribute("id","fontdialog-googlefonts");n.appendChild(q);d=document.createElement("label");d.setAttribute("for","fontdialog-googlefonts");mxUtils.write(d,mxResources.get("googleFonts",
|
|
|
|
@ -9835,9 +9835,9 @@ l.appendChild(n);var t=document.createElement("input");"g"==b&&t.setAttribute("v
|
|
|
|
|
"webfonts");v.setAttribute("type","radio");v.setAttribute("name","current-fontdialog");v.setAttribute("id","fontdialog-webfonts");n.appendChild(v);d=document.createElement("label");d.setAttribute("for","fontdialog-webfonts");mxUtils.write(d,mxResources.get("webfonts",null,"Web Fonts"));n.appendChild(d);l.appendChild(n);m.appendChild(l);l=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";
|
|
|
|
|
mxUtils.write(n,mxResources.get("fontname",null,"Font Name")+":");l.appendChild(n);var y=document.createElement("input");"w"==b&&y.setAttribute("value",c);y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontName_w";n=document.createElement("td");n.appendChild(y);l.appendChild(n);m.appendChild(l);l=document.createElement("tr");n=document.createElement("td");n.style.whiteSpace="nowrap";n.style.fontSize="10pt";n.style.width="120px";n.style.paddingLeft="15px";mxUtils.write(n,mxResources.get("fontUrl",
|
|
|
|
|
null,"Font URL")+":");l.appendChild(n);var x=document.createElement("input");x.setAttribute("value",e||"");x.style.marginLeft="4px";x.style.width="250px";x.className="dlg_fontUrl";n=document.createElement("td");n.appendChild(x);l.appendChild(n);m.appendChild(l);this.init=function(){var a=u;"g"==b?a=t:"w"==b&&(a=y);a.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?a.select():document.execCommand("selectAll",!1,null)};l=document.createElement("tr");n=document.createElement("td");
|
|
|
|
|
n.colSpan=2;n.style.paddingTop="20px";n.style.whiteSpace="nowrap";n.setAttribute("align","right");a.isOffline()||(c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}),c.className="geBtn",n.appendChild(c));c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();g()});c.className="geBtn";a.editor.cancelFirst&&n.appendChild(c);var A=mxUtils.button(mxResources.get("apply"),function(){var d,b,c;p.checked?(d=u.value,c="s"):q.checked?
|
|
|
|
|
(d=t.value,b=Editor.GOOGLE_FONTS+encodeURIComponent(d).replace(/%20/g,"+"),c="g"):v.checked&&(d=y.value,b=x.value,c="w");var e;e=b;var m=c,f=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null==d||0==d.length?(k.querySelector(".dlg_fontName_"+m).style.border="1px solid red",e=!1):"w"!=m||f.test(e)?e=!0:(k.querySelector(".dlg_fontUrl").style.border="1px solid red",e=!1);e&&(g(d,b,c),a.hideDialog())});A.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",
|
|
|
|
|
f);mxEvent.addListener(t,"keypress",f);mxEvent.addListener(y,"keypress",f);mxEvent.addListener(x,"keypress",f);mxEvent.addListener(u,"focus",function(){p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(t,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(y,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});mxEvent.addListener(x,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});n.appendChild(A);a.editor.cancelFirst||
|
|
|
|
|
n.colSpan=2;n.style.paddingTop="20px";n.style.whiteSpace="nowrap";n.setAttribute("align","right");a.isOffline()||(c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}),c.className="geBtn",n.appendChild(c));c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();g()});c.className="geBtn";a.editor.cancelFirst&&n.appendChild(c);var B=mxUtils.button(mxResources.get("apply"),function(){var d,b,c;p.checked?(d=u.value,c="s"):q.checked?
|
|
|
|
|
(d=t.value,b=Editor.GOOGLE_FONTS+encodeURIComponent(d).replace(/%20/g,"+"),c="g"):v.checked&&(d=y.value,b=x.value,c="w");var e;e=b;var m=c,f=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null==d||0==d.length?(k.querySelector(".dlg_fontName_"+m).style.border="1px solid red",e=!1):"w"!=m||f.test(e)?e=!0:(k.querySelector(".dlg_fontUrl").style.border="1px solid red",e=!1);e&&(g(d,b,c),a.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",
|
|
|
|
|
f);mxEvent.addListener(t,"keypress",f);mxEvent.addListener(y,"keypress",f);mxEvent.addListener(x,"keypress",f);mxEvent.addListener(u,"focus",function(){p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(t,"focus",function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(y,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});mxEvent.addListener(x,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});n.appendChild(B);a.editor.cancelFirst||
|
|
|
|
|
n.appendChild(c);l.appendChild(n);m.appendChild(l);k.appendChild(m);this.container=k};
|
|
|
|
|
function AspectDialog(a,c,e,b,g){this.aspect={pageId:c||a.pages[0].getId(),layerIds:e||[]};c=document.createElement("div");var f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("pages"));c.appendChild(f);e=document.createElement("div");e.className="geAspectDlgList";c.appendChild(e);f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("layers"));c.appendChild(f);f=document.createElement("div");f.className="geAspectDlgList";
|
|
|
|
|
c.appendChild(f);this.pagesContainer=e;this.layersContainer=f;this.ui=a;e=document.createElement("div");e.style.marginTop="16px";e.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});f.className="geBtn";a.editor.cancelFirst&&e.appendChild(f);var l=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();b({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));e.appendChild(l);l.className="geBtn gePrimaryBtn";
|
|
|
|
@ -9958,7 +9958,7 @@ function(a){c--;b+="@import url("+d+");";e()}))):b+=this.cachedGoogleFonts[d]:b+
|
|
|
|
|
if(null!=d){var b=a.getElementsByTagName("defs"),c=a.ownerDocument;0==b.length?(b=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"defs"):c.createElement("defs"),null!=a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)):b=b[0];c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,d);b.appendChild(c)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||
|
|
|
|
|
this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(a,d,b){var c=mxClient.IS_FF?8192:16384;return Math.min(b,Math.min(c/a,c/d))};Editor.prototype.exportToCanvas=function(a,d,b,c,e,k,m,f,p,g,l,u,q,n,t,z){try{k=null!=k?k:!0;m=null!=m?m:!0;u=null!=u?u:this.graph;q=null!=q?q:0;var v=p?null:u.background;v==mxConstants.NONE&&(v=null);null==v&&(v=c);null==v&&0==p&&(v=z?this.graph.defaultPageBackgroundColor:"#ffffff");this.convertImages(u.getSvg(null,null,q,n,null,m,null,null,null,g,null,
|
|
|
|
|
z),mxUtils.bind(this,function(b){try{var c=new Image;c.onload=mxUtils.bind(this,function(){try{var m=function(){mxClient.IS_SF?window.setTimeout(function(){n.drawImage(c,0,0);a(p)},0):(n.drawImage(c,0,0),a(p))},p=document.createElement("canvas"),g=parseInt(b.getAttribute("width")),l=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=d&&(f=k?Math.min(1,Math.min(3*d/(4*l),d/g)):d/g);f=this.getMaxCanvasScale(g,l,f);g=Math.ceil(f*g);l=Math.ceil(f*l);p.setAttribute("width",g);p.setAttribute("height",
|
|
|
|
|
l);var n=p.getContext("2d");null!=v&&(n.beginPath(),n.rect(0,0,g,l),n.fillStyle=v,n.fill());1!=f&&n.scale(f,f);if(t){var z=u.view,B=z.scale;z.scale=1;var x=btoa(unescape(encodeURIComponent(z.createSvgGrid(z.gridColor))));z.scale=B;var x="data:image/svg+xml;base64,"+x,C=u.gridSize*z.gridSteps*f,y=u.getGraphBounds(),D=z.translate.x*B,K=z.translate.y*B,M=D+(y.x-D)/B-q,A=K+(y.y-K)/B-q,I=new Image;I.onload=function(){try{for(var a=-Math.round(C-mxUtils.mod((D-M)*f,C)),d=-Math.round(C-mxUtils.mod((K-A)*
|
|
|
|
|
l);var n=p.getContext("2d");null!=v&&(n.beginPath(),n.rect(0,0,g,l),n.fillStyle=v,n.fill());1!=f&&n.scale(f,f);if(t){var z=u.view,A=z.scale;z.scale=1;var x=btoa(unescape(encodeURIComponent(z.createSvgGrid(z.gridColor))));z.scale=A;var x="data:image/svg+xml;base64,"+x,C=u.gridSize*z.gridSteps*f,y=u.getGraphBounds(),D=z.translate.x*A,K=z.translate.y*A,M=D+(y.x-D)/A-q,B=K+(y.y-K)/A-q,I=new Image;I.onload=function(){try{for(var a=-Math.round(C-mxUtils.mod((D-M)*f,C)),d=-Math.round(C-mxUtils.mod((K-B)*
|
|
|
|
|
f,C));a<g;a+=C)for(var b=d;b<l;b+=C)n.drawImage(I,a/f,b/f);m()}catch(ta){null!=e&&e(ta)}};I.onerror=function(a){null!=e&&e(a)};I.src=x}else m()}catch(oa){null!=e&&e(oa)}});c.onerror=function(a){null!=e&&e(a)};g&&this.graph.addSvgShadow(b);this.graph.mathEnabled&&this.addMathCss(b);var m=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(b,this.resolvedFontCss),c.src=Editor.createSvgDataUri(mxUtils.getXml(b))}catch(ba){null!=e&&e(ba)}});this.embedExtFonts(mxUtils.bind(this,
|
|
|
|
|
function(a){try{null!=a&&this.addFontCss(b,a),this.loadFonts(m)}catch(ha){null!=e&&e(ha)}}))}catch(ba){null!=e&&e(ba)}}),b,l)}catch(P){null!=e&&e(P)}};Editor.crcTable=[];for(var g=0;256>g;g++)for(var f=g,l=0;8>l;l++)f=1==(f&1)?3988292384^f>>>1:f>>>1,Editor.crcTable[g]=f;Editor.updateCRC=function(a,d,b,c){for(var e=0;e<c;e++)a=Editor.crcTable[(a^d.charCodeAt(b+e))&255]^a>>>8;return a};Editor.crc32=function(a){for(var d=-1,b=0;b<a.length;b++)d=d>>>8^Editor.crcTable[(d^a.charCodeAt(b))&255];return(d^
|
|
|
|
|
-1)>>>0};Editor.writeGraphModelToPng=function(a,d,b,c,e){function k(a,d){var b=p;p+=d;return a.substring(b,p)}function m(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(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 p=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(k(a,4),"IHDR"!=k(a,4))null!=
|
|
|
|
@ -10001,26 +10001,26 @@ function e(d,b,c){var e=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(d,!0);b.styl
|
|
|
|
|
function(k){this.editorUi.pickColor(d,function(d){e.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(e);return btn}function m(a,d,b,e,k,m,f){null!=d&&(d=d.split(","),q.push({name:a,values:d,type:b,defVal:e,countProperty:k,parentRow:m,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(l,function(d){for(var p=m,l=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==
|
|
|
|
|
a)p=p.nextSibling,l++;else break;var u={type:b,parentRow:m,index:l,isDeletable:!0,defVal:e,countProperty:k},l=g(a,"",u,0==l%2,f);c(a,e,u);p.parentNode.insertBefore(l,p.nextSibling);mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,d,b,c,e,k,m){if(0<e){var f=Array(e);d=null!=d?d.split(","):[];for(var p=0;p<e;p++)f[p]=null!=d[p]?d[p]:null!=c?c:"";q.push({name:a,values:f,type:b,defVal:c,parentRow:k,flipBkg:m,size:e})}return document.createElement("div")}
|
|
|
|
|
function p(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function g(d,b,g,u,q){var z=g.dispName,n=g.type,t=document.createElement("tr");t.className="gePropRow"+(q?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";t.setAttribute("data-pName",d);t.setAttribute("data-pValue",b);u=!1;null!=g.index&&(t.setAttribute("data-index",g.index),z=(null!=z?z:"")+"["+g.index+"]",u=!0);var v=document.createElement("td");
|
|
|
|
|
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(z,null,z));u&&(v.style.textAlign="right");t.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==n)v.appendChild(k(d,b,g));else if("bool"==n||"boolean"==n)v.appendChild(p(d,b,g));else if("enum"==n){var B=g.enumList;for(q=0;q<B.length;q++)if(z=B[q],z.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(z.dispName,null,z.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(l,function(){var k=
|
|
|
|
|
document.createElement("select");e(v,k);for(var m=0;m<B.length;m++){var f=B[m],p=document.createElement("option");p.value=mxUtils.htmlEntities(f.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(p)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);c(d,a,g)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==n?v.appendChild(m(d,b,g.subType,g.subDefVal,g.countProperty,
|
|
|
|
|
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(z,null,z));u&&(v.style.textAlign="right");t.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==n)v.appendChild(k(d,b,g));else if("bool"==n||"boolean"==n)v.appendChild(p(d,b,g));else if("enum"==n){var A=g.enumList;for(q=0;q<A.length;q++)if(z=A[q],z.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(z.dispName,null,z.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(l,function(){var k=
|
|
|
|
|
document.createElement("select");e(v,k);for(var m=0;m<A.length;m++){var f=A[m],p=document.createElement("option");p.value=mxUtils.htmlEntities(f.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(p)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);c(d,a,g)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==n?v.appendChild(m(d,b,g.subType,g.subDefVal,g.countProperty,
|
|
|
|
|
t,q)):"staticArr"==n?v.appendChild(f(d,b,g.subType,g.subDefVal,g.size,t,q)):(v.innerHTML=b,mxEvent.addListener(v,"click",mxUtils.bind(l,function(){function k(){var a=m.value,a=0==a.length&&"string"!=n?0:a;g.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",n="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=g.min&&a<g.min?a=g.min:null!=g.max&&a>g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==n?parseInt(a):a)+"");c(d,a,g)}var m=document.createElement("input");e(v,m,!0);m.value=b;m.className=
|
|
|
|
|
"gePropEditor";"int"!=n&&"float"!=n||g.allowAuto||(m.type="number",m.step="int"==n?"1":"any",null!=g.min&&(m.min=parseFloat(g.min)),null!=g.max&&(m.max=parseFloat(g.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&k()});m.focus();mxEvent.addListener(m,"blur",function(){k()})})));g.isDeletable&&(q=mxUtils.button("-",mxUtils.bind(l,function(a){c(d,"",g,g.index);mxEvent.consume(a)})),q.style.height="16px",q.style.width="25px",q.style["float"]="right",q.className="geColorBtn",
|
|
|
|
|
v.appendChild(q));t.appendChild(v);return t}var l=this,u=this.editorUi.editor.graph,q=[];a.style.position="relative";a.style.padding="0";var n=document.createElement("table");n.className="geProperties";n.style.whiteSpace="nowrap";n.style.width="100%";var z=document.createElement("tr");z.className="gePropHeader";var t=document.createElement("th");t.className="gePropHeaderCell";var v=document.createElement("img");v.src=Sidebar.prototype.expandedImage;t.appendChild(v);mxUtils.write(t,mxResources.get("property"));
|
|
|
|
|
z.style.cursor="pointer";var B=function(){var d=n.querySelectorAll(".gePropNonHeaderRow"),b;if(l.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(la){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(z,"click",function(){l.editorUi.propertiesCollapsed=!l.editorUi.propertiesCollapsed;
|
|
|
|
|
B()});z.appendChild(t);t=document.createElement("th");t.className="gePropHeaderCell";t.innerHTML=mxResources.get("value");z.appendChild(t);n.appendChild(z);var x=!1,C=!1,y;for(y in d)if(z=d[y],"function"!=typeof z.isVisible||z.isVisible(b,this)){var D=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=z.getDefaultValue?z.getDefaultValue(b,this):z.defVal;if("separator"==z.type)C=!C;else{if("staticArr"==z.type)z.size=parseInt(b.style[z.sizeProperty]||d[z.sizeProperty].defVal)||0;else if(null!=
|
|
|
|
|
z.dependentProps){for(var K=z.dependentProps,A=[],I=[],t=0;t<K.length;t++){var F=b.style[K[t]];I.push(d[K[t]].subDefVal);A.push(null!=F?F.split(","):[])}z.dependentPropsDefVal=I;z.dependentPropsVals=A}n.appendChild(g(y,D,z,x,C));x=!x}}for(t=0;t<q.length;t++)for(z=q[t],d=z.parentRow,b=0;b<z.values.length;b++)y=g(z.name,z.values[b],{type:z.type,parentRow:z.parentRow,isDeletable:z.isDeletable,index:b,defVal:z.defVal,countProperty:z.countProperty,size:z.size},0==b%2,z.flipBkg),d.parentNode.insertBefore(y,
|
|
|
|
|
d.nextSibling),d=y;a.appendChild(n);B();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var b=this.editorUi,c=b.editor.graph,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.paddingLeft="24px";e.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(e);
|
|
|
|
|
z.style.cursor="pointer";var A=function(){var d=n.querySelectorAll(".gePropNonHeaderRow"),b;if(l.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(la){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(z,"click",function(){l.editorUi.propertiesCollapsed=!l.editorUi.propertiesCollapsed;
|
|
|
|
|
A()});z.appendChild(t);t=document.createElement("th");t.className="gePropHeaderCell";t.innerHTML=mxResources.get("value");z.appendChild(t);n.appendChild(z);var x=!1,C=!1,y;for(y in d)if(z=d[y],"function"!=typeof z.isVisible||z.isVisible(b,this)){var D=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=z.getDefaultValue?z.getDefaultValue(b,this):z.defVal;if("separator"==z.type)C=!C;else{if("staticArr"==z.type)z.size=parseInt(b.style[z.sizeProperty]||d[z.sizeProperty].defVal)||0;else if(null!=
|
|
|
|
|
z.dependentProps){for(var K=z.dependentProps,B=[],I=[],t=0;t<K.length;t++){var F=b.style[K[t]];I.push(d[K[t]].subDefVal);B.push(null!=F?F.split(","):[])}z.dependentPropsDefVal=I;z.dependentPropsVals=B}n.appendChild(g(y,D,z,x,C));x=!x}}for(t=0;t<q.length;t++)for(z=q[t],d=z.parentRow,b=0;b<z.values.length;b++)y=g(z.name,z.values[b],{type:z.type,parentRow:z.parentRow,isDeletable:z.isDeletable,index:b,defVal:z.defVal,countProperty:z.countProperty,size:z.size},0==b%2,z.flipBkg),d.parentNode.insertBefore(y,
|
|
|
|
|
d.nextSibling),d=y;a.appendChild(n);A();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var b=this.editorUi,c=b.editor.graph,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.paddingLeft="24px";e.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(e);
|
|
|
|
|
var k="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" "),m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.position="relative";m.style.textAlign="center";for(var f=[],p=0;p<this.defaultColorSchemes.length;p++){var g=document.createElement("div");g.style.display="inline-block";g.style.width="6px";g.style.height="6px";g.style.marginLeft="4px";g.style.marginRight=
|
|
|
|
|
"3px";g.style.borderRadius="3px";g.style.cursor="pointer";g.style.background="transparent";g.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(a){mxEvent.addListener(g,"click",mxUtils.bind(this,function(){l(a)}))})(p);f.push(g);m.appendChild(g)}var l=mxUtils.bind(this,function(a){null!=this.format.currentScheme&&(f[this.format.currentScheme].style.background="transparent");this.format.currentScheme=a;q(this.defaultColorSchemes[this.format.currentScheme]);f[this.format.currentScheme].style.background=
|
|
|
|
|
"#84d7ff"}),q=mxUtils.bind(this,function(a){var d=mxUtils.bind(this,function(a){var d=mxUtils.button("",function(d){c.getModel().beginUpdate();try{for(var e=c.getSelectionCells(),m=0;m<e.length;m++){for(var f=c.getModel().getStyle(e[m]),p=0;p<k.length;p++)f=mxUtils.removeStylename(f,k[p]);var g=c.getModel().isVertex(e[m])?b.initialDefaultVertexStyle:b.initialdefaultEdgeStyle;null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(g,mxConstants.STYLE_GRADIENTCOLOR,
|
|
|
|
|
"3px";g.style.borderRadius="3px";g.style.cursor="pointer";g.style.background="transparent";g.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(a){mxEvent.addListener(g,"click",mxUtils.bind(this,function(){l(a)}))})(p);f.push(g);m.appendChild(g)}var l=mxUtils.bind(this,function(a){null!=this.format.currentScheme&&(f[this.format.currentScheme].style.background="transparent");this.format.currentScheme=a;u(this.defaultColorSchemes[this.format.currentScheme]);f[this.format.currentScheme].style.background=
|
|
|
|
|
"#84d7ff"}),u=mxUtils.bind(this,function(a){var d=mxUtils.bind(this,function(a){var d=mxUtils.button("",function(d){c.getModel().beginUpdate();try{for(var e=c.getSelectionCells(),m=0;m<e.length;m++){for(var f=c.getModel().getStyle(e[m]),p=0;p<k.length;p++)f=mxUtils.removeStylename(f,k[p]);var g=c.getModel().isVertex(e[m])?b.initialDefaultVertexStyle:b.initialdefaultEdgeStyle;null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(g,mxConstants.STYLE_GRADIENTCOLOR,
|
|
|
|
|
null)),mxEvent.isAltDown(d)||(f=""==a.fill?mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(g,mxConstants.STYLE_FILLCOLOR,null))),mxEvent.isShiftDown(d)||(f=""==a.stroke?mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(g,mxConstants.STYLE_STROKECOLOR,null))),mxEvent.isControlDown(d)||mxClient.IS_MAC&&mxEvent.isMetaDown(d)||!c.getModel().isVertex(e[m])||
|
|
|
|
|
(f=mxUtils.setStyle(f,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(g,mxConstants.STYLE_FONTCOLOR,null)))):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(g,mxConstants.STYLE_FILLCOLOR,"#ffffff")),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(g,mxConstants.STYLE_STROKECOLOR,"#000000")),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(g,mxConstants.STYLE_GRADIENTCOLOR,null)),c.getModel().isVertex(e[m])&&(f=mxUtils.setStyle(f,mxConstants.STYLE_FONTCOLOR,
|
|
|
|
|
mxUtils.getValue(g,mxConstants.STYLE_FONTCOLOR,null))));c.getModel().setStyle(e[m],f)}}finally{c.getModel().endUpdate()}});d.className="geStyleButton";d.style.width="36px";d.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";d.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?d.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":d.style.backgroundImage=
|
|
|
|
|
"linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":a.fill==mxConstants.NONE?d.style.background="url('"+Dialog.prototype.noColorImage+"')":d.style.backgroundColor=""==a.fill?mxUtils.getValue(b.initialDefaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"):a.fill||mxUtils.getValue(b.initialDefaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"),d.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(b.initialDefaultVertexStyle,
|
|
|
|
|
mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(b.initialDefaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#2a2a2a":"#ffffff"));else{var m=mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),f=mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"#000000");d.style.backgroundColor=m;d.style.border="1px solid "+f}e.appendChild(d)});e.innerHTML="";for(var m=0;m<a.length;m++)0<m&&0==mxUtils.mod(m,
|
|
|
|
|
4)&&mxUtils.br(e),d(a[m])});null==this.format.currentScheme?l("dark"==uiTheme?1:0):l(this.format.currentScheme);var p=10>=this.defaultColorSchemes.length?28:8,u=document.createElement("div");u.style.cssText="position:absolute;left:10px;top:8px;bottom:"+p+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
|
|
|
|
|
mxEvent.addListener(u,"click",mxUtils.bind(this,function(){l(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var z=document.createElement("div");z.style.cssText="position:absolute;left:202px;top:8px;bottom:"+p+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
|
|
|
|
|
1<this.defaultColorSchemes.length&&(a.appendChild(u),a.appendChild(z));mxEvent.addListener(z,"click",mxUtils.bind(this,function(){l(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));d(u);d(z);q(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&a.appendChild(m);return a};StyleFormatPanel.prototype.addEditOps=function(a){var d=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&(b=mxUtils.button(mxResources.get("editStyle"),
|
|
|
|
|
4)&&mxUtils.br(e),d(a[m])});null==this.format.currentScheme?l("dark"==uiTheme?1:0):l(this.format.currentScheme);var p=10>=this.defaultColorSchemes.length?28:8,q=document.createElement("div");q.style.cssText="position:absolute;left:10px;top:8px;bottom:"+p+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
|
|
|
|
|
mxEvent.addListener(q,"click",mxUtils.bind(this,function(){l(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var z=document.createElement("div");z.style.cssText="position:absolute;left:202px;top:8px;bottom:"+p+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
|
|
|
|
|
1<this.defaultColorSchemes.length&&(a.appendChild(q),a.appendChild(z));mxEvent.addListener(z,"click",mxUtils.bind(this,function(){l(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));d(q);d(z);u(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&a.appendChild(m);return a};StyleFormatPanel.prototype.addEditOps=function(a){var d=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&(b=mxUtils.button(mxResources.get("editStyle"),
|
|
|
|
|
mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var c=this.editorUi.editor.graph,e=c.view.getState(c.getSelectionCell());1==c.getSelectionCount()&&null!=e&&null!=e.shape&&null!=e.shape.stencil?(d=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editShape").funct()})),
|
|
|
|
|
d.setAttribute("title",mxResources.get("editShape")),d.style.marginBottom="2px",null==b?d.style.width="202px":(b.style.width="100px",d.style.width="100px",d.style.marginLeft="2px"),a.appendChild(d)):d.image&&(d=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),d.setAttribute("title",mxResources.get("editImage")),d.style.marginBottom="2px",null==b?d.style.width="202px":(b.style.width="100px",d.style.width="100px",d.style.marginLeft=
|
|
|
|
|
"2px"),a.appendChild(d));return a}}Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUrl=function(a){return a.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS};Graph.isCssFontUrl=function(a){return Graph.isGoogleFontUrl(a)};Graph.createFontElement=function(a,d){var b;Graph.isCssFontUrl(d)?(b=document.createElement("link"),b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.setAttribute("charset","UTF-8"),b.setAttribute("href",d)):(b=document.createElement("style"),
|
|
|
|
@ -10032,12 +10032,12 @@ d.altKey=a.altKey,d.shiftKey=a.shiftKey,d.metaKey=a.metaKey,d.button=a.button,d.
|
|
|
|
|
d?this.getPointForEvent(d):b.apply(this,arguments)};var c=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var d=this.graph.getCellStyle(a);if(null!=d){if("rack"==d.childLayout){var b=new mxStackLayout(this.graph,!1);b.gridSize=null!=d.rackUnitSize?parseFloat(d.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;b.marginLeft=d.marginLeft||0;b.marginRight=d.marginRight||0;b.marginTop=d.marginTop||0;b.marginBottom=d.marginBottom||0;b.allowGaps=d.allowGaps||
|
|
|
|
|
0;b.horizontal="1"==mxUtils.getValue(d,"horizontalRack","0");b.resizeParent=!1;b.fill=!0;return b}if("undefined"!==typeof mxTableLayout&&"tableLayout"==d.childLayout)return b=new mxTableLayout(this.graph),b.rows=d.tableRows||2,b.columns=d.tableColumns||2,b.colPercentages=d.colPercentages,b.rowPercentages=d.rowPercentages,b.equalColumns="1"==mxUtils.getValue(d,"equalColumns",b.colPercentages?"0":"1"),b.equalRows="1"==mxUtils.getValue(d,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(d,
|
|
|
|
|
"resizeParent","1"),b.border=d.tableBorder||b.border,b.marginLeft=d.marginLeft||0,b.marginRight=d.marginRight||0,b.marginTop=d.marginTop||0,b.marginBottom=d.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(d,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(d,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=d.colWidths||"100",b.rowHeights=d.rowHeights||"50",b}return c.apply(this,arguments)};this.updateGlobalUrlVariables()};var y=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=
|
|
|
|
|
function(a){return Graph.processFontStyle(y.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(a,d,b,c,e,k,m,f,p,g,l){x.apply(this,arguments);Graph.processFontAttributes(l)};var A=mxText.prototype.redraw;mxText.prototype.redraw=function(){A.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.getCustomFonts=function(){var a=this.extFonts,a=null!=a?a.slice():[],d;
|
|
|
|
|
function(a){return Graph.processFontStyle(y.apply(this,arguments))};var x=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(a,d,b,c,e,k,m,f,p,g,l){x.apply(this,arguments);Graph.processFontAttributes(l)};var B=mxText.prototype.redraw;mxText.prototype.redraw=function(){B.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.getCustomFonts=function(){var a=this.extFonts,a=null!=a?a.slice():[],d;
|
|
|
|
|
for(d in Graph.customFontElements){var b=Graph.customFontElements[d];a.push({name:b.name,url:b.url})}return a};Graph.prototype.setFont=function(a,d){Graph.addFont(a,d);document.execCommand("fontname",!1,a);if(null!=d){var b=this.cellEditor.textarea.getElementsByTagName("font");d=Graph.getFontUrl(a,d);for(var c=0;c<b.length;c++)b[c].getAttribute("face")==a&&b[c].getAttribute("data-font-src")!=d&&b[c].setAttribute("data-font-src",d)}};var z=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=
|
|
|
|
|
function(){return z.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=a)for(var d in a)this.globalVars[d]=a[d]}catch(N){null!=window.console&&console.log("Error in vars URL parameter: "+N)}};Graph.prototype.getExportVariables=function(){return null!=
|
|
|
|
|
this.globalVars?mxUtils.clone(this.globalVars):{}};var B=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=B.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
|
|
|
|
|
var C=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,k,m,f,p,g,l,u){var q=null;u||null==this.themes||"darkTheme"!=this.defaultThemeName||(q=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var z=C.apply(this,arguments),n=this.getCustomFonts();if(l&&0<n.length){var t=z.ownerDocument,v=null!=t.createElementNS?t.createElementNS(mxConstants.NS_SVG,"style"):t.createElement("style");null!=t.setAttributeNS?v.setAttributeNS("type","text/css"):v.setAttribute("type",
|
|
|
|
|
"text/css");for(var B="",x="",y=0;y<n.length;y++){var D=n[y].name,A=n[y].url;Graph.isCssFontUrl(A)?B+="@import url("+A+");\n":x+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+A+'");\n}\n'}v.appendChild(t.createTextNode(B+x));z.getElementsByTagName("defs")[0].appendChild(v)}null!=q&&(this.stylesheet=q,this.refresh());return z};var D=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=D.apply(this,arguments);if(this.mathEnabled){var d=a.drawText;a.drawText=
|
|
|
|
|
this.globalVars?mxUtils.clone(this.globalVars):{}};var A=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=A.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
|
|
|
|
|
var C=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,k,m,f,p,g,l,q){var u=null;q||null==this.themes||"darkTheme"!=this.defaultThemeName||(u=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var z=C.apply(this,arguments),n=this.getCustomFonts();if(l&&0<n.length){var t=z.ownerDocument,v=null!=t.createElementNS?t.createElementNS(mxConstants.NS_SVG,"style"):t.createElement("style");null!=t.setAttributeNS?v.setAttributeNS("type","text/css"):v.setAttribute("type",
|
|
|
|
|
"text/css");for(var A="",x="",y=0;y<n.length;y++){var D=n[y].name,B=n[y].url;Graph.isCssFontUrl(B)?A+="@import url("+B+");\n":x+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+B+'");\n}\n'}v.appendChild(t.createTextNode(A+x));z.getElementsByTagName("defs")[0].appendChild(v)}null!=u&&(this.stylesheet=u,this.refresh());return z};var D=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=D.apply(this,arguments);if(this.mathEnabled){var d=a.drawText;a.drawText=
|
|
|
|
|
function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&(mxUtils.isNode(a.text.value)||a.text.dialect==mxConstants.DIALECT_STRICTHTML)){var c=a.text.getContentNode();if(null!=c){c=c.cloneNode(!0);if(c.getElementsByTagNameNS)for(var e=c.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<e.length;)e[0].parentNode.removeChild(e[0]);null!=c.innerHTML&&(e=a.text.value,a.text.value=c.innerHTML,d.apply(this,arguments),a.text.value=e)}}else d.apply(this,arguments)}}return a};
|
|
|
|
|
var F=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){F.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==
|
|
|
|
|
this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};var G=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){G.apply(this,arguments);
|
|
|
|
@ -10066,30 +10066,30 @@ mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.x
|
|
|
|
|
[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
|
|
|
|
|
"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
|
|
|
|
|
[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var d=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?d="mxgraph.er":"sysML"==a.substring(0,5)&&(d="mxgraph.sysml"));return d};var E=mxMarker.createMarker;mxMarker.createMarker=function(a,d,b,c,e,k,m,f,p,g){if(null!=b&&null==mxMarker.markers[b]){var l=this.getPackageForType(b);null!=l&&mxStencilRegistry.getStencil(l)}return E.apply(this,arguments)};PrintDialog.prototype.create=function(a,d){function b(){z.value=Math.max(1,
|
|
|
|
|
Math.min(f,Math.max(parseInt(z.value),parseInt(u.value))));u.value=Math.max(1,Math.min(f,Math.min(parseInt(z.value),parseInt(u.value))))}function c(d){function b(d,b,k){var m=d.useCssTransforms,f=d.currentTranslate,g=d.currentScale,p=d.view.translate,l=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var q=d.getGraphBounds(),u=0,n=0,z=K.get(),t=1/d.pageScale,x=B.checked;if(x)var t=parseInt(E.value),
|
|
|
|
|
C=parseInt(J.value),t=Math.min(z.height*C/(q.height/d.view.scale),z.width*t/(q.width/d.view.scale));else t=parseInt(v.value)/(100*d.pageScale),isNaN(t)&&(c=1/d.pageScale,v.value="100 %");z=mxRectangle.fromRectangle(z);z.width=Math.ceil(z.width*c);z.height=Math.ceil(z.height*c);t*=c;!x&&d.pageVisible?(q=d.getPageLayout(),u-=q.x*z.width,n-=q.y*z.height):x=!0;if(null==b){b=PrintDialog.createPrintPreview(d,t,z,0,u,n,x);b.pageSelector=!1;b.mathEnabled=!1;u=a.getCurrentFile();null!=u&&(b.title=u.getTitle());
|
|
|
|
|
Math.min(f,Math.max(parseInt(z.value),parseInt(q.value))));q.value=Math.max(1,Math.min(f,Math.min(parseInt(z.value),parseInt(q.value))))}function c(d){function b(d,b,k){var m=d.useCssTransforms,f=d.currentTranslate,g=d.currentScale,p=d.view.translate,l=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var u=d.getGraphBounds(),q=0,n=0,z=K.get(),t=1/d.pageScale,x=A.checked;if(x)var t=parseInt(E.value),
|
|
|
|
|
C=parseInt(J.value),t=Math.min(z.height*C/(u.height/d.view.scale),z.width*t/(u.width/d.view.scale));else t=parseInt(v.value)/(100*d.pageScale),isNaN(t)&&(c=1/d.pageScale,v.value="100 %");z=mxRectangle.fromRectangle(z);z.width=Math.ceil(z.width*c);z.height=Math.ceil(z.height*c);t*=c;!x&&d.pageVisible?(u=d.getPageLayout(),q-=u.x*z.width,n-=u.y*z.height):x=!0;if(null==b){b=PrintDialog.createPrintPreview(d,t,z,0,q,n,x);b.pageSelector=!1;b.mathEnabled=!1;q=a.getCurrentFile();null!=q&&(b.title=q.getTitle());
|
|
|
|
|
var y=b.writeHead;b.writeHead=function(b){y.apply(this,arguments);if(mxClient.IS_GC||mxClient.IS_SF)b.writeln('<style type="text/css">'),b.writeln("div.MathJax_SVG_Display { position: static; }"),b.writeln("</style>");mxClient.IS_GC&&(b.writeln('<style type="text/css">'),b.writeln("@media print {"),b.writeln("span.MathJax_SVG svg { shape-rendering: crispEdges; }"),b.writeln("}"),b.writeln("</style>"));null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"));
|
|
|
|
|
for(var c=d.getCustomFonts(),e=0;e<c.length;e++){var k=c[e].name,m=c[e].url;Graph.isCssFontUrl(m)?b.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(m)+'" charset="UTF-8" type="text/css">'):(b.writeln('<style type="text/css">'),b.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(k)+'";\nsrc: url("'+mxUtils.htmlEntities(m)+'");\n}'),b.writeln("</style>"))}};if("undefined"!==typeof MathJax){var D=b.renderPage;b.renderPage=function(d,b,c,e,k,m){var f=mxClient.NO_FO;mxClient.NO_FO=
|
|
|
|
|
this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var g=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:g.className="geDisableMathJax";return g}}u=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(u=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=u&&(e.stylesheet=u,e.refresh())}else{z=d.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";b.backgroundColor=
|
|
|
|
|
z;b.autoOrigin=x;b.appendGraph(d,t,u,n,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(u=0;u<k.length;u++)n=k[u].name,x=k[u].url,Graph.isCssFontUrl(x)?b.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(x)+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(n)+'";\nsrc: url("'+mxUtils.htmlEntities(x)+'");\n}'),b.wnd.document.writeln("</style>"))}m&&(d.useCssTransforms=
|
|
|
|
|
m,d.currentTranslate=f,d.currentScale=g,d.view.translate=p,d.view.scale=l);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var m=u.value,f=z.value,g=!l.checked,q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,l.checked,m,f,B.checked,E.value,J.value,parseInt(v.value)/100,parseInt(M.value)/100,K.get());else{g&&(g=m==p&&f==p);if(!g&&null!=
|
|
|
|
|
this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var g=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:g.className="geDisableMathJax";return g}}q=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(q=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=q&&(e.stylesheet=q,e.refresh())}else{z=d.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";b.backgroundColor=
|
|
|
|
|
z;b.autoOrigin=x;b.appendGraph(d,t,q,n,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q<k.length;q++)n=k[q].name,x=k[q].url,Graph.isCssFontUrl(x)?b.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(x)+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(n)+'";\nsrc: url("'+mxUtils.htmlEntities(x)+'");\n}'),b.wnd.document.writeln("</style>"))}m&&(d.useCssTransforms=
|
|
|
|
|
m,d.currentTranslate=f,d.currentScale=g,d.view.translate=p,d.view.scale=l);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var m=q.value,f=z.value,g=!l.checked,u=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,l.checked,m,f,A.checked,E.value,J.value,parseInt(v.value)/100,parseInt(M.value)/100,K.get());else{g&&(g=m==p&&f==p);if(!g&&null!=
|
|
|
|
|
a.pages&&a.pages.length){var n=0,g=a.pages.length-1;l.checked||(n=parseInt(m)-1,g=parseInt(f)-1);for(var t=n;t<=g;t++){var x=a.pages[t],m=x==a.currentPage?e:null;if(null==m){var m=a.createTemporaryGraph(e.stylesheet),f=!0,n=!1,C=null,y=null;null==x.viewState&&null==x.root&&a.updatePageRoot(x);null!=x.viewState&&(f=x.viewState.pageVisible,n=x.viewState.mathEnabled,C=x.viewState.background,y=x.viewState.backgroundImage,m.extFonts=x.viewState.extFonts);m.background=C;m.backgroundImage=null!=y?new mxImage(y.src,
|
|
|
|
|
y.width,y.height):null;m.pageVisible=f;m.mathEnabled=n;var D=m.getGlobalVariable;m.getGlobalVariable=function(d){return"page"==d?x.getName():"pagenumber"==d?t+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(m.container);a.updatePageRoot(x);m.model.setRoot(x.root)}q=b(m,q,t!=g);m!=e&&m.container.parentNode.removeChild(m.container)}}else q=b(e);null==q?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(g=q.wnd.document,
|
|
|
|
|
d&&(q.wnd.IMMEDIATE_PRINT=!0),g.writeln('<script type="text/javascript" src="'+DRAWIO_BASE_URL+'/js/math-print.js">\x3c/script>')),q.closeDocument(),!q.mathEnabled&&d&&PrintDialog.printPreview(q));null!=k&&(e.stylesheet=k,e.refresh())}}var e=a.editor.graph,k=document.createElement("div"),m=document.createElement("h3");m.style.width="100%";m.style.textAlign="center";m.style.marginTop="0px";mxUtils.write(m,d||mxResources.get("print"));k.appendChild(m);var f=1,p=1,g=document.createElement("div");g.style.cssText=
|
|
|
|
|
"border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;";l.setAttribute("value","all");l.setAttribute("type","radio");l.setAttribute("name","pages-printdialog");g.appendChild(l);m=document.createElement("span");mxUtils.write(m,mxResources.get("printAllPages"));g.appendChild(m);mxUtils.br(g);var q=l.cloneNode(!0);l.setAttribute("checked","checked");q.setAttribute("value","range");g.appendChild(q);
|
|
|
|
|
m=document.createElement("span");mxUtils.write(m,mxResources.get("pages")+":");g.appendChild(m);var u=document.createElement("input");u.style.cssText="margin:0 8px 0 8px;";u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.style.width="50px";g.appendChild(u);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));g.appendChild(m);var z=u.cloneNode(!0);g.appendChild(z);mxEvent.addListener(u,"focus",function(){q.checked=!0});mxEvent.addListener(z,
|
|
|
|
|
"focus",function(){q.checked=!0});mxEvent.addListener(u,"change",b);mxEvent.addListener(z,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){p=m+1;u.value=p;z.value=p;break}u.setAttribute("max",f);z.setAttribute("max",f);a.isPagesEnabled()?1<f&&(k.appendChild(g),q.checked=!0):q.checked=!0;var n=document.createElement("div");n.style.marginBottom="10px";var t=document.createElement("input");t.style.marginRight="8px";t.setAttribute("value",
|
|
|
|
|
"adjust");t.setAttribute("type","radio");t.setAttribute("name","printZoom");n.appendChild(t);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));n.appendChild(m);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";n.appendChild(v);mxEvent.addListener(v,"focus",function(){t.checked=!0});k.appendChild(n);var g=g.cloneNode(!1),B=t.cloneNode(!0);B.setAttribute("value","fit");t.setAttribute("checked",
|
|
|
|
|
"checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(B);g.appendChild(m);n=document.createElement("table");n.style.display="inline-block";var x=document.createElement("tbody"),C=document.createElement("tr"),y=C.cloneNode(!0),D=document.createElement("td"),A=D.cloneNode(!0),I=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";F.style.textAlign="right";mxUtils.write(D,
|
|
|
|
|
mxResources.get("fitTo"));var E=document.createElement("input");E.style.cssText="margin:0 8px 0 8px;";E.setAttribute("value","1");E.setAttribute("min","1");E.setAttribute("type","number");E.style.width="40px";A.appendChild(E);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));I.appendChild(m);mxUtils.write(F,mxResources.get("fitToBy"));var J=E.cloneNode(!0);H.appendChild(J);mxEvent.addListener(E,"focus",function(){B.checked=!0});mxEvent.addListener(J,"focus",function(){B.checked=
|
|
|
|
|
!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));G.appendChild(m);C.appendChild(D);C.appendChild(A);C.appendChild(I);y.appendChild(F);y.appendChild(H);y.appendChild(G);x.appendChild(C);x.appendChild(y);n.appendChild(x);g.appendChild(n);k.appendChild(g);g=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));g.appendChild(m);m=document.createElement("div");
|
|
|
|
|
y.width,y.height):null;m.pageVisible=f;m.mathEnabled=n;var D=m.getGlobalVariable;m.getGlobalVariable=function(d){return"page"==d?x.getName():"pagenumber"==d?t+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(m.container);a.updatePageRoot(x);m.model.setRoot(x.root)}u=b(m,u,t!=g);m!=e&&m.container.parentNode.removeChild(m.container)}}else u=b(e);null==u?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(u.mathEnabled&&(g=u.wnd.document,
|
|
|
|
|
d&&(u.wnd.IMMEDIATE_PRINT=!0),g.writeln('<script type="text/javascript" src="'+DRAWIO_BASE_URL+'/js/math-print.js">\x3c/script>')),u.closeDocument(),!u.mathEnabled&&d&&PrintDialog.printPreview(u));null!=k&&(e.stylesheet=k,e.refresh())}}var e=a.editor.graph,k=document.createElement("div"),m=document.createElement("h3");m.style.width="100%";m.style.textAlign="center";m.style.marginTop="0px";mxUtils.write(m,d||mxResources.get("print"));k.appendChild(m);var f=1,p=1,g=document.createElement("div");g.style.cssText=
|
|
|
|
|
"border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;";l.setAttribute("value","all");l.setAttribute("type","radio");l.setAttribute("name","pages-printdialog");g.appendChild(l);m=document.createElement("span");mxUtils.write(m,mxResources.get("printAllPages"));g.appendChild(m);mxUtils.br(g);var u=l.cloneNode(!0);l.setAttribute("checked","checked");u.setAttribute("value","range");g.appendChild(u);
|
|
|
|
|
m=document.createElement("span");mxUtils.write(m,mxResources.get("pages")+":");g.appendChild(m);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","1");q.setAttribute("type","number");q.setAttribute("min","1");q.style.width="50px";g.appendChild(q);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));g.appendChild(m);var z=q.cloneNode(!0);g.appendChild(z);mxEvent.addListener(q,"focus",function(){u.checked=!0});mxEvent.addListener(z,
|
|
|
|
|
"focus",function(){u.checked=!0});mxEvent.addListener(q,"change",b);mxEvent.addListener(z,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){p=m+1;q.value=p;z.value=p;break}q.setAttribute("max",f);z.setAttribute("max",f);a.isPagesEnabled()?1<f&&(k.appendChild(g),u.checked=!0):u.checked=!0;var n=document.createElement("div");n.style.marginBottom="10px";var t=document.createElement("input");t.style.marginRight="8px";t.setAttribute("value",
|
|
|
|
|
"adjust");t.setAttribute("type","radio");t.setAttribute("name","printZoom");n.appendChild(t);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));n.appendChild(m);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";n.appendChild(v);mxEvent.addListener(v,"focus",function(){t.checked=!0});k.appendChild(n);var g=g.cloneNode(!1),A=t.cloneNode(!0);A.setAttribute("value","fit");t.setAttribute("checked",
|
|
|
|
|
"checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(A);g.appendChild(m);n=document.createElement("table");n.style.display="inline-block";var x=document.createElement("tbody"),C=document.createElement("tr"),y=C.cloneNode(!0),D=document.createElement("td"),B=D.cloneNode(!0),I=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";F.style.textAlign="right";mxUtils.write(D,
|
|
|
|
|
mxResources.get("fitTo"));var E=document.createElement("input");E.style.cssText="margin:0 8px 0 8px;";E.setAttribute("value","1");E.setAttribute("min","1");E.setAttribute("type","number");E.style.width="40px";B.appendChild(E);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));I.appendChild(m);mxUtils.write(F,mxResources.get("fitToBy"));var J=E.cloneNode(!0);H.appendChild(J);mxEvent.addListener(E,"focus",function(){A.checked=!0});mxEvent.addListener(J,"focus",function(){A.checked=
|
|
|
|
|
!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));G.appendChild(m);C.appendChild(D);C.appendChild(B);C.appendChild(I);y.appendChild(F);y.appendChild(H);y.appendChild(G);x.appendChild(C);x.appendChild(y);n.appendChild(x);g.appendChild(n);k.appendChild(g);g=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));g.appendChild(m);m=document.createElement("div");
|
|
|
|
|
m.style.marginBottom="12px";var K=PageSetupDialog.addPageFormatPanel(m,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(m);m=document.createElement("span");mxUtils.write(m,mxResources.get("pageScale"));g.appendChild(m);var M=document.createElement("input");M.style.cssText="margin:0 8px 0 8px;";M.setAttribute("value","100 %");M.style.width="60px";g.appendChild(M);k.appendChild(g);m=document.createElement("div");m.style.cssText="text-align:right;margin:48px 0 0 0;";
|
|
|
|
|
g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&m.appendChild(g);a.isOffline()||(n=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://www.diagrams.net/doc/faq/print-diagram")}),n.className="geBtn",m.appendChild(n));PrintDialog.previewEnabled&&(n=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),n.className="geBtn",m.appendChild(n));n=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
|
|
|
|
|
"print":"ok"),function(){a.hideDialog();c(!0)});n.className="geBtn gePrimaryBtn";m.appendChild(n);a.editor.cancelFirst||m.appendChild(g);k.appendChild(m);this.container=k};var H=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)):(H.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 J=document.createElement("canvas"),I=new Image;I.onload=function(){try{J.getContext("2d").drawImage(I,0,0);var a=J.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(M){}};I.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(K){}})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};a.afterDecode=function(a,e,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.10.1";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,e,b){b.ui=a.ui;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.10.2";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
|
|
|
|
|
EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;
|
|
|
|
|
EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},
|
|
|
|
|
gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(a,b,c,e,f,g,l){g=null!=g?g:0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";if(EditorUi.enableLogging&&"1"!=urlParams.dev)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&
|
|
|
|
@ -10113,11 +10113,11 @@ a.keyCode)return function(){0<d&&f.selectPage(f.pages[0])};if(39==a.keyCode)retu
|
|
|
|
|
e>b&&(d=a.substring(b,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(a),g=this.editor.extractGraphModel(f.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),d=null!=g?mxUtils.getXml(g):""}catch(t){}return d};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var d=a.indexOf('<meta charset="utf-8">');0<=d&&(a=a.slice(0,d)+'<meta charset="utf-8"/>'+a.slice(d+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 d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a){d=this.editor.graph;d.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,c=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<c.length||1==c.length&&c[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?
|
|
|
|
|
this.pages:[];for(var e=c.length-1;0<=e;e--){var f=this.updatePageRoot(new DiagramPage(c[e]));null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[e+1]));d.model.execute(new ChangePage(this,f,0==e?f:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),d.model.execute(new ChangePage(this,this.currentPage,
|
|
|
|
|
this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,f,g,l,n,y,x,A){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;y=null!=y?y:!0;var d,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":k=d=e;if(null==a)return"";var m=a;if("mxfile"!=
|
|
|
|
|
m.nodeName.toLowerCase()){if(A){var p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());p.appendChild(a)}else{p=Graph.zapGremlins(mxUtils.getXml(a));m=Graph.compress(p);if(Graph.decompress(m)!=p)return p;p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());mxUtils.setTextContent(p,m)}m=a.ownerDocument.createElement("mxfile");m.appendChild(p)}x?(m=m.cloneNode(!0),m.removeAttribute("modified"),m.removeAttribute("host"),m.removeAttribute("agent"),m.removeAttribute("etag"),
|
|
|
|
|
this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,f,g,l,n,y,x,B){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;y=null!=y?y:!0;var d,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":k=d=e;if(null==a)return"";var m=a;if("mxfile"!=
|
|
|
|
|
m.nodeName.toLowerCase()){if(B){var p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());p.appendChild(a)}else{p=Graph.zapGremlins(mxUtils.getXml(a));m=Graph.compress(p);if(Graph.decompress(m)!=p)return p;p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());mxUtils.setTextContent(p,m)}m=a.ownerDocument.createElement("mxfile");m.appendChild(p)}x?(m=m.cloneNode(!0),m.removeAttribute("modified"),m.removeAttribute("host"),m.removeAttribute("agent"),m.removeAttribute("etag"),
|
|
|
|
|
m.removeAttribute("userAgent"),m.removeAttribute("version"),m.removeAttribute("editor"),m.removeAttribute("type")):(m.removeAttribute("userAgent"),m.removeAttribute("version"),m.removeAttribute("editor"),m.removeAttribute("pages"),m.removeAttribute("type"),mxClient.IS_CHROMEAPP?m.setAttribute("host","Chrome"):EditorUi.isElectronApp?m.setAttribute("host","Electron"):m.setAttribute("host",window.location.hostname),m.setAttribute("modified",(new Date).toISOString()),m.setAttribute("agent",navigator.appVersion),
|
|
|
|
|
m.setAttribute("version",EditorUi.VERSION),m.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&m.setAttribute("type",a),1<m.getElementsByTagName("diagram").length&&null!=this.pages&&m.setAttribute("pages",this.pages.length));A=A?mxUtils.getPrettyXml(m):mxUtils.getXml(m);if(!g&&!f&&(l||null!=c&&/(\.html)$/i.test(c.getTitle())))A=this.getHtml2(mxUtils.getXml(m),b,null!=c?c.getTitle():null,d,k);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&
|
|
|
|
|
c.getMode()!=App.MODE_BROWSER||(e=null),A=this.getEmbeddedSvg(A,b,e,null,n,y,k);return A};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):
|
|
|
|
|
m.setAttribute("version",EditorUi.VERSION),m.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&m.setAttribute("type",a),1<m.getElementsByTagName("diagram").length&&null!=this.pages&&m.setAttribute("pages",this.pages.length));B=B?mxUtils.getPrettyXml(m):mxUtils.getXml(m);if(!g&&!f&&(l||null!=c&&/(\.html)$/i.test(c.getTitle())))B=this.getHtml2(mxUtils.getXml(m),b,null!=c?c.getTitle():null,d,k);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&
|
|
|
|
|
c.getMode()!=App.MODE_BROWSER||(e=null),B=this.getEmbeddedSvg(B,b,e,null,n,y,k);return B};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):
|
|
|
|
|
null==b||c?a=a.cloneNode(!0):(a=a.cloneNode(!1),mxUtils.setTextContent(a,Graph.compressNode(b)));d.appendChild(a)},EditorUi.removeChildNodes(this.currentPage.node),mxUtils.setTextContent(this.currentPage.node,Graph.compressNode(d)),d=this.fileNode.cloneNode(!1),b)a(this.currentPage.node);else for(b=0;b<this.pages.length;b++){if(this.currentPage!=this.pages[b]&&this.pages[b].needsUpdate){var e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root));this.editor.graph.saveViewState(this.pages[b].viewState,
|
|
|
|
|
e);EditorUi.removeChildNodes(this.pages[b].node);mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(e));delete this.pages[b].needsUpdate}a(this.pages[b].node)}return d};EditorUi.prototype.anonymizeString=function(a,b){for(var d=[],c=0;c<a.length;c++){var e=a.charAt(c);0<=EditorUi.ignoredAnonymizedChars.indexOf(e)?d.push(e):isNaN(parseInt(e))?e.toLowerCase()!=e?d.push(String.fromCharCode(65+Math.round(25*Math.random()))):e.toUpperCase()!=e?d.push(String.fromCharCode(97+Math.round(25*Math.random()))):
|
|
|
|
|
/\s/.test(e)?d.push(" "):d.push("?"):d.push(b?"0":Math.round(9*Math.random()))}return d.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var d=0;d<a[EditorUi.DIFF_INSERT].length;d++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][d].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][d].data=mxUtils.getXml(b)}catch(q){a[EditorUi.DIFF_INSERT][d].data=
|
|
|
|
@ -10136,9 +10136,9 @@ mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==f?'<script type="tex
|
|
|
|
|
null;var d=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(d)throw Error(mxResources.get("notADiagramFile")+" ("+d+")");d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a&&"mxfile"==a.nodeName&&(d=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name"))){var b=null;this.fileNode=a;this.pages=[];for(var c=0;c<d.length;c++)null==d[c].getAttribute("id")&&d[c].setAttribute("id",c),a=new DiagramPage(d[c]),
|
|
|
|
|
null==a.getName()&&a.setName(mxResources.get("pageWithNumber",[c+1])),this.pages.push(a),null!=urlParams["page-id"]&&a.getId()==urlParams["page-id"]&&(b=a);this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",
|
|
|
|
|
[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=urlParams["layer-ids"])try{var e=urlParams["layer-ids"].split(" ");a={};for(c=0;c<e.length;c++)a[e[c]]=!0;for(var f=this.editor.graph.getModel(),g=f.getChildren(f.root),c=0;c<g.length;c++){var l=g[c];f.setVisible(l,a[l.id]||!1)}}catch(y){}};EditorUi.prototype.getBaseFilename=function(a){var d=this.getCurrentFile(),d=null!=d&&null!=d.getTitle()?d.getTitle():
|
|
|
|
|
this.defaultFilename;if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,f,g,l,n,y,x,A){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),
|
|
|
|
|
this.defaultFilename;if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,f,g,l,n,y,x,B){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),
|
|
|
|
|
k=d+"."+a;if("xml"==a){var m='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,e,f,null,null,null,b);this.saveData(k,a,m,"text/xml")}else if("html"==a)m=this.getHtml2(this.getFileData(!0),this.editor.graph,d),this.saveData(k,a,m,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=d+".png":"jpeg"==a&&(k=d+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(d,b){try{var c=this.editor.graph.pageVisible;
|
|
|
|
|
null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(d,a,e,b,l,f,n,y,x,A);this.editor.graph.pageVisible=c;return k}catch(M){this.handleError(M)}}));else{var p=null,q=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(p)}))});if("svg"==a){var u=this.editor.graph.background;if(l||u==mxConstants.NONE)u=
|
|
|
|
|
null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(d,a,e,b,l,f,n,y,x,B);this.editor.graph.pageVisible=c;return k}catch(M){this.handleError(M)}}));else{var p=null,q=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(p)}))});if("svg"==a){var u=this.editor.graph.background;if(l||u==mxConstants.NONE)u=
|
|
|
|
|
null;var t=this.editor.graph.getSvg(u,null,null,null,null,e);c&&this.editor.graph.addSvgShadow(t);this.editor.convertImages(t,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();q('<?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=d+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();q(a)}),e)}}catch(H){this.handleError(H)}};EditorUi.prototype.createDownloadRequest=
|
|
|
|
|
function(a,b,c,e,f,g,l,n,y,x){var d=this.editor.graph,k=d.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var m="",p="";if(k.width*k.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};x=x?"1":"0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(x="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){m="&from="+g;break}g=d.background;"png"!=b&&"pdf"!=b||!f?f||
|
|
|
|
|
null!=g&&g!=mxConstants.NONE||(g="#ffffff"):g=mxConstants.NONE;f={globalVars:d.getExportVariables()};y&&(f.grid={size:d.gridSize,steps:d.view.gridSteps,color:d.view.gridColor});Graph.translateDiagram&&(f.diagramLanguage=Graph.diagramLanguage);return new mxXmlRequest(EXPORT_URL,"format="+b+m+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+x+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=l?"&scale="+
|
|
|
|
@ -10146,7 +10146,7 @@ l:"")+(null!=n?"&border="+n:""))};EditorUi.prototype.setMode=function(a,b){this.
|
|
|
|
|
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,m=null,f=mxUtils.bind(this,function(){var d=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){d===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(m);m=window.setTimeout(f,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();f()}));g();f()}null!=b&&b()});null!=a.url&&0<a.url.length?this.editor.loadUrl(a.url,mxUtils.bind(this,function(a){e(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)})):e("")};EditorUi.prototype.updateDiagram=function(a){function d(a){var b=new mxCellOverlay(a.image||e.warningImage,
|
|
|
|
|
a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,d){c.alert(a.tooltip)});return b}var b=null,c=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var e=this.editor.graph,f=e.getModel();f.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var l=f.getCell(a.getAttribute("id"));if(null!=l){try{var n=a.getAttribute("value");if(null!=n){var x=mxUtils.parseXml(n).documentElement;
|
|
|
|
|
if(null!=x)if("1"==x.getAttribute("replace-value"))f.setValue(l,x);else for(var A=x.attributes,z=0;z<A.length;z++)e.setAttributeForCell(l,A[z].nodeName,0<A[z].nodeValue.length?A[z].nodeValue:null)}}catch(J){null!=window.console&&console.log("Error in value for "+l.id+": "+J)}try{var B=a.getAttribute("style");null!=B&&e.model.setStyle(l,B)}catch(J){null!=window.console&&console.log("Error in style for "+l.id+": "+J)}try{var C=a.getAttribute("icon");if(null!=C){var D=0<C.length?JSON.parse(C):null;null!=
|
|
|
|
|
if(null!=x)if("1"==x.getAttribute("replace-value"))f.setValue(l,x);else for(var B=x.attributes,z=0;z<B.length;z++)e.setAttributeForCell(l,B[z].nodeName,0<B[z].nodeValue.length?B[z].nodeValue:null)}}catch(J){null!=window.console&&console.log("Error in value for "+l.id+": "+J)}try{var A=a.getAttribute("style");null!=A&&e.model.setStyle(l,A)}catch(J){null!=window.console&&console.log("Error in style for "+l.id+": "+J)}try{var C=a.getAttribute("icon");if(null!=C){var D=0<C.length?JSON.parse(C):null;null!=
|
|
|
|
|
D&&D.append||e.removeCellOverlays(l);null!=D&&e.addCellOverlay(l,d(D))}}catch(J){null!=window.console&&console.log("Error in icon for "+l.id+": "+J)}try{var F=a.getAttribute("geometry");if(null!=F){var F=JSON.parse(F),G=e.getCellGeometry(l);if(null!=G){G=G.clone();for(key in F){var E=parseFloat(F[key]);"dx"==key?G.x+=E:"dy"==key?G.y+=E:"dw"==key?G.width+=E:"dh"==key?G.height+=E:G[key]=parseFloat(F[key])}e.model.setGeometry(l,G)}}}catch(J){null!=window.console&&console.log("Error in icon for "+l.id+
|
|
|
|
|
": "+J)}}}else if("model"==a.nodeName){for(var H=a.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=H.nextSibling;null!=H&&(new mxCodec(a.firstChild)).decode(H,f)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(e.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))e.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{f.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var d=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,c="",e=d.lastIndexOf(".");0<=e&&(c=d.substring(e),d=d.substring(0,e));if(b)var k=new Date,e=k.getFullYear(),f=k.getMonth()+1,g=k.getDate(),l=k.getHours(),n=k.getMinutes(),k=k.getSeconds(),d=d+(" "+(e+"-"+f+"-"+g+"-"+l+"-"+n+"-"+k));return d=mxResources.get("copyOf",[d])+c};
|
|
|
|
@ -10165,13 +10165,13 @@ EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if
|
|
|
|
|
this.libraryLoaded(a,c,d.documentElement.getAttribute("title"),b)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c,e){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var k=
|
|
|
|
|
null,f=mxUtils.bind(this,function(b,d){0==b.length&&a.isEditable()?(null==k&&(k=document.createElement("div"),k.className="geDropTarget",mxUtils.write(k,mxResources.get("dragElementsHere"))),d.appendChild(k)):this.addLibraryEntries(b,d)});null!=this.sidebar&&null!=b&&this.sidebar.addEntries(b);c=null!=c&&0<c.length?c:a.getTitle();var m=this.sidebar.addPalette(a.getHash(),c,null!=e?e:!0,mxUtils.bind(this,function(a){f(b,a)}));this.repositionLibrary(d);var g=m.parentNode.previousSibling;e=g.getAttribute("title");
|
|
|
|
|
null!=e&&0<e.length&&".scratchpad"!=a.title&&g.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+e);var p=document.createElement("div");p.style.position="absolute";p.style.right="0px";p.style.top="0px";p.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");g.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("valign","absmiddle");
|
|
|
|
|
l.setAttribute("border","0");l.style.cursor="pointer";l.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)p.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var d=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):d();mxEvent.consume(b)}}));if(a.isEditable()){var B=this.editor.graph,C=null,
|
|
|
|
|
l.setAttribute("border","0");l.style.cursor="pointer";l.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)p.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var d=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):d();mxEvent.consume(b)}}));if(a.isEditable()){var A=this.editor.graph,C=null,
|
|
|
|
|
D=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),m,b,a,a.getMode());mxEvent.consume(d)}),F=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=C&&null!=C.parentNode&&C.parentNode.removeChild(C),C=l.cloneNode(!1),C.setAttribute("src",Editor.spinImage),C.setAttribute("title",mxResources.get("saving")),C.style.cursor="default",C.style.marginRight="2px",C.style.marginTop="-2px",p.insertBefore(C,p.firstChild),g.style.paddingRight=18*p.childNodes.length+"px",this.saveLibrary(a.getTitle(),
|
|
|
|
|
b,a,a.getMode(),!0,!0,function(){null!=C&&null!=C.parentNode&&(C.parentNode.removeChild(C),g.style.paddingRight=18*p.childNodes.length+"px")})):null==n&&(n=l.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),p.insertBefore(n,p.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(g.style.paddingRight=18*p.childNodes.length+
|
|
|
|
|
"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(d)})),g.style.paddingRight=18*p.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,d,c,e){a=B.cloneCells(mxUtils.sortCells(B.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var g=B.getCellGeometry(a[f]);null!=g&&g.translate(-d.x,-d.y)}m.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&
|
|
|
|
|
(a.title=e);b.push(a);F(c);null!=k&&null!=k.parentNode&&0<b.length&&(k.parentNode.removeChild(k),k=null)}),E=mxUtils.bind(this,function(a){if(B.isSelectionEmpty())B.getRubberband().isActive()?(B.getRubberband().execute(a),B.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=B.getSelectionCells(),d=B.view.getBounds(b),c=B.view.scale;d.x/=c;d.y/=c;d.width/=c;d.height/=c;d.x-=B.view.translate.x;d.y-=B.view.translate.y;
|
|
|
|
|
G(b,d)}mxEvent.consume(a)});mxEvent.addGestureListeners(m,function(){},mxUtils.bind(this,function(a){B.isMouseDown&&null!=B.panningManager&&null!=B.graphHandler.first&&(B.graphHandler.suspend(),null!=B.graphHandler.hint&&(B.graphHandler.hint.style.visibility="hidden"),m.style.backgroundColor="#f1f3f4",m.style.cursor="copy",B.panningManager.stop(),B.autoScroll=!1,mxEvent.consume(a))}),mxUtils.bind(this,function(a){B.isMouseDown&&null!=B.panningManager&&null!=B.graphHandler&&(m.style.backgroundColor=
|
|
|
|
|
"",m.style.cursor="default",this.sidebar.showTooltips=!0,B.panningManager.stop(),B.graphHandler.reset(),B.isMouseDown=!1,B.autoScroll=!0,E(a),mxEvent.consume(a))}));mxEvent.addListener(m,"mouseleave",mxUtils.bind(this,function(a){B.isMouseDown&&null!=B.graphHandler.first&&(B.graphHandler.resume(),null!=B.graphHandler.hint&&(B.graphHandler.hint.style.visibility="visible"),m.style.backgroundColor="",m.style.cursor="",B.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(m,"dragover",mxUtils.bind(this,
|
|
|
|
|
"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(d)})),g.style.paddingRight=18*p.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,d,c,e){a=A.cloneCells(mxUtils.sortCells(A.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var g=A.getCellGeometry(a[f]);null!=g&&g.translate(-d.x,-d.y)}m.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&
|
|
|
|
|
(a.title=e);b.push(a);F(c);null!=k&&null!=k.parentNode&&0<b.length&&(k.parentNode.removeChild(k),k=null)}),E=mxUtils.bind(this,function(a){if(A.isSelectionEmpty())A.getRubberband().isActive()?(A.getRubberband().execute(a),A.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=A.getSelectionCells(),d=A.view.getBounds(b),c=A.view.scale;d.x/=c;d.y/=c;d.width/=c;d.height/=c;d.x-=A.view.translate.x;d.y-=A.view.translate.y;
|
|
|
|
|
G(b,d)}mxEvent.consume(a)});mxEvent.addGestureListeners(m,function(){},mxUtils.bind(this,function(a){A.isMouseDown&&null!=A.panningManager&&null!=A.graphHandler.first&&(A.graphHandler.suspend(),null!=A.graphHandler.hint&&(A.graphHandler.hint.style.visibility="hidden"),m.style.backgroundColor="#f1f3f4",m.style.cursor="copy",A.panningManager.stop(),A.autoScroll=!1,mxEvent.consume(a))}),mxUtils.bind(this,function(a){A.isMouseDown&&null!=A.panningManager&&null!=A.graphHandler&&(m.style.backgroundColor=
|
|
|
|
|
"",m.style.cursor="default",this.sidebar.showTooltips=!0,A.panningManager.stop(),A.graphHandler.reset(),A.isMouseDown=!1,A.autoScroll=!0,E(a),mxEvent.consume(a))}));mxEvent.addListener(m,"mouseleave",mxUtils.bind(this,function(a){A.isMouseDown&&null!=A.graphHandler.first&&(A.graphHandler.resume(),null!=A.graphHandler.hint&&(A.graphHandler.hint.style.visibility="visible"),m.style.backgroundColor="",m.style.cursor="",A.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(m,"dragover",mxUtils.bind(this,
|
|
|
|
|
function(a){m.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";m.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"drop",mxUtils.bind(this,function(a){m.style.cursor="";m.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,e,g,p,l,n,z,q){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+
|
|
|
|
|
this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,p,l),d)],d[0].vertex=!0,G(d,new mxRectangle(0,0,p,l),a,mxEvent.isAltDown(a)?null:n.substring(0,n.lastIndexOf(".")).replace(/_/g," ")),null!=k&&null!=k.parentNode&&0<b.length&&(k.parentNode.removeChild(k),k=null);else{var u=!1,t=mxUtils.bind(this,function(d,c){if(null!=d&&"application/pdf"==c){var e=Editor.extractGraphModelFromPdf(d);null!=e&&0<e.length&&(d=e)}if(null!=d)if(e=mxUtils.parseXml(d),"mxlibrary"==e.documentElement.nodeName)try{var g=
|
|
|
|
|
JSON.parse(mxUtils.getTextContent(e.documentElement));f(g,m);b=b.concat(g);F(a);this.spinner.stop();u=!0}catch(R){}else if("mxfile"==e.documentElement.nodeName)try{for(var p=e.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var l=this.stringToCells(Editor.getDiagramNodeXml(p[g])),n=this.editor.graph.getBoundingBoxFromGeometry(l);G(l,new mxRectangle(0,0,n.width,n.height),a)}u=!0}catch(R){null!=window.console&&console.log("error in drop handler:",R)}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
|
|
|
@ -10204,7 +10204,7 @@ EditorUi.prototype.saveCanvas=function(a,b,c,e,f){var d="jpeg"==c?"jpg":c;e=this
|
|
|
|
|
EditorUi.prototype.showTextDialog=function(a,b){var d=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));d.textarea.style.width="600px";d.textarea.style.height="380px";this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,f,g){"text/xml"!=c||/(\.drawio)$/i.test(b)||/(\.xml)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.html)$/i.test(b)||(b=b+"."+(null!=g?g:"drawio"));if(window.Blob&&
|
|
|
|
|
navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==c||"image/"!=c.substring(0,6)?this.showTextDialog(b+":",a):this.openInNewWindow(a,c,e);else{var d=document.createElement("a");g=(null==navigator.userAgent||
|
|
|
|
|
0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof d.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var k=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);g=65==(k?parseInt(k[2],10):!1)?!1:g}if(g||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));g?d.download=b:d.setAttribute("target","_blank");document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},2E4),d.click(),d.parentNode.removeChild(d)}catch(y){}}else this.createEchoRequest(a,
|
|
|
|
|
b,c,e,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,f,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),f=Array(e),k=0;k<e;++k){for(var g=1024*k,l=Math.min(g+1024,c),n=Array(l-g),A=0;g<l;++A,++g)n[A]=
|
|
|
|
|
b,c,e,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,f,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),f=Array(e),k=0;k<e;++k){for(var g=1024*k,l=Math.min(g+1024,c),n=Array(l-g),B=0;g<l;++B,++g)n[B]=
|
|
|
|
|
d[g].charCodeAt(0);f[k]=new Uint8Array(n)}return new Blob(f,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,f,g,l,n){g=null!=g?g:!1;l=null!=l?l:"vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(g);isLocalStorage&&f++;var d=4>=f?2:6<f?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,d){try{if("_blank"==d)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,e);else if(null!=c&&"text/html"==c.substring(0,9)){var f=new EmbedDialog(this,a);this.showDialog(f.container,
|
|
|
|
|
440,240,!0,!0);f.init()}else{var k=window.open("about:blank");null==k?mxUtils.popup(a,!0):(k.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"</pre>"),k.document.close())}else d==App.MODE_DEVICE||"download"==d?this.doSaveLocalFile(a,b,c,e,null,n):null!=b&&0<b.length&&this.pickFolder(d,mxUtils.bind(this,function(f){try{this.exportFile(a,b,c,e,d,f)}catch(D){this.handleError(D)}}))}catch(C){this.handleError(C)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),
|
|
|
|
|
!1,g,l,null,1<f,d,a,c,e);g=this.isServices(f)?f>d?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!=b||mxClient.IS_SVG?"image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):(a=c?a:btoa(unescape(encodeURIComponent(a))),d.document.write('<html><img style="max-width:100%;" src="data:'+b+";base64,"+a+'"/></html>')):d.document.write("<html><pre>"+
|
|
|
|
@ -10216,7 +10216,7 @@ function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.
|
|
|
|
|
b,c,e,f){this.isLocalFileSave()?this.saveLocalFile(c,a,e,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,f,b,d)}),c,f,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,f,g,l){l=null!=l?l:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);isLocalStorage&&d++;var k=4>=d?2:6<d?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||"download"==
|
|
|
|
|
d||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"download"==d||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,g,!0,d,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,g,!0,d,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),
|
|
|
|
|
function(a){this.spinner.stop();this.handleError(a)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,l,null,1<d,k,e,g,f);d=this.isServices(d)?4<d?390:270:160;this.showDialog(a.container,380,d,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,f,g){};EditorUi.prototype.pickFolder=function(a,
|
|
|
|
|
b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,f,g,l,n,y,x,A){if(this.spinner.spin(document.body,mxResources.get("export")))try{var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;var k=b?null:this.editor.graph.background;k==mxConstants.NONE&&(k=null);null==k&&0==b&&(k=A?this.editor.graph.defaultPageBackgroundColor:"#ffffff");var m=this.editor.graph.getSvg(k,a,l,n,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null,null,!0,A);e&&this.editor.graph.addSvgShadow(m);var p=this.getBaseFilename()+
|
|
|
|
|
b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,f,g,l,n,y,x,B){if(this.spinner.spin(document.body,mxResources.get("export")))try{var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;var k=b?null:this.editor.graph.background;k==mxConstants.NONE&&(k=null);null==k&&0==b&&(k=B?this.editor.graph.defaultPageBackgroundColor:"#ffffff");var m=this.editor.graph.getSvg(k,a,l,n,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null,null,!0,B);e&&this.editor.graph.addSvgShadow(m);var p=this.getBaseFilename()+
|
|
|
|
|
".svg",q=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,y,null,null,null,!1));var b='<?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);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(p,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,
|
|
|
|
|
function(){mxUtils.popup(b)}))});this.editor.addFontCss(m);this.editor.graph.mathEnabled&&this.editor.addMathCss(m);g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(m,q,this.thumbImageCache)):q(m)}catch(G){this.handleError(G)}};EditorUi.prototype.addRadiobox=function(a,b,c,e,f,g,l){return this.addCheckbox(a,c,e,f,g,l,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,e,f,g,l,n){g=null!=g?g:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop=
|
|
|
|
|
"16px";d.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();d.id=l;null!=n&&d.setAttribute("name",n);c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");g&&(a.appendChild(d),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),f||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a,b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";
|
|
|
|
@ -10228,14 +10228,14 @@ mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("sele
|
|
|
|
|
"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return c.value},focus:function(){c.focus()}}};EditorUi.prototype.createUrlParameters=function(a,b,c,e,f,g,l){l=null!=l?l:[];e&&("1"==urlParams.dev&&l.push("lightbox=1"),"auto"!=a&&l.push("target="+
|
|
|
|
|
a),null!=b&&b!=mxConstants.NONE&&l.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&l.push("edit="+encodeURIComponent(f)),g&&l.push("layers=1"),this.editor.graph.foldingEnabled&&l.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&l.push("page-id="+this.currentPage.getId());return l};EditorUi.prototype.createLink=function(a,b,c,e,f,g,l,n,y,x){y=null!=y?y:this.createUrlParameters(a,b,c,e,f,g);a=this.getCurrentFile();b=!0;null!=l?
|
|
|
|
|
c="#U"+encodeURIComponent(l):(a=this.getCurrentFile(),n||null==a||a.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+a.getHash(),b=!1));b&&null!=a&&null!=a.getTitle()&&a.getTitle()!=this.defaultFilename&&y.push("title="+encodeURIComponent(a.getTitle()));x&&1<c.length&&(y.push("open="+c.substring(1)),c="");return(e&&"1"!=urlParams.dev?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||
|
|
|
|
|
EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<y.length?"?"+y.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,f,g,l,n,y,x,A){this.getBasenames();var d={};""!=f&&f!=mxConstants.NONE&&(d.highlight=f);"auto"!==e&&(d.target=e);y||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];l&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&
|
|
|
|
|
(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),d.resize=!0);n&&c.push("layers");0<c.length&&(y&&c.push("lightbox"),d.toolbar=c.join(" "));null!=x&&0<x.length&&(d.edit=x);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";A(b,'<script type="text/javascript" src="'+
|
|
|
|
|
EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<y.length?"?"+y.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,f,g,l,n,y,x,B){this.getBasenames();var d={};""!=f&&f!=mxConstants.NONE&&(d.highlight=f);"auto"!==e&&(d.target=e);y||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];l&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&
|
|
|
|
|
(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),d.resize=!0);n&&c.push("layers");0<c.length&&(y&&c.push("lightbox"),d.toolbar=c.join(" "));null!=x&&0<x.length&&(d.edit=x);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";B(b,'<script type="text/javascript" src="'+
|
|
|
|
|
(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";
|
|
|
|
|
d.appendChild(f);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var m=document.createElement("input");m.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";m.setAttribute("value","url");m.setAttribute("type","radio");m.setAttribute("name","type-embedhtmldialog");f=m.cloneNode(!0);f.setAttribute("value","copy");k.appendChild(f);var g=document.createElement("span");mxUtils.write(g,mxResources.get("includeCopyOfMyDiagram"));
|
|
|
|
|
k.appendChild(g);mxUtils.br(k);k.appendChild(m);g=document.createElement("span");mxUtils.write(g,mxResources.get("publicDiagramUrl"));k.appendChild(g);var l=this.getCurrentFile();null==c&&null!=l&&l.constructor==window.DriveFile&&(g=document.createElement("a"),g.style.paddingLeft="12px",g.style.color="gray",g.style.cursor="pointer",mxUtils.write(g,mxResources.get("share")),k.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));
|
|
|
|
|
f.setAttribute("checked","checked");null==c&&m.setAttribute("disabled","disabled");d.appendChild(k);var p=this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var B=document.createElement("input");B.setAttribute("type","text");B.style.marginRight="16px";B.style.width="60px";B.style.marginLeft="4px";B.style.marginRight="12px";B.value="100%";d.appendChild(B);var C=this.addCheckbox(d,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,D=
|
|
|
|
|
f.setAttribute("checked","checked");null==c&&m.setAttribute("disabled","disabled");d.appendChild(k);var p=this.addLinkSection(d),n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var A=document.createElement("input");A.setAttribute("type","text");A.style.marginRight="16px";A.style.width="60px";A.style.marginLeft="4px";A.style.marginRight="12px";A.value="100%";d.appendChild(A);var C=this.addCheckbox(d,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,D=
|
|
|
|
|
D=this.addCheckbox(d,mxResources.get("allPages"),k,!k),F=this.addCheckbox(d,mxResources.get("layers"),!0),G=this.addCheckbox(d,mxResources.get("lightbox"),!0),E=this.addEditButton(d,G),H=E.getEditInput();H.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled");H.checked&&G.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,
|
|
|
|
|
mxUtils.bind(this,function(){e(m.checked?c:null,n.checked,B.value,p.getTarget(),p.getColor(),C.checked,D.checked,F.checked,G.checked,E.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,g){var d=document.createElement("div");d.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";d.appendChild(k);
|
|
|
|
|
mxUtils.bind(this,function(){e(m.checked?c:null,n.checked,A.value,p.getTarget(),p.getColor(),C.checked,D.checked,F.checked,G.checked,E.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,g){var d=document.createElement("div");d.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";d.appendChild(k);
|
|
|
|
|
var m=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=m&&m.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 p=document.createElement("div");p.style.whiteSpace="normal";mxUtils.write(p,mxResources.get("linkAccountRequired"));l.appendChild(p);
|
|
|
|
|
p=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(m.getId())}));p.style.marginTop="12px";p.className="geBtn";l.appendChild(p);d.appendChild(l);p=document.createElement("a");p.style.paddingLeft="12px";p.style.color="gray";p.style.fontSize="11px";p.style.cursor="pointer";mxUtils.write(p,mxResources.get("check"));l.appendChild(p);mxEvent.addListener(p,"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,q=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,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",
|
|
|
|
@ -10265,19 +10265,19 @@ Math.floor((new Date-a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxR
|
|
|
|
|
a;else if("mxfile"==a.nodeName){var c=a.getElementsByTagName("diagram");if(0<c.length){var d=c[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?d.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=d&&(a=Editor.parseDiagramNode(d))}c=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(q){}finally{this.editor.graph=c}return a};EditorUi.prototype.getPngFileProperties=function(a){var b=1,d=0;if(null!=
|
|
|
|
|
a){if(a.hasAttribute("scale")){var c=parseFloat(a.getAttribute("scale"));!isNaN(c)&&0<c&&(b=c)}a.hasAttribute("border")&&(c=parseInt(a.getAttribute("border")),!isNaN(c)&&0<c&&(d=c))}return{scale:b,border:d}};EditorUi.prototype.getEmbeddedPng=function(a,b,c,e,f){try{var d=this.editor.graph,k=null!=d.themes&&"darkTheme"==d.defaultThemeName,m=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),m=c;else if(k||null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),g=d.getGlobalVariable,l=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(l.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(c){try{null==m&&(m=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var e=c.toDataURL("image/png"),e=Editor.writeGraphModelToPng(e,
|
|
|
|
|
"tEXt","mxfile",encodeURIComponent(m));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(B){null!=b&&b(B)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,e,null,d.shadowVisible,null,d,f)}catch(A){null!=b&&b(A)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,f,g,l,n){n=null!=n?n:!0;l=b.background;l==mxConstants.NONE&&(l=null);g=b.getSvg(l,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&
|
|
|
|
|
"tEXt","mxfile",encodeURIComponent(m));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(A){null!=b&&b(A)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,e,null,d.shadowVisible,null,d,f)}catch(B){null!=b&&b(B)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,f,g,l,n){n=null!=n?n:!0;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!=f)this.embedFonts(g,mxUtils.bind(this,function(a){n?this.editor.convertImages(a,mxUtils.bind(this,function(a){f((e?"":'<?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))})):f((e?"":'<?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(e?"":'<?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.embedFonts=function(a,b){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(a,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(d){try{null!=d&&this.editor.addFontCss(a,d),b(a)}catch(p){b(a)}}))}catch(m){b(a)}}))};
|
|
|
|
|
EditorUi.prototype.exportImage=function(a,b,c,e,f,g,l,n,y,x,A,z){y=null!=y?y:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,n):null,y,null==this.pages||0==this.pages.length,A)}catch(D){this.handleError(D)}}),null,this.thumbImageCache,
|
|
|
|
|
EditorUi.prototype.exportImage=function(a,b,c,e,f,g,l,n,y,x,B,z){y=null!=y?y:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,n):null,y,null==this.pages||0==this.pages.length,B)}catch(D){this.handleError(D)}}),null,this.thumbImageCache,
|
|
|
|
|
null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,g,l,x,z)}catch(C){this.spinner.stop(),this.handleError(C)}}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.importXml=function(a,b,c,e,f){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var k=this.editor.graph;if(null!=a&&0<a.length){k.model.beginUpdate();try{var m=mxUtils.parseXml(a);a={};var g=this.editor.extractGraphModel(m.documentElement,
|
|
|
|
|
null!=this.pages);if(null!=g&&"mxfile"==g.nodeName&&null!=this.pages){var l=g.getElementsByTagName("diagram");if(1==l.length)g=Editor.parseDiagramNode(l[0]),null!=this.currentPage&&(a[l[0].getAttribute("id")]=this.currentPage.getId());else if(1<l.length){var m=[],p=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(a[l[0].getAttribute("id")]=this.pages[0].getId(),g=Editor.parseDiagramNode(l[0]),e=!1,p=1);for(;p<l.length;p++){var n=l[p].getAttribute("id");l[p].removeAttribute("id");
|
|
|
|
|
var u=this.updatePageRoot(new DiagramPage(l[p]));a[n]=l[p].getAttribute("id");var C=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[C+1]));k.model.execute(new ChangePage(this,u,u,C,!0));m.push(u)}this.updatePageLinks(a,m)}}if(null!=g&&"mxGraphModel"===g.nodeName&&(d=k.importGraphModel(g,b,c,e),null!=d))for(p=0;p<d.length;p++)this.updatePageLinksForCell(a,d[p])}finally{k.model.endUpdate()}}}catch(D){if(f)throw D;this.handleError(D)}return d};EditorUi.prototype.updatePageLinks=
|
|
|
|
|
function(a,b){for(var d=0;d<b.length;d++)this.updatePageLinksForCell(a,b[d].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var d=document.createElement("div"),c=this.editor.graph,e=c.getLinkForCell(b);null!=e&&c.setLinkForCell(b,this.updatePageLink(a,e));if(c.isHtmlLabel(b)){d.innerHTML=c.sanitizeHtml(c.getLabel(b));for(var f=d.getElementsByTagName("a"),k=!1,g=0;g<f.length;g++)e=f[g].getAttribute("href"),null!=e&&(f[g].setAttribute("href",this.updatePageLink(a,e)),k=!0);k&&c.labelChanged(b,
|
|
|
|
|
d.innerHTML)}for(g=0;g<c.model.getChildCount(b);g++)this.updatePageLinksForCell(a,c.model.getChildAt(b,g))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var d=a[b.substring(b.indexOf(",")+1)];b=null!=d?"data:page/id,"+d:null}else if("data:action/json,"==b.substring(0,17))try{var c=JSON.parse(b.substring(17));if(null!=c.actions){for(var e=0;e<c.actions.length;e++){var f=c.actions[e];null!=f.open&&"data:page/id,"==f.open.substring(0,13)&&(d=a[f.open.substring(f.open.indexOf(",")+
|
|
|
|
|
1)],null!=d?f.open="data:page/id,"+d:delete f.open)}b="data:action/json,"+JSON.stringify(c)}}catch(t){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,e){e=null!=e?e:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var d=this.isRemoteVisioFormat(e);try{var f="UNKNOWN-VISIO",
|
|
|
|
|
k=e.lastIndexOf(".");if(0<=k&&k<e.length)f=e.substring(k+1).toUpperCase();else{var g=e.lastIndexOf("/");0<=g&&g<e.length&&(e=e.substring(g+1))}EditorUi.logEvent({category:f+"-MS-IMPORT-FILE",action:"filename_"+e,label:d?"remote":"local"})}catch(A){}if(d)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{d=new FormData;d.append("file1",a,e);var m=new XMLHttpRequest;m.open("POST",VSD_CONVERT_URL);
|
|
|
|
|
m.responseType="blob";this.addRemoteServiceSecurityCheck(m);m.onreadystatechange=mxUtils.bind(this,function(){if(4==m.readyState)if(200<=m.status&&299>=m.status)try{var a=m.response;if("text/xml"==a.type){var d=new FileReader;d.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(C){c({message:mxResources.get("errorLoadingFile")})}});d.readAsText(a)}else this.doImportVisio(a,b,c,e)}catch(B){c(B)}else try{""==m.responseType||"text"==m.responseType?c({message:m.responseText}):(d=new FileReader,
|
|
|
|
|
d.onload=function(){c({message:JSON.parse(d.result).Message})},d.readAsText(m.response))}catch(B){c({})}});m.send(d)}else try{this.doImportVisio(a,b,c,e)}catch(A){c(A)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
|
|
|
|
|
k=e.lastIndexOf(".");if(0<=k&&k<e.length)f=e.substring(k+1).toUpperCase();else{var g=e.lastIndexOf("/");0<=g&&g<e.length&&(e=e.substring(g+1))}EditorUi.logEvent({category:f+"-MS-IMPORT-FILE",action:"filename_"+e,label:d?"remote":"local"})}catch(B){}if(d)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{d=new FormData;d.append("file1",a,e);var m=new XMLHttpRequest;m.open("POST",VSD_CONVERT_URL);
|
|
|
|
|
m.responseType="blob";this.addRemoteServiceSecurityCheck(m);m.onreadystatechange=mxUtils.bind(this,function(){if(4==m.readyState)if(200<=m.status&&299>=m.status)try{var a=m.response;if("text/xml"==a.type){var d=new FileReader;d.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(C){c({message:mxResources.get("errorLoadingFile")})}});d.readAsText(a)}else this.doImportVisio(a,b,c,e)}catch(A){c(A)}else try{""==m.responseType||"text"==m.responseType?c({message:m.responseText}):(d=new FileReader,
|
|
|
|
|
d.onload=function(){c({message:JSON.parse(d.result).Message})},d.readAsText(m.response))}catch(A){c({})}});m.send(d)}else try{this.doImportVisio(a,b,c,e)}catch(B){c(B)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
|
|
|
|
|
var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(u){c(u)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||
|
|
|
|
|
this.handleError({message:mxResources.get("unknownError")})}catch(k){this.handleError(k)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?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{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",
|
|
|
|
|
action:"size_"+a.length}),EditorUi.debug("convertLucidChart",a)}catch(u){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(u){null!=window.console&&console.error(u),c(u)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generateMermaidImage=
|
|
|
|
@ -10298,18 +10298,18 @@ this.importFileInputElt){var d=document.createElement("input");d.setAttribute("t
|
|
|
|
|
"F",a,b)});window.openBrowserFile=mxUtils.bind(this,function(a,b,d){StorageFile.getFileContent(this,a,b,d)});window.deleteBrowserFile=mxUtils.bind(this,function(a,b,d){StorageFile.deleteFile(this,a,b,d)});if(!b){var c=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var d=new Blob([a],{type:"application/octet-stream"});
|
|
|
|
|
this.importVisio(d,mxUtils.bind(this,function(a){this.importXml(a,0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=c;f.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};
|
|
|
|
|
EditorUi.prototype.importZipFile=function(a,b,c){var d=this,e=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(e){if(0==Object.keys(e.files).length)c();else{var f=0,k,g=!1;e.forEach(function(a,d){var e=d.name.toLowerCase();"diagram/diagram.xml"==e?(g=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==e.indexOf("versions/")&&(e=parseInt(e.substr(9)),e>f&&(f=e,k=d))});0<f?k.async("string").then(function(e){!d.isOffline()&&
|
|
|
|
|
(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):g||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,g,l,n,y,x,A){x=null!=x?x:!0;var d=!1,k=null,
|
|
|
|
|
m=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,e,x);null!=n&&n(b)});"image"==b.substring(0,5)?(y=!1,"image/png"==b.substring(0,9)&&(b=A?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,e,x),y=!0)),y||(b=this.editor.graph,A=a.indexOf(";"),0<A&&(a=a.substring(0,A)+a.substring(a.indexOf(",",A+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),k=[b.insertVertex(null,
|
|
|
|
|
(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):g||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,g,l,n,y,x,B){x=null!=x?x:!0;var d=!1,k=null,
|
|
|
|
|
m=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,e,x);null!=n&&n(b)});"image"==b.substring(0,5)?(y=!1,"image/png"==b.substring(0,9)&&(b=B?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,e,x),y=!0)),y||(b=this.editor.graph,B=a.indexOf(";"),0<B&&(a=a.substring(0,B)+a.substring(a.indexOf(",",B+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),k=[b.insertVertex(null,
|
|
|
|
|
null,"",c,e,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,m)):null!=y&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(d=!0,this.importVisio(y,m)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=y?y:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==
|
|
|
|
|
a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=n&&n(null))}),l)):0==a.indexOf("PK")&&null!=y?(d=!0,this.importZipFile(y,m,mxUtils.bind(this,function(){k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);n(k)}))):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||(k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==n||n(k);return k};EditorUi.prototype.importFiles=function(a,b,c,e,f,g,l,n,y,x,A,z){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;
|
|
|
|
|
var d=null!=b&&null!=c,k=!0;b=null!=b?b:0;c=null!=c?c:0;var m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=A||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){m=!0;break}var u=mxUtils.bind(this,function(){var m=this.editor.graph,p=m.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,f,k,g,m,l){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,
|
|
|
|
|
m,l,d,z)}catch(da){return this.handleError(da),null}});g=null!=g?g:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,u=q,B=[],t=mxUtils.bind(this,function(a,b){B[a]=b;if(0==--u){this.spinner.stop();if(null!=n)n(B);else{var d=[];m.getModel().beginUpdate();try{for(var c=0;c<B.length;c++){var e=B[c]();null!=e&&(d=d.concat(e))}}finally{m.getModel().endUpdate()}}g(d)}}),v=0;v<q;v++)mxUtils.bind(this,function(d){var g=
|
|
|
|
|
a[d];if(null!=g){var n=new FileReader;n.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 n=a.target.result,q=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(q+1)))),B=mxUtils.parseXml(u),u=B.getElementsByTagName("svg");if(0<u.length){var u=u[0],v=z?null:u.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
|
|
|
|
|
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?t(d,mxUtils.bind(this,function(){try{if(n.substring(0,q+1),null!=B){var a=B.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=k.getAttribute("width"),z=k.getAttribute("height"),l=null!=l&&"%"!=l.charAt(l.length-1)?parseFloat(l):NaN,z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN,u=k.getAttribute("viewBox");if(null==u||0==u.length)k.setAttribute("viewBox","0 0 "+l+" "+z);else if(isNaN(l)||
|
|
|
|
|
isNaN(z)){var t=u.split(" ");3<t.length&&(l=parseFloat(t[2]),z=parseFloat(t[3]))}n=Editor.createSvgDataUri(mxUtils.getXml(k));var v=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,z)),C=f(n,g.type,b+d*p,c+d*p,Math.max(1,Math.round(l*v)),Math.max(1,Math.round(z*v)),g.name);if(isNaN(l)||isNaN(z)){var x=new Image;x.onload=mxUtils.bind(this,function(){l=Math.max(1,x.width);z=Math.max(1,x.height);C[0].geometry.width=l;C[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+l+" "+z);n=Editor.createSvgDataUri(mxUtils.getXml(k));
|
|
|
|
|
var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));m.setCellStyles("image",n,[C[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(k))}return C}}}catch(ka){}return null})):t(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*p,c+d*p,0,0,g.name)}))}else t(d,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==g.type){var C=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var D=new Image;D.src=a.target.result;t(d,mxUtils.bind(this,
|
|
|
|
|
function(){return f(C,"text/xml",b+d*p,c+d*p,D.width,D.height,g.name)}));u=!0}}u||(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(m){this.resizeImage(m,a.target.result,mxUtils.bind(this,function(a,m,l){t(d,mxUtils.bind(this,
|
|
|
|
|
function(){if(null!=a&&a.length<x){var n=k&&this.isResampleImageSize(g.size,A)?Math.min(1,Math.min(e/m,e/l)):1;return f(a,g.type,b+d*p,c+d*p,Math.round(m*n),Math.round(l*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,e,A,g.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else n=a.target.result,f(n,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||
|
|
|
|
|
a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=n&&n(null))}),l)):0==a.indexOf("PK")&&null!=y?(d=!0,this.importZipFile(y,m,mxUtils.bind(this,function(){k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);n(k)}))):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||(k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==n||n(k);return k};EditorUi.prototype.importFiles=function(a,b,c,e,f,g,l,n,y,x,B,z){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;
|
|
|
|
|
var d=null!=b&&null!=c,k=!0;b=null!=b?b:0;c=null!=c?c:0;var m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=B||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){m=!0;break}var u=mxUtils.bind(this,function(){var m=this.editor.graph,p=m.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,f,k,g,m,l){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,
|
|
|
|
|
m,l,d,z)}catch(da){return this.handleError(da),null}});g=null!=g?g:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,u=q,A=[],t=mxUtils.bind(this,function(a,b){A[a]=b;if(0==--u){this.spinner.stop();if(null!=n)n(A);else{var d=[];m.getModel().beginUpdate();try{for(var c=0;c<A.length;c++){var e=A[c]();null!=e&&(d=d.concat(e))}}finally{m.getModel().endUpdate()}}g(d)}}),v=0;v<q;v++)mxUtils.bind(this,function(d){var g=
|
|
|
|
|
a[d];if(null!=g){var n=new FileReader;n.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 n=a.target.result,q=n.indexOf(","),A=decodeURIComponent(escape(atob(n.substring(q+1)))),u=mxUtils.parseXml(A),A=u.getElementsByTagName("svg");if(0<A.length){var A=A[0],v=z?null:A.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
|
|
|
|
|
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?t(d,mxUtils.bind(this,function(){try{if(n.substring(0,q+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var k=a[0],l=k.getAttribute("width"),z=k.getAttribute("height"),l=null!=l&&"%"!=l.charAt(l.length-1)?parseFloat(l):NaN,z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN,A=k.getAttribute("viewBox");if(null==A||0==A.length)k.setAttribute("viewBox","0 0 "+l+" "+z);else if(isNaN(l)||
|
|
|
|
|
isNaN(z)){var t=A.split(" ");3<t.length&&(l=parseFloat(t[2]),z=parseFloat(t[3]))}n=Editor.createSvgDataUri(mxUtils.getXml(k));var v=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,z)),C=f(n,g.type,b+d*p,c+d*p,Math.max(1,Math.round(l*v)),Math.max(1,Math.round(z*v)),g.name);if(isNaN(l)||isNaN(z)){var x=new Image;x.onload=mxUtils.bind(this,function(){l=Math.max(1,x.width);z=Math.max(1,x.height);C[0].geometry.width=l;C[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+l+" "+z);n=Editor.createSvgDataUri(mxUtils.getXml(k));
|
|
|
|
|
var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));m.setCellStyles("image",n,[C[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(k))}return C}}}catch(ka){}return null})):t(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*p,c+d*p,0,0,g.name)}))}else t(d,mxUtils.bind(this,function(){return null}))}else{A=!1;if("image/png"==g.type){var C=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=C&&0<C.length){var D=new Image;D.src=a.target.result;t(d,mxUtils.bind(this,
|
|
|
|
|
function(){return f(C,"text/xml",b+d*p,c+d*p,D.width,D.height,g.name)}));A=!0}}A||(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(m){this.resizeImage(m,a.target.result,mxUtils.bind(this,function(a,m,l){t(d,mxUtils.bind(this,
|
|
|
|
|
function(){if(null!=a&&a.length<x){var n=k&&this.isResampleImageSize(g.size,B)?Math.min(1,Math.min(e/m,e/l)):1;return f(a,g.type,b+d*p,c+d*p,Math.round(m*n),Math.round(l*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,e,B,g.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else n=a.target.result,f(n,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||
|
|
|
|
|
/(\.vs(x|sx?))($|\?)/i.test(g.name)?f(null,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g):"image"==g.type.substring(0,5)||"application/pdf"==g.type?n.readAsDataURL(g):n.readAsText(g)}})(v)});if(m){m=[];for(q=0;q<a.length;q++)m.push(a[q]);a=m;this.confirmImageResize(function(a){k=a;u()},y)}else u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?
|
|
|
|
|
mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
|
|
|
|
|
mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(a,b){b=null!=b?b:this.resampleThreshold;return a>b};EditorUi.prototype.resizeImage=function(a,
|
|
|
|
@ -10331,7 +10331,7 @@ mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getD
|
|
|
|
|
"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()})))}));"undefined"!==typeof window.mxSettings&&(x=this.editor.graph.view,x.setUnit(mxSettings.getUnit()),x.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==
|
|
|
|
|
document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,x.unit),this.refresh());if("1"==urlParams.styledev){x=document.getElementById("geFooter");null!=x&&(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)})),x.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),d=this.editor.graph.getModel().getStyle(d);this.styleInput.value=d||
|
|
|
|
|
"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var A=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:A.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),
|
|
|
|
|
"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var B=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:B.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),
|
|
|
|
|
z=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=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!=z&&(z.parentNode.removeChild(z),z=null);if(b.isEnabled()){var d=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),
|
|
|
|
|
c=b.view.translate,e=b.view.scale,f=d.x/e-c.x,g=d.y/e-c.y;if(0<a.dataTransfer.files.length)mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)?this.openFiles(a.dataTransfer.files,!0):(mxEvent.isAltDown(a)&&(g=f=null),this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a)));else{mxEvent.isAltDown(a)&&(g=f=0);var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):
|
|
|
|
|
null,d=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=d)b.setSelectionCells(this.importXml(d,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var m=a.dataTransfer.getData("text/html"),d=document.createElement("div");d.innerHTML=b.sanitizeHtml(m);var l=null,c=d.getElementsByTagName("img");null!=c&&1==c.length?(m=c[0].getAttribute("src"),null==m&&(m=c[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)||(l=!0)):(c=d.getElementsByTagName("a"),null!=
|
|
|
|
@ -10355,7 +10355,7 @@ f=!0;g=d.getElementsByTagName("style");if(null!=g)for(;0<g.length;)g[0].parentNo
|
|
|
|
|
g==d.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(d,g),f=!1));k=k&&null!=d.firstChild?d.firstChild.nextSibling:d.firstChild;null!=k&&null==k.nextSibling&&k.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==k.nodeName&&(g=k.getAttribute("src"),null!=g&&(mxUtils.setTextContent(d,g),f=!1));f&&Graph.removePasteFormatting(d)}else g=a.clipboardData.getData("text/plain"),null!=g&&0<g.length&&(d=document.createElement("div"),mxUtils.setTextContent(d,g))}k=d.getElementsByTagName("span");
|
|
|
|
|
if(null!=k&&0<k.length&&"application/vnd.lucid.chart.objects"===k[0].getAttribute("data-lucid-type"))c=k[0].getAttribute("data-lucid-content"),null!=c&&0<c.length&&(this.convertLucidChart(c,mxUtils.bind(this,function(a){var b=this.editor.graph;b.lastPasteXml==a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var d=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,d,d));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a));
|
|
|
|
|
else{f=f?d.innerHTML:mxUtils.trim(null==d.innerText?mxUtils.getTextContent(d):d.innerText);g=!1;try{var m=f.lastIndexOf("%3E");0<=m&&m<f.length-3&&(f=f.substring(0,m+3))}catch(D){}try{var k=d.getElementsByTagName("span"),l=null!=k&&0<k.length?mxUtils.trim(decodeURIComponent(k[0].textContent)):decodeURIComponent(f);this.isCompatibleString(l)&&(g=!0,f=l)}catch(D){}try{var n=this.editor.graph;if(null!=f&&0<f.length){n.lastPasteXml==f?n.pasteCounter++:(n.lastPasteXml=f,n.pasteCounter=0);var p=n.pasteCounter*
|
|
|
|
|
n.gridSize;if(g||this.isCompatibleString(f))n.setSelectionCells(this.importXml(f,p,p));else if(e&&1==n.getSelectionCount()){var B=n.getStartEditingCell(n.getSelectionCell(),a);/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(f)&&"image"==n.getCurrentCellStyle(B)[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_IMAGE,f,[B]):(n.labelChanged(B,f),Graph.isLink(f)&&n.setLinkForCell(B,f));n.setSelectionCell(B)}else{var C=n.getInsertPoint();n.isMouseInsertPoint()&&(p=0,n.lastPasteXml==f&&0<n.pasteCounter&&
|
|
|
|
|
n.gridSize;if(g||this.isCompatibleString(f))n.setSelectionCells(this.importXml(f,p,p));else if(e&&1==n.getSelectionCount()){var A=n.getStartEditingCell(n.getSelectionCell(),a);/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(f)&&"image"==n.getCurrentCellStyle(A)[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_IMAGE,f,[A]):(n.labelChanged(A,f),Graph.isLink(f)&&n.setLinkForCell(A,f));n.setSelectionCell(A)}else{var C=n.getInsertPoint();n.isMouseInsertPoint()&&(p=0,n.lastPasteXml==f&&0<n.pasteCounter&&
|
|
|
|
|
n.pasteCounter--);n.setSelectionCells(this.insertTextAt(f,C.x+p,C.y+p,!0))}n.isSelectionEmpty()||(n.scrollCellToVisible(n.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(n.view.getState(n.getSelectionCell())));try{mxEvent.consume(a)}catch(D){}}else c||(n.lastPasteXml=null,n.pasteCounter=0)}catch(D){this.handleError(D)}}}b.innerHTML=" "};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave",
|
|
|
|
|
function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||
|
|
|
|
|
"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types,
|
|
|
|
@ -10367,9 +10367,9 @@ d))}return a};EditorUi.prototype.openFileHandle=function(a,b,c,e,f){if(null!=b&&
|
|
|
|
|
e);try{this.loadLibrary(new LocalLibrary(this,a,b))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,b,e)});if(/(\.v(dx|sdx?))($|\?)/i.test(b)||/(\.vs(x|sx?))($|\?)/i.test(b))this.importVisio(c,mxUtils.bind(this,function(a){this.spinner.stop();d(a)}));else if(/(\.*<graphml )/.test(a))this.importGraphML(a,mxUtils.bind(this,function(a){this.spinner.stop();d(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,
|
|
|
|
|
b))this.parseFile(c,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?d(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(a))/(\.json)$/i.test(b)&&(b=b.substring(0,b.length-5)+".drawio"),this.convertLucidChart(a,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,b,e)}),mxUtils.bind(this,function(a){this.spinner.stop();
|
|
|
|
|
this.handleError(a)}));else if("<mxlibrary"==a.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,e);try{this.loadLibrary(new LocalLibrary(this,a,c.name))}catch(v){this.handleError(v,mxResources.get("errorLoadingFile"))}}else if(0==a.indexOf("PK"))this.importZipFile(c,mxUtils.bind(this,function(a){this.spinner.stop();d(a)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(a,b,e)}));
|
|
|
|
|
else{if("image/png"==c.type.substring(0,9))a=this.extractGraphModelFromPng(a);else if("application/pdf"==c.type){var g=Editor.extractGraphModelFromPdf(a);null!=g&&(a=g)}this.spinner.stop();this.openLocalFile(a,b,e,f,null!=f?c:null)}}};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){try{this.openFileHandle(d.target.result,a.name,
|
|
|
|
|
a,b)}catch(t){this.handleError(t)}});d.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"!==a.type.substring(0,5)&&"application/pdf"!==a.type||"image/svg"===a.type.substring(0,9)?d.readAsText(a):d.readAsDataURL(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c,e,f){var d=this.getCurrentFile(),g=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);
|
|
|
|
|
null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c,e,f))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?g():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=
|
|
|
|
|
else{if("image/png"==c.type.substring(0,9))a=this.extractGraphModelFromPng(a);else if("application/pdf"==c.type){var g=Editor.extractGraphModelFromPdf(a);null!=g&&(f=null,e=!0,a=g)}this.spinner.stop();this.openLocalFile(a,b,e,f,null!=f?c:null)}}};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){try{this.openFileHandle(d.target.result,
|
|
|
|
|
a.name,a,b)}catch(t){this.handleError(t)}});d.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"!==a.type.substring(0,5)&&"application/pdf"!==a.type||"image/svg"===a.type.substring(0,9)?d.readAsText(a):d.readAsDataURL(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c,e,f){var d=this.getCurrentFile(),g=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);
|
|
|
|
|
null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c,e,f))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=e)?g():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=e)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=
|
|
|
|
|
null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,g,mxResources.get("cancel"),mxResources.get("discardChanges")):g()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),
|
|
|
|
|
a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function d(a){if(null!=a){var d=a.lastIndexOf(".");0<d&&(a=a.substring(d+1,a.length));null==b[a]&&(b[a]=!0)}}var c=this.editor.graph,e=c.getCellStyle(a);d(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));c.model.isEdge(a)&&(d(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),d(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=c.model.getChildCount(a),
|
|
|
|
|
f=0;f<e;f++)this.addBasenamesForCell(c.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.ruler&&(this.ruler.hRuler.container.style.visibility=a?"":"hidden",this.ruler.vRuler.container.style.visibility=
|
|
|
|
@ -10404,12 +10404,12 @@ urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMe
|
|
|
|
|
b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),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.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
|
|
|
|
|
a.appendChild(b),c=b);"1"!=urlParams.noExitBtn&&(b=document.createElement("a"),c="1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),mxUtils.write(b,c),b.setAttribute("title",c),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()})),a.appendChild(b),c=b);c.style.marginRight="20px";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.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};
|
|
|
|
|
EditorUi.prototype.executeLayoutList=function(a,b){for(var d=this.editor.graph,c=d.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](d);if(null!=a[e].config)for(var g in a[e].config)f[g]=a[e].config[g];this.executeLayout(function(){f.execute(d.getDefaultParent(),0==c.length?null:c)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var g={},k=null,l=null,n=null,A=null,z=null,B=null,C=null,D=null,F=null,G="",E="auto",
|
|
|
|
|
EditorUi.prototype.executeLayoutList=function(a,b){for(var d=this.editor.graph,c=d.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](d);if(null!=a[e].config)for(var g in a[e].config)f[g]=a[e].config[g];this.executeLayout(function(){f.execute(d.getDefaultParent(),0==c.length?null:c)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var g={},k=null,l=null,n=null,B=null,z=null,A=null,C=null,D=null,F=null,G="",E="auto",
|
|
|
|
|
H="auto",J=null,I=null,K=40,M=40,N=100,U=0,L=this.editor.graph;L.getGraphBounds();for(var T=function(){null!=b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))},Z=L.getFreeInsertPoint(),aa=Z.x,ga=Z.y,Z=ga,Y=null,V="auto",F=null,X=[],fa=null,da=null,O=0;O<c.length&&"#"==c[O].charAt(0);){a=c[O];for(O++;O<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[O].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[O].substring(1)),O++;if("#"!=a.charAt(1)){var W=a.indexOf(":");if(0<
|
|
|
|
|
W){var R=mxUtils.trim(a.substring(1,W)),P=mxUtils.trim(a.substring(W+1));"label"==R?Y=L.sanitizeHtml(P):"labelname"==R&&0<P.length&&"-"!=P?z=P:"labels"==R&&0<P.length&&"-"!=P?B=JSON.parse(P):"style"==R?l=P:"parentstyle"==R?C=P:"stylename"==R&&0<P.length&&"-"!=P?A=P:"styles"==R&&0<P.length&&"-"!=P?n=JSON.parse(P):"vars"==R&&0<P.length&&"-"!=P?k=JSON.parse(P):"identity"==R&&0<P.length&&"-"!=P?D=P:"parent"==R&&0<P.length&&"-"!=P?F=P:"namespace"==R&&0<P.length&&"-"!=P?G=P:"width"==R?E=P:"height"==R?H=
|
|
|
|
|
W){var R=mxUtils.trim(a.substring(1,W)),P=mxUtils.trim(a.substring(W+1));"label"==R?Y=L.sanitizeHtml(P):"labelname"==R&&0<P.length&&"-"!=P?z=P:"labels"==R&&0<P.length&&"-"!=P?A=JSON.parse(P):"style"==R?l=P:"parentstyle"==R?C=P:"stylename"==R&&0<P.length&&"-"!=P?B=P:"styles"==R&&0<P.length&&"-"!=P?n=JSON.parse(P):"vars"==R&&0<P.length&&"-"!=P?k=JSON.parse(P):"identity"==R&&0<P.length&&"-"!=P?D=P:"parent"==R&&0<P.length&&"-"!=P?F=P:"namespace"==R&&0<P.length&&"-"!=P?G=P:"width"==R?E=P:"height"==R?H=
|
|
|
|
|
P:"left"==R&&0<P.length?J=P:"top"==R&&0<P.length?I=P:"ignore"==R?da=P.split(","):"connect"==R?X.push(JSON.parse(P)):"link"==R?fa=P:"padding"==R?U=parseFloat(P):"edgespacing"==R?K=parseFloat(P):"nodespacing"==R?M=parseFloat(P):"levelspacing"==R?N=parseFloat(P):"layout"==R&&(V=P)}}}if(null==c[O])throw Error(mxResources.get("invalidOrMissingFile"));for(var ca=this.editor.csvToArray(c[O]),R=W=null,P=[],S=0;S<ca.length;S++)D==ca[S]&&(W=S),F==ca[S]&&(R=S),P.push(mxUtils.trim(ca[S]).replace(/[^a-z0-9]+/ig,
|
|
|
|
|
"_").replace(/^\d+/,"").replace(/_+$/,""));null==Y&&(Y="%"+P[0]+"%");if(null!=X)for(var ba=0;ba<X.length;ba++)null==g[X[ba].to]&&(g[X[ba].to]={});D=[];for(S=O+1;S<c.length;S++){var ha=this.editor.csvToArray(c[S]);if(null==ha){var ja=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(ja+" ("+S+"):\n"+mxResources.get("containsValidationErrors"));}0<ha.length&&D.push(ha)}L.model.beginUpdate();try{for(S=0;S<D.length;S++){var ha=D[S],Q=null,ka=null!=W?G+ha[W]:null;null!=ka&&(Q=L.model.getCell(ka));
|
|
|
|
|
var c=null!=Q,ea=new mxCell(Y,new mxGeometry(aa,Z,0,0),l||"whiteSpace=wrap;html=1;");ea.vertex=!0;ea.id=ka;for(var ia=0;ia<ha.length;ia++)L.setAttributeForCell(ea,P[ia],ha[ia]);if(null!=z&&null!=B){var ua=B[ea.getAttribute(z)];null!=ua&&L.labelChanged(ea,ua)}if(null!=A&&null!=n){var va=n[ea.getAttribute(A)];null!=va&&(ea.style=va)}L.setAttributeForCell(ea,"placeholders","1");ea.style=L.replacePlaceholders(ea,ea.style,k);c&&(L.model.setGeometry(Q,ea.geometry),L.model.setStyle(Q,ea.style),0>mxUtils.indexOf(e,
|
|
|
|
|
var c=null!=Q,ea=new mxCell(Y,new mxGeometry(aa,Z,0,0),l||"whiteSpace=wrap;html=1;");ea.vertex=!0;ea.id=ka;for(var ia=0;ia<ha.length;ia++)L.setAttributeForCell(ea,P[ia],ha[ia]);if(null!=z&&null!=A){var ua=A[ea.getAttribute(z)];null!=ua&&L.labelChanged(ea,ua)}if(null!=B&&null!=n){var va=n[ea.getAttribute(B)];null!=va&&(ea.style=va)}L.setAttributeForCell(ea,"placeholders","1");ea.style=L.replacePlaceholders(ea,ea.style,k);c&&(L.model.setGeometry(Q,ea.geometry),L.model.setStyle(Q,ea.style),0>mxUtils.indexOf(e,
|
|
|
|
|
Q)&&e.push(Q));Q=ea;if(!c)for(ba=0;ba<X.length;ba++)g[X[ba].to][Q.getAttribute(X[ba].to)]=Q;null!=fa&&"link"!=fa&&(L.setLinkForCell(Q,Q.getAttribute(fa)),L.setAttributeForCell(Q,fa,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[Q]));var wa=this.editor.graph.getPreferredSizeForCell(Q);Q.vertex&&(null!=J&&null!=Q.getAttribute(J)&&(Q.geometry.x=aa+parseFloat(Q.getAttribute(J))),null!=I&&null!=Q.getAttribute(I)&&(Q.geometry.y=ga+parseFloat(Q.getAttribute(I))),"@"==E.charAt(0)&&null!=Q.getAttribute(E.substring(1))?
|
|
|
|
|
Q.geometry.width=parseFloat(Q.getAttribute(E.substring(1))):Q.geometry.width="auto"==E?wa.width+U:parseFloat(E),"@"==H.charAt(0)&&null!=Q.getAttribute(H.substring(1))?Q.geometry.height=parseFloat(Q.getAttribute(H.substring(1))):Q.geometry.height="auto"==H?wa.height+U:parseFloat(H),Z+=Q.geometry.height+M);c?(null==f[ka]&&(f[ka]=[]),f[ka].push(Q)):(F=null!=R?L.model.getCell(G+ha[R]):null,d.push(Q),null!=F?(F.style=L.replacePlaceholders(F,C,k),L.addCell(Q,F)):e.push(L.addCell(Q)))}for(var na=e.slice(),
|
|
|
|
|
la=e.slice(),ba=0;ba<X.length;ba++)for(var xa=X[ba],S=0;S<d.length;S++){var Q=d[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(L.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),e=0;e<d.length;e++){var f=g[c.to][d[e]];if(null!=f){var m=c.label;null!=c.fromlabel&&(m=(b.getAttribute(c.fromlabel)||"")+(m||""));null!=c.tolabel&&(m=(m||"")+(f.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?f:a,l=null!=c.style?L.replacePlaceholders(l,
|
|
|
|
@ -10456,32 +10456,32 @@ function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};
|
|
|
|
|
null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();
|
|
|
|
|
return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language",
|
|
|
|
|
"da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(a,b,c,e,f,g,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(a,b,c,e,f,g,l,n)};EditorUi.prototype.loadFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(a)};EditorUi.prototype.createSvgDataUri=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(a)};EditorUi.prototype.embedCssFonts=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");
|
|
|
|
|
return this.editor.embedCssFonts(a,b)};EditorUi.prototype.embedExtFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(a)};EditorUi.prototype.exportToCanvas=function(a,b,c,e,f,g,l,n,y,x,A,z,B,C,D,F){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(a,b,c,e,f,g,l,n,y,x,A,z,B,C,D,F)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
|
|
|
|
|
return this.editor.embedCssFonts(a,b)};EditorUi.prototype.embedExtFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(a)};EditorUi.prototype.exportToCanvas=function(a,b,c,e,f,g,l,n,y,x,B,z,A,C,D,F){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(a,b,c,e,f,g,l,n,y,x,B,z,A,C,D,F)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
|
|
|
|
|
return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(a,b,c,e)};EditorUi.prototype.convertImageToDataUri=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(a,b)};EditorUi.prototype.base64Encode=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(a)};EditorUi.prototype.updateCRC=
|
|
|
|
|
function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(a,b,c,e)};EditorUi.prototype.crc32=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(a)};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,e,f){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(a,b,c,e,f)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=
|
|
|
|
|
urlParams.forceMigration)return null;for(var a=[],b=0;b<localStorage.length;b++){var c=localStorage.key(b),e=localStorage.getItem(c);if(0<c.length&&(".scratchpad"==c||"."!=c.charAt(0))&&0<e.length){var f="<mxfile "===e.substring(0,8)||"<?xml"===e.substring(0,5)||"\x3c!--[if IE]>"===e.substring(0,12),e="<mxlibrary>"===e.substring(0,11);(f||e)&&a.push(c)}}return a};EditorUi.prototype.getLocalStorageFile=function(a){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;
|
|
|
|
|
var b=localStorage.getItem(a);return{title:a,data:b,isLib:"<mxlibrary>"===b.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
|
|
|
|
|
var CommentsWindow=function(a,c,e,b,g,f){function l(){for(var a=A.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==A&&b++;z.style.display=0==b?"block":"none"}function n(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}v={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
|
|
|
|
|
var CommentsWindow=function(a,c,e,b,g,f){function l(){for(var a=B.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==B&&b++;z.style.display=0==b?"block":"none"}function n(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}v={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
|
|
|
|
|
"geCommentEditTxtArea";k.style.minHeight=f.offsetHeight+"px";k.value=a.content;b.insertBefore(k,f);var m=document.createElement("div");m.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),l()):e();v=null});n.className="geCommentEditBtn";m.appendChild(n);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=k.value;mxUtils.write(f,a.content);e();c(a);v=null});mxEvent.addListener(k,"keydown",mxUtils.bind(this,
|
|
|
|
|
function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";m.appendChild(p);b.insertBefore(m,f);g.style.display="none";f.style.display="none";k.focus()}function d(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
|
|
|
|
|
[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function k(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function m(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,g){function B(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
|
|
|
|
|
"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});G.appendChild(e);d&&(e.style.display="none")}function C(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=x;a(b);return{pdiv:d,replies:c}}function I(c,d,e,g,l){function z(){k(t);b.addReply(v,function(a){v.id=a;b.replies.push(v);p(t);e&&e()},function(b){B();m(t);a.handleError(b,null,
|
|
|
|
|
null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},g,l)}function B(){n(v,t,function(a){z()},!0)}var q=C().pdiv,v=a.newComment(c,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=u(v,b.replies,q,f+1);d?B():z()}if(g||!b.isResolved){z.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",b.id);x.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(x.style.backgroundColor="ghostWhite");
|
|
|
|
|
[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function k(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function m(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,g){function A(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
|
|
|
|
|
"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});G.appendChild(e);d&&(e.style.display="none")}function C(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=x;a(b);return{pdiv:d,replies:c}}function I(c,d,e,g,l){function z(){k(t);b.addReply(v,function(a){v.id=a;b.replies.push(v);p(t);e&&e()},function(b){A();m(t);a.handleError(b,null,
|
|
|
|
|
null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},g,l)}function A(){n(v,t,function(a){z()},!0)}var q=C().pdiv,v=a.newComment(c,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=u(v,b.replies,q,f+1);d?A():z()}if(g||!b.isResolved){z.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",b.id);x.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(x.style.backgroundColor="ghostWhite");
|
|
|
|
|
var y=document.createElement("div");y.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=b.user.pictureUrl||Editor.userImage;y.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";y.appendChild(F);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,b.user.displayName||"");F.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",b.id);d(b,
|
|
|
|
|
K);F.appendChild(K);x.appendChild(y);y=document.createElement("div");y.className="geCommentTxt";mxUtils.write(y,b.content||"");x.appendChild(y);b.isLocked&&(x.style.opacity="0.5");y=document.createElement("div");y.className="geCommentActions";var G=document.createElement("ul");G.className="geCommentActionsList";y.appendChild(G);q||b.isLocked||0!=f&&!t||B(mxResources.get("reply"),function(){I("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||q||b.isLocked||(B(mxResources.get("edit"),
|
|
|
|
|
function(){function c(){n(b,x,function(){k(x);b.editComment(b.content,function(){p(x)},function(b){m(x);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){k(x);b.deleteComment(function(a){if(!0===a){a=x.querySelector(".geCommentTxt");a.innerHTML="";mxUtils.write(a,mxResources.get("msgDeleted"));var d=x.querySelectorAll(".geCommentAction");for(a=
|
|
|
|
|
0;a<d.length;a++)d[a].parentNode.removeChild(d[a]);p(x);x.style.opacity="0.5"}else{d=C(b).replies;for(a=0;a<d.length;a++)A.removeChild(d[a]);for(a=0;a<c.length;a++)if(c[a]==b){c.splice(a,1);break}z.style.display=0==A.getElementsByTagName("div").length?"block":"none"}},function(b){m(x);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));q||b.isLocked||0!=f||B(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=
|
|
|
|
|
K);F.appendChild(K);x.appendChild(y);y=document.createElement("div");y.className="geCommentTxt";mxUtils.write(y,b.content||"");x.appendChild(y);b.isLocked&&(x.style.opacity="0.5");y=document.createElement("div");y.className="geCommentActions";var G=document.createElement("ul");G.className="geCommentActionsList";y.appendChild(G);q||b.isLocked||0!=f&&!t||A(mxResources.get("reply"),function(){I("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||q||b.isLocked||(A(mxResources.get("edit"),
|
|
|
|
|
function(){function c(){n(b,x,function(){k(x);b.editComment(b.content,function(){p(x)},function(b){m(x);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),A(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){k(x);b.deleteComment(function(a){if(!0===a){a=x.querySelector(".geCommentTxt");a.innerHTML="";mxUtils.write(a,mxResources.get("msgDeleted"));var d=x.querySelectorAll(".geCommentAction");for(a=
|
|
|
|
|
0;a<d.length;a++)d[a].parentNode.removeChild(d[a]);p(x);x.style.opacity="0.5"}else{d=C(b).replies;for(a=0;a<d.length;a++)B.removeChild(d[a]);for(a=0;a<c.length;a++)if(c[a]==b){c.splice(a,1);break}z.style.display=0==B.getElementsByTagName("div").length?"block":"none"}},function(b){m(x);a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));q||b.isLocked||0!=f||A(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=
|
|
|
|
|
a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=C(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"),m=0;m<k.length;m++)k[m]!=c.parentNode&&(k[m].style.display=d);D||(e[g].style.display="none")}l()}b.isResolved?I(mxResources.get("reOpened")+": ",!0,c,!1,
|
|
|
|
|
!0):I(mxResources.get("markedAsResolved"),!1,c,!0)});x.appendChild(y);null!=e?A.insertBefore(x,e.nextSibling):A.appendChild(x);for(e=0;null!=b.replies&&e<b.replies.length;e++)y=b.replies[e],y.isResolved=b.isResolved,u(y,b.replies,null,f+1,g);null!=v&&(v.comment.id==b.id?(g=b.content,b.content=v.comment.content,n(b,x,v.saveCallback,v.deleteOnCancel),b.content=g):null==v.comment.id&&v.comment.pCommentId==b.id&&(A.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel)));return x}}var q=
|
|
|
|
|
!a.canComment(),t=a.canReplyToReplies(),v=null,y=document.createElement("div");y.className="geCommentsWin";y.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var x=EditorUi.compactUi?"26px":"30px",A=document.createElement("div");A.className="geCommentsList";A.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;A.style.bottom=parseInt(x)+7+"px";y.appendChild(A);var z=document.createElement("span");z.style.cssText="display:none;padding-top:10px;text-align:center;";
|
|
|
|
|
mxUtils.write(z,mxResources.get("noCommentsFound"));var B=document.createElement("div");B.className="geToolbarContainer geCommentsToolbar";B.style.height=x;B.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(B.style.filter="none");x=document.createElement("a");x.className="geButton";mxClient.IS_QUIRKS&&(x.style.filter="none");if(!q){var C=x.cloneNode();C.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';
|
|
|
|
|
C.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(C,"click",function(b){function c(){n(d,e,function(b){k(e);a.addComment(b,function(a){b.id=a;F.push(b);p(e)},function(b){m(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var d=a.newComment("",a.getCurrentUser()),e=u(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});B.appendChild(C)}C=x.cloneNode();C.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';
|
|
|
|
|
C.setAttribute("title",mxResources.get("showResolved"));var D=!1;"dark"==uiTheme&&(C.style.filter="invert(100%)");mxEvent.addListener(C,"click",function(a){this.className=(D=!D)?"geButton geCheckedBtn":"geButton";G();a.preventDefault();mxEvent.consume(a)});B.appendChild(C);a.commentsRefreshNeeded()&&(C=x.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',C.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(C.style.filter="invert(100%)"),
|
|
|
|
|
mxEvent.addListener(C,"click",function(a){G();a.preventDefault();mxEvent.consume(a)}),B.appendChild(C));a.commentsSaveNeeded()&&(x=x.cloneNode(),x.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',x.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&(x.style.filter="invert(100%)"),mxEvent.addListener(x,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),B.appendChild(x));y.appendChild(B);var F=[],G=mxUtils.bind(this,function(){this.hasError=
|
|
|
|
|
!1;if(null!=v)try{v.div=v.div.cloneNode(!0);var b=v.div.querySelector(".geCommentEditTxtArea"),c=v.div.querySelector(".geCommentEditBtns");v.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(I){a.handleError(I)}A.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";t=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=
|
|
|
|
|
a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});A.innerHTML="";A.appendChild(z);z.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),u(F[a],F,null,0,D);null!=v&&null==v.comment.id&&null==v.comment.pCommentId&&(A.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel))},mxUtils.bind(this,function(a){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
|
|
|
|
|
(a&&a.message?": "+a.message:""));this.hasError=!0})):A.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});G();this.refreshComments=G;B=mxUtils.bind(this,function(){function a(b){var e=c[b.id];if(null!=e)for(d(b,e),e=0;null!=b.replies&&e<b.replies.length;e++)a(b.replies[e])}if(this.window.isVisible()){for(var b=A.querySelectorAll(".geCommentDate"),c={},e=0;e<b.length;e++){var f=b[e];c[f.getAttribute("data-commentId")]=f}for(e=0;e<F.length;e++)a(F[e])}});setInterval(B,6E4);this.refreshCommentsTime=
|
|
|
|
|
B;this.window=new mxWindow(mxResources.get("comments"),y,c,e,b,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,
|
|
|
|
|
!0):I(mxResources.get("markedAsResolved"),!1,c,!0)});x.appendChild(y);null!=e?B.insertBefore(x,e.nextSibling):B.appendChild(x);for(e=0;null!=b.replies&&e<b.replies.length;e++)y=b.replies[e],y.isResolved=b.isResolved,u(y,b.replies,null,f+1,g);null!=v&&(v.comment.id==b.id?(g=b.content,b.content=v.comment.content,n(b,x,v.saveCallback,v.deleteOnCancel),b.content=g):null==v.comment.id&&v.comment.pCommentId==b.id&&(B.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel)));return x}}var q=
|
|
|
|
|
!a.canComment(),t=a.canReplyToReplies(),v=null,y=document.createElement("div");y.className="geCommentsWin";y.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var x=EditorUi.compactUi?"26px":"30px",B=document.createElement("div");B.className="geCommentsList";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;B.style.bottom=parseInt(x)+7+"px";y.appendChild(B);var z=document.createElement("span");z.style.cssText="display:none;padding-top:10px;text-align:center;";
|
|
|
|
|
mxUtils.write(z,mxResources.get("noCommentsFound"));var A=document.createElement("div");A.className="geToolbarContainer geCommentsToolbar";A.style.height=x;A.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";A.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(A.style.filter="none");x=document.createElement("a");x.className="geButton";mxClient.IS_QUIRKS&&(x.style.filter="none");if(!q){var C=x.cloneNode();C.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';
|
|
|
|
|
C.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(C,"click",function(b){function c(){n(d,e,function(b){k(e);a.addComment(b,function(a){b.id=a;F.push(b);p(e)},function(b){m(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var d=a.newComment("",a.getCurrentUser()),e=u(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});A.appendChild(C)}C=x.cloneNode();C.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';
|
|
|
|
|
C.setAttribute("title",mxResources.get("showResolved"));var D=!1;"dark"==uiTheme&&(C.style.filter="invert(100%)");mxEvent.addListener(C,"click",function(a){this.className=(D=!D)?"geButton geCheckedBtn":"geButton";G();a.preventDefault();mxEvent.consume(a)});A.appendChild(C);a.commentsRefreshNeeded()&&(C=x.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',C.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(C.style.filter="invert(100%)"),
|
|
|
|
|
mxEvent.addListener(C,"click",function(a){G();a.preventDefault();mxEvent.consume(a)}),A.appendChild(C));a.commentsSaveNeeded()&&(x=x.cloneNode(),x.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',x.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&(x.style.filter="invert(100%)"),mxEvent.addListener(x,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),A.appendChild(x));y.appendChild(A);var F=[],G=mxUtils.bind(this,function(){this.hasError=
|
|
|
|
|
!1;if(null!=v)try{v.div=v.div.cloneNode(!0);var b=v.div.querySelector(".geCommentEditTxtArea"),c=v.div.querySelector(".geCommentEditBtns");v.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(I){a.handleError(I)}B.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";t=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=
|
|
|
|
|
a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});B.innerHTML="";B.appendChild(z);z.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),u(F[a],F,null,0,D);null!=v&&null==v.comment.id&&null==v.comment.pCommentId&&(B.appendChild(v.div),n(v.comment,v.div,v.saveCallback,v.deleteOnCancel))},mxUtils.bind(this,function(a){B.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+
|
|
|
|
|
(a&&a.message?": "+a.message:""));this.hasError=!0})):B.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});G();this.refreshComments=G;A=mxUtils.bind(this,function(){function a(b){var e=c[b.id];if(null!=e)for(d(b,e),e=0;null!=b.replies&&e<b.replies.length;e++)a(b.replies[e])}if(this.window.isVisible()){for(var b=B.querySelectorAll(".geCommentDate"),c={},e=0;e<b.length;e++){var f=b[e];c[f.getAttribute("data-commentId")]=f}for(e=0;e<F.length;e++)a(F[e])}});setInterval(A,6E4);this.refreshCommentsTime=
|
|
|
|
|
A;this.window=new mxWindow(mxResources.get("comments"),y,c,e,b,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,
|
|
|
|
|
(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var E=mxUtils.bind(this,function(){var a=this.window.getX(),b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",E);this.destroy=function(){mxEvent.removeListener(window,"resize",E);this.window.destroy()}},ConfirmDialog=
|
|
|
|
|
function(a,c,e,b,g,f,l,n,d,k,m){var p=document.createElement("div");p.style.textAlign="center";m=null!=m?m:44;var u=document.createElement("div");u.style.padding="6px";u.style.overflow="auto";u.style.maxHeight=m+"px";u.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(u.style.height="60px");mxUtils.write(u,c);p.appendChild(u);null!=k&&(u=document.createElement("div"),u.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",k),u.appendChild(c),p.appendChild(u));k=document.createElement("div");
|
|
|
|
|
k.style.textAlign="center";k.style.whiteSpace="nowrap";var q=document.createElement("input");q.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(q.checked)});f.className="geBtn";null!=n&&(f.innerHTML=n+"<br>"+f.innerHTML,f.style.paddingBottom="8px",f.style.paddingTop="8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&k.appendChild(f);var t=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=e&&
|
|
|
|
@ -10549,8 +10549,8 @@ DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mx
|
|
|
|
|
DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
|
|
|
|
|
DrawioFileSync.prototype.catchup=function(a,c,e,b){if(null!=a&&(null==b||!b())){var g=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==g)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=c&&c();else if(this.isValidState()){var l=this.file.getDescriptorSecret(a);if(null==l)this.reload(c,e,b);else{var n=0,d=!1,k=mxUtils.bind(this,function(){if(null==b||!b())if(f!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var m=!0,p=window.setTimeout(mxUtils.bind(this,
|
|
|
|
|
function(){m=!1;this.reload(c,e,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(g)+(null!=l?"&secret="+encodeURIComponent(l):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(p);if(m&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=c&&c();else if(this.isValidState()){var l=null,u=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var v=
|
|
|
|
|
JSON.parse(g.getText());if(null!=v&&0<v.length)for(var y=0;y<v.length;y++){var x=this.stringToObject(v[y]);if(x.v>DrawioFileSync.PROTOCOL){d=!0;u=[];break}else if(x.v===DrawioFileSync.PROTOCOL&&null!=x.d)l=x.d.checksum,u.push(x.d.patch);else{d=!0;u=[];break}}}catch(A){u=[],null!=window.console&&"1"==urlParams.test&&console.log(A)}try{0<u.length?(this.file.stats.cacheHits++,this.merge(u,l,a,c,e,b)):n<=this.maxCacheReadyRetries-1&&!d&&401!=g.getStatus()&&503!=g.getStatus()?(n++,this.file.stats.cacheMiss++,
|
|
|
|
|
window.setTimeout(k,(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,e,b))}catch(A){null!=e&&e(A)}}else null!=e&&e()}))}else null!=e&&e()});window.setTimeout(k,this.cacheReadyDelay)}}else null!=e&&e()}};DrawioFileSync.prototype.reload=function(a,c,e,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),e,b)};
|
|
|
|
|
JSON.parse(g.getText());if(null!=v&&0<v.length)for(var y=0;y<v.length;y++){var x=this.stringToObject(v[y]);if(x.v>DrawioFileSync.PROTOCOL){d=!0;u=[];break}else if(x.v===DrawioFileSync.PROTOCOL&&null!=x.d)l=x.d.checksum,u.push(x.d.patch);else{d=!0;u=[];break}}}catch(B){u=[],null!=window.console&&"1"==urlParams.test&&console.log(B)}try{0<u.length?(this.file.stats.cacheHits++,this.merge(u,l,a,c,e,b)):n<=this.maxCacheReadyRetries-1&&!d&&401!=g.getStatus()&&503!=g.getStatus()?(n++,this.file.stats.cacheMiss++,
|
|
|
|
|
window.setTimeout(k,(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,e,b))}catch(B){null!=e&&e(B)}}else null!=e&&e()}))}else null!=e&&e()});window.setTimeout(k,this.cacheReadyDelay)}}else null!=e&&e()}};DrawioFileSync.prototype.reload=function(a,c,e,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),e,b)};
|
|
|
|
|
DrawioFileSync.prototype.merge=function(a,c,e,b,g,f){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var l=this.file.ignorePatches(a),n=this.file.getDescriptorRevisionId(e);if(!l){for(f=0;f<a.length;f++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
|
|
|
|
|
a[f]);var d=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",n,"etag",this.file.getDescriptorEtag(e),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==d,c);if(null!=c&&c!=d){var k=this.ui.hashValue(this.file.getCurrentRevisionId()),m=this.ui.hashValue(n);this.file.checksumError(g,a,"From: "+k+"\nTo: "+m+"\nChecksum: "+c+"\nCurrent: "+d,n,"merge");
|
|
|
|
|
return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),e);this.file.backupPatch=null;null!=b&&b()}catch(q){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=g&&g(q);try{if(this.file.errorReportsEnabled)k=this.ui.hashValue(this.file.getCurrentRevisionId()),m=this.ui.hashValue(n),this.file.sendErrorReport("Error in merge",
|
|
|
|
@ -10653,18 +10653,18 @@ b.substring(0,32)&&(n=b.substring(22),b=window.atob&&!mxClient.IS_SF?atob(n):Bas
|
|
|
|
|
new LocalFile(this.ui,b,a.title,!0):new DriveFile(this.ui,b,a))}}catch(q){if(null!=e)e(q);else throw q;}}),e,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)||/\.pdf$/i.test(a.title),null,null,null,f)}catch(n){if(null!=e)e(n);else throw n;}};
|
|
|
|
|
DriveClient.prototype.saveFile=function(a,c,e,b,g,f,l,n,d){try{var k=0;a.saveLevel=1;var m=mxUtils.bind(this,function(c){if(null!=b)b(c);else throw c;try{if(!a.isConflict(c)){var d="sl_"+a.saveLevel+"-error_"+(a.getErrorMessage(c)||"unknown");null!=c&&null!=c.error&&null!=c.error.code&&(d+="-code_"+c.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?
|
|
|
|
|
"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:d,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(F){}}),p=mxUtils.bind(this,function(a){m(a);try{EditorUi.logError(a.message,null,null,a)}catch(D){}});if(a.isEditable()&&null!=a.desc){var u=(new Date).getTime(),q=a.desc.etag,t=a.desc.modifiedDate,v=a.desc.headRevisionId,y=
|
|
|
|
|
this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());f=null!=f?f:!1;var x=null,A=!1,z={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(z.mimeType))z.mimeType=this.xmlMimeType,x=a.desc,A=c=!0;else if("application/octet-stream"==z.mimeType||"1"==urlParams["override-mime"]&&z.mimeType!=this.xmlMimeType)z.mimeType=this.xmlMimeType;var B=mxUtils.bind(this,function(b,g,B){try{a.saveLevel=3;a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",
|
|
|
|
|
value:Editor.guid(32)}),null==a.getChannelKey()&&n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:null!=d?d:Editor.guid(32)}));B||(null!=b||f||(b=this.placeholderThumbnail,g=this.placeholderMimeType),null!=b&&null!=g&&(z.thumbnail={image:b,mimeType:g}));var C=a.getData(),D=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-u,a.saveLevel=11,null==b)m({message:mxResources.get("errorSavingFile")+": Empty response"});else{var d=(new Date(b.modifiedDate)).getTime()-
|
|
|
|
|
this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());f=null!=f?f:!1;var x=null,B=!1,z={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(z.mimeType))z.mimeType=this.xmlMimeType,x=a.desc,B=c=!0;else if("application/octet-stream"==z.mimeType||"1"==urlParams["override-mime"]&&z.mimeType!=this.xmlMimeType)z.mimeType=this.xmlMimeType;var A=mxUtils.bind(this,function(b,g,A){try{a.saveLevel=3;a.constructor==DriveFile&&(null==n&&(n=[]),null==a.getChannelId()&&n.push({key:"channel",
|
|
|
|
|
value:Editor.guid(32)}),null==a.getChannelKey()&&n.push({key:"key",value:Editor.guid(32)}),n.push({key:"secret",value:null!=d?d:Editor.guid(32)}));A||(null!=b||f||(b=this.placeholderThumbnail,g=this.placeholderMimeType),null!=b&&null!=g&&(z.thumbnail={image:b,mimeType:g}));var C=a.getData(),D=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-u,a.saveLevel=11,null==b)m({message:mxResources.get("errorSavingFile")+": Empty response"});else{var d=(new Date(b.modifiedDate)).getTime()-
|
|
|
|
|
(new Date(t)).getTime();if(0>=d||q==b.etag||c&&v==b.headRevisionId){a.saveLevel=12;var f=[];0>=d&&f.push("invalid modified time");q==b.etag&&f.push("stale etag");c&&v==b.headRevisionId&&f.push("stale revision");var g=f.join(", ");m({message:mxResources.get("errorSavingFile")+": "+g},b);try{EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+v+"."+t+"-"+this.ui.hashValue(q)+"-to-"+b.headRevisionId+"."+b.modifiedDate+"-"+this.ui.hashValue(b.etag)+(0<g.length?"-errors-"+
|
|
|
|
|
g:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(U){}}else if(a.saveLevel=null,e(b,C),null!=x){this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+x.id+"/revisions/"+x.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+"-CONVERT-FILE-"+a.getHash(),action:"from_"+
|
|
|
|
|
x.id+"."+x.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(U){}}}}catch(U){p(U)}}),F=mxUtils.bind(this,function(d,e){a.saveLevel=4;try{null!=n&&(z.properties=n);var f=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),g=mxUtils.bind(this,function(b){a.saveLevel=5;try{var g=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&
|
|
|
|
|
a.desc.mimeType!=this.libraryMimeType,l=!0,n=null;try{n=window.setTimeout(mxUtils.bind(this,function(){l=!1;m({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(a.getId(),z,d,c||b||g,e,b?null:f,A),mxUtils.bind(this,function(a){window.clearTimeout(n);l&&D(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},
|
|
|
|
|
mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==f)if(k<this.staleEtagMaxRetries){k++;var d=2*k*this.coolOff*(1+.1*(Math.random()-.5));window.setTimeout(B,d);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",k,"delay",d)}else{B(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+a.getHash(),action:"rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?
|
|
|
|
|
a.desc.mimeType!=this.libraryMimeType,l=!0,n=null;try{n=window.setTimeout(mxUtils.bind(this,function(){l=!1;m({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(a.getId(),z,d,c||b||g,e,b?null:f,B),mxUtils.bind(this,function(a){window.clearTimeout(n);l&&D(a)}),mxUtils.bind(this,function(b){window.clearTimeout(n);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},
|
|
|
|
|
mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==f)if(k<this.staleEtagMaxRetries){k++;var d=2*k*this.coolOff*(1+.1*(Math.random()-.5));window.setTimeout(A,d);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",k,"delay",d)}else{A(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+a.getHash(),action:"rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?
|
|
|
|
|
"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(fa){}}else"1"==urlParams.test&&c.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed","local",f,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),m(b,c)}catch(fa){p(fa)}}),mxUtils.bind(this,function(){m(b)})):m(b)}catch(V){p(V)}}}))}catch(Y){p(Y)}}),
|
|
|
|
|
B=mxUtils.bind(this,function(b){a.saveLevel=9;if(b||null==f)g(b);else{var c=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){c=!1;m({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(ga){}this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(e){window.clearTimeout(d);if(c){a.saveLevel=10;try{null!=e&&e.headRevisionId==v?("1"==urlParams.test&&f!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",
|
|
|
|
|
A=mxUtils.bind(this,function(b){a.saveLevel=9;if(b||null==f)g(b);else{var c=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){c=!1;m({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(ga){}this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(e){window.clearTimeout(d);if(c){a.saveLevel=10;try{null!=e&&e.headRevisionId==v?("1"==urlParams.test&&f!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",
|
|
|
|
|
f,"to",e.etag,"rev",a.desc.headRevisionId,"response",[e],"file",[a]),f=e.etag,g(b)):m({error:{code:412}},e)}catch(Y){p(Y)}}}),mxUtils.bind(this,function(b){window.clearTimeout(d);c&&(a.saveLevel=11,m(b))}))}});if(y&&null==b){a.saveLevel=8;var q=new Image;q.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/q.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(q.height*a);b.getContext("2d").drawImage(q,0,0,b.width,b.height);var c=b.toDataURL(),c=
|
|
|
|
|
c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");z.thumbnail={image:c,mimeType:"image/png"};B(!1)}catch(ga){try{B(!1)}catch(Y){p(Y)}}});q.src="data:image/png;base64,"+d}else B(!1)}catch(T){p(T)}});if(y){var J=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){F(a,!0)}),m,this.ui.getCurrentFile()!=a?C:null,J.scale,J.border)}else F(C,!1)}catch(I){p(I)}});try{a.saveLevel=2,(f||y||a.constructor==DriveLibrary||!this.enableThumbnails||
|
|
|
|
|
"0"==urlParams.thumb||null!=z.mimeType&&"application/vnd.jgraph.mxfile"!=z.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(F){b=null}B(b,"image/png")}catch(F){p(F)}})))&&B(null,null,a.constructor!=DriveLibrary)}catch(C){p(C)}}else this.ui.editor.graph.reset(),m({message:mxResources.get("readOnly")})}catch(C){p(C)}};
|
|
|
|
|
c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");z.thumbnail={image:c,mimeType:"image/png"};A(!1)}catch(ga){try{A(!1)}catch(Y){p(Y)}}});q.src="data:image/png;base64,"+d}else A(!1)}catch(T){p(T)}});if(y){var J=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){F(a,!0)}),m,this.ui.getCurrentFile()!=a?C:null,J.scale,J.border)}else F(C,!1)}catch(I){p(I)}});try{a.saveLevel=2,(f||y||a.constructor==DriveLibrary||!this.enableThumbnails||
|
|
|
|
|
"0"==urlParams.thumb||null!=z.mimeType&&"application/vnd.jgraph.mxfile"!=z.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(F){b=null}A(b,"image/png")}catch(F){p(F)}})))&&A(null,null,a.constructor!=DriveLibrary)}catch(C){p(C)}}else this.ui.editor.graph.reset(),m({message:mxResources.get("readOnly")})}catch(C){p(C)}};
|
|
|
|
|
DriveClient.prototype.insertFile=function(a,c,e,b,g,f,l){f=null!=f?f:this.xmlMimeType;a={mimeType:f,title:a};null!=e&&(a.parents=[{kind:"drive#fileLink",id:e}]);this.executeRequest(this.createUploadRequest(null,a,c,!1,l),mxUtils.bind(this,function(a){f==this.libraryMimeType?b(new DriveLibrary(this.ui,c,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,c,a))}),g)};
|
|
|
|
|
DriveClient.prototype.createUploadRequest=function(a,c,e,b,g,f,l){g=null!=g?g:!1;var n={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=f&&(n["If-Match"]=f);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:n,params:"\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!=e?g?e:!window.btoa||mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(e):Graph.base64EncodeUnicode(e):"")+"\r\n---------314159265358979323846--"};b||(a.fullUrl+="&newRevision=false");l&&(a.fullUrl+="&pinned=true");return a};
|
|
|
|
@ -10807,18 +10807,18 @@ GitHubClient.prototype.saveFile=function(a,c,e,b,g){var f=a.meta.org,l=a.meta.re
|
|
|
|
|
b)}),e,this.ui.getCurrentFile()!=a?a.getData():null,b.scale,b.border)}else k(a.meta.sha,Base64.encode(a.getData()))});b?this.getSha(f,l,d,n,mxUtils.bind(this,function(b){a.meta.sha=b;m()}),e):m()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
|
|
|
|
|
GitHubClient.prototype.showGitHubDialog=function(a,c){var e=null,b=null,g=null,f=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(n);var d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.border="1px solid lightgray";d.style.boxSizing=
|
|
|
|
|
"border-box";d.style.padding="4px";d.style.overflow="auto";d.style.lineHeight="1.2em";d.style.height="274px";l.appendChild(d);var k=document.createElement("div");k.style.textOverflow="ellipsis";k.style.boxSizing="border-box";k.style.overflow="hidden";k.style.padding="4px";k.style.width="100%";var m=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+f)}));this.ui.showDialog(m.container,420,360,!0,!0);a&&m.okButton.parentNode.removeChild(m.okButton);var p=
|
|
|
|
|
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;A()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
|
|
|
|
|
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,A()):this.ui.hideDialog()}),null,{})}),t=null,v=null,y=mxUtils.bind(this,function(l){null==
|
|
|
|
|
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;B()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
|
|
|
|
|
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,B()):this.ui.hideDialog()}),null,{})}),t=null,v=null,y=mxUtils.bind(this,function(l){null==
|
|
|
|
|
l&&(d.innerHTML="",l=1);var n=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+b+"/contents/"+f+"?ref="+encodeURIComponent(g)+"&per_page=100&page="+l,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));m.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var z=mxUtils.bind(this,
|
|
|
|
|
function(){y(l+1)});mxEvent.addListener(t,"click",z);this.executeRequest(n,mxUtils.bind(this,function(m){this.ui.spinner.stop();1==l&&(u(),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(m.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var z=!0,B=0;m=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,function(m,n){if(l==
|
|
|
|
|
function(){y(l+1)});mxEvent.addListener(t,"click",z);this.executeRequest(n,mxUtils.bind(this,function(m){this.ui.spinner.stop();1==l&&(u(),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(m.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var z=!0,A=0;m=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,function(m,n){if(l==
|
|
|
|
|
("dir"==m.type)){var q=k.cloneNode();q.style.backgroundColor=z?"dark"==uiTheme?"#000000":"#eeeeee":"";z=!z;var v=document.createElement("img");v.src=IMAGE_PATH+"/"+("dir"==m.type?"folder.png":"file.png");v.setAttribute("align","absmiddle");v.style.marginRight="4px";v.style.marginTop="-4px";v.width=20;q.appendChild(v);q.appendChild(p(m.name+("dir"==m.type?"/":""),mxUtils.bind(this,function(){"dir"==m.type?(f=m.path,y()):a&&"file"==m.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+
|
|
|
|
|
m.path))})));d.appendChild(q);B++}})(n[m],m)});m(!0);a&&m(!1)}}),q,!0)}),x=mxUtils.bind(this,function(a,c){null==a&&(d.innerHTML="",a=1);var l=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+b+"/branches?per_page=100&page="+a,null,"GET");m.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor=
|
|
|
|
|
"pointer";mxUtils.write(t,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(t,"click",n);this.executeRequest(l,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else if(1==b.length&&c)g=b[0].name,f="",y();else{for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a,b){var c=
|
|
|
|
|
k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=a.name;f="";y()})));d.appendChild(c)})(b[e],e);100==b.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&n()},mxEvent.addListener(d,"scroll",v))}}),q)}),A=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");m.okButton.setAttribute("disabled",
|
|
|
|
|
"disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&mxEvent.removeListener(d,"scroll",v);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){A(a+1)});mxEvent.addListener(t,"click",l);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(d,
|
|
|
|
|
m.path))})));d.appendChild(q);A++}})(n[m],m)});m(!0);a&&m(!1)}}),q,!0)}),x=mxUtils.bind(this,function(a,c){null==a&&(d.innerHTML="",a=1);var l=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+b+"/branches?per_page=100&page="+a,null,"GET");m.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor=
|
|
|
|
|
"pointer";mxUtils.write(t,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(t,"click",n);this.executeRequest(l,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;B()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else if(1==b.length&&c)g=b[0].name,f="",y();else{for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a,b){var c=
|
|
|
|
|
k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=a.name;f="";y()})));d.appendChild(c)})(b[e],e);100==b.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&n()},mxEvent.addListener(d,"scroll",v))}}),q)}),B=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var c=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");m.okButton.setAttribute("disabled",
|
|
|
|
|
"disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&mxEvent.removeListener(d,"scroll",v);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){B(a+1)});mxEvent.addListener(t,"click",l);this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();c=JSON.parse(c.getText());if(null==c||0==c.length)mxUtils.write(d,
|
|
|
|
|
mxResources.get("noFiles"));else{1==a&&(d.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var c=a.split("/");if(1<c.length){a=c[0];var k=c[1];3>c.length?(e=a,b=k,f=g=null,x()):this.ui.spinner.spin(d,mxResources.get("loading"))&&(c=encodeURIComponent(c.slice(2,c.length).join("/")),this.getFile(a+"/"+k+"/"+c,mxUtils.bind(this,function(a){this.ui.spinner.stop();
|
|
|
|
|
e=a.meta.org;b=a.meta.repo;g=decodeURIComponent(a.meta.ref);f="";y()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d),mxUtils.br(d));for(var m=0;m<c.length;m++)mxUtils.bind(this,function(a,c){var g=k.cloneNode();g.style.backgroundColor=
|
|
|
|
|
0==c%2?"dark"==uiTheme?"#000000":"#eeeeee":"";g.appendChild(p(a.full_name,mxUtils.bind(this,function(){e=a.owner.login;b=a.name;f="";x(null,!0)})));d.appendChild(g)})(c[m],m)}100==c.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&l()},mxEvent.addListener(d,"scroll",v))}),q)});A()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,e){DrawioFile.call(this,a,c);this.meta=e;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
|
|
|
|
|
0==c%2?"dark"==uiTheme?"#000000":"#eeeeee":"";g.appendChild(p(a.full_name,mxUtils.bind(this,function(){e=a.owner.login;b=a.name;f="";x(null,!0)})));d.appendChild(g)})(c[m],m)}100==c.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&l()},mxEvent.addListener(d,"scroll",v))}),q)});B()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,c,e){DrawioFile.call(this,a,c);this.meta=e;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
|
|
|
|
|
TrelloFile.prototype.save=function(a,c,e){this.doSave(this.getTitle(),c,e)};TrelloFile.prototype.saveAs=function(a,c,e){this.doSave(a,c,e)};TrelloFile.prototype.doSave=function(a,c,e){var b=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=b;this.saveFile(a,!1,c,e)}),e])};
|
|
|
|
|
TrelloFile.prototype.saveFile=function(a,c,e,b){this.isEditable()?this.savingFile?null!=b&&(this.saveNeededCounter++,b({code:App.ERROR_BUSY})):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.getTitle()==a?this.ui.trello.saveFile(this,mxUtils.bind(this,function(g){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=g;this.contentChanged();null!=e&&e();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,e,b))}),mxUtils.bind(this,
|
|
|
|
|
function(a){this.savingFile=!1;null!=b&&b(a)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(g){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(f){this.savingFile=!1;null!=e&&e();this.ui.fileLoaded(f);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,c,e,b))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,g)}))):null!=e&&e()};TrelloLibrary=function(a,c,e){TrelloFile.call(this,a,c,e)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,c,e){this.saveFile(a,!1,c,e)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(a){DrawioClient.call(this,a,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e73615c79cf7e381aef91c85936e9553";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";
|
|
|
|
@ -10864,20 +10864,20 @@ this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){k(a.meta.last_commit_id,b)}
|
|
|
|
|
GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)};
|
|
|
|
|
GitLabClient.prototype.showGitLabDialog=function(a,c){var e=null,b=null,g=null,f=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="304px";var n=document.createElement("h3");mxUtils.write(n,mxResources.get(a?"selectFile":"selectFolder"));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(n);var d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.border="1px solid lightgray";d.style.boxSizing=
|
|
|
|
|
"border-box";d.style.padding="4px";d.style.overflow="auto";d.style.lineHeight="1.2em";d.style.height="274px";l.appendChild(d);var k=document.createElement("div");k.style.textOverflow="ellipsis";k.style.boxSizing="border-box";k.style.overflow="hidden";k.style.padding="4px";k.style.width="100%";var m=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){c(e+"/"+b+"/"+encodeURIComponent(g)+"/"+f)}));this.ui.showDialog(m.container,420,360,!0,!0);a&&m.okButton.parentNode.removeChild(m.okButton);var p=
|
|
|
|
|
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;A()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
|
|
|
|
|
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,A()):this.ui.hideDialog()}))}),t=null,v=null,y=mxUtils.bind(this,function(l){null==
|
|
|
|
|
mxUtils.bind(this,function(a,b,c,d){var e=document.createElement("a");e.setAttribute("title",a);e.style.cursor="pointer";mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d&&(e.style.textDecoration="underline");null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(e),e=a);return e}),u=mxUtils.bind(this,function(a){var c=document.createElement("div");c.style.marginBottom="8px";c.appendChild(p(e+"/"+b,mxUtils.bind(this,function(){f=null;B()}),null,!0));a||(mxUtils.write(c," / "),c.appendChild(p(decodeURIComponent(g),
|
|
|
|
|
mxUtils.bind(this,function(){f=null;x()}),null,!0)));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(c," / ");c.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()}),null,!0))})(a)}d.appendChild(c)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=e=null,B()):this.ui.hideDialog()}))}),t=null,v=null,y=mxUtils.bind(this,function(l){null==
|
|
|
|
|
l&&(d.innerHTML="",l=1);var n=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(e+"/"+b)+"/repository/tree?path="+f+"&ref="+g+"&per_page=100&page="+l,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));m.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");
|
|
|
|
|
var z=mxUtils.bind(this,function(){y(l+1)});mxEvent.addListener(t,"click",z);this.executeRequest(n,mxUtils.bind(this,function(m){this.ui.spinner.stop();1==l&&(u(!g),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(m.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var B=!0,q=0;m=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,
|
|
|
|
|
function(m){if(l==("tree"==m.type)){var n=k.cloneNode();n.style.backgroundColor=B?"dark"==uiTheme?"#000000":"#eeeeee":"";B=!B;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==m.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(p(m.name+("tree"==m.type?"/":""),mxUtils.bind(this,function(){"tree"==m.type?(f=m.path,y()):a&&"blob"==m.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+g+
|
|
|
|
|
var z=mxUtils.bind(this,function(){y(l+1)});mxEvent.addListener(t,"click",z);this.executeRequest(n,mxUtils.bind(this,function(m){this.ui.spinner.stop();1==l&&(u(!g),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(m.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var A=!0,q=0;m=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,
|
|
|
|
|
function(m){if(l==("tree"==m.type)){var n=k.cloneNode();n.style.backgroundColor=A?"dark"==uiTheme?"#000000":"#eeeeee":"";A=!A;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==m.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(p(m.name+("tree"==m.type?"/":""),mxUtils.bind(this,function(){"tree"==m.type?(f=m.path,y()):a&&"blob"==m.type&&(this.ui.hideDialog(),c(e+"/"+b+"/"+g+
|
|
|
|
|
"/"+m.path))})));d.appendChild(n);q++}})(n[m])});m(!0);a&&m(!1);100==q&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&z()},mxEvent.addListener(d,"scroll",v))}}),q,!0)}),x=mxUtils.bind(this,function(a,c){null==a&&(d.innerHTML="",a=1);var l=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(e+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");m.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&
|
|
|
|
|
(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(t,"click",n);this.executeRequest(l,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==
|
|
|
|
|
(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var n=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(t,"click",n);this.executeRequest(l,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;B()}),"4px")));b=JSON.parse(b.getText());if(null==
|
|
|
|
|
b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else if(1==b.length&&c)g=b[0].name,f="",y();else{for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a,b){var c=k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=encodeURIComponent(a.name);f="";y()})));d.appendChild(c)})(b[e],e);100==b.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&n()},mxEvent.addListener(d,"scroll",
|
|
|
|
|
v))}}),q)});m.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));var A=mxUtils.bind(this,function(a){this.ui.spinner.stop();null==a&&(d.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){A(a+1)});mxEvent.addListener(t,
|
|
|
|
|
v))}}),q)});m.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));var B=mxUtils.bind(this,function(a){this.ui.spinner.stop();null==a&&(d.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.style.cursor="pointer";mxUtils.write(t,mxResources.get("more")+"...");var c=mxUtils.bind(this,function(){B(a+1)});mxEvent.addListener(t,
|
|
|
|
|
"click",c);var l=mxUtils.bind(this,function(a){this.ui.spinner.spin(d,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),q)}),m=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(d,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();
|
|
|
|
|
b(a,JSON.parse(c.getText()))}),q)});l(mxUtils.bind(this,function(l){var n=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+a,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=l&&0!=l.length){1==a&&(d.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",
|
|
|
|
|
mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(e=a[0],b=a[1],g=f=null,2<a.length?(g=encodeURIComponent(a.slice(2,a.length).join("/")),y()):x(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d),mxUtils.br(d));for(var z=0;z<n.length;z++)mxUtils.bind(this,function(a,c){var g=k.cloneNode();g.style.backgroundColor=
|
|
|
|
|
0==c%2?"dark"==uiTheme?"#000000":"#eeeeee":"";g.appendChild(p(a.name_with_namespace,mxUtils.bind(this,function(){e=a.owner.username;b=a.path;f="";x(null,!0)})));d.appendChild(g)})(n[z],z);for(z=0;z<l.length;z++)m(l[z],mxUtils.bind(this,function(a,c){for(var g=0;g<c.length;g++){var l=k.cloneNode();l.style.backgroundColor=0==idx%2?"dark"==uiTheme?"#000000":"#eeeeee":"";mxUtils.bind(this,function(c){l.appendChild(p(c.name_with_namespace,mxUtils.bind(this,function(){e=a.full_path;b=c.path;f="";x(null,
|
|
|
|
|
!0)})));d.appendChild(l)})(c[g])}}))}else mxUtils.write(d,mxResources.get("noFiles"));100==n.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&c()},mxEvent.addListener(d,"scroll",v))}),q)}))});this.token?this.user?A():this.updateUser(function(){A()},q,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){A()},q,!0)}),q)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,e,b,g,f,l){this.file=a;this.id=c;this.content=e;this.modifiedDate=b;this.createdDate=g;this.isResolved=f;this.user=l;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,e,b,g){c()};DrawioComment.prototype.editComment=function(a,c,e){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,e,b,g,f,l,n){DrawioComment.call(this,a,c,e,b,g,f,l);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,e,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),e)};
|
|
|
|
|
!0)})));d.appendChild(l)})(c[g])}}))}else mxUtils.write(d,mxResources.get("noFiles"));100==n.length&&(d.appendChild(t),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&c()},mxEvent.addListener(d,"scroll",v))}),q)}))});this.token?this.user?B():this.updateUser(function(){B()},q,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){B()},q,!0)}),q)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,c,e,b,g,f,l){this.file=a;this.id=c;this.content=e;this.modifiedDate=b;this.createdDate=g;this.isResolved=f;this.user=l;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,c,e,b,g){c()};DrawioComment.prototype.editComment=function(a,c,e){c()};DrawioComment.prototype.deleteComment=function(a,c){a()};DriveComment=function(a,c,e,b,g,f,l,n){DrawioComment.call(this,a,c,e,b,g,f,l);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,c,e,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){c(a.replyId)}),e)};
|
|
|
|
|
DriveComment.prototype.editComment=function(a,c,e){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},c,e)};
|
|
|
|
|
DriveComment.prototype.deleteComment=function(a,c){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,c)};App=function(a,c,e){EditorUi.call(this,a,c,null!=e?e:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var c={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=
|
|
|
|
|
a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!=a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};
|
|
|
|
@ -10962,8 +10962,8 @@ App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxVie
|
|
|
|
|
App.prototype.getThumbnail=function(a,c){var e=!1;try{var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;c(null)}),this.timeout),f=mxUtils.bind(this,function(a){window.clearTimeout(g);b&&c(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var l=this.editor.graph,n=null!=l.themes&&"darkTheme"==l.defaultThemeName;if(n||null!=this.pages&&this.currentPage!=this.pages[0]){var d=l.getGlobalVariable,l=this.createTemporaryGraph(n?l.getDefaultStylesheet():l.getStylesheet()),k=this.pages[0];
|
|
|
|
|
n&&(l.defaultThemeName="default");l.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:d.apply(this,arguments)};l.getGlobalVariable=d;document.body.appendChild(l.container);l.model.setRoot(k.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(a){try{l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(C){a=null}f(a)}),a,this.thumbImageCache,"#ffffff",function(){f()},
|
|
|
|
|
null,null,null,null,null,null,l),e=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var m=document.createElement("canvas"),p=l.getGraphBounds(),u=a/p.width,u=Math.min(1,Math.min(3*a/(4*p.height),u)),q=Math.floor(p.x),t=Math.floor(p.y);m.setAttribute("width",Math.ceil(u*(p.width+4)));m.setAttribute("height",Math.ceil(u*(p.height+4)));var v=m.getContext("2d");v.scale(u,u);v.translate(-q,-t);var y=l.background;if(null==y||""==y||y==mxConstants.NONE)y="#ffffff";v.save();v.fillStyle=y;v.fillRect(q,
|
|
|
|
|
t,Math.ceil(p.width+4),Math.ceil(p.height+4));v.restore();var x=new mxJsCanvas(m),A=new mxAsyncCanvas(this.thumbImageCache);x.images=this.thumbImageCache.images;var z=new mxImageExport;z.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};z.drawText=function(a,b){};z.drawState(l.getView().getState(l.model.root),A);A.finish(mxUtils.bind(this,function(){try{z.drawState(l.getView().getState(l.model.root),
|
|
|
|
|
x),l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(B){m=null}f(m)}));e=!0}}catch(B){e=!1,null!=l&&l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}return e};
|
|
|
|
|
t,Math.ceil(p.width+4),Math.ceil(p.height+4));v.restore();var x=new mxJsCanvas(m),B=new mxAsyncCanvas(this.thumbImageCache);x.images=this.thumbImageCache.images;var z=new mxImageExport;z.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};z.drawText=function(a,b){};z.drawState(l.getView().getState(l.model.root),B);B.finish(mxUtils.bind(this,function(){try{z.drawState(l.getView().getState(l.model.root),
|
|
|
|
|
x),l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(A){m=null}f(m)}));e=!0}}catch(A){e=!1,null!=l&&l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}return e};
|
|
|
|
|
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
|
|
|
|
|
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(c,e){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var b=this.getCurrentFile();c=null!=b?b.getMode():c;c==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):c==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),
|
|
|
|
|
this.appIcon.style.cursor="pointer"):c==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=c==App.MODE_DEVICE?"pointer":"default")}if(e)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var g=new Date;g.setYear(g.getFullYear()+1);document.cookie="MODE="+c+"; expires="+g.toUTCString()}}catch(f){}}})();
|
|
|
|
@ -11002,8 +11002,8 @@ EditorUi.isElectronApp||this.isOfflineApp()||mxClient.IS_ANDROID||mxClient.IS_IO
|
|
|
|
|
App.prototype.addLanguageMenu=function(a,c){var e=null;if(null!=this.menus.get("language")){e=document.createElement("div");e.setAttribute("title",mxResources.get("language"));e.className="geIcon geSprite geSprite-globe";e.style.position="absolute";e.style.cursor="pointer";e.style.bottom="20px";e.style.right="20px";if(c){e.style.direction="rtl";e.style.textAlign="right";e.style.right="24px";var b=document.createElement("span");b.style.display="inline-block";b.style.fontSize="12px";b.style.margin=
|
|
|
|
|
"5px 24px 0 0";b.style.color="gray";b.style.userSelect="none";mxUtils.write(b,mxResources.get("language"));e.appendChild(b)}mxEvent.addListener(e,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var c=mxUtils.getOffset(e);
|
|
|
|
|
b.popup(c.x,c.y+e.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(e)}return e};
|
|
|
|
|
App.prototype.loadFileSystemEntry=function(a,c,e){e=null!=e?e:mxUtils.bind(this,function(a){this.handleError(a)});try{a.getFile().then(mxUtils.bind(this,function(b){var g=new FileReader;g.onload=mxUtils.bind(this,function(f){try{if(null!=c){var g=f.target.result;"image/"==b.type.substring(0,6)&&(g=this.extractGraphModelFromPng(g));c(new LocalFile(this,g,b.name,null,a,b))}else this.openFileHandle(f.target.result,b.name,b,!1,a)}catch(n){e(n)}});g.onerror=e;"image"!==b.type.substring(0,5)&&"application/pdf"!==
|
|
|
|
|
b.type||"image/svg"===b.type.substring(0,9)?g.readAsText(b):g.readAsDataURL(b)}),e)}catch(b){e(b)}};
|
|
|
|
|
App.prototype.loadFileSystemEntry=function(a,c,e){e=null!=e?e:mxUtils.bind(this,function(a){this.handleError(a)});try{a.getFile().then(mxUtils.bind(this,function(b){var g=new FileReader;g.onload=mxUtils.bind(this,function(f){try{if(null!=c){var g=f.target.result;"image/png"==b.type&&(g=this.extractGraphModelFromPng(g));c(new LocalFile(this,g,b.name,null,a,b))}else this.openFileHandle(f.target.result,b.name,b,!1,a)}catch(n){e(n)}});g.onerror=e;"image"!==b.type.substring(0,5)&&"application/pdf"!==b.type||
|
|
|
|
|
"image/svg"===b.type.substring(0,9)?g.readAsText(b):g.readAsDataURL(b)}),e)}catch(b){e(b)}};
|
|
|
|
|
App.prototype.createFileSystemOptions=function(a){var c=[],e=null;if(null!=a){var b=a.lastIndexOf(".");0<b&&(e=a.substring(b+1))}for(b=0;b<this.editor.diagramFileTypes.length;b++){var g={description:mxResources.get(this.editor.diagramFileTypes[b].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[b].extension+")":""),accept:{}};g.accept[this.editor.diagramFileTypes[b].mimeType]=["."+this.editor.diagramFileTypes[b].extension];this.editor.diagramFileTypes[b].extension==e?c.splice(0,0,
|
|
|
|
|
g):this.editor.diagramFileTypes[b].extension==e?c.splice(0,0,g):c.push(g)}return{types:c,fileName:a}};App.prototype.showSaveFilePicker=function(a,c,e){c=null!=c?c:mxUtils.bind(this,function(a){"AbortError"!=a.name&&this.handleError(a)});e=null!=e?e:this.createFileSystemOptions();window.showSaveFilePicker(e).then(mxUtils.bind(this,function(b){null!=b&&b.getFile().then(mxUtils.bind(this,function(c){a(b,c)}),c)}),c)};
|
|
|
|
|
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&&"showOpenFilePicker"in window)window.showOpenFilePicker().then(mxUtils.bind(this,function(a){null!=a&&0<a.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(a[0])}),
|
|
|
|
@ -11202,7 +11202,7 @@ mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,n
|
|
|
|
|
c):("download"==d&&(d=App.MODE_GOOGLE),null!=c&&0<c.length&&(d==App.MODE_GOOGLE?b.spinner.spin(document.body,mxResources.get("saving"))&&a.saveAs(c,mxUtils.bind(this,function(c){a.desc=c;a.save(!1,mxUtils.bind(this,function(){b.spinner.stop();a.setModified(!1);a.addAllSavedStatus()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),mxUtils.bind(this,function(a){b.handleError(a)})):b.createFile(c,b.getFileData(!0),null,d)))}),mxUtils.bind(this,function(){b.hideDialog()}),mxResources.get("makeCopy"),
|
|
|
|
|
mxResources.get("create"),null,null,!0,null,!0,null,null,null,null,b.editor.fileExtensions),b.showDialog(c.container,420,380,!0,!0),c.init()):b.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));b.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var a=b.getCurrentFile();if(a.getMode()==App.MODE_GOOGLE||a.getMode()==App.MODE_ONEDRIVE){var c=!1;if(a.getMode()==App.MODE_GOOGLE&&null!=a.desc.parents)for(var d=0;d<a.desc.parents.length;d++)if(a.desc.parents[d].isRoot){c=!0;break}b.pickFolder(a.getMode(),
|
|
|
|
|
mxUtils.bind(this,function(c){b.spinner.spin(document.body,mxResources.get("moving"))&&a.move(c,mxUtils.bind(this,function(a){b.spinner.stop()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));b.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+
|
|
|
|
|
"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&a.share()}catch(B){b.handleError(B)}}));this.put("embed",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||
|
|
|
|
|
"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&a.share()}catch(A){b.handleError(A)}}));this.put("embed",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||
|
|
|
|
|
b.isOffline()||this.addMenuItems(a,["embedIframe"],c);"1"==urlParams.embed||b.isOffline()||this.addMenuItems(a,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),c)})));var v=function(a,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!b.isOffline())&&a.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e||"mermaid"==e){var a=new ParseDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);b.dialog.container.style.overflow="auto"}else a=
|
|
|
|
|
new CreateGraphDialog(b,d,e),b.showDialog(a.container,620,420,!0,!1);a.init()}),c,null,f())},y=function(a,c,d,e){var f=new mxCell(a,new mxGeometry(0,0,c,d),e);f.vertex=!0;a=g.getCenterInsertPoint(g.getBoundingBoxFromGeometry([f],!0));f.geometry.x=a.x;f.geometry.y=a.y;g.getModel().beginUpdate();try{f=g.addCell(f),g.fireEvent(new mxEventObject("cellsInserted","cells",[f]))}finally{g.getModel().endUpdate()}g.scrollCellToVisible(f);g.setSelectionCell(f);g.container.focus();g.editAfterInsert&&g.startEditing(f);
|
|
|
|
|
window.setTimeout(function(){null!=b.hoverIcons&&b.hoverIcons.update(g.view.getState(f))},0);return f};b.actions.put("insertText",new Action(mxResources.get("text"),function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&g.startEditingAtCell(y("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;b.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),
|
|
|
|
@ -11224,8 +11224,8 @@ c);null!=b.gitLab&&a.addItem(mxResources.get("gitlab")+"...",null,function(){b.s
|
|
|
|
|
a;b.editor.isCorsEnabledForUrl(a)||(c=PROXY_URL+"?url="+encodeURIComponent(a));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){b.spinner.stop();try{b.loadLibrary(new UrlLibrary(this,c.getText(),a))}catch(E){b.handleError(E,mxResources.get("errorLoadingFile"))}}else b.spinner.stop(),b.handleError(null,mxResources.get("errorLoadingFile"))},function(){b.spinner.stop();b.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));b.showDialog(a.container,300,
|
|
|
|
|
80,!0,!0);a.init()},c));"1"==urlParams.confLib&&(a.addSeparator(c),a.addItem(mxResources.get("confluenceCloud")+"...",null,function(){b.showRemotelyStoredLibrary(mxResources.get("libraries"))},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["undo","redo","-","cut","copy"]);EditorUi.isElectronApp&&this.addMenuItems(a,["copyAsImage"]);this.addMenuItems(a,"paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));
|
|
|
|
|
m=b.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(b,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("comments"));else{var a=!this.commentsWindow.window.isVisible();
|
|
|
|
|
this.commentsWindow.window.setVisible(a);this.commentsWindow.refreshCommentsTime();a&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));b.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var m=this.get("viewPanels"),A=m.funct;m.funct=
|
|
|
|
|
function(a,c){A.apply(this,arguments);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(b.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(a,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(a,"scratchpad",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,
|
|
|
|
|
this.commentsWindow.window.setVisible(a);this.commentsWindow.refreshCommentsTime();a&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));b.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var m=this.get("viewPanels"),B=m.funct;m.funct=
|
|
|
|
|
function(a,c){B.apply(this,arguments);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(b.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(a,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(a,"scratchpad",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,
|
|
|
|
|
"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(a,["shapes","-","pageView","pageScale"]);this.addSubmenu("units",a,c);this.addMenuItems(a,"- scrollbars tooltips ruler - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(a,"shadowVisible",c);this.addMenuItems(a,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=
|
|
|
|
|
urlParams.embed&&(this.addSubmenu("theme",a,c),a.addSeparator(c));if("undefined"!==typeof MathJax){var d=this.addMenuItem(a,"mathematicalTypesetting",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}this.addMenuItems(a,["copyConnect","collapseExpand","-"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(a,["showStartScreen"],c);"1"!=urlParams.embed&&this.addMenuItems(a,
|
|
|
|
|
["autosave"],c);a.addSeparator(c);!b.isOfflineApp()&&isLocalStorage&&this.addMenuItem(a,"plugins",c);this.addMenuItems(a,["tags","-","editDiagram"],c);Graph.translateDiagram&&this.addMenuItems(a,["diagramLanguage"]);this.addMenuItems(a,["-","configuration"],c);a.addSeparator(c);"1"==urlParams.newTempDlg&&(b.actions.addAction("templates",function(){var a=new TemplatesDialog;b.showDialog(a.container,a.width,a.height,!0,!1,null,!1,!0);a.init(b,function(a){console.log(a)},null,null,null,"user",function(a,
|
|
|
|
@ -11329,11 +11329,11 @@ var q=this,t=q.editor.graph,v=t.getModel(),y=q.menus.createPopupMenu;q.menus.cre
|
|
|
|
|
q.actions.addAction("selectChildren",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+X");q.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=t.getOutgoingEdges(t.model.getTerminal(a[0],!0)),null!=a)){for(var b=
|
|
|
|
|
[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+S");q.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");q.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 x=t.removeCells;t.removeCells=function(b,c){c=null!=c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];t.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=t.getIncomingEdges(b[f]),
|
|
|
|
|
b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return x.apply(this,arguments)};q.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var A=t.duplicateCells;t.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=A.call(this,
|
|
|
|
|
b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return x.apply(this,arguments)};q.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var B=t.duplicateCells;t.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=B.call(this,
|
|
|
|
|
b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=t.getIncomingEdges(k[e]),g=t.getIncomingEdges(b[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 z=t.moveCells;t.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(a(b[p])||
|
|
|
|
|
t.model.isEdge(b[p])&&null==t.model.getTerminal(b[p],!0)){f=t.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var q=t.getIncomingEdges(b[0]);if(0<q.length){var v=t.view.getState(t.model.getTerminal(q[0],!0));if(null!=v){var u=t.view.getState(m);null!=u&&(c=(u.getCenterX()-v.getCenterX())/t.view.scale,d=(u.getCenterY()-v.getCenterY())/t.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(p=0;p<l.length;p++)if(this.model.isEdge(l[p]))a(m)&&
|
|
|
|
|
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(q=t.getIncomingEdges(b[p]),0<q.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],m,!0);else if(0==t.getIncomingEdges(l[p]).length){n=m;if(null==n||n==t.model.getParent(b[p]))n=t.model.getTerminal(q[0],!0);e=this.cloneCell(q[0]);this.addEdge(e,t.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=q.sidebar){var B=q.sidebar.dropAndConnect;
|
|
|
|
|
q.sidebar.dropAndConnect=function(b,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=B.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:q.actions.get("selectChildren"),84:q.actions.get("selectSubtree"),80:q.actions.get("selectParent"),83:q.actions.get("selectSiblings")},D=
|
|
|
|
|
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(q=t.getIncomingEdges(b[p]),0<q.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],m,!0);else if(0==t.getIncomingEdges(l[p]).length){n=m;if(null==n||n==t.model.getParent(b[p]))n=t.model.getTerminal(q[0],!0);e=this.cloneCell(q[0]);this.addEdge(e,t.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=q.sidebar){var A=q.sidebar.dropAndConnect;
|
|
|
|
|
q.sidebar.dropAndConnect=function(b,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=A.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:q.actions.get("selectChildren"),84:q.actions.get("selectSubtree"),80:q.actions.get("selectParent"),83:q.actions.get("selectSiblings")},D=
|
|
|
|
|
q.onKeyDown;q.onKeyDown=function(b){try{if(t.isEnabled()&&!t.isEditing()&&a(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==b.which?c=mxEvent.isShiftDown(b)?k(t.getSelectionCell()):m(t.getSelectionCell()):13==b.which&&(c=d(t.getSelectionCell(),!mxEvent.isShiftDown(b))));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!=q.hoverIcons&&q.hoverIcons.update(t.view.getState(t.getSelectionCell())),
|
|
|
|
|
t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var e=C[b.keyCode];null!=e&&(e.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(u(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
|
|
|
|
|
mxEvent.consume(b))}}catch(N){q.handleError(N)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var F=t.connectVertex;t.connectVertex=function(b,c,e,f,g,l,p){var q=t.getIncomingEdges(b);if(a(b)){var v=n(b),u=v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST,x=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return v==c||0==q.length?m(b,c):u==x?k(b):d(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return F.apply(this,arguments)};t.getSubtree=function(b){var d=
|
|
|
|
@ -11417,13 +11417,13 @@ l.menus.get("viewZoom");if(null!=J){this.tabContainer.style.right="70px";var I=q
|
|
|
|
|
"none";I.style.right="0px";I.style.bottom="0px";I.style.overflow="hidden";I.style.visibility="hidden";I.style.textAlign="center";I.style.color="#000";I.style.fontSize="12px";I.style.color="#707070";I.style.width="59px";I.style.cursor="pointer";I.style.borderTop="1px solid lightgray";I.style.borderLeft="1px solid lightgray";I.style.height=parseInt(l.tabContainerHeight)-1+"px";I.style.lineHeight=parseInt(l.tabContainerHeight)+1+"px";H.appendChild(I);J=mxUtils.bind(this,function(){I.innerHTML=Math.round(100*
|
|
|
|
|
l.editor.graph.view.scale)+"%"});l.editor.graph.view.addListener(mxEvent.EVENT_SCALE,J);l.editor.addListener("resetGraphView",J);l.editor.addListener("pageSelected",J);var K=l.setGraphEnabled;l.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(I.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}H.appendChild(l.tabContainer);H.appendChild(n);H.appendChild(l.diagramContainer);
|
|
|
|
|
k.appendChild(H);l.updateTabContainer();var M=null;g();mxEvent.addListener(window,"resize",function(){g();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.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,e,l){var f=c.y,d=c.x,g=!1,m=!1;if(null!=this.states&&null!=b&&null!=c){var p=this,u=new mxCellState,q=this.graph.getView().scale,t=Math.max(2,this.getGuideTolerance()/2);u.x=b.x+d;u.y=b.y+f;u.width=b.width;u.height=b.height;for(var v=[],y=[],x=0;x<this.states.length;x++){var A=this.states[x];A instanceof mxCellState&&(l||!this.graph.isCellSelected(A.cell))&&((u.x>=A.x&&u.x<=A.x+A.width||A.x>=u.x&&A.x<=u.x+u.width)&&(u.y>
|
|
|
|
|
A.y+A.height+4||u.y+u.height+4<A.y)?v.push(A):(u.y>=A.y&&u.y<=A.y+A.height||A.y>=u.y&&A.y<=u.y+u.height)&&(u.x>A.x+A.width+4||u.x+u.width+4<A.x)&&y.push(A))}var z=0,B=0,C=A=0,D=0,F=0,G=0,E=0,H=5*q;if(1<v.length){v.push(u);v.sort(function(a,b){return a.y-b.y});var J=!1,x=u==v[0],q=u==v[v.length-1];if(!x&&!q)for(x=1;x<v.length-1;x++)if(u==v[x]){q=v[x-1];x=v[x+1];A=B=C=(x.y-q.y-q.height-u.height)/2;break}for(x=0;x<v.length-1;x++){var q=v[x],I=v[x+1],K=u==q||u==I,I=I.y-q.y-q.height,J=J|u==q;if(0==B&&
|
|
|
|
|
0==z)B=I,z=1;else if(Math.abs(B-I)<=(K||1==x&&J?t:0))z+=1;else if(1<z&&J){v=v.slice(0,x+1);break}else if(3<=v.length-x&&!J)z=0,A=B=0!=C?C:0,v.splice(0,0==x?1:x),x=-1;else break;0!=A||K||(B=A=I)}3==v.length&&v[1]==u&&(A=0)}if(1<y.length){y.push(u);y.sort(function(a,b){return a.x-b.x});J=!1;x=u==y[0];q=u==y[y.length-1];if(!x&&!q)for(x=1;x<y.length-1;x++)if(u==y[x]){q=y[x-1];x=y[x+1];G=F=E=(x.x-q.x-q.width-u.width)/2;break}for(x=0;x<y.length-1;x++){q=y[x];I=y[x+1];K=u==q||u==I;I=I.x-q.x-q.width;J|=u==
|
|
|
|
|
(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,e,l){var f=c.y,d=c.x,g=!1,m=!1;if(null!=this.states&&null!=b&&null!=c){var p=this,u=new mxCellState,q=this.graph.getView().scale,t=Math.max(2,this.getGuideTolerance()/2);u.x=b.x+d;u.y=b.y+f;u.width=b.width;u.height=b.height;for(var v=[],y=[],x=0;x<this.states.length;x++){var B=this.states[x];B instanceof mxCellState&&(l||!this.graph.isCellSelected(B.cell))&&((u.x>=B.x&&u.x<=B.x+B.width||B.x>=u.x&&B.x<=u.x+u.width)&&(u.y>
|
|
|
|
|
B.y+B.height+4||u.y+u.height+4<B.y)?v.push(B):(u.y>=B.y&&u.y<=B.y+B.height||B.y>=u.y&&B.y<=u.y+u.height)&&(u.x>B.x+B.width+4||u.x+u.width+4<B.x)&&y.push(B))}var z=0,A=0,C=B=0,D=0,F=0,G=0,E=0,H=5*q;if(1<v.length){v.push(u);v.sort(function(a,b){return a.y-b.y});var J=!1,x=u==v[0],q=u==v[v.length-1];if(!x&&!q)for(x=1;x<v.length-1;x++)if(u==v[x]){q=v[x-1];x=v[x+1];B=A=C=(x.y-q.y-q.height-u.height)/2;break}for(x=0;x<v.length-1;x++){var q=v[x],I=v[x+1],K=u==q||u==I,I=I.y-q.y-q.height,J=J|u==q;if(0==A&&
|
|
|
|
|
0==z)A=I,z=1;else if(Math.abs(A-I)<=(K||1==x&&J?t:0))z+=1;else if(1<z&&J){v=v.slice(0,x+1);break}else if(3<=v.length-x&&!J)z=0,B=A=0!=C?C:0,v.splice(0,0==x?1:x),x=-1;else break;0!=B||K||(A=B=I)}3==v.length&&v[1]==u&&(B=0)}if(1<y.length){y.push(u);y.sort(function(a,b){return a.x-b.x});J=!1;x=u==y[0];q=u==y[y.length-1];if(!x&&!q)for(x=1;x<y.length-1;x++)if(u==y[x]){q=y[x-1];x=y[x+1];G=F=E=(x.x-q.x-q.width-u.width)/2;break}for(x=0;x<y.length-1;x++){q=y[x];I=y[x+1];K=u==q||u==I;I=I.x-q.x-q.width;J|=u==
|
|
|
|
|
q;if(0==F&&0==D)F=I,D=1;else if(Math.abs(F-I)<=(K||1==x&&J?t:0))D+=1;else if(1<D&&J){y=y.slice(0,x+1);break}else if(3<=y.length-x&&!J)D=0,G=F=0!=E?E:0,y.splice(0,0==x?1:x),x=-1;else break;0!=G||K||(F=G=I)}3==y.length&&y[1]==u&&(G=0)}t=function(a,b,c,d){var e=[],f;d?(d=H,f=0):(d=0,f=H);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(p.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=p.guidesArrHor)for(var c=0;c<p.guidesArrHor.length;c++)p.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=p.guidesArrVer)for(c=0;c<p.guidesArrVer.length;c++)p.guidesArrVer[c].node.style.visibility="hidden"};if(1<D&&D==y.length-1){D=[];E=p.guidesArrHor;g=[];d=0;x=y[0]==u?1:0;J=y[x].y+y[x].height;if(0<G)for(x=0;x<y.length-1;x++)q=
|
|
|
|
|
y[x],I=y[x+1],u==q?(d=I.x-q.width-G,g.push(new mxPoint(d+q.width+H,J)),g.push(new mxPoint(I.x-H,J))):u==I?(g.push(new mxPoint(q.x+q.width+H,J)),d=q.x+q.width+G,g.push(new mxPoint(d-H,J))):(g.push(new mxPoint(q.x+q.width+H,J)),g.push(new mxPoint(I.x-H,J)));else q=y[0],x=y[2],d=q.x+q.width+(x.x-q.x-q.width-u.width)/2,g.push(new mxPoint(q.x+q.width+H,J)),g.push(new mxPoint(d-H,J)),g.push(new mxPoint(d+u.width+H,J)),g.push(new mxPoint(x.x-H,J));for(x=0;x<g.length;x+=2)y=g[x],G=g[x+1],y=t(y,G,null!=E?
|
|
|
|
|
E[x/2]:null),y.node.style.visibility="visible",y.redraw(),D.push(y);for(x=g.length/2;null!=E&&x<E.length;x++)E[x].destroy();p.guidesArrHor=D;d-=b.x;g=!0}else F(!0);if(1<z&&z==v.length-1){D=[];E=p.guidesArrVer;m=[];f=0;x=v[0]==u?1:0;z=v[x].x+v[x].width;if(0<A)for(x=0;x<v.length-1;x++)q=v[x],I=v[x+1],u==q?(f=I.y-q.height-A,m.push(new mxPoint(z,f+q.height+H)),m.push(new mxPoint(z,I.y-H))):u==I?(m.push(new mxPoint(z,q.y+q.height+H)),f=q.y+q.height+A,m.push(new mxPoint(z,f-H))):(m.push(new mxPoint(z,q.y+
|
|
|
|
|
E[x/2]:null),y.node.style.visibility="visible",y.redraw(),D.push(y);for(x=g.length/2;null!=E&&x<E.length;x++)E[x].destroy();p.guidesArrHor=D;d-=b.x;g=!0}else F(!0);if(1<z&&z==v.length-1){D=[];E=p.guidesArrVer;m=[];f=0;x=v[0]==u?1:0;z=v[x].x+v[x].width;if(0<B)for(x=0;x<v.length-1;x++)q=v[x],I=v[x+1],u==q?(f=I.y-q.height-B,m.push(new mxPoint(z,f+q.height+H)),m.push(new mxPoint(z,I.y-H))):u==I?(m.push(new mxPoint(z,q.y+q.height+H)),f=q.y+q.height+B,m.push(new mxPoint(z,f-H))):(m.push(new mxPoint(z,q.y+
|
|
|
|
|
q.height+H)),m.push(new mxPoint(z,I.y-H)));else q=v[0],x=v[2],f=q.y+q.height+(x.y-q.y-q.height-u.height)/2,m.push(new mxPoint(z,q.y+q.height+H)),m.push(new mxPoint(z,f-H)),m.push(new mxPoint(z,f+u.height+H)),m.push(new mxPoint(z,x.y-H));for(x=0;x<m.length;x+=2)y=m[x],G=m[x+1],y=t(y,G,null!=E?E[x/2]:null,!0),y.node.style.visibility="visible",y.redraw(),D.push(y);for(x=m.length/2;null!=E&&x<E.length;x++)E[x].destroy();p.guidesArrVer=D;f-=b.y;m=!0}else F(!1,!0)}if(g||m)return u=new mxPoint(d,f),v=a.call(this,
|
|
|
|
|
b,u,e,l),g&&!m?u.y=v.y:m&&!g&&(u.x=v.x),v.y!=u.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),v.x!=u.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),u;F(!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,e=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
|
|
|
|
|
e)for(l=0;l<e.length;l++)e[l].node.style.visibility=a?"visible":"hidden"};var e=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){e.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var f=0;f<a.length;f++)a[f].destroy();this.guidesArrVer=null}if(null!=c){for(f=0;f<c.length;f++)c[f].destroy();this.guidesArrHor=null}}})();function mxRuler(a,c,e,b){function g(){var b=a.diagramContainer;p.style.top=b.offsetTop-d+"px";p.style.left=b.offsetLeft-d+"px";p.style.width=(e?0:b.offsetWidth)+d+"px";p.style.height=(e?b.offsetHeight:0)+d+"px"}function f(a,b,c){if(null!=l)return a;var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,
|
|
|
|
@ -11431,12 +11431,12 @@ n=window.cancelAnimationFrame||window.mozCancelAnimationFrame,d=this.RULER_THICK
|
|
|
|
|
m.strokeClr;p.style.borderLeft="0.5px solid "+m.strokeClr;document.body.appendChild(p);mxEvent.disableContextMenu(p);this.editorUiRefresh=a.refresh;a.refresh=function(b){k.editorUiRefresh.apply(a,arguments);g()};g();var u=document.createElement("canvas");u.width=p.offsetWidth;u.height=p.offsetHeight;p.style.overflow="hidden";u.style.position="relative";p.appendChild(u);var q=u.getContext("2d");this.ui=a;var t=a.editor.graph;this.graph=t;this.container=p;this.canvas=u;var v=function(a,b,c,d,f){a=Math.round(a);
|
|
|
|
|
b=Math.round(b);c=Math.round(c);d=Math.round(d);q.beginPath();q.moveTo(a+.5,b+.5);q.lineTo(c+.5,d+.5);q.stroke();f&&(e?(q.save(),q.translate(a,b),q.rotate(-Math.PI/2),q.fillText(f,0,0),q.restore()):q.fillText(f,a,b))},y=function(){q.clearRect(0,0,u.width,u.height);q.beginPath();q.lineWidth=.7;q.strokeStyle=m.strokeClr;q.setLineDash([]);q.font="9px Arial";q.textAlign="center";var a=t.view.scale,b=t.view.getBackgroundPageBounds(),c=t.view.translate,f=t.pageVisible,c=f?d+(e?b.y-t.container.scrollTop:
|
|
|
|
|
b.x-t.container.scrollLeft):d+(e?c.y*a-t.container.scrollTop:c.x*a-t.container.scrollLeft),g=0;f&&(g=t.getPageLayout(),g=e?g.y*t.pageFormat.height:g.x*t.pageFormat.width);var l,n,p;switch(k.unit){case mxConstants.POINTS:l=p=10;n=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:p=10;l=mxConstants.PIXELS_PER_MM;n=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:p=.5>=a||4<=a?8:16,l=mxConstants.PIXELS_PER_INCH/p,n=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var x=l;2<=a?x=l/(2*Math.floor(a/2)):.5>=
|
|
|
|
|
a&&(x=l*Math.floor(1/a/2)*(k.unit==mxConstants.MILLIMETERS?2:1));l=null;b=f?Math.min(c+(e?b.height:b.width),e?u.height:u.width):e?u.height:u.width;if(f)if(q.fillStyle=m.outBkgClr,e){var y=c-d;0<y&&q.fillRect(0,d,d,y);b<u.height&&q.fillRect(0,b,d,u.height)}else y=c-d,0<y&&q.fillRect(d,0,y,d),b<u.width&&q.fillRect(b,0,u.width,d);q.fillStyle=m.fontClr;for(f=f?c:c%(x*a);f<=b;f+=x*a)if(y=Math.round((f-c)/a/x),!(f<d||y==l)){l=y;var A=null;0==y%p&&(A=k.formatText(g+y*x)+"");e?v(d-n[Math.abs(y)%p],f,d,f,
|
|
|
|
|
A):v(f,d-n[Math.abs(y)%p],f,d,A)}q.lineWidth=1;v(e?0:d,e?d:0,d,d);q.fillStyle=m.cornerClr;q.fillRect(0,0,d,d)},x=-1,A=function(){null!=l?(null!=n&&n(x),x=l(y)):y()};this.drawRuler=A;this.sizeListener=c=f(function(){var a=t.container;e?(a=a.offsetHeight+d,u.height!=a&&(u.height=a,p.style.height=a+"px",A())):(a=a.offsetWidth+d,u.width!=a&&(u.width=a,p.style.width=a+"px",A()))},10);this.pageListener=function(){A()};this.scrollListener=b=f(function(){var a=e?t.container.scrollTop:t.container.scrollLeft;
|
|
|
|
|
k.lastScroll!=a&&(k.lastScroll=a,A())},10);this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};t.addListener(mxEvent.SIZE,c);t.container.addEventListener("scroll",b);t.view.addListener("unitChanged",this.unitListener);a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){m=a;p.style.background=m.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=
|
|
|
|
|
function(a,b,c,f){var g;if(e&&4<a.height||!e&&4<a.width){if(null!=k.guidePart)try{q.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),q.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),q.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3)}catch(L){}g=k.origGuideMove.apply(this,arguments);try{var l,n,p,t,u,x,y,z,A;q.lineWidth=.5;q.strokeStyle=m.guideClr;q.setLineDash([2]);e?(n=a.y+g.y+d-this.graph.container.scrollTop,l=0,u=n+a.height/2,t=d/2,z=n+a.height,
|
|
|
|
|
y=0,p=q.getImageData(l,n-1,d,3),v(l,n,d,n),n--,x=q.getImageData(t,u-1,d,3),v(t,u,d,u),u--,A=q.getImageData(y,z-1,d,3),v(y,z,d,z),z--):(n=0,l=a.x+g.x+d-this.graph.container.scrollLeft,u=d/2,t=l+a.width/2,z=0,y=l+a.width,p=q.getImageData(l-1,n,3,d),v(l,n,l,d),l--,x=q.getImageData(t-1,u,3,d),v(t,u,t,d),t--,A=q.getImageData(y-1,z,3,d),v(y,z,y,d),y--);if(null==k.guidePart||k.guidePart.x1!=l||k.guidePart.y1!=n)k.guidePart={imgData1:p,x1:l,y1:n,imgData2:x,x2:t,y2:u,imgData3:A,x3:y,y3:z}}catch(L){}}else g=
|
|
|
|
|
k.origGuideMove.apply(this,arguments);return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this,arguments);if(null!=k.guidePart)try{q.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),q.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),q.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null}catch(B){}return a}}mxRuler.prototype.RULER_THICKNESS=14;
|
|
|
|
|
a&&(x=l*Math.floor(1/a/2)*(k.unit==mxConstants.MILLIMETERS?2:1));l=null;b=f?Math.min(c+(e?b.height:b.width),e?u.height:u.width):e?u.height:u.width;if(f)if(q.fillStyle=m.outBkgClr,e){var y=c-d;0<y&&q.fillRect(0,d,d,y);b<u.height&&q.fillRect(0,b,d,u.height)}else y=c-d,0<y&&q.fillRect(d,0,y,d),b<u.width&&q.fillRect(b,0,u.width,d);q.fillStyle=m.fontClr;for(f=f?c:c%(x*a);f<=b;f+=x*a)if(y=Math.round((f-c)/a/x),!(f<d||y==l)){l=y;var B=null;0==y%p&&(B=k.formatText(g+y*x)+"");e?v(d-n[Math.abs(y)%p],f,d,f,
|
|
|
|
|
B):v(f,d-n[Math.abs(y)%p],f,d,B)}q.lineWidth=1;v(e?0:d,e?d:0,d,d);q.fillStyle=m.cornerClr;q.fillRect(0,0,d,d)},x=-1,B=function(){null!=l?(null!=n&&n(x),x=l(y)):y()};this.drawRuler=B;this.sizeListener=c=f(function(){var a=t.container;e?(a=a.offsetHeight+d,u.height!=a&&(u.height=a,p.style.height=a+"px",B())):(a=a.offsetWidth+d,u.width!=a&&(u.width=a,p.style.width=a+"px",B()))},10);this.pageListener=function(){B()};this.scrollListener=b=f(function(){var a=e?t.container.scrollTop:t.container.scrollLeft;
|
|
|
|
|
k.lastScroll!=a&&(k.lastScroll=a,B())},10);this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};t.addListener(mxEvent.SIZE,c);t.container.addEventListener("scroll",b);t.view.addListener("unitChanged",this.unitListener);a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){m=a;p.style.background=m.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=
|
|
|
|
|
function(a,b,c,f){var g;if(e&&4<a.height||!e&&4<a.width){if(null!=k.guidePart)try{q.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),q.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),q.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3)}catch(L){}g=k.origGuideMove.apply(this,arguments);try{var l,n,p,t,u,x,y,z,B;q.lineWidth=.5;q.strokeStyle=m.guideClr;q.setLineDash([2]);e?(n=a.y+g.y+d-this.graph.container.scrollTop,l=0,u=n+a.height/2,t=d/2,z=n+a.height,
|
|
|
|
|
y=0,p=q.getImageData(l,n-1,d,3),v(l,n,d,n),n--,x=q.getImageData(t,u-1,d,3),v(t,u,d,u),u--,B=q.getImageData(y,z-1,d,3),v(y,z,d,z),z--):(n=0,l=a.x+g.x+d-this.graph.container.scrollLeft,u=d/2,t=l+a.width/2,z=0,y=l+a.width,p=q.getImageData(l-1,n,3,d),v(l,n,l,d),l--,x=q.getImageData(t-1,u,3,d),v(t,u,t,d),t--,B=q.getImageData(y-1,z,3,d),v(y,z,y,d),y--);if(null==k.guidePart||k.guidePart.x1!=l||k.guidePart.y1!=n)k.guidePart={imgData1:p,x1:l,y1:n,imgData2:x,x2:t,y2:u,imgData3:B,x3:y,y3:z}}catch(L){}}else g=
|
|
|
|
|
k.origGuideMove.apply(this,arguments);return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this,arguments);if(null!=k.guidePart)try{q.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),q.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),q.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null}catch(A){}return a}}mxRuler.prototype.RULER_THICKNESS=14;
|
|
|
|
|
mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()};mxRuler.prototype.formatText=function(a){switch(this.unit){case mxConstants.POINTS:return Math.round(a);case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}};
|
|
|
|
|
mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener("unitChanged",this.unitListener);this.ui.removeListener("pageViewChanged",this.pageListener);this.ui.removeListener("pageScaleChanged",this.pageListener);this.ui.removeListener("pageFormatChanged",
|
|
|
|
|
this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};
|
|
|
|
|