|
|
|
@ -2333,24 +2333,24 @@ n)}f(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.c
|
|
|
|
|
mxResources.get("fit"));var m=null,q=null,v=mxUtils.bind(this,function(a){null!=m&&(window.clearTimeout(m),m=null);null!=q&&(window.clearTimeout(q),q=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);m=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),a||200)}),u=mxUtils.bind(this,function(a){null!=m&&(window.clearTimeout(m),m=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display=
|
|
|
|
|
"";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var t=f(mxUtils.bind(this,function(b){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var c=t.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,
|
|
|
|
|
"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=c.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);
|
|
|
|
|
this.layersDialog.style.zIndex=c.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(b)}),Editor.layersLargeImage,mxResources.get("layers")),w=a.getModel();w.addListener(mxEvent.CHANGE,function(){t.style.display=1<w.getChildCount(w.root)?"":"none"})}this.addChromelessToolbarItems(f);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||f(mxUtils.bind(this,function(b){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):
|
|
|
|
|
a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(b)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(p=0;p<this.lightboxToolbarActions.length;p++){var r=this.lightboxToolbarActions[p];f(r.fn,r.icon,r.tooltip)}null!=e.refreshBtn&&f(mxUtils.bind(this,function(a){e.refreshBtn.url?window.location.href=e.refreshBtn.url:window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh"));null!=e.fullscreenBtn&&
|
|
|
|
|
window.self!==window.top&&f(mxUtils.bind(this,function(b){e.fullscreenBtn.url?a.openLink(e.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(b)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(e.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&f(mxUtils.bind(this,function(a){"1"==urlParams.close||e.closeBtn?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,
|
|
|
|
|
mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";a.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||u(30),v())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});
|
|
|
|
|
mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?v():u(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?v():u(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||u(30)}));var A=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(b,c){this.startX=
|
|
|
|
|
c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(c,d){mxEvent.isTouchEvent(d.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<A&&Math.abs(this.scrollTop-a.container.scrollTop)<A&&Math.abs(this.startX-d.getGraphX())<A&&Math.abs(this.startY-d.getGraphY())<A&&(0<parseFloat(b.chromelessToolbar.style.opacity||0)?v():u(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var y=
|
|
|
|
|
a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),b=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*b.width;this.translate.y=a.y-(this.y0||0)*b.height}y.apply(this,arguments)};if(!a.isViewer()){var C=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var b=this.getPageLayout(),c=this.getPagePadding(),d=this.getPageSize(),f=Math.ceil(2*
|
|
|
|
|
c.x+b.width*d.width),g=Math.ceil(2*c.y+b.height*d.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,f,g);f=c.x-b.x*d.width;c=c.y-b.y*d.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==c?C.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=b.x,this.view.y0=b.y,b=a.view.translate.x,d=a.view.translate.y,a.view.setTranslate(f,c),a.container.scrollLeft+=Math.round((f-b)*a.view.scale),a.container.scrollTop+=Math.round((c-
|
|
|
|
|
d)*a.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var D=a.view.getBackgroundPane(),B=a.view.getDrawPane();a.cumulativeZoomFactor=1;var z=null,E=null,H=null,I=null,J=null,G=function(d){null!=z&&window.clearTimeout(z);window.setTimeout(function(){if(!a.isMouseDown||I)z=window.setTimeout(mxUtils.bind(this,function(){a.isFastZoomEnabled()&&(null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(a.view.backgroundPageShape.node.style,
|
|
|
|
|
"transform-origin",null),mxUtils.setPrefixedStyle(a.view.backgroundPageShape.node.style,"transform",null)),B.style.transformOrigin="",D.style.transformOrigin="",mxClient.IS_SF?(B.style.transform="scale(1)",D.style.transform="scale(1)",window.setTimeout(function(){B.style.transform="";D.style.transform=""},0)):(B.style.transform="",D.style.transform=""),a.view.getDecoratorPane().style.opacity="",a.view.getOverlayPane().style.opacity="");var d=new mxPoint(a.container.scrollLeft,a.container.scrollTop),
|
|
|
|
|
f=mxUtils.getOffset(a.container),g=a.view.scale,e=0,h=0;null!=E&&(e=a.container.offsetWidth/2-E.x+f.x,h=a.container.offsetHeight/2-E.y+f.y);a.zoom(a.cumulativeZoomFactor);a.view.scale!=g&&(null!=H&&(e+=d.x-H.x,h+=d.y-H.y),null!=c&&b.chromelessResize(!1,null,e*(a.cumulativeZoomFactor-1),h*(a.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==e&&0==h||(a.container.scrollLeft-=e*(a.cumulativeZoomFactor-1),a.container.scrollTop-=h*(a.cumulativeZoomFactor-1)));null!=J&&B.setAttribute("filter",
|
|
|
|
|
J);a.cumulativeZoomFactor=1;J=I=E=H=z=null}),null!=d?d:a.isFastZoomEnabled()?b.wheelZoomDelay:b.lazyZoomDelay)},0)};a.lazyZoom=function(c,d,f){(d=d||!a.scrollbars)&&(E=new mxPoint(a.container.offsetLeft+a.container.clientWidth/2,a.container.offsetTop+a.container.clientHeight/2));c?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*
|
|
|
|
|
20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(a.isFastZoomEnabled()){null==J&&""!=B.getAttribute("filter")&&(J=B.getAttribute("filter"),B.removeAttribute("filter"));
|
|
|
|
|
H=new mxPoint(a.container.scrollLeft,a.container.scrollTop);c=d?a.container.scrollLeft+a.container.clientWidth/2:E.x+a.container.scrollLeft-a.container.offsetLeft;var g=d?a.container.scrollTop+a.container.clientHeight/2:E.y+a.container.scrollTop-a.container.offsetTop;B.style.transformOrigin=c+"px "+g+"px";B.style.transform="scale("+this.cumulativeZoomFactor+")";D.style.transformOrigin=c+"px "+g+"px";D.style.transform="scale("+this.cumulativeZoomFactor+")";null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node&&
|
|
|
|
|
(c=a.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(c.style,"transform-origin",(d?a.container.clientWidth/2+a.container.scrollLeft-c.offsetLeft+"px":E.x+a.container.scrollLeft-c.offsetLeft-a.container.offsetLeft+"px")+" "+(d?a.container.clientHeight/2+a.container.scrollTop-c.offsetTop+"px":E.y+a.container.scrollTop-c.offsetTop-a.container.offsetTop+"px")),mxUtils.setPrefixedStyle(c.style,"transform","scale("+this.cumulativeZoomFactor+")"));a.view.getDecoratorPane().style.opacity="0";a.view.getOverlayPane().style.opacity=
|
|
|
|
|
"0";null!=b.hoverIcons&&b.hoverIcons.reset()}G(f)};mxEvent.addGestureListeners(a.container,function(a){null!=z&&window.clearTimeout(z)},null,function(b){1!=a.cumulativeZoomFactor&&G(0)});mxEvent.addListener(a.container,"scroll",function(b){null==z||a.isMouseDown||1==a.cumulativeZoomFactor||G(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,c,d,f,g){if(null==this.dialogs||0==this.dialogs.length)if(!a.scrollbars&&!d&&a.isScrollWheelEvent(b))d=a.view.getTranslate(),f=40/a.view.scale,mxEvent.isShiftDown(b)?
|
|
|
|
|
a.view.setTranslate(d.x+(c?-f:f),d.y):a.view.setTranslate(d.x,d.y+(c?f:-f));else if(d||a.isZoomWheelEvent(b))for(var e=mxEvent.getSource(b);null!=e;){if(e==a.container)return a.tooltipHandler.hideTooltip(),E=null!=f&&null!=g?new mxPoint(f,g):new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b)),I=d,a.lazyZoom(c),mxEvent.consume(b),!1;e=e.parentNode}}),a.container);a.panningHandler.zoomGraph=function(b){a.cumulativeZoomFactor=b.scale;a.lazyZoom(0<b.scale,!0);mxEvent.consume(b)}};
|
|
|
|
|
EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};
|
|
|
|
|
this.layersDialog.style.zIndex=c.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(b)}),Editor.layersLargeImage,mxResources.get("layers")),w=a.getModel();w.addListener(mxEvent.CHANGE,function(){t.style.display=1<w.getChildCount(w.root)?"":"none"})}"1"!=urlParams.openInSameWin&&this.addChromelessToolbarItems(f);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||f(mxUtils.bind(this,function(b){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==
|
|
|
|
|
this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(b)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(p=0;p<this.lightboxToolbarActions.length;p++){var r=this.lightboxToolbarActions[p];f(r.fn,r.icon,r.tooltip)}null!=e.refreshBtn&&f(mxUtils.bind(this,function(a){e.refreshBtn.url?window.location.href=e.refreshBtn.url:window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,
|
|
|
|
|
mxResources.get("refresh",null,"Refresh"));null!=e.fullscreenBtn&&window.self!==window.top&&f(mxUtils.bind(this,function(b){e.fullscreenBtn.url?a.openLink(e.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(b)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(e.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&f(mxUtils.bind(this,function(a){"1"==urlParams.close||e.closeBtn?window.close():
|
|
|
|
|
(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";a.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||u(30),v())}));mxEvent.addListener(this.chromelessToolbar,
|
|
|
|
|
mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?v():u(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?v():u(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||u(30)}));var A=a.getTolerance();a.addMouseListener({startX:0,
|
|
|
|
|
startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(b,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(c,d){mxEvent.isTouchEvent(d.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<A&&Math.abs(this.scrollTop-a.container.scrollTop)<A&&Math.abs(this.startX-d.getGraphX())<A&&Math.abs(this.startY-d.getGraphY())<A&&(0<parseFloat(b.chromelessToolbar.style.opacity||0)?
|
|
|
|
|
v():u(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var y=a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),b=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*b.width;this.translate.y=a.y-(this.y0||0)*b.height}y.apply(this,arguments)};if(!a.isViewer()){var C=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var b=
|
|
|
|
|
this.getPageLayout(),c=this.getPagePadding(),d=this.getPageSize(),f=Math.ceil(2*c.x+b.width*d.width),g=Math.ceil(2*c.y+b.height*d.height),e=a.minimumGraphSize;if(null==e||e.width!=f||e.height!=g)a.minimumGraphSize=new mxRectangle(0,0,f,g);f=c.x-b.x*d.width;c=c.y-b.y*d.height;this.autoTranslate||this.view.translate.x==f&&this.view.translate.y==c?C.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=b.x,this.view.y0=b.y,b=a.view.translate.x,d=a.view.translate.y,a.view.setTranslate(f,c),a.container.scrollLeft+=
|
|
|
|
|
Math.round((f-b)*a.view.scale),a.container.scrollTop+=Math.round((c-d)*a.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var D=a.view.getBackgroundPane(),B=a.view.getDrawPane();a.cumulativeZoomFactor=1;var z=null,E=null,H=null,I=null,J=null,G=function(d){null!=z&&window.clearTimeout(z);window.setTimeout(function(){if(!a.isMouseDown||I)z=window.setTimeout(mxUtils.bind(this,function(){a.isFastZoomEnabled()&&(null!=a.view.backgroundPageShape&&
|
|
|
|
|
null!=a.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(a.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(a.view.backgroundPageShape.node.style,"transform",null)),B.style.transformOrigin="",D.style.transformOrigin="",mxClient.IS_SF?(B.style.transform="scale(1)",D.style.transform="scale(1)",window.setTimeout(function(){B.style.transform="";D.style.transform=""},0)):(B.style.transform="",D.style.transform=""),a.view.getDecoratorPane().style.opacity="",
|
|
|
|
|
a.view.getOverlayPane().style.opacity="");var d=new mxPoint(a.container.scrollLeft,a.container.scrollTop),f=mxUtils.getOffset(a.container),g=a.view.scale,e=0,h=0;null!=E&&(e=a.container.offsetWidth/2-E.x+f.x,h=a.container.offsetHeight/2-E.y+f.y);a.zoom(a.cumulativeZoomFactor);a.view.scale!=g&&(null!=H&&(e+=d.x-H.x,h+=d.y-H.y),null!=c&&b.chromelessResize(!1,null,e*(a.cumulativeZoomFactor-1),h*(a.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==e&&0==h||(a.container.scrollLeft-=e*(a.cumulativeZoomFactor-
|
|
|
|
|
1),a.container.scrollTop-=h*(a.cumulativeZoomFactor-1)));null!=J&&B.setAttribute("filter",J);a.cumulativeZoomFactor=1;J=I=E=H=z=null}),null!=d?d:a.isFastZoomEnabled()?b.wheelZoomDelay:b.lazyZoomDelay)},0)};a.lazyZoom=function(c,d,f){(d=d||!a.scrollbars)&&(E=new mxPoint(a.container.offsetLeft+a.container.clientWidth/2,a.container.offsetTop+a.container.clientHeight/2));c?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=
|
|
|
|
|
this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(a.isFastZoomEnabled()){null==
|
|
|
|
|
J&&""!=B.getAttribute("filter")&&(J=B.getAttribute("filter"),B.removeAttribute("filter"));H=new mxPoint(a.container.scrollLeft,a.container.scrollTop);c=d?a.container.scrollLeft+a.container.clientWidth/2:E.x+a.container.scrollLeft-a.container.offsetLeft;var g=d?a.container.scrollTop+a.container.clientHeight/2:E.y+a.container.scrollTop-a.container.offsetTop;B.style.transformOrigin=c+"px "+g+"px";B.style.transform="scale("+this.cumulativeZoomFactor+")";D.style.transformOrigin=c+"px "+g+"px";D.style.transform=
|
|
|
|
|
"scale("+this.cumulativeZoomFactor+")";null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node&&(c=a.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(c.style,"transform-origin",(d?a.container.clientWidth/2+a.container.scrollLeft-c.offsetLeft+"px":E.x+a.container.scrollLeft-c.offsetLeft-a.container.offsetLeft+"px")+" "+(d?a.container.clientHeight/2+a.container.scrollTop-c.offsetTop+"px":E.y+a.container.scrollTop-c.offsetTop-a.container.offsetTop+"px")),mxUtils.setPrefixedStyle(c.style,
|
|
|
|
|
"transform","scale("+this.cumulativeZoomFactor+")"));a.view.getDecoratorPane().style.opacity="0";a.view.getOverlayPane().style.opacity="0";null!=b.hoverIcons&&b.hoverIcons.reset()}G(f)};mxEvent.addGestureListeners(a.container,function(a){null!=z&&window.clearTimeout(z)},null,function(b){1!=a.cumulativeZoomFactor&&G(0)});mxEvent.addListener(a.container,"scroll",function(b){null==z||a.isMouseDown||1==a.cumulativeZoomFactor||G(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,c,d,f,g){if(null==
|
|
|
|
|
this.dialogs||0==this.dialogs.length)if(!a.scrollbars&&!d&&a.isScrollWheelEvent(b))d=a.view.getTranslate(),f=40/a.view.scale,mxEvent.isShiftDown(b)?a.view.setTranslate(d.x+(c?-f:f),d.y):a.view.setTranslate(d.x,d.y+(c?f:-f));else if(d||a.isZoomWheelEvent(b))for(var e=mxEvent.getSource(b);null!=e;){if(e==a.container)return a.tooltipHandler.hideTooltip(),E=null!=f&&null!=g?new mxPoint(f,g):new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b)),I=d,a.lazyZoom(c),mxEvent.consume(b),!1;e=e.parentNode}}),
|
|
|
|
|
a.container);a.panningHandler.zoomGraph=function(b){a.cumulativeZoomFactor=b.scale;a.lazyZoom(0<b.scale,!0);mxEvent.consume(b)}};EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};
|
|
|
|
|
EditorUi.prototype.createTemporaryGraph=function(a){var c=new Graph(document.createElement("div"));c.stylesheet.styles=mxUtils.clone(a.styles);c.resetViewOnRootChange=!1;c.setConnectable(!1);c.gridEnabled=!1;c.autoScroll=!1;c.setTooltips(!1);c.setEnabled(!1);c.container.style.visibility="hidden";c.container.style.position="absolute";c.container.style.overflow="hidden";c.container.style.height="1px";c.container.style.width="1px";return c};
|
|
|
|
|
EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};EditorUi.prototype.toggleFormatPanel=function(a){a=null!=a?a:0==this.formatWidth;null!=this.format&&(this.formatWidth=a?240:0,this.formatContainer.style.display=a?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};
|
|
|
|
|
EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var c=urlParams.border,b=60;null!=c&&(b=parseInt(c));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(b,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
|
|
|
|
@ -9709,8 +9709,8 @@ v.className="geToolbarContainer";v.style.cssText="box-shadow:none !important;bac
|
|
|
|
|
return d}mxEvent.addListener(E,"change",function(a){B=parseInt(E.value);d(A[B]);mxEvent.consume(a)});if("mxfile"==z.nodeName){var b=z.getElementsByTagName("diagram");A=[];for(var c=0;c<b.length;c++)A.push(b[c]);0<A.length&&d(A[B]);E.innerHTML="";if(1<A.length)for(E.style.display="",c=0;c<A.length;c++)b=document.createElement("option"),mxUtils.write(b,A[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),b.setAttribute("value",c),c==B&&b.setAttribute("selected","selected"),E.appendChild(b);
|
|
|
|
|
else E.style.display="none"}else a(z)};v.appendChild(E);v.appendChild(c);v.appendChild(l);v.appendChild(t);v.appendChild(e);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";n=null!=n?mxUtils.button(mxResources.get("ignore"),n):null;null!=n&&(n.className="geBtn");a.editor.cancelFirst?(q.appendChild(c),null!=n&&q.appendChild(n),q.appendChild(m),q.appendChild(f)):(q.appendChild(f),q.appendChild(m),null!=n&&q.appendChild(n),q.appendChild(c));k.appendChild(q);
|
|
|
|
|
k.appendChild(v);this.container=k},FindWindow=function(a,e,c,b,g){function f(a,d,b){if("object"===typeof d.value&&null!=d.value.attributes){d=d.value.attributes;for(var c=0;c<d.length;c++)if("label"!=d[c].nodeName){var e=mxUtils.trim(d[c].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&e.substring(0,b.length)===b||null!=a&&a.test(e))return!0}}return!1}function m(b){var c=d.model.getDescendants(d.model.getRoot()),e=t.value.toLowerCase(),g=q.checked?new RegExp(e):null,
|
|
|
|
|
u=null;k!=e&&(k=e,l=null,p=!1);var z=null==l;if(0<e.length){if(p){p=!1;for(var n,v=0;v<a.pages.length;v++)if(a.currentPage==a.pages[v]){n=v;break}b=(n+1)%a.pages.length;l=null;do p=!1,c=a.pages[b],d=a.createTemporaryGraph(d.getStylesheet()),a.updatePageRoot(c),d.model.setRoot(c.root),b=(b+1)%a.pages.length;while(!m(!0)&&b!=n);l&&(l=null,a.selectPage(c));p=!1;d=a.editor.graph;return m(!0)}for(v=0;v<c.length;v++){n=d.view.getState(c[v]);if(null!=n&&null!=n.cell.value&&(z||null==u)&&(d.model.isVertex(n.cell)||
|
|
|
|
|
d.model.isEdge(n.cell))&&(d.isHtmlLabel(n.cell)?(x.innerHTML=d.sanitizeHtml(d.getLabel(n.cell)),label=mxUtils.extractTextWithWhitespace([x])):label=d.getLabel(n.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==g&&(label.substring(0,e.length)===e||f(g,n.cell,e))||null!=g&&(g.test(label)||f(g,n.cell,e))))if(z){u=n;break}else null==u&&(u=n);z=z||n==l}}if(null!=u){if(v==c.length&&y.checked)return l=null,p=!0,m(!0);l=u;d.scrollCellToVisible(l.cell);d.isEnabled()?
|
|
|
|
|
u=null;k!=e&&(k=e,l=null,p=!1);var z=null==l;if(0<e.length){if(p){p=!1;for(var v,n=0;n<a.pages.length;n++)if(a.currentPage==a.pages[n]){v=n;break}b=(v+1)%a.pages.length;l=null;do p=!1,c=a.pages[b],d=a.createTemporaryGraph(d.getStylesheet()),a.updatePageRoot(c),d.model.setRoot(c.root),b=(b+1)%a.pages.length;while(!m(!0)&&b!=v);l&&(l=null,a.selectPage(c));p=!1;d=a.editor.graph;return m(!0)}for(n=0;n<c.length;n++){v=d.view.getState(c[n]);if(null!=v&&null!=v.cell.value&&(z||null==u)&&(d.model.isVertex(v.cell)||
|
|
|
|
|
d.model.isEdge(v.cell))&&(d.isHtmlLabel(v.cell)?(x.innerHTML=d.sanitizeHtml(d.getLabel(v.cell)),label=mxUtils.extractTextWithWhitespace([x])):label=d.getLabel(v.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==g&&(label.substring(0,e.length)===e||f(g,v.cell,e))||null!=g&&(g.test(label)||f(g,v.cell,e))))if(z){u=v;break}else null==u&&(u=v);z=z||v==l}}if(null!=u){if(n==c.length&&y.checked)return l=null,p=!0,m(!0);l=u;d.scrollCellToVisible(l.cell);d.isEnabled()?
|
|
|
|
|
d.setSelectionCell(l.cell):d.highlightCell(l.cell)}else{if(!b&&y.checked)return p=!0,m(!0);d.isEnabled()&&d.clearSelection()}return 0==e.length||null!=u}var n=a.actions.get("find"),d=a.editor.graph,k=null,l=null,p=!1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var t=document.createElement("input");t.setAttribute("placeholder",mxResources.get("find"));t.setAttribute("type","text");t.style.marginTop="4px";t.style.marginBottom=
|
|
|
|
|
"6px";t.style.width="200px";t.style.fontSize="12px";t.style.borderRadius="4px";t.style.padding="6px";u.appendChild(t);mxUtils.br(u);var q=document.createElement("input");q.setAttribute("id","geFindWinRegExChck");q.setAttribute("type","checkbox");q.style.marginRight="4px";u.appendChild(q);var v=document.createElement("label");v.setAttribute("for","geFindWinRegExChck");u.appendChild(v);mxUtils.write(v,mxResources.get("regularExpression"));u.appendChild(v);v=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");
|
|
|
|
|
v.style.position="relative";v.style.marginLeft="6px";v.style.top="-1px";u.appendChild(v);mxUtils.br(u);var y=document.createElement("input");y.setAttribute("id","geFindWinAllPagesChck");y.setAttribute("type","checkbox");y.style.marginRight="4px";u.appendChild(y);v=document.createElement("label");v.setAttribute("for","geFindWinAllPagesChck");u.appendChild(v);mxUtils.write(v,mxResources.get("allPages"));u.appendChild(v);var x=document.createElement("div");mxUtils.br(u);v=mxUtils.button(mxResources.get("reset"),
|
|
|
|
@ -9792,9 +9792,9 @@ m.setAttribute("colspan","2");m.style.fontSize="10pt";mxUtils.write(m,c);f.appen
|
|
|
|
|
m.appendChild(g);var t=function(d,b,c){var e=k.value,l=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(l.documentElement),l=l.documentElement.getElementsByTagName("parsererror");if(null!=l&&0<l.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),l=!d.model.contains(b),!c||l||e!=u){e=Graph.compress(e);d.getModel().beginUpdate();try{if(l){var f=a.editor.graph.getFreeInsertPoint();b.geometry.x=f.x;b.geometry.y=f.y;d.addCell(b)}d.setCellStyles(mxConstants.STYLE_SHAPE,
|
|
|
|
|
"stencil("+e+")",[b])}catch(B){throw B;}finally{d.getModel().endUpdate()}l&&(d.setSelectionCell(b),d.scrollCellToVisible(b))}};c=mxUtils.button(mxResources.get("preview"),function(){t(l,p,!1)});c.className="geBtn";m.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,e,!0)});c.className="geBtn gePrimaryBtn";m.appendChild(c);a.editor.cancelFirst||m.appendChild(g);f.appendChild(m);d.appendChild(f);n.appendChild(d);this.container=n},CustomDialog=function(a,e,c,b,g,f,
|
|
|
|
|
m,n,d){var k=document.createElement("div");k.appendChild(e);e=document.createElement("div");e.style.marginTop="16px";e.style.textAlign="center";null!=m&&e.appendChild(m);a.isOffline()||null==f||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),m.className="geBtn",e.appendChild(m));d=mxUtils.button(d||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b()});d.className="geBtn";n&&(d.style.display="none");a.editor.cancelFirst&&e.appendChild(d);g=mxUtils.button(g||mxResources.get("ok"),
|
|
|
|
|
function(){a.hideDialog();null!=c&&c()});e.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(d);k.appendChild(e);this.cancelBtn=d;this.okButton=g;this.container=k},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+
|
|
|
|
|
mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+mxResources.get("showAll",null,"+ Show all")+
|
|
|
|
|
'</div></div></div><div class="geTempDlgDiagramsList"><div class="geTempDlgDiagramsListHeader"><div class="geTempDlgDiagramsListTitle"></div><div class="geTempDlgDiagramsListBtns"><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge" data-id="myDiagramsBtn"><img src="/images/my-diagrams.svg" class="geTempDlgMyDiagramsBtnImg"> <span>'+mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+
|
|
|
|
|
function(){if(null!=c){var d=c();if("string"===typeof d){a.showError(mxResources.get("error"),d);return}}a.hideDialog()});e.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(d);k.appendChild(e);this.cancelBtn=d;this.okButton=g;this.container=k},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+
|
|
|
|
|
'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+
|
|
|
|
|
mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTempDlgDiagramsList"><div class="geTempDlgDiagramsListHeader"><div class="geTempDlgDiagramsListTitle"></div><div class="geTempDlgDiagramsListBtns"><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge" data-id="myDiagramsBtn"><img src="/images/my-diagrams.svg" class="geTempDlgMyDiagramsBtnImg"> <span>'+mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+
|
|
|
|
|
mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">🛈 '+
|
|
|
|
|
mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",e=document.createElement("div");e.innerHTML=a;e.className="geTemplateDlg";
|
|
|
|
|
var a=window.innerWidth,c=window.innerHeight,b=987,g=712;.9*a<b&&(b=Math.max(.9*a,600),e.style.width=b+"px");.9*c<g&&(g=Math.max(.9*c,300),e.style.height=g+"px");this.width=b;this.height=g;this.container=e};
|
|
|
|
@ -9837,8 +9837,8 @@ n.appendChild(e);m.appendChild(n);l.appendChild(m);k.appendChild(l);this.contain
|
|
|
|
|
function AspectDialog(a,e,c,b,g){this.aspect={pageId:e||a.pages[0].getId(),layerIds:c||[]};e=document.createElement("div");var f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("pages"));e.appendChild(f);c=document.createElement("div");c.className="geAspectDlgList";e.appendChild(c);f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("layers"));e.appendChild(f);f=document.createElement("div");f.className="geAspectDlgList";
|
|
|
|
|
e.appendChild(f);this.pagesContainer=c;this.layersContainer=f;this.ui=a;c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=g&&g()});f.className="geBtn";a.editor.cancelFirst&&c.appendChild(f);var m=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();b({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));c.appendChild(m);m.className="geBtn gePrimaryBtn";
|
|
|
|
|
a.editor.cancelFirst||c.appendChild(f);m.setAttribute("disabled","disabled");this.okBtn=m;e.appendChild(c);this.container=e}AspectDialog.prototype.init=function(){this.ui.getFileData(!0);for(var a=0;a<this.ui.pages.length;a++){var e=this.ui.updatePageRoot(this.ui.pages[a]);this.createPageItem(e.getId(),e.getName(),e.node,e.root)}};
|
|
|
|
|
AspectDialog.prototype.createViewer=function(a,e,c){mxEvent.disableContextMenu(a);a.style.userSelect="none";var b=new Graph(a);b.setTooltips(!1);b.setEnabled(!1);b.setPanning(!1);b.minFitScale=null;b.maxFitScale=null;b.centerZoom=!0;e=Editor.parseDiagramNode(e);if(null!=e){var g=e.getAttribute("background");if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";a.style.backgroundColor=g;g=new mxCodec(e.ownerDocument);a=b.getModel();g.decode(e,a);e=a.getChildCount(a.root);for(var g=null==c,f=0;f<e;f++){var m=
|
|
|
|
|
a.getChildAt(a.root,f);a.setVisible(m,g||c==m.id)}b.maxFitScale=1;b.fit(0);b.center()}return b};
|
|
|
|
|
AspectDialog.prototype.createViewer=function(a,e,c){mxEvent.disableContextMenu(a);a.style.userSelect="none";var b=new Graph(a);b.setTooltips(!1);b.setEnabled(!1);b.setPanning(!1);b.minFitScale=null;b.maxFitScale=null;b.centerZoom=!0;e="mxGraphModel"==e.nodeName?e:Editor.parseDiagramNode(e);if(null!=e){var g=e.getAttribute("background");if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";a.style.backgroundColor=g;g=new mxCodec(e.ownerDocument);a=b.getModel();g.decode(e,a);e=a.getChildCount(a.root);
|
|
|
|
|
for(var g=null==c,f=0;f<e;f++){var m=a.getChildAt(a.root,f);a.setVisible(m,g||c==m.id)}b.maxFitScale=1;b.fit(0);b.center()}return b};
|
|
|
|
|
AspectDialog.prototype.createPageItem=function(a,e,c,b){var g=document.createElement("div");g.className="geAspectDlgListItem";g.setAttribute("data-page-id",a);g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(e)+"</div>";this.pagesContainer.appendChild(g);var f=this.createViewer(g.childNodes[0],c);e=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem=
|
|
|
|
|
g;this.selectedPage=a;g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerHTML="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");for(var b=f.model,b=b.getChildCells(b.getRoot()),e=0;e<b.length;e++)this.createLayerItem(b[e],a,f,c)});mxEvent.addListener(g,"click",e);this.aspect.pageId==a&&e()};
|
|
|
|
|
AspectDialog.prototype.createLayerItem=function(a,e,c,b){e=c.convertValueToString(a)||mxResources.get("background")||"Background";var g=document.createElement("div");g.setAttribute("data-layer-id",a.id);g.className="geAspectDlgListItem";g.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(e)+"</div>";this.layersContainer.appendChild(g);this.createViewer(g.childNodes[0],b,a.id);b=mxUtils.bind(this,function(){0<=g.className.indexOf("geAspectDlgListItemSelected")?
|
|
|
|
@ -9950,9 +9950,9 @@ else if("sfnt"==f||/(\.sfnt)($|\?)/i.test(a))d="application/font-sfnt";var b=a;/
|
|
|
|
|
mxUtils.bind(this,function(d){this.resolvedFontCss=d;a()})):a()};Editor.prototype.embedExtFonts=function(a){var d=this.graph.getCustomFonts();if(0<d.length){var b="",c=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts={});for(var e=mxUtils.bind(this,function(){0==c&&this.embedCssFonts(b,a)}),k=0;k<d.length;k++)mxUtils.bind(this,function(a,d){Graph.isCssFontUrl(d)?null==this.cachedGoogleFonts[d]?(c++,this.loadUrl(d,mxUtils.bind(this,function(a){this.cachedGoogleFonts[d]=a;b+=a;c--;e()}),mxUtils.bind(this,
|
|
|
|
|
function(a){c--;b+="@import url("+d+");";e()}))):b+=this.cachedGoogleFonts[d]:b+='@font-face {font-family: "'+a+'";src: url("'+d+'")}'})(d[k].name,d[k].url);e()}else a()};Editor.prototype.addMathCss=function(a){a=a.getElementsByTagName("defs");if(null!=a&&0<a.length)for(var d=document.getElementsByTagName("style"),b=0;b<d.length;b++)0<mxUtils.getTextContent(d[b]).indexOf("MathJax")&&a[0].appendChild(d[b].cloneNode(!0))};Editor.prototype.addFontCss=function(a,d){d=null!=d?d:this.absoluteCssFonts(this.fontCss);
|
|
|
|
|
if(null!=d){var b=a.getElementsByTagName("defs"),c=a.ownerDocument;0==b.length?(b=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"defs"):c.createElement("defs"),null!=a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)):b=b[0];c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,d);b.appendChild(c)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||
|
|
|
|
|
this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(a,d,b){var c=mxClient.IS_FF?8192:16384;return Math.min(b,Math.min(c/a,c/d))};Editor.prototype.exportToCanvas=function(a,d,b,c,e,k,l,f,p,g,u,t,q,m,n,z){try{k=null!=k?k:!0;l=null!=l?l:!0;t=null!=t?t:this.graph;q=null!=q?q:0;var v=p?null:t.background;v==mxConstants.NONE&&(v=null);null==v&&(v=c);null==v&&0==p&&(v=z?this.graph.defaultPageBackgroundColor:"#ffffff");this.convertImages(t.getSvg(null,null,q,m,null,l,null,null,null,g,null,
|
|
|
|
|
z),mxUtils.bind(this,function(b){try{var c=new Image;c.onload=mxUtils.bind(this,function(){try{var l=function(){mxClient.IS_SF?window.setTimeout(function(){m.drawImage(c,0,0);a(p)},0):(m.drawImage(c,0,0),a(p))},p=document.createElement("canvas"),g=parseInt(b.getAttribute("width")),u=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=d&&(f=k?Math.min(1,Math.min(3*d/(4*u),d/g)):d/g);f=this.getMaxCanvasScale(g,u,f);g=Math.ceil(f*g);u=Math.ceil(f*u);p.setAttribute("width",g);p.setAttribute("height",
|
|
|
|
|
u);var m=p.getContext("2d");null!=v&&(m.beginPath(),m.rect(0,0,g,u),m.fillStyle=v,m.fill());1!=f&&m.scale(f,f);if(n){var z=t.view,B=z.scale;z.scale=1;var A=btoa(unescape(encodeURIComponent(z.createSvgGrid(z.gridColor))));z.scale=B;var A="data:image/svg+xml;base64,"+A,x=t.gridSize*z.gridSteps*f,D=t.getGraphBounds(),y=z.translate.x*B,K=z.translate.y*B,M=y+(D.x-y)/B-q,C=K+(D.y-K)/B-q,O=new Image;O.onload=function(){try{for(var a=-Math.round(x-mxUtils.mod((y-M)*f,x)),d=-Math.round(x-mxUtils.mod((K-C)*
|
|
|
|
|
this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(a,d,b){var c=mxClient.IS_FF?8192:16384;return Math.min(b,Math.min(c/a,c/d))};Editor.prototype.exportToCanvas=function(a,d,b,c,e,k,l,f,p,g,u,t,q,m,n,v){try{k=null!=k?k:!0;l=null!=l?l:!0;t=null!=t?t:this.graph;q=null!=q?q:0;var z=p?null:t.background;z==mxConstants.NONE&&(z=null);null==z&&(z=c);null==z&&0==p&&(z=v?this.graph.defaultPageBackgroundColor:"#ffffff");this.convertImages(t.getSvg(null,null,q,m,null,l,null,null,null,g,null,
|
|
|
|
|
v),mxUtils.bind(this,function(b){try{var c=new Image;c.onload=mxUtils.bind(this,function(){try{var l=function(){mxClient.IS_SF?window.setTimeout(function(){m.drawImage(c,0,0);a(p)},0):(m.drawImage(c,0,0),a(p))},p=document.createElement("canvas"),g=parseInt(b.getAttribute("width")),u=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=d&&(f=k?Math.min(1,Math.min(3*d/(4*u),d/g)):d/g);f=this.getMaxCanvasScale(g,u,f);g=Math.ceil(f*g);u=Math.ceil(f*u);p.setAttribute("width",g);p.setAttribute("height",
|
|
|
|
|
u);var m=p.getContext("2d");null!=z&&(m.beginPath(),m.rect(0,0,g,u),m.fillStyle=z,m.fill());1!=f&&m.scale(f,f);if(n){var v=t.view,B=v.scale;v.scale=1;var A=btoa(unescape(encodeURIComponent(v.createSvgGrid(v.gridColor))));v.scale=B;var A="data:image/svg+xml;base64,"+A,x=t.gridSize*v.gridSteps*f,D=t.getGraphBounds(),y=v.translate.x*B,K=v.translate.y*B,M=y+(D.x-y)/B-q,C=K+(D.y-K)/B-q,O=new Image;O.onload=function(){try{for(var a=-Math.round(x-mxUtils.mod((y-M)*f,x)),d=-Math.round(x-mxUtils.mod((K-C)*
|
|
|
|
|
f,x));a<g;a+=x)for(var b=d;b<u;b+=x)m.drawImage(O,a/f,b/f);l()}catch(ta){null!=e&&e(ta)}};O.onerror=function(a){null!=e&&e(a)};O.src=A}else l()}catch(na){null!=e&&e(na)}});c.onerror=function(a){null!=e&&e(a)};g&&this.graph.addSvgShadow(b);this.graph.mathEnabled&&this.addMathCss(b);var l=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(b,this.resolvedFontCss),c.src=Editor.createSvgDataUri(mxUtils.getXml(b))}catch(da){null!=e&&e(da)}});this.embedExtFonts(mxUtils.bind(this,
|
|
|
|
|
function(a){try{null!=a&&this.addFontCss(b,a),this.loadFonts(l)}catch(aa){null!=e&&e(aa)}}))}catch(da){null!=e&&e(da)}}),b,u)}catch(N){null!=e&&e(N)}};Editor.crcTable=[];for(var g=0;256>g;g++)for(var f=g,m=0;8>m;m++)f=1==(f&1)?3988292384^f>>>1:f>>>1,Editor.crcTable[g]=f;Editor.updateCRC=function(a,d,b,c){for(var e=0;e<c;e++)a=Editor.crcTable[(a^d.charCodeAt(b+e))&255]^a>>>8;return a};Editor.crc32=function(a){for(var d=-1,b=0;b<a.length;b++)d=d>>>8^Editor.crcTable[(d^a.charCodeAt(b))&255];return(d^
|
|
|
|
|
-1)>>>0};Editor.writeGraphModelToPng=function(a,d,b,c,e){function k(a,d){var b=p;p+=d;return a.substring(b,p)}function l(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(k(a,4),"IHDR"!=k(a,4))null!=
|
|
|
|
@ -9994,15 +9994,15 @@ d,t.getSelectionCells());e.push(a);k.push(d);if(null!=b.dependentProps)for(a=0;a
|
|
|
|
|
function e(d,b,c){var e=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(d,!0);b.style.position="absolute";b.style.left=k.x-e.x+"px";b.style.top=k.y-e.y+"px";b.style.width=d.offsetWidth+"px";b.style.height=d.offsetHeight-(c?4:0)+"px";b.style.zIndex=5}function k(a,d,b){var e=document.createElement("div");e.style.width="32px";e.style.height="4px";e.style.margin="2px";e.style.border="1px solid black";e.style.background=d&&"none"!=d?d:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(u,
|
|
|
|
|
function(k){this.editorUi.pickColor(d,function(d){e.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(e);return btn}function l(a,d,b,e,k,l,f){null!=d&&(d=d.split(","),q.push({name:a,values:d,type:b,defVal:e,countProperty:k,parentRow:l,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(u,function(d){for(var p=l,u=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==
|
|
|
|
|
a)p=p.nextSibling,u++;else break;var t={type:b,parentRow:l,index:u,isDeletable:!0,defVal:e,countProperty:k},u=g(a,"",t,0==u%2,f);c(a,e,t);p.parentNode.insertBefore(u,p.nextSibling);mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,d,b,c,e,k,l){if(0<e){var f=Array(e);d=null!=d?d.split(","):[];for(var p=0;p<e;p++)f[p]=null!=d[p]?d[p]:null!=c?c:"";q.push({name:a,values:f,type:b,defVal:c,parentRow:k,flipBkg:l,size:e})}return document.createElement("div")}
|
|
|
|
|
function p(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function g(d,b,g,t,q){var m=g.dispName,n=g.type,z=document.createElement("tr");z.className="gePropRow"+(q?"Dark":"")+(t?"Alt":"")+" gePropNonHeaderRow";z.setAttribute("data-pName",d);z.setAttribute("data-pValue",b);t=!1;null!=g.index&&(z.setAttribute("data-index",g.index),m=(null!=m?m:"")+"["+g.index+"]",t=!0);var v=document.createElement("td");
|
|
|
|
|
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(m,null,m));t&&(v.style.textAlign="right");z.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==n)v.appendChild(k(d,b,g));else if("bool"==n||"boolean"==n)v.appendChild(p(d,b,g));else if("enum"==n){var B=g.enumList;for(q=0;q<B.length;q++)if(m=B[q],m.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(m.dispName,null,m.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(u,function(){var k=
|
|
|
|
|
document.createElement("select");e(v,k);for(var l=0;l<B.length;l++){var f=B[l],p=document.createElement("option");p.value=mxUtils.htmlEntities(f.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(p)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);c(d,a,g)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==n?v.appendChild(l(d,b,g.subType,g.subDefVal,g.countProperty,
|
|
|
|
|
z,q)):"staticArr"==n?v.appendChild(f(d,b,g.subType,g.subDefVal,g.size,z,q)):(v.innerHTML=b,mxEvent.addListener(v,"click",mxUtils.bind(u,function(){function k(){var a=l.value,a=0==a.length&&"string"!=n?0:a;g.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",n="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=g.min&&a<g.min?a=g.min:null!=g.max&&a>g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==n?parseInt(a):a)+"");c(d,a,g)}var l=document.createElement("input");e(v,l,!0);l.value=b;l.className=
|
|
|
|
|
"gePropEditor";"int"!=n&&"float"!=n||g.allowAuto||(l.type="number",l.step="int"==n?"1":"any",null!=g.min&&(l.min=parseFloat(g.min)),null!=g.max&&(l.max=parseFloat(g.max)));a.appendChild(l);mxEvent.addListener(l,"keypress",function(a){13==a.keyCode&&k()});l.focus();mxEvent.addListener(l,"blur",function(){k()})})));g.isDeletable&&(q=mxUtils.button("-",mxUtils.bind(u,function(a){c(d,"",g,g.index);mxEvent.consume(a)})),q.style.height="16px",q.style.width="25px",q.style["float"]="right",q.className="geColorBtn",
|
|
|
|
|
v.appendChild(q));z.appendChild(v);return z}var u=this,t=this.editorUi.editor.graph,q=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.className="geProperties";m.style.whiteSpace="nowrap";m.style.width="100%";var n=document.createElement("tr");n.className="gePropHeader";var z=document.createElement("th");z.className="gePropHeaderCell";var v=document.createElement("img");v.src=Sidebar.prototype.expandedImage;z.appendChild(v);mxUtils.write(z,mxResources.get("property"));
|
|
|
|
|
n.style.cursor="pointer";var B=function(){var d=m.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(ka){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(n,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;
|
|
|
|
|
B()});n.appendChild(z);z=document.createElement("th");z.className="gePropHeaderCell";z.innerHTML=mxResources.get("value");n.appendChild(z);m.appendChild(n);var A=!1,x=!1,y;for(y in d)if(n=d[y],"function"!=typeof n.isVisible||n.isVisible(b,this)){var D=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=n.getDefaultValue?n.getDefaultValue(b,this):n.defVal;if("separator"==n.type)x=!x;else{if("staticArr"==n.type)n.size=parseInt(b.style[n.sizeProperty]||d[n.sizeProperty].defVal)||0;else if(null!=
|
|
|
|
|
n.dependentProps){for(var K=n.dependentProps,C=[],I=[],z=0;z<K.length;z++){var M=b.style[K[z]];I.push(d[K[z]].subDefVal);C.push(null!=M?M.split(","):[])}n.dependentPropsDefVal=I;n.dependentPropsVals=C}m.appendChild(g(y,D,n,A,x));A=!A}}for(z=0;z<q.length;z++)for(n=q[z],d=n.parentRow,b=0;b<n.values.length;b++)y=g(n.name,n.values[b],{type:n.type,parentRow:n.parentRow,isDeletable:n.isDeletable,index:b,defVal:n.defVal,countProperty:n.countProperty,size:n.size},0==b%2,n.flipBkg),d.parentNode.insertBefore(y,
|
|
|
|
|
function p(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function g(d,b,g,t,q){var m=g.dispName,v=g.type,z=document.createElement("tr");z.className="gePropRow"+(q?"Dark":"")+(t?"Alt":"")+" gePropNonHeaderRow";z.setAttribute("data-pName",d);z.setAttribute("data-pValue",b);t=!1;null!=g.index&&(z.setAttribute("data-index",g.index),m=(null!=m?m:"")+"["+g.index+"]",t=!0);var n=document.createElement("td");
|
|
|
|
|
n.className="gePropRowCell";n.innerHTML=mxUtils.htmlEntities(mxResources.get(m,null,m));t&&(n.style.textAlign="right");z.appendChild(n);n=document.createElement("td");n.className="gePropRowCell";if("color"==v)n.appendChild(k(d,b,g));else if("bool"==v||"boolean"==v)n.appendChild(p(d,b,g));else if("enum"==v){var B=g.enumList;for(q=0;q<B.length;q++)if(m=B[q],m.val==b){n.innerHTML=mxUtils.htmlEntities(mxResources.get(m.dispName,null,m.dispName));break}mxEvent.addListener(n,"click",mxUtils.bind(u,function(){var k=
|
|
|
|
|
document.createElement("select");e(n,k);for(var l=0;l<B.length;l++){var f=B[l],p=document.createElement("option");p.value=mxUtils.htmlEntities(f.val);p.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(p)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);c(d,a,g)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==v?n.appendChild(l(d,b,g.subType,g.subDefVal,g.countProperty,
|
|
|
|
|
z,q)):"staticArr"==v?n.appendChild(f(d,b,g.subType,g.subDefVal,g.size,z,q)):(n.innerHTML=b,mxEvent.addListener(n,"click",mxUtils.bind(u,function(){function k(){var a=l.value,a=0==a.length&&"string"!=v?0:a;g.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",v="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=g.min&&a<g.min?a=g.min:null!=g.max&&a>g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==v?parseInt(a):a)+"");c(d,a,g)}var l=document.createElement("input");e(n,l,!0);l.value=b;l.className=
|
|
|
|
|
"gePropEditor";"int"!=v&&"float"!=v||g.allowAuto||(l.type="number",l.step="int"==v?"1":"any",null!=g.min&&(l.min=parseFloat(g.min)),null!=g.max&&(l.max=parseFloat(g.max)));a.appendChild(l);mxEvent.addListener(l,"keypress",function(a){13==a.keyCode&&k()});l.focus();mxEvent.addListener(l,"blur",function(){k()})})));g.isDeletable&&(q=mxUtils.button("-",mxUtils.bind(u,function(a){c(d,"",g,g.index);mxEvent.consume(a)})),q.style.height="16px",q.style.width="25px",q.style["float"]="right",q.className="geColorBtn",
|
|
|
|
|
n.appendChild(q));z.appendChild(n);return z}var u=this,t=this.editorUi.editor.graph,q=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.className="geProperties";m.style.whiteSpace="nowrap";m.style.width="100%";var v=document.createElement("tr");v.className="gePropHeader";var z=document.createElement("th");z.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;z.appendChild(n);mxUtils.write(z,mxResources.get("property"));
|
|
|
|
|
v.style.cursor="pointer";var B=function(){var d=m.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){n.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(ka){}}else n.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(v,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;
|
|
|
|
|
B()});v.appendChild(z);z=document.createElement("th");z.className="gePropHeaderCell";z.innerHTML=mxResources.get("value");v.appendChild(z);m.appendChild(v);var A=!1,x=!1,y;for(y in d)if(v=d[y],"function"!=typeof v.isVisible||v.isVisible(b,this)){var D=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=v.getDefaultValue?v.getDefaultValue(b,this):v.defVal;if("separator"==v.type)x=!x;else{if("staticArr"==v.type)v.size=parseInt(b.style[v.sizeProperty]||d[v.sizeProperty].defVal)||0;else if(null!=
|
|
|
|
|
v.dependentProps){for(var K=v.dependentProps,C=[],I=[],z=0;z<K.length;z++){var M=b.style[K[z]];I.push(d[K[z]].subDefVal);C.push(null!=M?M.split(","):[])}v.dependentPropsDefVal=I;v.dependentPropsVals=C}m.appendChild(g(y,D,v,A,x));A=!A}}for(z=0;z<q.length;z++)for(v=q[z],d=v.parentRow,b=0;b<v.values.length;b++)y=g(v.name,v.values[b],{type:v.type,parentRow:v.parentRow,isDeletable:v.isDeletable,index:b,defVal:v.defVal,countProperty:v.countProperty,size:v.size},0==b%2,v.flipBkg),d.parentNode.insertBefore(y,
|
|
|
|
|
d.nextSibling),d=y;a.appendChild(m);B();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var b=this.editorUi,c=b.editor.graph,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.paddingLeft="24px";e.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(e);
|
|
|
|
|
var k="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" "),l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.position="relative";l.style.textAlign="center";for(var f=[],p=0;p<this.defaultColorSchemes.length;p++){var g=document.createElement("div");g.style.display="inline-block";g.style.width="6px";g.style.height="6px";g.style.marginLeft="4px";g.style.marginRight=
|
|
|
|
|
"3px";g.style.borderRadius="3px";g.style.cursor="pointer";g.style.background="transparent";g.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(a){mxEvent.addListener(g,"click",mxUtils.bind(this,function(){u(a)}))})(p);f.push(g);l.appendChild(g)}var u=mxUtils.bind(this,function(a){null!=this.format.currentScheme&&(f[this.format.currentScheme].style.background="transparent");this.format.currentScheme=a;t(this.defaultColorSchemes[this.format.currentScheme]);f[this.format.currentScheme].style.background=
|
|
|
|
@ -10030,8 +10030,8 @@ function(a){return Graph.processFontStyle(y.apply(this,arguments))};var x=mxSvgC
|
|
|
|
|
for(d in Graph.customFontElements){var b=Graph.customFontElements[d];a.push({name:b.name,url:b.url})}return a};Graph.prototype.setFont=function(a,d){Graph.addFont(a,d);document.execCommand("fontname",!1,a);if(null!=d){var b=this.cellEditor.textarea.getElementsByTagName("font");d=Graph.getFontUrl(a,d);for(var c=0;c<b.length;c++)b[c].getAttribute("face")==a&&b[c].getAttribute("data-font-src")!=d&&b[c].setAttribute("data-font-src",d)}};var z=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=
|
|
|
|
|
function(){return z.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=a)for(var d in a)this.globalVars[d]=a[d]}catch(O){null!=window.console&&console.log("Error in vars URL parameter: "+O)}};Graph.prototype.getExportVariables=function(){return null!=
|
|
|
|
|
this.globalVars?mxUtils.clone(this.globalVars):{}};var B=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=B.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};
|
|
|
|
|
var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,k,l,f,p,g,u,t){var q=null;t||null==this.themes||"darkTheme"!=this.defaultThemeName||(q=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var m=A.apply(this,arguments),n=this.getCustomFonts();if(u&&0<n.length){var z=m.ownerDocument,v=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"style"):z.createElement("style");null!=z.setAttributeNS?v.setAttributeNS("type","text/css"):v.setAttribute("type",
|
|
|
|
|
"text/css");for(var B="",x="",y=0;y<n.length;y++){var D=n[y].name,C=n[y].url;Graph.isCssFontUrl(C)?B+="@import url("+C+");\n":x+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+C+'");\n}\n'}v.appendChild(z.createTextNode(B+x));m.getElementsByTagName("defs")[0].appendChild(v)}null!=q&&(this.stylesheet=q,this.refresh());return m};var D=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=D.apply(this,arguments);if(this.mathEnabled){var d=a.drawText;a.drawText=
|
|
|
|
|
var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,k,l,f,p,g,u,t){var q=null;t||null==this.themes||"darkTheme"!=this.defaultThemeName||(q=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var m=A.apply(this,arguments),v=this.getCustomFonts();if(u&&0<v.length){var z=m.ownerDocument,n=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"style"):z.createElement("style");null!=z.setAttributeNS?n.setAttributeNS("type","text/css"):n.setAttribute("type",
|
|
|
|
|
"text/css");for(var B="",x="",y=0;y<v.length;y++){var D=v[y].name,C=v[y].url;Graph.isCssFontUrl(C)?B+="@import url("+C+");\n":x+='@font-face {\nfont-family: "'+D+'";\nsrc: url("'+C+'");\n}\n'}n.appendChild(z.createTextNode(B+x));m.getElementsByTagName("defs")[0].appendChild(n)}null!=q&&(this.stylesheet=q,this.refresh());return m};var D=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=D.apply(this,arguments);if(this.mathEnabled){var d=a.drawText;a.drawText=
|
|
|
|
|
function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&(mxUtils.isNode(a.text.value)||a.text.dialect==mxConstants.DIALECT_STRICTHTML)){var c=a.text.getContentNode();if(null!=c){c=c.cloneNode(!0);if(c.getElementsByTagNameNS)for(var e=c.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<e.length;)e[0].parentNode.removeChild(e[0]);null!=c.innerHTML&&(e=a.text.value,a.text.value=c.innerHTML,d.apply(this,arguments),a.text.value=e)}}else d.apply(this,arguments)}}return a};
|
|
|
|
|
var E=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){E.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==
|
|
|
|
|
this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};var F=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){F.apply(this,arguments);
|
|
|
|
@ -10060,30 +10060,30 @@ mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.x
|
|
|
|
|
[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+
|
|
|
|
|
"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
|
|
|
|
|
[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var d=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?d="mxgraph.er":"sysML"==a.substring(0,5)&&(d="mxgraph.sysml"));return d};var G=mxMarker.createMarker;mxMarker.createMarker=function(a,d,b,c,e,k,l,f,p,g){if(null!=b&&null==mxMarker.markers[b]){var u=this.getPackageForType(b);null!=u&&mxStencilRegistry.getStencil(u)}return G.apply(this,arguments)};PrintDialog.prototype.create=function(a,d){function b(){m.value=Math.max(1,
|
|
|
|
|
Math.min(f,Math.max(parseInt(m.value),parseInt(q.value))));q.value=Math.max(1,Math.min(f,Math.min(parseInt(m.value),parseInt(q.value))))}function c(d){function b(d,b,k){var l=d.useCssTransforms,f=d.currentTranslate,p=d.currentScale,g=d.view.translate,u=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var t=d.getGraphBounds(),q=0,m=0,n=J.get(),z=1/d.pageScale,A=B.checked;if(A)var z=parseInt(F.value),
|
|
|
|
|
x=parseInt(K.value),z=Math.min(n.height*x/(t.height/d.view.scale),n.width*z/(t.width/d.view.scale));else z=parseInt(v.value)/(100*d.pageScale),isNaN(z)&&(c=1/d.pageScale,v.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*c);n.height=Math.ceil(n.height*c);z*=c;!A&&d.pageVisible?(t=d.getPageLayout(),q-=t.x*n.width,m-=t.y*n.height):A=!0;if(null==b){b=PrintDialog.createPrintPreview(d,z,n,0,q,m,A);b.pageSelector=!1;b.mathEnabled=!1;q=a.getCurrentFile();null!=q&&(b.title=q.getTitle());
|
|
|
|
|
Math.min(f,Math.max(parseInt(m.value),parseInt(q.value))));q.value=Math.max(1,Math.min(f,Math.min(parseInt(m.value),parseInt(q.value))))}function c(d){function b(d,b,k){var l=d.useCssTransforms,f=d.currentTranslate,p=d.currentScale,g=d.view.translate,u=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var t=d.getGraphBounds(),q=0,m=0,v=J.get(),z=1/d.pageScale,A=B.checked;if(A)var z=parseInt(F.value),
|
|
|
|
|
x=parseInt(K.value),z=Math.min(v.height*x/(t.height/d.view.scale),v.width*z/(t.width/d.view.scale));else z=parseInt(n.value)/(100*d.pageScale),isNaN(z)&&(c=1/d.pageScale,n.value="100 %");v=mxRectangle.fromRectangle(v);v.width=Math.ceil(v.width*c);v.height=Math.ceil(v.height*c);z*=c;!A&&d.pageVisible?(t=d.getPageLayout(),q-=t.x*v.width,m-=t.y*v.height):A=!0;if(null==b){b=PrintDialog.createPrintPreview(d,z,v,0,q,m,A);b.pageSelector=!1;b.mathEnabled=!1;q=a.getCurrentFile();null!=q&&(b.title=q.getTitle());
|
|
|
|
|
var y=b.writeHead;b.writeHead=function(b){y.apply(this,arguments);if(mxClient.IS_GC||mxClient.IS_SF)b.writeln('<style type="text/css">'),b.writeln("div.MathJax_SVG_Display { position: static; }"),b.writeln("</style>");mxClient.IS_GC&&(b.writeln('<style type="text/css">'),b.writeln("@media print {"),b.writeln("span.MathJax_SVG svg { shape-rendering: crispEdges; }"),b.writeln("}"),b.writeln("</style>"));null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"));
|
|
|
|
|
for(var c=d.getCustomFonts(),e=0;e<c.length;e++){var k=c[e].name,l=c[e].url;Graph.isCssFontUrl(l)?b.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(l)+'" charset="UTF-8" type="text/css">'):(b.writeln('<style type="text/css">'),b.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(k)+'";\nsrc: url("'+mxUtils.htmlEntities(l)+'");\n}'),b.writeln("</style>"))}};if("undefined"!==typeof MathJax){var D=b.renderPage;b.renderPage=function(d,b,c,e,k,l){var f=mxClient.NO_FO;mxClient.NO_FO=
|
|
|
|
|
this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var p=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:p.className="geDisableMathJax";return p}}q=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(q=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=q&&(e.stylesheet=q,e.refresh())}else{n=d.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor=
|
|
|
|
|
n;b.autoOrigin=A;b.appendGraph(d,z,q,m,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q<k.length;q++)m=k[q].name,A=k[q].url,Graph.isCssFontUrl(A)?b.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(A)+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(m)+'";\nsrc: url("'+mxUtils.htmlEntities(A)+'");\n}'),b.wnd.document.writeln("</style>"))}l&&(d.useCssTransforms=
|
|
|
|
|
l,d.currentTranslate=f,d.currentScale=p,d.view.translate=g,d.view.scale=u);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var l=q.value,f=m.value,g=!u.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,u.checked,l,f,B.checked,F.value,K.value,parseInt(v.value)/100,parseInt(M.value)/100,J.get());else{g&&(g=l==p&&f==p);if(!g&&null!=
|
|
|
|
|
a.pages&&a.pages.length){var n=0,g=a.pages.length-1;u.checked||(n=parseInt(l)-1,g=parseInt(f)-1);for(var z=n;z<=g;z++){var A=a.pages[z],l=A==a.currentPage?e:null;if(null==l){var l=a.createTemporaryGraph(e.stylesheet),f=!0,n=!1,x=null,y=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(f=A.viewState.pageVisible,n=A.viewState.mathEnabled,x=A.viewState.background,y=A.viewState.backgroundImage,l.extFonts=A.viewState.extFonts);l.background=x;l.backgroundImage=null!=y?new mxImage(y.src,
|
|
|
|
|
y.width,y.height):null;l.pageVisible=f;l.mathEnabled=n;var D=l.getGlobalVariable;l.getGlobalVariable=function(d){return"page"==d?A.getName():"pagenumber"==d?z+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(l.container);a.updatePageRoot(A);l.model.setRoot(A.root)}t=b(l,t,z!=g);l!=e&&l.container.parentNode.removeChild(l.container)}}else t=b(e);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(g=t.wnd.document,
|
|
|
|
|
this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var p=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:p.className="geDisableMathJax";return p}}q=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(q=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=q&&(e.stylesheet=q,e.refresh())}else{v=d.background;if(null==v||""==v||v==mxConstants.NONE)v="#ffffff";b.backgroundColor=
|
|
|
|
|
v;b.autoOrigin=A;b.appendGraph(d,z,q,m,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q<k.length;q++)m=k[q].name,A=k[q].url,Graph.isCssFontUrl(A)?b.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(A)+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(m)+'";\nsrc: url("'+mxUtils.htmlEntities(A)+'");\n}'),b.wnd.document.writeln("</style>"))}l&&(d.useCssTransforms=
|
|
|
|
|
l,d.currentTranslate=f,d.currentScale=p,d.view.translate=g,d.view.scale=u);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var l=q.value,f=m.value,g=!u.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,u.checked,l,f,B.checked,F.value,K.value,parseInt(n.value)/100,parseInt(M.value)/100,J.get());else{g&&(g=l==p&&f==p);if(!g&&null!=
|
|
|
|
|
a.pages&&a.pages.length){var v=0,g=a.pages.length-1;u.checked||(v=parseInt(l)-1,g=parseInt(f)-1);for(var z=v;z<=g;z++){var A=a.pages[z],l=A==a.currentPage?e:null;if(null==l){var l=a.createTemporaryGraph(e.stylesheet),f=!0,v=!1,x=null,y=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(f=A.viewState.pageVisible,v=A.viewState.mathEnabled,x=A.viewState.background,y=A.viewState.backgroundImage,l.extFonts=A.viewState.extFonts);l.background=x;l.backgroundImage=null!=y?new mxImage(y.src,
|
|
|
|
|
y.width,y.height):null;l.pageVisible=f;l.mathEnabled=v;var D=l.getGlobalVariable;l.getGlobalVariable=function(d){return"page"==d?A.getName():"pagenumber"==d?z+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(l.container);a.updatePageRoot(A);l.model.setRoot(A.root)}t=b(l,t,z!=g);l!=e&&l.container.parentNode.removeChild(l.container)}}else t=b(e);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(g=t.wnd.document,
|
|
|
|
|
d&&(t.wnd.IMMEDIATE_PRINT=!0),g.writeln('<script type="text/javascript" src="'+DRAWIO_BASE_URL+'/js/math-print.js">\x3c/script>')),t.closeDocument(),!t.mathEnabled&&d&&PrintDialog.printPreview(t));null!=k&&(e.stylesheet=k,e.refresh())}}var e=a.editor.graph,k=document.createElement("div"),l=document.createElement("h3");l.style.width="100%";l.style.textAlign="center";l.style.marginTop="0px";mxUtils.write(l,d||mxResources.get("print"));k.appendChild(l);var f=1,p=1,g=document.createElement("div");g.style.cssText=
|
|
|
|
|
"border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");g.appendChild(u);l=document.createElement("span");mxUtils.write(l,mxResources.get("printAllPages"));g.appendChild(l);mxUtils.br(g);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");g.appendChild(t);
|
|
|
|
|
l=document.createElement("span");mxUtils.write(l,mxResources.get("pages")+":");g.appendChild(l);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","1");q.setAttribute("type","number");q.setAttribute("min","1");q.style.width="50px";g.appendChild(q);l=document.createElement("span");mxUtils.write(l,mxResources.get("to"));g.appendChild(l);var m=q.cloneNode(!0);g.appendChild(m);mxEvent.addListener(q,"focus",function(){t.checked=!0});mxEvent.addListener(m,
|
|
|
|
|
"focus",function(){t.checked=!0});mxEvent.addListener(q,"change",b);mxEvent.addListener(m,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(l=0;l<a.pages.length;l++)if(a.currentPage==a.pages[l]){p=l+1;q.value=p;m.value=p;break}q.setAttribute("max",f);m.setAttribute("max",f);a.isPagesEnabled()?1<f&&(k.appendChild(g),t.checked=!0):t.checked=!0;var n=document.createElement("div");n.style.marginBottom="10px";var z=document.createElement("input");z.style.marginRight="8px";z.setAttribute("value",
|
|
|
|
|
"adjust");z.setAttribute("type","radio");z.setAttribute("name","printZoom");n.appendChild(z);l=document.createElement("span");mxUtils.write(l,mxResources.get("adjustTo"));n.appendChild(l);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";n.appendChild(v);mxEvent.addListener(v,"focus",function(){z.checked=!0});k.appendChild(n);var g=g.cloneNode(!1),B=z.cloneNode(!0);B.setAttribute("value","fit");z.setAttribute("checked",
|
|
|
|
|
"checked");l=document.createElement("div");l.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";l.appendChild(B);g.appendChild(l);n=document.createElement("table");n.style.display="inline-block";var A=document.createElement("tbody"),x=document.createElement("tr"),y=x.cloneNode(!0),D=document.createElement("td"),C=D.cloneNode(!0),I=D.cloneNode(!0),H=D.cloneNode(!0),E=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";H.style.textAlign="right";mxUtils.write(D,
|
|
|
|
|
"focus",function(){t.checked=!0});mxEvent.addListener(q,"change",b);mxEvent.addListener(m,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(l=0;l<a.pages.length;l++)if(a.currentPage==a.pages[l]){p=l+1;q.value=p;m.value=p;break}q.setAttribute("max",f);m.setAttribute("max",f);a.isPagesEnabled()?1<f&&(k.appendChild(g),t.checked=!0):t.checked=!0;var v=document.createElement("div");v.style.marginBottom="10px";var z=document.createElement("input");z.style.marginRight="8px";z.setAttribute("value",
|
|
|
|
|
"adjust");z.setAttribute("type","radio");z.setAttribute("name","printZoom");v.appendChild(z);l=document.createElement("span");mxUtils.write(l,mxResources.get("adjustTo"));v.appendChild(l);var n=document.createElement("input");n.style.cssText="margin:0 8px 0 8px;";n.setAttribute("value","100 %");n.style.width="50px";v.appendChild(n);mxEvent.addListener(n,"focus",function(){z.checked=!0});k.appendChild(v);var g=g.cloneNode(!1),B=z.cloneNode(!0);B.setAttribute("value","fit");z.setAttribute("checked",
|
|
|
|
|
"checked");l=document.createElement("div");l.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";l.appendChild(B);g.appendChild(l);v=document.createElement("table");v.style.display="inline-block";var A=document.createElement("tbody"),x=document.createElement("tr"),y=x.cloneNode(!0),D=document.createElement("td"),C=D.cloneNode(!0),I=D.cloneNode(!0),H=D.cloneNode(!0),E=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";H.style.textAlign="right";mxUtils.write(D,
|
|
|
|
|
mxResources.get("fitTo"));var F=document.createElement("input");F.style.cssText="margin:0 8px 0 8px;";F.setAttribute("value","1");F.setAttribute("min","1");F.setAttribute("type","number");F.style.width="40px";C.appendChild(F);l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsAcross"));I.appendChild(l);mxUtils.write(H,mxResources.get("fitToBy"));var K=F.cloneNode(!0);E.appendChild(K);mxEvent.addListener(F,"focus",function(){B.checked=!0});mxEvent.addListener(K,"focus",function(){B.checked=
|
|
|
|
|
!0});l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsDown"));G.appendChild(l);x.appendChild(D);x.appendChild(C);x.appendChild(I);y.appendChild(H);y.appendChild(E);y.appendChild(G);A.appendChild(x);A.appendChild(y);n.appendChild(A);g.appendChild(n);k.appendChild(g);g=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));g.appendChild(l);l=document.createElement("div");
|
|
|
|
|
!0});l=document.createElement("span");mxUtils.write(l,mxResources.get("fitToSheetsDown"));G.appendChild(l);x.appendChild(D);x.appendChild(C);x.appendChild(I);y.appendChild(H);y.appendChild(E);y.appendChild(G);A.appendChild(x);A.appendChild(y);v.appendChild(A);g.appendChild(v);k.appendChild(g);g=document.createElement("div");l=document.createElement("div");l.style.fontWeight="bold";l.style.marginBottom="12px";mxUtils.write(l,mxResources.get("paperSize"));g.appendChild(l);l=document.createElement("div");
|
|
|
|
|
l.style.marginBottom="12px";var J=PageSetupDialog.addPageFormatPanel(l,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(l);l=document.createElement("span");mxUtils.write(l,mxResources.get("pageScale"));g.appendChild(l);var M=document.createElement("input");M.style.cssText="margin:0 8px 0 8px;";M.setAttribute("value","100 %");M.style.width="60px";g.appendChild(M);k.appendChild(g);l=document.createElement("div");l.style.cssText="text-align:right;margin:48px 0 0 0;";
|
|
|
|
|
g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);a.isOffline()||(n=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),n.className="geBtn",l.appendChild(n));PrintDialog.previewEnabled&&(n=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),n.className="geBtn",l.appendChild(n));n=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
|
|
|
|
|
"print":"ok"),function(){a.hideDialog();c(!0)});n.className="geBtn gePrimaryBtn";l.appendChild(n);a.editor.cancelFirst||l.appendChild(g);k.appendChild(l);this.container=k};var H=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
|
|
|
|
|
g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);a.isOffline()||(v=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),v.className="geBtn",l.appendChild(v));PrintDialog.previewEnabled&&(v=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),v.className="geBtn",l.appendChild(v));v=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
|
|
|
|
|
"print":"ok"),function(){a.hideDialog();c(!0)});v.className="geBtn gePrimaryBtn";l.appendChild(v);a.editor.cancelFirst||l.appendChild(g);k.appendChild(l);this.container=k};var H=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
|
|
|
|
|
(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(H.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
|
|
|
|
|
this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var J=document.createElement("canvas"),I=new Image;I.onload=function(){try{J.getContext("2d").drawImage(I,0,0);var a=J.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(M){}};I.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(K){}})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.8.5";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.8.6";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
|
|
|
|
|
EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;
|
|
|
|
|
EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},
|
|
|
|
|
gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(a,b,c,e,f,g,q){g=null!=g?g:0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";if(EditorUi.enableLogging&&"1"!=urlParams.dev)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&
|
|
|
|
@ -10107,11 +10107,11 @@ a.keyCode)return function(){0<d&&f.selectPage(f.pages[0])};if(39==a.keyCode)retu
|
|
|
|
|
c>b&&(d=a.substring(b,c+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(a),g=this.editor.extractGraphModel(f.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),d=null!=g?mxUtils.getXml(g):""}catch(q){}return d};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var d=a.indexOf('<meta charset="utf-8">');0<=d&&(a=a.slice(0,d)+'<meta charset="utf-8"/>'+a.slice(d+23-1,a.length));
|
|
|
|
|
a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a){d=this.editor.graph;d.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,c=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<c.length||1==c.length&&c[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?
|
|
|
|
|
this.pages:[];for(var e=c.length-1;0<=e;e--){var f=this.updatePageRoot(new DiagramPage(c[e]));null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[e+1]));d.model.execute(new ChangePage(this,f,0==e?f:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),d.model.execute(new ChangePage(this,this.currentPage,
|
|
|
|
|
this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,f,g,q,n,m,x,C){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;m=null!=m?m:!0;var d,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":k=d=e;if(null==a)return"";var l=a;if("mxfile"!=
|
|
|
|
|
this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,f,g,q,m,n,x,C){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;n=null!=n?n:!0;var d,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":k=d=e;if(null==a)return"";var l=a;if("mxfile"!=
|
|
|
|
|
l.nodeName.toLowerCase()){if(C){var p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());p.appendChild(a)}else{p=Graph.zapGremlins(mxUtils.getXml(a));l=Graph.compress(p);if(Graph.decompress(l)!=p)return p;p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());mxUtils.setTextContent(p,l)}l=a.ownerDocument.createElement("mxfile");l.appendChild(p)}x?(l=l.cloneNode(!0),l.removeAttribute("modified"),l.removeAttribute("host"),l.removeAttribute("agent"),l.removeAttribute("etag"),
|
|
|
|
|
l.removeAttribute("userAgent"),l.removeAttribute("version"),l.removeAttribute("editor"),l.removeAttribute("type")):(l.removeAttribute("userAgent"),l.removeAttribute("version"),l.removeAttribute("editor"),l.removeAttribute("pages"),l.removeAttribute("type"),mxClient.IS_CHROMEAPP?l.setAttribute("host","Chrome"):EditorUi.isElectronApp?l.setAttribute("host","Electron"):l.setAttribute("host",window.location.hostname),l.setAttribute("modified",(new Date).toISOString()),l.setAttribute("agent",navigator.appVersion),
|
|
|
|
|
l.setAttribute("version",EditorUi.VERSION),l.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&l.setAttribute("type",a),1<l.getElementsByTagName("diagram").length&&null!=this.pages&&l.setAttribute("pages",this.pages.length));C=C?mxUtils.getPrettyXml(l):mxUtils.getXml(l);if(!g&&!f&&(q||null!=c&&/(\.html)$/i.test(c.getTitle())))C=this.getHtml2(mxUtils.getXml(l),b,null!=c?c.getTitle():null,d,k);else if(g||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&
|
|
|
|
|
c.getMode()!=App.MODE_BROWSER||(e=null),C=this.getEmbeddedSvg(C,b,e,null,n,m,k);return C};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):
|
|
|
|
|
c.getMode()!=App.MODE_BROWSER||(e=null),C=this.getEmbeddedSvg(C,b,e,null,m,n,k);return C};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):
|
|
|
|
|
null==b||c?a=a.cloneNode(!0):(a=a.cloneNode(!1),mxUtils.setTextContent(a,Graph.compressNode(b)));d.appendChild(a)},EditorUi.removeChildNodes(this.currentPage.node),mxUtils.setTextContent(this.currentPage.node,Graph.compressNode(d)),d=this.fileNode.cloneNode(!1),b)a(this.currentPage.node);else for(b=0;b<this.pages.length;b++){if(this.currentPage!=this.pages[b]&&this.pages[b].needsUpdate){var e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root));this.editor.graph.saveViewState(this.pages[b].viewState,
|
|
|
|
|
e);EditorUi.removeChildNodes(this.pages[b].node);mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(e));delete this.pages[b].needsUpdate}a(this.pages[b].node)}return d};EditorUi.prototype.anonymizeString=function(a,b){for(var d=[],c=0;c<a.length;c++){var e=a.charAt(c);0<=EditorUi.ignoredAnonymizedChars.indexOf(e)?d.push(e):isNaN(parseInt(e))?e.toLowerCase()!=e?d.push(String.fromCharCode(65+Math.round(25*Math.random()))):e.toUpperCase()!=e?d.push(String.fromCharCode(97+Math.round(25*Math.random()))):
|
|
|
|
|
/\s/.test(e)?d.push(" "):d.push("?"):d.push(b?"0":Math.round(9*Math.random()))}return d.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var d=0;d<a[EditorUi.DIFF_INSERT].length;d++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][d].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][d].data=mxUtils.getXml(b)}catch(t){a[EditorUi.DIFF_INSERT][d].data=
|
|
|
|
@ -10119,8 +10119,8 @@ t.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var c in a[EditorUi.DIFF_UPDATE]
|
|
|
|
|
delete e.cells[a]}}),d(EditorUi.DIFF_INSERT),d(EditorUi.DIFF_UPDATE),0==Object.keys(e.cells).length&&delete e.cells);0==Object.keys(e).length&&delete a[EditorUi.DIFF_UPDATE][c]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var d=0;d<a.attributes.length;d++)"as"!=a.attributes[d].name&&a.setAttribute(a.attributes[d].name,this.anonymizeString(a.attributes[d].value,b));if(null!=a.childNodes)for(d=
|
|
|
|
|
0;d<a.childNodes.length;d++)this.anonymizeAttributes(a.childNodes[d],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var d=a.getElementsByTagName("mxCell"),c=0;c<d.length;c++)null!=d[c].getAttribute("value")&&d[c].setAttribute("value","["+d[c].getAttribute("value").length+"]"),null!=d[c].getAttribute("xmlValue")&&d[c].setAttribute("xmlValue","["+d[c].getAttribute("xmlValue").length+"]"),null!=d[c].getAttribute("style")&&d[c].setAttribute("style","["+d[c].getAttribute("style").length+"]"),null!=
|
|
|
|
|
d[c].parentNode&&"root"!=d[c].parentNode.nodeName&&null!=d[c].parentNode.parentNode&&(d[c].setAttribute("id",d[c].parentNode.getAttribute("id")),d[c].parentNode.parentNode.replaceChild(d[c],d[c].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var d=this.getCurrentFile();null!=d&&(d.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&d.invalidChecksum?d.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(d.clearAutosave(),
|
|
|
|
|
this.editor.setStatus(""),a?d.reloadFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){d.handleFileError(a,!0)})):d.synchronizeFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){d.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,c,e,f,g,m,n,y,x){f=null!=f?f:!0;g=null!=g?g:!1;var d=this.editor.graph;if(b||!a&&null!=y&&/(\.svg)$/i.test(y.getTitle()))if(x=
|
|
|
|
|
!1,null!=d.themes&&"darkTheme"==d.defaultThemeName||null!=this.pages&&this.currentPage!=this.pages[0]){var k=d.getGlobalVariable,d=this.createTemporaryGraph(d.getStylesheet()),l=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:k.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(l.root)}m=null!=m?m:this.getXmlFileData(f,g,x);y=null!=y?y:this.getCurrentFile();a=this.createFileData(m,d,y,window.location.href,a,b,c,e,f,n,x);d!=this.editor.graph&&
|
|
|
|
|
this.editor.setStatus(""),a?d.reloadFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){d.handleFileError(a,!0)})):d.synchronizeFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){d.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,c,e,f,g,m,v,n,x){f=null!=f?f:!0;g=null!=g?g:!1;var d=this.editor.graph;if(b||!a&&null!=n&&/(\.svg)$/i.test(n.getTitle()))if(x=
|
|
|
|
|
!1,null!=d.themes&&"darkTheme"==d.defaultThemeName||null!=this.pages&&this.currentPage!=this.pages[0]){var k=d.getGlobalVariable,d=this.createTemporaryGraph(d.getStylesheet()),l=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:k.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(l.root)}m=null!=m?m:this.getXmlFileData(f,g,x);n=null!=n?n:this.getCurrentFile();a=this.createFileData(m,d,n,window.location.href,a,b,c,e,f,v,x);d!=this.editor.graph&&
|
|
|
|
|
d.container.parentNode.removeChild(d.container);return a};EditorUi.prototype.getHtml=function(a,b,c,e,f,g){g=null!=g?g:!0;var d=null,k=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var d=g?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),l=b.view.scale;g=Math.floor(d.x/l-b.view.translate.x);l=Math.floor(d.y/l-b.view.translate.y);d=b.background;null==f&&(b=this.getBasenames().join(";"),0<b.length&&(k=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",g);a.setAttribute("y0",
|
|
|
|
|
l)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=f&&(f=f.replace(/&/g,"&"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";e=Graph.compress(a);Graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+
|
|
|
|
|
(null!=f?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==f?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>diagrams.net</title>\n")+(null!=f?'<meta http-equiv="refresh" content="0;URL=\''+f+"'\"/>\n":"")+"</head>\n<body"+(null==f&&null!=d&&d!=mxConstants.NONE?' style="background-color:'+d+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+"</div>\n</div>\n"+(null==f?'<script type="text/javascript" src="'+
|
|
|
|
@ -10130,13 +10130,13 @@ mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==f?'<script type="tex
|
|
|
|
|
null;var d=Editor.extractParserError(a,mxResources.get("invalidOrMissingFile"));if(d)throw Error(mxResources.get("notADiagramFile")+" ("+d+")");d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a&&"mxfile"==a.nodeName&&(d=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name"))){var b=null;this.fileNode=a;this.pages=[];for(var c=0;c<d.length;c++)null==d[c].getAttribute("id")&&d[c].setAttribute("id",c),a=new DiagramPage(d[c]),
|
|
|
|
|
null==a.getName()&&a.setName(mxResources.get("pageWithNumber",[c+1])),this.pages.push(a),null!=urlParams["page-id"]&&a.getId()==urlParams["page-id"]&&(b=a);this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",
|
|
|
|
|
[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=urlParams["layer-ids"])try{var e=urlParams["layer-ids"].split(" ");a={};for(c=0;c<e.length;c++)a[e[c]]=!0;for(var f=this.editor.graph.getModel(),g=f.getChildren(f.root),c=0;c<g.length;c++){var m=g[c];f.setVisible(m,a[m.id]||!1)}}catch(y){}};EditorUi.prototype.getBaseFilename=function(a){var d=this.getCurrentFile(),d=null!=d&&null!=d.getTitle()?d.getTitle():
|
|
|
|
|
this.defaultFilename;if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,f,g,m,n,y,x,C){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),
|
|
|
|
|
this.defaultFilename;if(/(\.xml)$/i.test(d)||/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,f,g,m,v,n,x,C){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),
|
|
|
|
|
k=d+"."+a;if("xml"==a){var l='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,e,f,null,null,null,b);this.saveData(k,a,l,"text/xml")}else if("html"==a)l=this.getHtml2(this.getFileData(!0),this.editor.graph,d),this.saveData(k,a,l,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=d+".png":"jpeg"==a&&(k=d+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(d,b){try{var c=this.editor.graph.pageVisible;
|
|
|
|
|
null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(d,a,e,b,m,f,n,y,x,C);this.editor.graph.pageVisible=c;return k}catch(M){this.handleError(M)}}));else{var p=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var q=this.editor.graph.background;if(m||q==mxConstants.NONE)q=
|
|
|
|
|
null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(d,a,e,b,m,f,v,n,x,C);this.editor.graph.pageVisible=c;return k}catch(M){this.handleError(M)}}));else{var p=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var q=this.editor.graph.background;if(m||q==mxConstants.NONE)q=
|
|
|
|
|
null;var u=this.editor.graph.getSvg(q,null,null,null,null,e);c&&this.editor.graph.addSvgShadow(u);this.editor.convertImages(u,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();t('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=d+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),e)}}catch(H){this.handleError(H)}};EditorUi.prototype.createDownloadRequest=
|
|
|
|
|
function(a,b,c,e,f,g,m,n,y,x){var d=this.editor.graph,k=d.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var l="",p="";if(k.width*k.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};x=x?"1":"0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(x="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){l="&from="+g;break}g=d.background;"png"!=b&&"pdf"!=b||!f?f||
|
|
|
|
|
null!=g&&g!=mxConstants.NONE||(g="#ffffff"):g=mxConstants.NONE;f={globalVars:d.getExportVariables()};y&&(f.grid={size:d.gridSize,steps:d.view.gridSteps,color:d.view.gridColor});Graph.translateDiagram&&(f.diagramLanguage=Graph.diagramLanguage);return new mxXmlRequest(EXPORT_URL,"format="+b+l+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+x+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=m?"&scale="+
|
|
|
|
|
m:"")+(null!=n?"&border="+n:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,e=mxUtils.bind(this,function(c){var e=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<e.length&&(e+="\n"),e+=c);c=new LocalFile(this,"csv"!=a.format&&0<e.length?e:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(e,
|
|
|
|
|
function(a,b,c,e,f,g,m,v,n,x){var d=this.editor.graph,k=d.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var l="",p="";if(k.width*k.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};x=x?"1":"0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(x="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){l="&from="+g;break}g=d.background;"png"!=b&&"pdf"!=b||!f?f||
|
|
|
|
|
null!=g&&g!=mxConstants.NONE||(g="#ffffff"):g=mxConstants.NONE;f={globalVars:d.getExportVariables()};n&&(f.grid={size:d.gridSize,steps:d.view.gridSteps,color:d.view.gridColor});Graph.translateDiagram&&(f.diagramLanguage=Graph.diagramLanguage);return new mxXmlRequest(EXPORT_URL,"format="+b+l+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+x+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=m?"&scale="+
|
|
|
|
|
m:"")+(null!=v?"&border="+v:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,e=mxUtils.bind(this,function(c){var e=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<e.length&&(e+="\n"),e+=c);c=new LocalFile(this,"csv"!=a.format&&0<e.length?e:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(e,
|
|
|
|
|
mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,l=null,f=mxUtils.bind(this,function(){var d=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){d===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+
|
|
|
|
|
" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(l);l=window.setTimeout(f,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();f()}));g();f()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+"?url="+encodeURIComponent(k));this.editor.loadUrl(k,mxUtils.bind(this,function(a){e(a)}),mxUtils.bind(this,function(a){null!=
|
|
|
|
|
c&&c(a)}))}else e("")};EditorUi.prototype.updateDiagram=function(a){function d(a){var d=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,a.offset);d.addListener(mxEvent.CLICK,function(d,b){c.alert(a.tooltip)});return d}var b=null,c=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var e=this.editor.graph,f=e.getModel();f.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var m=f.getCell(a.getAttribute("id"));
|
|
|
|
@ -10152,7 +10152,7 @@ a.getHash(),action:"size_"+a.getSize(),label:"autosave_"+(this.editor.autosave?"
|
|
|
|
|
(null!=a?a.getHash():"none"),action:"message_"+q.message,label:"stack_"+q.stack})}catch(v){}var k=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=d?this.fileLoaded(d):e()});b?k():this.handleError(q,mxResources.get("errorLoadingFile"),k,!0,null,null,!0)}else e();return c};EditorUi.prototype.getHashValueForPages=function(a,b){var d=0,c=new mxGraphModel,e=new mxCodec;null!=b&&(b.byteCount=
|
|
|
|
|
0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var k=0;k<a.length;k++){this.updatePageRoot(a[k]);var f=a[k].node.cloneNode(!1);f.removeAttribute("name");c.root=a[k].root;var g=e.encode(c);this.editor.graph.saveViewState(a[k].viewState,g,!0);g.removeAttribute("pageWidth");g.removeAttribute("pageHeight");f.appendChild(g);null!=b&&(b.eltCount+=f.getElementsByTagName("*").length,b.nodeCount+=f.getElementsByTagName("mxCell").length);d=(d<<5)-d+this.hashValue(f,function(a,d,b,c){return!c||"mxGeometry"!=
|
|
|
|
|
a.nodeName&&"mxPoint"!=a.nodeName||"x"!=d&&"y"!=d&&"width"!=d&&"height"!=d?c&&"mxCell"==a.nodeName&&"previous"==d?null:b:Math.round(b)},b)<<0}return d};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var e=0;e<a.attributes.length;e++){var k=a.attributes[e].name,
|
|
|
|
|
l=null!=b?b(a,k,a.attributes[e].value,!0):a.attributes[e].value;null!=l&&(d^=this.hashValue(k,b,c)+this.hashValue(l,b,c))}}if(null!=a.childNodes)for(e=0;e<a.childNodes.length;e++)d=(d<<5)-d+this.hashValue(a.childNodes[e],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(e=0;e<a.length;e++)b=(b<<5)-b+a.charCodeAt(e)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=
|
|
|
|
|
f=null!=b?b(a,k,a.attributes[e].value,!0):a.attributes[e].value;null!=f&&(d^=this.hashValue(k,b,c)+this.hashValue(f,b,c))}}if(null!=a.childNodes)for(e=0;e<a.childNodes.length;e++)d=(d<<5)-d+this.hashValue(a.childNodes[e],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(e=0;e<a.length;e++)b=(b<<5)-b+a.charCodeAt(e)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=
|
|
|
|
|
function(a,b,c,e,f,g,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var b=mxUtils.createXmlDocument(),
|
|
|
|
|
d=b.createElement("mxlibrary");mxUtils.setTextContent(d,JSON.stringify(a));b.appendChild(d);return mxUtils.getXml(b)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var d=0;d<b.length;d++)b[d].parentNode.removeChild(b[d]);delete this.sidebar.palettes[a]}};
|
|
|
|
|
EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var d=this.sidebar.palettes["L.scratchpad"];null==d&&(d=this.sidebar.palettes.search);null!=d&&(a=d[d.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var d=b.lastChild,c=d.previousSibling;b.insertBefore(d,a);b.insertBefore(c,d)};EditorUi.prototype.loadLibrary=function(a,b){var d=mxUtils.parseXml(a.getData());if("mxlibrary"==d.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(d.documentElement));
|
|
|
|
@ -10198,9 +10198,9 @@ d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFi
|
|
|
|
|
d.textarea.style.height="380px";this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,c,e,f,g){"text/xml"!=c||/(\.drawio)$/i.test(b)||/(\.xml)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.html)$/i.test(b)||(b=b+"."+(null!=g?g:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank",
|
|
|
|
|
"_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==c||"image/"!=c.substring(0,6)?this.showTextDialog(b+":",a):this.openInNewWindow(a,c,e);else{var d=document.createElement("a");g=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof d.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var k=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
|
|
|
|
g=65==(k?parseInt(k[2],10):!1)?!1:g}if(g||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));g?d.download=b:d.setAttribute("target","_blank");document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},2E4),d.click(),d.parentNode.removeChild(d)}catch(y){}}else this.createEchoRequest(a,b,c,e,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,f,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
|
|
|
|
|
a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),k=Array(e),f=0;f<e;++f){for(var g=1024*f,m=Math.min(g+1024,c),n=Array(m-g),C=0;g<m;++C,++g)n[C]=d[g].charCodeAt(0);k[f]=new Uint8Array(n)}return new Blob(k,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,f,g,m,n){g=null!=g?g:!1;m=null!=m?
|
|
|
|
|
m:"vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(g);isLocalStorage&&f++;var d=4>=f?2:6<f?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,d){try{if("_blank"==d)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,e);else if(null!=c&&"text/html"==c.substring(0,9)){var k=new EmbedDialog(this,a);this.showDialog(k.container,440,240,!0,!0);k.init()}else{var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write("<pre>"+mxUtils.htmlEntities(a,
|
|
|
|
|
!1)+"</pre>"),f.document.close())}else d==App.MODE_DEVICE||"download"==d?this.doSaveLocalFile(a,b,c,e,null,n):null!=b&&0<b.length&&this.pickFolder(d,mxUtils.bind(this,function(k){try{this.exportFile(a,b,c,e,d,k)}catch(D){this.handleError(D)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,m,null,1<f,d,a,c,e);g=this.isServices(f)?f>d?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=
|
|
|
|
|
a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),f=Array(e),k=0;k<e;++k){for(var g=1024*k,m=Math.min(g+1024,c),n=Array(m-g),C=0;g<m;++C,++g)n[C]=d[g].charCodeAt(0);f[k]=new Uint8Array(n)}return new Blob(f,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,f,g,m,n){g=null!=g?g:!1;m=null!=m?
|
|
|
|
|
m:"vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(g);isLocalStorage&&f++;var d=4>=f?2:6<f?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,d){try{if("_blank"==d)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,e);else if(null!=c&&"text/html"==c.substring(0,9)){var f=new EmbedDialog(this,a);this.showDialog(f.container,440,240,!0,!0);f.init()}else{var k=window.open("about:blank");null==k?mxUtils.popup(a,!0):(k.document.write("<pre>"+mxUtils.htmlEntities(a,
|
|
|
|
|
!1)+"</pre>"),k.document.close())}else d==App.MODE_DEVICE||"download"==d?this.doSaveLocalFile(a,b,c,e,null,n):null!=b&&0<b.length&&this.pickFolder(d,mxUtils.bind(this,function(f){try{this.exportFile(a,b,c,e,d,f)}catch(D){this.handleError(D)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,m,null,1<f,d,a,c,e);g=this.isServices(f)?f>d?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=
|
|
|
|
|
function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!=b||mxClient.IS_SVG?"image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):(a=c?a:btoa(unescape(encodeURIComponent(a))),d.document.write('<html><img style="max-width:100%;" src="data:'+b+";base64,"+a+'"/></html>')):d.document.write("<html><pre>"+mxUtils.htmlEntities(a,!1)+"</pre></html>"),d.document.close())};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=
|
|
|
|
|
function(a){if(this.isExportToCanvas()){this.exportDialog=null;var d=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var c=d.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");
|
|
|
|
|
this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+
|
|
|
|
@ -10226,9 +10226,9 @@ c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0
|
|
|
|
|
d.toolbar=c.join(" "));null!=x&&0<x.length&&(d.edit=x);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!m);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";C(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+a:"1"==urlParams.dev?
|
|
|
|
|
"https://test.draw.io/js/viewer-static.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";
|
|
|
|
|
var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","type-embedhtmldialog");f=l.cloneNode(!0);f.setAttribute("value","copy");k.appendChild(f);var g=document.createElement("span");mxUtils.write(g,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(g);mxUtils.br(k);k.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("publicDiagramUrl"));
|
|
|
|
|
k.appendChild(g);var p=this.getCurrentFile();null==c&&null!=p&&p.constructor==window.DriveFile&&(g=document.createElement("a"),g.style.paddingLeft="12px",g.style.color="gray",g.style.cursor="pointer",mxUtils.write(g,mxResources.get("share")),k.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(p.getId())})));f.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");d.appendChild(k);var m=this.addLinkSection(d),
|
|
|
|
|
k.appendChild(g);var m=this.getCurrentFile();null==c&&null!=m&&m.constructor==window.DriveFile&&(g=document.createElement("a"),g.style.paddingLeft="12px",g.style.color="gray",g.style.cursor="pointer",mxUtils.write(g,mxResources.get("share")),k.appendChild(g),mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");d.appendChild(k);var p=this.addLinkSection(d),
|
|
|
|
|
n=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var B=document.createElement("input");B.setAttribute("type","text");B.style.marginRight="16px";B.style.width="60px";B.style.marginLeft="4px";B.style.marginRight="12px";B.value="100%";d.appendChild(B);var A=this.addCheckbox(d,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,D=D=this.addCheckbox(d,mxResources.get("allPages"),k,!k),E=this.addCheckbox(d,mxResources.get("layers"),!0),F=this.addCheckbox(d,mxResources.get("lightbox"),
|
|
|
|
|
!0),G=this.addEditButton(d,F),H=G.getEditInput();H.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled");H.checked&&F.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(l.checked?c:null,n.checked,B.value,m.getTarget(),m.getColor(),A.checked,D.checked,E.checked,F.checked,G.getLink())}),null,a,
|
|
|
|
|
!0),G=this.addEditButton(d,F),H=G.getEditInput();H.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled");H.checked&&F.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(l.checked?c:null,n.checked,B.value,p.getTarget(),p.getColor(),A.checked,D.checked,E.checked,F.checked,G.getLink())}),null,a,
|
|
|
|
|
b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,g,m){m=document.createElement("div");m.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,a||mxResources.get("link"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(d);var k=this.getCurrentFile(),d="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=k&&k.constructor==window.DriveFile&&!b){a=
|
|
|
|
|
80;var d="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var p=document.createElement("div");p.style.whiteSpace="normal";mxUtils.write(p,mxResources.get("linkAccountRequired"));l.appendChild(p);p=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));p.style.marginTop="12px";
|
|
|
|
|
p.className="geBtn";l.appendChild(p);m.appendChild(l);p=document.createElement("a");p.style.paddingLeft="12px";p.style.color="gray";p.style.fontSize="11px";p.style.cursor="pointer";mxUtils.write(p,mxResources.get("check"));l.appendChild(p);mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?
|
|
|
|
@ -10239,13 +10239,13 @@ function(){f(t.getTarget(),t.getColor(),null==u?!0:u.checked,E.checked,F.getLink
|
|
|
|
|
var k=document.createElement("h3");mxUtils.write(k,mxResources.get("image"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(f?"10":"4")+"px";d.appendChild(k);if(f){mxUtils.write(d,mxResources.get("zoom")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.style.marginRight="12px";l.value=this.lastExportZoom||"100%";d.appendChild(l);mxUtils.write(d,mxResources.get("borderWidth")+
|
|
|
|
|
":");var g=document.createElement("input");g.setAttribute("type","text");g.style.marginRight="16px";g.style.width="60px";g.style.marginLeft="4px";g.value=this.lastExportBorder||"0";d.appendChild(g);mxUtils.br(d)}var m=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),p=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0),k=this.editor.graph,n=e?null:this.addCheckbox(d,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||
|
|
|
|
|
null==k.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,d,mxUtils.bind(this,function(){var a=parseInt(l.value)/100||1,b=parseInt(g.value)||0;c(!m.checked,null!=p?p.checked:!1,null!=n?n.checked:!1,a,b)}),null,a,b);this.showDialog(a.container,300,(f?25:0)+(e?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,e,f,g,m,n){m=null!=m?m:!0;var d=document.createElement("div");d.style.whiteSpace="nowrap";var k=this.editor.graph,l="jpeg"==n?196:300,p=document.createElement("h3");
|
|
|
|
|
mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";d.appendChild(q);mxUtils.write(d,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");
|
|
|
|
|
t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.value=this.lastExportBorder||"0";d.appendChild(t);mxUtils.br(d);var u=this.addCheckbox(d,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=n),v=null;"dark"==uiTheme&&(v=this.addCheckbox(d,mxResources.get("dark"),!0),l+=26);var F=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),G=document.createElement("input");G.style.marginTop="16px";G.style.marginRight="8px";G.style.marginLeft="24px";
|
|
|
|
|
mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.style.marginRight="12px";q.value=this.lastExportZoom||"100%";d.appendChild(q);mxUtils.write(d,mxResources.get("borderWidth")+":");var v=document.createElement("input");v.setAttribute("type","text");
|
|
|
|
|
v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||"0";d.appendChild(v);mxUtils.br(d);var t=this.addCheckbox(d,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=n),u=null;"dark"==uiTheme&&(u=this.addCheckbox(d,mxResources.get("dark"),!0),l+=26);var F=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),G=document.createElement("input");G.style.marginTop="16px";G.style.marginRight="8px";G.style.marginLeft="24px";
|
|
|
|
|
G.setAttribute("disabled","disabled");G.setAttribute("type","checkbox");g&&(d.appendChild(G),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),l+=26,mxEvent.addListener(F,"change",function(){F.checked?G.removeAttribute("disabled"):G.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(G.setAttribute("checked","checked"),G.defaultChecked=!0);var H=this.addCheckbox(d,mxResources.get("shadow"),k.shadowVisible),J=document.createElement("input");J.style.marginTop="16px";J.style.marginRight=
|
|
|
|
|
"8px";J.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||J.setAttribute("disabled","disabled");b&&(d.appendChild(J),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),l+=26);var I=null;if("png"==n||"jpeg"==n)I=this.addCheckbox(d,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),l+=26;var K=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),m,null,null,"jpeg"!=n),M=null!=this.pages&&1<this.pages.length,O=this.addCheckbox(d,M&&"svg"!=
|
|
|
|
|
n?mxResources.get("allPages"):"",M,!M,null,"jpeg"!=n);O.style.marginLeft="24px";O.style.marginBottom="16px";M&&"svg"!=n?l+=26:O.style.display="none";mxEvent.addListener(K,"change",function(){K.checked&&M?O.removeAttribute("disabled"):O.setAttribute("disabled","disabled")});m&&M||O.setAttribute("disabled","disabled");var U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginRight="10px";U.className="geBtn";a=document.createElement("option");a.setAttribute("value",
|
|
|
|
|
"auto");mxUtils.write(a,mxResources.get("automatic"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));U.appendChild(a);"svg"==n&&(mxUtils.write(d,mxResources.get("links")+":"),d.appendChild(U),mxUtils.br(d),mxUtils.br(d),l+=26);c=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=
|
|
|
|
|
t.value;this.lastExportZoom=q.value;f(q.value,u.checked,!F.checked,H.checked,K.checked,J.checked,t.value,G.checked,!O.checked,U.value,null!=I?I.checked:null,null!=v?v.checked:null)}),null,c,e);this.showDialog(c.container,340,l,!0,!0,null,null,null,null,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,f){var d=document.createElement("div");d.style.whiteSpace=
|
|
|
|
|
v.value;this.lastExportZoom=q.value;f(q.value,t.checked,!F.checked,H.checked,K.checked,J.checked,v.value,G.checked,!O.checked,U.value,null!=I?I.checked:null,null!=u?u.checked:null)}),null,c,e);this.showDialog(c.container,340,l,!0,!0,null,null,null,null,!0);q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,f){var d=document.createElement("div");d.style.whiteSpace=
|
|
|
|
|
"nowrap";var k=this.editor.graph;if(null!=b){var l=document.createElement("h3");mxUtils.write(l,b);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(l)}var g=this.addCheckbox(d,mxResources.get("fit"),!0),m=this.addCheckbox(d,mxResources.get("shadow"),k.shadowVisible&&e,!e),p=this.addCheckbox(d,c),n=this.addCheckbox(d,mxResources.get("lightbox"),!0),u=this.addEditButton(d,n),A=u.getEditInput(),D=1<k.model.getChildCount(k.model.getRoot()),E=this.addCheckbox(d,
|
|
|
|
|
mxResources.get("layers"),D,!D);E.style.marginLeft=A.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(n,"change",function(){n.checked?(D&&E.removeAttribute("disabled"),A.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"));A.checked&&n.checked?u.getEditSelect().removeAttribute("disabled"):u.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(g.checked,
|
|
|
|
|
m.checked,p.checked,n.checked,u.getLink(),E.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,f,g,m,n){function d(b){var d=" ",p="";e&&(d=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
|
|
|
|
@ -10264,8 +10264,8 @@ g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=f)thi
|
|
|
|
|
mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(g)};EditorUi.prototype.embedFonts=function(a,b){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(a,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(d){try{null!=d&&this.editor.addFontCss(a,d),b(a)}catch(p){b(a)}}))}catch(l){b(a)}}))};
|
|
|
|
|
EditorUi.prototype.exportImage=function(a,b,c,e,f,g,m,n,y,x,C,z){y=null!=y?y:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,n):null,y,null==this.pages||0==this.pages.length,C)}catch(D){this.handleError(D)}}),null,this.thumbImageCache,
|
|
|
|
|
null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,g,m,x,z)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.importXml=function(a,b,c,e,f){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var k=this.editor.graph;if(null!=a&&0<a.length){k.model.beginUpdate();try{var l=mxUtils.parseXml(a);a={};var g=this.editor.extractGraphModel(l.documentElement,
|
|
|
|
|
null!=this.pages);if(null!=g&&"mxfile"==g.nodeName&&null!=this.pages){var m=g.getElementsByTagName("diagram");if(1==m.length)g=Editor.parseDiagramNode(m[0]),null!=this.currentPage&&(a[m[0].getAttribute("id")]=this.currentPage.getId());else if(1<m.length){var l=[],n=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(a[m[0].getAttribute("id")]=this.pages[0].getId(),g=Editor.parseDiagramNode(m[0]),e=!1,n=1);for(;n<m.length;n++){var p=m[n].getAttribute("id");m[n].removeAttribute("id");
|
|
|
|
|
var u=this.updatePageRoot(new DiagramPage(m[n]));a[p]=m[n].getAttribute("id");var A=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[A+1]));k.model.execute(new ChangePage(this,u,u,A,!0));l.push(u)}this.updatePageLinks(a,l)}}if(null!=g&&"mxGraphModel"===g.nodeName&&(d=k.importGraphModel(g,b,c,e),null!=d))for(n=0;n<d.length;n++)this.updatePageLinksForCell(a,d[n])}finally{k.model.endUpdate()}}}catch(D){if(f)throw D;this.handleError(D)}return d};EditorUi.prototype.updatePageLinks=
|
|
|
|
|
null!=this.pages);if(null!=g&&"mxfile"==g.nodeName&&null!=this.pages){var m=g.getElementsByTagName("diagram");if(1==m.length)g=Editor.parseDiagramNode(m[0]),null!=this.currentPage&&(a[m[0].getAttribute("id")]=this.currentPage.getId());else if(1<m.length){var l=[],p=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(a[m[0].getAttribute("id")]=this.pages[0].getId(),g=Editor.parseDiagramNode(m[0]),e=!1,p=1);for(;p<m.length;p++){var n=m[p].getAttribute("id");m[p].removeAttribute("id");
|
|
|
|
|
var u=this.updatePageRoot(new DiagramPage(m[p]));a[n]=m[p].getAttribute("id");var A=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[A+1]));k.model.execute(new ChangePage(this,u,u,A,!0));l.push(u)}this.updatePageLinks(a,l)}}if(null!=g&&"mxGraphModel"===g.nodeName&&(d=k.importGraphModel(g,b,c,e),null!=d))for(p=0;p<d.length;p++)this.updatePageLinksForCell(a,d[p])}finally{k.model.endUpdate()}}}catch(D){if(f)throw D;this.handleError(D)}return d};EditorUi.prototype.updatePageLinks=
|
|
|
|
|
function(a,b){for(var d=0;d<b.length;d++)this.updatePageLinksForCell(a,b[d].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var d=document.createElement("div"),c=this.editor.graph,e=c.getLinkForCell(b);null!=e&&c.setLinkForCell(b,this.updatePageLink(a,e));if(c.isHtmlLabel(b)){d.innerHTML=c.sanitizeHtml(c.getLabel(b));for(var f=d.getElementsByTagName("a"),k=!1,g=0;g<f.length;g++)e=f[g].getAttribute("href"),null!=e&&(f[g].setAttribute("href",this.updatePageLink(a,e)),k=!0);k&&c.labelChanged(b,
|
|
|
|
|
d.innerHTML)}for(g=0;g<c.model.getChildCount(b);g++)this.updatePageLinksForCell(a,c.model.getChildAt(b,g))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var d=a[b.substring(b.indexOf(",")+1)];b=null!=d?"data:page/id,"+d:null}else if("data:action/json,"==b.substring(0,17))try{var c=JSON.parse(b.substring(17));if(null!=c.actions){for(var e=0;e<c.actions.length;e++){var f=c.actions[e];null!=f.open&&"data:page/id,"==f.open.substring(0,13)&&(d=a[f.open.substring(f.open.indexOf(",")+
|
|
|
|
|
1)],null!=d?f.open="data:page/id,"+d:delete f.open)}b="data:action/json,"+JSON.stringify(c)}}catch(q){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,e){e=null!=e?e:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var d=this.isRemoteVisioFormat(e);try{var f="UNKNOWN-VISIO",
|
|
|
|
@ -10286,7 +10286,7 @@ b,c,g,!0);if("data:image/svg+xml;"==a.substring(0,19))try{k=null;"data:image/svg
|
|
|
|
|
d.snap(b),d.snap(c),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),k=Math.round(e.width*f);e=Math.round(e.height*f);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),k,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
|
|
|
|
a+";"))}}),mxUtils.bind(this,function(){var f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(f),d.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,g);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,
|
|
|
|
|
function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,g))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{d=this.editor.graph;f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,"",d.snap(b),d.snap(c),1,1,"text;whiteSpace=wrap;"+(e?"html=1;":""));d.fireEvent(new mxEventObject("textInserted","cells",[f]));"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a));a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"...");
|
|
|
|
|
f.value=a;d.updateCellSize(f);if(0<this.maxTextWidth&&f.geometry.width>this.maxTextWidth){var n=d.getPreferredSizeForCell(f,this.maxTextWidth);f.geometry.width=n.width;f.geometry.height=n.height}Graph.isLink(f.value)&&d.setLinkForCell(f,f.value);f.geometry.width+=d.gridSize;f.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};
|
|
|
|
|
f.value=a;d.updateCellSize(f);if(0<this.maxTextWidth&&f.geometry.width>this.maxTextWidth){var p=d.getPreferredSizeForCell(f,this.maxTextWidth);f.geometry.width=p.width;f.geometry.height=p.height}Graph.isLink(f.value)&&d.setLinkForCell(f,f.value);f.geometry.width+=d.gridSize;f.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};
|
|
|
|
|
EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.isLucidChartData=function(a){return null!=a&&('{"state":"{\\"Properties\\":'==a.substring(0,26)||'{"Properties":'==a.substring(0,14))};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport){if(null==
|
|
|
|
|
this.importFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){null!=d.files&&(this.importFiles(d.files,null,null,this.maxImageSize),d.type="",d.type="file",d.value="")}));d.style.display="none";document.body.appendChild(d);this.importFileInputElt=d}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(a,b){StorageFile.listFiles(this,
|
|
|
|
|
"F",a,b)});window.openBrowserFile=mxUtils.bind(this,function(a,b,d){StorageFile.getFileContent(this,a,b,d)});window.deleteBrowserFile=mxUtils.bind(this,function(a,b,d){StorageFile.deleteFile(this,a,b,d)});if(!b){var c=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var d=new Blob([a],{type:"application/octet-stream"});
|
|
|
|
@ -10296,15 +10296,15 @@ EditorUi.prototype.importZipFile=function(a,b,c){var d=this,e=mxUtils.bind(this,
|
|
|
|
|
l=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,m)):b=this.importXml(a,c,e,x);null!=n&&n(b)});"image"==b.substring(0,5)?(y=!1,"image/png"==b.substring(0,9)&&(b=C?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(k=this.importXml(b,c,e,x),y=!0)),y||(b=this.editor.graph,C=a.indexOf(";"),0<C&&(a=a.substring(0,C)+a.substring(a.indexOf(",",C+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),k=[b.insertVertex(null,
|
|
|
|
|
null,"",c,e,f,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,l)):null!=y&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(d=!0,this.importVisio(y,l)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(d=!0,this.parseFile(null!=y?y:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==
|
|
|
|
|
a.readyState&&(200<=a.status&&299>=a.status?l(a.responseText):null!=n&&n(null))}),m)):0==a.indexOf("PK")&&null!=y?(d=!0,this.importZipFile(y,l,mxUtils.bind(this,function(){k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);n(k)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(k=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==n||n(k);return k};EditorUi.prototype.importFiles=function(a,b,c,e,f,g,m,n,y,x,C,z){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;
|
|
|
|
|
var d=null!=b&&null!=c,k=!0;b=null!=b?b:0;c=null!=c?c:0;var l=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=C||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){l=!0;break}var t=mxUtils.bind(this,function(){var l=this.editor.graph,p=l.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,f,k,g,l,m){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,
|
|
|
|
|
l,m,d,z)}catch(P){return this.handleError(P),null}});g=null!=g?g:mxUtils.bind(this,function(a){l.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,t=q,B=[],u=mxUtils.bind(this,function(a,b){B[a]=b;if(0==--t){this.spinner.stop();if(null!=n)n(B);else{var d=[];l.getModel().beginUpdate();try{for(var c=0;c<B.length;c++){var e=B[c]();null!=e&&(d=d.concat(e))}}finally{l.getModel().endUpdate()}}g(d)}}),A=0;A<q;A++)mxUtils.bind(this,function(d){var g=
|
|
|
|
|
a[d];if(null!=g){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,q=n.indexOf(","),t=decodeURIComponent(escape(atob(n.substring(q+1)))),B=mxUtils.parseXml(t),t=B.getElementsByTagName("svg");if(0<t.length){var t=t[0],A=z?null:t.getAttribute("content");null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=unescape(window.atob?atob(A):Base64.decode(A,!0)));null!=A&&"%"==A.charAt(0)&&
|
|
|
|
|
(A=decodeURIComponent(A));null==A||"<mxfile "!==A.substring(0,8)&&"<mxGraphModel "!==A.substring(0,14)?u(d,mxUtils.bind(this,function(){try{if(n.substring(0,q+1),null!=B){var a=B.getElementsByTagName("svg");if(0<a.length){var k=a[0],m=k.getAttribute("width"),z=k.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN,t=k.getAttribute("viewBox");if(null==t||0==t.length)k.setAttribute("viewBox","0 0 "+m+" "+z);else if(isNaN(m)||
|
|
|
|
|
isNaN(z)){var u=t.split(" ");3<u.length&&(m=parseFloat(u[2]),z=parseFloat(u[3]))}n=Editor.createSvgDataUri(mxUtils.getXml(k));var A=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,z)),v=f(n,g.type,b+d*p,c+d*p,Math.max(1,Math.round(m*A)),Math.max(1,Math.round(z*A)),g.name);if(isNaN(m)||isNaN(z)){var D=new Image;D.onload=mxUtils.bind(this,function(){m=Math.max(1,D.width);z=Math.max(1,D.height);v[0].geometry.width=m;v[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+m+" "+z);n=Editor.createSvgDataUri(mxUtils.getXml(k));
|
|
|
|
|
var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));l.setCellStyles("image",n,[v[0]])});D.src=Editor.createSvgDataUri(mxUtils.getXml(k))}return v}}}catch(ia){}return null})):u(d,mxUtils.bind(this,function(){return f(A,"text/xml",b+d*p,c+d*p,0,0,g.name)}))}else u(d,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==g.type){var v=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=v&&0<v.length){var D=new Image;D.src=a.target.result;u(d,mxUtils.bind(this,
|
|
|
|
|
function(){return f(v,"text/xml",b+d*p,c+d*p,D.width,D.height,g.name)}));t=!0}}t||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(l){this.resizeImage(l,a.target.result,mxUtils.bind(this,function(a,l,m){u(d,mxUtils.bind(this,
|
|
|
|
|
function(){if(null!=a&&a.length<x){var n=k&&this.isResampleImageSize(g.size,C)?Math.min(1,Math.min(e/l,e/m)):1;return f(a,g.type,b+d*p,c+d*p,Math.round(l*n),Math.round(m*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,e,C,g.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else n=a.target.result,f(n,g.type,b+d*p,c+d*p,240,160,g.name,function(a){u(d,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||
|
|
|
|
|
/(\.vs(x|sx?))($|\?)/i.test(g.name)?f(null,g.type,b+d*p,c+d*p,240,160,g.name,function(a){u(d,function(){return a})},g):"image"==g.type.substring(0,5)||"application/pdf"==g.type?n.readAsDataURL(g):n.readAsText(g)}})(A)});if(l){l=[];for(q=0;q<a.length;q++)l.push(a[q]);a=l;this.confirmImageResize(function(a){k=a;t()},y)}else t()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?
|
|
|
|
|
var d=null!=b&&null!=c,k=!0;b=null!=b?b:0;c=null!=c?c:0;var l=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=C||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>p){l=!0;break}var u=mxUtils.bind(this,function(){var l=this.editor.graph,p=l.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,f,k,g,l,m){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,
|
|
|
|
|
l,m,d,z)}catch(P){return this.handleError(P),null}});g=null!=g?g:mxUtils.bind(this,function(a){l.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,u=q,B=[],t=mxUtils.bind(this,function(a,b){B[a]=b;if(0==--u){this.spinner.stop();if(null!=n)n(B);else{var d=[];l.getModel().beginUpdate();try{for(var c=0;c<B.length;c++){var e=B[c]();null!=e&&(d=d.concat(e))}}finally{l.getModel().endUpdate()}}g(d)}}),v=0;v<q;v++)mxUtils.bind(this,function(d){var g=
|
|
|
|
|
a[d];if(null!=g){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,q=n.indexOf(","),B=decodeURIComponent(escape(atob(n.substring(q+1)))),u=mxUtils.parseXml(B),B=u.getElementsByTagName("svg");if(0<B.length){var B=B[0],v=z?null:B.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&
|
|
|
|
|
(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?t(d,mxUtils.bind(this,function(){try{if(n.substring(0,q+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var k=a[0],m=k.getAttribute("width"),z=k.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN,B=k.getAttribute("viewBox");if(null==B||0==B.length)k.setAttribute("viewBox","0 0 "+m+" "+z);else if(isNaN(m)||
|
|
|
|
|
isNaN(z)){var t=B.split(" ");3<t.length&&(m=parseFloat(t[2]),z=parseFloat(t[3]))}n=Editor.createSvgDataUri(mxUtils.getXml(k));var v=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,z)),A=f(n,g.type,b+d*p,c+d*p,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(z*v)),g.name);if(isNaN(m)||isNaN(z)){var D=new Image;D.onload=mxUtils.bind(this,function(){m=Math.max(1,D.width);z=Math.max(1,D.height);A[0].geometry.width=m;A[0].geometry.height=z;k.setAttribute("viewBox","0 0 "+m+" "+z);n=Editor.createSvgDataUri(mxUtils.getXml(k));
|
|
|
|
|
var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));l.setCellStyles("image",n,[A[0]])});D.src=Editor.createSvgDataUri(mxUtils.getXml(k))}return A}}}catch(ia){}return null})):t(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*p,c+d*p,0,0,g.name)}))}else t(d,mxUtils.bind(this,function(){return null}))}else{B=!1;if("image/png"==g.type){var A=z?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var D=new Image;D.src=a.target.result;t(d,mxUtils.bind(this,
|
|
|
|
|
function(){return f(A,"text/xml",b+d*p,c+d*p,D.width,D.height,g.name)}));B=!0}}B||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(l){this.resizeImage(l,a.target.result,mxUtils.bind(this,function(a,l,m){t(d,mxUtils.bind(this,
|
|
|
|
|
function(){if(null!=a&&a.length<x){var n=k&&this.isResampleImageSize(g.size,C)?Math.min(1,Math.min(e/l,e/m)):1;return f(a,g.type,b+d*p,c+d*p,Math.round(l*n),Math.round(m*n),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,e,C,g.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else n=a.target.result,f(n,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||
|
|
|
|
|
/(\.vs(x|sx?))($|\?)/i.test(g.name)?f(null,g.type,b+d*p,c+d*p,240,160,g.name,function(a){t(d,function(){return a})},g):"image"==g.type.substring(0,5)||"application/pdf"==g.type?n.readAsDataURL(g):n.readAsText(g)}})(v)});if(l){l=[];for(q=0;q<a.length;q++)l.push(a[q]);a=l;this.confirmImageResize(function(a){k=a;u()},y)}else u()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?
|
|
|
|
|
mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
|
|
|
|
|
mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(a,b){b=null!=b?b:this.resampleThreshold;return a>b};EditorUi.prototype.resizeImage=function(a,
|
|
|
|
|
b,c,e,f,g,m){f=null!=f?f:this.maxImageSize;var d=Math.max(1,a.width),k=Math.max(1,a.height);if(e&&this.isResampleImageSize(null!=m?m:b.length,g))try{var l=Math.max(d/f,k/f);if(1<l){var n=Math.round(d/l),p=Math.round(k/l),q=document.createElement("canvas");q.width=n;q.height=p;q.getContext("2d").drawImage(a,0,0,n,p);var t=q.toDataURL();if(t.length<b.length){var u=document.createElement("canvas");u.width=n;u.height=p;var E=u.toDataURL();t!==E&&(b=t,d=n,k=p)}}}catch(F){}c(b,d,k)};EditorUi.prototype.extractGraphModelFromPng=
|
|
|
|
@ -10375,16 +10375,16 @@ window.parent)){var k=f.data,l=mxUtils.bind(this,function(a){if(null!=a&&"functi
|
|
|
|
|
null}try{if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("layout"==k.action){this.executeLayoutList(k.layouts);return}if("prompt"==k.action){this.spinner.stop();var m=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):k.ok,function(a){null!=
|
|
|
|
|
a?g.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*"):g.postMessage(JSON.stringify({event:"prompt-cancel",message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(m.container,300,80,!0,!1);m.init();return}if("draft"==k.action){var n=l(k.xml);this.spinner.stop();m=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),n,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",
|
|
|
|
|
message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{m.init()}catch(P){g.postMessage(JSON.stringify({event:"draft",
|
|
|
|
|
error:P.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var p=1==k.enableRecent,q=1==k.enableSearch,t=1==k.enableCustomTemp,m=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:d,message:k}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,p?mxUtils.bind(this,
|
|
|
|
|
function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,q?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,d){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")}),null,null,t?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(m.container,620,440,
|
|
|
|
|
!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));m.init();return}if("textContent"==k.action){var u=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:u,message:k}),"*");return}if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var v=
|
|
|
|
|
null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,v):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var y=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var J=this.editor.graph,I=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();
|
|
|
|
|
error:P.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var p=1==k.enableRecent,q=1==k.enableSearch,v=1==k.enableCustomTemp,m=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:d,message:k}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,p?mxUtils.bind(this,
|
|
|
|
|
function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,q?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,d){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")}),null,null,v?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(m.container,620,440,
|
|
|
|
|
!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));m.init();return}if("textContent"==k.action){var u=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:u,message:k}),"*");return}if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var t=
|
|
|
|
|
null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,t):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var y=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var J=this.editor.graph,I=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();
|
|
|
|
|
var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=y;g.postMessage(JSON.stringify(b),"*")}),K=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=Editor.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(y)));J!=this.editor.graph&&J.container.parentNode.removeChild(J.container);I(a)}),M=k.pageId||(null!=this.pages?this.pages[0].getId():null);if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage.getId()!=M){for(var O=
|
|
|
|
|
J.getGlobalVariable,J=this.createTemporaryGraph(J.getStylesheet()),U,L=0;L<this.pages.length;L++)if(this.pages[L].getId()==M){U=this.updatePageRoot(this.pages[L]);break}J.getGlobalVariable=function(a){return"page"==a?U.getName():"pagenumber"==a?1:O.apply(this,arguments)};document.body.appendChild(J.container);J.model.setRoot(U.root)}if(null!=k.layerIds){for(var T=J.model,Z=T.getChildCells(T.getRoot()),m={},L=0;L<k.layerIds.length;L++)m[k.layerIds[L]]=!0;for(L=0;L<Z.length;L++)T.setVisible(Z[L],m[Z[L].id]||
|
|
|
|
|
!1)}this.editor.exportToCanvas(mxUtils.bind(this,function(a){K(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){K(null)}),null,null,k.scale,null,null,null,J)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+(null!=M?"&pageId="+M:"")+(null!=k.layerIds?"&extras="+encodeURIComponent(JSON.stringify({layerIds:k.layerIds})):"")+(null!=k.scale?"&scale="+k.scale:"")+"&base64=1&xml="+encodeURIComponent(y))).send(mxUtils.bind(this,function(a){200<=
|
|
|
|
|
a.getStatus()&&299>=a.getStatus()?I("data:image/png;base64,"+a.getText()):K(null)}),mxUtils.bind(this,function(){K(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);v=this.createLoadMessage("export");v.message=k;if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ba=this.getXmlFileData();v.xml=mxUtils.getXml(ba);v.data=this.getFileData(null,null,!0,null,null,null,ba);v.format=k.format}else if("html"==k.format)y=this.editor.getGraphXml(),
|
|
|
|
|
v.data=this.getHtml(y,this.editor.graph),v.xml=mxUtils.getXml(y),v.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;var fa=this.editor.graph.background;fa==mxConstants.NONE&&(fa=null);v.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);v.format="svg";var Y=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();v.data=Editor.createSvgDataUri(a);g.postMessage(JSON.stringify(v),"*")});if("xmlsvg"==k.format)(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,
|
|
|
|
|
null!=k.spinKey?mxResources.get(k.spinKey):k.spin))&&this.getEmbeddedSvg(v.xml,this.editor.graph,null,!0,Y,null,null,k.embedImages);else if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){this.editor.graph.setEnabled(!1);var V=this.editor.graph.getSvg(fa);this.embedFonts(V,mxUtils.bind(this,function(a){k.embedImages||null==k.embedImages?this.editor.convertImages(a,mxUtils.bind(this,function(a){Y(mxUtils.getXml(a))})):Y(mxUtils.getXml(a))}))}return}g.postMessage(JSON.stringify(v),
|
|
|
|
|
a.getStatus()&&299>=a.getStatus()?I("data:image/png;base64,"+a.getText()):K(null)}),mxUtils.bind(this,function(){K(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);t=this.createLoadMessage("export");t.message=k;if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ba=this.getXmlFileData();t.xml=mxUtils.getXml(ba);t.data=this.getFileData(null,null,!0,null,null,null,ba);t.format=k.format}else if("html"==k.format)y=this.editor.getGraphXml(),
|
|
|
|
|
t.data=this.getHtml(y,this.editor.graph),t.xml=mxUtils.getXml(y),t.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;var fa=this.editor.graph.background;fa==mxConstants.NONE&&(fa=null);t.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);t.format="svg";var Y=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();t.data=Editor.createSvgDataUri(a);g.postMessage(JSON.stringify(t),"*")});if("xmlsvg"==k.format)(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,
|
|
|
|
|
null!=k.spinKey?mxResources.get(k.spinKey):k.spin))&&this.getEmbeddedSvg(t.xml,this.editor.graph,null,!0,Y,null,null,k.embedImages);else if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){this.editor.graph.setEnabled(!1);var V=this.editor.graph.getSvg(fa);this.embedFonts(V,mxUtils.bind(this,function(a){k.embedImages||null==k.embedImages?this.editor.convertImages(a,mxUtils.bind(this,function(a){Y(mxUtils.getXml(a))})):Y(mxUtils.getXml(a))}))}return}g.postMessage(JSON.stringify(t),
|
|
|
|
|
"*")}return}if("load"==k.action)c=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=k.noSaveBtn),null!=k.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=k.noExitBtn),null!=k.title&&null!=this.buttonContainer&&(n=document.createElement("span"),mxUtils.write(n,k.title),"atlas"==
|
|
|
|
|
uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(n),this.embedFilenameSpan=n),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{if("merge"==k.action){var X=
|
|
|
|
|
this.getCurrentFile();null!=X&&(n=l(k.xml),null!=n&&""!=n&&X.mergeFile(new LocalFile(this,n),function(){g.postMessage(JSON.stringify({event:"merge",message:k}),"*")},function(a){g.postMessage(JSON.stringify({event:"merge",message:k,error:a}),"*")}))}else"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k,f.origin):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),
|
|
|
|
@ -10458,8 +10458,8 @@ var CommentsWindow=function(a,e,c,b,g,f){function m(){for(var a=C.getElementsByT
|
|
|
|
|
"geCommentEditTxtArea";k.style.minHeight=f.offsetHeight+"px";k.value=a.content;b.insertBefore(k,f);var l=document.createElement("div");l.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),m()):e();v=null});n.className="geCommentEditBtn";l.appendChild(n);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=k.value;mxUtils.write(f,a.content);e();c(a);v=null});mxEvent.addListener(k,"keydown",mxUtils.bind(this,
|
|
|
|
|
function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";l.appendChild(p);b.insertBefore(l,f);g.style.display="none";f.style.display="none";k.focus()}function d(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
|
|
|
|
|
[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function k(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function l(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,g){function B(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
|
|
|
|
|
"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});F.appendChild(e);d&&(e.style.display="none")}function A(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=x;a(b);return{pdiv:d,replies:c}}function I(c,d,e,g,m){function z(){k(v);b.addReply(t,function(a){t.id=a;b.replies.push(t);p(v);e&&e()},function(b){q();l(v);a.handleError(b,null,
|
|
|
|
|
null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},g,m)}function q(){n(t,v,function(a){z()},!0)}var B=A().pdiv,t=a.newComment(c,a.getCurrentUser());t.pCommentId=b.id;null==b.replies&&(b.replies=[]);var v=u(t,b.replies,B,f+1);d?q():z()}if(g||!b.isResolved){z.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",b.id);x.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(x.style.backgroundColor="ghostWhite");
|
|
|
|
|
"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});F.appendChild(e);d&&(e.style.display="none")}function A(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=x;a(b);return{pdiv:d,replies:c}}function I(c,d,e,g,m){function z(){k(t);b.addReply(v,function(a){v.id=a;b.replies.push(v);p(t);e&&e()},function(b){q();l(t);a.handleError(b,null,
|
|
|
|
|
null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},g,m)}function q(){n(v,t,function(a){z()},!0)}var B=A().pdiv,v=a.newComment(c,a.getCurrentUser());v.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=u(v,b.replies,B,f+1);d?q():z()}if(g||!b.isResolved){z.style.display="none";var x=document.createElement("div");x.className="geCommentContainer";x.setAttribute("data-commentId",b.id);x.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(x.style.backgroundColor="ghostWhite");
|
|
|
|
|
var y=document.createElement("div");y.className="geCommentHeader";var E=document.createElement("img");E.className="geCommentUserImg";E.src=b.user.pictureUrl||Editor.userImage;y.appendChild(E);E=document.createElement("div");E.className="geCommentHeaderTxt";y.appendChild(E);var K=document.createElement("div");K.className="geCommentUsername";mxUtils.write(K,b.user.displayName||"");E.appendChild(K);K=document.createElement("div");K.className="geCommentDate";K.setAttribute("data-commentId",b.id);d(b,
|
|
|
|
|
K);E.appendChild(K);x.appendChild(y);y=document.createElement("div");y.className="geCommentTxt";mxUtils.write(y,b.content||"");x.appendChild(y);b.isLocked&&(x.style.opacity="0.5");y=document.createElement("div");y.className="geCommentActions";var F=document.createElement("ul");F.className="geCommentActionsList";y.appendChild(F);t||b.isLocked||0!=f&&!q||B(mxResources.get("reply"),function(){I("",!0)},b.isResolved);E=a.getCurrentUser();null==E||E.id!=b.user.id||t||b.isLocked||(B(mxResources.get("edit"),
|
|
|
|
|
function(){function c(){n(b,x,function(){k(x);b.editComment(b.content,function(){p(x)},function(b){l(x);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){k(x);b.deleteComment(function(a){if(!0===a){a=x.querySelector(".geCommentTxt");a.innerHTML="";mxUtils.write(a,mxResources.get("msgDeleted"));var d=x.querySelectorAll(".geCommentAction");for(a=
|
|
|
|
@ -10489,8 +10489,8 @@ a.getParent(g),null!=g&&(m=g.getId()))),null!=m&&(c(m).moved[f.previous]=d));ret
|
|
|
|
|
EditorUi.prototype.patchPage=function(a,e,c,b){var g=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),f=this.createParentLookup(g,e);g.beginUpdate();try{var m=g.updateEdgeParent,n=new mxDictionary,d=[];g.updateEdgeParent=function(a,c){!n.get(a)&&b&&(n.put(a,!0),d.push(a))};var k=f[""],l=null!=k&&null!=k.inserted?k.inserted[""]:null,p=null;null!=l&&(p=this.getCellForJson(l));if(null==p){var u=null!=k&&null!=k.moved?k.moved[""]:null;null!=u&&(p=g.getCell(u))}null!=p&&(g.setRoot(p),
|
|
|
|
|
a.root=p);this.patchCellRecursive(a,g,g.root,f,e);if(null!=e[EditorUi.DIFF_REMOVE])for(var t=0;t<e[EditorUi.DIFF_REMOVE].length;t++){var q=g.getCell(e[EditorUi.DIFF_REMOVE][t]);null!=q&&g.remove(q)}if(null!=e[EditorUi.DIFF_UPDATE]){var v=null!=c&&null!=c.cells?c.cells[EditorUi.DIFF_UPDATE]:null;for(u in e[EditorUi.DIFF_UPDATE])this.patchCell(g,g.getCell(u),e[EditorUi.DIFF_UPDATE][u],null!=v?v[u]:null)}if(null!=e[EditorUi.DIFF_INSERT])for(t=0;t<e[EditorUi.DIFF_INSERT].length;t++)l=e[EditorUi.DIFF_INSERT][t],
|
|
|
|
|
q=g.getCell(l.id),null!=q&&(g.setTerminal(q,g.getCell(l.source),!0),g.setTerminal(q,g.getCell(l.target),!1));g.updateEdgeParent=m;if(b&&0<d.length)for(t=0;t<d.length;t++)g.contains(d[t])&&g.updateEdgeParent(d[t])}finally{g.endUpdate()}};
|
|
|
|
|
EditorUi.prototype.patchCellRecursive=function(a,e,c,b,g){if(null!=c){for(var f=b[c.getId()],m=null!=f&&null!=f.inserted?f.inserted:{},f=null!=f&&null!=f.moved?f.moved:{},n=0,d=e.getChildCount(c),k="",l=0;l<d;l++){var p=e.getChildAt(c,l).getId();null==f[k]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][p]||null==g[EditorUi.DIFF_UPDATE][p].previous&&null==g[EditorUi.DIFF_UPDATE][p].parent)&&(f[k]=p);k=p}d=mxUtils.bind(this,function(d,f){var k=null!=d?d.getId():"";if(null!=d&&f){var l=
|
|
|
|
|
e.getCell(k);null!=l&&l!=d&&(d=null)}null!=d&&(e.getChildAt(c,n)!=d&&e.add(c,d,n),this.patchCellRecursive(a,e,d,b,g),n++);return k});for(k=[null];0<k.length;)if(l=k.shift(),l=d(null!=l?l.child:null,null!=l?l.insert:!1),p=f[l],null!=p&&(delete f[l],k.push({child:e.getCell(p)})),p=m[l],null!=p&&(delete m[l],k.push({child:this.getCellForJson(p),insert:!0})),0==k.length){for(l in f)k.push({child:e.getCell(f[l])}),delete f[l];for(l in m)k.push({child:this.getCellForJson(m[l]),insert:!0}),delete m[l]}}};
|
|
|
|
|
EditorUi.prototype.patchCellRecursive=function(a,e,c,b,g){if(null!=c){for(var f=b[c.getId()],m=null!=f&&null!=f.inserted?f.inserted:{},f=null!=f&&null!=f.moved?f.moved:{},n=0,d=e.getChildCount(c),k="",l=0;l<d;l++){var p=e.getChildAt(c,l).getId();null==f[k]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][p]||null==g[EditorUi.DIFF_UPDATE][p].previous&&null==g[EditorUi.DIFF_UPDATE][p].parent)&&(f[k]=p);k=p}d=mxUtils.bind(this,function(d,f){var k=null!=d?d.getId():"";if(null!=d&&f){var m=
|
|
|
|
|
e.getCell(k);null!=m&&m!=d&&(d=null)}null!=d&&(e.getChildAt(c,n)!=d&&e.add(c,d,n),this.patchCellRecursive(a,e,d,b,g),n++);return k});for(k=[null];0<k.length;)if(l=k.shift(),l=d(null!=l?l.child:null,null!=l?l.insert:!1),p=f[l],null!=p&&(delete f[l],k.push({child:e.getCell(p)})),p=m[l],null!=p&&(delete m[l],k.push({child:this.getCellForJson(p),insert:!0})),0==k.length){for(l in f)k.push({child:e.getCell(f[l])}),delete f[l];for(l in m)k.push({child:this.getCellForJson(m[l]),insert:!0}),delete m[l]}}};
|
|
|
|
|
EditorUi.prototype.patchCell=function(a,e,c,b){if(null!=e&&null!=c){if(null==b||null==b.xmlValue&&(null==b.value||""==b.value))"value"in c?a.setValue(e,c.value):null!=c.xmlValue&&a.setValue(e,mxUtils.parseXml(c.xmlValue).documentElement);null!=b&&null!=b.style||null==c.style||a.setStyle(e,c.style);null!=c.visible&&a.setVisible(e,1==c.visible);null!=c.collapsed&&a.setCollapsed(e,1==c.collapsed);null!=c.vertex&&(e.vertex=1==c.vertex);null!=c.edge&&(e.edge=1==c.edge);null!=c.connectable&&(e.connectable=
|
|
|
|
|
1==c.connectable);null!=c.geometry&&a.setGeometry(e,this.codec.decode(mxUtils.parseXml(c.geometry).documentElement));null!=c.source&&a.setTerminal(e,a.getCell(c.source),!0);null!=c.target&&a.setTerminal(e,a.getCell(c.target),!1);for(var g in c)this.cellProperties[g]||(e[g]=c[g])}};
|
|
|
|
|
EditorUi.prototype.getPagesForNode=function(a,e){var c=this.editor.extractGraphModel(a,!0,!0);null!=c&&(a=c);var c=a.getElementsByTagName(e||"diagram"),b=[];if(0<c.length)for(var g=0;g<c.length;g++){var f=new DiagramPage(c[g]);this.updatePageRoot(f,!0);b.push(f)}else"mxGraphModel"==a.nodeName&&(f=new DiagramPage(a.ownerDocument.createElement("diagram")),f.setName(mxResources.get("pageWithNumber",[1])),mxUtils.setTextContent(f.node,Graph.compressNode(a,!0)),b.push(f));return b};
|
|
|
|
@ -10541,8 +10541,8 @@ DrawioFileSync.prototype.fileChanged=function(a,e,c,b){return this.notifyThread=
|
|
|
|
|
DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorRevisionId(a,this.file.getCurrentRevisionId()),this.updateDescriptor(a),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(a){this.file.inConflictState=!0;this.file.handleFileError(a)}))};
|
|
|
|
|
DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
|
|
|
|
|
DrawioFileSync.prototype.catchup=function(a,e,c,b){if(null!=a&&(null==b||!b())){var g=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==g)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=e&&e();else if(this.isValidState()){var m=this.file.getDescriptorSecret(a);if(null==m)this.reload(e,c,b);else{var n=0,d=!1,k=mxUtils.bind(this,function(){if(null==b||!b())if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var l=!0,p=window.setTimeout(mxUtils.bind(this,
|
|
|
|
|
function(){l=!1;this.reload(e,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(g)+(null!=m?"&secret="+encodeURIComponent(m):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(p);if(l&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var m=null,q=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var u=
|
|
|
|
|
JSON.parse(g.getText());if(null!=u&&0<u.length)for(var y=0;y<u.length;y++){var x=this.stringToObject(u[y]);if(x.v>DrawioFileSync.PROTOCOL){d=!0;q=[];break}else if(x.v===DrawioFileSync.PROTOCOL&&null!=x.d)m=x.d.checksum,q.push(x.d.patch);else{d=!0;q=[];break}}}catch(C){q=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,m,a,e,c,b)):n<=this.maxCacheReadyRetries-1&&!d&&401!=g.getStatus()&&503!=g.getStatus()?(n++,this.file.stats.cacheMiss++,
|
|
|
|
|
function(){l=!1;this.reload(e,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(g)+(null!=m?"&secret="+encodeURIComponent(m):""),mxUtils.bind(this,function(g){this.file.stats.bytesReceived+=g.getText().length;window.clearTimeout(p);if(l&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var m=null,q=[];if(200<=g.getStatus()&&299>=g.getStatus()&&0<g.getText().length)try{var v=
|
|
|
|
|
JSON.parse(g.getText());if(null!=v&&0<v.length)for(var u=0;u<v.length;u++){var x=this.stringToObject(v[u]);if(x.v>DrawioFileSync.PROTOCOL){d=!0;q=[];break}else if(x.v===DrawioFileSync.PROTOCOL&&null!=x.d)m=x.d.checksum,q.push(x.d.patch);else{d=!0;q=[];break}}}catch(C){q=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,m,a,e,c,b)):n<=this.maxCacheReadyRetries-1&&!d&&401!=g.getStatus()&&503!=g.getStatus()?(n++,this.file.stats.cacheMiss++,
|
|
|
|
|
window.setTimeout(k,(n+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(e,c,b))}catch(C){null!=c&&c(C)}}else null!=c&&c()}))}else null!=c&&c()});window.setTimeout(k,this.cacheReadyDelay)}}else null!=c&&c()}};DrawioFileSync.prototype.reload=function(a,e,c,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=e&&e(a)}),c,b)};
|
|
|
|
|
DrawioFileSync.prototype.merge=function(a,e,c,b,g,f){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var m=this.file.ignorePatches(a),n=this.file.getDescriptorRevisionId(c);if(!m){for(f=0;f<a.length;f++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
|
|
|
|
|
a[f]);var d=null!=e?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",n,"etag",this.file.getDescriptorEtag(c),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",e==d,e);if(null!=e&&e!=d){var k=this.ui.hashValue(this.file.getCurrentRevisionId()),l=this.ui.hashValue(n);this.file.checksumError(g,a,"From: "+k+"\nTo: "+l+"\nChecksum: "+e+"\nCurrent: "+d,n,"merge");
|
|
|
|
@ -10595,7 +10595,7 @@ c.toUTCString(),localStorage.setItem("."+this.cookieName,e)))}return e};DrawioCl
|
|
|
|
|
DriveFile.prototype.isConflict=function(a){return null!=a&&null!=a.error&&412==a.error.code};DriveFile.prototype.getCurrentUser=function(){return null!=this.ui.drive?this.ui.drive.user:null};DriveFile.prototype.getMode=function(){return App.MODE_GOOGLE};
|
|
|
|
|
DriveFile.prototype.getPublicUrl=function(a){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(e){if(null!=e&&null!=e.items)for(var c=0;c<e.items.length;c++)if("anyoneWithLink"===e.items[c].id||"anyone"===e.items[c].id){a(this.desc.webContentLink);return}a(null)}),mxUtils.bind(this,function(){a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};
|
|
|
|
|
DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(a,e,c,b,g){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,e,c,b,g)}),c,b,g])};
|
|
|
|
|
DriveFile.prototype.saveFile=function(a,e,c,b,g,f){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(a,n){var d=mxUtils.bind(this,function(f,l){try{var k=this.desc;this.ui.drive.saveFile(this,l,mxUtils.bind(this,function(a,d){try{this.savingFile=!1,0!=a?(this.setModified(this.getShadowModified()),e&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.round(Math.min(1E4,
|
|
|
|
|
DriveFile.prototype.saveFile=function(a,e,c,b,g,f){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(a,n){var d=mxUtils.bind(this,function(f,m){try{var k=this.desc;this.ui.drive.saveFile(this,m,mxUtils.bind(this,function(a,d){try{this.savingFile=!1,0!=a?(this.setModified(this.getShadowModified()),e&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.round(Math.min(1E4,
|
|
|
|
|
Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=a,null!=n?this.fileSaved(d,k,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c(a)}),b,n):null!=c&&c(a)):null!=b&&b(a)}catch(q){if(this.savingFile=!1,null!=b)b(q);else throw q;}}),mxUtils.bind(this,function(a,c){try{this.savingFile=!1,this.isConflict(a)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(c,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();
|
|
|
|
|
this.setShadowModified(!1);d(f,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b()):null!=b&&b(a)}catch(q){if(this.savingFile=!1,null!=b)b(q);else throw q;}}),g,g,f,null,a)}catch(u){if(this.savingFile=!1,null!=b)b(u);else throw u;}});d(f,e)}))):null!=c&&c()}catch(m){if(null!=b)b(m);else throw m;}};
|
|
|
|
|
DriveFile.prototype.copyFile=function(a,e){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,e)}catch(c){e(c)}}),e,!0)};
|
|
|
|
@ -10610,14 +10610,14 @@ DriveFile.prototype.setDescriptorEtag=function(a,e){a.etag=e};DriveFile.prototyp
|
|
|
|
|
DriveFile.prototype.loadDescriptor=function(a,e){this.ui.drive.loadDescriptor(this.getId(),a,e)};DriveFile.prototype.commentsSupported=function(){return!0};
|
|
|
|
|
DriveFile.prototype.getComments=function(a,e){function c(a,e,m){if(e.deleted)return null;m=new DriveComment(a,e.commentId||e.replyId,e.content,e.modifiedDate,e.createdDate,"resolved"==e.status,e.author.isAuthenticatedUser?b:new DrawioUser(e.author.permissionId,e.author.emailAddress,e.author.displayName,e.author.picture.url),m);for(var f=0;null!=e.replies&&f<e.replies.length;f++)m.addReplyDirect(c(a,e.replies[f],e.commentId));return m}var b=this.ui.getCurrentUser();this.ui.drive.executeRequest({url:"/files/"+
|
|
|
|
|
this.getId()+"/comments"},mxUtils.bind(this,function(b){for(var e=[],g=0;g<b.items.length;g++){var n=c(this,b.items[g]);null!=n&&e.push(n)}a(e)}),e)};DriveFile.prototype.addComment=function(a,e,c){a={content:a.content};this.ui.drive.executeRequest({url:"/files/"+this.getId()+"/comments",method:"POST",params:a},mxUtils.bind(this,function(a){e(a.commentId)}),c)};DriveFile.prototype.canReplyToReplies=function(){return!1};DriveFile.prototype.canComment=function(){return this.desc.canComment};
|
|
|
|
|
DriveFile.prototype.newComment=function(a,e){return new DriveComment(this,null,a,Date.now(),Date.now(),!1,e)};DriveLibrary=function(a,e,c){DriveFile.call(this,a,e,c)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,e,c){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=e&&e(a)}),c)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);DrawioClient.call(this,a,"gDriveAuthInfo");this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.mimeType="application/vnd.jgraph.mxfile.realtime";this.ui.editor.chromeless&&!this.ui.editor.editable&&"1"!=urlParams.rt?(this.cookieName="gDriveViewerAuthInfo",this.token=this.getPersistentToken(),this.appId=window.DRAWIO_GOOGLE_VIEWER_APP_ID||"850530949725",this.clientId=window.DRAWIO_GOOGLE_VIEWER_CLIENT_ID||"850530949725.apps.googleusercontent.com",
|
|
|
|
|
this.scopes=["https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/userinfo.profile"]):(this.appId=window.DRAWIO_GOOGLE_APP_ID||"671128082532",this.clientId=window.DRAWIO_GOOGLE_CLIENT_ID||"671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com");this.mimeTypes=this.xmlMimeType+",application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy";a=JSON.parse(this.token);if(null!=a&&null!=a.current){a=a.current;
|
|
|
|
|
this.userId=a.userId;this.token=a.access_token;var e=(a.expires-Date.now())/1E3;a.expires_in=600>e?1:e;this.resetTokenRefresh(a);this.authCalled=!1}};mxUtils.extend(DriveClient,mxEventSource);mxUtils.extend(DriveClient,DrawioClient);DriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/google";DriveClient.prototype.GDriveBaseUrl="https://www.googleapis.com/drive/v2";
|
|
|
|
|
DriveFile.prototype.newComment=function(a,e){return new DriveComment(this,null,a,Date.now(),Date.now(),!1,e)};DriveLibrary=function(a,e,c){DriveFile.call(this,a,e,c)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,e,c){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=e&&e(a)}),c)};DriveLibrary.prototype.open=function(){};DriveClient=function(a,e){null==e&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(e=!0);mxEventSource.call(this);DrawioClient.call(this,a,"gDriveAuthInfo");this.isExtAuth=e;this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.mimeType="application/vnd.jgraph.mxfile.realtime";this.ui.editor.chromeless&&!this.ui.editor.editable&&"1"!=urlParams.rt&&"1"!=urlParams.extAuth?(this.cookieName="gDriveViewerAuthInfo",this.token=this.getPersistentToken(),this.appId=window.DRAWIO_GOOGLE_VIEWER_APP_ID||
|
|
|
|
|
"850530949725",this.clientId=window.DRAWIO_GOOGLE_VIEWER_CLIENT_ID||"850530949725.apps.googleusercontent.com",this.scopes=["https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/userinfo.profile"]):(this.appId=window.DRAWIO_GOOGLE_APP_ID||"671128082532",this.clientId=window.DRAWIO_GOOGLE_CLIENT_ID||"671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com");this.mimeTypes=this.xmlMimeType+",application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy";
|
|
|
|
|
var c=JSON.parse(this.token);if(null!=c&&null!=c.current){c=c.current;this.userId=c.userId;this.token=c.access_token;var b=(c.expires-Date.now())/1E3;c.expires_in=600>b?1:b;this.resetTokenRefresh(c);this.authCalled=!1}};mxUtils.extend(DriveClient,mxEventSource);mxUtils.extend(DriveClient,DrawioClient);DriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/google";DriveClient.prototype.GDriveBaseUrl="https://www.googleapis.com/drive/v2";
|
|
|
|
|
DriveClient.prototype.scopes=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/userinfo.profile"];DriveClient.prototype.allFields="kind,id,parents,headRevisionId,etag,title,mimeType,modifiedDate,editable,copyable,canComment,labels,properties,downloadUrl,webContentLink,userPermission,fileSize";DriveClient.prototype.catchupFields="etag,headRevisionId,modifiedDate,properties(key,value)";
|
|
|
|
|
DriveClient.prototype.enableThumbnails=!0;DriveClient.prototype.thumbnailWidth=1E3;DriveClient.prototype.maxThumbnailSize=2E6;
|
|
|
|
|
DriveClient.prototype.placeholderThumbnail="iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAACN1BMVEXwhwXvhgX4iwXzhwXgbQzvhgXhbAzocgzqcwzldAoAAADhbgvjcQnmdgrlbgDwhgXsfwXufgjwhgXwgQfziAXxgADibgz4iwX4jAX3iwTpcwr1igXoewjsfgj3igX4iwXqcQv4jAX3iwXtfQnndQrvhAbibArwhwXgbQz//////v39jwX6jQX+/v7fagHfawzdVQDwhADgbhPgbhXwhwPocQ3uvKvwiA/faQDscgzxiAT97+XgciTgcSP6jAXgbQ3gcCHwiRfpcQzwhwfeXQD77ef74NLvhgTvegD66uPgbAf66+TvfADwjCzgcCfwiSD67ObhcjjwiBHhczvwiyrgbxj///777ujgcSHgcB/xiRzgbhveWgDeVwDhdEDgbRDqfgffYgDfXwD97+bvfQDxiz7//vvwiRr118rrcgztggbfZgDfZAD++PT98+3gbBPsgAb99vD33tPgcB7icAvuhAX//Pn66N/00sTyy7vuuqbjekLwhwzkcgr88er449n++vfutp/kh1vgcBvhbwvmdwnwgwDwgADeWQD87eLxxrTssJjqpIf0roHmjWTkhFP759n63czvvanomnjnlHDhczD22cr4y6/wwa/3xKX2wJ3rqpH0tY7qp4vpnoDymlbjf0vxjjntcwzldAroegj/kgX12s7518PzqnnnkWfynmLieUjpewjrdAD40Lj1uZTzpm3idTbiciLydQzzfwnyiQTsfgD3xqnzp3TxlkzgbCrdTwDdSwBLKUlNAAAAJ3RSTlP8/b2X/YH8wb+FAIuIggJbQin5opAM9+a/ubaubyD78NjSyr2WgRp4sjN4AAAI70lEQVR42u2cZ38SQRDGT8WGvfde4E4BxVMRRaKiUURRlJhQRDCCSgQVO/bee++9994+nMt5ywoezFJd/fm8uITi3p9n5mbYkcCpO6rVnVu2YEXd+3dRIySuo7pLv4GjGNKg7j3UHTl1l14PajmG9OFBnx7Ird4PumpYEtf1QXc112l0M7OGKXEfeg3guo3iNIyJG92Jaz61mYYxcaNacs1H/8f6j6X5j1WI/mMVIsawRFEzI49SjwOqAJa43emclk8Rp2c7AFZ+LDGyvXE2kmO2Q1Lq17RSd6ND48QIwFVuLNHTOPbEpTOz8ujMpccHGz0AV5mxIo4TpwUeUPj0YwfAVVYs0Tn7VZjnBUA8v+n6CyfERY8FR/DEJj7MQ6oL85vOvfDUAsuVC8s19s5yXuAppOPnvPk4EeSCsehCeBVTwVzHfE6RcFUQa4an8Qw91kpbw2oz4aoc1sSxniO0WAI/J24wriabmEpizZtM79bc+fr4/tUarEpiLabGElJYRsOGjbJfjGDpJCxtmosRLOEnVpqLESzZLYlLg65H1rAkLo2GESwcROwXI1jELcS1Y6OGQSzEVaupZQJLDiLhYtCtFBcbbslYhOueqKllDwtzwVhTq4RFuBh0C3EdEBl0C3OBWNUrEISLvSD+5GLQLYmLoSqfwcUiFuaqzhYDxiJc981lxqqdVsCGbHPcQLBgrtK3rwLt9tWqhblKxxI9hW3267U5ZHhuBrCKzXl4NIJTS5FrmbmMWGIEDZIouOp0/O6boYQ2jxBXWcdu13fzRILuF/2Ku+aGr96uBbhALHo5Z38+XcfXyVRZVx/+Ed513ldDCCCu0rFE0Xlo2mu5TAj8ki0XV0q6ePHilhi+d/15b9ACQGGusg3AFzc+XSMBCPzu89+CNlnB7zfD8t1z4iaLXUvDVT6sGdMOnv5pi47f6r9Qk9YF3xZ0l8S11UfMArlgLMpZM6bamYy6rWnta9q7TrZrzZPgPgoqg3atubY8WK6D8lQXHfb4p/wSK7vFfxmxSsAPQ96AlZ4LxoLNeompdkUDGQVznL5mLr4ar5ESD3PBWHA9fbpbjlT4pq1Bm6H6w9dwfOd69ePouNDYt3S3ULPGZ96S3YqtAW/Tepz1E8bgAANc+xEXhAX36ut1cslcd6rJq81SIvgEe7lmL3kY5iqxVYvOI9isswp22KeMOcrriJlWai5giwHl+yec73Ma9Mbfz+qOJndKz6hLpR5V1uPxavFuTTt0K1XfpbNeO0wKeUaR2IPBN5sMRlqu1eY8bsFmPeIFUpi0CjIGTLvSZY2EGeYSi3VL9Dgeb0I+SQl9MlcZT4TObZKzfmfS5NZSx1GsLQ5r+8Sxp7ERR/1TtDlUn2qNuGXCrZGM5URlLDiEVzDVkje5fdjXdDsm27XpXChBz4XG0UpYcDOMYaxjGc3wtyJxFtu1PohaI71f2K2imqEONcN4nrMZ9TWbMf81wg9z3VNwC26Gr3enY4ObobLqbccFefuz5AKONpVfzQp2y3NoVvrN32GLNl9orA22lTiM+Nqg5CJY1DueOjkwsdtNgAP7gidR2SWVhFqt3o9QwoKHIuiwDcwX+xT/UWztSlvCaqXGmtQBY1GadQmfh6anuE0XlkhhRFs3tGGkd+tuIVhiJN0M+brj0mlAu46lX0bcbizVLbgZrgwl4JhYA+NQa9TJQUetsSJYHscJvAVct7eJKoUbQudxPYmdirqzsYsIojhjoitD01yadH287J+vpZF1/uGt2K4ttinjshQo2C2XMzI2U64X6WY4tyZq99a7wZS3eA3BpNyrUPn1x00Z0uM1ACzilOfg7EN3VmRo8dN16WYYerYw6G9qCOSDCjQ0jQkufRbalt65LVyapaA/2mClxhK3Rxy3rsyavDxDR/DL5sMLFiyYu/7sXps7z8VldPv2Xl6PnjlTwOOuJQuytH7CXpvXCOQWoZrYeHWd4nw2Q+v22OLGnFSG0Nk1PCi0xjgjpVvTGi8hht9F+ARBGq8dtXmtOSLoDm1FhUSHnihkTecESalHkPAaWVhtFbA8jqvQGBmbt8fWkKtNn0Xw9GvAWK6DX9bBVHjzqtyvvcG9a+jXyC5oKoKV/a4YFG7Yij2ofszlgtaA3ZoRwW+pIOH3w0qZFURNh3oNtKsDsAr9LNvMC0pj93H6hTPpX9ocg8FIgTVvcgFYC03jFLBMi6ix0MDAoi8/lh7Cgt2q0VfNrSX0ayhjTa2IW0tKdotNrMq4NbPkILKZW+xdiSoGgshogfh7Ul7FcIEoFevfrPLC3+XWf6y/CEvHZoFQqlts9sQigqjLxFpQCJauakFcsqhKPXH79rGb6bE2B5Qmu0b91zn0WJtN8Wys9tgtIqfjEf2SWw7XKI8gHuKQ0X0eDsQSI44TaGBN6dYN5dlI/eFj9I7f8GWtoUJYOIgkiq6Ds/gw5T7dZDUqTrfscbLbB9eIB7JmEKsUgiii/4uO8ToBfJlhfif5tEGWEsGTMT4Mr6HDa0BBlP5Y88lcnkdkCtLhnyjMM0+Gcn2WzW6xnd/J8zn+LZq4SUeEvUBaA8LCs6Tk1p1AetXt3JoMWexWZSyr3RK6vSUGrRHbmkRUVgCLpP1HW/L4tgl5tO140mdKKFFhrkTUdxta4xleA8DCXC6n/vCYvPJFa9zAWL4m6qNaA8IiqjW73lreWnJrSj0AJYFZpvwq6RZRzjVUGEtB5tX7DdoqCXaL+PXHuEjdYsuvVqva4Sqv6NdabdW4YLeIKsoFYzHGhYPIGBd2izGuVpPaSVgAV7VEsOQgsuUXdosxLuwWxLVMW0WRK5ExLiiIpN4vq2YYVTiIbPmFgii5xRiXimCBqmIcVSS3WMqvdMqz5VcKqzdKeca4UrnVT/ryR6bi2Opuf64TwYJlfl4FLqu2Zxeux5BRXZnisvZ8103NqTtzoziuGa24+wZVRdVK9W7wyNSX1nYeOmrU6JSmjp6KhH5BR+kGvk++Ld0c/X66rPH4SEQeGl+kpq8a33eAumPqK347durWpzm9hrWhUevi1Hd4ZzVC+gGMHY0TYnDOYwAAAABJRU5ErkJggg==".replace(/\+/g,"-").replace(/\//g,
|
|
|
|
|
"_");DriveClient.prototype.placeholderMimeType="image/png";DriveClient.prototype.libraryMimeType="application/vnd.jgraph.mxlibrary";DriveClient.prototype.newAppHostname="www.draw.io";DriveClient.prototype.extension=".drawio";DriveClient.prototype.tokenRefreshInterval=0;DriveClient.prototype.lastTokenRefresh=0;DriveClient.prototype.maxRetries=5;DriveClient.prototype.staleEtagMaxRetries=3;DriveClient.prototype.coolOff=1E3;DriveClient.prototype.mimeTypeCheckCoolOff=6E4;DriveClient.prototype.user=null;
|
|
|
|
|
DriveClient.prototype.setUser=function(a){this.user=a;null==this.user?(this.userId=null,null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null)):this.userId=a.id;this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.setUserId=function(a){this.userId=a;null!=this.user&&this.user.id!=this.userId&&(this.user=null)};DriveClient.prototype.getUser=function(){return this.user};
|
|
|
|
|
DriveClient.prototype.sameWinAuthMode=!1;DriveClient.prototype.sameWinRedirectUrl=null;DriveClient.prototype.setUser=function(a){this.user=a;null==this.user?(this.userId=null,null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null)):this.userId=a.id;this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.setUserId=function(a){this.userId=a;null!=this.user&&this.user.id!=this.userId&&(this.user=null)};DriveClient.prototype.getUser=function(){return this.user};
|
|
|
|
|
DriveClient.prototype.getUsersList=function(){var a=[],e=JSON.parse(this.getPersistentToken(!0)),c=null;if(null!=e){null!=e.current&&(c=e.current.userId,a.push(e[c].user),a[0].isCurrent=!0);for(var b in e)"current"!=b&&b!=c&&a.push(e[b].user)}return a};DriveClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};
|
|
|
|
|
DriveClient.prototype.execute=function(a){var e=mxUtils.bind(this,function(c){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,c){this.authorize(!1,mxUtils.bind(this,function(){null!=c&&c();a()}),mxUtils.bind(this,function(a){var b=mxResources.get("cannotLogin");null!=a&&null!=a.error&&403==a.error.code&&null!=a.error.data&&0<a.error.data.length&&"domainPolicy"==a.error.data[0].reason&&(b=a.error.message);this.logout();this.ui.showError(mxResources.get("error"),b,mxResources.get("help"),
|
|
|
|
|
mxUtils.bind(this,function(){this.ui.openLink("https://desk.draw.io/support/solutions/articles/16000074659")}),null,mxResources.get("ok"))}),b)}))});this.authorize(!0,a,e)};
|
|
|
|
@ -10626,11 +10626,12 @@ d=!0);var k=a.fullUrl||this.GDriveBaseUrl+a.url;d&&(k+=(0<k.indexOf("?")?"&":"?"
|
|
|
|
|
b){var k;try{k=JSON.parse(d.getText())}catch(v){k=null}if(200<=d.getStatus()&&299>=d.getStatus())null!=e&&e(k);else{var l=null!=k&&null!=k.error?null!=k.error.data?k.error.data:k.error.errors:null,n=null!=l&&0<l.length?l[0].reason:null;null==c||null==k||null==k.error||-1!=k.error.code&&(403!=k.error.code||"domainPolicy"!=n&&"The requested mime type change is forbidden."!=k.error.message)?null!=k&&null!=k.error&&(401==k.error.code||403==k.error.code&&"rateLimitExceeded"!=n)?403==k.error.code&&this.retryAuth||
|
|
|
|
|
401==k.error.code&&this.retryAuth&&"authError"==n?(null!=c&&c(k),this.retryAuth=!1):(this.retryAuth=!0,this.execute(m)):null!=k&&null!=k.error&&412!=k.error.code&&404!=k.error.code&&400!=k.error.code&&this.currentRequest==a&&f<this.maxRetries?(f++,this.requestThread=window.setTimeout(m,Math.round(Math.pow(2,f)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=c&&c(k):c(k)}}}catch(v){if(null!=c)c(v);else throw v;}}))}catch(p){if(null!=c)c(p);else throw p;}});null!=this.token&&this.authCalled?m():this.execute(m)}catch(n){if(null!=
|
|
|
|
|
c)c(n);else throw n;}};DriveClient.prototype.createAuthWin=function(a){return window.open(a?a:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};
|
|
|
|
|
DriveClient.prototype.authorize=function(a,e,c,b,g){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(f){200<=f.getStatus()&&299>=f.getStatus()?this.authorizeStep2(f.getText(),a,e,c,b,g):null!=c&&c(f)}),c)};
|
|
|
|
|
DriveClient.prototype.authorizeStep2=function(a,e,c,b,g,f){var m=mxUtils.bind(this,function(a,d,e){this.token=a.access_token;a.expires=Date.now()+1E3*parseInt(a.expires_in);a.remember=d;this.resetTokenRefresh(a);this.authCalled=!0;if(e||null==this.user){var f=JSON.stringify(a);this.updateUser(mxUtils.bind(this,function(){var a=JSON.parse(f);this.setPersistentToken(a,!d);null!=c&&c()}),b)}else null!=c&&(this.setPersistentToken(a,!d),c())});try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&
|
|
|
|
|
(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));var n=JSON.parse(this.getPersistentToken(!0));null!=n&&(null==this.userId?null!=n.current?(this.userId=n.current.userId,n=n[this.userId]):n=null:n=n[this.userId]);if(!e||null!=n&&null!=n.refresh_token)if(e)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&ver=2&token="+a)+"&refresh_token="+n.refresh_token,null,"GET")).send(mxUtils.bind(this,
|
|
|
|
|
function(a){200<=a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),a.refresh_token=n.refresh_token,m(a,!0)):(0!=a.getStatus()&&this.logout(),null!=b&&b(a))}),b);else{var d="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(g?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+
|
|
|
|
|
this.clientId+"&domain="+window.location.hostname+"&ver=2&token="+a);null==f?f=this.createAuthWin(d):f.location=d;null!=f&&(window.onGoogleDriveCallback=mxUtils.bind(this,function(a,c){window.onGoogleDriveCallback=null;try{null==a?null!=b&&b({message:mxResources.get("accessDenied")}):m(a,g,!0)}catch(p){null!=b&&b(p)}finally{null!=c&&c.close()}}),f.focus())}else null!=b&&b()}catch(k){if(null!=b)b(k);else throw k;}};
|
|
|
|
|
DriveClient.prototype.authorize=function(a,e,c,b,g){this.isExtAuth&&!a?window.parent.driveAuth(mxUtils.bind(this,function(a){this.updateAuthInfo(a,!0,!0,e,c)}),c):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(f){200<=f.getStatus()&&299>=f.getStatus()?this.authorizeStep2(f.getText(),a,e,c,b,g):null!=c&&c(f)}),c)};
|
|
|
|
|
DriveClient.prototype.updateAuthInfo=function(a,e,c,b,g){this.token=a.access_token;a.expires=Date.now()+1E3*parseInt(a.expires_in);a.remember=e;this.resetTokenRefresh(a);this.authCalled=!0;if(c||null==this.user){var f=JSON.stringify(a);this.updateUser(mxUtils.bind(this,function(){var a=JSON.parse(f);this.setPersistentToken(a,!e);null!=b&&b()}),g)}else null!=b&&(this.setPersistentToken(a,!e),b())};
|
|
|
|
|
DriveClient.prototype.authorizeStep2=function(a,e,c,b,g,f){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));var m=JSON.parse(this.getPersistentToken(!0));null!=m&&(null==this.userId?null!=m.current?(this.userId=m.current.userId,m=m[this.userId]):m=null:m=m[this.userId]);if(!e||null!=m&&null!=m.refresh_token)if(e)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+
|
|
|
|
|
"&domain="+window.location.hostname+"&ver=2&token="+a)+"&refresh_token="+m.refresh_token,null,"GET")).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),a.refresh_token=m.refresh_token,this.updateAuthInfo(a,!0,!1,c,b)):(0!=a.getStatus()&&this.logout(),null!=b&&b(a))}),b);else{var n="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+
|
|
|
|
|
(g?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&ver=2&token="+a+(this.sameWinRedirectUrl?"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(n),f=null):null==f?f=this.createAuthWin(n):f.location=n;null!=f&&(window.onGoogleDriveCallback=mxUtils.bind(this,function(a,e){window.onGoogleDriveCallback=null;try{null==
|
|
|
|
|
a?null!=b&&b({message:mxResources.get("accessDenied")}):this.updateAuthInfo(a,g,!0,c,b)}catch(l){null!=b&&b(l)}finally{null!=e&&e.close()}}),f.focus())}else null!=b&&b()}catch(d){if(null!=b)b(d);else throw d;}};
|
|
|
|
|
DriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=a&&null==a.error&&0<a.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(a.expires_in),this.lastTokenRefresh=(new Date).getTime(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*a.expires_in))};
|
|
|
|
|
DriveClient.prototype.checkToken=function(a){var e=0<this.lastTokenRefresh;(new Date).getTime()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){a();e&&this.fireEvent(new mxEventObject("disconnected"))})):a()};
|
|
|
|
|
DriveClient.prototype.updateUser=function(a,e){try{var c={Authorization:"Bearer "+this.token};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(b){var c=JSON.parse(b);this.executeRequest({url:"/about"},mxUtils.bind(this,function(b){var e=mxResources.get("notAvailable"),f=e,d=null;null!=b&&null!=b.user&&(e=b.user.emailAddress,f=b.user.displayName,d=null!=b.user.picture?b.user.picture.url:null);this.setUser(new DrawioUser(c.id,e,f,d,c.locale));
|
|
|
|
@ -10660,18 +10661,19 @@ c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");z.thumbnail=
|
|
|
|
|
DriveClient.prototype.insertFile=function(a,e,c,b,g,f,m){f=null!=f?f:this.xmlMimeType;a={mimeType:f,title:a};null!=c&&(a.parents=[{kind:"drive#fileLink",id:c}]);this.executeRequest(this.createUploadRequest(null,a,e,!1,m),mxUtils.bind(this,function(a){f==this.libraryMimeType?b(new DriveLibrary(this.ui,e,a)):0==a?null!=g&&g({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,e,a))}),g)};
|
|
|
|
|
DriveClient.prototype.createUploadRequest=function(a,e,c,b,g,f,m){g=null!=g?g:!1;var n={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=f&&(n["If-Match"]=f);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:n,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(e)+
|
|
|
|
|
"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=c?g?c:!window.btoa||mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(c):Graph.base64EncodeUnicode(c):"")+"\r\n---------314159265358979323846--"};b||(a.fullUrl+="&newRevision=false");m&&(a.fullUrl+="&pinned=true");return a};
|
|
|
|
|
DriveClient.prototype.pickFile=function(a,e){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=e?"genericPicker":"filePicker",b=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"==
|
|
|
|
|
mxEvent.getSource(c).className&&(mxEvent.removeListener(document,"click",b),this[a].setVisible(!1))});if(null==this[a]||this[a+"Token"]!=this.token){this[a+"Token"]=this.token;var g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),f=(new google.picker.DocsView).setIncludeFolders(!0),m=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),n=(new google.picker.DocsUploadView).setIncludeFolders(!0);e?(g.setMimeTypes("*/*"),f.setMimeTypes("*/*"),
|
|
|
|
|
m.setMimeTypes("*/*")):(g.setMimeTypes(this.mimeTypes),f.setMimeTypes(this.mimeTypes),m.setMimeTypes(this.mimeTypes));this[a]=(new google.picker.PickerBuilder).setOAuthToken(this[a+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(g).addView(f).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).addView(n).setCallback(mxUtils.bind(this,function(a){a.action!=google.picker.Action.PICKED&&a.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,
|
|
|
|
|
"click",b);a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",b);this[a].setVisible(!0)}catch(d){this.ui.spinner.stop(),this.ui.handleError(d)}}))};
|
|
|
|
|
DriveClient.prototype.pickFile=function(a,e,c){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id,a.docs[0])});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=e?"genericPicker":"filePicker",g=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==
|
|
|
|
|
mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",g),this[a].setVisible(!1),c&&c())});if(null==this[a]||this[a+"Token"]!=this.token){this[a+"Token"]=this.token;var f=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),m=(new google.picker.DocsView).setIncludeFolders(!0),n=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),d=(new google.picker.DocsUploadView).setIncludeFolders(!0);e?(f.setMimeTypes("*/*"),m.setMimeTypes("*/*"),
|
|
|
|
|
n.setMimeTypes("*/*")):(f.setMimeTypes(this.mimeTypes),m.setMimeTypes(this.mimeTypes),n.setMimeTypes(this.mimeTypes));this[a]=(new google.picker.PickerBuilder).setOAuthToken(this[a+"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(f).addView(m).addView(n).addView(google.picker.ViewId.RECENTLY_PICKED).addView(d);if(urlParams.gPickerSize){var k=urlParams.gPickerSize.split(",");this[a]=this[a].setSize(k[0],k[1])}urlParams.topBaseUrl&&(this[a]=
|
|
|
|
|
this[a].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));this[a]=this[a].setCallback(mxUtils.bind(this,function(a){if(a.action==google.picker.Action.PICKED||a.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,"click",g),c&&c();a.action==google.picker.Action.PICKED&&this.filePicked(a)})).build()}mxEvent.addListener(document,"click",g);this[a].setVisible(!0)}catch(l){this.ui.spinner.stop(),this.ui.handleError(l)}}))};
|
|
|
|
|
DriveClient.prototype.pickFolder=function(a,e){this.folderPickerCallback=a;var c=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.folderPicker.setVisible(!1))});if(null==this.folderPicker||this.folderPickerToken!=this.token){this.folderPickerToken=
|
|
|
|
|
this.token;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),e=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),m=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(c).addView(e).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder")).setCallback(mxUtils.bind(this,
|
|
|
|
|
function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);this.folderPickerCallback(b)})).build()}mxEvent.addListener(document,"click",a);this.folderPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))}catch(b){this.ui.handleError(b)}});e?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",
|
|
|
|
|
id:"root"}]})}),mxUtils.bind(this,function(){c()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)};
|
|
|
|
|
this.token;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),e=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),m=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");this.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(this.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(c).addView(e).addView(m).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));
|
|
|
|
|
if(urlParams.gPickerSize){var n=urlParams.gPickerSize.split(",");this.folderPicker=this.folderPicker.setSize(n[0],n[1])}urlParams.topBaseUrl&&(this.folderPicker=this.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));this.folderPicker=this.folderPicker.setCallback(mxUtils.bind(this,function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);this.folderPickerCallback(b)})).build()}mxEvent.addListener(document,"click",
|
|
|
|
|
a);this.folderPicker.setVisible(!0)}catch(d){this.ui.spinner.stop(),this.ui.handleError(d)}}))}catch(b){this.ui.handleError(b)}});e?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){c()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)};
|
|
|
|
|
DriveClient.prototype.pickLibrary=function(a){this.filePickerCallback=a;this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED?this.filePickerCallback(a.docs[0].id):a.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=mxUtils.bind(this,function(b){"picker modal-dialog-bg picker-dialog-bg"==
|
|
|
|
|
mxEvent.getSource(b).className&&(mxEvent.removeListener(document,"click",a),this.libraryPicker.setVisible(!1))});if(null==this.libraryPicker||this.libraryPickerToken!=this.token){this.libraryPickerToken=this.token;var c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),b=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),
|
|
|
|
|
g=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),f=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(c).addView(b).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(f).setCallback(mxUtils.bind(this,
|
|
|
|
|
function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,"click",a);this.libraryPicker.setVisible(!0)}catch(m){this.ui.spinner.stop(),this.ui.handleError(m)}}))};
|
|
|
|
|
g=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),f=(new google.picker.DocsUploadView).setIncludeFolders(!0);this.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(this.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(c).addView(b).addView(g).addView(google.picker.ViewId.RECENTLY_PICKED).addView(f);if(urlParams.gPickerSize){var m=
|
|
|
|
|
urlParams.gPickerSize.split(",");this.libraryPicker=this.libraryPicker.setSize(m[0],m[1])}urlParams.topBaseUrl&&(this.libraryPicker=this.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));this.libraryPicker=this.libraryPicker.setCallback(mxUtils.bind(this,function(b){b.action!=google.picker.Action.PICKED&&b.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",a);b.action==google.picker.Action.PICKED&&this.filePicked(b)})).build()}mxEvent.addListener(document,
|
|
|
|
|
"click",a);this.libraryPicker.setVisible(!0)}catch(n){this.ui.spinner.stop(),this.ui.handleError(n)}}))};
|
|
|
|
|
DriveClient.prototype.showPermissions=function(a){var e=mxUtils.bind(this,function(){var c=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){this.ui.editor.graph.openLink("https://drive.google.com/open?id="+a)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(c.container,360,190,!0,!0);c.init()});this.sharingFailed?e():this.checkToken(mxUtils.bind(this,function(){try{var c=new gapi.drive.share.ShareClient(this.appId);
|
|
|
|
|
c.setOAuthToken(this.token);c.setItemIds([a]);c.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(a){for(var b=!1,c=0;c<a.length;c++)for(var m=0;m<a[c].addedNodes.length;m++){var n=a[c].addedNodes[m];"BUTTON"==n.nodeName&&"ok"==n.getAttribute("name")&&null!=n.parentNode&&null!=n.parentNode.parentNode&&"dialog"==n.parentNode.parentNode.getAttribute("role")?
|
|
|
|
|
(this.sharingFailed=!0,n.click(),e(),b=!0):"DIV"==n.nodeName&&"shr-q-shr-r-shr-xb"==n.className&&(b=!0)}b&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(b){this.ui.handleError(b)}}))};
|
|
|
|
@ -10721,19 +10723,19 @@ OneDriveFile.prototype.saveFile=function(a,e,c,b,g,f){if(!this.isEditable())null
|
|
|
|
|
!1;this.meta=a;this.fileSaved(e,d,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c()}),b)}),mxUtils.bind(this,function(a,c){try{this.savingFile=!1,this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();m()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b()):null!=b&&b(a)}catch(p){if(this.savingFile=
|
|
|
|
|
!1,null!=b)b(p);else throw p;}}),a)}catch(k){if(this.savingFile=!1,null!=b)b(k);else throw k;}});m()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.oneDrive.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.setModified(this.getShadowModified());this.savingFile=!1;null!=c&&c();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))};
|
|
|
|
|
OneDriveFile.prototype.rename=function(a,e,c){var b=this.getCurrentEtag();this.ui.oneDrive.renameFile(this,a,mxUtils.bind(this,function(g){this.hasSameExtension(a,this.getTitle())?(this.meta=g,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(b),null!=e&&e(g)):(this.meta=g,null!=this.sync&&this.sync.descriptorChanged(b),this.save(!0,e,c))}),c)};
|
|
|
|
|
OneDriveFile.prototype.move=function(a,e,c){this.ui.oneDrive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=e&&e(a)}),c)};OneDriveLibrary=function(a,e,c){OneDriveFile.call(this,a,e,c)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(a,e,c){this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.desc=a;null!=e&&e(a)}),c)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a){DrawioClient.call(this,a,"oneDriveAuthInfo");a=JSON.parse(this.token);null!=a&&(this.token=a.access_token,this.endpointHint=null!=a.endpointHint?a.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):a.endpointHint,this.tokenExpiresOn=a.expiresOn,a=(this.tokenExpiresOn-Date.now())/1E3,this.resetTokenRefresh(600>a?1:a))};mxUtils.extend(OneDriveClient,DrawioClient);
|
|
|
|
|
OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"2e598409-107f-4b59-89ca-d7723c8e00a4":"45c10911-200f-4e27-a666-9e9fca147395");OneDriveClient.prototype.clientId="app.diagrams.net"==window.location.hostname?"b5ff67d6-3155-4fca-965a-59a3655c4476":OneDriveClient.prototype.clientId;OneDriveClient.prototype.clientId="viewer.diagrams.net"==window.location.hostname?"417a451a-a343-4788-b6c1-901e63182565":OneDriveClient.prototype.clientId;
|
|
|
|
|
OneDriveClient.prototype.scopes="user.read files.readwrite.all offline_access";OneDriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/microsoft";OneDriveClient.prototype.pickerRedirectUri=window.location.protocol+"//"+window.location.host+"/onedrive3.html";OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.extension=".drawio";
|
|
|
|
|
OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(a){if(null==a||""===a)return!1;for(var e=0;e<this.invalidFilenameRegExs.length;e++)if(this.invalidFilenameRegExs[e].test(a))return!1;return!0};
|
|
|
|
|
OneDriveClient.prototype.get=function(a,e,c){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(e,c);return a};
|
|
|
|
|
OneDriveFile.prototype.move=function(a,e,c){this.ui.oneDrive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.meta=a;this.descriptorChanged();null!=e&&e(a)}),c)};OneDriveLibrary=function(a,e,c){OneDriveFile.call(this,a,e,c)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(a,e,c){this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(a){this.desc=a;null!=e&&e(a)}),c)};OneDriveLibrary.prototype.open=function(){};OneDriveClient=function(a,e,c){null==e&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(e=!0);null==c&&null!=window.urlParams&&"1"==window.urlParams.inlinePicker&&(c=!0);DrawioClient.call(this,a,e?"oneDriveExtAuthInfo":"oneDriveAuthInfo");this.isExtAuth=e;this.inlinePicker=c;a=JSON.parse(this.token);null!=a&&(this.token=a.access_token,this.endpointHint=null!=a.endpointHint?a.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):a.endpointHint,this.tokenExpiresOn=a.expiresOn,a=(this.tokenExpiresOn-
|
|
|
|
|
Date.now())/1E3,this.resetTokenRefresh(600>a?1:a))};mxUtils.extend(OneDriveClient,DrawioClient);OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"2e598409-107f-4b59-89ca-d7723c8e00a4":"45c10911-200f-4e27-a666-9e9fca147395");OneDriveClient.prototype.clientId="app.diagrams.net"==window.location.hostname?"b5ff67d6-3155-4fca-965a-59a3655c4476":OneDriveClient.prototype.clientId;
|
|
|
|
|
OneDriveClient.prototype.clientId="viewer.diagrams.net"==window.location.hostname?"417a451a-a343-4788-b6c1-901e63182565":OneDriveClient.prototype.clientId;OneDriveClient.prototype.scopes="user.read files.readwrite.all offline_access sites.read.all";OneDriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/microsoft";OneDriveClient.prototype.pickerRedirectUri=window.location.protocol+"//"+window.location.host+"/onedrive3.html";
|
|
|
|
|
OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.extension=".drawio";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];
|
|
|
|
|
OneDriveClient.prototype.isValidFilename=function(a){if(null==a||""===a)return!1;for(var e=0;e<this.invalidFilenameRegExs.length;e++)if(this.invalidFilenameRegExs[e].test(a))return!1;return!0};OneDriveClient.prototype.get=function(a,e,c){a=new mxXmlRequest(a,null,"GET");a.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Authorization","Bearer "+this.token)});a.send(e,c);return a};
|
|
|
|
|
OneDriveClient.prototype.updateUser=function(a,e,c){var b=!0,g=window.setTimeout(mxUtils.bind(this,function(){b=!1;e({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,function(f){window.clearTimeout(g);b&&(200>f.getStatus()||300<=f.getStatus()?c?e({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(a,e,!0)}),e)):(f=JSON.parse(f.getText()),this.setUser(new DrawioUser(f.id,null,f.displayName)),
|
|
|
|
|
a()))}),mxUtils.bind(this,function(a){window.clearTimeout(g);b&&e(a)}))};OneDriveClient.prototype.resetTokenRefresh=function(a){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<a&&(this.tokenRefreshInterval=1E3*a,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0)}),900*a))};
|
|
|
|
|
OneDriveClient.prototype.authenticate=function(a,e,c){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?this.authenticateStep2(b.getText(),a,e,c):null!=e&&e(b)}),e)};
|
|
|
|
|
OneDriveClient.prototype.authenticateStep2=function(a,e,c,b){if(null==window.onOneDriveCallback){var g=mxUtils.bind(this,function(){var f=!0,m=JSON.parse(this.getPersistentToken(!0));null!=m?(new mxXmlRequest(this.redirectUri+"?refresh_token="+m.refresh_token+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&ver=2&token="+a),null,"GET")).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?(a=JSON.parse(a.getText()),this.token=a.access_token,
|
|
|
|
|
a.access_token=a.access_token,a.refresh_token=a.refresh_token,a.expiresOn=Date.now()+1E3*a.expires_in,this.tokenExpiresOn=a.expiresOn,this.setPersistentToken(JSON.stringify(a),!a.remember),this.resetTokenRefresh(a.expires_in),e()):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=a.getStatus()||b?c({message:mxResources.get("accessDenied"),retry:g}):g())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,d){var k="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+
|
|
|
|
|
this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes)+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&ver=2&token="+a),k=window.open(k,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=k&&(window.onOneDriveCallback=
|
|
|
|
|
mxUtils.bind(this,function(a,k){if(f){window.onOneDriveCallback=null;f=!1;try{null==a?c({message:mxResources.get("accessDenied"),retry:g}):(null!=d&&d(),this.setUser(null),this.token=a.access_token,a.expiresOn=Date.now()+1E3*a.expires_in,this.tokenExpiresOn=a.expiresOn,a.remember=b,this.setPersistentToken(JSON.stringify(a),!b),this.resetTokenRefresh(a.expires_in),this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){e()}),c))}catch(u){c(u)}finally{null!=k&&k.close()}}else null!=k&&k.close()}),
|
|
|
|
|
k.focus())}),mxUtils.bind(this,function(){f&&(window.onOneDriveCallback=null,f=!1,c({message:mxResources.get("accessDenied"),retry:g}))}))});g()}else c({code:App.ERROR_BUSY})};
|
|
|
|
|
OneDriveClient.prototype.authenticate=function(a,e,c){if(this.isExtAuth)window.parent.oneDriveAuth(mxUtils.bind(this,function(b){this.updateAuthInfo(b,!0,null==this.endpointHint,a,e)}),e);else(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?this.authenticateStep2(b.getText(),a,e,c):null!=e&&e(b)}),e)};
|
|
|
|
|
OneDriveClient.prototype.updateAuthInfo=function(a,e,c,b,g){c&&this.setUser(null);this.token=a.access_token;a.expiresOn=Date.now()+1E3*a.expires_in;this.tokenExpiresOn=a.expiresOn;a.remember=e;this.setPersistentToken(JSON.stringify(a),!e);this.resetTokenRefresh(a.expires_in);c?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){b()}),g):b()};
|
|
|
|
|
OneDriveClient.prototype.authenticateStep2=function(a,e,c,b){if(null==window.onOneDriveCallback){var g=mxUtils.bind(this,function(){var f=!0,m=JSON.parse(this.getPersistentToken(!0));null!=m?(new mxXmlRequest(this.redirectUri+"?refresh_token="+m.refresh_token+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&ver=2&token="+a),null,"GET")).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?this.updateAuthInfo(JSON.parse(a.getText()),m.remember,
|
|
|
|
|
!1,e,c):(this.clearPersistentToken(),this.setUser(null),this.token=null,401!=a.getStatus()||b?c({message:mxResources.get("accessDenied"),retry:g}):g())}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(b,d){var k="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes)+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+
|
|
|
|
|
"&ver=2&token="+a),k=window.open(k,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=k&&(window.onOneDriveCallback=mxUtils.bind(this,function(a,k){if(f){window.onOneDriveCallback=null;f=!1;try{null==a?c({message:mxResources.get("accessDenied"),retry:g}):(null!=d&&d(),this.updateAuthInfo(a,b,!0,e,c))}catch(u){c(u)}finally{null!=
|
|
|
|
|
k&&k.close()}}else null!=k&&k.close()}),k.focus())}),mxUtils.bind(this,function(){f&&(window.onOneDriveCallback=null,f=!1,c({message:mxResources.get("accessDenied"),retry:g}))}))});g()}else c({code:App.ERROR_BUSY})};
|
|
|
|
|
OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,e){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(c){try{if(200<=c.getStatus()&&299>=c.getStatus()){var b=JSON.parse(c.getText());0<b.webUrl.indexOf(".sharepoint.com")?this.endpointHint=b.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var g=JSON.parse(this.getPersistentToken(!0));null!=g&&(g.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(g),!g.remember));
|
|
|
|
|
a();return}}catch(f){}e({message:mxResources.get("unknownError")+" (Code: "+c.getStatus()+")"})}),e)};
|
|
|
|
|
OneDriveClient.prototype.executeRequest=function(a,e,c){var b=mxUtils.bind(this,function(g){var f=!0,m=window.setTimeout(mxUtils.bind(this,function(){f=!1;c({code:App.ERROR_TIMEOUT,retry:b})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(m);f&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),e(a)):g||401!==a.getStatus()&&400!==a.getStatus()?c(this.parseRequestText(a)):this.authenticate(function(){b(!0)},
|
|
|
|
@ -10758,11 +10760,15 @@ d&&b(this.parseRequestText(a))}))}catch(p){b(p)}});null==this.token||6E4>this.to
|
|
|
|
|
OneDriveClient.prototype.writeFile=function(a,e,c,b,g,f,m){try{if(null!=a&&null!=e){var n=mxUtils.bind(this,function(d){try{var k=!0,l=null;try{l=window.setTimeout(mxUtils.bind(this,function(){k=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(u){}var p=new mxXmlRequest(a,e,c);p.setRequestHeaders=mxUtils.bind(this,function(a,c){a.setRequestHeader("Content-Type",b||" ");a.setRequestHeader("Authorization","Bearer "+this.token);null!=m&&a.setRequestHeader("If-Match",m)});p.send(mxUtils.bind(this,
|
|
|
|
|
function(a){window.clearTimeout(l);k&&(200<=a.getStatus()&&299>=a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),g(JSON.parse(a.getText()))):d||401!==a.getStatus()?f(this.parseRequestText(a),a):this.authenticate(function(){n(!0)},f,d))}),mxUtils.bind(this,function(a){window.clearTimeout(l);k&&f(this.parseRequestText(a))}))}catch(u){f(u)}});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){n(!0)},f):n(!1)}else f({message:mxResources.get("unknownError")})}catch(d){f(d)}};
|
|
|
|
|
OneDriveClient.prototype.parseRequestText=function(a){var e={message:mxResources.get("unknownError")};try{e=JSON.parse(a.getText())}catch(c){}return e};OneDriveClient.prototype.pickLibrary=function(a){this.pickFile(function(e){a(e)})};
|
|
|
|
|
OneDriveClient.prototype.pickFolder=function(a,e){var c=mxUtils.bind(this,function(b){var c=mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(b){a(b);mxClient.IS_IE11&&(this.token=b.accessToken)}),cancel:mxUtils.bind(this,function(){}),
|
|
|
|
|
error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})});b?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){a({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})}),c,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){c(!1)}),this.emptyFn):c(e)};
|
|
|
|
|
OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("W"+encodeURIComponent(a))});var e=mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(c){null!=c&&null!=c.value&&0<c.value.length&&
|
|
|
|
|
(mxClient.IS_IE11&&(this.token=c.accessToken),a(OneDriveFile.prototype.getIdOf(c.value[0]),c))}),cancel:mxUtils.bind(this,function(){}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,function(){e();this.ui.hideDialog()}))).container,
|
|
|
|
|
300,140,!0,!0)}),this.emptyFn):e()};OneDriveClient.prototype.logout=function(){if(isLocalStorage){var a=localStorage.getItem("odpickerv7cache");null!=a&&'{"odsdkLoginHint":{'==a.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open("https://login.microsoftonline.com/common/oauth2/v2.0/logout","logout","width=525,height=525,status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes");this.clearPersistentToken();this.setUser(null);this.token=null};GitHubFile=function(a,e,c){DrawioFile.call(this,a,e);this.meta=c;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.share=function(){this.ui.editor.graph.openLink("https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/settings/access")};
|
|
|
|
|
OneDriveClient.prototype.createInlinePicker=function(a,e){return mxUtils.bind(this,function(){var c=null,b=document.createElement("div");b.style.width="550px";b.style.height="435px";b.style.position="relative";var g=new CustomDialog(this.ui,b,mxUtils.bind(this,function(){var b=c.getSelectedItem();if(null!=b){if(e&&"object"==typeof b.folder){a({value:[b]});return}if(!b.folder){a(OneDriveFile.prototype.getIdOf(b));return}}return mxResources.get("invalidSel",null,"Invalid selection")}),null,mxResources.get(e?
|
|
|
|
|
"save":"open"));this.ui.showDialog(g.container,550,485,!0,!0);c=new mxODPicker(b,null,mxUtils.bind(this,function(a,b,c){this.executeRequest(this.baseUrl+a,function(a){b(JSON.parse(a.getText()))},c)}),mxUtils.bind(this,function(a,b,c,d){this.executeRequest(this.baseUrl+"/drives/"+b+"/items/"+a,function(a){c(JSON.parse(a.getText()))},d)}),null,null,function(b){e?a({value:[b]}):a(OneDriveFile.prototype.getIdOf(b))},mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)}),e)})};
|
|
|
|
|
OneDriveClient.prototype.pickFolder=function(a,e){var c=mxUtils.bind(this,function(b){var c=this.inlinePicker?this.createInlinePicker(a,!0):mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(b){a(b);mxClient.IS_IE11&&(this.token=
|
|
|
|
|
b.accessToken)}),cancel:mxUtils.bind(this,function(){}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})})});b?c():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){a({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})}),c,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,
|
|
|
|
|
function(){c(!1)}),this.emptyFn):c(e)};
|
|
|
|
|
OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("W"+encodeURIComponent(a))});var e=this.inlinePicker?this.createInlinePicker(a):mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:this.token,isConsumerAccount:!1},success:mxUtils.bind(this,function(c){null!=
|
|
|
|
|
c&&null!=c.value&&0<c.value.length&&(mxClient.IS_IE11&&(this.token=c.accessToken),a(OneDriveFile.prototype.getIdOf(c.value[0]),c))}),cancel:mxUtils.bind(this,function(){}),error:mxUtils.bind(this,function(a){this.ui.showError(mxResources.get("error"),a)})});null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){this.ui.showDialog((new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,
|
|
|
|
|
function(){this.ui.hideDialog();e()}))).container,300,140,!0,!0)}),this.emptyFn):e()};
|
|
|
|
|
OneDriveClient.prototype.logout=function(){if(isLocalStorage){var a=localStorage.getItem("odpickerv7cache");null!=a&&'{"odsdkLoginHint":{'==a.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open("https://login.microsoftonline.com/common/oauth2/v2.0/logout","logout","width=525,height=525,status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes");this.clearPersistentToken();this.setUser(null);this.token=null};GitHubFile=function(a,e,c){DrawioFile.call(this,a,e);this.meta=c;this.peer=this.ui.gitHub};mxUtils.extend(GitHubFile,DrawioFile);GitHubFile.prototype.share=function(){this.ui.editor.graph.openLink("https://github.com/"+encodeURIComponent(this.meta.org)+"/"+encodeURIComponent(this.meta.repo)+"/settings/access")};
|
|
|
|
|
GitHubFile.prototype.getId=function(){return encodeURIComponent(this.meta.org)+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitHubFile.prototype.getHash=function(){return encodeURIComponent("H"+this.getId())};
|
|
|
|
|
GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(e){a(200<=e.getStatus()&&299>=e.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.isConflict=function(a){return null!=a&&409==a.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};
|
|
|
|
|
GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(a,e){this.peer.getFile(this.getId(),a,e)};GitHubFile.prototype.isCompressedStorage=function(){return!1};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,e){a.sha=e};
|
|
|
|
@ -10795,8 +10801,8 @@ GitHubClient.prototype.showGitHubDialog=function(a,e){var c=null,b=null,g=null,f
|
|
|
|
|
mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("title",a);d.style.cursor="pointer";mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=k.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),u=mxUtils.bind(this,function(a){var e=document.createElement("div");e.style.marginBottom="8px";e.appendChild(p(c+"/"+b,mxUtils.bind(this,function(){f=null;C()})));a||(mxUtils.write(e," / "),e.appendChild(p(decodeURIComponent(g),mxUtils.bind(this,function(){f=
|
|
|
|
|
null;x()}))));if(null!=f&&0<f.length){var k=f.split("/");for(a=0;a<k.length;a++)(function(a){mxUtils.write(e," / ");e.appendChild(p(k[a],mxUtils.bind(this,function(){f=k.slice(0,a+1).join("/");y()})))})(a)}d.appendChild(e)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=g=b=c=null,C()):this.ui.hideDialog()}))}),q=null,v=null,y=mxUtils.bind(this,function(m){null==m&&(d.innerHTML="",m=1);var n=new mxXmlRequest(this.baseUrl+
|
|
|
|
|
"/repos/"+c+"/"+b+"/contents/"+f+"?ref="+encodeURIComponent(g)+"&per_page=100&page="+m,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));l.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var z=mxUtils.bind(this,function(){y(m+1)});mxEvent.addListener(q,"click",
|
|
|
|
|
z);this.executeRequest(n,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==m&&(u(),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,C();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var z=!0,q=0;l=mxUtils.bind(this,function(l){for(var m=0;m<n.length;m++)mxUtils.bind(this,function(m,n){if(l==("dir"==m.type)){var B=k.cloneNode();B.style.backgroundColor=
|
|
|
|
|
z?"dark"==uiTheme?"#000000":"#eeeeee":"";z=!z;var t=document.createElement("img");t.src=IMAGE_PATH+"/"+("dir"==m.type?"folder.png":"file.png");t.setAttribute("align","absmiddle");t.style.marginRight="4px";t.style.marginTop="-4px";t.width=20;B.appendChild(t);B.appendChild(p(m.name+("dir"==m.type?"/":""),mxUtils.bind(this,function(){"dir"==m.type?(f=m.path,y()):a&&"file"==m.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+encodeURIComponent(g)+"/"+m.path))})));d.appendChild(B);q++}})(n[m],m)});l(!0);a&&l(!1)}}),
|
|
|
|
|
z);this.executeRequest(n,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==m&&(u(),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,C();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");y()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(d,mxResources.get("noFiles"));else{var z=!0,q=0;l=mxUtils.bind(this,function(m){for(var l=0;l<n.length;l++)mxUtils.bind(this,function(l,n){if(m==("dir"==l.type)){var B=k.cloneNode();B.style.backgroundColor=
|
|
|
|
|
z?"dark"==uiTheme?"#000000":"#eeeeee":"";z=!z;var v=document.createElement("img");v.src=IMAGE_PATH+"/"+("dir"==l.type?"folder.png":"file.png");v.setAttribute("align","absmiddle");v.style.marginRight="4px";v.style.marginTop="-4px";v.width=20;B.appendChild(v);B.appendChild(p(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(f=l.path,y()):a&&"file"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+encodeURIComponent(g)+"/"+l.path))})));d.appendChild(B);q++}})(n[l],l)});l(!0);a&&l(!1)}}),
|
|
|
|
|
t,!0)}),x=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var e=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+b+"/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");
|
|
|
|
|
var m=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(q,"click",m);this.executeRequest(e,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,
|
|
|
|
|
mxUtils.bind(this,function(){g=a.name;f="";y()})));d.appendChild(c)})(b[c],c);100==b.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&m()},mxEvent.addListener(d,"scroll",v))}}),t)}),C=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var e=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&mxEvent.removeListener(d,"scroll",
|
|
|
|
@ -10834,9 +10840,9 @@ a.getStatus()&&299>=a.getStatus()||b&&404==a.getStatus())e(a);else if(401===a.ge
|
|
|
|
|
mxResources.get("fileNotFound"))}):400===a.getStatus()?c({status:400}):c({status:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("error")+" "+a.getStatus())})}),mxUtils.bind(this,function(a){window.clearTimeout(d);n&&c(a)}))}),f=mxUtils.bind(this,function(a){null==this.user?this.updateUser(function(){f(!0)},c,a):g(a)});null==this.token?this.authenticate(function(){f(!0)},c):f(!1)};
|
|
|
|
|
GitLabClient.prototype.getRefIndex=function(a,e,c,b,g,f){if(null!=g)c(a,g);else{var m=a.length-2,n=mxUtils.bind(this,function(){if(2>m)b({message:mxResources.get("fileNotFound")});else{var d=Math.max(m-1,0),g=a.slice(0,d).join("/"),d=a[d],l=a[m],p=a.slice(m+1,a.length).join("/"),g=this.baseUrl+"/projects/"+encodeURIComponent(g+"/"+d)+"/repository/"+(e?f?"branches?per_page=1&page=1&ref="+l:"tree?path="+p+"&ref="+l:"files/"+encodeURIComponent(p)+"?ref="+l),u=new mxXmlRequest(g,null,"HEAD");this.executeRequest(u,
|
|
|
|
|
mxUtils.bind(this,function(){200==u.getStatus()?c(a,m):b({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==u.getStatus()?(m--,n()):b({message:mxResources.get("fileNotFound")})}))}});n()}};
|
|
|
|
|
GitLabClient.prototype.getFile=function(a,e,c,b,g,f){b=null!=b?b:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(f,n){var d=Math.max(n-1,0),k=f.slice(0,d).join("/"),m=f[d],p=f[n];a=f.slice(n+1,f.length).join("/");d=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&d))if(null!=this.token){var d="&t="+(new Date).getTime(),u=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+m)+"/repository/files/"+encodeURIComponent(a)+
|
|
|
|
|
"?ref="+p;f=a.split("/");this.ui.convertFile(u+d,0<f.length?f[f.length-1]:a,null,this.extension,e,c,mxUtils.bind(this,function(a,b,c){a=new mxXmlRequest(a,null,"GET");this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.getFileContent(JSON.parse(a.getText())))}catch(x){c(x)}}),c)}))}else c({message:mxResources.get("accessDenied")});else d="&t="+(new Date).getTime(),u=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+m)+"/repository/files/"+encodeURIComponent(a)+"?ref="+p,d=new mxXmlRequest(u+
|
|
|
|
|
d,null,"GET"),this.executeRequest(d,mxUtils.bind(this,function(a){try{e(this.createGitLabFile(k,m,p,JSON.parse(a.getText()),b,n))}catch(q){c(q)}}),c)}),c,f)};
|
|
|
|
|
GitLabClient.prototype.getFile=function(a,e,c,b,g,f){b=null!=b?b:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(f,n){var d=Math.max(n-1,0),k=f.slice(0,d).join("/"),l=f[d],m=f[n];a=f.slice(n+1,f.length).join("/");d=/\.png$/i.test(a);if(!g&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&d))if(null!=this.token){var d="&t="+(new Date).getTime(),u=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+l)+"/repository/files/"+encodeURIComponent(a)+
|
|
|
|
|
"?ref="+m;f=a.split("/");this.ui.convertFile(u+d,0<f.length?f[f.length-1]:a,null,this.extension,e,c,mxUtils.bind(this,function(a,b,c){a=new mxXmlRequest(a,null,"GET");this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.getFileContent(JSON.parse(a.getText())))}catch(x){c(x)}}),c)}))}else c({message:mxResources.get("accessDenied")});else d="&t="+(new Date).getTime(),u=this.baseUrl+"/projects/"+encodeURIComponent(k+"/"+l)+"/repository/files/"+encodeURIComponent(a)+"?ref="+m,d=new mxXmlRequest(u+
|
|
|
|
|
d,null,"GET"),this.executeRequest(d,mxUtils.bind(this,function(a){try{e(this.createGitLabFile(k,l,m,JSON.parse(a.getText()),b,n))}catch(q){c(q)}}),c)}),c,f)};
|
|
|
|
|
GitLabClient.prototype.getFileContent=function(a){var e=a.file_name,c=a.content;"base64"===a.encoding&&(/\.jpe?g$/i.test(e)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(e)?c="data:image/gif;base64,"+c:/\.pdf$/i.test(e)?c="data:application/pdf;base64,"+c:/\.png$/i.test(e)?(a=this.ui.extractGraphModelFromPng(c),c=null!=a&&0<a.length?a:"data:image/png;base64,"+c):c=Base64.decode(c));return c};
|
|
|
|
|
GitLabClient.prototype.createGitLabFile=function(a,e,c,b,g,f){var m=DRAWIO_GITLAB_URL+"/";a={org:a,repo:e,ref:c,name:b.file_name,path:b.file_path,html_url:m+a+"/"+e+"/blob/"+c+"/"+b.file_path,download_url:m+a+"/"+e+"/raw/"+c+"/"+b.file_path+"?inline=false",last_commit_id:b.last_commit_id,refPos:f};b=this.getFileContent(b);return g?new GitLabLibrary(this.ui,b,a):new GitLabFile(this.ui,b,a)};
|
|
|
|
|
GitLabClient.prototype.insertFile=function(a,e,c,b,g,f,m){g=null!=g?g:!1;f=f.split("/");this.getRefIndex(f,!0,mxUtils.bind(this,function(f,d){var k=Math.max(d-1,0),l=f.slice(0,k).join("/"),n=f[k],u=f[d];path=f.slice(d+1,f.length).join("/");0<path.length&&(path+="/");path+=a;this.checkExists(l+"/"+n+"/"+u+"/"+path,!0,mxUtils.bind(this,function(f,k){if(f)if(g)m||(e=Base64.encode(e)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(l,n,u,path,a,e,k,mxUtils.bind(this,function(a){try{var e=
|
|
|
|
@ -10857,46 +10863,47 @@ B?"dark"==uiTheme?"#000000":"#eeeeee":"";B=!B;var z=document.createElement("img"
|
|
|
|
|
v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&z()},mxEvent.addListener(d,"scroll",v))}}),t,!0)}),x=mxUtils.bind(this,function(a){null==a&&(d.innerHTML="",a=1);var e=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);
|
|
|
|
|
q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var m=mxUtils.bind(this,function(){x(a+1)});mxEvent.addListener(q,"click",m);this.executeRequest(e,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),d.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;C()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(d,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,
|
|
|
|
|
function(a,b){var c=k.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){g=encodeURIComponent(a.name);f="";y()})));d.appendChild(c)})(b[c],c);100==b.length&&(d.appendChild(q),v=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&m()},mxEvent.addListener(d,"scroll",v))}}),t)});l.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(d,mxResources.get("loading"));var C=mxUtils.bind(this,function(a){this.ui.spinner.stop();
|
|
|
|
|
null==a&&(d.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(q,"click",e);var m=mxUtils.bind(this,function(a){this.ui.spinner.spin(d,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");
|
|
|
|
|
this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),t)}),l=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(d,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),t)});m(mxUtils.bind(this,function(m){var n=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+
|
|
|
|
|
a,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=m&&0!=m.length){1==a&&(d.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(c=a[0],b=a[1],g="master",f=null,2<a.length&&(f=encodeURIComponent(a.slice(2,
|
|
|
|
|
a.length).join("/"))),y()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d),mxUtils.br(d));for(var z=0;z<n.length;z++)mxUtils.bind(this,function(a,e){var m=k.cloneNode();m.style.backgroundColor=0==e%2?"dark"==uiTheme?"#000000":"#eeeeee":"";m.appendChild(p(a.name_with_namespace,mxUtils.bind(this,function(){c=a.owner.username;b=a.path;g=a.default_branch||"master";
|
|
|
|
|
f="";y()})));d.appendChild(m)})(n[z],z);for(z=0;z<m.length;z++)l(m[z],mxUtils.bind(this,function(a,e){for(var m=0;m<e.length;m++){var l=k.cloneNode();l.style.backgroundColor=0==idx%2?"dark"==uiTheme?"#000000":"#eeeeee":"";mxUtils.bind(this,function(e){l.appendChild(p(e.name_with_namespace,mxUtils.bind(this,function(){c=a.full_path;b=e.path;g=e.default_branch||"master";f="";y()})));d.appendChild(l)})(e[m])}}))}else mxUtils.write(d,mxResources.get("noFiles"));100==n.length&&(d.appendChild(q),v=function(){d.scrollTop>=
|
|
|
|
|
null==a&&(d.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(d,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){C(a+1)});mxEvent.addListener(q,"click",e);var l=mxUtils.bind(this,function(a){this.ui.spinner.spin(d,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");
|
|
|
|
|
this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),t)}),m=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(d,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),t)});l(mxUtils.bind(this,function(l){var n=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+
|
|
|
|
|
a,null,"GET");this.ui.spinner.spin(d,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=l&&0!=l.length){1==a&&(d.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(c=a[0],b=a[1],g="master",f=null,2<a.length&&(f=encodeURIComponent(a.slice(2,
|
|
|
|
|
a.length).join("/"))),y()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d),mxUtils.br(d));for(var z=0;z<n.length;z++)mxUtils.bind(this,function(a,e){var l=k.cloneNode();l.style.backgroundColor=0==e%2?"dark"==uiTheme?"#000000":"#eeeeee":"";l.appendChild(p(a.name_with_namespace,mxUtils.bind(this,function(){c=a.owner.username;b=a.path;g=a.default_branch||"master";
|
|
|
|
|
f="";y()})));d.appendChild(l)})(n[z],z);for(z=0;z<l.length;z++)m(l[z],mxUtils.bind(this,function(a,e){for(var l=0;l<e.length;l++){var m=k.cloneNode();m.style.backgroundColor=0==idx%2?"dark"==uiTheme?"#000000":"#eeeeee":"";mxUtils.bind(this,function(e){m.appendChild(p(e.name_with_namespace,mxUtils.bind(this,function(){c=a.full_path;b=e.path;g=e.default_branch||"master";f="";y()})));d.appendChild(m)})(e[l])}}))}else mxUtils.write(d,mxResources.get("noFiles"));100==n.length&&(d.appendChild(q),v=function(){d.scrollTop>=
|
|
|
|
|
d.scrollHeight-d.offsetHeight&&e()},mxEvent.addListener(d,"scroll",v))}),t)}))});this.token?this.user?C():this.updateUser(function(){C()},t,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){C()},t,!0)}),t)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,e,c,b,g,f,m){this.file=a;this.id=e;this.content=c;this.modifiedDate=b;this.createdDate=g;this.isResolved=f;this.user=m;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,e,c,b,g){e()};DrawioComment.prototype.editComment=function(a,e,c){e()};DrawioComment.prototype.deleteComment=function(a,e){a()};DriveComment=function(a,e,c,b,g,f,m,n){DrawioComment.call(this,a,e,c,b,g,f,m);this.pCommentId=n};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,e,c,b,g){a={content:a.content};b?a.verb="resolve":g&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){e(a.replyId)}),c)};
|
|
|
|
|
DriveComment.prototype.editComment=function(a,e,c){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},e,c)};
|
|
|
|
|
DriveComment.prototype.deleteComment=function(a,e){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,e)};App=function(a,e,c){EditorUi.call(this,a,e,null!=c?c:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var c={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=
|
|
|
|
|
a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!=a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};
|
|
|
|
|
a.constructor==DriveFile&&null!=a.desc&&null!=this.drive&&(c.label+=(null!=this.drive.user?"-user_"+this.drive.user.id:"-nouser")+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType);EditorUi.logEvent(c)}}));this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+a.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?
|
|
|
|
|
"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":
|
|
|
|
|
(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,c,e){var b=null;try{b=window.open(a)}catch(n){}null==b||void 0===b?this.showDialog((new PopupDialog(this,a,c,e)).container,320,140,!0,!0):null!=c&&c()});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.editor.chromeless&&!this.editor.editable||this.addFileDropHandler([document]);if(null!=
|
|
|
|
|
App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(b){null!=window.console&&console.log("Plugin Error:",b,App.DrawPlugins[a])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(a){try{a(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,this.initializeEmbedMode())}),5E3)}this.load()};
|
|
|
|
|
App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL=window.DRAWIO_BASE_URL+"/js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";
|
|
|
|
|
App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":window.DRAWIO_BASE_URL+"/js/onedrive/OneDrive.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date;
|
|
|
|
|
(new Image).src=mxGraph.prototype.warningImage.src;window.openWindow=mxUtils.bind(this,function(a,c,e){if("1"==urlParams.openInSameWin)e();else{var b=null;try{b=window.open(a)}catch(n){}null==b||void 0===b?this.showDialog((new PopupDialog(this,a,c,e)).container,320,140,!0,!0):null!=c&&c()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(a){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(a)});this.editor.chromeless&&!this.editor.editable||
|
|
|
|
|
this.addFileDropHandler([document]);if(null!=App.DrawPlugins){for(a=0;a<App.DrawPlugins.length;a++)try{App.DrawPlugins[a](this)}catch(b){null!=window.console&&console.log("Plugin Error:",b,App.DrawPlugins[a])}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}window.Draw.loadPlugin=mxUtils.bind(this,function(a){try{a(this)}finally{App.embedModePluginsCount--,this.initializeEmbedMode()}});setTimeout(mxUtils.bind(this,function(){0<App.embedModePluginsCount&&(App.embedModePluginsCount=0,
|
|
|
|
|
this.initializeEmbedMode())}),5E3)}this.load()};App.ERROR_TIMEOUT="timeout";App.ERROR_BUSY="busy";App.ERROR_UNKNOWN="unknown";App.MODE_GOOGLE="google";App.MODE_DROPBOX="dropbox";App.MODE_ONEDRIVE="onedrive";App.MODE_GITHUB="github";App.MODE_GITLAB="gitlab";App.MODE_DEVICE="device";App.MODE_BROWSER="browser";App.MODE_TRELLO="trello";App.MODE_EMBED="embed";App.DROPBOX_APPKEY="libwls2fa9szdji";App.DROPBOX_URL=window.DRAWIO_BASE_URL+"/js/dropbox/Dropbox-sdk.min.js";App.DROPINS_URL="https://www.dropbox.com/static/api/2/dropins.js";
|
|
|
|
|
App.ONEDRIVE_URL=mxClient.IS_IE11?"https://js.live.net/v7.2/OneDrive.js":window.DRAWIO_BASE_URL+"/js/onedrive/OneDrive.js";App.ONEDRIVE_INLINE_PICKER_URL=window.DRAWIO_BASE_URL+"/js/onedrive/mxODPicker.js";App.TRELLO_URL="https://api.trello.com/1/client.js";App.TRELLO_JQUERY_URL="https://code.jquery.com/jquery-1.7.1.min.js";App.PUSHER_KEY="1e756b07a690c5bdb054";App.PUSHER_CLUSTER="eu";App.PUSHER_URL="https://js.pusher.com/4.3/pusher.min.js";App.GOOGLE_APIS="drive-share";App.startTime=new Date;
|
|
|
|
|
App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugins/explore.js",p1:"/plugins/p1.js",ac:"/plugins/connect.js",acj:"/plugins/connectJira.js",ac148:"/plugins/cConf-1-4-8.js",ac148cmnt:"/plugins/cConf-comments.js",voice:"/plugins/voice.js",tips:"/plugins/tooltips.js",svgdata:"/plugins/svgdata.js",electron:"plugins/electron.js",number:"/plugins/number.js",sql:"/plugins/sql.js",props:"/plugins/props.js",text:"/plugins/text.js",anim:"/plugins/animation.js",update:"/plugins/update.js",
|
|
|
|
|
trees:"/plugins/trees/trees.js","import":"/plugins/import.js",replay:"/plugins/replay.js",anon:"/plugins/anonymize.js",tr:"/plugins/trello.js",f5:"/plugins/rackF5.js",tickets:"/plugins/tickets.js",flow:"/plugins/flow.js",webcola:"/plugins/webcola/webcola.js",rnd:"/plugins/random.js",page:"/plugins/page.js",gd:"/plugins/googledrive.js",tags:"/plugins/tags.js"};App.publicPlugin="ex voice tips svgdata number sql props text anim update trees replay anon tickets flow webcola tags".split(" ");
|
|
|
|
|
App.loadScripts=function(a,e){for(var c=a.length,b=0;b<c;b++)mxscript(a[b],function(){0==--c&&null!=e&&e()})};
|
|
|
|
|
App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var e=document.cookie.split(";"),c=0;c<e.length;c++){var b=mxUtils.trim(e[c]);if("MODE="==b.substring(0,5)){a=b.substring(5);break}}null!=a&&isLocalStorage&&(e=new Date,e.setYear(e.getFullYear()-1),document.cookie="MODE=; expires="+e.toUTCString(),localStorage.setItem(".mode",a))}return a};
|
|
|
|
|
(function(){mxClient.IS_CHROMEAPP||("1"!=urlParams.offline&&("db.draw.io"==window.location.hostname&&null==urlParams.mode&&(urlParams.mode="dropbox"),App.mode=urlParams.mode),null==App.mode&&(App.mode=App.getStoredMode()),null!=window.mxscript&&("1"!=urlParams.embed&&("function"===typeof window.DriveClient&&("0"!=urlParams.gapi&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_GOOGLE||null!=urlParams.state&&""==window.location.hash||null!=window.location.hash&&
|
|
|
|
|
"#G"==window.location.hash.substring(0,2)?mxscript("https://apis.google.com/js/api.js"):"0"!=urlParams.chrome||null!=window.location.hash&&"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"===window.location.hash.substring(0,45)||(window.DriveClient=null):window.DriveClient=null),"function"===typeof window.DropboxClient&&("0"!=urlParams.db&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?App.mode==App.MODE_DROPBOX||null!=window.location.hash&&"#D"==window.location.hash.substring(0,
|
|
|
|
|
2)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)}):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=
|
|
|
|
|
null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL)}):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")))})();
|
|
|
|
|
2)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,null,"dropboxjs",App.DROPBOX_APPKEY)}):"0"==urlParams.chrome&&(window.DropboxClient=null):window.DropboxClient=null),"function"===typeof window.OneDriveClient&&("0"!=urlParams.od&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?"1"==urlParams.inlinePicker?mxscript(App.ONEDRIVE_INLINE_PICKER_URL):
|
|
|
|
|
mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient=null),"function"===typeof window.TrelloClient&&("0"!=urlParams.tr&&isSvgBrowser&&(null==document.documentMode||10<=document.documentMode)?App.mode==App.MODE_TRELLO||null!=window.location.hash&&"#T"==window.location.hash.substring(0,2)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL)}):"0"==urlParams.chrome&&(window.TrelloClient=null):window.TrelloClient=null)),"undefined"==typeof JSON&&
|
|
|
|
|
mxscript("js/json/json2.min.js")))})();
|
|
|
|
|
App.main=function(a,e){function c(b){mxUtils.getAll("1"!=urlParams.dev?[b]:[b,STYLE_PATH+"/default.xml",STYLE_PATH+"/dark-default.xml"],function(b){mxResources.parse(b[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var c=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(!d[a[b]])throw Error(mxResources.get("invalidInput")+' "'+a[b])+'"';return!0},d={},f;for(f in App.pluginRegistry)d[App.pluginRegistry[f]]=!0;
|
|
|
|
|
var g=JSON.parse(Graph.decompress(window.location.hash.substring(9)));null!=g&&c(g.plugins)&&(EditorUi.debug("Setting configuration",JSON.stringify(g)),confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(".configuration",JSON.stringify(g)),window.location.hash="",window.location.reload()));window.location.hash=""}catch(y){window.location.hash="",alert(y)}2<b.length&&(Graph.prototype.defaultThemes["default-style2"]=b[1].getDocumentElement(),
|
|
|
|
|
Graph.prototype.defaultThemes.darkTheme=b[2].getDocumentElement());b=null!=e?e():new App(new Editor("0"==urlParams.chrome||"min"==uiTheme,null,null,null,"0"!=urlParams.chrome));if(null!=window.mxscript){if("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode))mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,
|
|
|
|
|
function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,
|
|
|
|
|
window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):
|
|
|
|
|
"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",[b,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))},function(a){a=document.getElementById("geStatus");null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||
|
|
|
|
|
mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function b(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var a=parseInt(mxSettings.settings.autosaveDelay);!isNaN(a)&&0<a?(DrawioFile.prototype.autosaveDelay=a,EditorUi.debug("Setting autosaveDelay",a)):EditorUi.debug("Invalid autosaveDelay",a)}null!=mxSettings.settings.defaultEdgeLength&&(a=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(a)&&0<a?(Graph.prototype.defaultEdgeLength=a,EditorUi.debug("Using defaultEdgeLength",
|
|
|
|
|
a)):EditorUi.debug("Invalid defaultEdgeLength",a))}}catch(p){null!=window.console&&console.error(p)}mxResources.loadDefaultBundle=!1;c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,e){EditorUi.logError("Global: "+(null!=a?a:""),b,c,d,e,null,!0)};if("1"==urlParams.embed||"1"==urlParams.lightbox){var g=document.getElementById("geInfo");null!=g&&g.parentNode.removeChild(g)}null!=document.referrer&&"aws3"==
|
|
|
|
|
urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.dev&&null!=CryptoJS){g=document.getElementsByTagName("script");if(null!=g&&0<g.length){var f=mxUtils.getTextContent(g[0]);"a74b51371929aa44cfc6f8b9c73d1f47"!=CryptoJS.MD5(f).toString()&&(console.log("Change bootstrap script MD5 in the previous line:",CryptoJS.MD5(f).toString()),alert("[Dev] Bootstrap script change requires update of CSP"))}null!=
|
|
|
|
|
g&&1<g.length&&(f=mxUtils.getTextContent(g[1]),"d41d8cd98f00b204e9800998ecf8427e"!=CryptoJS.MD5(f).toString()&&(console.log("Change main script MD5 in the previous line:",CryptoJS.MD5(f).toString()),alert("[Dev] Main script change requires update of CSP")))}try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"==urlParams.dev?navigator.serviceWorker.getRegistrations().then(function(a){if(null!=a&&0<a.length){for(var b=
|
|
|
|
|
0;b<a.length;b++)a[b].unregister();"0"==urlParams.offline&&alert("Cache cleared")}}):(mxStencilRegistry.allowEval=!1,navigator.serviceWorker.register("/service-worker.js"),App.loadScripts(["js/shapes.min.js","js/stencils.min.js","js/extensions.min.js"])))}catch(l){null!=window.console&&console.error(l)}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&"1"!=urlParams.embedRT||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||
|
|
|
|
|
"1"==urlParams.stealth||"1"==urlParams.offline||mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){g=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var m=JSON.parse(localStorage.getItem(mxSettings.key));null!=m&&(g=m.plugins)}catch(l){}m=urlParams.p;App.initPluginCallback();null!=m&&App.loadPlugins(m.split(";"));if(null!=g&&0<g.length&&"0"!=urlParams.plugins){for(var m=window.location.protocol+
|
|
|
|
|
"//"+window.location.host,f=!0,n=0;n<g.length&&f;n++)"/"!=g[n].charAt(0)&&g[n].substring(0,m.length)!=m&&(f=!1);if(f||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[g.join("\n")]).replace(/\\n/g,"\n")))for(n=0;n<g.length;n++)try{null==App.pluginsLoaded[g[n]]&&(App.pluginsLoaded[g[n]]=
|
|
|
|
|
!0,App.embedModePluginsCount++,"/"==g[n].charAt(0)&&(g[n]=PLUGINS_BASE_PATH+g[n]),mxscript(g[n]))}catch(l){}}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=
|
|
|
|
|
null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var d=window.opener||window.parent,k=function(a){if(a.source==d)try{var c=JSON.parse(a.data);null!=c&&"configure"==c.action&&(mxEvent.removeListener(window,"message",k),Editor.configure(c.config,!0),mxSettings.load(),b())}catch(u){null!=window.console&&console.log("Error in configure message: "+u,a.data)}};mxEvent.addListener(window,"message",k);d.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=
|
|
|
|
|
window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(l){null!=window.console&&console.error(l)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&(g=localStorage.getItem(".configuration"),null!=g))try{g=JSON.parse(g),null!=g&&(EditorUi.debug("Using local configuration",g),Editor.configure(g),mxSettings.load())}catch(l){null!=window.console&&console.error(l)}}b()}};mxUtils.extend(App,EditorUi);
|
|
|
|
|
App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=64";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
|
|
|
|
|
function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?"1"==urlParams.inlinePicker?
|
|
|
|
|
mxscript(App.ONEDRIVE_INLINE_PICKER_URL,window.DrawOneDriveClientCallback):mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null);"function"===typeof window.TrelloClient&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,
|
|
|
|
|
function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(b);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",[b,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))},function(a){a=document.getElementById("geStatus");null!=a&&(a.innerHTML="Error loading page. <a>Please try refreshing.</a>",a.getElementsByTagName("a")[0].onclick=function(){mxLanguage=
|
|
|
|
|
"en";c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})}function b(){try{if(null!=mxSettings.settings){if(null!=mxSettings.settings.autosaveDelay){var a=parseInt(mxSettings.settings.autosaveDelay);!isNaN(a)&&0<a?(DrawioFile.prototype.autosaveDelay=a,EditorUi.debug("Setting autosaveDelay",a)):EditorUi.debug("Invalid autosaveDelay",a)}null!=mxSettings.settings.defaultEdgeLength&&(a=parseInt(mxSettings.settings.defaultEdgeLength),!isNaN(a)&&
|
|
|
|
|
0<a?(Graph.prototype.defaultEdgeLength=a,EditorUi.debug("Using defaultEdgeLength",a)):EditorUi.debug("Invalid defaultEdgeLength",a))}}catch(p){null!=window.console&&console.error(p)}mxResources.loadDefaultBundle=!1;c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(a,b,c,d,e){EditorUi.logError("Global: "+(null!=a?a:""),b,c,d,e,null,!0)};if("1"==urlParams.embed||"1"==urlParams.lightbox){var g=document.getElementById("geInfo");
|
|
|
|
|
null!=g&&g.parentNode.removeChild(g)}null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.dev&&null!=CryptoJS){g=document.getElementsByTagName("script");if(null!=g&&0<g.length){var f=mxUtils.getTextContent(g[0]);"a74b51371929aa44cfc6f8b9c73d1f47"!=CryptoJS.MD5(f).toString()&&(console.log("Change bootstrap script MD5 in the previous line:",CryptoJS.MD5(f).toString()),
|
|
|
|
|
alert("[Dev] Bootstrap script change requires update of CSP"))}null!=g&&1<g.length&&(f=mxUtils.getTextContent(g[1]),"d41d8cd98f00b204e9800998ecf8427e"!=CryptoJS.MD5(f).toString()&&(console.log("Change main script MD5 in the previous line:",CryptoJS.MD5(f).toString()),alert("[Dev] Main script change requires update of CSP")))}try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"==urlParams.dev?navigator.serviceWorker.getRegistrations().then(function(a){if(null!=
|
|
|
|
|
a&&0<a.length){for(var b=0;b<a.length;b++)a[b].unregister();"0"==urlParams.offline&&alert("Cache cleared")}}):(mxStencilRegistry.allowEval=!1,navigator.serviceWorker.register("/service-worker.js"),App.loadScripts(["js/shapes.min.js","js/stencils.min.js","js/extensions.min.js"])))}catch(l){null!=window.console&&console.error(l)}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&"1"!=urlParams.embedRT||"1"==urlParams.local||"0"==
|
|
|
|
|
urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||mxscript(App.PUSHER_URL);if("0"!=urlParams.plugins&&"1"!=urlParams.offline){g=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var m=JSON.parse(localStorage.getItem(mxSettings.key));null!=m&&(g=m.plugins)}catch(l){}m=urlParams.p;App.initPluginCallback();null!=m&&App.loadPlugins(m.split(";"));if(null!=g&&0<g.length&&"0"!=urlParams.plugins){for(var m=
|
|
|
|
|
window.location.protocol+"//"+window.location.host,f=!0,n=0;n<g.length&&f;n++)"/"!=g[n].charAt(0)&&g[n].substring(0,m.length)!=m&&(f=!1);if(f||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[g.join("\n")]).replace(/\\n/g,"\n")))for(n=0;n<g.length;n++)try{null==App.pluginsLoaded[g[n]]&&
|
|
|
|
|
(App.pluginsLoaded[g[n]]=!0,App.embedModePluginsCount++,"/"==g[n].charAt(0)&&(g[n]=PLUGINS_BASE_PATH+g[n]),mxscript(g[n]))}catch(l){}}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&
|
|
|
|
|
(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var d=window.opener||window.parent,k=function(a){if(a.source==d)try{var c=JSON.parse(a.data);null!=c&&"configure"==c.action&&(mxEvent.removeListener(window,"message",k),Editor.configure(c.config,!0),mxSettings.load(),b())}catch(u){null!=window.console&&console.log("Error in configure message: "+u,a.data)}};mxEvent.addListener(window,"message",k);d.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==
|
|
|
|
|
Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(l){null!=window.console&&console.error(l)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&(g=localStorage.getItem(".configuration"),null!=g))try{g=JSON.parse(g),null!=g&&(EditorUi.debug("Using local configuration",g),Editor.configure(g),mxSettings.load())}catch(l){null!=window.console&&console.error(l)}}b()}};
|
|
|
|
|
mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=64";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowOTgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMjU2NzdEMTcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMjU2NzdEMDcwRDIxMUUxQjc0MDkxRDhCNUQzOEFGRCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNjgwMTE3NDA3MjA2ODExODcxRkM4MUY1OTFDMjQ5OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowNzgwMTE3NDA3MjA2ODExODhDNkFGMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg==";
|
|
|
|
|
App.prototype.chevronUpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUY1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NjA1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1RDUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1RTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg+qUokAAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAAL0lEQVR42mJgRgMMRAswMKAKMDDARBjg8lARBoR6KImkH0wTbygT6YaS4DmAAAMAYPkClOEDDD0AAAAASUVORK5CYII=":
|
|
|
|
|
IMAGE_PATH+"/chevron-up.png";
|
|
|
|
|
App.prototype.chevronDownImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDg2NEE3NUI1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDg2NEE3NUM1MUVBMTFFM0I3MUVEMTc0N0YyOUI4QzEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0ODY0QTc1OTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0ODY0QTc1QTUxRUExMUUzQjcxRUQxNzQ3RjI5QjhDMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsCtve8AAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAALUlEQVR42mJgRgMMRAkwQEXBNAOcBSPhclB1cNVwfcxI+vEZykSpoSR6DiDAAF23ApT99bZ+AAAAAElFTkSuQmCC":IMAGE_PATH+
|
|
|
|
@ -11011,17 +11018,17 @@ App.prototype.fileCreated=function(a,e,c,b,g){var f=window.location.pathname;nul
|
|
|
|
|
(k=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(k.container),d=this.decodeNodeIntoGraph(d,k));a.setData(this.createFileData(m,k,a,n));null!=k&&k.container.parentNode.removeChild(k.container);var l=mxUtils.bind(this,function(){this.spinner.stop()}),p=mxUtils.bind(this,function(){l();var d=this.getCurrentFile();null==c&&null!=d&&(c=!d.isModified()&&null==d.getMode());var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);c&&a.addAllSavedStatus();
|
|
|
|
|
null!=e&&this.sidebar.showEntries(e);if(null!=g){for(var b=[],d=g.split(";"),f=0;f<d.length;f++)b.push(decodeURIComponent(d[f]));this.loadLibraries(b)}}),m=mxUtils.bind(this,function(){c||null==d||!d.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=b&&b();null==c||c?m():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),
|
|
|
|
|
null==a.getMode())),null!=b&&b(),window.openWindow(f,null,m))});a.constructor==LocalFile?p():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){p()}),mxUtils.bind(this,function(a){l();this.handleError(a)}))}};
|
|
|
|
|
App.prototype.loadFile=function(a,e,c,b,g){this.hideDialog();var f=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage){var d=mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))});a=decodeURIComponent(a.substring(1));
|
|
|
|
|
StorageFile.getFileContent(this,a,mxUtils.bind(this,function(c){null!=c?(this.fileLoaded(new StorageFile(this,c,a)),null!=b&&b()):d({message:mxResources.get("fileNotFound")})}),d)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=c)this.spinner.stop(),this.fileLoaded(c),null!=b&&b();else if("S"==a.charAt(0)){this.spinner.stop();
|
|
|
|
|
try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))),b,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0)){this.spinner.stop();var f=decodeURIComponent(a.substring(1));"<"!=f.charAt(0)&&(f=Graph.decompress(f));f=new LocalFile(this,f,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);f.getHash=function(){return a};this.fileLoaded(f);
|
|
|
|
|
null!=b&&b()}else if("E"==a.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(a,c){this.spinner.stop();this.fileLoaded(new EmbedFile(this,a,c));null!=b&&b()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==a.charAt(0)){var g=
|
|
|
|
|
decodeURIComponent(a.substring(1)),m=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+a,e,null,mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&this.editor.chromeless&&!this.editor.editable&&(c.getHash=function(){return"G"+a},
|
|
|
|
|
window.location.hash="#"+c.getHash());null!=b&&b()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",a);return!0});this.loadTemplate(g,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=g,e=g.lastIndexOf("."),f=d.lastIndexOf("/");e>f&&0<f&&(d=d.substring(f+1,e),e=g.substring(e),this.useCanvasForExport||".png"!=e||(e=".drawio"),
|
|
|
|
|
".svg"===e||".xml"===e||".html"===e||".png"===e||".drawio"===e)&&(c=d+e)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||m()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else m()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){m()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},
|
|
|
|
|
mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else if(f=null,"G"==a.charAt(0)?f=this.drive:"D"==a.charAt(0)?f=this.dropbox:"W"==a.charAt(0)?f=this.oneDrive:"H"==a.charAt(0)?f=this.gitHub:"A"==a.charAt(0)?f=this.gitLab:"T"==a.charAt(0)&&(f=this.trello),null==f)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();
|
|
|
|
|
window.location.hash=null!=a?a.getHash():""}));else{var n=a.charAt(0);a=decodeURIComponent(a.substring(1));f.getFile(a,mxUtils.bind(this,function(c){this.spinner.stop();this.fileLoaded(c);var d=this.getCurrentFile();null==d?(window.location.hash="",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(d.getHash=function(){return n+a},window.location.hash="#"+d.getHash()):c==d&&null==c.getMode()&&(c=mxResources.get("copyCreated"),this.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="overflow:hidden;">'+
|
|
|
|
|
c+"</div>"));null!=b&&b()}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):window.location.hash="#"+a.getHash()}),null,null,"#"+n+a)}))}}),m=this.getCurrentFile(),n=mxUtils.bind(this,function(){g||null==m||!m.isModified()?f():this.confirm(mxResources.get("allChangesLost"),
|
|
|
|
|
mxUtils.bind(this,function(){null!=m&&(window.location.hash=m.getHash())}),f,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?n():null==m||e?n():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+a,null,n)).container,320,140,!0,!0)};
|
|
|
|
|
App.prototype.loadFile=function(a,e,c,b,g){"1"==urlParams.openInSameWin&&(e=!0);this.hideDialog();var f=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage){var d=mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=
|
|
|
|
|
null!=a?a.getHash():""}))});a=decodeURIComponent(a.substring(1));StorageFile.getFileContent(this,a,mxUtils.bind(this,function(c){null!=c?(this.fileLoaded(new StorageFile(this,c,a)),null!=b&&b()):d({message:mxResources.get("fileNotFound")})}),d)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=c)this.spinner.stop(),this.fileLoaded(c),
|
|
|
|
|
null!=b&&b();else if("S"==a.charAt(0)){this.spinner.stop();try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))),b,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0)){this.spinner.stop();var f=decodeURIComponent(a.substring(1));"<"!=f.charAt(0)&&(f=Graph.decompress(f));f=new LocalFile(this,f,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,
|
|
|
|
|
!0);f.getHash=function(){return a};this.fileLoaded(f);null!=b&&b()}else if("E"==a.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(a,c){this.spinner.stop();this.fileLoaded(new EmbedFile(this,a,c));null!=b&&b()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));
|
|
|
|
|
else if("U"==a.charAt(0)){var g=decodeURIComponent(a.substring(1)),m=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=g.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=g.substring(31,g.lastIndexOf("&ex"));this.loadFile("G"+a,e,null,mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&this.editor.chromeless&&!this.editor.editable&&(c.getHash=
|
|
|
|
|
function(){return"G"+a},window.location.hash="#"+c.getHash());null!=b&&b()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",a);return!0});this.loadTemplate(g,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=g,e=g.lastIndexOf("."),f=d.lastIndexOf("/");e>f&&0<f&&(d=d.substring(f+1,e),e=g.substring(e),this.useCanvasForExport||
|
|
|
|
|
".png"!=e||(e=".drawio"),".svg"===e||".xml"===e||".html"===e||".png"===e||".drawio"===e)&&(c=d+e)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||m()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else m()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){m()||(this.spinner.stop(),
|
|
|
|
|
this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else if(f=null,"G"==a.charAt(0)?f=this.drive:"D"==a.charAt(0)?f=this.dropbox:"W"==a.charAt(0)?f=this.oneDrive:"H"==a.charAt(0)?f=this.gitHub:"A"==a.charAt(0)?f=this.gitLab:"T"==a.charAt(0)&&(f=this.trello),null==f)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),
|
|
|
|
|
mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else{var n=a.charAt(0);a=decodeURIComponent(a.substring(1));f.getFile(a,mxUtils.bind(this,function(c){this.spinner.stop();this.fileLoaded(c);var d=this.getCurrentFile();null==d?(window.location.hash="",this.showSplash()):this.editor.chromeless&&!this.editor.editable?(d.getHash=function(){return n+a},window.location.hash="#"+d.getHash()):c==d&&null==c.getMode()&&(c=mxResources.get("copyCreated"),
|
|
|
|
|
this.editor.setStatus('<div title="'+c+'" class="geStatusAlert" style="overflow:hidden;">'+c+"</div>"));null!=b&&b()}),mxUtils.bind(this,function(b){null!=window.console&&null!=b&&console.log("error in loadFile:",a,b);this.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null,mxUtils.bind(this,function(){var a=this.getCurrentFile();null==a?(window.location.hash="",this.showSplash()):window.location.hash="#"+a.getHash()}),null,null,"#"+n+a)}))}}),m=this.getCurrentFile(),n=mxUtils.bind(this,
|
|
|
|
|
function(){g||null==m||!m.isModified()?f():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=m&&(window.location.hash=m.getHash())}),f,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==a||0==a.length?n():null==m||e?n():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+a,null,n)).container,320,140,!0,!0)};
|
|
|
|
|
App.prototype.getLibraryStorageHint=function(a){var e=a.getTitle();a.constructor!=LocalLibrary&&(e+="\n"+a.getHash());a.constructor==DriveLibrary?e+=" ("+mxResources.get("googleDrive")+")":a.constructor==GitHubLibrary?e+=" ("+mxResources.get("github")+")":a.constructor==TrelloLibrary?e+=" ("+mxResources.get("trello")+")":a.constructor==DropboxLibrary?e+=" ("+mxResources.get("dropbox")+")":a.constructor==OneDriveLibrary?e+=" ("+mxResources.get("oneDrive")+")":a.constructor==StorageLibrary?e+=" ("+
|
|
|
|
|
mxResources.get("browser")+")":a.constructor==LocalLibrary&&(e+=" ("+mxResources.get("device")+")");return e};App.prototype.restoreLibraries=function(){this.loadLibraries(mxSettings.getCustomLibraries(),mxUtils.bind(this,function(){this.loadLibraries((urlParams.clibs||"").split(";"))}))};
|
|
|
|
|
App.prototype.loadLibraries=function(a,e){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var c=mxUtils.bind(this,function(a,b){b||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=0,g=[],f=mxUtils.bind(this,function(){if(0==b){if(null!=a)for(var c=a.length-1;0<=c;c--)null!=g[c]&&this.loadLibrary(g[c]);null!=e&&e()}});if(null!=a)for(var m=0;m<a.length;m++){var n=encodeURIComponent(decodeURIComponent(a[m]));mxUtils.bind(this,function(a,e){if(null!=
|
|
|
|
@ -11043,7 +11050,7 @@ function(){this.spinner.stop()}),mxUtils.bind(this,function(a){this.spinner.stop
|
|
|
|
|
c():this.confirm(mxResources.get("replaceIt",[e]),c))};
|
|
|
|
|
App.prototype.descriptorChanged=function(){var a=this.getCurrentFile();if(null!=a){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var e=null!=a.getTitle()?a.getTitle():this.defaultFilename;mxUtils.write(this.fname,e);this.fname.setAttribute("title",e+" - "+mxResources.get("rename"))}var e=this.editor.graph,c=a.isEditable()&&!a.invalidChecksum;e.isEnabled()&&!c&&e.reset();e.setEnabled(c);null==urlParams.rev&&(this.updateDocumentTitle(),a=a.getHash(),0<a.length?
|
|
|
|
|
window.location.hash=a:0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null!=this.format&&this.editor.graph.isSelectionEmpty()&&this.format.refresh()};
|
|
|
|
|
App.prototype.showAuthDialog=function(a,e,c,b){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,e,mxUtils.bind(this,function(a){try{null!=c&&c(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(m){this.editor.setStatus(mxUtils.htmlEntities(m.message))}}))).container,300,e?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b();a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
|
|
|
|
|
App.prototype.showAuthDialog=function(a,e,c,b){var g=this.spinner.pause();this.showDialog((new AuthDialog(this,a,e,mxUtils.bind(this,function(a){try{null!=c&&c(a,mxUtils.bind(this,function(){this.hideDialog();g()}))}catch(m){this.editor.setStatus(mxUtils.htmlEntities(m.message))}}))).container,300,e?180:140,!0,!0,mxUtils.bind(this,function(a){null!=b&&b(a);a&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};
|
|
|
|
|
App.prototype.convertFile=function(a,e,c,b,g,f,m,n){var d=e;/\.svg$/i.test(d)||(d=d.substring(0,e.lastIndexOf("."))+b);var k=!1;null!=this.gitHub&&a.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(k=!0);if(/\.v(dx|sdx?)$/i.test(e)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var l=new XMLHttpRequest;l.open("GET",a,!0);k||(l.responseType="blob");if(n)for(var p in n)l.setRequestHeader(p,n[p]);l.onload=mxUtils.bind(this,function(){if(200<=
|
|
|
|
|
l.status&&299>=l.status){var a=null;k?(a=JSON.parse(l.responseText),a=this.base64ToBlob(a.content,"application/octet-stream")):a=new Blob([l.response],{type:"application/octet-stream"});this.importVisio(a,mxUtils.bind(this,function(a){g(new LocalFile(this,a,d,!0))}),f,e)}else null!=f&&f({message:mxResources.get("errorLoadingFile")})});l.onerror=f;l.send()}else{var u=mxUtils.bind(this,function(b){try{if(/\.pdf$/i.test(e)){var c=Editor.extractGraphModelFromPdf(b);null!=c&&0<c.length&&g(new LocalFile(this,
|
|
|
|
|
c,d,!0))}else/\.png$/i.test(e)?(c=this.extractGraphModelFromPng(b),null!=c?g(new LocalFile(this,c,d,!0)):g(new LocalFile(this,b,e,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(new LocalFile(this,a.responseText,d,!0)):null!=f&&f({message:mxResources.get("errorLoadingFile")}))}),e):g(new LocalFile(this,b,d,!0))}catch(v){null!=
|
|
|
|
@ -11093,34 +11100,34 @@ Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);th
|
|
|
|
|
var c=document.createElement("img");mxUtils.setOpacity(c,50);c.style.height="16px";c.style.width="16px";c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);b.appendChild(c);mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){null!=this.editorUi.menubar&&this.editorUi.menubar.hideMenu();this.editorUi.openLink(a);mxEvent.consume(b)}));return b};Menus.prototype.addLinkToItem=function(a,b){null!=a&&a.firstChild.nextSibling.appendChild(this.createHelpLink(b))};
|
|
|
|
|
var e=Menus.prototype.init;Menus.prototype.init=function(){function a(a,b,c){this.ui=a;this.previousExtFonts=this.extFonts=b;this.prevCustomFonts=this.customFonts=c}e.apply(this,arguments);var b=this.editorUi,g=b.editor.graph,f=mxUtils.bind(g,g.isEnabled),m=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),n=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&
|
|
|
|
|
"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),d=("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!mxClient.IS_IOS&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),k=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&
|
|
|
|
|
"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);mxClient.IS_SVG||b.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");b.actions.addAction("new...",function(){var a=b.isOffline(),c=new NewDialog(b,a,!(b.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));b.showDialog(c.container,a?350:620,a?70:440,!0,!0,function(a){a&&null==b.getCurrentFile()&&b.showSplash()});c.init()});b.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",
|
|
|
|
|
function(){var a=new NewDialog(b,null,!1,function(a){b.hideDialog();if(null!=a){var c=b.editor.graph.getFreeInsertPoint();g.setSelectionCells(b.importXml(a,Math.max(c.x,20),Math.max(c.y,20),!0));g.scrollCellToVisible(g.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));b.showDialog(a.container,620,440,!0,!0)})).isEnabled=f;var l=b.actions.addAction("points",function(){b.editor.graph.view.setUnit(mxConstants.POINTS)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.graph.view.unit==
|
|
|
|
|
mxConstants.POINTS});l=b.actions.addAction("inches",function(){b.editor.graph.view.setUnit(mxConstants.INCHES)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.INCHES});l=b.actions.addAction("millimeters",function(){b.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.MILLIMETERS});this.put("units",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,
|
|
|
|
|
["points","millimeters"],b)})));l=b.actions.addAction("ruler",function(){mxSettings.setRulerOn(!mxSettings.isRulerOn());mxSettings.save();null!=b.ruler?(b.ruler.destroy(),b.ruler=null):b.ruler=new mxDualRuler(b,b.editor.graph.view.unit);b.refresh()});l.setEnabled(b.canvasSupported&&9!=document.documentMode);l.setToggleAction(!0);l.setSelectedCallback(function(){return null!=b.ruler});b.actions.addAction("properties...",function(){var a=new FilePropertiesDialog(b);b.showDialog(a.container,320,120,
|
|
|
|
|
!0,!0);a.init()}).isEnabled=f;window.mxFreehand&&(b.actions.put("insertFreehand",new Action(mxResources.get("freehand")+"...",function(a){g.isEnabled()&&(null==this.freehandWindow&&(this.freehandWindow=new FreehandWindow(b,document.body.offsetWidth-420,102,176,104)),g.freehand.isDrawing()?g.freehand.stopDrawing():g.freehand.startDrawing(),this.freehandWindow.window.setVisible(g.freehand.isDrawing()))})).isEnabled=function(){return f()&&mxClient.IS_SVG});b.actions.put("exportXml",new Action(mxResources.get("formatXml")+
|
|
|
|
|
"...",function(){var a=document.createElement("div");a.style.whiteSpace="nowrap";var c=null==b.pages||1>=b.pages.length,d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatXml"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";a.appendChild(d);var e=b.addCheckbox(a,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),f=b.addCheckbox(a,mxResources.get("compressed"),!0),k=b.addCheckbox(a,mxResources.get("allPages"),!c,c);k.style.marginBottom="16px";
|
|
|
|
|
mxEvent.addListener(e,"change",function(){e.checked?k.setAttribute("disabled","disabled"):k.removeAttribute("disabled")});a=new CustomDialog(b,a,mxUtils.bind(this,function(){b.downloadFile("xml",!f.checked,null,!e.checked,c||!k.checked)}),null,mxResources.get("export"));b.showDialog(a.container,300,180,!0,!0)}));b.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){b.showPublishLinkDialog(mxResources.get("url"),!0,null,null,function(a,c,d,e,f,g){a=new EmbedDialog(b,b.createLink(a,
|
|
|
|
|
c,d,e,f,g,null,!0));b.showDialog(a.container,440,240,!0,!0);a.init()})}));b.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("export"),null,a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e,f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d=b.getBaseFilename(k),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+
|
|
|
|
|
mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+a+"\n"+c+"\n</body>\n</html>";b.saveData(d+".html","html",e,"text/html")}))})})}));b.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(EditorUi.isElectronApp||!b.isOffline()&&!b.printPdfExport){var a=null==b.pages||1>=b.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatPdf"));d.style.cssText=
|
|
|
|
|
"width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(d);var e=function(){f!=this&&this.checked?(m.removeAttribute("disabled"),m.checked=!g.pageVisible):(m.setAttribute("disabled","disabled"),m.checked=!1)},d=180;if(b.pdfPageExport&&!a){var f=b.addRadiobox(c,"pages",mxResources.get("allPages"),!0),k=b.addRadiobox(c,"pages",mxResources.get("currentPage"),!1),l=b.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),m=b.addCheckbox(c,mxResources.get("crop"),
|
|
|
|
|
!1,!0),n=b.addCheckbox(c,mxResources.get("grid"),!1,!1);mxEvent.addListener(f,"change",e);mxEvent.addListener(k,"change",e);mxEvent.addListener(l,"change",e);d+=60}else l=b.addCheckbox(c,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),m=b.addCheckbox(c,mxResources.get("crop"),!g.pageVisible||!b.pdfPageExport,!b.pdfPageExport),n=b.addCheckbox(c,mxResources.get("grid"),!1,!1),b.pdfPageExport||mxEvent.addListener(l,"change",e);var p=null,q=null;mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||
|
|
|
|
|
"draw.io"!=b.getServiceName()||(q=b.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),p=b.addCheckbox(c,mxResources.get("transparentBackground"),!1),d+=60);c=new CustomDialog(b,c,mxUtils.bind(this,function(){b.downloadFile("pdf",null,null,!l.checked,a?!0:!f.checked,!m.checked,null!=p&&p.checked,null,null,n.checked,null!=q&&q.checked)}),null,mxResources.get("export"));b.showDialog(c.container,300,d,!0,!0)}else b.showDialog((new PrintDialog(b,mxResources.get("formatPdf"))).container,360,null!=
|
|
|
|
|
b.pages&&1<b.pages.length&&(b.editor.editable||"1"!=urlParams["hide-pages"])?450:370,!0,!0)}));b.actions.addAction("open...",function(){b.pickFile()});b.actions.addAction("close",function(){function a(){null!=c&&c.removeDraft();b.fileLoaded(null)}var c=b.getCurrentFile();null!=c&&c.isModified()?b.confirm(mxResources.get("allChangesLost"),null,a,mxResources.get("cancel"),mxResources.get("discardChanges")):a()});b.actions.addAction("editShape...",mxUtils.bind(this,function(){g.getSelectionCells();if(1==
|
|
|
|
|
g.getSelectionCount()){var a=g.getSelectionCell(),c=g.view.getState(a);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())}}));b.actions.addAction("revisionHistory...",function(){b.isRevisionHistorySupported()?b.spinner.spin(document.body,mxResources.get("loading"))&&b.getRevisions(mxUtils.bind(this,function(a,c){b.spinner.stop();var d=new RevisionDialog(b,a,c);b.showDialog(d.container,
|
|
|
|
|
640,480,!0,!0);d.init()}),mxUtils.bind(this,function(a){b.handleError(a)})):b.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});b.actions.addAction("createRevision",function(){b.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");l=b.actions.addAction("synchronize",function(){b.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(l.label=mxResources.get("refresh"));b.actions.addAction("upload...",function(){var a=
|
|
|
|
|
b.getCurrentFile();null!=a&&(window.drawdata=b.getFileData(),a=null!=a.getTitle()?a.getTitle():b.defaultFilename,b.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(b.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(a),null,!0))});"undefined"!==typeof MathJax&&(l=b.actions.addAction("mathematicalTypesetting",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.mathEnabled=!b.isMathEnabled();g.model.execute(a)}),l.setToggleAction(!0),
|
|
|
|
|
l.setSelectedCallback(function(){return b.isMathEnabled()}),l.isEnabled=f);isLocalStorage&&(l=b.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),l.setToggleAction(!0),l.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var p=b.actions.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});p.setToggleAction(!0);p.setSelectedCallback(function(){return p.isEnabled()&&b.editor.autosave});
|
|
|
|
|
b.actions.addAction("editGeometry...",function(){for(var a=g.getSelectionCells(),c=[],d=0;d<a.length;d++)g.getModel().isVertex(a[d])&&c.push(a[d]);0<c.length&&(a=new EditGeometryDialog(b,c),b.showDialog(a.container,200,270,!0,!0),a.init())},null,null,Editor.ctrlKey+"+Shift+M");var u=null;b.actions.addAction("copyStyle",function(){g.isEnabled()&&!g.isSelectionEmpty()&&(u=g.copyStyle(g.getSelectionCell()))},null,null,Editor.ctrlKey+"+Shift+C");b.actions.addAction("pasteStyle",function(){g.isEnabled()&&
|
|
|
|
|
!g.isSelectionEmpty()&&null!=u&&g.pasteStyle(u,g.getSelectionCells())},null,null,Editor.ctrlKey+"+Shift+V");b.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!b.isOffline()){var a=new BackgroundImageDialog(b,function(a){b.setBackgroundImage(a)});b.showDialog(a.container,320,170,!0,!0);a.init()}}));b.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),
|
|
|
|
|
"https://desk.draw.io/support/solutions/articles/16000067785",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportSvg(a/100,c,d,e,f,g,k,!l,!1,n,q)}),!0,null,"svg")}));b.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://desk.draw.io/support/solutions/articles/16000067785",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,q){a=parseInt(a);
|
|
|
|
|
!isNaN(a)&&0<a&&b.exportImage(a/100,c,d,e,f,k,!l,m,null,p,null,q)}),!0,!0,"png"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile(c?"xmlpng":"png",null,null,a,null,null,d,e,f)}),!1,!0)}));b.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://desk.draw.io/support/solutions/articles/16000067785",
|
|
|
|
|
mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,!1,d,e,!1,k,!l,!1,"jpeg",p,null,q)}),!0,!1,"jpeg"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile("jpeg",null,null,a,null,null,null,e,f)}),!0,!0)}));l=b.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){g.setShadowVisible(!g.shadowVisible)}));l.setToggleAction(!0);
|
|
|
|
|
l.setSelectedCallback(function(){return g.shadowVisible});b.actions.put("about",new Action(mxResources.get("about")+" "+EditorUi.VERSION+"...",function(){b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.alert(b.editor.appName+" "+EditorUi.VERSION):b.openLink("https://www.diagrams.net/")}));b.actions.addAction("support...",function(){b.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});b.actions.addAction("exportOptionsDisabled...",function(){b.handleError({message:mxResources.get("exportOptionsDisabledDetails")},
|
|
|
|
|
mxResources.get("exportOptionsDisabled"))});b.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):b.openLink("shortcuts.svg")});b.actions.addAction("feedback...",function(){var a=new FeedbackDialog(b);b.showDialog(a.container,610,360,!0,!1);a.init()});b.actions.addAction("quickStart...",function(){b.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});
|
|
|
|
|
b.actions.addAction("forkme",function(){b.openLink("https://github.com/jgraph/drawio")}).label="Fork me on GitHub...";b.actions.addAction("downloadDesktop...",function(){b.openLink("https://get.diagrams.net/")});l=b.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(b,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",
|
|
|
|
|
function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));l=b.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(b,document.body.offsetWidth-300,110,240,155),
|
|
|
|
|
this.findWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));b.actions.put("exportVsdx",
|
|
|
|
|
new Action(mxResources.get("formatVsdx")+" (beta)...",function(){b.exportVisio()}));isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&b.actions.addAction("configuration...",function(){var a=localStorage.getItem(".configuration"),a=new TextareaDialog(b,mxResources.get("configuration")+":",null!=a?JSON.stringify(JSON.parse(a),null,2):"",function(a){if(null!=a)try{if(0<a.length){var c=JSON.parse(a);localStorage.setItem(".configuration",JSON.stringify(c))}else localStorage.removeItem(".configuration");
|
|
|
|
|
"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);mxClient.IS_SVG||b.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(a){return"file"!=a}));b.actions.addAction("new...",function(){var a=b.isOffline(),c=new NewDialog(b,a,!(b.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));b.showDialog(c.container,a?350:620,a?70:440,!0,!0,function(a){a&&null==b.getCurrentFile()&&
|
|
|
|
|
b.showSplash()});c.init()});b.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var a=new NewDialog(b,null,!1,function(a){b.hideDialog();if(null!=a){var c=b.editor.graph.getFreeInsertPoint();g.setSelectionCells(b.importXml(a,Math.max(c.x,20),Math.max(c.y,20),!0));g.scrollCellToVisible(g.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));b.showDialog(a.container,620,440,!0,!0)})).isEnabled=f;var l=b.actions.addAction("points",
|
|
|
|
|
function(){b.editor.graph.view.setUnit(mxConstants.POINTS)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.POINTS});l=b.actions.addAction("inches",function(){b.editor.graph.view.setUnit(mxConstants.INCHES)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.graph.view.unit==mxConstants.INCHES});l=b.actions.addAction("millimeters",function(){b.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.graph.view.unit==
|
|
|
|
|
mxConstants.MILLIMETERS});this.put("units",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["points","millimeters"],b)})));l=b.actions.addAction("ruler",function(){mxSettings.setRulerOn(!mxSettings.isRulerOn());mxSettings.save();null!=b.ruler?(b.ruler.destroy(),b.ruler=null):b.ruler=new mxDualRuler(b,b.editor.graph.view.unit);b.refresh()});l.setEnabled(b.canvasSupported&&9!=document.documentMode);l.setToggleAction(!0);l.setSelectedCallback(function(){return null!=b.ruler});b.actions.addAction("properties...",
|
|
|
|
|
function(){var a=new FilePropertiesDialog(b);b.showDialog(a.container,320,120,!0,!0);a.init()}).isEnabled=f;window.mxFreehand&&(b.actions.put("insertFreehand",new Action(mxResources.get("freehand")+"...",function(a){g.isEnabled()&&(null==this.freehandWindow&&(this.freehandWindow=new FreehandWindow(b,document.body.offsetWidth-420,102,176,104)),g.freehand.isDrawing()?g.freehand.stopDrawing():g.freehand.startDrawing(),this.freehandWindow.window.setVisible(g.freehand.isDrawing()))})).isEnabled=function(){return f()&&
|
|
|
|
|
mxClient.IS_SVG});b.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var a=document.createElement("div");a.style.whiteSpace="nowrap";var c=null==b.pages||1>=b.pages.length,d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatXml"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";a.appendChild(d);var e=b.addCheckbox(a,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),f=b.addCheckbox(a,mxResources.get("compressed"),
|
|
|
|
|
!0),k=b.addCheckbox(a,mxResources.get("allPages"),!c,c);k.style.marginBottom="16px";mxEvent.addListener(e,"change",function(){e.checked?k.setAttribute("disabled","disabled"):k.removeAttribute("disabled")});a=new CustomDialog(b,a,mxUtils.bind(this,function(){b.downloadFile("xml",!f.checked,null,!e.checked,c||!k.checked)}),null,mxResources.get("export"));b.showDialog(a.container,300,180,!0,!0)}));b.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){b.showPublishLinkDialog(mxResources.get("url"),
|
|
|
|
|
!0,null,null,function(a,c,d,e,f,g){a=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,null,!0));b.showDialog(a.container,440,240,!0,!0);a.init()})}));b.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("export"),null,a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e,f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d=
|
|
|
|
|
b.getBaseFilename(k),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+a+"\n"+c+"\n</body>\n</html>";b.saveData(d+".html","html",e,"text/html")}))})})}));b.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(EditorUi.isElectronApp||!b.isOffline()&&!b.printPdfExport){var a=null==b.pages||1>=b.pages.length,c=document.createElement("div");
|
|
|
|
|
c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatPdf"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(d);var e=function(){f!=this&&this.checked?(m.removeAttribute("disabled"),m.checked=!g.pageVisible):(m.setAttribute("disabled","disabled"),m.checked=!1)},d=180;if(b.pdfPageExport&&!a){var f=b.addRadiobox(c,"pages",mxResources.get("allPages"),!0),k=b.addRadiobox(c,"pages",mxResources.get("currentPage"),
|
|
|
|
|
!1),l=b.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),m=b.addCheckbox(c,mxResources.get("crop"),!1,!0),n=b.addCheckbox(c,mxResources.get("grid"),!1,!1);mxEvent.addListener(f,"change",e);mxEvent.addListener(k,"change",e);mxEvent.addListener(l,"change",e);d+=60}else l=b.addCheckbox(c,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),m=b.addCheckbox(c,mxResources.get("crop"),!g.pageVisible||!b.pdfPageExport,!b.pdfPageExport),n=b.addCheckbox(c,mxResources.get("grid"),
|
|
|
|
|
!1,!1),b.pdfPageExport||mxEvent.addListener(l,"change",e);var p=null,q=null;mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=b.getServiceName()||(q=b.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),p=b.addCheckbox(c,mxResources.get("transparentBackground"),!1),d+=60);c=new CustomDialog(b,c,mxUtils.bind(this,function(){b.downloadFile("pdf",null,null,!l.checked,a?!0:!f.checked,!m.checked,null!=p&&p.checked,null,null,n.checked,null!=q&&q.checked)}),null,mxResources.get("export"));
|
|
|
|
|
b.showDialog(c.container,300,d,!0,!0)}else b.showDialog((new PrintDialog(b,mxResources.get("formatPdf"))).container,360,null!=b.pages&&1<b.pages.length&&(b.editor.editable||"1"!=urlParams["hide-pages"])?450:370,!0,!0)}));b.actions.addAction("open...",function(){b.pickFile()});b.actions.addAction("close",function(){function a(){null!=c&&c.removeDraft();b.fileLoaded(null)}var c=b.getCurrentFile();null!=c&&c.isModified()?b.confirm(mxResources.get("allChangesLost"),null,a,mxResources.get("cancel"),mxResources.get("discardChanges")):
|
|
|
|
|
a()});b.actions.addAction("editShape...",mxUtils.bind(this,function(){g.getSelectionCells();if(1==g.getSelectionCount()){var a=g.getSelectionCell(),c=g.view.getState(a);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())}}));b.actions.addAction("revisionHistory...",function(){b.isRevisionHistorySupported()?b.spinner.spin(document.body,mxResources.get("loading"))&&b.getRevisions(mxUtils.bind(this,
|
|
|
|
|
function(a,c){b.spinner.stop();var d=new RevisionDialog(b,a,c);b.showDialog(d.container,640,480,!0,!0);d.init()}),mxUtils.bind(this,function(a){b.handleError(a)})):b.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});b.actions.addAction("createRevision",function(){b.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");l=b.actions.addAction("synchronize",function(){b.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&
|
|
|
|
|
(l.label=mxResources.get("refresh"));b.actions.addAction("upload...",function(){var a=b.getCurrentFile();null!=a&&(window.drawdata=b.getFileData(),a=null!=a.getTitle()?a.getTitle():b.defaultFilename,b.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(b.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(a),null,!0))});"undefined"!==typeof MathJax&&(l=b.actions.addAction("mathematicalTypesetting",function(){var a=new ChangePageSetup(b);a.ignoreColor=
|
|
|
|
|
!0;a.ignoreImage=!0;a.mathEnabled=!b.isMathEnabled();g.model.execute(a)}),l.setToggleAction(!0),l.setSelectedCallback(function(){return b.isMathEnabled()}),l.isEnabled=f);isLocalStorage&&(l=b.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),l.setToggleAction(!0),l.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var p=b.actions.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});
|
|
|
|
|
p.setToggleAction(!0);p.setSelectedCallback(function(){return p.isEnabled()&&b.editor.autosave});b.actions.addAction("editGeometry...",function(){for(var a=g.getSelectionCells(),c=[],d=0;d<a.length;d++)g.getModel().isVertex(a[d])&&c.push(a[d]);0<c.length&&(a=new EditGeometryDialog(b,c),b.showDialog(a.container,200,270,!0,!0),a.init())},null,null,Editor.ctrlKey+"+Shift+M");var u=null;b.actions.addAction("copyStyle",function(){g.isEnabled()&&!g.isSelectionEmpty()&&(u=g.copyStyle(g.getSelectionCell()))},
|
|
|
|
|
null,null,Editor.ctrlKey+"+Shift+C");b.actions.addAction("pasteStyle",function(){g.isEnabled()&&!g.isSelectionEmpty()&&null!=u&&g.pasteStyle(u,g.getSelectionCells())},null,null,Editor.ctrlKey+"+Shift+V");b.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!b.isOffline()){var a=new BackgroundImageDialog(b,function(a){b.setBackgroundImage(a)});b.showDialog(a.container,320,170,!0,!0);a.init()}}));b.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+
|
|
|
|
|
"...",function(){b.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://desk.draw.io/support/solutions/articles/16000067785",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportSvg(a/100,c,d,e,f,g,k,!l,!1,n,q)}),!0,null,"svg")}));b.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://desk.draw.io/support/solutions/articles/16000067785",
|
|
|
|
|
mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,c,d,e,f,k,!l,m,null,p,null,q)}),!0,!0,"png"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile(c?"xmlpng":"png",null,null,a,null,null,d,e,f)}),!1,!0)}));b.actions.put("exportJpg",new Action(mxResources.get("formatJpg")+"...",function(){b.isExportToCanvas()?b.showExportDialog(mxResources.get("image"),
|
|
|
|
|
!1,mxResources.get("export"),"https://desk.draw.io/support/solutions/articles/16000067785",mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,q){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,!1,d,e,!1,k,!l,!1,"jpeg",p,null,q)}),!0,!1,"jpeg"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile("jpeg",null,null,a,null,null,null,e,f)}),!0,!0)}));l=b.actions.put("shadowVisible",new Action(mxResources.get("shadow"),
|
|
|
|
|
function(){g.setShadowVisible(!g.shadowVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return g.shadowVisible});b.actions.put("about",new Action(mxResources.get("about")+" "+EditorUi.VERSION+"...",function(){b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.alert(b.editor.appName+" "+EditorUi.VERSION):b.openLink("https://www.diagrams.net/")}));b.actions.addAction("support...",function(){b.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});b.actions.addAction("exportOptionsDisabled...",
|
|
|
|
|
function(){b.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});b.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):b.openLink("shortcuts.svg")});b.actions.addAction("feedback...",function(){var a=new FeedbackDialog(b);b.showDialog(a.container,610,360,!0,!1);a.init()});b.actions.addAction("quickStart...",
|
|
|
|
|
function(){b.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});b.actions.addAction("forkme",function(){b.openLink("https://github.com/jgraph/drawio")}).label="Fork me on GitHub...";b.actions.addAction("downloadDesktop...",function(){b.openLink("https://get.diagrams.net/")});l=b.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(b,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("tags"))}),
|
|
|
|
|
this.tagsWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));l=b.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(b,
|
|
|
|
|
document.body.offsetWidth-300,110,240,155),this.findWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));
|
|
|
|
|
b.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){b.exportVisio()}));isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&b.actions.addAction("configuration...",function(){var a=localStorage.getItem(".configuration"),a=new TextareaDialog(b,mxResources.get("configuration")+":",null!=a?JSON.stringify(JSON.parse(a),null,2):"",function(a){if(null!=a)try{if(0<a.length){var c=JSON.parse(a);localStorage.setItem(".configuration",JSON.stringify(c))}else localStorage.removeItem(".configuration");
|
|
|
|
|
b.hideDialog();b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}},null,null,null,null,null,!0,null,null,"https://desk.draw.io/support/solutions/articles/16000058316",EditorUi.isElectronApp?null:[[mxResources.get("reset"),function(a,c){b.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(".configuration"),localStorage.removeItem(".drawio-config"),localStorage.removeItem(".mode"),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}})}],
|
|
|
|
|
[mxResources.get("link"),function(a,c){if(0<c.value.length)try{var d=JSON.parse(c.value),e=window.location.protocol+"//"+window.location.host+"/"+b.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(d)),f=new EmbedDialog(b,e);b.showDialog(f.container,440,240,!0);f.init()}catch(G){b.handleError(G)}else b.handleError({message:mxResources.get("invalidInput")})}]]);a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!1);a.init()});if(mxClient.IS_CHROMEAPP||
|
|
|
|
|
isLocalStorage){this.put("language",new Menu(mxUtils.bind(this,function(a,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=a.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);b.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&a.addCheckmark(f,Editor.checkmarkImage));
|
|
|
|
@ -11289,12 +11296,12 @@ function(a,c){this.model.beginUpdate();try{var b=[];this.traverse(c,!0,mxUtils.b
|
|
|
|
|
e(a)}function c(a){var b=!1;null!=a&&(b="1"==q.getCurrentCellStyle(a).treeMoving);return b}function e(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),b="tree"==(null!=b?b.style:q.getCellStyle(a)).containerType);return b}function m(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function n(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.view.getState(b[0]),
|
|
|
|
|
null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function d(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=q.cloneCells([d[0],a]);q.model.setTerminal(e[0],
|
|
|
|
|
q.model.getTerminal(d[0],!0),!0);var f=n(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;q.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=q.view.getState(a),l=q.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-
|
|
|
|
|
10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=q.getOutgoingEdges(q.model.getTerminal(d[0],!0));if(null!=p){for(var t=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,v=g=d=0;v<p.length;v++){var u=q.model.getTerminal(p[v],!1);if(f==n(u)){var A=q.view.getState(u);u!=a&&null!=A&&(t&&b!=A.getCenterX()<k.getCenterX()||!t&&b!=A.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,A)&&(d=10+Math.max(d,(Math.min(m.x+m.width,A.x+A.width)-Math.max(m.x,A.x))/l),g=10+Math.max(g,
|
|
|
|
|
(Math.min(m.y+m.height,A.y+A.height)-Math.max(m.y,A.y))/l))}}t?g=0:d=0;for(v=0;v<p.length;v++)if(u=q.model.getTerminal(p[v],!1),f==n(u)&&(A=q.view.getState(u),u!=a&&null!=A&&(t&&b!=A.getCenterX()<k.getCenterX()||!t&&b!=A.getCenterY()<k.getCenterY()))){var x=[];q.traverse(A.cell,!0,function(a,b){null!=b&&x.push(b);x.push(a);return!0});q.moveCells(x,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function k(a){q.model.beginUpdate();try{var b=n(a),c=q.getIncomingEdges(a),
|
|
|
|
|
10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=q.getOutgoingEdges(q.model.getTerminal(d[0],!0));if(null!=p){for(var v=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,t=g=d=0;t<p.length;t++){var u=q.model.getTerminal(p[t],!1);if(f==n(u)){var A=q.view.getState(u);u!=a&&null!=A&&(v&&b!=A.getCenterX()<k.getCenterX()||!v&&b!=A.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,A)&&(d=10+Math.max(d,(Math.min(m.x+m.width,A.x+A.width)-Math.max(m.x,A.x))/l),g=10+Math.max(g,
|
|
|
|
|
(Math.min(m.y+m.height,A.y+A.height)-Math.max(m.y,A.y))/l))}}v?g=0:d=0;for(t=0;t<p.length;t++)if(u=q.model.getTerminal(p[t],!1),f==n(u)&&(A=q.view.getState(u),u!=a&&null!=A&&(v&&b!=A.getCenterX()<k.getCenterX()||!v&&b!=A.getCenterY()<k.getCenterY()))){var B=[];q.traverse(A.cell,!0,function(a,b){null!=b&&B.push(b);B.push(a);return!0});q.moveCells(B,(b?1:-1)*d,(b?1:-1)*g)}}}return q.addCells(e,c)}finally{q.model.endUpdate()}}function k(a){q.model.beginUpdate();try{var b=n(a),c=q.getIncomingEdges(a),
|
|
|
|
|
d=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],d[1],!1);q.model.setTerminal(d[0],d[1],!0);q.model.setTerminal(d[0],a,!1);var e=q.model.getParent(a),f=e.geometry,g=[];q.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);q.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&
|
|
|
|
|
(l=0);q.moveCells(g,k,l);return q.addCells(d,e)}finally{q.model.endUpdate()}}function l(a,b){q.model.beginUpdate();try{var c=q.model.getParent(a),d=q.getIncomingEdges(a),e=n(a);0==d.length&&(d=[q.createEdge(c,null,"",null,null,q.createCurrentEdgeStyle())],e=b);var f=q.cloneCells([d[0],a]);q.model.setTerminal(f[0],a,!0);if(null==q.model.getTerminal(f[0],!1)){q.model.setTerminal(f[0],f[1],!1);var g=q.getCellStyle(f[1]).newEdgeStyle;if(null!=g)try{var k=JSON.parse(g),l;for(l in k)q.setCellStyles(l,k[l],
|
|
|
|
|
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&q.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(P){}}var d=q.getOutgoingEdges(a),m=c.geometry,g=[];q.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var p=q.model.getTerminal(d[k],!1);null!=p&&g.push(p)}var t=q.view.getBounds(g),v=q.view.translate,u=q.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==t?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
|
|
|
|
|
2:(t.x+t.width)/u-v.x-m.x+10,f[1].geometry.y+=f[1].geometry.height-m.y+40):e==mxConstants.DIRECTION_NORTH?(f[1].geometry.x=null==t?a.geometry.x+(a.geometry.width-f[1].geometry.width)/2:(t.x+t.width)/u-v.x+-m.x+10,f[1].geometry.y-=f[1].geometry.height+m.y+40):(f[1].geometry.x=e==mxConstants.DIRECTION_WEST?f[1].geometry.x-(f[1].geometry.width+m.x+40):f[1].geometry.x+(f[1].geometry.width-m.x+40),f[1].geometry.y=null==t?a.geometry.y+(a.geometry.height-f[1].geometry.height)/2:(t.y+t.height)/u-v.y+-m.y+
|
|
|
|
|
[f[0]]),"edgeStyle"==l&&"elbowEdgeStyle"==k[l]&&q.setCellStyles("elbow",e==mxConstants.DIRECTION_SOUTH||e==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[f[0]])}catch(P){}}var d=q.getOutgoingEdges(a),m=c.geometry,g=[];q.view.currentRoot==c&&(m=new mxRectangle);for(k=0;k<d.length;k++){var p=q.model.getTerminal(d[k],!1);null!=p&&g.push(p)}var v=q.view.getBounds(g),t=q.view.translate,u=q.view.scale;e==mxConstants.DIRECTION_SOUTH?(f[1].geometry.x=null==v?a.geometry.x+(a.geometry.width-f[1].geometry.width)/
|
|
|
|
|
2:(v.x+v.width)/u-t.x-m.x+10,f[1].geometry.y+=f[1].geometry.height-m.y+40):e==mxConstants.DIRECTION_NORTH?(f[1].geometry.x=null==v?a.geometry.x+(a.geometry.width-f[1].geometry.width)/2:(v.x+v.width)/u-t.x+-m.x+10,f[1].geometry.y-=f[1].geometry.height+m.y+40):(f[1].geometry.x=e==mxConstants.DIRECTION_WEST?f[1].geometry.x-(f[1].geometry.width+m.x+40):f[1].geometry.x+(f[1].geometry.width-m.x+40),f[1].geometry.y=null==v?a.geometry.y+(a.geometry.height-f[1].geometry.height)/2:(v.y+v.height)/u-t.y+-m.y+
|
|
|
|
|
10);return q.addCells(f,c)}finally{q.model.endUpdate()}}function p(a,b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=n(a),d=b==mxConstants.DIRECTION_EAST||
|
|
|
|
|
b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=b?t.actions.get("selectParent").funct():c==b?(d=q.getOutgoingEdges(a),null!=d&&0<d.length&&q.setSelectionCell(q.model.getTerminal(d[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(d=p(q.model.getTerminal(c[0],!0),d,a),c=q.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&q.setSelectionCell(d[c].cell)))))}
|
|
|
|
|
var t=this,q=t.editor.graph,v=q.getModel(),y=t.menus.createPopupMenu;t.menus.createPopupMenu=function(b,c,d){y.apply(this,arguments);if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);b.addSeparator();0<e.length&&(a(q.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));a(q.getSelectionCell())&&(b.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(b,["selectSiblings","selectParent"],null,d))}};
|
|
|
|
@ -11303,12 +11310,12 @@ t.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelect
|
|
|
|
|
c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+D");var x=q.removeCells;q.removeCells=function(b,c){c=null!=c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];q.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=q.getIncomingEdges(b[f]),
|
|
|
|
|
b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return x.apply(this,arguments)};t.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var C=q.duplicateCells;q.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=C.call(this,
|
|
|
|
|
b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(b[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var z=q.moveCells;q.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(a(b[p])||
|
|
|
|
|
q.model.isEdge(b[p])&&null==q.model.getTerminal(b[p],!0)){f=q.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var t=q.getIncomingEdges(b[0]);if(0<t.length){var v=q.view.getState(q.model.getTerminal(t[0],!0));if(null!=v){var u=q.view.getState(m);null!=u&&(c=(u.getCenterX()-v.getCenterX())/q.view.scale,d=(u.getCenterY()-v.getCenterY())/q.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(p=0;p<l.length;p++)if(this.model.isEdge(l[p]))a(m)&&
|
|
|
|
|
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(t=q.getIncomingEdges(b[p]),0<t.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],m,!0);else if(0==q.getIncomingEdges(l[p]).length){n=m;if(null==n||n==q.model.getParent(b[p]))n=q.model.getTerminal(t[0],!0);e=this.cloneCell(t[0]);this.addEdge(e,q.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var B=t.sidebar.dropAndConnect;
|
|
|
|
|
q.model.isEdge(b[p])&&null==q.model.getTerminal(b[p],!0)){f=q.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var v=q.getIncomingEdges(b[0]);if(0<v.length){var t=q.view.getState(q.model.getTerminal(v[0],!0));if(null!=t){var u=q.view.getState(m);null!=u&&(c=(u.getCenterX()-t.getCenterX())/q.view.scale,d=(u.getCenterY()-t.getCenterY())/q.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(p=0;p<l.length;p++)if(this.model.isEdge(l[p]))a(m)&&
|
|
|
|
|
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(v=q.getIncomingEdges(b[p]),0<v.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==q.getIncomingEdges(l[p]).length){n=m;if(null==n||n==q.model.getParent(b[p]))n=q.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,q.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var B=t.sidebar.dropAndConnect;
|
|
|
|
|
t.sidebar.dropAndConnect=function(b,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=B.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:t.actions.get("selectChildren"),84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},D=
|
|
|
|
|
t.onKeyDown;t.onKeyDown=function(b){try{if(q.isEnabled()&&!q.isEditing()&&a(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==b.which?c=mxEvent.isShiftDown(b)?k(q.getSelectionCell()):l(q.getSelectionCell()):13==b.which&&(c=d(q.getSelectionCell(),!mxEvent.isShiftDown(b))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(q.view.getState(q.getSelectionCell())),
|
|
|
|
|
q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var e=A[b.keyCode];null!=e&&(e.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(u(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
|
|
|
|
|
mxEvent.consume(b))}}catch(O){t.handleError(O)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var E=q.connectVertex;q.connectVertex=function(b,c,e,f,g,m,p){var t=q.getIncomingEdges(b);if(a(b)){var v=n(b),u=v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST,A=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return v==c||0==t.length?l(b,c):u==A?k(b):d(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return E.apply(this,arguments)};q.getSubtree=function(b){var d=
|
|
|
|
|
mxEvent.consume(b))}}catch(O){t.handleError(O)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var E=q.connectVertex;q.connectVertex=function(b,c,e,f,g,m,p){var v=q.getIncomingEdges(b);if(a(b)){var t=n(b),u=t==mxConstants.DIRECTION_EAST||t==mxConstants.DIRECTION_WEST,A=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return t==c||0==v.length?l(b,c):u==A?k(b):d(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return E.apply(this,arguments)};q.getSubtree=function(b){var d=
|
|
|
|
|
[b];!c(b)&&!a(b)||m(b)||q.traverse(b,!0,function(a,b){null!=b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);(c(this.state.cell)||a(this.state.cell))&&!m(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position=
|
|
|
|
|
"absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;t.hoverIcons.reset();
|
|
|
|
|
mxEvent.consume(a)})))};var G=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(a){H.apply(this,arguments);null!=this.moveHandle&&
|
|
|
|
@ -11406,8 +11413,8 @@ b.x-q.container.scrollLeft):d+(c?e.y*a-q.container.scrollTop:e.x*a-q.container.s
|
|
|
|
|
a&&(x=m*Math.floor(1/a/2)*(k.unit==mxConstants.MILLIMETERS?2:1));m=null;b=f?Math.min(e+(c?b.height:b.width),c?u.height:u.width):c?u.height:u.width;if(f)if(t.fillStyle=l.outBkgClr,c){var y=e-d;0<y&&t.fillRect(0,d,d,y);b<u.height&&t.fillRect(0,b,d,u.height)}else y=e-d,0<y&&t.fillRect(d,0,y,d),b<u.width&&t.fillRect(b,0,u.width,d);t.fillStyle=l.fontClr;for(f=f?e:e%(x*a);f<=b;f+=x*a)if(y=Math.round((f-e)/a/x),!(f<d||y==m)){m=y;var C=null;0==y%p&&(C=k.formatText(g+y*x)+"");c?v(d-n[Math.abs(y)%p],f,d,f,
|
|
|
|
|
C):v(f,d-n[Math.abs(y)%p],f,d,C)}t.lineWidth=1;v(c?0:d,c?d:0,d,d);t.fillStyle=l.cornerClr;t.fillRect(0,0,d,d)},x=-1,C=function(){null!=m?(null!=n&&n(x),x=m(y)):y()};this.drawRuler=C;this.sizeListener=e=f(function(){var a=q.container;c?(a=a.offsetHeight+d,u.height!=a&&(u.height=a,p.style.height=a+"px",C())):(a=a.offsetWidth+d,u.width!=a&&(u.width=a,p.style.width=a+"px",C()))},10);this.pageListener=function(){C()};this.scrollListener=b=f(function(){var a=c?q.container.scrollTop:q.container.scrollLeft;
|
|
|
|
|
k.lastScroll!=a&&(k.lastScroll=a,C())},10);this.unitListener=function(a,b){k.setUnit(b.getProperty("unit"))};q.addListener(mxEvent.SIZE,e);q.container.addEventListener("scroll",b);q.view.addListener("unitChanged",this.unitListener);a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){l=a;p.style.background=l.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=
|
|
|
|
|
function(a,b,e,f){var g;if(c&&4<a.height||!c&&4<a.width){if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3)}catch(L){}g=k.origGuideMove.apply(this,arguments);try{var m,n,p,q,u,x,y,z,A;t.lineWidth=.5;t.strokeStyle=l.guideClr;t.setLineDash([2]);c?(n=a.y+g.y+d-this.graph.container.scrollTop,m=0,u=n+a.height/2,q=d/2,z=n+a.height,
|
|
|
|
|
y=0,p=t.getImageData(m,n-1,d,3),v(m,n,d,n),n--,x=t.getImageData(q,u-1,d,3),v(q,u,d,u),u--,A=t.getImageData(y,z-1,d,3),v(y,z,d,z),z--):(n=0,m=a.x+g.x+d-this.graph.container.scrollLeft,u=d/2,q=m+a.width/2,z=0,y=m+a.width,p=t.getImageData(m-1,n,3,d),v(m,n,m,d),m--,x=t.getImageData(q-1,u,3,d),v(q,u,q,d),q--,A=t.getImageData(y-1,z,3,d),v(y,z,y,d),y--);if(null==k.guidePart||k.guidePart.x1!=m||k.guidePart.y1!=n)k.guidePart={imgData1:p,x1:m,y1:n,imgData2:x,x2:q,y2:u,imgData3:A,x3:y,y3:z}}catch(L){}}else g=
|
|
|
|
|
function(a,b,e,f){var g;if(c&&4<a.height||!c&&4<a.width){if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3)}catch(L){}g=k.origGuideMove.apply(this,arguments);try{var m,n,p,q,u,x,y,z,C;t.lineWidth=.5;t.strokeStyle=l.guideClr;t.setLineDash([2]);c?(n=a.y+g.y+d-this.graph.container.scrollTop,m=0,u=n+a.height/2,q=d/2,z=n+a.height,
|
|
|
|
|
y=0,p=t.getImageData(m,n-1,d,3),v(m,n,d,n),n--,x=t.getImageData(q,u-1,d,3),v(q,u,d,u),u--,C=t.getImageData(y,z-1,d,3),v(y,z,d,z),z--):(n=0,m=a.x+g.x+d-this.graph.container.scrollLeft,u=d/2,q=m+a.width/2,z=0,y=m+a.width,p=t.getImageData(m-1,n,3,d),v(m,n,m,d),m--,x=t.getImageData(q-1,u,3,d),v(q,u,q,d),q--,C=t.getImageData(y-1,z,3,d),v(y,z,y,d),y--);if(null==k.guidePart||k.guidePart.x1!=m||k.guidePart.y1!=n)k.guidePart={imgData1:p,x1:m,y1:n,imgData2:x,x2:q,y2:u,imgData3:C,x3:y,y3:z}}catch(L){}}else g=
|
|
|
|
|
k.origGuideMove.apply(this,arguments);return g};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=k.origGuideDestroy.apply(this,arguments);if(null!=k.guidePart)try{t.putImageData(k.guidePart.imgData1,k.guidePart.x1,k.guidePart.y1),t.putImageData(k.guidePart.imgData2,k.guidePart.x2,k.guidePart.y2),t.putImageData(k.guidePart.imgData3,k.guidePart.x3,k.guidePart.y3),k.guidePart=null}catch(B){}return a}}mxRuler.prototype.RULER_THICKNESS=14;
|
|
|
|
|
mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()};mxRuler.prototype.formatText=function(a){switch(this.unit){case mxConstants.POINTS:return Math.round(a);case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}};
|
|
|
|
|
mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener("unitChanged",this.unitListener);this.ui.removeListener("pageViewChanged",this.pageListener);this.ui.removeListener("pageScaleChanged",this.pageListener);this.ui.removeListener("pageFormatChanged",
|
|
|
|
|