7.6.7 release
This commit is contained in:
parent
470438cb31
commit
a34a3686b3
12 changed files with 465 additions and 445 deletions
|
@ -1,3 +1,8 @@
|
|||
30-OCT-2017: 7.6.7
|
||||
|
||||
- Ignores invalid sources in embed mode
|
||||
- Fixes auth flow in Trello Power-Up
|
||||
|
||||
30-OCT-2017: 7.6.6
|
||||
|
||||
- Uses mxGraph 3.7.6 beta 9
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
7.6.6
|
||||
7.6.7
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 10/30/2017 09:17 AM
|
||||
# 10/30/2017 12:32 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
136
war/js/app.min.js
vendored
136
war/js/app.min.js
vendored
|
@ -6539,7 +6539,7 @@ R.setAttribute("min","1");R.setAttribute("type","number");R.style.width="40px";W
|
|||
P.appendChild(W);P.appendChild(K);N.appendChild(X);N.appendChild(Q);N.appendChild(Y);L.appendChild(P);L.appendChild(N);q.appendChild(L);k.appendChild(q);g.appendChild(k);k=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));k.appendChild(m);m=document.createElement("div");m.style.marginBottom="12px";var T=PageSetupDialog.addPageFormatPanel(m,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);
|
||||
k.appendChild(m);m=document.createElement("span");mxUtils.write(m,mxResources.get("pageScale"));k.appendChild(m);var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","100 %");S.style.width="60px";k.appendChild(S);g.appendChild(k);m=document.createElement("div");m.style.cssText="text-align:right;margin:62px 0 0 0;";k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&m.appendChild(k);a.isOffline()||
|
||||
(q=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),q.className="geBtn",m.appendChild(q));PrintDialog.previewEnabled&&(q=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();d(!1)}),q.className="geBtn",m.appendChild(q));q=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});q.className="geBtn gePrimaryBtn";m.appendChild(q);a.editor.cancelFirst||m.appendChild(k);
|
||||
g.appendChild(m);this.container=g}})();(function(){EditorUi.VERSION="7.6.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
g.appendChild(m);this.container=g}})();(function(){EditorUi.VERSION="7.6.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;
|
||||
EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b,
|
||||
0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=c&&6<c.length}catch(t){}};b.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(p){}try{a=document.createElement("canvas");a.width=a.height=1;var c=
|
||||
|
@ -6591,10 +6591,10 @@ w:c.width,h:c.height};null!=h&&(a.title=h);b.push(a);F(d);null!=g&&null!=g.paren
|
|||
c.y-=n.view.translate.y;C(b,c)}mxEvent.consume(a)});e.style.border="3px solid transparent";mxEvent.addGestureListeners(e,function(){},mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="hidden",null!=g?g.style.border="3px dotted rgb(254, 137, 12)":e.style.border="3px dotted rgb(254, 137, 12)",e.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!1),
|
||||
null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(e.style.border="3px solid transparent",null!=g&&(g.style.border="3px dotted lightGray"),e.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,D(a),mxEvent.consume(a))}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){n.isMouseDown&&
|
||||
null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",e.style.border="3px solid transparent",e.style.cursor="",n.autoScroll=!0,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!0),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),null!=g&&(g.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){null!=g?g.style.border="3px dotted rgb(254, 137, 12)":e.style.border="3px dotted rgb(254, 137, 12)";
|
||||
a.dataTransfer.dropEffect="copy";e.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){e.style.border="3px solid transparent";e.style.cursor="";null!=g&&(g.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,m,f,k,v,l,n,p){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
|
||||
a.dataTransfer.dropEffect="copy";e.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){e.style.border="3px solid transparent";e.style.cursor="";null!=g&&(g.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,m,f,k,v,l,p,n){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
|
||||
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,k,v),c)],c[0].vertex=!0,C(c,new mxRectangle(0,0,k,v),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null);else{var q=!1,x=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var m=mxUtils.parseXml(c);if("mxlibrary"==m.documentElement.nodeName)try{var f=JSON.parse(mxUtils.getTextContent(m.documentElement));h(f,e);b=b.concat(f);F(a);
|
||||
this.spinner.stop();q=!0}catch(S){}else if("mxfile"==m.documentElement.nodeName)try{for(var k=m.documentElement.getElementsByTagName("diagram"),m=0;m<k.length;m++){var f=mxUtils.getTextContent(k[m]),v=this.stringToCells(this.editor.graph.decompress(f)),l=this.editor.graph.getBoundingBoxFromGeometry(v);C(v,new mxRectangle(0,0,l.width,l.height),a)}q=!0}catch(S){null!=window.console&&console.log("error in drop handler:",S)}}q||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=p?this.parseFile(p,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),
|
||||
null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=n?this.parseFile(n,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?x(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):x(c,d)}}));a.stopPropagation();a.preventDefault()})),
|
||||
mxEvent.addListener(e,"dragleave",function(a){null!=g?g.style.border="3px dotted lightGray":(e.style.border="3px solid transparent",e.style.cursor="");a.stopPropagation();a.preventDefault()}));k=k.cloneNode(!1);k.setAttribute("src",IMAGE_PATH+"/edit.gif");k.setAttribute("title",mxResources.get("edit"));f.insertBefore(k,f.firstChild);mxEvent.addListener(k,"click",B);mxEvent.addListener(e,"dblclick",function(a){mxEvent.getSource(a)==e&&B(a)});k=k.cloneNode(!1);k.setAttribute("src",Editor.plusImage);
|
||||
k.setAttribute("title",mxResources.get("add"));f.insertBefore(k,f.firstChild);this.isOffline()||".scratchpad"!=a.title||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:gray;text-decoration:none;",c.className="geButton",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink("https://desk.draw.io/support/solutions/articles/16000042367");mxEvent.consume(a)})),f.insertBefore(c,f.firstChild));var E=null;mxEvent.addListener(k,
|
||||
"click",D)}m.appendChild(f);m.style.paddingRight=18*f.childNodes.length+"px"}};"1"==urlParams.offline?EditorUi.prototype.footerHeight=4:("atlas"==uiTheme?("undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=
|
||||
|
@ -6667,15 +6667,15 @@ g=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getS
|
|||
d.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==g&&(g=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(g)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(v){null!=b&&b(v)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg=
|
||||
function(a,b,c,d,e,f,k){k=b.background;k==mxConstants.NONE&&(k=null);b=b.getSvg(k,null,null,null,null,f);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
||||
mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,f,k,l,n){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var g=this.editor.graph.isSelectionEmpty();c=null!=c?c:g;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,n)}catch(y){"Invalid image"==y.message?this.downloadFile(n):this.handleError(y)}}),null,
|
||||
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,k)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},f=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f<c.length;f++){var h=
|
||||
c[f].indexOf(")");g.push('url("');g.push(e[b(c[f].substring(0,h))]);g.push('"'+c[f].substring(h))}this.editor.resolvedFontCss=g.join("");a()}});if(0<c.length)for(var h=1;h<c.length;h++){var k=c[h].indexOf(")"),l=null,n=c[h].indexOf("format(",k);0<n&&(l=b(c[h].substring(n+7,c[h].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b=
|
||||
"application/x-font-opentype";else if("woff"==l||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==l||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==l||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==l||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;f()}),mxUtils.bind(this,
|
||||
function(a){d--;f()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[h].substring(0,k)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,k,l,n,v,x,y,B,F){f=null!=f?f:!0;y=null!=y?y:this.editor.graph;B=null!=B?B:0;var g=n?null:y.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==n&&(g="#ffffff");this.convertImages(y.getSvg(g,null,null,F,null,null!=k?k:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var h=document.createElement("canvas"),
|
||||
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,f,k)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},h=mxUtils.bind(this,function(){if(0==d){for(var g=[c[0]],f=1;f<c.length;f++){var h=
|
||||
c[f].indexOf(")");g.push('url("');g.push(e[b(c[f].substring(0,h))]);g.push('"'+c[f].substring(h))}this.editor.resolvedFontCss=g.join("");a()}});if(0<c.length)for(var f=1;f<c.length;f++){var k=c[f].indexOf(")"),l=null,n=c[f].indexOf("format(",k);0<n&&(l=b(c[f].substring(n+7,c[f].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==l||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==l||"embedded-opentype"==l||/(\.otf)($|\?)/i.test(a))b=
|
||||
"application/x-font-opentype";else if("woff"==l||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==l||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==l||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==l||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;h()}),mxUtils.bind(this,
|
||||
function(a){d--;h()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[f].substring(0,k)),l)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,f,k,l,n,v,x,y,B,F){f=null!=f?f:!0;y=null!=y?y:this.editor.graph;B=null!=B?B:0;var g=n?null:y.background;g==mxConstants.NONE&&(g=null);null==g&&(g=d);null==g&&0==n&&(g="#ffffff");this.convertImages(y.getSvg(g,null,null,F,null,null!=k?k:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var h=document.createElement("canvas"),
|
||||
m=parseInt(c.getAttribute("width")),k=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=f?Math.min(1,Math.min(3*b/(4*k),b/m)):b/m);m=Math.ceil(l*m)+2*B;k=Math.ceil(l*k)+2*B;h.setAttribute("width",m);h.setAttribute("height",k);var n=h.getContext("2d");null!=g&&(n.beginPath(),n.rect(0,0,m,k),n.fillStyle=g,n.fill());n.scale(l,l);n.drawImage(d,B/l,B/l);a(h)}catch(U){null!=e&&e(U)}});d.onerror=function(a){null!=e&&e(a)};try{v&&this.editor.graph.addSvgShadow(c);var h=mxUtils.bind(this,function(){if(null!=
|
||||
this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(y,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(h)}catch(H){null!=e&&e(H)}}),c,x)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;a.convert=function(c){null!=c&&("http://"!=
|
||||
c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var g=0,e=c||{};c=mxUtils.bind(this,function(c,f){for(var h=a.getElementsByTagName(c),m=0;m<h.length;m++)mxUtils.bind(this,function(c){var h=d.convert(c.getAttribute(f));if(null!=h&&
|
||||
"data:"!=h.substring(0,5)){var m=e[h];null==m?(g++,this.convertImageToDataUri(h,function(d){null!=d&&(e[h]=d,c.setAttribute(f,d));g--;0==g&&b(a)})):c.setAttribute(f,m)}})(h[m])});c("image","xlink:href");c("img","src");0==g&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,f){try{var g=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);e=null!=e?e:!0;var h=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
|
||||
b){var d=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}f=null!=f?f:"data:image/png;base64,";d=f+this.base64Encode(d)}b(d)}}else null!=c&&c({code:App.ERROR_UNKNOWN})}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,
|
||||
b){var d=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}f=null!=f?f:"data:image/png;base64,";d=f+this.base64Encode(d)}b(d)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,
|
||||
retry:h})})});h()}catch(w){null!=c&&c(w)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=function(){var a=document.createElement("canvas"),
|
||||
d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var g=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var h=mxUtils.parseXml(a),m=this.editor.extractGraphModel(h.documentElement,null!=this.pages);if(null!=m&&"mxfile"==m.nodeName&&null!=this.pages){var k=m.getElementsByTagName("diagram");if(1==k.length)m=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(k[0]))).documentElement;
|
||||
else if(1<k.length){f.model.beginUpdate();try{for(var l=0;l<k.length;l++){var n=this.updatePageRoot(new DiagramPage(k[l])),p=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[p+1]));f.model.execute(new ChangePage(this,n,n,p))}}finally{f.model.endUpdate()}}}if(null!=m&&"mxGraphModel"===m.nodeName){var t=new mxGraphModel;(new mxCodec(m.ownerDocument)).decode(m,t);var C=t.getChildCount(t.getRoot());f.model.getChildCount(f.model.getRoot());f.model.beginUpdate();try{a={};
|
||||
|
@ -6756,53 +6756,52 @@ function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatCont
|
|||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
|
||||
null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
|
||||
this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
|
||||
f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(!/https:\/\/.*\.googleapis\.com$/.test(f.origin)&&!/https:\/\/.*\.google\.com$/.test(f.origin)){var h=
|
||||
f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(G){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var m=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=
|
||||
a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(m.container,300,80,!0,!1);m.init();return}if("draft"==h.action){m=null;m="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();m=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),m,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",
|
||||
result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
|
||||
try{m.init()}catch(G){k.postMessage(JSON.stringify({event:"draft",error:G.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();m=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(m.container,620,440,!0,!1,mxUtils.bind(this,
|
||||
function(a){a&&this.actions.get("exit").funct()}));m.init();return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var l=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==h.action){if("png"==
|
||||
h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var n=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(n);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==
|
||||
a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),t=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(p.container);
|
||||
p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=
|
||||
h.xml&&0<h.xml.length&&this.setFileData(h.xml);l=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))m=this.getXmlFileData(),l.xml=mxUtils.getXml(m),l.data=this.getFileData(null,null,!0,null,null,null,m),l.format=h.format;else if("html"==h.format)n=this.editor.getGraphXml(),l.data=this.getHtml(n,this.editor.graph),l.xml=mxUtils.getXml(n),l.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;m=this.editor.graph.background;
|
||||
m==mxConstants.NONE&&(m=null);l.xml=this.getFileData(!0);l.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(m),
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(l),"*")}));return}m="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(m));l.data=this.createSvgDataUri(m)}k.postMessage(JSON.stringify(l),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(m=document.createElement("span"),mxUtils.write(m,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
|
||||
this.buttonContainer.appendChild(m),this.embedFilenameSpan=m),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var H=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
|
||||
1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=H();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=H();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
|
||||
b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):
|
||||
urlParams.ready||"ready";k.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
|
||||
"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
|
||||
a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
|
||||
function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,h="auto",k="auto",l=40,n=40,x=0,y=this.editor.graph;y.getGraphBounds();
|
||||
for(var B=function(){y.setSelectionCells(V);y.scrollCellToVisible(y.getSelectionCell())},F=y.getFreeInsertPoint(),C=F.x,D=F.y,F=D,E=null,A="auto",H=[],G=null,I=null,J=0;J<b.length&&"#"==b[J].charAt(0);){a=b[J];for(J++;J<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[J].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[J].substring(1)),J++;if("#"!=a.charAt(1)){var U=a.indexOf(":");if(0<U){var O=mxUtils.trim(a.substring(1,U)),L=mxUtils.trim(a.substring(U+1));"label"==O?E=y.sanitizeHtml(L):"style"==
|
||||
O?e=L:"identity"==O&&0<L.length&&"-"!=L?f=L:"width"==O?h=L:"height"==O?k=L:"ignore"==O?I=L.split(","):"connect"==O?H.push(JSON.parse(L)):"link"==O?G=L:"padding"==O?x=parseFloat(L):"edgespacing"==O?l=parseFloat(L):"nodespacing"==O?n=parseFloat(L):"layout"==O&&(A=L)}}}var P=this.editor.csvToArray(b[J]);a=null;if(null!=f)for(var N=0;N<P.length;N++)if(f==P[N]){a=N;break}null==E&&(E="%"+P[0]+"%");if(null!=H)for(var M=0;M<H.length;M++)null==d[H[M].to]&&(d[H[M].to]={});y.model.beginUpdate();try{for(N=J+
|
||||
1;N<b.length;N++){var W=this.editor.csvToArray(b[N]);if(W.length==P.length){var K=null,X=null!=a?W[a]:null;null!=X&&(K=y.model.getCell(X));null==K&&(K=new mxCell(E,new mxGeometry(C,F,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=X);for(var Q=0;Q<W.length;Q++)y.setAttributeForCell(K,P[Q],W[Q]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(M=0;M<H.length;M++)d[H[M].to][K.getAttribute(H[M].to)]=K;null!=G&&"link"!=G&&(y.setLinkForCell(K,K.getAttribute(G)),
|
||||
y.setAttributeForCell(K,G,null));y.fireEvent(new mxEventObject("cellsInserted","cells",[K]));var Y=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==h?Y.width+x:parseFloat(h);K.geometry.height="auto"==k?Y.height+x:parseFloat(k);F+=K.geometry.height+n;c.push(y.addCell(K))}}for(var R=c.slice(),V=c.slice(),M=0;M<H.length;M++)for(var T=H[M],N=0;N<c.length;N++){var K=c[N],S=K.getAttribute(T.from);if(null!=S){y.setAttributeForCell(K,T.from,null);for(var fa=S.split(","),Q=0;Q<fa.length;Q++){var ba=
|
||||
d[T.to][fa[Q]];null!=ba&&(V.push(y.insertEdge(null,null,T.label||"",T.invert?ba:K,T.invert?K:ba,T.style||y.createCurrentEdgeStyle())),mxUtils.remove(T.invert?K:ba,R))}}}if(null!=I)for(N=0;N<c.length;N++)for(K=c[N],Q=0;Q<I.length;Q++)y.setAttributeForCell(K,mxUtils.trim(I[Q]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=l;var ha=function(){ca.execute(y.getDefaultParent());for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==
|
||||
h&&(b.width=Math.round(y.snap(b.width)));"auto"==k&&(b.height=Math.round(y.snap(b.height)))}};if("circle"==A){var da=new mxCircleLayout(y);da.resetEdges=!1;var ia=da.isVertexIgnored;da.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,B);B=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==
|
||||
A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),0<R.length?R[0]:null)},!0,B);B=null}else if("horizontalflow"==A||"verticalflow"==A||"auto"==A&&1==R.length){y.view.validate();var ea=new mxHierarchicalLayout(y,"horizontalflow"==A?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=n;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),V);y.moveCells(V,C,D)},!0,B);B=null}else if("organic"==
|
||||
A||"auto"==A&&V.length>c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=l;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,B);B=null}this.hideDialog()}finally{y.model.endUpdate()}null!=B&&B()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b=
|
||||
"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
|
||||
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
|
||||
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 f=b.init;b.init=function(){f.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"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
|
||||
e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
|
||||
b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var d=applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
|
||||
"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b=
|
||||
'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+
|
||||
IMAGE_PATH+'/clear.gif"/>'}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
|
||||
EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
|
||||
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("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());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 n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);n.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=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(g.getSvg(d,e,f)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=g.getGraphBounds(),l=Math.floor(h.width*e/g.view.scale),m=Math.floor(h.height*e/g.view.scale);k.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+
|
||||
(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+f+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(I){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
|
||||
JSON.parse(h)}catch(G){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
|
||||
value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
|
||||
function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(G){k.postMessage(JSON.stringify({event:"draft",
|
||||
error:G.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
|
||||
return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
|
||||
null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var n=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(n);k.postMessage(JSON.stringify(b),"*")}),u=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
|
||||
h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),t=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,
|
||||
function(a){u(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){u(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):u(null)}),mxUtils.bind(this,function(){u(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");
|
||||
if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)n=this.editor.getGraphXml(),m.data=this.getHtml(n,this.editor.graph),m.xml=mxUtils.getXml(n),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";
|
||||
if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
|
||||
this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
|
||||
(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
|
||||
l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var H=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
|
||||
e=H();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=H();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
|
||||
b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=
|
||||
function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
|
||||
"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
|
||||
mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
|
||||
(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,f=null,h="auto",k="auto",l=40,n=40,x=0,y=this.editor.graph;y.getGraphBounds();for(var B=function(){y.setSelectionCells(V);
|
||||
y.scrollCellToVisible(y.getSelectionCell())},F=y.getFreeInsertPoint(),C=F.x,D=F.y,F=D,E=null,A="auto",H=[],G=null,I=null,J=0;J<b.length&&"#"==b[J].charAt(0);){a=b[J];for(J++;J<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[J].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[J].substring(1)),J++;if("#"!=a.charAt(1)){var U=a.indexOf(":");if(0<U){var O=mxUtils.trim(a.substring(1,U)),L=mxUtils.trim(a.substring(U+1));"label"==O?E=y.sanitizeHtml(L):"style"==O?e=L:"identity"==O&&0<L.length&&"-"!=L?f=
|
||||
L:"width"==O?h=L:"height"==O?k=L:"ignore"==O?I=L.split(","):"connect"==O?H.push(JSON.parse(L)):"link"==O?G=L:"padding"==O?x=parseFloat(L):"edgespacing"==O?l=parseFloat(L):"nodespacing"==O?n=parseFloat(L):"layout"==O&&(A=L)}}}var P=this.editor.csvToArray(b[J]);a=null;if(null!=f)for(var N=0;N<P.length;N++)if(f==P[N]){a=N;break}null==E&&(E="%"+P[0]+"%");if(null!=H)for(var M=0;M<H.length;M++)null==d[H[M].to]&&(d[H[M].to]={});y.model.beginUpdate();try{for(N=J+1;N<b.length;N++){var W=this.editor.csvToArray(b[N]);
|
||||
if(W.length==P.length){var K=null,X=null!=a?W[a]:null;null!=X&&(K=y.model.getCell(X));null==K&&(K=new mxCell(E,new mxGeometry(C,F,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=X);for(var Q=0;Q<W.length;Q++)y.setAttributeForCell(K,P[Q],W[Q]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(M=0;M<H.length;M++)d[H[M].to][K.getAttribute(H[M].to)]=K;null!=G&&"link"!=G&&(y.setLinkForCell(K,K.getAttribute(G)),y.setAttributeForCell(K,G,null));y.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[K]));var Y=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==h?Y.width+x:parseFloat(h);K.geometry.height="auto"==k?Y.height+x:parseFloat(k);F+=K.geometry.height+n;c.push(y.addCell(K))}}for(var R=c.slice(),V=c.slice(),M=0;M<H.length;M++)for(var T=H[M],N=0;N<c.length;N++){var K=c[N],S=K.getAttribute(T.from);if(null!=S){y.setAttributeForCell(K,T.from,null);for(var fa=S.split(","),Q=0;Q<fa.length;Q++){var ba=d[T.to][fa[Q]];null!=ba&&(V.push(y.insertEdge(null,null,T.label||
|
||||
"",T.invert?ba:K,T.invert?K:ba,T.style||y.createCurrentEdgeStyle())),mxUtils.remove(T.invert?K:ba,R))}}}if(null!=I)for(N=0;N<c.length;N++)for(K=c[N],Q=0;Q<I.length;Q++)y.setAttributeForCell(K,mxUtils.trim(I[Q]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=l;var ha=function(){ca.execute(y.getDefaultParent());for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==h&&(b.width=Math.round(y.snap(b.width)));"auto"==k&&(b.height=Math.round(y.snap(b.height)))}};
|
||||
if("circle"==A){var da=new mxCircleLayout(y);da.resetEdges=!1;var ia=da.isVertexIgnored;da.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,B);B=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),
|
||||
0<R.length?R[0]:null)},!0,B);B=null}else if("horizontalflow"==A||"verticalflow"==A||"auto"==A&&1==R.length){y.view.validate();var ea=new mxHierarchicalLayout(y,"horizontalflow"==A?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=n;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),V);y.moveCells(V,C,D)},!0,B);B=null}else if("organic"==A||"auto"==A&&V.length>c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*
|
||||
n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=l;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,B);B=null}this.hideDialog()}finally{y.model.endUpdate()}null!=B&&B()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
|
||||
b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
|
||||
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
|
||||
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 f=b.init;b.init=function(){f.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"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
|
||||
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
|
||||
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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("openLibraryFrom").setEnabled(c);this.menus.get("newLibrary").setEnabled(c);this.menus.get("extras").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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var d=
|
||||
applicationCache;if(null!=d&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",
|
||||
b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var l=EditorUi.prototype.updateActionStates;
|
||||
EditorUi.prototype.updateActionStates=function(){l.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);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("1"==urlParams.embed&&
|
||||
this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&!c.isRestricted());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 n=EditorUi.prototype.destroy;
|
||||
EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);n.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,f){var g=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(g.getSvg(d,
|
||||
e,f)),"image/svg+xml");else{var k=a.getFileData(!0,null,null,null,null,!0),h=g.getGraphBounds(),l=Math.floor(h.width*e/g.view.scale),n=Math.floor(h.height*e/g.view.scale);k.length<=MAX_REQUEST_SIZE&&l*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+n+"&border="+f+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
|
||||
|
@ -6982,8 +6981,8 @@ DriveClient.prototype.loadRealtime=function(a,b,d){if("1"==urlParams.ignoremime|
|
|||
function(a){window.clearTimeout(f);e&&b(a)}))});c()}else b();else this.redirectToNewApp(d,a.id)};
|
||||
DriveClient.prototype.getXmlFile=function(a,b,d,c,e,f){var k=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+k,mxUtils.bind(this,function(k){if(null==k)c({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||f)a.mimeType!=this.libraryMimeType||f?d(new DriveLibrary(this.ui,k,a)):c({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var l=k.lastIndexOf(",");0<l&&(l=this.ui.extractGraphModelFromPng(k.substring(l+
|
||||
1)),null!=l&&0<l.length&&(k=l))}var h=new DriveFile(this.ui,k,a,b);!e&&"850530949725"!=this.appId&&h.isEditable()&&a.mimeType!=this.mimeType?this.saveFile(h,!0,mxUtils.bind(this,function(a){h.desc=a;d(h)}),c,!0):d(h)}}),c,"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))};
|
||||
DriveClient.prototype.saveFile=function(a,b,d,c,e,f){if(a.isEditable()){var k=(new Date).getTime();e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;f=null!=f?f:!1;var l=mxUtils.bind(this,function(e,g,l){var h={mimeType:a.constructor==DriveLibrary?this.libraryMimeType:this.mimeType,title:a.getTitle()};l||(null!=e||f||(e=this.placeholderThumbnail,g=this.placeholderMimeType),null!=e&&null!=g&&(h.thumbnail={image:e,mimeType:g}));var m=function(){a.saveDelay=(new Date).getTime()-k;
|
||||
d.apply(this,arguments)},n=mxUtils.bind(this,function(d,e){this.executeRequest(this.createUploadRequest(a.getId(),h,d,b||a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,e),m,c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){n(a,!0)}),c,this.ui.getCurrentFile()!=a?a.getData():null):n(a.getData(),!1)}),n=mxUtils.bind(this,function(){!f&&a.constructor!=DriveLibrary&&this.enableThumbnails&&"0"!=urlParams.thumb&&this.ui.getThumbnail(this.thumbnailWidth,
|
||||
DriveClient.prototype.saveFile=function(a,b,d,c,e,f){if(a.isEditable()){var k=(new Date).getTime();e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;f=null!=f?f:!1;var l=mxUtils.bind(this,function(e,g,l){var h={mimeType:a.constructor==DriveLibrary?this.libraryMimeType:this.mimeType,title:a.getTitle()};l||(null!=e||f||(e=this.placeholderThumbnail,g=this.placeholderMimeType),null!=e&&null!=g&&(h.thumbnail={image:e,mimeType:g}));var n=function(){a.saveDelay=(new Date).getTime()-k;
|
||||
d.apply(this,arguments)},m=mxUtils.bind(this,function(d,e){this.executeRequest(this.createUploadRequest(a.getId(),h,d,b||a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,e),n,c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a,!0)}),c,this.ui.getCurrentFile()!=a?a.getData():null):m(a.getData(),!1)}),n=mxUtils.bind(this,function(){!f&&a.constructor!=DriveLibrary&&this.enableThumbnails&&"0"!=urlParams.thumb&&this.ui.getThumbnail(this.thumbnailWidth,
|
||||
mxUtils.bind(this,function(a){var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(m){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");l(b,"image/png")}))||l(null,null,a.constructor!=DriveLibrary)});e||!b?n():this.verifyMimeType(a.getId(),n,!0)}else this.ui.editor.graph.reset(),null!=c&&c({message:mxResources.get("readOnly")})};
|
||||
DriveClient.prototype.verifyMimeType=function(a,b,d,c){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(d||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(d){this.checkingMimeType=!1;null!=d&&"application/vnd.jgraph.mxfile.realtime"==d.mimeType?this.redirectToNewApp(c,a):null!=
|
||||
b&&b()})))};
|
||||
|
@ -7067,7 +7066,7 @@ this.contentChanged();null!=d&&d()}),mxUtils.bind(this,function(a){this.savingFi
|
|||
GitHubClient.prototype.updateUser=function(a,b,d){var c=!0,e=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT})}),this.ui.timeout);mxUtils.get(this.baseUrl+"/user?access_token="+this.token,mxUtils.bind(this,function(f){window.clearTimeout(e);c&&(401===f.getStatus()?d?b({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,b,!0)}),b)):200>f.getStatus()||300<=f.getStatus()?b({message:mxResources.get("accessDenied")}):
|
||||
(f=JSON.parse(f.getText()),this.setUser(new DrawioUser(f.id,f.email,f.name)),a()))}))};
|
||||
GitHubClient.prototype.authenticate=function(a,b){if(null==window.onGitHubCallback){var d=mxUtils.bind(this,function(){var c=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(e,f){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(k,l){if(c)if(window.onGitHubCallback=null,c=!1,null==k)b({message:mxResources.get("accessDenied"),retry:d});else{var n=mxUtils.bind(this,function(){var c=
|
||||
!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(g){window.clearTimeout(d);if(c)try{if(200>g.getStatus()||300<=g.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=f&&f();var k=g.getText();this.token=k.substring(k.indexOf("=")+1,k.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){b(t)}finally{null!=l&&
|
||||
!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b({code:App.ERROR_TIMEOUT,retry:n})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+k,mxUtils.bind(this,function(g){window.clearTimeout(d);if(c)try{if(200>g.getStatus()||300<=g.getStatus())b({message:mxResources.get("cannotLogin")});else{null!=f&&f();var h=g.getText();this.token=h.substring(h.indexOf("=")+1,h.indexOf("&"));this.setUser(null);e&&this.setPersistentToken(this.token);a()}}catch(t){b(t)}finally{null!=l&&
|
||||
l.close()}}))});n()}else null!=l&&l.close()}):b({message:mxResources.get("serviceUnavailableOrBlocked"),retry:d})}),mxUtils.bind(this,function(){c&&(window.onGitHubCallback=null,c=!1,b({message:mxResources.get("accessDenied"),retry:d}))}))});d()}else b({code:App.ERROR_BUSY})};
|
||||
GitHubClient.prototype.executeRequest=function(a,b,d){var c=mxUtils.bind(this,function(f){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT,retry:e})}),this.ui.timeout),n=this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization","token "+n)};a.send(mxUtils.bind(this,function(){window.clearTimeout(l);if(k)if(200<=a.getStatus()&&299>=a.getStatus())b(a);else if(401===a.getStatus())f?d({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,
|
||||
function(){this.authenticate(function(){e(!0)},d)})}):this.authenticate(function(){c(!0)},d);else if(403===a.getStatus()){var h=!1;try{var g=JSON.parse(a.getText());null!=g&&null!=g.errors&&0<g.errors.length&&(h="too_large"==g.errors[0].code)}catch(m){}d({message:mxResources.get(h?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?d({message:mxResources.get("fileNotFound")}):409===a.getStatus()?d({status:409}):d({message:mxResources.get("error")+" "+a.getStatus()})}),d)}),e=mxUtils.bind(this,
|
||||
|
@ -7099,17 +7098,16 @@ TrelloFile.prototype.save=function(a,b,d){this.doSave(this.getTitle(),b,d)};Trel
|
|||
TrelloFile.prototype.saveFile=function(a,b,d,c){if(this.isEditable())if(this.savingFile)null!=c&&(this.saveNeededCounter++,c({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.getTitle()==a){var e=this.isModified,f=this.isModified(),k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});k();this.ui.trello.saveFile(this,mxUtils.bind(this,function(f){this.savingFile=!1;this.isModified=e;this.meta=f;this.contentChanged();null!=d&&d();0<this.saveNeededCounter&&
|
||||
(this.saveNeededCounter--,this.saveFile(a,b,d,c))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(f||this.isModified());if(null!=c){if(null!=a&&null!=a.retry){var b=a.retry;a.retry=function(){k();b()}}c(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(e){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(e){this.savingFile=!1;null!=d&&d();this.ui.fileLoaded(e);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,
|
||||
b,d,c))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}),!1,e)}));else null!=d&&d()};TrelloLibrary=function(a,b,d){TrelloFile.call(this,a,b,d)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(a,b,d){this.saveFile(a,!1,b,d)};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";
|
||||
TrelloClient.prototype.authenticate=function(a,b){var d=mxUtils.bind(this,function(c){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:c?"never":"1hour",success:a,error:b})});this.isAuthorized()?d(!0):this.ui.showAuthDialog(this,!0,d)};TrelloClient.prototype.getLibrary=function(a,b,d){this.getFile(a,b,d,!1,!0)};
|
||||
TrelloClient.prototype.getFile=function(a,b,d,c,e){e=null!=e?e:!1;c=mxUtils.bind(this,function(){var c=a.split(this.SEPARATOR);Trello.cards.get(c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(c){var f=/\.png$/i.test(c.name);if(/\.vsdx$/i.test(c.name)||/\.gliffy$/i.test(c.name)||!this.ui.useCanvasForExport&&f)this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(c.url),c.name,c.mimeType,this.extension,b,d);else{var k=!0,h=window.setTimeout(mxUtils.bind(this,function(){k=!1;d({code:App.ERROR_TIMEOUT})}),
|
||||
this.ui.timeout);this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(c.url),mxUtils.bind(this,function(d){window.clearTimeout(h);if(k){c.compoundId=a;var g=f?d.lastIndexOf(","):-1;0<g&&(g=this.ui.extractGraphModelFromPng(d.substring(g+1)),null!=g&&0<g.length&&(d=g));e?b(new TrelloLibrary(this.ui,d,c)):b(new TrelloFile(this.ui,d,c))}}),mxUtils.bind(this,function(a){window.clearTimeout(h);k&&d()}),f||null!=c.mimeType&&"image/"==c.mimeType.substring(0,6))}}))});this.authenticate(c,d)};
|
||||
TrelloClient.prototype.insertLibrary=function(a,b,d,c,e){this.insertFile(a,b,d,c,!0,e)};
|
||||
TrelloClient.prototype.authenticate=function(a,b,d){d&&this.logout();d=mxUtils.bind(this,function(c){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:c?"never":"1hour",success:a,error:b})});this.isAuthorized()?d(!0):this.ui.showAuthDialog(this,!0,d)};TrelloClient.prototype.getLibrary=function(a,b,d){this.getFile(a,b,d,!1,!0)};
|
||||
TrelloClient.prototype.getFile=function(a,b,d,c,e){e=null!=e?e:!1;var f=mxUtils.bind(this,function(){var c=a.split(this.SEPARATOR),l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;d({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout);Trello.cards.get(c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(c){window.clearTimeout(n);if(l){var g=/\.png$/i.test(c.name);/\.vsdx$/i.test(c.name)||/\.gliffy$/i.test(c.name)||!this.ui.useCanvasForExport&&g?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(c.url),
|
||||
c.name,c.mimeType,this.extension,b,d):(l=!0,n=window.setTimeout(mxUtils.bind(this,function(){l=!1;d({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.loadUrl(PROXY_URL+"?url="+encodeURIComponent(c.url),mxUtils.bind(this,function(d){window.clearTimeout(n);if(l){c.compoundId=a;var f=g?d.lastIndexOf(","):-1;0<f&&(f=this.ui.extractGraphModelFromPng(d.substring(f+1)),null!=f&&0<f.length&&(d=f));e?b(new TrelloLibrary(this.ui,d,c)):b(new TrelloFile(this.ui,d,c))}}),mxUtils.bind(this,function(a,b){window.clearTimeout(n);
|
||||
l&&(401==b.status?this.authenticate(f,d,!0):d())}),g||null!=c.mimeType&&"image/"==c.mimeType.substring(0,6)))}}),mxUtils.bind(this,function(a){window.clearTimeout(n);l&&(401==a.status?this.authenticate(f,d,!0):d())}))});this.authenticate(f,d)};TrelloClient.prototype.insertLibrary=function(a,b,d,c,e){this.insertFile(a,b,d,c,!0,e)};
|
||||
TrelloClient.prototype.insertFile=function(a,b,d,c,e,f){e=null!=e?e:!1;var k=mxUtils.bind(this,function(){var k=mxUtils.bind(this,function(k){this.writeFile(a,k,f,mxUtils.bind(this,function(a){e?d(new TrelloLibrary(this.ui,b,a)):d(new TrelloFile(this.ui,b,a))}),c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){k(this.ui.base64ToBlob(a,"image/png"))}),c,b):k(b)});this.authenticate(k,c)};
|
||||
TrelloClient.prototype.saveFile=function(a,b,d){var c=a.meta.compoundId.split(this.SEPARATOR);Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){var e=mxUtils.bind(this,function(e){Trello.del("cards/"+c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(){this.writeFile(a.meta.name,e,c[0],b,d)}),d)});this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,
|
||||
"image/png"))}),d,this.ui.getCurrentFile()!=a?a.getData():null):e(a.getData())}),error:d})};
|
||||
TrelloClient.prototype.writeFile=function(a,b,d,c,e){if(null!=a&&null!=b)if(b.length>=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;e({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),n=new FormData;
|
||||
n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof b?new Blob([b]):b,a);n.append("name",a);var h=new XMLHttpRequest;h.responseType="json";h.onreadystatechange=mxUtils.bind(this,function(){if(4===h.readyState&&(window.clearTimeout(l),k))if(200==h.status){var a=h.response;a.compoundId=d+this.SEPARATOR+a.id;c(a)}else e()});h.open("POST",this.baseUrl+"cards/"+d+"/attachments");h.send(n)}),error:e})});f()}else e({message:mxResources.get("unknownError")})};
|
||||
TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};TrelloClient.prototype.pickFolder=function(a){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})};
|
||||
TrelloClient.prototype.pickFile=function(a,b){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:"never",success:mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})};
|
||||
TrelloClient.prototype.saveFile=function(a,b,d){var c=a.meta.compoundId.split(this.SEPARATOR),e=mxUtils.bind(this,function(e){Trello.del("cards/"+c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(){this.writeFile(a.meta.name,e,c[0],b,d)}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(f,d,!0):d()}))}),f=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(a.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){e(this.ui.base64ToBlob(a,"image/png"))}),
|
||||
d,this.ui.getCurrentFile()!=a?a.getData():null):e(a.getData())});this.authenticate(f,d)};
|
||||
TrelloClient.prototype.writeFile=function(a,b,d,c,e){if(null!=a&&null!=b)if(b.length>=this.maxFileSize)e({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(b.length)+" / 10 MB)"});else{var f=mxUtils.bind(this,function(){var k=!0,l=window.setTimeout(mxUtils.bind(this,function(){k=!1;e({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),n=new FormData;n.append("key",Trello.key());n.append("token",Trello.token());n.append("file","string"===typeof b?new Blob([b]):b,a);n.append("name",
|
||||
a);var h=new XMLHttpRequest;h.responseType="json";h.onreadystatechange=mxUtils.bind(this,function(){if(4===h.readyState&&(window.clearTimeout(l),k))if(200==h.status){var a=h.response;a.compoundId=d+this.SEPARATOR+a.id;c(a)}else 401==h.status?this.authenticate(f,e,!0):e()});h.open("POST",this.baseUrl+"cards/"+d+"/attachments");h.send(n)});this.authenticate(f,e)}else e({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(a){this.pickFile(a)};
|
||||
TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};TrelloClient.prototype.pickFile=function(a,b){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("T"+encodeURIComponent(a))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,a)}),mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}))};
|
||||
TrelloClient.prototype.showTrelloDialog=function(a,b){var d=null,c=null,e=0,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.height="224px";var k=document.createElement("h3");mxUtils.write(k,a?mxResources.get("selectFile"):mxResources.get("selectCard"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="auto";l.style.height="194px";
|
||||
f.appendChild(l);f=new CustomDialog(this.ui,f);this.ui.showDialog(f.container,340,270,!0,!0);f.okButton.parentNode.removeChild(f.okButton);var n=mxUtils.bind(this,function(a,b,c){e++;var d=document.createElement("div");d.style="width:100%;vertical-align:middle;background:"+(0==e%2?"#eee":"#fff");var f=document.createElement("a");f.setAttribute("href","javascript:void(0);");if(null!=c){var g=document.createElement("img");g.src=c.url;g.width=c.width;g.height=c.height;g.style="border: 1px solid black;margin:5px;vertical-align:middle";
|
||||
f.appendChild(g)}mxUtils.write(f,a);mxEvent.addListener(f,"click",b);d.appendChild(f);return d}),h=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),g=mxUtils.bind(this,function(){e=0;l.innerHTML="";this.ui.spinner.spin(l,mxResources.get("loading"));Trello.cards.get(d+"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(a){this.ui.spinner.stop();l.appendChild(n("../ [Up]",mxUtils.bind(this,function(){t()})));
|
||||
|
@ -7117,7 +7115,7 @@ mxUtils.br(l);null==a||0==a.length?mxUtils.write(l,mxResources.get("noFiles")):m
|
|||
m=document.createElement("a");m.style.display="block";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("more")+"...");var k=mxUtils.bind(this,function(){mxEvent.removeListener(l,"scroll",p);t(f+1)});mxEvent.addListener(m,"click",k);Trello.get("search",{query:null!=c?c:"is:open",cards_limit:100,cards_page:f-1},mxUtils.bind(this,function(e){this.ui.spinner.stop();e=null!=e?e.cards:null;if(null==e||0==e.length)null!=c&&(l.appendChild(n(mxResources.get("clearFilter"),mxUtils.bind(this,
|
||||
function(){c=null;t()}))),mxUtils.br(l)),mxUtils.write(l,mxResources.get("noFiles"));else{1==f&&(null!=c?l.appendChild(n(mxResources.get("clearFilter"),mxUtils.bind(this,function(){c=null;t()}))):l.appendChild(n(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"is:open",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(c=a,t())}),mxResources.get("cardName"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
|
||||
this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(l));for(var h=0;h<e.length;h++)mxUtils.bind(this,function(c){l.appendChild(n(c.name,mxUtils.bind(this,function(){a?(d=c.id,g()):(this.ui.hideDialog(),b(c.id))})))})(e[h]);100==e.length&&(l.appendChild(m),p=function(){l.scrollTop>=l.scrollHeight-l.offsetHeight&&k()},mxEvent.addListener(l,"scroll",p))}}),h)});t()};TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};
|
||||
TrelloClient.prototype.logout=function(){Trello.deauthorize()};function ChatWindow(a,b,d,c,e,f,k,l){this.editorUi=a;this.doc=l.doc;this.rtModel=l.rt;this.chatHistory=l.chatHistory;this.chatMap=l.chatMap;this.configCollabInfo();d=document.createElement("div");d.id="mainDiv";l=document.createElement("div");l.style.padding="3px";d.appendChild(l);var n=document.createElement("div");n.style.paddingLeft="3px";n.style.paddingRight="15px";a.editor.graph.isEnabled()&&d.appendChild(n);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
|
||||
TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};function ChatWindow(a,b,d,c,e,f,k,l){this.editorUi=a;this.doc=l.doc;this.rtModel=l.rt;this.chatHistory=l.chatHistory;this.chatMap=l.chatMap;this.configCollabInfo();d=document.createElement("div");d.id="mainDiv";l=document.createElement("div");l.style.padding="3px";d.appendChild(l);var n=document.createElement("div");n.style.paddingLeft="3px";n.style.paddingRight="15px";a.editor.graph.isEnabled()&&d.appendChild(n);this.chatArea=document.createElement("div");this.chatArea.style.backgroundColor="white";
|
||||
this.chatArea.style.overflowX="hidden";this.chatArea.style.overflowY="auto";this.chatArea.style.width="98%";this.chatArea.style.resize="none";l.appendChild(this.chatArea);this.chatLineArea=document.createElement("textarea");this.chatLineArea.style.resize="none";this.chatLineArea.rows=1;this.chatLineArea.onkeydown=mxUtils.bind(this,function(a){13==(a.keyCode||window.event.keyCode)&&""!=this.chatLineArea.value&&this.sendMessage()});this.sendBtn=document.createElement("button");this.sendBtn.style.cssFloat=
|
||||
"right";this.sendBtn.style.styleFloat="right";mxUtils.write(this.sendBtn,mxResources.get("sendMessage"));mxEvent.addListener(this.sendBtn,"click",mxUtils.bind(this,function(a){""!=this.chatLineArea.value&&this.sendMessage()}));n.appendChild(this.chatLineArea);n.appendChild(this.sendBtn);this.window=new mxWindow(b,d,c,e,f,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!0);this.window.setScrollable(!0);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
|
||||
this.handleResize();this.window.addListener(mxEvent.RESIZE,mxUtils.bind(this,this.handleResize));this.window.addListener(mxEvent.MAXIMIZE,mxUtils.bind(this,this.handleResize));this.window.addListener(mxEvent.NORMALIZE,mxUtils.bind(this,this.handleResize));if(null!=this.chatHistory){for(a=Math.max(0,this.chatHistory.length-this.chatHistoryShow);a<this.chatHistory.length;a++)this.updateChatArea(this.chatHistory.get(a));this.chatHistory.addEventListener(gapi.drive.realtime.EventType.VALUES_ADDED,mxUtils.bind(this,
|
||||
|
|
107
war/js/atlas-viewer.min.js
vendored
107
war/js/atlas-viewer.min.js
vendored
|
@ -2179,7 +2179,7 @@ this.getRubberband=function(){return g};var p=(new Date).getTime(),n=0,q=this.co
|
|||
"outlineConnect","1"))&&k.apply(this,arguments)};var w=this.isToggleEvent;this.isToggleEvent=function(a){return w.apply(this,arguments)||mxEvent.isShiftDown(a)};var x=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var u=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
|
||||
(u=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=u)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return y.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
|
||||
var v=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return v.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,g){g=null!=g?g:[];if(0<b||0<d){var e=this.getModel(),k=a+b,p=c+d;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var n=e.getChildCount(f),O=0;O<n;O++){var q=
|
||||
e.getChildAt(f,O),w=this.view.getState(q);if(null!=w&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(w.style,"locked","0")){var u=mxUtils.getValue(w.style,mxConstants.STYLE_ROTATION)||0;0!=u&&(w=mxUtils.getBoundingBox(w,u));(e.isEdge(q)||e.isVertex(q))&&w.x>=a&&w.y+w.height<=p&&w.y>=c&&w.x+w.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
|
||||
e.getChildAt(f,O),u=this.view.getState(q);if(null!=u&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var w=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(u=mxUtils.getBoundingBox(u,w));(e.isEdge(q)||e.isVertex(q))&&u.x>=a&&u.y+u.height<=p&&u.y>=c&&u.x+u.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
|
||||
!1:G.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();F=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
|
||||
mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=F?this.addSelectionCells(F):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);F=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=
|
||||
function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var E=this.updateMouseEvent;this.updateMouseEvent=function(a){a=E.apply(this,arguments);this.isCellLocked(a.getCell())&&(a.state=null);return a}}};
|
||||
|
@ -2293,7 +2293,7 @@ JSON.parse(b),b=0;b<f.length;b++){var g=f[b];d.push(new mxConnectionConstraint(n
|
|||
mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,d=0;d<c;d++){var f=this.model.getChildAt(a,d);this.model.isVertex(f)&&(f=this.getCellGeometry(f),null==f||f.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,
|
||||
"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),
|
||||
null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var d=0;d<a.length;d++){var f=a[d];if(c.isEdge(f)){var g=c.getTerminal(f,!0),e=c.getTerminal(f,!1);c.setTerminal(f,
|
||||
e,!0);c.setTerminal(f,g,!1);var k=c.getGeometry(f);if(null!=k){k=k.clone();null!=k.points&&k.points.reverse();var p=k.getTerminalPoint(!0),n=k.getTerminalPoint(!1);k.setTerminalPoint(p,!1);k.setTerminalPoint(n,!0);c.setGeometry(f,k);var q=this.view.getState(f),w=this.view.getState(g),u=this.view.getState(e);if(null!=q){var x=null!=w?this.getConnectionConstraint(q,w,!0):null,O=null!=u?this.getConnectionConstraint(q,u,!1):null;this.setConnectionConstraint(f,g,!0,O);this.setConnectionConstraint(f,e,
|
||||
e,!0);c.setTerminal(f,g,!1);var k=c.getGeometry(f);if(null!=k){k=k.clone();null!=k.points&&k.points.reverse();var p=k.getTerminalPoint(!0),n=k.getTerminalPoint(!1);k.setTerminalPoint(p,!1);k.setTerminalPoint(n,!0);c.setGeometry(f,k);var q=this.view.getState(f),u=this.view.getState(g),w=this.view.getState(e);if(null!=q){var x=null!=u?this.getConnectionConstraint(q,u,!0):null,O=null!=w?this.getConnectionConstraint(q,w,!1):null;this.setConnectionConstraint(f,g,!0,O);this.setConnectionConstraint(f,e,
|
||||
!1,x)}b.push(f)}}else if(c.isVertex(f)&&(k=this.getCellGeometry(f),null!=k)){k=k.clone();k.x+=k.width/2-k.height/2;k.y+=k.height/2-k.width/2;var h=k.width;k.width=k.height;k.height=h;c.setGeometry(f,k);var v=this.view.getState(f);if(null!=v){var r=v.style[mxConstants.STYLE_DIRECTION]||"east";"east"==r?r="south":"south"==r?r="west":"west"==r?r="north":"north"==r&&(r="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,r,[f])}b.push(f)}}}finally{c.endUpdate()}return b};Graph.prototype.processChange=
|
||||
function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var b=0;b<c.length;b++)this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,c,b){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=
|
||||
a.getAttribute("placeholder"),f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(d)){this.setAttributeForCell(f,d,c);break}f=this.model.getParent(f)}var g=a.value.cloneNode(!0);g.setAttribute("label",c);c=g}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var d=this.view.getState(a[b]);if(null!=d){var f=
|
||||
|
@ -2318,9 +2318,9 @@ q=this.getCellGeometry(b[g].cell),d=d+p;null!=q&&null!=n&&(q=q.clone(),a?q.x=Mat
|
|||
this.view.getState(a[d]);if(null!=f){var g=this.getCellGeometry(c[d]);null==g||!g.relative||this.model.isEdge(a[d])||b.get(this.model.getParent(a[d]))||(g.relative=!1,g.x=f.x/f.view.scale-f.view.translate.x,g.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;g=f.getChildAt(f.getRoot(),0);for(d=0;d<a.length;d++)f.add(g,c[d]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});
|
||||
return a};Graph.prototype.getSvg=function(a,c,b,d,f,g,e){c=null!=c?c:1;b=null!=b?b:0;f=null!=f?f:!0;g=null!=g?g:!0;e=null!=e?e:!0;var k=g||d?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==k)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,n=mxUtils.createXmlDocument();d=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=d.style?d.style.backgroundColor=a:d.setAttribute("style","background-color:"+
|
||||
a));null==n.createElementNS?(d.setAttribute("xmlns",mxConstants.NS_SVG),d.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/p;d.setAttribute("width",Math.max(1,Math.ceil(k.width*a)+2*b)+"px");d.setAttribute("height",Math.max(1,Math.ceil(k.height*a)+2*b)+"px");d.setAttribute("version","1.1");var q=d;f&&(q=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),q.setAttribute("transform",
|
||||
"translate(0.5,0.5)"),d.appendChild(q));n.appendChild(d);n=this.createSvgCanvas(q);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-k.x)/p),Math.floor((b/c-k.y)/p));var w=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,g,e,k,p,n,q,u,x){var h=this.state;if(null!=this.foAltText&&(0==d||0!=h.fontSize&&g.length<5*d/h.fontSize)){var r=this.createElement("text");r.setAttribute("x",Math.round(d/2));r.setAttribute("y",Math.round((f+h.fontSize)/
|
||||
"translate(0.5,0.5)"),d.appendChild(q));n.appendChild(d);n=this.createSvgCanvas(q);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-k.x)/p),Math.floor((b/c-k.y)/p));var u=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,g,e,k,p,n,q,w,x){var h=this.state;if(null!=this.foAltText&&(0==d||0!=h.fontSize&&g.length<5*d/h.fontSize)){var r=this.createElement("text");r.setAttribute("x",Math.round(d/2));r.setAttribute("y",Math.round((f+h.fontSize)/
|
||||
2));r.setAttribute("fill",h.fontColor||"black");r.setAttribute("text-anchor","middle");r.setAttribute("font-size",Math.round(h.fontSize)+"px");r.setAttribute("font-family",h.fontFamily);(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&r.setAttribute("font-weight","bold");(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&r.setAttribute("font-style","italic");(h.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&r.setAttribute("text-decoration","underline");
|
||||
mxUtils.write(r,g);return r}return w.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(k,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=e;e=this.createSvgImageExport();var u=e.drawCellState;e.drawCellState=function(a,c){(g||a.view.graph.isCellSelected(a.cell))&&u.apply(this,arguments)};e.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
|
||||
mxUtils.write(r,g);return r}return u.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(k,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=e;e=this.createSvgImageExport();var w=e.drawCellState;e.drawCellState=function(a,c){(g||a.view.graph.isCellSelected(a.cell))&&w.apply(this,arguments)};e.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
|
||||
function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=
|
||||
window.getSelection(),c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],d=0<b.rows.length?b.rows[0].cells.length:1,b=b.insertRow(c),f=0;f<d;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};
|
||||
Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var d=0;d<b.rows.length;d++){var f=document.createElement("th");b.rows[d].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(d=0;d<b.rows.length;d++)f=b.rows[d].insertCell(c),mxUtils.br(f);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,d=0;d<b.length;d++)b[d].cells.length>c&&b[d].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;
|
||||
|
@ -2426,8 +2426,8 @@ x.prototype.redrawPath=function(a,c,b,d,f){c=mxUtils.getValue(this.style,mxConst
|
|||
0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],this.isRounded,b,!0)};mxCellRenderer.prototype.defaultShapes.hexagon=y;mxUtils.extend(v,mxRectangleShape);v.prototype.isHtmlAllowed=function(){return!1};v.prototype.paintForeground=function(a,c,b,d,f){var g=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+g);a.lineTo(c+d/2,b+f-g);a.moveTo(c+g,b+f/2);a.lineTo(c+d-g,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.plus=
|
||||
v;var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,d,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var g=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
|
||||
0);c+=g;b+=g;d-=2*g;f-=2*g;0<d&&0<f&&(a.setShadow(!1),Ca.apply(this,[a,c,b,d,f]))}};mxUtils.extend(G,mxRectangleShape);G.prototype.isHtmlAllowed=function(){return!1};G.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};G.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var g=
|
||||
Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=g;b+=g;d-=2*g;f-=2*g;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var g=0,e;do{e=mxCellRenderer.prototype.defaultShapes[this.style["symbol"+g]];if(null!=e){var k=this.style["symbol"+g+"Align"],la=this.style["symbol"+g+"VerticalAlign"],p=this.style["symbol"+g+"Width"],n=this.style["symbol"+g+"Height"],q=this.style["symbol"+g+"Spacing"]||0,w=this.style["symbol"+g+"VSpacing"]||
|
||||
q,u=this.style["symbol"+g+"ArcSpacing"];null!=u&&(u*=this.getArcSize(d+this.strokewidth,f+this.strokewidth),q+=u,w+=u);var u=c,x=b,u=k==mxConstants.ALIGN_CENTER?u+(d-p)/2:k==mxConstants.ALIGN_RIGHT?u+(d-p-q):u+q,x=la==mxConstants.ALIGN_MIDDLE?x+(f-n)/2:la==mxConstants.ALIGN_BOTTOM?x+(f-n-w):x+w;a.save();k=new e;k.style=this.style;e.prototype.paintVertexShape.call(k,a,u,x,p,n);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.ext=
|
||||
Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=g;b+=g;d-=2*g;f-=2*g;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var g=0,e;do{e=mxCellRenderer.prototype.defaultShapes[this.style["symbol"+g]];if(null!=e){var k=this.style["symbol"+g+"Align"],la=this.style["symbol"+g+"VerticalAlign"],p=this.style["symbol"+g+"Width"],n=this.style["symbol"+g+"Height"],q=this.style["symbol"+g+"Spacing"]||0,u=this.style["symbol"+g+"VSpacing"]||
|
||||
q,w=this.style["symbol"+g+"ArcSpacing"];null!=w&&(w*=this.getArcSize(d+this.strokewidth,f+this.strokewidth),q+=w,u+=w);var w=c,x=b,w=k==mxConstants.ALIGN_CENTER?w+(d-p)/2:k==mxConstants.ALIGN_RIGHT?w+(d-p-q):w+q,x=la==mxConstants.ALIGN_MIDDLE?x+(f-n)/2:la==mxConstants.ALIGN_BOTTOM?x+(f-n-u):x+u;a.save();k=new e;k.style=this.style;e.prototype.paintVertexShape.call(k,a,w,x,p,n);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.ext=
|
||||
G;mxUtils.extend(F,mxCylinder);F.prototype.redrawPath=function(a,c,b,d,f,g){g?(a.moveTo(0,0),a.lineTo(d/2,f/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(0,f),a.close())};mxCellRenderer.prototype.defaultShapes.message=F;mxUtils.extend(E,mxShape);E.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.ellipse(d/4,0,d/2,f/4);a.fillAndStroke();a.begin();a.moveTo(d/2,f/4);a.lineTo(d/2,2*f/3);a.moveTo(d/2,f/3);a.lineTo(0,f/3);a.moveTo(d/2,f/3);a.lineTo(d,f/3);
|
||||
a.moveTo(d/2,2*f/3);a.lineTo(0,f);a.moveTo(d/2,2*f/3);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlActor=E;mxUtils.extend(D,mxShape);D.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};D.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(d/6,f/2);a.end();a.stroke();a.ellipse(d/6,0,5*d/6,f);a.fillAndStroke()};mxCellRenderer.prototype.defaultShapes.umlBoundary=
|
||||
D;mxUtils.extend(A,mxEllipse);A.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/8,b+f);a.lineTo(c+7*d/8,b+f);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlEntity=A;mxUtils.extend(z,mxShape);z.prototype.paintVertexShape=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(d,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlDestroy=z;mxUtils.extend(B,
|
||||
|
@ -2802,7 +2802,7 @@ g=parseInt(d.getAttribute("width")),k=parseInt(d.getAttribute("height"));l=null!
|
|||
this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(v,d,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(e)}catch(B){null!=n&&n(B)}}),d,r)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;a.convert=function(c){null!=c&&("http://"!=
|
||||
c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var k=a.getElementsByTagName(d),p=0;p<k.length;p++)mxUtils.bind(this,function(d){var k=e.convert(d.getAttribute(g));if(null!=k&&
|
||||
"data:"!=k.substring(0,5)){var p=f[k];null==p?(c++,this.convertImageToDataUri(k,function(e){null!=e&&(f[k]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,p)}})(k[p])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,n,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);n=null!=n?n:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
|
||||
b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN})}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){n&&null!=d&&d({code:App.ERROR_TIMEOUT,
|
||||
b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){n&&null!=d&&d({code:App.ERROR_TIMEOUT,
|
||||
retry:f})})});f()}catch(x){null!=d&&d(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=function(){var a=document.createElement("canvas"),
|
||||
d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,n){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),p=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=p&&"mxfile"==p.nodeName&&null!=this.pages){var h=p.getElementsByTagName("diagram");if(1==h.length)p=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(h[0]))).documentElement;
|
||||
else if(1<h.length){f.model.beginUpdate();try{for(var l=0;l<h.length;l++){var m=this.updatePageRoot(new DiagramPage(h[l])),r=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[r+1]));f.model.execute(new ChangePage(this,m,m,r))}}finally{f.model.endUpdate()}}}if(null!=p&&"mxGraphModel"===p.nodeName){var t=new mxGraphModel;(new mxCodec(p.ownerDocument)).decode(p,t);var E=t.getChildCount(t.getRoot());f.model.getChildCount(f.model.getRoot());f.model.beginUpdate();try{a={};
|
||||
|
@ -2883,53 +2883,52 @@ function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatCont
|
|||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
|
||||
null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
|
||||
this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
|
||||
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(H){}return a}if(!/https:\/\/.*\.googleapis\.com$/.test(f.origin)&&!/https:\/\/.*\.google\.com$/.test(f.origin)){var h=
|
||||
f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(J){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=
|
||||
a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",
|
||||
result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
|
||||
try{l.init()}catch(J){k.postMessage(JSON.stringify({event:"draft",error:J.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,
|
||||
function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==
|
||||
h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(b),"*")}),r=mxUtils.bind(this,function(a){null==
|
||||
a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),t=n.getGlobalVariable,z=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(n.container);
|
||||
n.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){r(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){r(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=
|
||||
h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
|
||||
l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
|
||||
this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(J){this.handleError(J)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var B=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
|
||||
1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=B();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=B();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
|
||||
b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):
|
||||
urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
|
||||
"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
|
||||
a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
|
||||
function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,r=40,t=0,v=this.editor.graph;v.getGraphBounds();
|
||||
for(var G=function(){v.setSelectionCells(W);v.scrollCellToVisible(v.getSelectionCell())},F=v.getFreeInsertPoint(),E=F.x,D=F.y,F=D,A=null,z="auto",B=[],J=null,H=null,M=0;M<b.length&&"#"==b[M].charAt(0);){a=b[M];for(M++;M<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[M].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[M].substring(1)),M++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var L=mxUtils.trim(a.substring(1,Y)),N=mxUtils.trim(a.substring(Y+1));"label"==L?A=v.sanitizeHtml(N):"style"==
|
||||
L?e=N:"identity"==L&&0<N.length&&"-"!=N?h=N:"width"==L?k=N:"height"==L?l=N:"ignore"==L?H=N.split(","):"connect"==L?B.push(JSON.parse(N)):"link"==L?J=N:"padding"==L?t=parseFloat(N):"edgespacing"==L?m=parseFloat(N):"nodespacing"==L?r=parseFloat(N):"layout"==L&&(z=N)}}}var O=this.editor.csvToArray(b[M]);a=null;if(null!=h)for(var K=0;K<O.length;K++)if(h==O[K]){a=K;break}null==A&&(A="%"+O[0]+"%");if(null!=B)for(var I=0;I<B.length;I++)null==d[B[I].to]&&(d[B[I].to]={});v.model.beginUpdate();try{for(K=M+
|
||||
1;K<b.length;K++){var V=this.editor.csvToArray(b[K]);if(V.length==O.length){var C=null,U=null!=a?V[a]:null;null!=U&&(C=v.model.getCell(U));null==C&&(C=new mxCell(A,new mxGeometry(E,F,0,0),e||"whiteSpace=wrap;html=1;"),C.vertex=!0,C.id=U);for(var R=0;R<V.length;R++)v.setAttributeForCell(C,O[R],V[R]);v.setAttributeForCell(C,"placeholders","1");C.style=v.replacePlaceholders(C,C.style);for(I=0;I<B.length;I++)d[B[I].to][C.getAttribute(B[I].to)]=C;null!=J&&"link"!=J&&(v.setLinkForCell(C,C.getAttribute(J)),
|
||||
v.setAttributeForCell(C,J,null));v.fireEvent(new mxEventObject("cellsInserted","cells",[C]));var X=this.editor.graph.getPreferredSizeForCell(C);C.geometry.width="auto"==k?X.width+t:parseFloat(k);C.geometry.height="auto"==l?X.height+t:parseFloat(l);F+=C.geometry.height+r;c.push(v.addCell(C))}}for(var P=c.slice(),W=c.slice(),I=0;I<B.length;I++)for(var S=B[I],K=0;K<c.length;K++){var C=c[K],T=C.getAttribute(S.from);if(null!=T){v.setAttributeForCell(C,S.from,null);for(var ha=T.split(","),R=0;R<ha.length;R++){var Z=
|
||||
d[S.to][ha[R]];null!=Z&&(W.push(v.insertEdge(null,null,S.label||"",S.invert?Z:C,S.invert?C:Z,S.style||v.createCurrentEdgeStyle())),mxUtils.remove(S.invert?C:Z,P))}}}if(null!=H)for(K=0;K<c.length;K++)for(C=c[K],R=0;R<H.length;R++)v.setAttributeForCell(C,mxUtils.trim(H[R]),null);var aa=new mxParallelEdgeLayout(v);aa.spacing=m;var ia=function(){aa.execute(v.getDefaultParent());for(var a=0;a<c.length;a++){var b=v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==k&&
|
||||
(b.width=Math.round(v.snap(b.width)));"auto"==l&&(b.height=Math.round(v.snap(b.height)))}};if("circle"==z){var ba=new mxCircleLayout(v);ba.resetEdges=!1;var na=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==
|
||||
z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),0<P.length?P[0]:null)},!0,G);G=null}else if("horizontalflow"==z||"verticalflow"==z||"auto"==z&&1==P.length){v.view.validate();var ja=new mxHierarchicalLayout(v,"horizontalflow"==z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(v.getDefaultParent(),W);v.moveCells(W,E,D)},!0,G);G=null}else if("organic"==
|
||||
z||"auto"==z&&W.length>c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b=
|
||||
"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
|
||||
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
|
||||
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 h=b.init;b.init=function(){h.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"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
|
||||
e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
|
||||
b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
|
||||
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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
|
||||
"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b=
|
||||
'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+
|
||||
IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
|
||||
EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
|
||||
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!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=
|
||||
d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;
|
||||
if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+
|
||||
(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+n+"&border="+l+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(H){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
|
||||
JSON.parse(h)}catch(J){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
|
||||
value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
|
||||
function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(J){k.postMessage(JSON.stringify({event:"draft",
|
||||
error:J.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
|
||||
return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
|
||||
null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(b),"*")}),r=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
|
||||
h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),t=n.getGlobalVariable,z=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(n.container);n.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,
|
||||
function(a){r(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){r(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");
|
||||
if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";
|
||||
if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
|
||||
this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
|
||||
(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
|
||||
l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(J){this.handleError(J)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var B=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
|
||||
e=B();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=B();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
|
||||
b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=
|
||||
function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
|
||||
"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
|
||||
mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
|
||||
(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,r=40,t=0,v=this.editor.graph;v.getGraphBounds();for(var G=function(){v.setSelectionCells(W);
|
||||
v.scrollCellToVisible(v.getSelectionCell())},F=v.getFreeInsertPoint(),E=F.x,D=F.y,F=D,A=null,z="auto",B=[],J=null,H=null,M=0;M<b.length&&"#"==b[M].charAt(0);){a=b[M];for(M++;M<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[M].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[M].substring(1)),M++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var L=mxUtils.trim(a.substring(1,Y)),N=mxUtils.trim(a.substring(Y+1));"label"==L?A=v.sanitizeHtml(N):"style"==L?e=N:"identity"==L&&0<N.length&&"-"!=N?h=
|
||||
N:"width"==L?k=N:"height"==L?l=N:"ignore"==L?H=N.split(","):"connect"==L?B.push(JSON.parse(N)):"link"==L?J=N:"padding"==L?t=parseFloat(N):"edgespacing"==L?m=parseFloat(N):"nodespacing"==L?r=parseFloat(N):"layout"==L&&(z=N)}}}var O=this.editor.csvToArray(b[M]);a=null;if(null!=h)for(var K=0;K<O.length;K++)if(h==O[K]){a=K;break}null==A&&(A="%"+O[0]+"%");if(null!=B)for(var I=0;I<B.length;I++)null==d[B[I].to]&&(d[B[I].to]={});v.model.beginUpdate();try{for(K=M+1;K<b.length;K++){var V=this.editor.csvToArray(b[K]);
|
||||
if(V.length==O.length){var C=null,U=null!=a?V[a]:null;null!=U&&(C=v.model.getCell(U));null==C&&(C=new mxCell(A,new mxGeometry(E,F,0,0),e||"whiteSpace=wrap;html=1;"),C.vertex=!0,C.id=U);for(var R=0;R<V.length;R++)v.setAttributeForCell(C,O[R],V[R]);v.setAttributeForCell(C,"placeholders","1");C.style=v.replacePlaceholders(C,C.style);for(I=0;I<B.length;I++)d[B[I].to][C.getAttribute(B[I].to)]=C;null!=J&&"link"!=J&&(v.setLinkForCell(C,C.getAttribute(J)),v.setAttributeForCell(C,J,null));v.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[C]));var X=this.editor.graph.getPreferredSizeForCell(C);C.geometry.width="auto"==k?X.width+t:parseFloat(k);C.geometry.height="auto"==l?X.height+t:parseFloat(l);F+=C.geometry.height+r;c.push(v.addCell(C))}}for(var P=c.slice(),W=c.slice(),I=0;I<B.length;I++)for(var S=B[I],K=0;K<c.length;K++){var C=c[K],T=C.getAttribute(S.from);if(null!=T){v.setAttributeForCell(C,S.from,null);for(var ha=T.split(","),R=0;R<ha.length;R++){var Z=d[S.to][ha[R]];null!=Z&&(W.push(v.insertEdge(null,null,S.label||"",
|
||||
S.invert?Z:C,S.invert?C:Z,S.style||v.createCurrentEdgeStyle())),mxUtils.remove(S.invert?C:Z,P))}}}if(null!=H)for(K=0;K<c.length;K++)for(C=c[K],R=0;R<H.length;R++)v.setAttributeForCell(C,mxUtils.trim(H[R]),null);var aa=new mxParallelEdgeLayout(v);aa.spacing=m;var ia=function(){aa.execute(v.getDefaultParent());for(var a=0;a<c.length;a++){var b=v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==k&&(b.width=Math.round(v.snap(b.width)));"auto"==l&&(b.height=Math.round(v.snap(b.height)))}};
|
||||
if("circle"==z){var ba=new mxCircleLayout(v);ba.resetEdges=!1;var na=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),
|
||||
0<P.length?P[0]:null)},!0,G);G=null}else if("horizontalflow"==z||"verticalflow"==z||"auto"==z&&1==P.length){v.view.validate();var ja=new mxHierarchicalLayout(v,"horizontalflow"==z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(v.getDefaultParent(),W);v.moveCells(W,E,D)},!0,G);G=null}else if("organic"==z||"auto"==z&&W.length>c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*
|
||||
r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
|
||||
b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
|
||||
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
|
||||
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 h=b.init;b.init=function(){h.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"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
|
||||
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
|
||||
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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 d=
|
||||
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
|
||||
applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
|
||||
b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;
|
||||
EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);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!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
|
||||
this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;
|
||||
EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,
|
||||
h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+n+"&border="+l+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
|
||||
function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
|
||||
function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
|
||||
|
|
97
war/js/atlas.min.js
vendored
97
war/js/atlas.min.js
vendored
|
@ -6539,7 +6539,7 @@ R.setAttribute("min","1");R.setAttribute("type","number");R.style.width="40px";W
|
|||
P.appendChild(W);P.appendChild(K);N.appendChild(X);N.appendChild(Q);N.appendChild(Y);L.appendChild(P);L.appendChild(N);m.appendChild(L);g.appendChild(m);d.appendChild(g);g=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom="12px";mxUtils.write(e,mxResources.get("paperSize"));g.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var T=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);
|
||||
g.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));g.appendChild(e);var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","100 %");S.style.width="60px";g.appendChild(S);d.appendChild(g);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&e.appendChild(g);a.isOffline()||
|
||||
(m=mxUtils.button(mxResources.get("help"),function(){window.open("https://desk.draw.io/support/solutions/articles/16000048947")}),m.className="geBtn",e.appendChild(m));PrintDialog.previewEnabled&&(m=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)}),m.className="geBtn",e.appendChild(m));m=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});m.className="geBtn gePrimaryBtn";e.appendChild(m);a.editor.cancelFirst||e.appendChild(g);
|
||||
d.appendChild(e);this.container=d}})();(function(){EditorUi.VERSION="7.6.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
d.appendChild(e);this.container=d}})();(function(){EditorUi.VERSION="7.6.7";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;
|
||||
EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),f=new Image;f.onload=function(){try{a.getContext("2d").drawImage(f,
|
||||
0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=c&&6<c.length}catch(u){}};f.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}try{a=document.createElement("canvas");a.width=a.height=1;var b=
|
||||
|
@ -6675,7 +6675,7 @@ k=parseInt(f.getAttribute("width")),n=parseInt(f.getAttribute("height"));m=null!
|
|||
this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;f.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(y,f,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(f))}))});this.loadFonts(e)}catch(C){null!=g&&g(C)}}),d,w)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;a.convert=function(c){null!=c&&("http://"!=
|
||||
c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,k){for(var g=a.getElementsByTagName(d),n=0;n<g.length;n++)mxUtils.bind(this,function(d){var g=e.convert(d.getAttribute(k));if(null!=g&&
|
||||
"data:"!=g.substring(0,5)){var n=f[g];null==n?(c++,this.convertImageToDataUri(g,function(e){null!=e&&(f[g]=e,d.setAttribute(k,e));c--;0==c&&b(a)})):d.setAttribute(k,n)}})(g[n])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,g,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);g=null!=g?g:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
|
||||
b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN})}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){g&&null!=d&&d({code:App.ERROR_TIMEOUT,
|
||||
b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){g&&null!=d&&d({code:App.ERROR_TIMEOUT,
|
||||
retry:f})})});f()}catch(x){null!=d&&d(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=function(){var a=document.createElement("canvas"),
|
||||
f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,g){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var k=mxUtils.parseXml(a),h=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var n=h.getElementsByTagName("diagram");if(1==n.length)h=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(n[0]))).documentElement;
|
||||
else if(1<n.length){f.model.beginUpdate();try{for(var l=0;l<n.length;l++){var m=this.updatePageRoot(new DiagramPage(n[l])),t=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[t+1]));f.model.execute(new ChangePage(this,m,m,t))}}finally{f.model.endUpdate()}}}if(null!=h&&"mxGraphModel"===h.nodeName){var p=new mxGraphModel;(new mxCodec(h.ownerDocument)).decode(h,p);var u=p.getChildCount(p.getRoot());f.model.getChildCount(f.model.getRoot());f.model.beginUpdate();try{a={};
|
||||
|
@ -6756,53 +6756,52 @@ function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatCont
|
|||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
|
||||
null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
|
||||
this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,g=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
|
||||
g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(J){}return a}if(!/https:\/\/.*\.googleapis\.com$/.test(f.origin)&&!/https:\/\/.*\.google\.com$/.test(f.origin)){var n=
|
||||
f.data;if("json"==urlParams.proto){try{n=JSON.parse(n)}catch(G){n=null}if(null==n)return;if("dialog"==n.action){this.showError(null!=n.titleKey?mxResources.get(n.titleKey):n.title,null!=n.messageKey?mxResources.get(n.messageKey):n.message,null!=n.buttonKey?mxResources.get(n.buttonKey):n.button);null!=n.modified&&(this.editor.modified=n.modified);return}if("prompt"==n.action){this.spinner.stop();var k=new FilenameDialog(this,n.defaultValue||"",null!=n.okKey?mxResources.get(n.okKey):null,function(a){null!=
|
||||
a&&h.postMessage(JSON.stringify({event:"prompt",value:a,message:n}),"*")},null!=n.titleKey?mxResources.get(n.titleKey):n.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==n.action){k=null;k="data:image/png;base64,"==n.xml.substring(0,22)?this.extractGraphModelFromPng(n.xml):g(n.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[n.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",
|
||||
result:"edit",message:n}),"*")}),mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"discard",message:n}),"*")}),n.editKey?mxResources.get(n.editKey):null,n.discardKey?mxResources.get(n.discardKey):null,n.ignore?mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"ignore",message:n}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
|
||||
try{k.init()}catch(G){h.postMessage(JSON.stringify({event:"draft",error:G.toString(),message:n}),"*")}return}if("template"==n.action){this.spinner.stop();k=new NewDialog(this,!1,null!=n.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=n.callback?h.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,
|
||||
function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("status"==n.action){null!=n.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(n.messageKey))):null!=n.message&&this.editor.setStatus(mxUtils.htmlEntities(n.message));null!=n.modified&&(this.editor.modified=n.modified);return}if("spinner"==n.action){var l=null!=n.messageKey?mxResources.get(n.messageKey):n.message;null==n.show||n.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==n.action){if("png"==
|
||||
n.format||"xmlpng"==n.format){if(null==n.spin&&null==n.spinKey||this.spinner.spin(document.body,null!=n.spinKey?mxResources.get(n.spinKey):n.spin)){var m=null!=n.xml?n.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=n.format;b.message=n;b.data=a;b.xml=encodeURIComponent(m);h.postMessage(JSON.stringify(b),"*")}),q=mxUtils.bind(this,function(a){null==
|
||||
a&&(a=Editor.blankImage);"xmlpng"==n.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),u=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(p.container);
|
||||
p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,function(a){q(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){q(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==n.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):q(null)}),mxUtils.bind(this,function(){q(null)}))}}else{null!=
|
||||
n.xml&&0<n.xml.length&&this.setFileData(n.xml);l=this.createLoadMessage("export");if("html2"==n.format||"html"==n.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=this.getFileData(null,null,!0,null,null,null,k),l.format=n.format;else if("html"==n.format)m=this.editor.getGraphXml(),l.data=this.getHtml(m,this.editor.graph),l.xml=mxUtils.getXml(m),l.format=n.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;
|
||||
k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";if(n.embedImages||null==n.embedImages){if(null==n.spin&&null==n.spinKey||this.spinner.spin(document.body,null!=n.spinKey?mxResources.get(n.spinKey):n.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==n.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);h.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));h.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==n.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}h.postMessage(JSON.stringify(l),"*")}return}if("load"==n.action)d=1==n.autosave,this.hideDialog(),null!=n.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
n.modified),null!=n.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=n.saveAndExit),null!=n.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,n.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
|
||||
this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),n=null!=n.xmlpng?this.extractGraphModelFromPng(n.xmlpng):null!=n.xml&&"data:image/png;base64,"==n.xml.substring(0,22)?this.extractGraphModelFromPng(n.xml):n.xml;else{h.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(n)}),"*");return}}n=g(n);c=!0;try{a(n,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var C=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
|
||||
1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=C();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=C();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
|
||||
b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||h.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var h=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):
|
||||
urlParams.ready||"ready";h.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
|
||||
"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
|
||||
a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
|
||||
function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,h="auto",l="auto",m=40,n=40,p=0,y=this.editor.graph;y.getGraphBounds();
|
||||
for(var E=function(){y.setSelectionCells(V);y.scrollCellToVisible(y.getSelectionCell())},D=y.getFreeInsertPoint(),H=D.x,F=D.y,D=F,B=null,A="auto",C=[],G=null,J=null,I=0;I<b.length&&"#"==b[I].charAt(0);){a=b[I];for(I++;I<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[I].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[I].substring(1)),I++;if("#"!=a.charAt(1)){var U=a.indexOf(":");if(0<U){var O=mxUtils.trim(a.substring(1,U)),L=mxUtils.trim(a.substring(U+1));"label"==O?B=y.sanitizeHtml(L):"style"==
|
||||
O?e=L:"identity"==O&&0<L.length&&"-"!=L?g=L:"width"==O?h=L:"height"==O?l=L:"ignore"==O?J=L.split(","):"connect"==O?C.push(JSON.parse(L)):"link"==O?G=L:"padding"==O?p=parseFloat(L):"edgespacing"==O?m=parseFloat(L):"nodespacing"==O?n=parseFloat(L):"layout"==O&&(A=L)}}}var P=this.editor.csvToArray(b[I]);a=null;if(null!=g)for(var N=0;N<P.length;N++)if(g==P[N]){a=N;break}null==B&&(B="%"+P[0]+"%");if(null!=C)for(var M=0;M<C.length;M++)null==d[C[M].to]&&(d[C[M].to]={});y.model.beginUpdate();try{for(N=I+
|
||||
1;N<b.length;N++){var W=this.editor.csvToArray(b[N]);if(W.length==P.length){var K=null,X=null!=a?W[a]:null;null!=X&&(K=y.model.getCell(X));null==K&&(K=new mxCell(B,new mxGeometry(H,D,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=X);for(var Q=0;Q<W.length;Q++)y.setAttributeForCell(K,P[Q],W[Q]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(M=0;M<C.length;M++)d[C[M].to][K.getAttribute(C[M].to)]=K;null!=G&&"link"!=G&&(y.setLinkForCell(K,K.getAttribute(G)),
|
||||
y.setAttributeForCell(K,G,null));y.fireEvent(new mxEventObject("cellsInserted","cells",[K]));var Y=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==h?Y.width+p:parseFloat(h);K.geometry.height="auto"==l?Y.height+p:parseFloat(l);D+=K.geometry.height+n;c.push(y.addCell(K))}}for(var R=c.slice(),V=c.slice(),M=0;M<C.length;M++)for(var T=C[M],N=0;N<c.length;N++){var K=c[N],S=K.getAttribute(T.from);if(null!=S){y.setAttributeForCell(K,T.from,null);for(var fa=S.split(","),Q=0;Q<fa.length;Q++){var ba=
|
||||
d[T.to][fa[Q]];null!=ba&&(V.push(y.insertEdge(null,null,T.label||"",T.invert?ba:K,T.invert?K:ba,T.style||y.createCurrentEdgeStyle())),mxUtils.remove(T.invert?K:ba,R))}}}if(null!=J)for(N=0;N<c.length;N++)for(K=c[N],Q=0;Q<J.length;Q++)y.setAttributeForCell(K,mxUtils.trim(J[Q]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=m;var ha=function(){ca.execute(y.getDefaultParent());for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==
|
||||
h&&(b.width=Math.round(y.snap(b.width)));"auto"==l&&(b.height=Math.round(y.snap(b.height)))}};if("circle"==A){var da=new mxCircleLayout(y);da.resetEdges=!1;var ia=da.isVertexIgnored;da.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,E);E=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==
|
||||
A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),0<R.length?R[0]:null)},!0,E);E=null}else if("horizontalflow"==A||"verticalflow"==A||"auto"==A&&1==R.length){y.view.validate();var ea=new mxHierarchicalLayout(y,"horizontalflow"==A?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=n;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),V);y.moveCells(V,H,F)},!0,E);E=null}else if("organic"==
|
||||
A||"auto"==A&&V.length>c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=m;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,E);E=null}this.hideDialog()}finally{y.model.endUpdate()}null!=E&&E()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b=
|
||||
"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
|
||||
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
|
||||
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 g=b.init;b.init=function(){g.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){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
|
||||
b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
|
||||
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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
|
||||
"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b=
|
||||
'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+
|
||||
IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
|
||||
EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
|
||||
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!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=
|
||||
d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,g,h){var c=a.editor.graph;
|
||||
if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,g,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),l=c.getGraphBounds(),n=Math.floor(l.width*g/c.view.scale),k=Math.floor(l.height*g/c.view.scale);f.length<=MAX_REQUEST_SIZE&&n*k<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+
|
||||
(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+n+"&h="+k+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
g);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(J){}return a}if(f.source==(window.opener||window.parent)){var n=f.data;if("json"==urlParams.proto){try{n=
|
||||
JSON.parse(n)}catch(G){n=null}if(null==n)return;if("dialog"==n.action){this.showError(null!=n.titleKey?mxResources.get(n.titleKey):n.title,null!=n.messageKey?mxResources.get(n.messageKey):n.message,null!=n.buttonKey?mxResources.get(n.buttonKey):n.button);null!=n.modified&&(this.editor.modified=n.modified);return}if("prompt"==n.action){this.spinner.stop();var k=new FilenameDialog(this,n.defaultValue||"",null!=n.okKey?mxResources.get(n.okKey):null,function(a){null!=a&&h.postMessage(JSON.stringify({event:"prompt",
|
||||
value:a,message:n}),"*")},null!=n.titleKey?mxResources.get(n.titleKey):n.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==n.action){k=null;k="data:image/png;base64,"==n.xml.substring(0,22)?this.extractGraphModelFromPng(n.xml):g(n.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[n.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"edit",message:n}),"*")}),mxUtils.bind(this,
|
||||
function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"discard",message:n}),"*")}),n.editKey?mxResources.get(n.editKey):null,n.discardKey?mxResources.get(n.discardKey):null,n.ignore?mxUtils.bind(this,function(){this.hideDialog();h.postMessage(JSON.stringify({event:"draft",result:"ignore",message:n}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(G){h.postMessage(JSON.stringify({event:"draft",
|
||||
error:G.toString(),message:n}),"*")}return}if("template"==n.action){this.spinner.stop();k=new NewDialog(this,!1,null!=n.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=n.callback?h.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();
|
||||
return}if("status"==n.action){null!=n.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(n.messageKey))):null!=n.message&&this.editor.setStatus(mxUtils.htmlEntities(n.message));null!=n.modified&&(this.editor.modified=n.modified);return}if("spinner"==n.action){var l=null!=n.messageKey?mxResources.get(n.messageKey):n.message;null==n.show||n.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==n.action){if("png"==n.format||"xmlpng"==n.format){if(null==n.spin&&
|
||||
null==n.spinKey||this.spinner.spin(document.body,null!=n.spinKey?mxResources.get(n.spinKey):n.spin)){var m=null!=n.xml?n.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=n.format;b.message=n;b.data=a;b.xml=encodeURIComponent(m);h.postMessage(JSON.stringify(b),"*")}),q=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
|
||||
n.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(m))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),u=p.getGlobalVariable,A=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,
|
||||
function(a){q(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){q(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==n.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(m)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):q(null)}),mxUtils.bind(this,function(){q(null)}))}}else{null!=n.xml&&0<n.xml.length&&this.setFileData(n.xml);l=this.createLoadMessage("export");
|
||||
if("html2"==n.format||"html"==n.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=this.getFileData(null,null,!0,null,null,null,k),l.format=n.format;else if("html"==n.format)m=this.editor.getGraphXml(),l.data=this.getHtml(m,this.editor.graph),l.xml=mxUtils.getXml(m),l.format=n.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";
|
||||
if(n.embedImages||null==n.embedImages){if(null==n.spin&&null==n.spinKey||this.spinner.spin(document.body,null!=n.spinKey?mxResources.get(n.spinKey):n.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==n.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);h.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
|
||||
this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));h.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==n.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}h.postMessage(JSON.stringify(l),"*")}return}if("load"==n.action)d=1==n.autosave,this.hideDialog(),null!=n.modified&&null==urlParams.modified&&(urlParams.modified=n.modified),null!=n.saveAndExit&&null==urlParams.saveAndExit&&
|
||||
(urlParams.saveAndExit=n.saveAndExit),null!=n.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,n.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=
|
||||
k),n=null!=n.xmlpng?this.extractGraphModelFromPng(n.xmlpng):null!=n.xml&&"data:image/png;base64,"==n.xml.substring(0,22)?this.extractGraphModelFromPng(n.xml):n.xml;else{h.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(n)}),"*");return}}n=g(n);c=!0;try{a(n,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var C=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
|
||||
e=C();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=C();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
|
||||
b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||h.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var h=window.opener||window.parent,g="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";h.postMessage(g,"*")};EditorUi.prototype.addEmbedButtons=
|
||||
function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
|
||||
"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
|
||||
mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
|
||||
(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,g=null,h="auto",l="auto",m=40,n=40,p=0,y=this.editor.graph;y.getGraphBounds();for(var E=function(){y.setSelectionCells(V);
|
||||
y.scrollCellToVisible(y.getSelectionCell())},D=y.getFreeInsertPoint(),H=D.x,F=D.y,D=F,B=null,A="auto",C=[],G=null,J=null,I=0;I<b.length&&"#"==b[I].charAt(0);){a=b[I];for(I++;I<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[I].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[I].substring(1)),I++;if("#"!=a.charAt(1)){var U=a.indexOf(":");if(0<U){var O=mxUtils.trim(a.substring(1,U)),L=mxUtils.trim(a.substring(U+1));"label"==O?B=y.sanitizeHtml(L):"style"==O?e=L:"identity"==O&&0<L.length&&"-"!=L?g=
|
||||
L:"width"==O?h=L:"height"==O?l=L:"ignore"==O?J=L.split(","):"connect"==O?C.push(JSON.parse(L)):"link"==O?G=L:"padding"==O?p=parseFloat(L):"edgespacing"==O?m=parseFloat(L):"nodespacing"==O?n=parseFloat(L):"layout"==O&&(A=L)}}}var P=this.editor.csvToArray(b[I]);a=null;if(null!=g)for(var N=0;N<P.length;N++)if(g==P[N]){a=N;break}null==B&&(B="%"+P[0]+"%");if(null!=C)for(var M=0;M<C.length;M++)null==d[C[M].to]&&(d[C[M].to]={});y.model.beginUpdate();try{for(N=I+1;N<b.length;N++){var W=this.editor.csvToArray(b[N]);
|
||||
if(W.length==P.length){var K=null,X=null!=a?W[a]:null;null!=X&&(K=y.model.getCell(X));null==K&&(K=new mxCell(B,new mxGeometry(H,D,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=X);for(var Q=0;Q<W.length;Q++)y.setAttributeForCell(K,P[Q],W[Q]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(M=0;M<C.length;M++)d[C[M].to][K.getAttribute(C[M].to)]=K;null!=G&&"link"!=G&&(y.setLinkForCell(K,K.getAttribute(G)),y.setAttributeForCell(K,G,null));y.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[K]));var Y=this.editor.graph.getPreferredSizeForCell(K);K.geometry.width="auto"==h?Y.width+p:parseFloat(h);K.geometry.height="auto"==l?Y.height+p:parseFloat(l);D+=K.geometry.height+n;c.push(y.addCell(K))}}for(var R=c.slice(),V=c.slice(),M=0;M<C.length;M++)for(var T=C[M],N=0;N<c.length;N++){var K=c[N],S=K.getAttribute(T.from);if(null!=S){y.setAttributeForCell(K,T.from,null);for(var fa=S.split(","),Q=0;Q<fa.length;Q++){var ba=d[T.to][fa[Q]];null!=ba&&(V.push(y.insertEdge(null,null,T.label||
|
||||
"",T.invert?ba:K,T.invert?K:ba,T.style||y.createCurrentEdgeStyle())),mxUtils.remove(T.invert?K:ba,R))}}}if(null!=J)for(N=0;N<c.length;N++)for(K=c[N],Q=0;Q<J.length;Q++)y.setAttributeForCell(K,mxUtils.trim(J[Q]),null);var ca=new mxParallelEdgeLayout(y);ca.spacing=m;var ha=function(){ca.execute(y.getDefaultParent());for(var a=0;a<c.length;a++){var b=y.getCellGeometry(c[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==h&&(b.width=Math.round(y.snap(b.width)));"auto"==l&&(b.height=Math.round(y.snap(b.height)))}};
|
||||
if("circle"==A){var da=new mxCircleLayout(y);da.resetEdges=!1;var ia=da.isVertexIgnored;da.isVertexIgnored=function(a){return ia.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ha()},!0,E);E=null}else if("horizontaltree"==A||"verticaltree"==A||"auto"==A&&V.length==2*c.length-1&&1==R.length){y.view.validate();var Z=new mxCompactTreeLayout(y,"horizontaltree"==A);Z.levelDistance=n;Z.edgeRouting=!1;Z.resetEdges=!1;this.executeLayout(function(){Z.execute(y.getDefaultParent(),
|
||||
0<R.length?R[0]:null)},!0,E);E=null}else if("horizontalflow"==A||"verticalflow"==A||"auto"==A&&1==R.length){y.view.validate();var ea=new mxHierarchicalLayout(y,"horizontalflow"==A?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ea.intraCellSpacing=n;ea.disableEdgeStyle=!1;this.executeLayout(function(){ea.execute(y.getDefaultParent(),V);y.moveCells(V,H,F)},!0,E);E=null}else if("organic"==A||"auto"==A&&V.length>c.length){y.view.validate();var aa=new mxFastOrganicLayout(y);aa.forceConstant=3*
|
||||
n;aa.resetEdges=!1;var ja=aa.isVertexIgnored;aa.isVertexIgnored=function(a){return ja.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ca=new mxParallelEdgeLayout(y);ca.spacing=m;this.executeLayout(function(){aa.execute(y.getDefaultParent());ha()},!0,E);E=null}this.hideDialog()}finally{y.model.endUpdate()}null!=E&&E()}}catch(ka){this.handleError(ka)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
|
||||
b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var l=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=l.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
|
||||
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
|
||||
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 g=b.init;b.init=function(){g.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){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
|
||||
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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 d=
|
||||
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
|
||||
applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,g=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=g&&(this.offlineStatus.innerHTML=b,g=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
|
||||
b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;
|
||||
EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);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!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
|
||||
this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var p=EditorUi.prototype.destroy;
|
||||
EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,g,h){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,
|
||||
g,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),l=c.getGraphBounds(),n=Math.floor(l.width*g/c.view.scale),k=Math.floor(l.height*g/c.view.scale);f.length<=MAX_REQUEST_SIZE&&n*k<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+n+"&h="+k+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
|
||||
|
|
|
@ -5044,7 +5044,7 @@
|
|||
}
|
||||
else if (error != null)
|
||||
{
|
||||
error({code: App.ERROR_UNKNOWN});
|
||||
error({code: App.ERROR_UNKNOWN}, req);
|
||||
}
|
||||
}), function()
|
||||
{
|
||||
|
@ -8236,9 +8236,9 @@
|
|||
// Receives XML message from opener and puts it into the graph
|
||||
mxEvent.addListener(window, 'message', mxUtils.bind(this, function(evt)
|
||||
{
|
||||
// Ignores messages from Google APIs (use evt.source == parent || opener?)
|
||||
if (/https:\/\/.*\.googleapis\.com$/.test(evt.origin) ||
|
||||
/https:\/\/.*\.google\.com$/.test(evt.origin))
|
||||
var validSource = window.opener || window.parent;
|
||||
|
||||
if (evt.source != validSource)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -32,8 +32,13 @@ TrelloClient.prototype.extension = '.xml'; //TODO export to png
|
|||
* Authorizes the client, used with methods that can be called without a user click and popup blockers will interfere
|
||||
* Show the AuthDialog to work around the popup blockers if the file is opened directly
|
||||
*/
|
||||
TrelloClient.prototype.authenticate = function(success, error)
|
||||
TrelloClient.prototype.authenticate = function(success, error, force)
|
||||
{
|
||||
if (force)
|
||||
{
|
||||
this.logout();
|
||||
}
|
||||
|
||||
var callback = mxUtils.bind(this, function(remember)
|
||||
{
|
||||
Trello.authorize(
|
||||
|
@ -45,7 +50,7 @@ TrelloClient.prototype.authenticate = function(success, error)
|
|||
read: 'true',
|
||||
write: 'true'
|
||||
},
|
||||
expiration: remember? 'never' : '1hour',
|
||||
expiration: remember ? 'never' : '1hour',
|
||||
success: success,
|
||||
error: error
|
||||
});
|
||||
|
@ -80,8 +85,19 @@ TrelloClient.prototype.getFile = function(id, success, error, denyConvert, asLib
|
|||
var callback = mxUtils.bind(this, function()
|
||||
{
|
||||
var ids = id.split(this.SEPARATOR);
|
||||
var acceptResponse = true;
|
||||
|
||||
var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, retry: callback})
|
||||
}), this.ui.timeout);
|
||||
|
||||
Trello.cards.get(ids[0] + '/attachments/' + ids[1], mxUtils.bind(this, function(meta)
|
||||
{
|
||||
window.clearTimeout(timeoutThread);
|
||||
|
||||
if (acceptResponse)
|
||||
{
|
||||
var binary = /\.png$/i.test(meta.name);
|
||||
|
||||
|
@ -96,9 +112,9 @@ TrelloClient.prototype.getFile = function(id, success, error, denyConvert, asLib
|
|||
}
|
||||
else
|
||||
{
|
||||
var acceptResponse = true;
|
||||
acceptResponse = true;
|
||||
|
||||
var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT})
|
||||
|
@ -138,17 +154,40 @@ TrelloClient.prototype.getFile = function(id, success, error, denyConvert, asLib
|
|||
success(new TrelloFile(this.ui, data, meta));
|
||||
}
|
||||
}
|
||||
}), mxUtils.bind(this, function(req)
|
||||
}), mxUtils.bind(this, function(err, req)
|
||||
{
|
||||
window.clearTimeout(timeoutThread);
|
||||
|
||||
if (acceptResponse)
|
||||
{
|
||||
if (req.status == 401)
|
||||
{
|
||||
this.authenticate(callback, error, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
error();
|
||||
}
|
||||
}
|
||||
}), binary || (meta.mimeType != null &&
|
||||
meta.mimeType.substring(0, 6) == 'image/'));
|
||||
}
|
||||
}
|
||||
}), mxUtils.bind(this, function(err)
|
||||
{
|
||||
window.clearTimeout(timeoutThread);
|
||||
|
||||
if (acceptResponse)
|
||||
{
|
||||
if (err.status == 401)
|
||||
{
|
||||
this.authenticate(callback, error, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
error();
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
|
@ -210,26 +249,28 @@ TrelloClient.prototype.saveFile = function(file, success, error)
|
|||
{
|
||||
// delete file first, then write it again
|
||||
var ids = file.meta.compoundId.split(this.SEPARATOR);
|
||||
Trello.authorize(
|
||||
{
|
||||
type: 'popup',
|
||||
name: 'draw.io',
|
||||
scope:
|
||||
{
|
||||
read: 'true',
|
||||
write: 'true'
|
||||
},
|
||||
expiration: 'never',
|
||||
success: mxUtils.bind(this, function()
|
||||
{
|
||||
|
||||
var fn = mxUtils.bind(this, function(data)
|
||||
{
|
||||
Trello.del('cards/' + ids[0] + '/attachments/' + ids[1], mxUtils.bind(this, function()
|
||||
{
|
||||
this.writeFile(file.meta.name, data, ids[0], success, error);
|
||||
}), error);
|
||||
}), mxUtils.bind(this, function(err)
|
||||
{
|
||||
if (err.status == 401)
|
||||
{
|
||||
// KNOWN: Does not wait for popup to close for callback
|
||||
this.authenticate(callback, error, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
error();
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
var callback = mxUtils.bind(this, function()
|
||||
{
|
||||
if (this.ui.useCanvasForExport && /(\.png)$/i.test(file.meta.name))
|
||||
{
|
||||
this.ui.getEmbeddedPng(mxUtils.bind(this, function(data)
|
||||
|
@ -241,9 +282,9 @@ TrelloClient.prototype.saveFile = function(file, success, error)
|
|||
{
|
||||
fn(file.getData());
|
||||
}
|
||||
}),
|
||||
error: error
|
||||
});
|
||||
|
||||
this.authenticate(callback, error);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -262,16 +303,6 @@ TrelloClient.prototype.writeFile = function(filename, data, cardId, success, err
|
|||
}
|
||||
|
||||
var fn = mxUtils.bind(this, function()
|
||||
{
|
||||
Trello.authorize({
|
||||
type: 'popup',
|
||||
name: 'draw.io',
|
||||
scope: {
|
||||
read: 'true',
|
||||
write: 'true'
|
||||
},
|
||||
expiration: 'never',
|
||||
success: mxUtils.bind(this, function()
|
||||
{
|
||||
var acceptResponse = true;
|
||||
|
||||
|
@ -284,7 +315,7 @@ TrelloClient.prototype.writeFile = function(filename, data, cardId, success, err
|
|||
var formData = new FormData();
|
||||
formData.append('key', Trello.key());
|
||||
formData.append('token', Trello.token());
|
||||
formData.append('file', typeof data === "string"? new Blob([data]) : data, filename);
|
||||
formData.append('file', typeof data === 'string' ? new Blob([data]) : data, filename);
|
||||
formData.append('name', filename);
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
|
@ -304,6 +335,10 @@ TrelloClient.prototype.writeFile = function(filename, data, cardId, success, err
|
|||
fileMeta.compoundId = cardId + this.SEPARATOR + fileMeta.id
|
||||
success(fileMeta);
|
||||
}
|
||||
else if (request.status == 401)
|
||||
{
|
||||
this.authenticate(fn, error, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
error();
|
||||
|
@ -314,12 +349,9 @@ TrelloClient.prototype.writeFile = function(filename, data, cardId, success, err
|
|||
|
||||
request.open('POST', this.baseUrl + 'cards/' + cardId + '/attachments');
|
||||
request.send(formData);
|
||||
}),
|
||||
error: error
|
||||
});
|
||||
});
|
||||
|
||||
fn();
|
||||
this.authenticate(fn, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -340,23 +372,14 @@ TrelloClient.prototype.pickLibrary = function(fn)
|
|||
*/
|
||||
TrelloClient.prototype.pickFolder = function(fn)
|
||||
{
|
||||
Trello.authorize({
|
||||
type: 'popup',
|
||||
name: 'draw.io',
|
||||
scope: {
|
||||
read: 'true',
|
||||
write: 'true' },
|
||||
expiration: 'never',
|
||||
success: mxUtils.bind(this, function()
|
||||
this.authenticate(mxUtils.bind(this, function()
|
||||
{
|
||||
//show file select
|
||||
// show file select
|
||||
this.showTrelloDialog(false, fn);
|
||||
}),
|
||||
error: mxUtils.bind(this, function(e)
|
||||
}), mxUtils.bind(this, function(e)
|
||||
{
|
||||
this.ui.showError(mxResources.get('error'), e);
|
||||
})
|
||||
});
|
||||
}));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -369,23 +392,14 @@ TrelloClient.prototype.pickFile = function(fn, returnObject)
|
|||
this.ui.loadFile('T' + encodeURIComponent(id));
|
||||
});
|
||||
|
||||
Trello.authorize({
|
||||
type: 'popup',
|
||||
name: 'draw.io',
|
||||
scope: {
|
||||
read: 'true',
|
||||
write: 'true' },
|
||||
expiration: 'never',
|
||||
success: mxUtils.bind(this, function()
|
||||
this.authenticate(mxUtils.bind(this, function()
|
||||
{
|
||||
//show file select
|
||||
// show file select
|
||||
this.showTrelloDialog(true, fn);
|
||||
}),
|
||||
error: mxUtils.bind(this, function(e)
|
||||
}), mxUtils.bind(this, function(e)
|
||||
{
|
||||
this.ui.showError(mxResources.get('error'), e);
|
||||
})
|
||||
});
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
|
@ -653,5 +667,6 @@ TrelloClient.prototype.isAuthorized = function()
|
|||
*/
|
||||
TrelloClient.prototype.logout = function()
|
||||
{
|
||||
localStorage.removeItem('trello_token');
|
||||
Trello.deauthorize();
|
||||
};
|
||||
|
|
2
war/js/embed-static.min.js
vendored
2
war/js/embed-static.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.6.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.6.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
2
war/js/reader.min.js
vendored
2
war/js/reader.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.6.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.6.7",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
107
war/js/viewer.min.js
vendored
107
war/js/viewer.min.js
vendored
|
@ -2179,7 +2179,7 @@ this.getRubberband=function(){return g};var p=(new Date).getTime(),n=0,q=this.co
|
|||
"outlineConnect","1"))&&k.apply(this,arguments)};var w=this.isToggleEvent;this.isToggleEvent=function(a){return w.apply(this,arguments)||mxEvent.isShiftDown(a)};var x=g.isForceRubberbandEvent;g.isForceRubberbandEvent=function(a){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var u=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
|
||||
(u=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=u)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){if(this.isEnabled()||a.isConsumed())return y.apply(this,arguments);var c=a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&window.open(c))};
|
||||
var v=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return v.apply(this,arguments);if(null!=this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,d,f,g){g=null!=g?g:[];if(0<b||0<d){var e=this.getModel(),k=a+b,p=c+d;null==f&&(f=this.getCurrentRoot(),null==f&&(f=e.getRoot()));if(null!=f)for(var n=e.getChildCount(f),O=0;O<n;O++){var q=
|
||||
e.getChildAt(f,O),w=this.view.getState(q);if(null!=w&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(w.style,"locked","0")){var u=mxUtils.getValue(w.style,mxConstants.STYLE_ROTATION)||0;0!=u&&(w=mxUtils.getBoundingBox(w,u));(e.isEdge(q)||e.isVertex(q))&&w.x>=a&&w.y+w.height<=p&&w.y>=c&&w.x+w.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
|
||||
e.getChildAt(f,O),u=this.view.getState(q);if(null!=u&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(u.style,"locked","0")){var w=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=w&&(u=mxUtils.getBoundingBox(u,w));(e.isEdge(q)||e.isVertex(q))&&u.x>=a&&u.y+u.height<=p&&u.y>=c&&u.x+u.width<=k&&g.push(q);this.getAllCells(a,c,b,d,q,g)}}}return g};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?
|
||||
!1:G.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();F=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,
|
||||
mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g.start(b.x,b.y)):null!=F?this.addSelectionCells(F):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);F=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=
|
||||
function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var E=this.updateMouseEvent;this.updateMouseEvent=function(a){a=E.apply(this,arguments);this.isCellLocked(a.getCell())&&(a.state=null);return a}}};
|
||||
|
@ -2293,7 +2293,7 @@ JSON.parse(b),b=0;b<f.length;b++){var g=f[b];d.push(new mxConnectionConstraint(n
|
|||
mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,d=0;d<c;d++){var f=this.model.getChildAt(a,d);this.model.isVertex(f)&&(f=this.getCellGeometry(f),null==f||f.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,
|
||||
"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),
|
||||
null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var d=0;d<a.length;d++){var f=a[d];if(c.isEdge(f)){var g=c.getTerminal(f,!0),e=c.getTerminal(f,!1);c.setTerminal(f,
|
||||
e,!0);c.setTerminal(f,g,!1);var k=c.getGeometry(f);if(null!=k){k=k.clone();null!=k.points&&k.points.reverse();var p=k.getTerminalPoint(!0),n=k.getTerminalPoint(!1);k.setTerminalPoint(p,!1);k.setTerminalPoint(n,!0);c.setGeometry(f,k);var q=this.view.getState(f),w=this.view.getState(g),u=this.view.getState(e);if(null!=q){var x=null!=w?this.getConnectionConstraint(q,w,!0):null,O=null!=u?this.getConnectionConstraint(q,u,!1):null;this.setConnectionConstraint(f,g,!0,O);this.setConnectionConstraint(f,e,
|
||||
e,!0);c.setTerminal(f,g,!1);var k=c.getGeometry(f);if(null!=k){k=k.clone();null!=k.points&&k.points.reverse();var p=k.getTerminalPoint(!0),n=k.getTerminalPoint(!1);k.setTerminalPoint(p,!1);k.setTerminalPoint(n,!0);c.setGeometry(f,k);var q=this.view.getState(f),u=this.view.getState(g),w=this.view.getState(e);if(null!=q){var x=null!=u?this.getConnectionConstraint(q,u,!0):null,O=null!=w?this.getConnectionConstraint(q,w,!1):null;this.setConnectionConstraint(f,g,!0,O);this.setConnectionConstraint(f,e,
|
||||
!1,x)}b.push(f)}}else if(c.isVertex(f)&&(k=this.getCellGeometry(f),null!=k)){k=k.clone();k.x+=k.width/2-k.height/2;k.y+=k.height/2-k.width/2;var h=k.width;k.width=k.height;k.height=h;c.setGeometry(f,k);var v=this.view.getState(f);if(null!=v){var r=v.style[mxConstants.STYLE_DIRECTION]||"east";"east"==r?r="south":"south"==r?r="west":"west"==r?r="north":"north"==r&&(r="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,r,[f])}b.push(f)}}}finally{c.endUpdate()}return b};Graph.prototype.processChange=
|
||||
function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var b=0;b<c.length;b++)this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,c,b){c=this.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=
|
||||
a.getAttribute("placeholder"),f=a;null!=f;){if(f==this.model.getRoot()||null!=f.value&&"object"==typeof f.value&&f.hasAttribute(d)){this.setAttributeForCell(f,d,c);break}f=this.model.getParent(f)}var g=a.value.cloneNode(!0);g.setAttribute("label",c);c=g}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var d=this.view.getState(a[b]);if(null!=d){var f=
|
||||
|
@ -2318,9 +2318,9 @@ q=this.getCellGeometry(b[g].cell),d=d+p;null!=q&&null!=n&&(q=q.clone(),a?q.x=Mat
|
|||
this.view.getState(a[d]);if(null!=f){var g=this.getCellGeometry(c[d]);null==g||!g.relative||this.model.isEdge(a[d])||b.get(this.model.getParent(a[d]))||(g.relative=!1,g.x=f.x/f.view.scale-f.view.translate.x,g.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;g=f.getChildAt(f.getRoot(),0);for(d=0;d<a.length;d++)f.add(g,c[d]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});
|
||||
return a};Graph.prototype.getSvg=function(a,c,b,d,f,g,e){c=null!=c?c:1;b=null!=b?b:0;f=null!=f?f:!0;g=null!=g?g:!0;e=null!=e?e:!0;var k=g||d?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==k)throw Error(mxResources.get("drawingEmpty"));var p=this.view.scale,n=mxUtils.createXmlDocument();d=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=a&&(null!=d.style?d.style.backgroundColor=a:d.setAttribute("style","background-color:"+
|
||||
a));null==n.createElementNS?(d.setAttribute("xmlns",mxConstants.NS_SVG),d.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/p;d.setAttribute("width",Math.max(1,Math.ceil(k.width*a)+2*b)+"px");d.setAttribute("height",Math.max(1,Math.ceil(k.height*a)+2*b)+"px");d.setAttribute("version","1.1");var q=d;f&&(q=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"g"):n.createElement("g"),q.setAttribute("transform",
|
||||
"translate(0.5,0.5)"),d.appendChild(q));n.appendChild(d);n=this.createSvgCanvas(q);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-k.x)/p),Math.floor((b/c-k.y)/p));var w=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,g,e,k,p,n,q,u,x){var h=this.state;if(null!=this.foAltText&&(0==d||0!=h.fontSize&&g.length<5*d/h.fontSize)){var r=this.createElement("text");r.setAttribute("x",Math.round(d/2));r.setAttribute("y",Math.round((f+h.fontSize)/
|
||||
"translate(0.5,0.5)"),d.appendChild(q));n.appendChild(d);n=this.createSvgCanvas(q);n.foOffset=f?-.5:0;n.textOffset=f?-.5:0;n.imageOffset=f?-.5:0;n.translate(Math.floor((b/c-k.x)/p),Math.floor((b/c-k.y)/p));var u=n.createAlternateContent;n.createAlternateContent=function(a,c,b,d,f,g,e,k,p,n,q,w,x){var h=this.state;if(null!=this.foAltText&&(0==d||0!=h.fontSize&&g.length<5*d/h.fontSize)){var r=this.createElement("text");r.setAttribute("x",Math.round(d/2));r.setAttribute("y",Math.round((f+h.fontSize)/
|
||||
2));r.setAttribute("fill",h.fontColor||"black");r.setAttribute("text-anchor","middle");r.setAttribute("font-size",Math.round(h.fontSize)+"px");r.setAttribute("font-family",h.fontFamily);(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&r.setAttribute("font-weight","bold");(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&r.setAttribute("font-style","italic");(h.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&r.setAttribute("text-decoration","underline");
|
||||
mxUtils.write(r,g);return r}return w.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(k,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=e;e=this.createSvgImageExport();var u=e.drawCellState;e.drawCellState=function(a,c){(g||a.view.graph.isCellSelected(a.cell))&&u.apply(this,arguments)};e.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
|
||||
mxUtils.write(r,g);return r}return u.apply(this,arguments)};b=this.backgroundImage;null!=b&&(f=p/c,c=this.view.translate,f=new mxRectangle(c.x*f,c.y*f,b.width*f,b.height*f),mxUtils.intersects(k,f)&&n.image(c.x,c.y,b.width,b.height,b.src,!0));n.scale(a);n.textEnabled=e;e=this.createSvgImageExport();var w=e.drawCellState;e.drawCellState=function(a,c){(g||a.view.graph.isCellSelected(a.cell))&&w.apply(this,arguments)};e.drawState(this.getView().getState(this.model.root),n);return d};Graph.prototype.createSvgCanvas=
|
||||
function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=
|
||||
window.getSelection(),c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],d=0<b.rows.length?b.rows[0].cells.length:1,b=b.insertRow(c),f=0;f<d;f++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};
|
||||
Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var d=0;d<b.rows.length;d++){var f=document.createElement("th");b.rows[d].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(d=0;d<b.rows.length;d++)f=b.rows[d].insertCell(c),mxUtils.br(f);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,d=0;d<b.length;d++)b[d].cells.length>c&&b[d].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;
|
||||
|
@ -2426,8 +2426,8 @@ x.prototype.redrawPath=function(a,c,b,d,f){c=mxUtils.getValue(this.style,mxConst
|
|||
0),new mxPoint(d,.5*f),new mxPoint(d-c,f),new mxPoint(c,f),new mxPoint(0,.5*f)],this.isRounded,b,!0)};mxCellRenderer.prototype.defaultShapes.hexagon=y;mxUtils.extend(v,mxRectangleShape);v.prototype.isHtmlAllowed=function(){return!1};v.prototype.paintForeground=function(a,c,b,d,f){var g=Math.min(d/5,f/5)+1;a.begin();a.moveTo(c+d/2,b+g);a.lineTo(c+d/2,b+f-g);a.moveTo(c+g,b+f/2);a.lineTo(c+d-g,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.plus=
|
||||
v;var Ca=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,d,f){Ca.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var g=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||
|
||||
0);c+=g;b+=g;d-=2*g;f-=2*g;0<d&&0<f&&(a.setShadow(!1),Ca.apply(this,[a,c,b,d,f]))}};mxUtils.extend(G,mxRectangleShape);G.prototype.isHtmlAllowed=function(){return!1};G.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};G.prototype.paintForeground=function(a,c,b,d,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var g=
|
||||
Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=g;b+=g;d-=2*g;f-=2*g;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var g=0,e;do{e=mxCellRenderer.prototype.defaultShapes[this.style["symbol"+g]];if(null!=e){var k=this.style["symbol"+g+"Align"],la=this.style["symbol"+g+"VerticalAlign"],p=this.style["symbol"+g+"Width"],n=this.style["symbol"+g+"Height"],q=this.style["symbol"+g+"Spacing"]||0,w=this.style["symbol"+g+"VSpacing"]||
|
||||
q,u=this.style["symbol"+g+"ArcSpacing"];null!=u&&(u*=this.getArcSize(d+this.strokewidth,f+this.strokewidth),q+=u,w+=u);var u=c,x=b,u=k==mxConstants.ALIGN_CENTER?u+(d-p)/2:k==mxConstants.ALIGN_RIGHT?u+(d-p-q):u+q,x=la==mxConstants.ALIGN_MIDDLE?x+(f-n)/2:la==mxConstants.ALIGN_BOTTOM?x+(f-n-w):x+w;a.save();k=new e;k.style=this.style;e.prototype.paintVertexShape.call(k,a,u,x,p,n);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.ext=
|
||||
Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=g;b+=g;d-=2*g;f-=2*g;0<d&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var g=0,e;do{e=mxCellRenderer.prototype.defaultShapes[this.style["symbol"+g]];if(null!=e){var k=this.style["symbol"+g+"Align"],la=this.style["symbol"+g+"VerticalAlign"],p=this.style["symbol"+g+"Width"],n=this.style["symbol"+g+"Height"],q=this.style["symbol"+g+"Spacing"]||0,u=this.style["symbol"+g+"VSpacing"]||
|
||||
q,w=this.style["symbol"+g+"ArcSpacing"];null!=w&&(w*=this.getArcSize(d+this.strokewidth,f+this.strokewidth),q+=w,u+=w);var w=c,x=b,w=k==mxConstants.ALIGN_CENTER?w+(d-p)/2:k==mxConstants.ALIGN_RIGHT?w+(d-p-q):w+q,x=la==mxConstants.ALIGN_MIDDLE?x+(f-n)/2:la==mxConstants.ALIGN_BOTTOM?x+(f-n-u):x+u;a.save();k=new e;k.style=this.style;e.prototype.paintVertexShape.call(k,a,w,x,p,n);a.restore()}g++}while(null!=e)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.ext=
|
||||
G;mxUtils.extend(F,mxCylinder);F.prototype.redrawPath=function(a,c,b,d,f,g){g?(a.moveTo(0,0),a.lineTo(d/2,f/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.lineTo(0,f),a.close())};mxCellRenderer.prototype.defaultShapes.message=F;mxUtils.extend(E,mxShape);E.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.ellipse(d/4,0,d/2,f/4);a.fillAndStroke();a.begin();a.moveTo(d/2,f/4);a.lineTo(d/2,2*f/3);a.moveTo(d/2,f/3);a.lineTo(0,f/3);a.moveTo(d/2,f/3);a.lineTo(d,f/3);
|
||||
a.moveTo(d/2,2*f/3);a.lineTo(0,f);a.moveTo(d/2,2*f/3);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlActor=E;mxUtils.extend(D,mxShape);D.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};D.prototype.paintBackground=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(d/6,f/2);a.end();a.stroke();a.ellipse(d/6,0,5*d/6,f);a.fillAndStroke()};mxCellRenderer.prototype.defaultShapes.umlBoundary=
|
||||
D;mxUtils.extend(A,mxEllipse);A.prototype.paintVertexShape=function(a,c,b,d,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+d/8,b+f);a.lineTo(c+7*d/8,b+f);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlEntity=A;mxUtils.extend(z,mxShape);z.prototype.paintVertexShape=function(a,c,b,d,f){a.translate(c,b);a.begin();a.moveTo(d,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(d,f);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlDestroy=z;mxUtils.extend(B,
|
||||
|
@ -2802,7 +2802,7 @@ g=parseInt(d.getAttribute("width")),k=parseInt(d.getAttribute("height"));l=null!
|
|||
this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(v,d,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(e)}catch(B){null!=n&&n(B)}}),d,r)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert;a.convert=function(c){null!=c&&("http://"!=
|
||||
c.substring(0,7)&&"https://"!=c.substring(0,8)||c.substring(0,a.baseUrl.length)==a.baseUrl?"chrome-extension://"!=c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c));return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var k=a.getElementsByTagName(d),p=0;p<k.length;p++)mxUtils.bind(this,function(d){var k=e.convert(d.getAttribute(g));if(null!=k&&
|
||||
"data:"!=k.substring(0,5)){var p=f[k];null==p?(c++,this.convertImageToDataUri(k,function(e){null!=e&&(f[k]=e,d.setAttribute(g,e));c--;0==c&&b(a)})):d.setAttribute(g,p)}})(k[p])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,n,h){try{var c=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);n=null!=n?n:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=
|
||||
b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN})}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){n&&null!=d&&d({code:App.ERROR_TIMEOUT,
|
||||
b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=d&&d({code:App.ERROR_UNKNOWN},a)}),function(){null!=d&&d({code:App.ERROR_UNKNOWN})},c,this.timeout,function(){n&&null!=d&&d({code:App.ERROR_TIMEOUT,
|
||||
retry:f})})});f()}catch(x){null!=d&&d(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return"https?://raw.githubusercontent.com/"===a.substring(0,34)||/^https?:\/\/.*\.github\.io\//.test(a)||/^https?:\/\/(.*\.)?rawgit\.com\//.test(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b()});else{var c=new Image;c.onload=function(){var a=document.createElement("canvas"),
|
||||
d=a.getContext("2d");a.height=c.height;a.width=c.width;d.drawImage(c,0,0);b(a.toDataURL())};c.onerror=function(){b()};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,n){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),p=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=p&&"mxfile"==p.nodeName&&null!=this.pages){var h=p.getElementsByTagName("diagram");if(1==h.length)p=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(h[0]))).documentElement;
|
||||
else if(1<h.length){f.model.beginUpdate();try{for(var l=0;l<h.length;l++){var m=this.updatePageRoot(new DiagramPage(h[l])),r=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[r+1]));f.model.execute(new ChangePage(this,m,m,r))}}finally{f.model.endUpdate()}}}if(null!=p&&"mxGraphModel"===p.nodeName){var t=new mxGraphModel;(new mxCodec(p.ownerDocument)).decode(p,t);var E=t.getChildCount(t.getRoot());f.model.getChildCount(f.model.getRoot());f.model.beginUpdate();try{a={};
|
||||
|
@ -2883,53 +2883,52 @@ function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatCont
|
|||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.chromeless?this.editor.graph.lightbox&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=
|
||||
null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=
|
||||
this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,h=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
|
||||
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(H){}return a}if(!/https:\/\/.*\.googleapis\.com$/.test(f.origin)&&!/https:\/\/.*\.google\.com$/.test(f.origin)){var h=
|
||||
f.data;if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(J){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=
|
||||
a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",
|
||||
result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
|
||||
try{l.init()}catch(J){k.postMessage(JSON.stringify({event:"draft",error:J.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,
|
||||
function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==
|
||||
h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(b),"*")}),r=mxUtils.bind(this,function(a){null==
|
||||
a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),t=n.getGlobalVariable,z=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(n.container);
|
||||
n.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){r(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){r(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=
|
||||
h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
|
||||
l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),
|
||||
mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),
|
||||
this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(J){this.handleError(J)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var B=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&
|
||||
1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=B();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=B();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",
|
||||
b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):
|
||||
urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize=
|
||||
"12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
|
||||
a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=
|
||||
function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,r=40,t=0,v=this.editor.graph;v.getGraphBounds();
|
||||
for(var G=function(){v.setSelectionCells(W);v.scrollCellToVisible(v.getSelectionCell())},F=v.getFreeInsertPoint(),E=F.x,D=F.y,F=D,A=null,z="auto",B=[],J=null,H=null,M=0;M<b.length&&"#"==b[M].charAt(0);){a=b[M];for(M++;M<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[M].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[M].substring(1)),M++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var L=mxUtils.trim(a.substring(1,Y)),N=mxUtils.trim(a.substring(Y+1));"label"==L?A=v.sanitizeHtml(N):"style"==
|
||||
L?e=N:"identity"==L&&0<N.length&&"-"!=N?h=N:"width"==L?k=N:"height"==L?l=N:"ignore"==L?H=N.split(","):"connect"==L?B.push(JSON.parse(N)):"link"==L?J=N:"padding"==L?t=parseFloat(N):"edgespacing"==L?m=parseFloat(N):"nodespacing"==L?r=parseFloat(N):"layout"==L&&(z=N)}}}var O=this.editor.csvToArray(b[M]);a=null;if(null!=h)for(var K=0;K<O.length;K++)if(h==O[K]){a=K;break}null==A&&(A="%"+O[0]+"%");if(null!=B)for(var I=0;I<B.length;I++)null==d[B[I].to]&&(d[B[I].to]={});v.model.beginUpdate();try{for(K=M+
|
||||
1;K<b.length;K++){var V=this.editor.csvToArray(b[K]);if(V.length==O.length){var C=null,U=null!=a?V[a]:null;null!=U&&(C=v.model.getCell(U));null==C&&(C=new mxCell(A,new mxGeometry(E,F,0,0),e||"whiteSpace=wrap;html=1;"),C.vertex=!0,C.id=U);for(var R=0;R<V.length;R++)v.setAttributeForCell(C,O[R],V[R]);v.setAttributeForCell(C,"placeholders","1");C.style=v.replacePlaceholders(C,C.style);for(I=0;I<B.length;I++)d[B[I].to][C.getAttribute(B[I].to)]=C;null!=J&&"link"!=J&&(v.setLinkForCell(C,C.getAttribute(J)),
|
||||
v.setAttributeForCell(C,J,null));v.fireEvent(new mxEventObject("cellsInserted","cells",[C]));var X=this.editor.graph.getPreferredSizeForCell(C);C.geometry.width="auto"==k?X.width+t:parseFloat(k);C.geometry.height="auto"==l?X.height+t:parseFloat(l);F+=C.geometry.height+r;c.push(v.addCell(C))}}for(var P=c.slice(),W=c.slice(),I=0;I<B.length;I++)for(var S=B[I],K=0;K<c.length;K++){var C=c[K],T=C.getAttribute(S.from);if(null!=T){v.setAttributeForCell(C,S.from,null);for(var ha=T.split(","),R=0;R<ha.length;R++){var Z=
|
||||
d[S.to][ha[R]];null!=Z&&(W.push(v.insertEdge(null,null,S.label||"",S.invert?Z:C,S.invert?C:Z,S.style||v.createCurrentEdgeStyle())),mxUtils.remove(S.invert?C:Z,P))}}}if(null!=H)for(K=0;K<c.length;K++)for(C=c[K],R=0;R<H.length;R++)v.setAttributeForCell(C,mxUtils.trim(H[R]),null);var aa=new mxParallelEdgeLayout(v);aa.spacing=m;var ia=function(){aa.execute(v.getDefaultParent());for(var a=0;a<c.length;a++){var b=v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==k&&
|
||||
(b.width=Math.round(v.snap(b.width)));"auto"==l&&(b.height=Math.round(v.snap(b.height)))}};if("circle"==z){var ba=new mxCircleLayout(v);ba.resetEdges=!1;var na=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==
|
||||
z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),0<P.length?P[0]:null)},!0,G);G=null}else if("horizontalflow"==z||"verticalflow"==z||"auto"==z&&1==P.length){v.view.validate();var ja=new mxHierarchicalLayout(v,"horizontalflow"==z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(v.getDefaultParent(),W);v.moveCells(W,E,D)},!0,G);G=null}else if("organic"==
|
||||
z||"auto"==z&&W.length>c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b=
|
||||
"";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&
|
||||
null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*
|
||||
b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 h=b.init;b.init=function(){h.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"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=
|
||||
e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||
|
||||
b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);
|
||||
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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding=
|
||||
"2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b=
|
||||
'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+
|
||||
IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};
|
||||
EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
|
||||
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!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=
|
||||
d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;
|
||||
if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+
|
||||
(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+n+"&border="+l+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function g(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(H){}return a}if(f.source==(window.opener||window.parent)){var h=f.data;if("json"==urlParams.proto){try{h=
|
||||
JSON.parse(h)}catch(J){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();var l=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",
|
||||
value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==h.action){l=null;l="data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):g(h.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),l,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,
|
||||
function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(J){k.postMessage(JSON.stringify({event:"draft",
|
||||
error:J.toString(),message:h}),"*")}return}if("template"==h.action){this.spinner.stop();l=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?k.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}));this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();
|
||||
return}if("status"==h.action){null!=h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var m=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&
|
||||
null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var p=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(b),"*")}),r=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==
|
||||
h.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),t=n.getGlobalVariable,z=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:t.apply(this,arguments)};document.body.appendChild(n.container);n.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,
|
||||
function(a){r(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){r(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):r(null)}),mxUtils.bind(this,function(){r(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);m=this.createLoadMessage("export");
|
||||
if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=h.format;else if("html"==h.format)p=this.editor.getGraphXml(),m.data=this.getHtml(p,this.editor.graph),m.xml=mxUtils.getXml(p),m.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";
|
||||
if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);k.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
|
||||
this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));k.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(m),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
|
||||
(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=
|
||||
l),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):null!=h.xml&&"data:image/png;base64,"==h.xml.substring(0,22)?this.extractGraphModelFromPng(h.xml):h.xml;else{k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}h=g(h);c=!0;try{a(h,f)}catch(J){this.handleError(J)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var B=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});
|
||||
e=B();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=B();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",
|
||||
b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var k=window.opener||window.parent,h="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=
|
||||
function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,
|
||||
"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,
|
||||
mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&
|
||||
(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a){try{var b=a.split("\n"),c=[];if(0<b.length){var d={},e=null,h=null,k="auto",l="auto",m=40,r=40,t=0,v=this.editor.graph;v.getGraphBounds();for(var G=function(){v.setSelectionCells(W);
|
||||
v.scrollCellToVisible(v.getSelectionCell())},F=v.getFreeInsertPoint(),E=F.x,D=F.y,F=D,A=null,z="auto",B=[],J=null,H=null,M=0;M<b.length&&"#"==b[M].charAt(0);){a=b[M];for(M++;M<b.length&&"\\"==a.charAt(a.length-1)&&"#"==b[M].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(b[M].substring(1)),M++;if("#"!=a.charAt(1)){var Y=a.indexOf(":");if(0<Y){var L=mxUtils.trim(a.substring(1,Y)),N=mxUtils.trim(a.substring(Y+1));"label"==L?A=v.sanitizeHtml(N):"style"==L?e=N:"identity"==L&&0<N.length&&"-"!=N?h=
|
||||
N:"width"==L?k=N:"height"==L?l=N:"ignore"==L?H=N.split(","):"connect"==L?B.push(JSON.parse(N)):"link"==L?J=N:"padding"==L?t=parseFloat(N):"edgespacing"==L?m=parseFloat(N):"nodespacing"==L?r=parseFloat(N):"layout"==L&&(z=N)}}}var O=this.editor.csvToArray(b[M]);a=null;if(null!=h)for(var K=0;K<O.length;K++)if(h==O[K]){a=K;break}null==A&&(A="%"+O[0]+"%");if(null!=B)for(var I=0;I<B.length;I++)null==d[B[I].to]&&(d[B[I].to]={});v.model.beginUpdate();try{for(K=M+1;K<b.length;K++){var V=this.editor.csvToArray(b[K]);
|
||||
if(V.length==O.length){var C=null,U=null!=a?V[a]:null;null!=U&&(C=v.model.getCell(U));null==C&&(C=new mxCell(A,new mxGeometry(E,F,0,0),e||"whiteSpace=wrap;html=1;"),C.vertex=!0,C.id=U);for(var R=0;R<V.length;R++)v.setAttributeForCell(C,O[R],V[R]);v.setAttributeForCell(C,"placeholders","1");C.style=v.replacePlaceholders(C,C.style);for(I=0;I<B.length;I++)d[B[I].to][C.getAttribute(B[I].to)]=C;null!=J&&"link"!=J&&(v.setLinkForCell(C,C.getAttribute(J)),v.setAttributeForCell(C,J,null));v.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[C]));var X=this.editor.graph.getPreferredSizeForCell(C);C.geometry.width="auto"==k?X.width+t:parseFloat(k);C.geometry.height="auto"==l?X.height+t:parseFloat(l);F+=C.geometry.height+r;c.push(v.addCell(C))}}for(var P=c.slice(),W=c.slice(),I=0;I<B.length;I++)for(var S=B[I],K=0;K<c.length;K++){var C=c[K],T=C.getAttribute(S.from);if(null!=T){v.setAttributeForCell(C,S.from,null);for(var ha=T.split(","),R=0;R<ha.length;R++){var Z=d[S.to][ha[R]];null!=Z&&(W.push(v.insertEdge(null,null,S.label||"",
|
||||
S.invert?Z:C,S.invert?C:Z,S.style||v.createCurrentEdgeStyle())),mxUtils.remove(S.invert?C:Z,P))}}}if(null!=H)for(K=0;K<c.length;K++)for(C=c[K],R=0;R<H.length;R++)v.setAttributeForCell(C,mxUtils.trim(H[R]),null);var aa=new mxParallelEdgeLayout(v);aa.spacing=m;var ia=function(){aa.execute(v.getDefaultParent());for(var a=0;a<c.length;a++){var b=v.getCellGeometry(c[a]);b.x=Math.round(v.snap(b.x));b.y=Math.round(v.snap(b.y));"auto"==k&&(b.width=Math.round(v.snap(b.width)));"auto"==l&&(b.height=Math.round(v.snap(b.height)))}};
|
||||
if("circle"==z){var ba=new mxCircleLayout(v);ba.resetEdges=!1;var na=ba.isVertexIgnored;ba.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ba.execute(v.getDefaultParent());ia()},!0,G);G=null}else if("horizontaltree"==z||"verticaltree"==z||"auto"==z&&W.length==2*c.length-1&&1==P.length){v.view.validate();var ca=new mxCompactTreeLayout(v,"horizontaltree"==z);ca.levelDistance=r;ca.edgeRouting=!1;ca.resetEdges=!1;this.executeLayout(function(){ca.execute(v.getDefaultParent(),
|
||||
0<P.length?P[0]:null)},!0,G);G=null}else if("horizontalflow"==z||"verticalflow"==z||"auto"==z&&1==P.length){v.view.validate();var ja=new mxHierarchicalLayout(v,"horizontalflow"==z?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=r;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(v.getDefaultParent(),W);v.moveCells(W,E,D)},!0,G);G=null}else if("organic"==z||"auto"==z&&W.length>c.length){v.view.validate();var da=new mxFastOrganicLayout(v);da.forceConstant=3*
|
||||
r;da.resetEdges=!1;var ra=da.isVertexIgnored;da.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};aa=new mxParallelEdgeLayout(v);aa.spacing=m;this.executeLayout(function(){da.execute(v.getDefaultParent());ia()},!0,G);G=null}this.hideDialog()}finally{v.model.endUpdate()}null!=G&&G()}}catch(oa){this.handleError(oa)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",
|
||||
d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],
|
||||
b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,420,120,!0,!0);a.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
|
||||
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
|
||||
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();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 h=b.init;b.init=function(){h.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"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
|
||||
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=0;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
|
||||
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null==this.trello&&"function"!==typeof window.TrelloClient||b++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&b++;mxClient.IS_IOS||b++;return b};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 d=
|
||||
("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("openLibraryFrom").setEnabled(d);this.menus.get("newLibrary").setEnabled(d);this.menus.get("extras").setEnabled(d);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.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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isOfflineApp()){var e=
|
||||
applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,h=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b='<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
IMAGE_PATH+'/spin.gif"/>';break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=h&&(this.offlineStatus.innerHTML=b,h=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",
|
||||
b);mxEvent.addListener(e,"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var r=EditorUi.prototype.updateActionStates;
|
||||
EditorUi.prototype.updateActionStates=function(){r.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);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!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled("1"==urlParams.embed&&
|
||||
this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=d&&!d.isRestricted());this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var t=EditorUi.prototype.destroy;
|
||||
EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);t.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,h,l){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,
|
||||
h,l)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*h/c.view.scale),n=Math.floor(g.height*h/c.view.scale);f.length<=MAX_REQUEST_SIZE&&m*n<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+n+"&border="+l+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
|
||||
function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
|
||||
function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
|
||||
|
|
|
@ -25,6 +25,11 @@ Draw.loadPlugin(function(editorUi)
|
|||
}
|
||||
};
|
||||
|
||||
editorUi.showSplash = function()
|
||||
{
|
||||
this.actions.get('exit').funct();
|
||||
};
|
||||
|
||||
function main()
|
||||
{
|
||||
var name = (urlParams['filename'] != null) ? decodeURIComponent(urlParams['filename']) : null;
|
||||
|
|
Loading…
Reference in a new issue