diff --git a/ChangeLog b/ChangeLog index 9c924212c56bacf7a8209a5b0dbc7bbf4a1a6a3d..80c07aa353883fc364523dd9541cec353886a5de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +07-SEP-2019: 11.2.7 + +- Fixes minor bugs + 06-SEP-2019: 11.2.6 - Enables ruler by default diff --git a/VERSION b/VERSION index 44d6c25b6f13867b72194545b0398516a7fc8bf9..e53e91b048900f34c72608a5acd36b27f02f9c36 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.2.6 \ No newline at end of file +11.2.7 \ No newline at end of file diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest index fc5ce58f2a7b7238cfe9949e936855fa7d2774c2..8ab6a6a9057b06dd77b7d5bdb41f7d3edcfde53a 100644 --- a/src/main/webapp/cache.manifest +++ b/src/main/webapp/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 09/06/2019 04:10 PM +# 09/07/2019 03:50 PM app.html index.html?offline=1 diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 23b86ac2ed76fab35a4f93395ab611e206f12a59..2c5bd60fc5bbfa28c5546baac4700cd5c24e1d05 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -8587,7 +8587,7 @@ ka.style.cssText="margin:0 8px 0 8px;";ka.setAttribute("value","100 %");ka.style (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)):(A.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 B=document.createElement("canvas"),D=new Image;D.onload=function(){try{B.getContext("2d").drawImage(D,0,0);var a=B.toDataURL("image/png");Editor.prototype.useCanvasForExport= null!=a&&6<a.length}catch(J){}};D.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(z){}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="11.2.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";EditorUi.enablePlantUml= +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="11.2.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";EditorUi.enablePlantUml= EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage= a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",l=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=l+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+ encodeURIComponent(e.stack):"")}}catch(x){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(p){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b: @@ -8883,15 +8883,15 @@ a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"0px";a.st 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))); b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null== this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://about.draw.io/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 c=this.editor.graph,d=c.getSelectionCells(), -f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var g in a[f].config)e[g]=a[f].config[g];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var g={},k=null,l=null,m=null,n=null,q=null,z=null,J=null,F=null,G="",H="auto",I="auto",E=null,K=null,M=40,R=40,X=100,T=0,L=this.editor.graph;L.getGraphBounds();for(var W=function(){null!= +f=0;f<a.length;f++){var e=new window[a[f].layout](c);if(null!=a[f].config)for(var k in a[f].config)e[k]=a[f].config[k];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var k={},g=null,l=null,m=null,n=null,q=null,z=null,J=null,F=null,G="",H="auto",I="auto",E=null,K=null,M=40,R=40,X=100,T=0,L=this.editor.graph;L.getGraphBounds();for(var W=function(){null!= b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))},Z=L.getFreeInsertPoint(),ha=Z.x,fa=Z.y,Z=fa,da=null,V="auto",F=null,ba=[],Q=null,aa=null,Y=0;Y<c.length&&"#"==c[Y].charAt(0);){a=c[Y];for(Y++;Y<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Y].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[Y].substring(1)),Y++;if("#"!=a.charAt(1)){var ea=a.indexOf(":");if(0<ea){var P=mxUtils.trim(a.substring(1,ea)),N=mxUtils.trim(a.substring(ea+1));"label"==P?da=L.sanitizeHtml(N): -"labelname"==P&&0<N.length&&"-"!=N?n=N:"labels"==P&&0<N.length&&"-"!=N?q=JSON.parse(N):"style"==P?k=N:"parentstyle"==P?z=N:"stylename"==P&&0<N.length&&"-"!=N?m=N:"styles"==P&&0<N.length&&"-"!=N?l=JSON.parse(N):"identity"==P&&0<N.length&&"-"!=N?J=N:"parent"==P&&0<N.length&&"-"!=N?F=N:"namespace"==P&&0<N.length&&"-"!=N?G=N:"width"==P?H=N:"height"==P?I=N:"left"==P&&0<N.length?E=N:"top"==P&&0<N.length?K=N:"ignore"==P?aa=N.split(","):"connect"==P?ba.push(JSON.parse(N)):"link"==P?Q=N:"padding"==P?T=parseFloat(N): -"edgespacing"==P?M=parseFloat(N):"nodespacing"==P?R=parseFloat(N):"levelspacing"==P?X=parseFloat(N):"layout"==P&&(V=N)}}}if(null==c[Y])throw Error(mxResources.get("invalidOrMissingFile"));var ca=this.editor.csvToArray(c[Y]),P=ea=null;if(null!=J||null!=F)for(var S=0;S<ca.length;S++)J==ca[S]&&(ea=S),F==ca[S]&&(P=S);null==da&&(da="%"+ca[0]+"%");if(null!=ba)for(var U=0;U<ba.length;U++)null==g[ba[U].to]&&(g[ba[U].to]={});L.model.beginUpdate();try{for(S=Y+1;S<c.length;S++){var ja=this.editor.csvToArray(c[S]); -if(null==ja){var ka=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(S+" ("+ka+") "+mxResources.get("containsValidationErrors"));}if(ja.length==ca.length){var O=null,ma=null!=ea?G+ja[ea]:null;null!=ma&&(O=L.model.getCell(ma));var J=null!=O,ga=new mxCell(da,new mxGeometry(ha,Z,0,0),k||"whiteSpace=wrap;html=1;");ga.vertex=!0;ga.id=ma;for(var ia=0;ia<ja.length;ia++)L.setAttributeForCell(ga,ca[ia],ja[ia]);if(null!=n&&null!=q){var ua=q[ga.getAttribute(n)];null!=ua&&L.labelChanged(ga,ua)}if(null!= -m&&null!=l){var va=l[ga.getAttribute(m)];null!=va&&(ga.style=va)}L.setAttributeForCell(ga,"placeholders","1");ga.style=L.replacePlaceholders(ga,ga.style);J&&(L.model.setGeometry(O,ga.geometry),L.model.setStyle(O,ga.style),0>mxUtils.indexOf(f,O)&&f.push(O));O=ga;if(!J)for(U=0;U<ba.length;U++)g[ba[U].to][O.getAttribute(ba[U].to)]=O;null!=Q&&"link"!=Q&&(L.setLinkForCell(O,O.getAttribute(Q)),L.setAttributeForCell(O,Q,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var wa=this.editor.graph.getPreferredSizeForCell(O); +"labelname"==P&&0<N.length&&"-"!=N?n=N:"labels"==P&&0<N.length&&"-"!=N?q=JSON.parse(N):"style"==P?g=N:"parentstyle"==P?z=N:"stylename"==P&&0<N.length&&"-"!=N?m=N:"styles"==P&&0<N.length&&"-"!=N?l=JSON.parse(N):"identity"==P&&0<N.length&&"-"!=N?J=N:"parent"==P&&0<N.length&&"-"!=N?F=N:"namespace"==P&&0<N.length&&"-"!=N?G=N:"width"==P?H=N:"height"==P?I=N:"left"==P&&0<N.length?E=N:"top"==P&&0<N.length?K=N:"ignore"==P?aa=N.split(","):"connect"==P?ba.push(JSON.parse(N)):"link"==P?Q=N:"padding"==P?T=parseFloat(N): +"edgespacing"==P?M=parseFloat(N):"nodespacing"==P?R=parseFloat(N):"levelspacing"==P?X=parseFloat(N):"layout"==P&&(V=N)}}}if(null==c[Y])throw Error(mxResources.get("invalidOrMissingFile"));var ca=this.editor.csvToArray(c[Y]),P=ea=null;if(null!=J||null!=F)for(var S=0;S<ca.length;S++)J==ca[S]&&(ea=S),F==ca[S]&&(P=S);null==da&&(da="%"+ca[0]+"%");if(null!=ba)for(var U=0;U<ba.length;U++)null==k[ba[U].to]&&(k[ba[U].to]={});L.model.beginUpdate();try{for(S=Y+1;S<c.length;S++){var ja=this.editor.csvToArray(c[S]); +if(null==ja){var ka=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(S+" ("+ka+") "+mxResources.get("containsValidationErrors"));}if(ja.length==ca.length){var O=null,ma=null!=ea?G+ja[ea]:null;null!=ma&&(O=L.model.getCell(ma));var J=null!=O,ga=new mxCell(da,new mxGeometry(ha,Z,0,0),g||"whiteSpace=wrap;html=1;");ga.vertex=!0;ga.id=ma;for(var ia=0;ia<ja.length;ia++)L.setAttributeForCell(ga,ca[ia],ja[ia]);if(null!=n&&null!=q){var ua=q[ga.getAttribute(n)];null!=ua&&L.labelChanged(ga,ua)}if(null!= +m&&null!=l){var va=l[ga.getAttribute(m)];null!=va&&(ga.style=va)}L.setAttributeForCell(ga,"placeholders","1");ga.style=L.replacePlaceholders(ga,ga.style);J&&(L.model.setGeometry(O,ga.geometry),L.model.setStyle(O,ga.style),0>mxUtils.indexOf(f,O)&&f.push(O));O=ga;if(!J)for(U=0;U<ba.length;U++)k[ba[U].to][O.getAttribute(ba[U].to)]=O;null!=Q&&"link"!=Q&&(L.setLinkForCell(O,O.getAttribute(Q)),L.setAttributeForCell(O,Q,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var wa=this.editor.graph.getPreferredSizeForCell(O); O.vertex&&(null!=E&&null!=O.getAttribute(E)&&(O.geometry.x=ha+parseFloat(O.getAttribute(E))),null!=K&&null!=O.getAttribute(K)&&(O.geometry.y=fa+parseFloat(O.getAttribute(K))),"@"==H.charAt(0)&&null!=O.getAttribute(H.substring(1))?O.geometry.width=parseFloat(O.getAttribute(H.substring(1))):O.geometry.width="auto"==H?wa.width+T:parseFloat(H),"@"==I.charAt(0)&&null!=O.getAttribute(I.substring(1))?O.geometry.height=parseFloat(O.getAttribute(I.substring(1))):O.geometry.height="auto"==I?wa.height+T:parseFloat(I), -Z+=O.geometry.height+R);J?(null==e[ma]&&(e[ma]=[]),e[ma].push(O)):(F=null!=P?L.model.getCell(G+ja[P]):null,d.push(O),null!=F?(F.style=L.replacePlaceholders(F,z),L.addCell(O,F)):f.push(L.addCell(O)))}}for(var na=f.slice(),la=f.slice(),U=0;U<ba.length;U++)for(var xa=ba[U],S=0;S<f.length;S++){var O=f[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){L.setAttributeForCell(b,c.from,null);for(var d=d.split(","),f=0;f<d.length;f++){var e=g[c.to][d[f]];if(null!=e){var k=c.label; -null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)||"")+(k||""));null!=c.tolabel&&(k=(k||"")+(e.getAttribute(c.tolabel)||""));la.push(L.insertEdge(null,null,k||"",c.invert?e:a,c.invert?a:e,c.style||L.createCurrentEdgeStyle()));mxUtils.remove(c.invert?a:e,na)}}}});ya(O,O,xa);if(null!=e[O.id])for(ia=0;ia<e[O.id].length;ia++)ya(O,e[O.id][ia],xa)}if(null!=aa)for(S=0;S<d.length;S++)for(O=d[S],ia=0;ia<aa.length;ia++)L.setAttributeForCell(O,mxUtils.trim(aa[ia]),null);if(0<f.length){var oa=new mxParallelEdgeLayout(L); +Z+=O.geometry.height+R);J?(null==e[ma]&&(e[ma]=[]),e[ma].push(O)):(F=null!=P?L.model.getCell(G+ja[P]):null,d.push(O),null!=F?(F.style=L.replacePlaceholders(F,z),L.addCell(O,F)):f.push(L.addCell(O)))}}for(var na=f.slice(),la=f.slice(),U=0;U<ba.length;U++)for(var xa=ba[U],S=0;S<f.length;S++){var O=f[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){L.setAttributeForCell(b,c.from,null);for(var d=d.split(","),f=0;f<d.length;f++){var e=k[c.to][d[f]];if(null!=e){var g=c.label; +null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)||"")+(g||""));null!=c.tolabel&&(g=(g||"")+(e.getAttribute(c.tolabel)||""));la.push(L.insertEdge(null,null,g||"",c.invert?e:a,c.invert?a:e,c.style||L.createCurrentEdgeStyle()));mxUtils.remove(c.invert?a:e,na)}}}});ya(O,O,xa);if(null!=e[O.id])for(ia=0;ia<e[O.id].length;ia++)ya(O,e[O.id][ia],xa)}if(null!=aa)for(S=0;S<d.length;S++)for(O=d[S],ia=0;ia<aa.length;ia++)L.setAttributeForCell(O,mxUtils.trim(aa[ia]),null);if(0<f.length){var oa=new mxParallelEdgeLayout(L); oa.spacing=M;var ta=function(){0<oa.spacing&&oa.execute(L.getDefaultParent());for(var a=0;a<f.length;a++){var b=L.getCellGeometry(f[a]);b.x=Math.round(L.snap(b.x));b.y=Math.round(L.snap(b.y));"auto"==H&&(b.width=Math.round(L.snap(b.width)));"auto"==I&&(b.height=Math.round(L.snap(b.height)))}};if("["==V.charAt(0)){var za=W;L.view.validate();this.executeLayoutList(JSON.parse(V),function(){ta();za()});W=null}else if("circle"==V){var ra=new mxCircleLayout(L);ra.resetEdges=!1;var Aa=ra.isVertexIgnored; ra.isVertexIgnored=function(a){return Aa.apply(this,arguments)||0>mxUtils.indexOf(f,a)};this.executeLayout(function(){ra.execute(L.getDefaultParent());ta()},!0,W);W=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&la.length==2*f.length-1&&1==na.length){L.view.validate();var sa=new mxCompactTreeLayout(L,"horizontaltree"==V);sa.levelDistance=R;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(L.getDefaultParent(),0<na.length?na[0]:null)},!0,W);W=null}else if("horizontalflow"== V||"verticalflow"==V||"auto"==V&&1==na.length){L.view.validate();var pa=new mxHierarchicalLayout(L,"horizontalflow"==V?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);pa.intraCellSpacing=R;pa.parallelEdgeSpacing=M;pa.interRankCellSpacing=X;pa.disableEdgeStyle=!1;this.executeLayout(function(){pa.execute(L.getDefaultParent(),la);L.moveCells(la,ha,fa)},!0,W);W=null}else if("organic"==V||"auto"==V&&la.length>f.length){L.view.validate();var qa=new mxFastOrganicLayout(L);qa.forceConstant=3*R;qa.resetEdges= @@ -8900,8 +8900,8 @@ mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,560,130,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0, 0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var f=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return f.apply(this, arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var e=b.init;b.init=function(){e.apply(this,arguments);b.outline.view.getBackgroundPageBounds= -function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var g= -mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=g.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=1;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&& +function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),f=b.source,e=b.outline;e.pageScale=f.pageScale;e.pageFormat=f.pageFormat;e.background=f.background;e.pageVisible=f.pageVisible;e.background=f.background;var k= +mxUtils.getCurrentStyle(f.container);e.container.style.backgroundColor=k.backgroundColor;null!=f.view.backgroundPageShape&&null!=e.view.backgroundPageShape&&(e.view.backgroundPageShape.fill=f.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=1;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&& "function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.gitLab||c++;b&&a&&isLocalStorage&&"1"==urlParams.browser&&c++;return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted()); this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(c);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(c),this.menus.get("newLibrary").setEnabled(c));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b); this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.actions.get("undo").setEnabled(this.canUndo()&&a);this.actions.get("redo").setEnabled(this.canRedo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&& @@ -8913,17 +8913,17 @@ function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrent this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b); this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility); this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&& -(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);q.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,g,k){var f=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(), -a.saveData(b,"svg",mxUtils.getXml(f.getSvg(d,e,g)),"image/svg+xml");else{var l=a.getFileData(!0,null,null,null,null,!0),m=f.getGraphBounds(),n=Math.floor(m.width*e/f.view.scale),p=Math.floor(m.height*e/f.view.scale);if(l.length<=MAX_REQUEST_SIZE&&n*p<MAX_AREA)if(a.hideDialog(),"png"!=c&&"jpg"!=c&&"jpeg"!=c||!a.isExportToCanvas()){var t={globalVars:f.getExportVariables()};a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a): -"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<k?"&dpi="+k:"")+"&bg="+(null!=d?d:"none")+"&w="+n+"&h="+p+"&border="+g+"&xml="+encodeURIComponent(l))})}else"png"==c?a.exportImage(e,null==d||"none"==d,!0,!1,!1,g,!0,!1,null,null,k):a.exportImage(e,!1,!0,!1,!1,g,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d= +(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);q.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,k,g){var f=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(), +a.saveData(b,"svg",mxUtils.getXml(f.getSvg(d,e,k)),"image/svg+xml");else{var l=a.getFileData(!0,null,null,null,null,!0),m=f.getGraphBounds(),n=Math.floor(m.width*e/f.view.scale),p=Math.floor(m.height*e/f.view.scale);if(l.length<=MAX_REQUEST_SIZE&&n*p<MAX_AREA)if(a.hideDialog(),"png"!=c&&"jpg"!=c&&"jpeg"!=c||!a.isExportToCanvas()){var t={globalVars:f.getExportVariables()};a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a): +"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<g?"&dpi="+g:"")+"&bg="+(null!=d?d:"none")+"&w="+n+"&h="+p+"&border="+k+"&xml="+encodeURIComponent(l))})}else"png"==c?a.exportImage(e,null==d||"none"==d,!0,!1,!1,k,!0,!1,null,null,g):a.exportImage(e,!1,!0,!1,!1,k,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d= c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutureCellForEdit(c.model,a,d.source.id);e!=d.source&&(d.source=e)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==c){a.contains(f.previous)&&(d=f.child);break}}return d}; EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length;c++){var d=a;this.currentPage!=this.pages[c]&&(d=this.createTemporaryGraph(a.getStylesheet()),d.model.setRoot(this.pages[c].root));b+=this.pages[c].getName()+" "+d.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div"); -c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var k=g[a];if("R"==k.substring(0, -1)){var m=JSON.parse(decodeURIComponent(k.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(A){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";if(0==a.length)e.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked? -b[a.id]=a:delete b[a.id]})})(d,g)}},mxUtils.bind(this,function(a){e.innerHTML="";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this, +c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var f={};try{var k=mxSettings.getCustomLibraries();for(a=0;a<k.length;a++){var g=k[a];if("R"==g.substring(0, +1)){var m=JSON.parse(decodeURIComponent(g.substring(1)));f[m[0]]={id:m[0],title:m[1],downloadUrl:m[2]}}}}catch(A){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";if(0==a.length)e.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var k=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked? +b[a.id]=a:delete b[a.id]})})(d,k)}},mxUtils.bind(this,function(a){e.innerHTML="";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this, function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763"); this.showDialog(c.container,340,375,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId]; -a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,d,e){var f=!0,g=window.setTimeout(mxUtils.bind(this,function(){f=!1;e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(g);f&&d.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:k, +a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,d,e){var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=!1;e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),g=mxUtils.bind(this,function(){window.clearTimeout(k);f&&d.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:g, error:e});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"=== typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),e.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,e);else{var f=this[c].apply(this,e);b([f])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(y){b(null,"Invalid Call: An error occured, "+y.message)}};EditorUi.prototype.commentsSupported=function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded= function(){var a=this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,c){var d=this.getCurrentFile();null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile(); @@ -9078,7 +9078,7 @@ DriveFile.prototype.getDescriptor=function(){return this.desc};DriveFile.prototy DriveFile.prototype.loadPatchDescriptor=function(a,c){this.ui.drive.executeRequest(gapi.client.drive.files.get({fileId:this.getId(),fields:this.ui.drive.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(b){a(b)}),c)};DriveFile.prototype.patchDescriptor=function(a,c){DrawioFile.prototype.patchDescriptor.apply(this,arguments);a.headRevisionId=c.headRevisionId;a.modifiedDate=c.modifiedDate};DriveFile.prototype.loadDescriptor=function(a,c){this.ui.drive.loadDescriptor(this.getId(),a,c)}; DriveFile.prototype.commentsSupported=function(){return!0}; DriveFile.prototype.getComments=function(a,c){function b(a,c,k){if(c.deleted)return null;k=new DriveComment(a,c.commentId||c.replyId,c.content,c.modifiedDate,c.createdDate,"resolved"==c.status,c.author.isAuthenticatedUser?d:new DrawioUser(c.author.permissionId,c.author.emailAddress,c.author.displayName,c.author.picture.url),k);for(var e=0;null!=c.replies&&e<c.replies.length;e++)k.addReplyDirect(b(a,c.replies[e],c.commentId));return k}var d=this.ui.getCurrentUser();this.ui.drive.executeRequest(gapi.client.drive.comments.list({fileId:this.getId()}), -mxUtils.bind(this,function(c){for(var d=[],g=0;g<c.items.length;g++){var m=b(this,c.items[g]);null!=m&&d.push(m)}a(d)}),c)};DriveFile.prototype.addComment=function(a,c,b){a={content:a.content};this.ui.drive.executeRequest(gapi.client.drive.comments.insert({fileId:this.getId(),resource:a}),mxUtils.bind(this,function(a){c(a.commentId)}),b)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment}; +mxUtils.bind(this,function(c){for(var d=[],k=0;k<c.items.length;k++){var g=b(this,c.items[k]);null!=g&&d.push(g)}a(d)}),c)};DriveFile.prototype.addComment=function(a,c,b){a={content:a.content};this.ui.drive.executeRequest(gapi.client.drive.comments.insert({fileId:this.getId(),resource:a}),mxUtils.bind(this,function(a){c(a.commentId)}),b)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment}; DriveFile.prototype.newComment=function(a,c){return new DriveComment(this,null,a,Date.now(),Date.now(),!1,c)};DriveLibrary=function(a,c,b){DriveFile.call(this,a,c,b)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,c,b){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),b)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.mimeType="application/vnd.jgraph.mxfile.realtime";this.ui.editor.chromeless&&!this.ui.editor.editable&&"1"!=urlParams.rt?(this.appId="850530949725",this.clientId="850530949725.apps.googleusercontent.com",this.scopes=["https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/userinfo.profile"]):this.ui.isDriveDomain()?(this.appId="671128082532",this.clientId="671128082532.apps.googleusercontent.com"): (this.appId="420247213240",this.clientId="420247213240-hnbju1pt13seqrc1hhd5htpotk4g9q7u.apps.googleusercontent.com",this.mimeType="application/vnd.jgraph.mxfile.rtlegacy");this.mimeTypes=this.xmlMimeType+"application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy";"1"==urlParams.photos&&this.scopes.push("https://www.googleapis.com/auth/photos.upload")};mxUtils.extend(DriveClient,mxEventSource); DriveClient.prototype.scopes=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/userinfo.profile"];DriveClient.prototype.allFields="kind,id,parents,headRevisionId,etag,title,mimeType,modifiedDate,editable,copyable,canComment,labels,properties,downloadUrl,webContentLink,userPermission,fileSize";DriveClient.prototype.catchupFields="etag,headRevisionId,modifiedDate,properties(key,value)"; @@ -9825,15 +9825,15 @@ d=Math.round(d);e=Math.round(e);f.beginPath();f.moveTo(a+.5,c+.5);f.lineTo(d+.5, c.x-l.container.scrollLeft):14+(b?d.y-l.container.scrollTop:d.x-l.container.scrollLeft),u=0;g&&(u=b?Math.floor(((e.y+1)/a-d.y)/l.pageFormat.height)*l.pageFormat.height*a:Math.floor(((e.x+1)/a-d.x)/l.pageFormat.width)*l.pageFormat.width*a);var z,v,F;switch(k.unit){case mxConstants.POINTS:z=F=10;v=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:F=10;z=mxConstants.PIXELS_PER_MM;v=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:F=.5>=a||4<=a?8:16,z=mxConstants.PIXELS_PER_INCH/F,v=[5,3,5, 3,7,3,5,3,7,3,5,3,7,3,5,3]}d=z;2<=a?d=z/(2*Math.floor(a/2)):.5>=a&&(d=z*Math.floor(1/a/2)*(k.unit==mxConstants.MILLIMETERS?2:1));z=null;c=g?Math.min(n+(b?c.height:c.width),b?q.height:q.width):b?q.height:q.width;g&&(f.fillStyle=m.outBkgClr,b?(f.fillRect(0,14,14,n-14),f.fillRect(0,c,14,q.height)):(f.fillRect(14,0,n-14,14),f.fillRect(c,0,q.width,14)));f.fillStyle=m.fontClr;for(g=g?n:n%(d*a);g<=c;g+=d*a)if(e=Math.round((g-n)/a/d),!(14>g||e==z)){z=e;var G=null;0==e%F&&(G=k.formatText(u+e*d)+"");b?p(14- v[Math.abs(e)%F],g,14,g,G):p(g,14-v[Math.abs(e)%F],g,14,G)}f.lineWidth=1;p(b?0:14,b?14:0,14,14);f.fillStyle=m.cornerClr;f.fillRect(0,0,14,14)};this.drawRuler=u;this.sizeListener=c=e(function(){var a=l.container;b?(a=a.offsetHeight+14,q.height!=a&&(q.height=a,n.style.height=a+"px",u())):(a=a.offsetWidth+14,q.width!=a&&(q.width=a,n.style.width=a+"px",u()))},10);this.pageListener=function(){u()};var v=e(function(){var a=b?l.container.scrollTop:l.container.scrollLeft;k.lastScroll!=a&&(k.lastScroll=a, -u())},10);this.scrollListener=v;this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};l.addListener(mxEvent.SIZE,c);l.container.addEventListener("scroll",v);l.view.addListener("unitChanged",this.unitListener);a.addListener("pageViewChanged",this.pageListener);this.setStyle=function(a){m=a;n.style.background=m.bkgClr;u()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,c,d,e){null!=k.guidePart&&(f.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1), -f.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),f.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3));var g=k.origGuideMove.apply(this,arguments),l,n,q,t,u,v,x,y,C;f.lineWidth=.5;f.strokeStyle=m.guideClr;f.setLineDash([2]);b?(n=a.y+g.y+14-this.graph.container.scrollTop,l=0,u=n+a.height/2,t=7,y=n+a.height,x=0,q=f.getImageData(l,n,14,5),p(l,n,14,n),v=f.getImageData(t,u,14,5),p(t,u,14,u),C=f.getImageData(x,y,14,5),p(x,y,14,y)):(n=0,l=a.x+g.x+14-this.graph.container.scrollLeft, -u=7,t=l+a.width/2,y=0,x=l+a.width,q=f.getImageData(l,n,5,14),p(l,n,l,14),v=f.getImageData(t,u,5,14),p(t,u,t,14),C=f.getImageData(x,y,5,14),p(x,y,x,14));if(null==k.guidePart||k.guidePart.x1!=l||k.guidePart.y1!=n)k.guidePart={imgData1:q,x1:l,y1:n,imgData2:v,x2:t,y2:u,imgData3:C,x3:x,y3:y};return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this,arguments);null!=k.guidePart&&(f.putImageData(k.guidePart.imgData1,k.guidePart.x1, -k.guidePart.y1),f.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),f.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null);return a}}mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()}; +u())},10);this.scrollListener=v;this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};l.addListener(mxEvent.SIZE,c);l.container.addEventListener("scroll",v);l.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;n.style.background=m.bkgClr;u()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move= +function(a,c,d,e){null!=k.guidePart&&(f.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),f.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),f.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3));var g=k.origGuideMove.apply(this,arguments),l,n,q,t,u,v,x,y,C;f.lineWidth=.5;f.strokeStyle=m.guideClr;f.setLineDash([2]);b?(n=a.y+g.y+14-this.graph.container.scrollTop,l=0,u=n+a.height/2,t=7,y=n+a.height,x=0,q=f.getImageData(l,n,14,5),p(l,n,14,n),v=f.getImageData(t, +u,14,5),p(t,u,14,u),C=f.getImageData(x,y,14,5),p(x,y,14,y)):(n=0,l=a.x+g.x+14-this.graph.container.scrollLeft,u=7,t=l+a.width/2,y=0,x=l+a.width,q=f.getImageData(l,n,5,14),p(l,n,l,14),v=f.getImageData(t,u,5,14),p(t,u,t,14),C=f.getImageData(x,y,5,14),p(x,y,x,14));if(null==k.guidePart||k.guidePart.x1!=l||k.guidePart.y1!=n)k.guidePart={imgData1:q,x1:l,y1:n,imgData2:v,x2:t,y2:u,imgData3:C,x3:x,y3:y};return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this, +arguments);null!=k.guidePart&&(f.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),f.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),f.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null);return a}}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);null!=this.container&&this.container.parentNode.removeChild(this.container);this.ui.diagramContainer.style.left= -this.ui.origContLeft+"px";this.ui.diagramContainer.style.top=this.ui.origContTop+"px"}; -function mxDualRuler(a,c){this.editorUiRefresh=a.refresh;this.ui=a;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(a,c,!0);this.hRuler=new mxRuler(a,c,!1,!0);var b=mxUtils.bind(this,function(b){mxEvent.addGestureListeners(b,null,null,mxUtils.bind(this,function(c){if(a.editor.graph.isEnabled()&&!a.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(c)||mxEvent.isPopupTrigger(c))){a.editor.graph.popupMenuHandler.hideMenu();a.hideCurrentMenu(); -if(!mxEvent.isTouchEvent(c)||!menuWasVisible){var d=new mxPopupMenu(mxUtils.bind(this,function(b,c){a.menus.addMenuItems(b,["points","millimeters"],c)}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);a.resetCurrentMenu();d.destroy()});var g=mxEvent.getClientX(c),m=mxEvent.getClientY(c);d.popup(g,m,null,c);a.setCurrentMenu(d,b)}mxEvent.consume(c)}}))});b(this.hRuler.container); +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);this.ui.diagramContainer.style.left=this.ui.origContLeft+"px";this.ui.diagramContainer.style.top=this.ui.origContTop+"px"}; +function mxDualRuler(a,c){this.editorUiRefresh=a.refresh;this.ui=a;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(a,c,!0);this.hRuler=new mxRuler(a,c,!1,!0);var b=mxUtils.bind(this,function(b){var c=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){c=null!=a.currentMenu;mxEvent.consume(b)}),null,mxUtils.bind(this,function(d){if(a.editor.graph.isEnabled()&&!a.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(d)||mxEvent.isPopupTrigger(d))){a.editor.graph.popupMenuHandler.hideMenu(); +a.hideCurrentMenu();if(!mxEvent.isTouchEvent(d)||!c){var e=new mxPopupMenu(mxUtils.bind(this,function(b,c){a.menus.addMenuItems(b,["points","millimeters"],c)}));e.div.className+=" geMenubarMenu";e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);a.resetCurrentMenu();e.destroy()});var g=mxEvent.getClientX(d),n=mxEvent.getClientY(d);e.popup(g,n,null,d);a.setCurrentMenu(e,b)}mxEvent.consume(d)}}))});b(this.hRuler.container); b(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.setUnit=function(a){this.vRuler.setUnit(a);this.hRuler.setUnit(a)};mxDualRuler.prototype.setStyle=function(a){this.vRuler.setStyle(a);this.hRuler.setStyle(a)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy};function mxFreehand(a){if(null!=a.container&&null!=a.container.querySelector("svg")){var c=a.container.querySelector("svg"),b=mxFreehand.prototype.NORMAL_SMOOTHING,d=null,g=[],e,k=[],m,n=!1,q=!0,f=[],l=!1,p=!1;this.setClosedPath=function(a){n=a};this.setAutoClose=function(a){q=a};this.setStopClickEnabled=function(a){p=a};this.setSmoothing=function(a){b=a};var u=function(b){l=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor= b?"crosshair":"";a.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){u(!0)};this.isDrawing=function(){return l};var v=mxUtils.bind(this,function(a){if(d){var b=p&&0<k.length&&null!=m&&2>m.length;b||k.push.apply(k,m);m=[];k.push(null);g.push(d);d=null;b&&this.stopDrawing();mxEvent.consume(a)}});this.stopDrawing=function(){if(0<g.length){for(var b=k[0].x,c=k[0].x,e=k[0].y,f=k[0].y,l=1;l<k.length;l++)null!=k[l]&&(b=Math.max(b,k[l].x),c=Math.min(c,k[l].x),e=Math.max(e, k[l].y),f=Math.min(f,k[l].y));b-=c;e-=f;if(0<b&&0<e){var m=100/b,p=100/e;k.map(function(a){if(null==a)return a;a.x=(a.x-c)*m;a.y=(a.y-f)*p;return a});for(var t='<shape strokewidth="inherit"><foreground>',v=0,l=0;l<k.length;l++){var x=k[l];if(null==x){var x=!1,v=k[v],y=k[l-1];!n&&q&&(x=v.x-y.x,y=v.y-y.y,x=Math.sqrt(x*x+y*y)<=a.tolerance);if(n||x)t+='<line x="'+v.x.toFixed(2)+'" y="'+v.y.toFixed(2)+'"/>';t+="</path>"+(n||x?"<fillstroke/>":"<stroke/>");v=l+1}else t=l==v?t+('<path><move x="'+x.x.toFixed(2)+ diff --git a/src/main/webapp/js/diagramly/mxRuler.js b/src/main/webapp/js/diagramly/mxRuler.js index d1d80cbcedbf0fb77a22cf0534b10d7261244444..756a5fdbc803a28313e5800a135ea9f3531a5f11 100644 --- a/src/main/webapp/js/diagramly/mxRuler.js +++ b/src/main/webapp/js/diagramly/mxRuler.js @@ -325,6 +325,8 @@ function mxRuler(editorUi, unit, isVertical, isSecondery) graph.container.addEventListener('scroll', efficientScrollListener); graph.view.addListener('unitChanged', this.unitListener); editorUi.addListener('pageViewChanged', this.pageListener); + editorUi.addListener('pageScaleChanged', this.pageListener); + editorUi.addListener('pageFormatChanged', this.pageListener); function debounce(func, wait, immediate) { @@ -465,6 +467,8 @@ mxRuler.prototype.destroy = function() 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); if (this.container != null) { @@ -488,14 +492,20 @@ function mxDualRuler(editorUi, unit) // Adds units context menu var installMenu = mxUtils.bind(this, function(node) { - mxEvent.addGestureListeners(node, null, null, mxUtils.bind(this, function(evt) + var menuWasVisible = false; + + mxEvent.addGestureListeners(node, mxUtils.bind(this, function(evt) + { + menuWasVisible = editorUi.currentMenu != null; + mxEvent.consume(evt); + }), null, mxUtils.bind(this, function(evt) { if (editorUi.editor.graph.isEnabled() && !editorUi.editor.graph.isMouseDown && (mxEvent.isTouchEvent(evt) || mxEvent.isPopupTrigger(evt))) { editorUi.editor.graph.popupMenuHandler.hideMenu(); editorUi.hideCurrentMenu(); - + if (!mxEvent.isTouchEvent(evt) || !menuWasVisible) { var menu = new mxPopupMenu(mxUtils.bind(this, function(menu, parent)