|
|
|
@ -2003,11 +2003,11 @@ Editor.prototype.setFilename=function(a){this.filename=a};
|
|
|
|
|
Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,e){var d=a.getSelectionCellsForChanges(e.getProperty("edit").changes);a.getModel();for(var k=[],t=0;t<d.length;t++)null!=a.view.getState(d[t])&&k.push(d[t]);a.setSelectionCells(k)};
|
|
|
|
|
b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};
|
|
|
|
|
OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)};
|
|
|
|
|
function Dialog(a,b,e,d,k,m,q,t,v,A){var c=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(c=80);e+=c;d+=c;var f=e,g=d,n=mxUtils.getDocumentSize(),l=n.height,p=Math.max(1,Math.round((n.width-e-64)/2)),z=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=null!=document.body?Math.min(e,document.body.scrollWidth-64):e;d=Math.min(d,l-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&(this.bg=a.createDiv("background"),
|
|
|
|
|
this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=l+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));n=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=n.x+"px";this.bg.style.top=n.y+"px";p+=n.x;z+=n.y;k&&document.body.appendChild(this.bg);var x=a.createDiv(v?"geTransDialog":"geDialog");k=this.getPosition(p,z,e,d);p=k.x;z=k.y;x.style.width=
|
|
|
|
|
e+"px";x.style.height=d+"px";x.style.left=p+"px";x.style.top=z+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!t&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=z+14+"px",m.style.left=p+e+38-c+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})),
|
|
|
|
|
document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=A){var n=A();null!=n&&(f=e=n.w,g=d=n.h)}n=mxUtils.getDocumentSize();l=n.height;this.bg.style.height=l+"px";p=Math.max(1,Math.round((n.width-e-64)/2));z=Math.max(1,Math.round((l-d-a.footerHeight)/3));e=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(g,l-64);n=this.getPosition(p,
|
|
|
|
|
z,e,d);p=n.x;z=n.y;x.style.left=p+"px";x.style.top=z+"px";x.style.width=e+"px";x.style.height=d+"px";!t&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=z+14+"px",this.dialogImg.style.left=p+e+38-c+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=q;this.container=x;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1;
|
|
|
|
|
function Dialog(a,b,e,d,k,m,q,t,v,A){var c=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(c=80);e+=c;d+=c;var f=e,g=d,n=mxUtils.getDocumentSize(),l=n.height,p=Math.max(1,Math.round((n.width-e-64)/2)),y=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=null!=document.body?Math.min(e,document.body.scrollWidth-64):e;d=Math.min(d,l-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&(this.bg=a.createDiv("background"),
|
|
|
|
|
this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=l+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));n=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=n.x+"px";this.bg.style.top=n.y+"px";p+=n.x;y+=n.y;k&&document.body.appendChild(this.bg);var x=a.createDiv(v?"geTransDialog":"geDialog");k=this.getPosition(p,y,e,d);p=k.x;y=k.y;x.style.width=
|
|
|
|
|
e+"px";x.style.height=d+"px";x.style.left=p+"px";x.style.top=y+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!t&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=y+14+"px",m.style.left=p+e+38-c+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})),
|
|
|
|
|
document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=A){var n=A();null!=n&&(f=e=n.w,g=d=n.h)}n=mxUtils.getDocumentSize();l=n.height;this.bg.style.height=l+"px";p=Math.max(1,Math.round((n.width-e-64)/2));y=Math.max(1,Math.round((l-d-a.footerHeight)/3));e=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(g,l-64);n=this.getPosition(p,
|
|
|
|
|
y,e,d);p=n.x;y=n.y;x.style.left=p+"px";x.style.top=y+"px";x.style.width=e+"px";x.style.height=d+"px";!t&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=y+14+"px",this.dialogImg.style.left=p+e+38-c+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=q;this.container=x;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1;
|
|
|
|
|
Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":
|
|
|
|
|
IMAGE_PATH+"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png";
|
|
|
|
|
Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+
|
|
|
|
@ -2023,7 +2023,7 @@ k.appendChild(v);mxEvent.addListener(v,"click",function(a){t.checked=!t.checked;
|
|
|
|
|
"click",function(a){A.checked=!A.checked;t.checked=!A.checked;mxEvent.consume(a)});d.appendChild(k);var c=document.createElement("input");c.setAttribute("value","1");c.setAttribute("type","number");c.setAttribute("min","1");c.setAttribute("size","4");c.setAttribute("disabled","disabled");c.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);q.appendChild(d);mxEvent.addListener(A,"change",
|
|
|
|
|
function(){A.checked?c.removeAttribute("disabled"):c.setAttribute("disabled","disabled");t.checked=!A.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var f=document.createElement("input");f.setAttribute("value","100 %");f.setAttribute("size","5");f.style.width="50px";k.appendChild(f);d.appendChild(k);q.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
|
|
|
|
|
k.style.paddingTop="20px";k.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&k.appendChild(v);if(PrintDialog.previewEnabled){var g=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});g.className="geBtn";k.appendChild(g)}g=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});g.className="geBtn gePrimaryBtn";k.appendChild(g);a.editor.cancelFirst||
|
|
|
|
|
k.appendChild(v);d.appendChild(k);q.appendChild(d);m.appendChild(q);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}};
|
|
|
|
|
k.appendChild(v);d.appendChild(k);q.appendChild(d);m.appendChild(q);this.container=m};PrintDialog.printPreview=function(a){try{if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}catch(e){}};
|
|
|
|
|
PrintDialog.createPrintPreview=function(a,b,e,d,k,m,q){b=new mxPrintPreview(a,b,e,d,k,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=q;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var t=b.writeHead;b.writeHead=function(a){t.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
|
|
|
|
|
PrintDialog.previewEnabled=!0;
|
|
|
|
|
var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(A.style.backgroundColor="",A.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(A.style.backgroundColor=c,A.style.backgroundImage="")}function e(){null==n?(g.removeAttribute("title"),g.style.fontSize="",g.innerHTML=mxResources.get("change")+"..."):(g.setAttribute("title",n.src),g.style.fontSize="11px",g.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,m,q=document.createElement("table");q.style.width=
|
|
|
|
@ -2037,10 +2037,10 @@ PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,b,d){if(d||f!=
|
|
|
|
|
e.height==d.format.height?(t.value=d.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,q.removeAttribute("checked"),q.defaultChecked=!1,q.checked=!1,a=!0):e.width==d.format.height&&e.height==d.format.width&&(t.value=d.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,q.setAttribute("checked","checked"),q.defaultChecked=!0,a=q.checked=!0));a?(v.style.display="",c.style.display="none"):(f.value=e.width/100,g.value=e.height/100,m.setAttribute("checked","checked"),
|
|
|
|
|
t.value="custom",v.style.display="none",c.style.display="")}}b="format-"+b;var m=document.createElement("input");m.setAttribute("name",b);m.setAttribute("type","radio");m.setAttribute("value","portrait");var q=document.createElement("input");q.setAttribute("name",b);q.setAttribute("type","radio");q.setAttribute("value","landscape");var t=document.createElement("select");t.style.marginBottom="8px";t.style.width="202px";var v=document.createElement("div");v.style.marginLeft="4px";v.style.width="210px";
|
|
|
|
|
v.style.height="24px";m.style.marginRight="6px";v.appendChild(m);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));v.appendChild(b);q.style.marginLeft="10px";q.style.marginRight="6px";v.appendChild(q);var A=document.createElement("span");A.style.width="100px";mxUtils.write(A,mxResources.get("landscape"));v.appendChild(A);var c=document.createElement("div");c.style.marginLeft="4px";c.style.width="210px";c.style.height="24px";var f=document.createElement("input");
|
|
|
|
|
f.setAttribute("size","7");f.style.textAlign="right";c.appendChild(f);mxUtils.write(c," in x ");var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";c.appendChild(g);mxUtils.write(c," in");v.style.display="none";c.style.display="none";for(var n={},l=PageSetupDialog.getFormats(),p=0;p<l.length;p++){var z=l[p];n[z.key]=z;var x=document.createElement("option");x.setAttribute("value",z.key);mxUtils.write(x,z.title);t.appendChild(x)}var u=!1;k();a.appendChild(t);mxUtils.br(a);
|
|
|
|
|
a.appendChild(v);a.appendChild(c);var G=e,y=function(a,b){var l=n[t.value];null!=l.format?(f.value=l.format.width/100,g.value=l.format.height/100,c.style.display="none",v.style.display=""):(v.style.display="none",c.style.display="");l=parseFloat(f.value);if(isNaN(l)||0>=l)f.value=e.width/100;l=parseFloat(g.value);if(isNaN(l)||0>=l)g.value=e.height/100;l=new mxRectangle(0,0,Math.floor(100*parseFloat(f.value)),Math.floor(100*parseFloat(g.value)));"custom"!=t.value&&q.checked&&(l=new mxRectangle(0,0,
|
|
|
|
|
l.height,l.width));b&&u||l.width==G.width&&l.height==G.height||(G=l,null!=d&&d(G))};mxEvent.addListener(b,"click",function(a){m.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(A,"click",function(a){q.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(f,"blur",y);mxEvent.addListener(f,"click",y);mxEvent.addListener(g,"blur",y);mxEvent.addListener(g,"click",y);mxEvent.addListener(q,"change",y);mxEvent.addListener(m,"change",y);mxEvent.addListener(t,"change",function(a){u="custom"==t.value;
|
|
|
|
|
y(a,!0)});y();return{set:function(a){e=a;k(null,null,!0)},get:function(){return G},widthInput:f,heightInput:g}};
|
|
|
|
|
f.setAttribute("size","7");f.style.textAlign="right";c.appendChild(f);mxUtils.write(c," in x ");var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";c.appendChild(g);mxUtils.write(c," in");v.style.display="none";c.style.display="none";for(var n={},l=PageSetupDialog.getFormats(),p=0;p<l.length;p++){var y=l[p];n[y.key]=y;var x=document.createElement("option");x.setAttribute("value",y.key);mxUtils.write(x,y.title);t.appendChild(x)}var u=!1;k();a.appendChild(t);mxUtils.br(a);
|
|
|
|
|
a.appendChild(v);a.appendChild(c);var G=e,z=function(a,b){var l=n[t.value];null!=l.format?(f.value=l.format.width/100,g.value=l.format.height/100,c.style.display="none",v.style.display=""):(v.style.display="none",c.style.display="");l=parseFloat(f.value);if(isNaN(l)||0>=l)f.value=e.width/100;l=parseFloat(g.value);if(isNaN(l)||0>=l)g.value=e.height/100;l=new mxRectangle(0,0,Math.floor(100*parseFloat(f.value)),Math.floor(100*parseFloat(g.value)));"custom"!=t.value&&q.checked&&(l=new mxRectangle(0,0,
|
|
|
|
|
l.height,l.width));b&&u||l.width==G.width&&l.height==G.height||(G=l,null!=d&&d(G))};mxEvent.addListener(b,"click",function(a){m.checked=!0;z(a);mxEvent.consume(a)});mxEvent.addListener(A,"click",function(a){q.checked=!0;z(a);mxEvent.consume(a)});mxEvent.addListener(f,"blur",z);mxEvent.addListener(f,"click",z);mxEvent.addListener(g,"blur",z);mxEvent.addListener(g,"click",z);mxEvent.addListener(q,"change",z);mxEvent.addListener(m,"change",z);mxEvent.addListener(t,"change",function(a){u="custom"==t.value;
|
|
|
|
|
z(a,!0)});z();return{set:function(a){e=a;k(null,null,!0)},get:function(){return G},widthInput:f,heightInput:g}};
|
|
|
|
|
PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:"US-Tabloid (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",
|
|
|
|
|
format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]};
|
|
|
|
|
(function(){mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph;if(null!=a.container&&!a.transparentBackground){if(a.pageVisible){var b=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var d=a.container.firstChild;null!=d&&d.nodeType!=mxConstants.NODETYPE_ELEMENT;)d=d.nextSibling;null!=d&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=
|
|
|
|
@ -2051,7 +2051,7 @@ c="url("+this.gridImage+")";var g=d=0;null!=a.view.backgroundPageShape&&(g=this.
|
|
|
|
|
b,a.container.className="geDiagramContainer geDiagramBackdrop",d.style.backgroundImage="none",d.style.backgroundColor=""):(a.container.className="geDiagramContainer",d.style.backgroundPosition=f,d.style.backgroundColor=b,d.style.backgroundImage=c)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var d=this.gridSteps*b,c=[],f=1;f<this.gridSteps;f++){var g=f*b;c.push("M 0 "+g+" L "+d+" "+g+" M "+g+" 0 L "+g+" "+d)}return'<svg width="'+
|
|
|
|
|
d+'" height="'+d+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+d+'" height="'+d+'" patternUnits="userSpaceOnUse"><path d="'+c.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+d+" 0 L 0 0 0 "+d+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var e=
|
|
|
|
|
this.view.canvas;null!=e.ownerSVGElement&&(e=e.ownerSVGElement);var c=this.gridSize*this.view.scale*this.view.gridSteps,c=-Math.round(c-mxUtils.mod(this.view.translate.x*this.view.scale+b,c))+"px "+-Math.round(c-mxUtils.mod(this.view.translate.y*this.view.scale+d,c))+"px";e.style.backgroundPosition=c}};mxGraph.prototype.updatePageBreaks=function(a,b,d){var c=this.view.scale,f=this.view.translate,g=this.pageFormat,e=c*this.pageScale,l=this.view.getBackgroundPageBounds();b=l.width;d=l.height;var p=
|
|
|
|
|
new mxRectangle(c*f.x,c*f.y,g.width*e,g.height*e),z=(a=a&&Math.min(p.width,p.height)>this.minPageBreakDist)?Math.ceil(d/p.height)-1:0,k=a?Math.ceil(b/p.width)-1:0,u=l.x+b,t=l.y+d;null==this.horizontalPageBreaks&&0<z&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?z:k,f=0;f<=c;f++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+(f+1)*p.height)),
|
|
|
|
|
new mxRectangle(c*f.x,c*f.y,g.width*e,g.height*e),y=(a=a&&Math.min(p.width,p.height)>this.minPageBreakDist)?Math.ceil(d/p.height)-1:0,k=a?Math.ceil(b/p.width)-1:0,u=l.x+b,t=l.y+d;null==this.horizontalPageBreaks&&0<y&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?y:k,f=0;f<=c;f++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+(f+1)*p.height)),
|
|
|
|
|
new mxPoint(Math.round(u),Math.round(l.y+(f+1)*p.height))]:[new mxPoint(Math.round(l.x+(f+1)*p.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(f+1)*p.width),Math.round(t))];null!=a[f]?(a[f].points=b,a[f].redraw()):(b=new mxPolyline(b,this.pageBreakColor),b.dialect=this.dialect,b.isDashed=this.pageBreakDashed,b.pointerEvents=!1,b.init(this.view.backgroundPane),b.redraw(),a[f]=b)}for(f=c;f<a.length;f++)a[f].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
|
|
|
|
|
var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,e){for(var c=0;c<d.length;c++)if(this.graph.getModel().isVertex(d[c])){var f=this.graph.getCellGeometry(d[c]);if(null!=f&&f.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,d){return this.isConnecting()?
|
|
|
|
|
!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,d=0<a.height?a.y/this.scale-this.translate.y:0,c=this.graph.pageFormat,f=this.graph.pageScale,g=c.width*f,c=c.height*f,f=Math.floor(Math.min(0,b)/g),e=Math.floor(Math.min(0,
|
|
|
|
@ -2068,14 +2068,14 @@ arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(m=!0,
|
|
|
|
|
d.panningHandler.isForcePanningEvent=function(a){return t.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var v=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return v.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||
|
|
|
|
|
mxClient.IS_SF&&mxEvent.isShiftDown(a))};var A=!1,c=null,f=null,g=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&A!=d.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==g)this.toolbar.createTextToolbar();else{for(var l=0;l<g.length;l++)this.toolbar.container.appendChild(g[l]);this.toolbar.fontMenu=
|
|
|
|
|
c;this.toolbar.sizeMenu=f}A=d.cellEditor.isContentEditing();c=a;f=e;g=b}}),l=this,p=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){p.apply(this,arguments);n();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=l.toolbar)){var b=c.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-
|
|
|
|
|
1)&&(b=b.substring(0,b.length-1));l.toolbar.setFontName(b);l.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var z=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){z.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor=
|
|
|
|
|
1)&&(b=b.substring(0,b.length-1));l.toolbar.setFontName(b);l.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var y=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){y.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor=
|
|
|
|
|
"default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(Q){}var x=d.fireMouseEvent;d.fireMouseEvent=function(a,c,b){a==mxEvent.MOUSE_DOWN&&this.container.focus();x.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=
|
|
|
|
|
this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var u="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),G="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=d.view.getState(a);if(null!=c){a=a.clone();a.style="";a=d.getCellStyle(a);var b=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(b.push(c.style[g]),f.push(g));g=d.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],l=0;l<
|
|
|
|
|
e.length;l++){var r=e[l],n=r.indexOf("=");0<=n&&(g=r.substring(0,n),r=r.substring(n+1),null!=a[g]&&"none"==r&&(b.push(r),f.push(g)))}d.getModel().isEdge(c.cell)?d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[c.cell]))}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",
|
|
|
|
|
[],"cells",[]))};var y=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),r=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],y,["opacity"],["align"],["html"]];for(a=0;a<r.length;a++)for(b=0;b<r[a].length;b++)u.push(r[a][b]);for(a=0;a<G.length;a++)0>mxUtils.indexOf(u,G[a])&&u.push(G[a]);var C=function(a,c){var b=
|
|
|
|
|
d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(n),g=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var l=g[f[e]];null!=l&&d.setCellStyles(f[e],l,a)}else for(l=0;l<a.length;l++){for(var n=a[l],p=b.getStyle(n),C=null!=p?p.split(";"):[],J=u.slice(),e=0;e<C.length;e++){var z=C[e],k=z.indexOf("=");if(0<=k){var x=z.substring(0,k),Q=mxUtils.indexOf(J,x);0<=Q&&J.splice(Q,1);for(var m=0;m<r.length;m++){var y=r[m];if(0<=mxUtils.indexOf(y,x))for(var t=
|
|
|
|
|
0;t<y.length;t++){var q=mxUtils.indexOf(J,y[t]);0<=q&&J.splice(q,1)}}}}for(var g=(f=b.isEdge(n))?d.currentEdgeStyle:d.currentVertexStyle,O=b.getStyle(n),e=0;e<J.length;e++){var x=J[e],v=g[x];null==v||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(G,x))||(O=mxUtils.setStyle(O,x,v),console.log("here",x,v))}b.setStyle(n,O)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){C(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){C(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,
|
|
|
|
|
function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));C(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var b=c.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(g=d.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=c.getProperty("keys"),l=c.getProperty("values"),e=0;e<b.length;e++){var r=0<=mxUtils.indexOf(y,b[e]);if("strokeColor"!=b[e]||null!=l[e]&&"none"!=
|
|
|
|
|
[],"cells",[]))};var z=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),r=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],z,["opacity"],["align"],["html"]];for(a=0;a<r.length;a++)for(b=0;b<r[a].length;b++)u.push(r[a][b]);for(a=0;a<G.length;a++)0>mxUtils.indexOf(u,G[a])&&u.push(G[a]);var C=function(a,c){var b=
|
|
|
|
|
d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(n),g=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var l=g[f[e]];null!=l&&d.setCellStyles(f[e],l,a)}else for(l=0;l<a.length;l++){for(var n=a[l],p=b.getStyle(n),C=null!=p?p.split(";"):[],J=u.slice(),e=0;e<C.length;e++){var y=C[e],k=y.indexOf("=");if(0<=k){var x=y.substring(0,k),Q=mxUtils.indexOf(J,x);0<=Q&&J.splice(Q,1);for(var m=0;m<r.length;m++){var z=r[m];if(0<=mxUtils.indexOf(z,x))for(var t=
|
|
|
|
|
0;t<z.length;t++){var q=mxUtils.indexOf(J,z[t]);0<=q&&J.splice(q,1)}}}}for(var g=(f=b.isEdge(n))?d.currentEdgeStyle:d.currentVertexStyle,O=b.getStyle(n),e=0;e<J.length;e++){var x=J[e],v=g[x];null==v||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(G,x))||(O=mxUtils.setStyle(O,x,v),console.log("here",x,v))}b.setStyle(n,O)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){C(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){C(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,
|
|
|
|
|
function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));C(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var b=c.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(g=d.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=c.getProperty("keys"),l=c.getProperty("values"),e=0;e<b.length;e++){var r=0<=mxUtils.indexOf(z,b[e]);if("strokeColor"!=b[e]||null!=l[e]&&"none"!=
|
|
|
|
|
l[e])if(0<=mxUtils.indexOf(G,b[e]))g||0<=mxUtils.indexOf(E,b[e])?null==l[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=l[e]:f&&0<=mxUtils.indexOf(u,b[e])&&(null==l[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=l[e]);else if(0<=mxUtils.indexOf(u,b[e])){if(f||r)null==l[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=l[e];if(g||r||0<=mxUtils.indexOf(E,b[e]))null==l[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=l[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||
|
|
|
|
|
Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||null==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==
|
|
|
|
|
d.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==d.currentEdgeStyle.shape?
|
|
|
|
@ -2099,8 +2099,8 @@ EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipb
|
|
|
|
|
!1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;
|
|
|
|
|
EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*a.width*c.width,
|
|
|
|
|
this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,b){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(c,b,f,d){if(null!=a.container){f=null!=f?f:0;d=null!=d?d:0;var e=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),g=mxUtils.hasScrollbars(a.container),l=a.view.translate,r=a.view.scale,n=mxRectangle.fromRectangle(e);
|
|
|
|
|
n.x=n.x/r-l.x;n.y=n.y/r-l.y;n.width/=r;n.height/=r;var l=a.container.scrollTop,p=a.container.scrollLeft,u=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)u+=3;var J=a.container.offsetWidth-u,u=a.container.offsetHeight-u;c=c?Math.max(.3,Math.min(b||1,J/n.width)):r;b=(J-c*n.width)/2/c;var C=0==this.lightboxVerticalDivider?0:(u-c*n.height)/this.lightboxVerticalDivider/c;g&&(b=Math.max(b,0),C=Math.max(C,0));if(g||e.width<J||e.height<u)a.view.scaleAndTranslate(c,
|
|
|
|
|
Math.floor(b-n.x),Math.floor(C-n.y)),a.container.scrollTop=l*c/r,a.container.scrollLeft=p*c/r;else if(0!=f||0!=d)e=a.view.translate,a.view.setTranslate(Math.floor(e.x+f/r),Math.floor(e.y+d/r))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
|
|
|
|
|
n.x=n.x/r-l.x;n.y=n.y/r-l.y;n.width/=r;n.height/=r;var l=a.container.scrollTop,p=a.container.scrollLeft,C=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)C+=3;var J=a.container.offsetWidth-C,C=a.container.offsetHeight-C;c=c?Math.max(.3,Math.min(b||1,J/n.width)):r;b=(J-c*n.width)/2/c;var u=0==this.lightboxVerticalDivider?0:(C-c*n.height)/this.lightboxVerticalDivider/c;g&&(b=Math.max(b,0),u=Math.max(u,0));if(g||e.width<J||e.height<C)a.view.scaleAndTranslate(c,
|
|
|
|
|
Math.floor(b-n.x),Math.floor(u-n.y)),a.container.scrollTop=l*c/r,a.container.scrollLeft=p*c/r;else if(0!=f||0!=d)e=a.view.translate,a.view.setTranslate(Math.floor(e.x+f/r),Math.floor(e.y+d/r))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
|
|
|
|
|
mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var k=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";
|
|
|
|
|
this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var m=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);
|
|
|
|
|
this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",m);m();var q=0,m=mxUtils.bind(this,function(a,c,b){q++;var f=document.createElement("span");f.style.paddingLeft="8px";f.style.paddingRight="8px";f.style.cursor="pointer";mxEvent.addListener(f,"click",a);null!=b&&f.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",
|
|
|
|
@ -2109,15 +2109,15 @@ c);f.appendChild(a);this.chromelessToolbar.appendChild(f);return f});null!=k.bac
|
|
|
|
|
t.style.paddingRight="4px";A.style.paddingLeft="4px";A.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(A.style.display="",t.style.display="",v.style.display="inline-block"):(A.style.display="none",t.style.display="none",v.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);m(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,
|
|
|
|
|
mxResources.get("zoomOut")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale?this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,n=null,l=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),
|
|
|
|
|
fadeThead=null);null!=n&&(window.clearTimeout(n),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;n=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";n=null}),600)}),a||200)}),p=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=n&&(window.clearTimeout(n),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||
|
|
|
|
|
30)});if("1"==urlParams.layers){this.layersDialog=null;var z=m(mxUtils.bind(this,function(c){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 b=z.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius",
|
|
|
|
|
30)});if("1"==urlParams.layers){this.layersDialog=null;var y=m(mxUtils.bind(this,function(c){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 b=y.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=b.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);
|
|
|
|
|
this.layersDialog.style.zIndex=b.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),x=a.getModel();x.addListener(mxEvent.CHANGE,function(){z.style.display=1<x.getChildCount(x.root)?"":"none"})}this.addChromelessToolbarItems(m);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||m(mxUtils.bind(this,function(c){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):
|
|
|
|
|
this.layersDialog.style.zIndex=b.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),x=a.getModel();x.addListener(mxEvent.CHANGE,function(){y.style.display=1<x.getChildCount(x.root)?"":"none"})}this.addChromelessToolbarItems(m);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||m(mxUtils.bind(this,function(c){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):
|
|
|
|
|
a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var u=this.lightboxToolbarActions[f];m(u.fn,u.icon,u.tooltip)}null!=k.refreshBtn&&m(mxUtils.bind(this,function(a){k.refreshBtn.url?window.location.href=k.refreshBtn.url:window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh"));null!=k.fullscreenBtn&&
|
|
|
|
|
window.self!==window.top&&m(mxUtils.bind(this,function(c){k.fullscreenBtn.url?a.openLink(k.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(c)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(k.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&m(mxUtils.bind(this,function(a){"1"==urlParams.close||k.closeBtn?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,
|
|
|
|
|
mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";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)||p(30),l())}));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)?l():p(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?l():p(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var G=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,b){this.startX=
|
|
|
|
|
b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<G&&Math.abs(this.scrollTop-a.container.scrollTop)<G&&Math.abs(this.startX-b.getGraphX())<G&&Math.abs(this.startY-b.getGraphY())<G&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?l():p(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(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}y.apply(this,arguments)};var E=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),f=this.getPageSize(),d=Math.ceil(2*b.x+c.width*
|
|
|
|
|
b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<G&&Math.abs(this.scrollTop-a.container.scrollTop)<G&&Math.abs(this.startX-b.getGraphX())<G&&Math.abs(this.startY-b.getGraphY())<G&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?l():p(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var z=
|
|
|
|
|
a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}z.apply(this,arguments)};var E=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),f=this.getPageSize(),d=Math.ceil(2*b.x+c.width*
|
|
|
|
|
f.width),e=Math.ceil(2*b.y+c.height*f.height),g=a.minimumGraphSize;if(null==g||g.width!=d||g.height!=e)a.minimumGraphSize=new mxRectangle(0,0,d,e);d=b.x-c.x*f.width;b=b.y-c.y*f.height;this.autoTranslate||this.view.translate.x==d&&this.view.translate.y==b?E.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,f=a.view.translate.y,a.view.setTranslate(d,b),a.container.scrollLeft+=Math.round((d-c)*a.view.scale),a.container.scrollTop+=Math.round((b-f)*a.view.scale),
|
|
|
|
|
this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var r=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/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-.01)/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(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),f=0,d=0;null!=r&&(f=a.container.offsetWidth/2-r.x+c.x,d=a.container.offsetHeight/2-r.y+c.y);c=this.view.scale;
|
|
|
|
@ -2198,9 +2198,9 @@ null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):
|
|
|
|
|
"ungroup",!0),k.bindAction(190,!0,"superscript"),k.bindAction(188,!0,"subscript"),k.bindKey(13,function(){d.isEnabled()&&d.startEditingAtCell()}),k.bindKey(113,function(){d.isEnabled()&&d.startEditingAtCell()});mxClient.IS_WIN?k.bindAction(89,!0,"redo"):k.bindAction(90,!0,"redo",!0);return k};
|
|
|
|
|
EditorUi.prototype.destroy=function(){null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&
|
|
|
|
|
(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,
|
|
|
|
|
"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(var a=0;a<this.destroyFunctions.length;a++)this.destroyFunctions[a]();this.destroyFunctions=null}for(var b=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<b.length;a++)null!=b[a]&&null!=b[a].parentNode&&b[a].parentNode.removeChild(b[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;
|
|
|
|
|
(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;
|
|
|
|
|
mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(a,b,e){return null};
|
|
|
|
|
"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(var a=0;a<this.destroyFunctions.length;a++)this.destroyFunctions[a]();this.destroyFunctions=null}for(var b=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<b.length;a++)null!=b[a]&&null!=b[a].parentNode&&b[a].parentNode.removeChild(b[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);Date.prototype.toISOString||function(){function a(a){a=String(a);1===a.length&&(a="0"+a);return a}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();
|
|
|
|
|
mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();mxText.prototype.baseSpacingTop=5;
|
|
|
|
|
mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(a,b,e){return null};
|
|
|
|
|
Graph=function(a,b,e,d,k){mxGraph.call(this,a,b,e,d);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a);
|
|
|
|
|
return null!=a?"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.edgeMode){var m=null,q=null,t=null,v=null,A=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")&&this.isEnabled()){var b=c.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var f=b.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(b.getGraphX(),b.getGraphY()),A=this.isCellSelected(f.cell),t=
|
|
|
|
|
f,q=b,null!=f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,b.getGraphX(),b.getGraphY())?v=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(v=f.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,c){var b=this.selectionCellsHandler.handlers.map,f;for(f in b)if(null!=b[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(c.getEvent())&&
|
|
|
|
@ -2214,11 +2214,11 @@ function(){var a=c.apply(this,arguments);if(this.graph.pageVisible){for(var b=[]
|
|
|
|
|
function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),b=[],f=0;f<c.length;f++){var d=this.graph.view.getState(c[f]),d=null!=d?d.style:this.graph.getCellStyle(c[f]);
|
|
|
|
|
"1"==mxUtils.getValue(d,"part","0")?(d=this.graph.model.getParent(c[f]),this.graph.model.isVertex(d)&&0>mxUtils.indexOf(c,d)&&b.push(d)):b.push(c[f])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var f=new mxRubberband(this);
|
|
|
|
|
this.getRubberband=function(){return f};var g=(new Date).getTime(),n=0,l=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;l.apply(this,arguments);a!=this.currentState?(g=(new Date).getTime(),n=0):n=(new Date).getTime()-g};var p=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,
|
|
|
|
|
"outlineConnect","1"))&&p.apply(this,arguments)};var z=this.isToggleEvent;this.isToggleEvent=function(a){return z.apply(this,arguments)||mxEvent.isShiftDown(a)};var x=f.isForceRubberbandEvent;f.isForceRubberbandEvent=function(a){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var u=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
|
|
|
|
|
"outlineConnect","1"))&&p.apply(this,arguments)};var y=this.isToggleEvent;this.isToggleEvent=function(a){return y.apply(this,arguments)||mxEvent.isShiftDown(a)};var x=f.isForceRubberbandEvent;f.isForceRubberbandEvent=function(a){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var u=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
|
|
|
|
|
(u=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=u)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var G=this.click;this.click=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!c||a.isConsumed())return G.apply(this,
|
|
|
|
|
arguments);c=c?a.sourceState.cell:a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&(this.isCustomLink(c)?this.customLinkClicked(c):this.openLink(c)))};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var y=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!=
|
|
|
|
|
this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return y.apply(this,arguments)};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,f,d,e){e=null!=e?e:[];if(0<b||0<f){var g=this.getModel(),l=a+b,r=c+f;null==d&&(d=this.getCurrentRoot(),null==d&&(d=g.getRoot()));if(null!=d)for(var n=g.getChildCount(d),p=0;p<n;p++){var u=g.getChildAt(d,p),k=this.view.getState(u);if(null!=
|
|
|
|
|
k&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(k.style,"locked","0")){var z=mxUtils.getValue(k.style,mxConstants.STYLE_ROTATION)||0;0!=z&&(k=mxUtils.getBoundingBox(k,z));(g.isEdge(u)||g.isVertex(u))&&k.x>=a&&k.y+k.height<=r&&k.y>=c&&k.x+k.width<=l&&e.push(u);this.getAllCells(a,c,b,f,u,e)}}}return e};var E=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:E.apply(this,arguments)};this.isCellLocked=function(a){for(a=
|
|
|
|
|
arguments);c=c?a.sourceState.cell:a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&(this.isCustomLink(c)?this.customLinkClicked(c):this.openLink(c)))};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var z=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!=
|
|
|
|
|
this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return z.apply(this,arguments)};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,f,d,e){e=null!=e?e:[];if(0<b||0<f){var g=this.getModel(),l=a+b,r=c+f;null==d&&(d=this.getCurrentRoot(),null==d&&(d=g.getRoot()));if(null!=d)for(var n=g.getChildCount(d),p=0;p<n;p++){var u=g.getChildAt(d,p),k=this.view.getState(u);if(null!=
|
|
|
|
|
k&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(k.style,"locked","0")){var y=mxUtils.getValue(k.style,mxConstants.STYLE_ROTATION)||0;0!=y&&(k=mxUtils.getBoundingBox(k,y));(g.isEdge(u)||g.isVertex(u))&&k.x>=a&&k.y+k.height<=r&&k.y>=c&&k.x+k.width<=l&&e.push(u);this.getAllCells(a,c,b,f,u,e)}}}return e};var E=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:E.apply(this,arguments)};this.isCellLocked=function(a){for(a=
|
|
|
|
|
this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var r=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();r=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=
|
|
|
|
|
c.getProperty("event"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),f.start(b.x,b.y)):null!=r?this.addSelectionCells(r):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);r=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,
|
|
|
|
|
mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var C=this.updateMouseEvent;this.updateMouseEvent=function(a){a=C.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}this.currentTranslate=new mxPoint(0,0)};
|
|
|
|
@ -2253,8 +2253,8 @@ Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b
|
|
|
|
|
Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};
|
|
|
|
|
Graph.prototype.formatDate=function(a,b,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",
|
|
|
|
|
shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,q=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
|
|
|
|
|
/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var t=e?"getUTC":"get",v=a[t+"Date"](),A=a[t+"Day"](),c=a[t+"Month"](),f=a[t+"FullYear"](),g=a[t+"Hours"](),n=a[t+"Minutes"](),l=a[t+"Seconds"](),t=a[t+"Milliseconds"](),p=e?0:a.getTimezoneOffset(),z={d:v,dd:q(v),ddd:d.i18n.dayNames[A],dddd:d.i18n.dayNames[A+7],m:c+1,mm:q(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+
|
|
|
|
|
12],yy:String(f).slice(2),yyyy:f,h:g%12||12,hh:q(g%12||12),H:g,HH:q(g),M:n,MM:q(n),s:l,ss:q(l),l:q(t,3),L:q(99<t?Math.round(t/10):t),t:12>g?"a":"p",tt:12>g?"am":"pm",T:12>g?"A":"P",TT:12>g?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<p?"-":"+")+q(100*Math.floor(Math.abs(p)/60)+Math.abs(p)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in z?z[a]:a.slice(1,
|
|
|
|
|
/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var t=e?"getUTC":"get",v=a[t+"Date"](),A=a[t+"Day"](),c=a[t+"Month"](),f=a[t+"FullYear"](),g=a[t+"Hours"](),n=a[t+"Minutes"](),l=a[t+"Seconds"](),t=a[t+"Milliseconds"](),p=e?0:a.getTimezoneOffset(),y={d:v,dd:q(v),ddd:d.i18n.dayNames[A],dddd:d.i18n.dayNames[A+7],m:c+1,mm:q(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+
|
|
|
|
|
12],yy:String(f).slice(2),yyyy:f,h:g%12||12,hh:q(g%12||12),H:g,HH:q(g),M:n,MM:q(n),s:l,ss:q(l),l:q(t,3),L:q(99<t?Math.round(t/10):t),t:12>g?"a":"p",tt:12>g?"am":"pm",T:12>g?"A":"P",TT:12>g?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0<p?"-":"+")+q(100*Math.floor(Math.abs(p)/60)+Math.abs(p)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in y?y[a]:a.slice(1,
|
|
|
|
|
a.length-1)})};
|
|
|
|
|
Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),e=b.getChildCount(b.root),d=0;d<e;d++)mxUtils.bind(this,function(d){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");b.isVisible(d)&&(k.setAttribute("checked","checked"),
|
|
|
|
|
k.defaultChecked=!0);e.appendChild(k);var t=this.convertValueToString(d)||mxResources.get("background")||"Background";e.setAttribute("title",t);mxUtils.write(e,t);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");b.setVisible(d,k.checked)})})(b.getChildAt(b.root,d));return a};
|
|
|
|
@ -2318,11 +2318,11 @@ this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a
|
|
|
|
|
(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,d){var c=this.getState(a);null!=c&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=b.apply(this,arguments);null!=
|
|
|
|
|
c&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,b){return e.apply(this,arguments)||null!=a.routedPoints&&null!=b.routedPoints&&!mxUtils.equalPoints(b.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&&
|
|
|
|
|
1!=a.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var b=a.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=a.routedPoints,f=null;if(null!=b&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var d=function(c,b,d){var e=new mxPoint(b,d);e.type=c;f.push(e);e=null!=a.routedPoints?a.routedPoints[f.length-1]:null;return null==e||e.type!=c||e.x!=b||e.y!=d},e=.5*this.scale,c=!1,f=[],l=0;l<b.length-1;l++){for(var p=
|
|
|
|
|
b[l+1],k=b[l],x=[],u=b[l+2];l<b.length-2&&mxUtils.ptSegDistSq(k.x,k.y,u.x,u.y,p.x,p.y)<1*this.scale*this.scale;)p=u,l++,u=b[l+2];for(var c=d(0,k.x,k.y)||c,t=0;t<this.validEdges.length;t++){var y=this.validEdges[t],m=y.absolutePoints;if(null!=m&&mxUtils.intersects(a,y)&&"1"!=y.style.noJump)for(y=0;y<m.length-1;y++){for(var r=m[y+1],C=m[y],u=m[y+2];y<m.length-2&&mxUtils.ptSegDistSq(C.x,C.y,u.x,u.y,r.x,r.y)<1*this.scale*this.scale;)r=u,y++,u=m[y+2];u=mxUtils.intersection(k.x,k.y,p.x,p.y,C.x,C.y,r.x,
|
|
|
|
|
r.y);if(null!=u&&(Math.abs(u.x-C.x)>e||Math.abs(u.y-C.y)>e)&&(Math.abs(u.x-r.x)>e||Math.abs(u.y-r.y)>e)){r=u.x-k.x;C=u.y-k.y;u={distSq:r*r+C*C,x:u.x,y:u.y};for(r=0;r<x.length;r++)if(x[r].distSq>u.distSq){x.splice(r,0,u);u=null;break}null==u||0!=x.length&&x[x.length-1].x===u.x&&x[x.length-1].y===u.y||x.push(u)}}}for(y=0;y<x.length;y++)c=d(1,x[y].x,x[y].y)||c}u=b[b.length-1];c=d(0,u.x,u.y)||c}a.routedPoints=f;return c}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,
|
|
|
|
|
b,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,d=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),l,p=!0,z=null,x=null;l=[];var u=null;a.begin();for(var t=
|
|
|
|
|
0;t<this.state.routedPoints.length;t++){var y=this.state.routedPoints[t],m=new mxPoint(y.x/this.scale,y.y/this.scale);0==t?m=b[0]:t==this.state.routedPoints.length-1&&(m=b[b.length-1]);var r=!1;if(null!=z&&1==y.type){var C=this.state.routedPoints[t+1],y=C.x/this.scale-m.x,C=C.y/this.scale-m.y,y=y*y+C*C;null==u&&(u=new mxPoint(m.x-z.x,m.y-z.y),x=Math.sqrt(u.x*u.x+u.y*u.y),u.x=u.x*d/x,u.y=u.y*d/x);y>d*d&&0<x&&(y=z.x-m.x,C=z.y-m.y,y=y*y+C*C,y>d*d&&(r=new mxPoint(m.x-u.x,m.y-u.y),y=new mxPoint(m.x+u.x,
|
|
|
|
|
m.y+u.y),l.push(r),this.addPoints(a,l,c,f,!1,null,p),l=0>Math.round(u.x)||0==Math.round(u.x)&&0>=Math.round(u.y)?1:-1,p=!1,"sharp"==e?(a.lineTo(r.x-u.y*l,r.y+u.x*l),a.lineTo(y.x-u.y*l,y.y+u.x*l),a.lineTo(y.x,y.y)):"arc"==e?(l*=1.3,a.curveTo(r.x-u.y*l,r.y+u.x*l,y.x-u.y*l,y.y+u.x*l,y.x,y.y)):(a.moveTo(y.x,y.y),p=!0),l=[y],r=!0))}else u=null;r||(l.push(m),z=m)}this.addPoints(a,l,c,f,!1,null,p);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=
|
|
|
|
|
b[l+1],k=b[l],x=[],u=b[l+2];l<b.length-2&&mxUtils.ptSegDistSq(k.x,k.y,u.x,u.y,p.x,p.y)<1*this.scale*this.scale;)p=u,l++,u=b[l+2];for(var c=d(0,k.x,k.y)||c,t=0;t<this.validEdges.length;t++){var z=this.validEdges[t],m=z.absolutePoints;if(null!=m&&mxUtils.intersects(a,z)&&"1"!=z.style.noJump)for(z=0;z<m.length-1;z++){for(var r=m[z+1],C=m[z],u=m[z+2];z<m.length-2&&mxUtils.ptSegDistSq(C.x,C.y,u.x,u.y,r.x,r.y)<1*this.scale*this.scale;)r=u,z++,u=m[z+2];u=mxUtils.intersection(k.x,k.y,p.x,p.y,C.x,C.y,r.x,
|
|
|
|
|
r.y);if(null!=u&&(Math.abs(u.x-C.x)>e||Math.abs(u.y-C.y)>e)&&(Math.abs(u.x-r.x)>e||Math.abs(u.y-r.y)>e)){r=u.x-k.x;C=u.y-k.y;u={distSq:r*r+C*C,x:u.x,y:u.y};for(r=0;r<x.length;r++)if(x[r].distSq>u.distSq){x.splice(r,0,u);u=null;break}null==u||0!=x.length&&x[x.length-1].x===u.x&&x[x.length-1].y===u.y||x.push(u)}}}for(z=0;z<x.length;z++)c=d(1,x[z].x,x[z].y)||c}u=b[b.length-1];c=d(0,u.x,u.y)||c}a.routedPoints=f;return c}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,
|
|
|
|
|
b,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,d=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),l,p=!0,y=null,x=null;l=[];var u=null;a.begin();for(var t=
|
|
|
|
|
0;t<this.state.routedPoints.length;t++){var z=this.state.routedPoints[t],m=new mxPoint(z.x/this.scale,z.y/this.scale);0==t?m=b[0]:t==this.state.routedPoints.length-1&&(m=b[b.length-1]);var r=!1;if(null!=y&&1==z.type){var C=this.state.routedPoints[t+1],z=C.x/this.scale-m.x,C=C.y/this.scale-m.y,z=z*z+C*C;null==u&&(u=new mxPoint(m.x-y.x,m.y-y.y),x=Math.sqrt(u.x*u.x+u.y*u.y),u.x=u.x*d/x,u.y=u.y*d/x);z>d*d&&0<x&&(z=y.x-m.x,C=y.y-m.y,z=z*z+C*C,z>d*d&&(r=new mxPoint(m.x-u.x,m.y-u.y),z=new mxPoint(m.x+u.x,
|
|
|
|
|
m.y+u.y),l.push(r),this.addPoints(a,l,c,f,!1,null,p),l=0>Math.round(u.x)||0==Math.round(u.x)&&0>=Math.round(u.y)?1:-1,p=!1,"sharp"==e?(a.lineTo(r.x-u.y*l,r.y+u.x*l),a.lineTo(z.x-u.y*l,z.y+u.x*l),a.lineTo(z.x,z.y)):"arc"==e?(l*=1.3,a.curveTo(r.x-u.y*l,r.y+u.x*l,z.x-u.y*l,z.y+u.x*l,z.x,z.y)):(a.moveTo(z.x,z.y),p=!0),l=[z],r=!0))}else u=null;r||(l.push(m),y=m)}this.addPoints(a,l,c,f,!1,null,p);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=
|
|
|
|
|
function(a,b,c,f){if(null==b||null==a||"1"!=b.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{b=this.getTerminalPort(a,b,f);var d=this.getNextPoint(a,c,f),e=this.graph.isOrthogonal(a),l=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),p=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=l)var k=Math.cos(-l),x=Math.sin(-l),d=mxUtils.getRotatedPoint(d,k,x,p);k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:
|
|
|
|
|
mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);d=this.getPerimeterPoint(b,d,0==l&&e,k);0!=l&&(k=Math.cos(l),x=Math.sin(l),d=mxUtils.getRotatedPoint(d,k,x,p));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,c,f,d),f)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,c,f,d){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);f=c=null;if(null!=a)for(var e=0;e<a.length;e++){var g=this.graph.getConnectionPoint(b,a[e]);if(null!=g){var p=(g.x-d.x)*(g.x-d.x)+(g.y-d.y)*(g.y-d.y);if(null==
|
|
|
|
|
f||p<f)c=g,f=p}}null!=c&&(d=c)}return d};var q=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,b,c){var f=q.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,f));return f};var t=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var b=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=
|
|
|
|
@ -2348,9 +2348,9 @@ a.shape.direction;d=a.shape.bounds;b=a.shape.scale;f=d.width/b;d=d.height/b;if(e
|
|
|
|
|
(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,f=0;f<c;f++){var d=this.model.getChildAt(a,f);this.model.isVertex(d)&&(d=this.getCellGeometry(d),null==d||d.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=
|
|
|
|
|
this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=
|
|
|
|
|
this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var f=0;f<a.length;f++){var d=
|
|
|
|
|
a[f];if(c.isEdge(d)){var e=c.getTerminal(d,!0),g=c.getTerminal(d,!1);c.setTerminal(d,g,!0);c.setTerminal(d,e,!1);var l=c.getGeometry(d);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse();var r=l.getTerminalPoint(!0),n=l.getTerminalPoint(!1);l.setTerminalPoint(r,!1);l.setTerminalPoint(n,!0);c.setGeometry(d,l);var p=this.view.getState(d),u=this.view.getState(e),J=this.view.getState(g);if(null!=p){var k=null!=u?this.getConnectionConstraint(p,u,!0):null,z=null!=J?this.getConnectionConstraint(p,
|
|
|
|
|
J,!1):null;this.setConnectionConstraint(d,e,!0,z);this.setConnectionConstraint(d,g,!1,k)}b.push(d)}}else if(c.isVertex(d)&&(l=this.getCellGeometry(d),null!=l)){l=l.clone();l.x+=l.width/2-l.height/2;l.y+=l.height/2-l.width/2;var x=l.width;l.width=l.height;l.height=x;c.setGeometry(d,l);var B=this.view.getState(d);if(null!=B){var C=B.style[mxConstants.STYLE_DIRECTION]||"east";"east"==C?C="south":"south"==C?C="west":"west"==C?C="north":"north"==C&&(C="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,
|
|
|
|
|
C,[d])}b.push(d)}}}finally{c.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0;a=a.nextSibling}return!1};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var b=
|
|
|
|
|
a[f];if(c.isEdge(d)){var e=c.getTerminal(d,!0),g=c.getTerminal(d,!1);c.setTerminal(d,g,!0);c.setTerminal(d,e,!1);var l=c.getGeometry(d);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse();var r=l.getTerminalPoint(!0),n=l.getTerminalPoint(!1);l.setTerminalPoint(r,!1);l.setTerminalPoint(n,!0);c.setGeometry(d,l);var p=this.view.getState(d),u=this.view.getState(e),J=this.view.getState(g);if(null!=p){var k=null!=u?this.getConnectionConstraint(p,u,!0):null,y=null!=J?this.getConnectionConstraint(p,
|
|
|
|
|
J,!1):null;this.setConnectionConstraint(d,e,!0,y);this.setConnectionConstraint(d,g,!1,k)}b.push(d)}}else if(c.isVertex(d)&&(l=this.getCellGeometry(d),null!=l)){l=l.clone();l.x+=l.width/2-l.height/2;l.y+=l.height/2-l.width/2;var C=l.width;l.width=l.height;l.height=C;c.setGeometry(d,l);var x=this.view.getState(d);if(null!=x){var B=x.style[mxConstants.STYLE_DIRECTION]||"east";"east"==B?B="south":"south"==B?B="west":"west"==B?B="north":"north"==B&&(B="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,
|
|
|
|
|
B,[d])}b.push(d)}}}finally{c.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0;a=a.nextSibling}return!1};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var b=
|
|
|
|
|
0;b<c.length;b++){var f=this.view.getState(c[b]);null!=f&&null!=f.shape&&null!=f.shape.stencil&&this.stencilHasPlaceholders(f.shape.stencil)?this.removeStateForCell(c[b]):this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],!1,!1)}}};Graph.prototype.replaceElement=function(a,c){for(var b=a.ownerDocument.createElement(null!=c?c:"span"),f=Array.prototype.slice.call(a.attributes);attr=f.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};
|
|
|
|
|
Graph.prototype.updateLabelElements=function(a,c,b){a=null!=a?a:this.getSelectionCells();for(var f=document.createElement("div"),d=0;d<a.length;d++)if(this.isHtmlLabel(a[d])){var e=this.convertValueToString(a[d]);if(null!=e&&0<e.length){f.innerHTML=e;for(var g=f.getElementsByTagName(null!=b?b:"*"),l=0;l<g.length;l++)c(g[l]);f.innerHTML!=e&&this.cellLabelChanged(a[d],f.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,b){c=Graph.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&
|
|
|
|
|
"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var f=a.getAttribute("placeholder"),d=a;null!=d;){if(d==this.model.getRoot()||null!=d.value&&"object"==typeof d.value&&d.hasAttribute(f)){this.setAttributeForCell(d,f,c);break}d=this.model.getParent(d)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=
|
|
|
|
@ -2376,12 +2376,12 @@ a.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var c=thi
|
|
|
|
|
if(null!=g){var l=a?g.getCenterX():g.getCenterY(),f=null!=f?Math.max(f,l):l,d=null!=d?Math.min(d,l):l;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;l=this.view.scale;d=d/l-(a?g.x:g.y);f=f/l-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var r=(f-d)/(b.length-1),f=d,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),p=this.getCellGeometry(b[e].cell),f=f+r;null!=p&&null!=n&&(p=p.clone(),a?p.x=Math.round(f-p.width/2)-n.origin.x:
|
|
|
|
|
p.y=Math.round(f-p.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,p))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),b=new mxDictionary,f=0;f<a.length;f++)b.put(a[f],!0);for(f=0;f<c.length;f++){var d=this.view.getState(a[f]);if(null!=d){var e=this.getCellGeometry(c[f]);null==e||!e.relative||this.model.isEdge(a[f])||
|
|
|
|
|
b.get(this.model.getParent(a[f]))||(e.relative=!1,e.x=d.x/d.view.scale-d.view.translate.x,e.y=d.y/d.view.scale-d.view.translate.y)}}b=new mxCodec;d=new mxGraphModel;e=d.getChildAt(d.getRoot(),0);for(f=0;f<a.length;f++)d.add(e,c[f]);return b.encode(d)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,b,f,d,e,g,l,r,n){var p=this.useCssTransforms;
|
|
|
|
|
p&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;b=null!=b?b:0;d=null!=d?d:!0;e=null!=e?e:!0;g=null!=g?g:!0;var u=e||f?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==u)throw Error(mxResources.get("drawingEmpty"));var k=this.view.scale,z=mxUtils.createXmlDocument(),x=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"svg"):z.createElement("svg");null!=a&&(null!=x.style?x.style.backgroundColor=a:x.setAttribute("style",
|
|
|
|
|
"background-color:"+a));null==z.createElementNS?(x.setAttribute("xmlns",mxConstants.NS_SVG),x.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):x.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/k;var C=Math.max(1,Math.ceil(u.width*a)+2*b)+(n?5:0),B=Math.max(1,Math.ceil(u.height*a)+2*b)+(n?5:0);x.setAttribute("version","1.1");x.setAttribute("width",C+"px");x.setAttribute("height",B+"px");x.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+C+" "+B);z.appendChild(x);
|
|
|
|
|
var y=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"g"):z.createElement("g");x.appendChild(y);var m=this.createSvgCanvas(y);m.foOffset=d?-.5:0;m.textOffset=d?-.5:0;m.imageOffset=d?-.5:0;m.translate(Math.floor((b/c-u.x)/k),Math.floor((b/c-u.y)/k));var t=document.createElement("textarea"),H=m.createAlternateContent;m.createAlternateContent=function(a,c,b,f,d,e,g,l,r,n,p,u,k){var z=this.state;if(null!=this.foAltText&&(0==f||0!=z.fontSize&&e.length<5*f/z.fontSize)){var x=this.createElement("text");
|
|
|
|
|
x.setAttribute("x",Math.round(f/2));x.setAttribute("y",Math.round((d+z.fontSize)/2));x.setAttribute("fill",z.fontColor||"black");x.setAttribute("text-anchor","middle");x.setAttribute("font-size",Math.round(z.fontSize)+"px");x.setAttribute("font-family",z.fontFamily);(z.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&x.setAttribute("font-weight","bold");(z.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&x.setAttribute("font-style","italic");(z.fontStyle&mxConstants.FONT_UNDERLINE)==
|
|
|
|
|
mxConstants.FONT_UNDERLINE&&x.setAttribute("text-decoration","underline");try{return t.innerHTML=e,x.textContent=t.value,x}catch(oa){return H.apply(this,arguments)}}else return H.apply(this,arguments)};var J=this.backgroundImage;if(null!=J){c=k/c;var q=this.view.translate,G=new mxRectangle(q.x*c,q.y*c,J.width*c,J.height*c);mxUtils.intersects(u,G)&&m.image(q.x,q.y,J.width,J.height,J.src,!0)}m.scale(a);m.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var I=l.drawCellState;l.drawCellState=function(a,
|
|
|
|
|
c){for(var b=a.view.graph,f=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!e&&!f&&null!=d;)f=b.isCellSelected(d),d=b.model.getParent(d);(e||f)&&I.apply(this,arguments)};l.drawState(this.getView().getState(this.model.root),m);this.updateSvgLinks(x,r,!0);return x}finally{p&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a,c,b){a=a.getElementsByTagName("a");for(var f=0;f<a.length;f++){var d=a[f].getAttribute("href");null==d&&(d=
|
|
|
|
|
p&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;b=null!=b?b:0;d=null!=d?d:!0;e=null!=e?e:!0;g=null!=g?g:!0;var u=e||f?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==u)throw Error(mxResources.get("drawingEmpty"));var k=this.view.scale,y=mxUtils.createXmlDocument(),C=null!=y.createElementNS?y.createElementNS(mxConstants.NS_SVG,"svg"):y.createElement("svg");null!=a&&(null!=C.style?C.style.backgroundColor=a:C.setAttribute("style",
|
|
|
|
|
"background-color:"+a));null==y.createElementNS?(C.setAttribute("xmlns",mxConstants.NS_SVG),C.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):C.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/k;var x=Math.max(1,Math.ceil(u.width*a)+2*b)+(n?5:0),B=Math.max(1,Math.ceil(u.height*a)+2*b)+(n?5:0);C.setAttribute("version","1.1");C.setAttribute("width",x+"px");C.setAttribute("height",B+"px");C.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+x+" "+B);y.appendChild(C);
|
|
|
|
|
var z=null!=y.createElementNS?y.createElementNS(mxConstants.NS_SVG,"g"):y.createElement("g");C.appendChild(z);var m=this.createSvgCanvas(z);m.foOffset=d?-.5:0;m.textOffset=d?-.5:0;m.imageOffset=d?-.5:0;m.translate(Math.floor((b/c-u.x)/k),Math.floor((b/c-u.y)/k));var t=document.createElement("textarea"),H=m.createAlternateContent;m.createAlternateContent=function(a,c,b,f,d,e,g,l,r,n,p,u,k){var y=this.state;if(null!=this.foAltText&&(0==f||0!=y.fontSize&&e.length<5*f/y.fontSize)){var C=this.createElement("text");
|
|
|
|
|
C.setAttribute("x",Math.round(f/2));C.setAttribute("y",Math.round((d+y.fontSize)/2));C.setAttribute("fill",y.fontColor||"black");C.setAttribute("text-anchor","middle");C.setAttribute("font-size",Math.round(y.fontSize)+"px");C.setAttribute("font-family",y.fontFamily);(y.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&C.setAttribute("font-weight","bold");(y.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&C.setAttribute("font-style","italic");(y.fontStyle&mxConstants.FONT_UNDERLINE)==
|
|
|
|
|
mxConstants.FONT_UNDERLINE&&C.setAttribute("text-decoration","underline");try{return t.innerHTML=e,C.textContent=t.value,C}catch(oa){return H.apply(this,arguments)}}else return H.apply(this,arguments)};var J=this.backgroundImage;if(null!=J){c=k/c;var q=this.view.translate,G=new mxRectangle(q.x*c,q.y*c,J.width*c,J.height*c);mxUtils.intersects(u,G)&&m.image(q.x,q.y,J.width,J.height,J.src,!0)}m.scale(a);m.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var I=l.drawCellState;l.drawCellState=function(a,
|
|
|
|
|
c){for(var b=a.view.graph,f=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!e&&!f&&null!=d;)f=b.isCellSelected(d),d=b.model.getParent(d);(e||f)&&I.apply(this,arguments)};l.drawState(this.getView().getState(this.model.root),m);this.updateSvgLinks(C,r,!0);return C}finally{p&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a,c,b){a=a.getElementsByTagName("a");for(var f=0;f<a.length;f++){var d=a[f].getAttribute("href");null==d&&(d=
|
|
|
|
|
a[f].getAttribute("xlink:href"));null!=d&&(null!=c&&/^https?:\/\//.test(d)?a[f].setAttribute("target",c):b&&this.isCustomLink(d)&&a[f].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());
|
|
|
|
|
return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=
|
|
|
|
|
function(a,c){for(var b=a.tBodies[0],f=b.rows[0].cells,d=0,e=0;e<f.length;e++)var g=f[e].getAttribute("colspan"),d=d+(null!=g?parseInt(g):1);b=b.insertRow(c);for(e=0;e<d;e++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var f=0;f<b.rows.length;f++){var d=document.createElement("th");b.rows[f].appendChild(d);mxUtils.br(d)}b=a.tBodies[0];for(f=0;f<b.rows.length;f++)d=
|
|
|
|
@ -2433,11 +2433,11 @@ new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(e,
|
|
|
|
|
this.update(f,b),this.isSpaceEvent(c)?(f=this.x+this.width,b=this.y+this.height,d=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/d)*d,this.height=this.graph.snap(this.height/d)*d,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=f-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor=
|
|
|
|
|
"white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+
|
|
|
|
|
"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var l=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),
|
|
|
|
|
this.secondDiv=null);l.apply(this,arguments)};var p=(new Date).getTime(),z=0,x=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,f){x.apply(this,arguments);b!=this.currentTerminalState?(p=(new Date).getTime(),z=0):z=(new Date).getTime()-p;this.currentTerminalState=b};var u=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&
|
|
|
|
|
2E3<z||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&u.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,f=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,
|
|
|
|
|
this.secondDiv=null);l.apply(this,arguments)};var p=(new Date).getTime(),y=0,x=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,f){x.apply(this,arguments);b!=this.currentTerminalState?(p=(new Date).getTime(),y=0):y=(new Date).getTime()-p;this.currentTerminalState=b};var u=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&
|
|
|
|
|
2E3<y||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&u.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,f=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,
|
|
|
|
|
f,b):null,b=null!=(null!=d?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),d):null)?this.fixedHandleImage:null!=d&&null!=f?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var G=mxVertexHandler.prototype.createSizerShape;
|
|
|
|
|
mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return G.apply(this,arguments)};var y=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),f=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=f&&f.relative&&(c=this.graph.view.getState(a[0]),
|
|
|
|
|
null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return y.apply(this,arguments)};var E=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),f=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=f&&f.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,
|
|
|
|
|
mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return G.apply(this,arguments)};var z=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),f=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=f&&f.relative&&(c=this.graph.view.getState(a[0]),
|
|
|
|
|
null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return z.apply(this,arguments)};var E=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),f=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=f&&f.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox,
|
|
|
|
|
new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):E.apply(this,arguments)};var r=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),f=b.getParent(this.state.cell),d=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(f)||null==d||!d.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&r.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=
|
|
|
|
|
function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var C=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){C.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=
|
|
|
|
|
this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var Q=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,c){Q.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var O=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){O.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",
|
|
|
|
@ -2456,7 +2456,7 @@ null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.chang
|
|
|
|
|
a.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var U=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){U.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var X=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){X.apply(this,arguments);null!=this.linkHint&&
|
|
|
|
|
(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function q(){mxCylinder.call(this)}function t(){mxActor.call(this)}function v(){mxActor.call(this)}function A(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function n(){mxActor.call(this)}function l(a,c){this.canvas=
|
|
|
|
|
a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
|
|
|
|
|
this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo)}function p(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function x(){mxActor.call(this)}function u(){mxActor.call(this)}function G(){mxActor.call(this)}function y(){mxRectangleShape.call(this)}function E(){mxRectangleShape.call(this)}function r(){mxCylinder.call(this)}function C(){mxShape.call(this)}function Q(){mxShape.call(this)}
|
|
|
|
|
this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo)}function p(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function x(){mxActor.call(this)}function u(){mxActor.call(this)}function G(){mxActor.call(this)}function z(){mxRectangleShape.call(this)}function E(){mxRectangleShape.call(this)}function r(){mxCylinder.call(this)}function C(){mxShape.call(this)}function Q(){mxShape.call(this)}
|
|
|
|
|
function O(){mxEllipse.call(this)}function M(){mxShape.call(this)}function H(){mxShape.call(this)}function B(){mxRectangleShape.call(this)}function I(){mxShape.call(this)}function S(){mxShape.call(this)}function V(){mxShape.call(this)}function U(){mxShape.call(this)}function X(){mxShape.call(this)}function J(){mxCylinder.call(this)}function aa(){mxDoubleEllipse.call(this)}function la(){mxDoubleEllipse.call(this)}function ea(){mxArrowConnector.call(this);this.spacing=0}function Y(){mxArrowConnector.call(this);
|
|
|
|
|
this.spacing=0}function ba(){mxActor.call(this)}function K(){mxRectangleShape.call(this)}function L(){mxActor.call(this)}function ha(){mxActor.call(this)}function N(){mxActor.call(this)}function R(){mxActor.call(this)}function ia(){mxActor.call(this)}function fa(){mxActor.call(this)}function F(){mxActor.call(this)}function ja(){mxActor.call(this)}function P(){mxActor.call(this)}function ca(){mxActor.call(this)}function ga(){mxEllipse.call(this)}function W(){mxEllipse.call(this)}function Z(){mxEllipse.call(this)}
|
|
|
|
|
function wa(){mxRhombus.call(this)}function ua(){mxEllipse.call(this)}function pa(){mxEllipse.call(this)}function ta(){mxEllipse.call(this)}function va(){mxEllipse.call(this)}function ma(){mxActor.call(this)}function ra(){mxActor.call(this)}function ka(){mxActor.call(this)}function da(){mxConnector.call(this)}function sa(a,c,b,f,d,e,g,l,r,n){g+=r;var D=f.clone();f.x-=d*(2*g+r);f.y-=e*(2*g+r);d*=g+r;e*=g+r;return function(){a.ellipse(D.x-d-g,D.y-e-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,
|
|
|
|
@ -2485,17 +2485,17 @@ this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Ka.apply(this,argume
|
|
|
|
|
(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?e=Math.min(f/2,Math.min(d/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(f*e,d*e)),a.moveTo(c+e,b),a.lineTo(c+f-e,b),a.quadTo(c+f,b,c+f,b+e),a.lineTo(c+f,b+d-e),a.quadTo(c+f,b+d,c+f-e,b+d),a.lineTo(c+e,b+d),a.quadTo(c,b+d,c,b+d-e),
|
|
|
|
|
a.lineTo(c,b+e),a.quadTo(c,b,c+e,b)):(a.moveTo(c,b),a.lineTo(c+f,b),a.lineTo(c+f,b+d),a.lineTo(c,b+d),a.lineTo(c,b)),a.close(),a.end(),a.fillAndStroke()}};var Ma=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,b,f,d){null==a.handJiggle&&Ma.apply(this,arguments)};mxUtils.extend(p,mxRectangleShape);p.prototype.size=.1;p.prototype.isHtmlAllowed=function(){return!1};p.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,
|
|
|
|
|
!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var c=a.width,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var f=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(c*d,b*d));a.x+=Math.round(f);a.width-=Math.round(2*f)}return a};p.prototype.paintForeground=
|
|
|
|
|
function(a,c,b,f,d){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(f*g,d*g));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+d);a.moveTo(c+f-e,b);a.lineTo(c+f-e,b+d);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",p);mxUtils.extend(z,
|
|
|
|
|
mxRectangleShape);z.prototype.paintBackground=function(a,c,b,f,d){a.setFillColor(mxConstants.NONE);a.rect(c,b,f,d);a.fill()};z.prototype.paintForeground=function(a,c,b,f,d){};mxCellRenderer.registerShape("transparent",z);mxUtils.extend(x,mxHexagon);x.prototype.size=30;x.prototype.position=.5;x.prototype.position2=.5;x.prototype.base=20;x.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};x.prototype.isRoundable=
|
|
|
|
|
function(a,c,b,f,d){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(f*g,d*g));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+d);a.moveTo(c+f-e,b);a.lineTo(c+f-e,b+d);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",p);mxUtils.extend(y,
|
|
|
|
|
mxRectangleShape);y.prototype.paintBackground=function(a,c,b,f,d){a.setFillColor(mxConstants.NONE);a.rect(c,b,f,d);a.fill()};y.prototype.paintForeground=function(a,c,b,f,d){};mxCellRenderer.registerShape("transparent",y);mxUtils.extend(x,mxHexagon);x.prototype.size=30;x.prototype.position=.5;x.prototype.position2=.5;x.prototype.base=20;x.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};x.prototype.isRoundable=
|
|
|
|
|
function(){return!0};x.prototype.redrawPath=function(a,c,b,f,d){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),l=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"base",this.base))));
|
|
|
|
|
this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,d-b),new mxPoint(Math.min(f,e+l),d-b),new mxPoint(g,d),new mxPoint(Math.max(0,e),d-b),new mxPoint(0,d-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",x);mxUtils.extend(u,mxActor);u.prototype.size=.2;u.prototype.fixedSize=20;u.prototype.isRoundable=function(){return!0};u.prototype.redrawPath=function(a,c,b,f,d){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,
|
|
|
|
|
"size",this.fixedSize)))):f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(0,d),new mxPoint(c,d/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",u);mxUtils.extend(G,mxHexagon);G.prototype.size=.25;G.prototype.isRoundable=function(){return!0};G.prototype.redrawPath=
|
|
|
|
|
function(a,c,b,f,d){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(f-c,0),new mxPoint(f,.5*d),new mxPoint(f-c,d),new mxPoint(c,d),new mxPoint(0,.5*d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",G);mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.paintForeground=function(a,
|
|
|
|
|
c,b,f,d){var e=Math.min(f/5,d/5)+1;a.begin();a.moveTo(c+f/2,b+e);a.lineTo(c+f/2,b+d-e);a.moveTo(c+e,b+d/2);a.lineTo(c+f-e,b+d/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",y);var Fa=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+
|
|
|
|
|
function(a,c,b,f,d){c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(c,0),new mxPoint(f-c,0),new mxPoint(f,.5*d),new mxPoint(f-c,d),new mxPoint(c,d),new mxPoint(0,.5*d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",G);mxUtils.extend(z,mxRectangleShape);z.prototype.isHtmlAllowed=function(){return!1};z.prototype.paintForeground=function(a,
|
|
|
|
|
c,b,f,d){var e=Math.min(f/5,d/5)+1;a.begin();a.moveTo(c+f/2,b+e);a.lineTo(c+f/2,b+d-e);a.moveTo(c+e,b+d/2);a.lineTo(c+f-e,b+d/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",z);var Fa=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+
|
|
|
|
|
c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,f,d){Fa.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;b+=e;f-=2*e;d-=2*e;0<f&&0<d&&(a.setShadow(!1),Fa.apply(this,[a,c,b,f,d]))}};mxUtils.extend(E,mxRectangleShape);E.prototype.isHtmlAllowed=function(){return!1};E.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,
|
|
|
|
|
this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};E.prototype.paintForeground=function(a,c,b,f,d){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;b+=e;f-=2*e;d-=2*e;0<f&&0<d&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+
|
|
|
|
|
e]];if(null!=g){var l=this.style["symbol"+e+"Align"],D=this.style["symbol"+e+"VerticalAlign"],r=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],p=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||p,k=this.style["symbol"+e+"ArcSpacing"];null!=k&&(k*=this.getArcSize(f+this.strokewidth,d+this.strokewidth),p+=k,u+=k);var k=c,z=b,k=l==mxConstants.ALIGN_CENTER?k+(f-r)/2:l==mxConstants.ALIGN_RIGHT?k+(f-r-p):k+p,z=D==mxConstants.ALIGN_MIDDLE?z+(d-n)/2:D==mxConstants.ALIGN_BOTTOM?
|
|
|
|
|
z+(d-n-u):z+u;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,k,z,r,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(r,mxCylinder);r.prototype.redrawPath=function(a,c,b,f,d,e){e?(a.moveTo(0,0),a.lineTo(f/2,d/2),a.lineTo(f,0),a.end()):(a.moveTo(0,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",r);mxUtils.extend(C,mxShape);
|
|
|
|
|
e]];if(null!=g){var l=this.style["symbol"+e+"Align"],D=this.style["symbol"+e+"VerticalAlign"],r=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],p=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||p,k=this.style["symbol"+e+"ArcSpacing"];null!=k&&(k*=this.getArcSize(f+this.strokewidth,d+this.strokewidth),p+=k,u+=k);var k=c,y=b,k=l==mxConstants.ALIGN_CENTER?k+(f-r)/2:l==mxConstants.ALIGN_RIGHT?k+(f-r-p):k+p,y=D==mxConstants.ALIGN_MIDDLE?y+(d-n)/2:D==mxConstants.ALIGN_BOTTOM?
|
|
|
|
|
y+(d-n-u):y+u;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,k,y,r,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(r,mxCylinder);r.prototype.redrawPath=function(a,c,b,f,d,e){e?(a.moveTo(0,0),a.lineTo(f/2,d/2),a.lineTo(f,0),a.end()):(a.moveTo(0,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",r);mxUtils.extend(C,mxShape);
|
|
|
|
|
C.prototype.paintBackground=function(a,c,b,f,d){a.translate(c,b);a.ellipse(f/4,0,f/2,d/4);a.fillAndStroke();a.begin();a.moveTo(f/2,d/4);a.lineTo(f/2,2*d/3);a.moveTo(f/2,d/3);a.lineTo(0,d/3);a.moveTo(f/2,d/3);a.lineTo(f,d/3);a.moveTo(f/2,2*d/3);a.lineTo(0,d);a.moveTo(f/2,2*d/3);a.lineTo(f,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",C);mxUtils.extend(Q,mxShape);Q.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};Q.prototype.paintBackground=function(a,
|
|
|
|
|
c,b,f,d){a.translate(c,b);a.begin();a.moveTo(0,d/4);a.lineTo(0,3*d/4);a.end();a.stroke();a.begin();a.moveTo(0,d/2);a.lineTo(f/6,d/2);a.end();a.stroke();a.ellipse(f/6,0,5*f/6,d);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",Q);mxUtils.extend(O,mxEllipse);O.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+f/8,b+d);a.lineTo(c+7*f/8,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",O);mxUtils.extend(M,
|
|
|
|
|
mxShape);M.prototype.paintVertexShape=function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(f,0);a.lineTo(0,d);a.moveTo(0,0);a.lineTo(f,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",M);mxUtils.extend(H,mxShape);H.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};H.prototype.paintBackground=function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(3*f/8,d/8*1.1);a.lineTo(5*f/8,0);a.end();a.stroke();a.ellipse(0,d/8,f,7*d/8);a.fillAndStroke()};
|
|
|
|
@ -2544,7 +2544,7 @@ va);mxUtils.extend(ma,mxActor);ma.prototype.redrawPath=function(a,c,b,f,d){c=Mat
|
|
|
|
|
mxCellRenderer.registerShape("display",ka);mxUtils.extend(da,mxConnector);da.prototype.origPaintEdgeShape=da.prototype.paintEdgeShape;da.prototype.paintEdgeShape=function(a,c,b){for(var f=[],d=0;d<c.length;d++)f.push(mxUtils.clone(c[d]));var d=a.state.dashed,e=a.state.fixDash;da.prototype.origPaintEdgeShape.apply(this,[a,f,b]);3<=a.state.strokeWidth&&(f=mxUtils.getValue(this.style,"fillColor",null),null!=f&&(a.setStrokeColor(f),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(d,e),da.prototype.origPaintEdgeShape.apply(this,
|
|
|
|
|
[a,c,b])))};mxCellRenderer.registerShape("filledEdge",da);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,f,d,e,g,l,r,n){var p=d*(g+r+1),u=e*(g+r+1);return function(){a.begin();
|
|
|
|
|
a.moveTo(f.x-p/2-u/2,f.y-u/2+p/2);a.lineTo(f.x+u/2-3*p/2,f.y-3*u/2-p/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,f,d,e,g,l,r,n){var p=d*(g+r+1),u=e*(g+r+1);return function(){a.begin();a.moveTo(f.x-p/2-u/2,f.y-u/2+p/2);a.lineTo(f.x+u/2-3*p/2,f.y-3*u/2-p/2);a.moveTo(f.x-p/2+u/2,f.y-u/2-p/2);a.lineTo(f.x-u/2-3*p/2,f.y-3*u/2+p/2);a.stroke()}});mxMarker.addMarker("circle",sa);mxMarker.addMarker("circlePlus",function(a,c,b,f,d,e,g,l,r,n){var p=f.clone(),u=sa.apply(this,arguments),k=d*(g+
|
|
|
|
|
2*r),z=e*(g+2*r);return function(){u.apply(this,arguments);a.begin();a.moveTo(p.x-d*r,p.y-e*r);a.lineTo(p.x-2*k+d*r,p.y-2*z+e*r);a.moveTo(p.x-k-z+e*r,p.y-z+k-d*r);a.lineTo(p.x+z-k-e*r,p.y-z-k+d*r);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,f,d,e,g,l,r,n){c=d*r*1.118;b=e*r*1.118;d*=g+r;e*=g+r;var p=f.clone();p.x-=c;p.y-=b;f.x+=1*-d-c;f.y+=1*-e-b;return function(){a.begin();a.moveTo(p.x,p.y);l?a.lineTo(p.x-d-e/2,p.y-e+d/2):a.lineTo(p.x+e/2-d,p.y-e-d/2);a.lineTo(p.x-d,p.y-e);a.close();n?
|
|
|
|
|
2*r),y=e*(g+2*r);return function(){u.apply(this,arguments);a.begin();a.moveTo(p.x-d*r,p.y-e*r);a.lineTo(p.x-2*k+d*r,p.y-2*y+e*r);a.moveTo(p.x-k-y+e*r,p.y-y+k-d*r);a.lineTo(p.x+y-k-e*r,p.y-y-k+d*r);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,f,d,e,g,l,r,n){c=d*r*1.118;b=e*r*1.118;d*=g+r;e*=g+r;var p=f.clone();p.x-=c;p.y-=b;f.x+=1*-d-c;f.y+=1*-e-b;return function(){a.begin();a.moveTo(p.x,p.y);l?a.lineTo(p.x-d-e/2,p.y-e+d/2):a.lineTo(p.x+e/2-d,p.y-e-d/2);a.lineTo(p.x-d,p.y-e);a.close();n?
|
|
|
|
|
a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,f,d,e,g,l,r,p,n){e*=l+p;g*=l+p;var u=d.clone();return function(){c.begin();c.moveTo(u.x,u.y);r?c.lineTo(u.x-e-g/a,u.y-g+e/a):c.lineTo(u.x+g/a-e,u.y-g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ga=function(a,c,b){return ya(a,["width"],c,function(c,f,d,e,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+f*c/4+d*g/2,e.y+d*c/4-f*g/2)},function(c,f,d,e,g,
|
|
|
|
|
l){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ya=function(a,c,b,f,d){return T(a,c,function(c){var d=a.absolutePoints,e=d.length-1;c=a.view.translate;var g=a.view.scale,l=b?d[0]:d[e],d=b?d[1]:d[e-1],e=d.x-l.x,r=d.y-l.y,p=Math.sqrt(e*e+r*r),l=f.call(this,p,e/p,r/p,l,d);return new mxPoint(l.x/g-c.x,l.y/g-c.y)},function(c,f,e){var g=a.absolutePoints,l=g.length-1;c=a.view.translate;var r=a.view.scale,p=b?g[0]:g[l],g=b?g[1]:g[l-1],l=g.x-p.x,
|
|
|
|
|
n=g.y-p.y,u=Math.sqrt(l*l+n*n);f.x=(f.x+c.x)*r;f.y=(f.y+c.y)*r;d.call(this,u,l/u,n/u,p,g,f,e)})},oa=function(a){return function(c){return[T(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))),f=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",R.prototype.arrowSize)));return new mxPoint(c.x+(1-f)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,
|
|
|
|
@ -2582,14 +2582,14 @@ Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",ca.pro
|
|
|
|
|
!0),trapezoid:Ha(.5),parallelogram:Ha(1)};Graph.createHandle=T;Graph.handleFactory=Ba;mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=Ba[a];null==a&&null!=this.state.shape&&this.state.shape.isRoundable()&&(a=Ba[mxConstants.SHAPE_RECTANGLE]);if(null!=a)return a(this.state)}return null};
|
|
|
|
|
mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_CONNECTOR);a=Ba[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Ca=new mxPoint(1,0),Da=new mxPoint(1,0),oa=mxUtils.toRadians(-30),Ca=mxUtils.getRotatedPoint(Ca,Math.cos(oa),Math.sin(oa)),oa=mxUtils.toRadians(-150),
|
|
|
|
|
Da=mxUtils.getRotatedPoint(Da,Math.cos(oa),Math.sin(oa));mxEdgeStyle.IsometricConnector=function(a,c,b,f,d){var e=a.view;f=null!=f&&0<f.length?f[0]:null;var g=a.absolutePoints,l=g[0],g=g[g.length-1];null!=f&&(f=e.transformControlPoint(a,f));null==l&&null!=c&&(l=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var r=Ca.x,p=Ca.y,n=Da.x,u=Da.y,k="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,
|
|
|
|
|
b){a-=z.x;var f=c-z.y;c=(u*a-n*f)/(r*u-p*n);a=(p*a-r*f)/(p*n-r*u);k?(b&&(z=new mxPoint(z.x+r*c,z.y+p*c),d.push(z)),z=new mxPoint(z.x+n*a,z.y+u*a)):(b&&(z=new mxPoint(z.x+n*a,z.y+u*a),d.push(z)),z=new mxPoint(z.x+r*c,z.y+p*c));d.push(z)};var z=l;null==f&&(f=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(f.x,f.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Na=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==
|
|
|
|
|
b){a-=y.x;var f=c-y.y;c=(u*a-n*f)/(r*u-p*n);a=(p*a-r*f)/(p*n-r*u);k?(b&&(y=new mxPoint(y.x+r*c,y.y+p*c),d.push(y)),y=new mxPoint(y.x+n*a,y.y+u*a)):(b&&(y=new mxPoint(y.x+n*a,y.y+u*a),d.push(y)),y=new mxPoint(y.x+r*c,y.y+p*c));d.push(y)};var y=l;null==f&&(f=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(f.x,f.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Na=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==
|
|
|
|
|
mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Na.apply(this,arguments)};b.prototype.constraints=[];e.prototype.getConstraints=function(a,c,b){a=[];var f=Math.tan(mxUtils.toRadians(30)),d=(.5-f)/2,f=Math.min(c,b/(.5+f));c=(c-f)/2;b=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.25*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*f,b+f*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+f,
|
|
|
|
|
b+.25*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+f,b+.75*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*f,b+(1-d)*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.75*f));return a};x.prototype.getConstraints=function(a,c,b){a=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var f=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",
|
|
|
|
|
this.position));var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
|
|
|
|
|
0),!1,null,c,.5*(b-f)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-f)));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,
|
|
|
|
|
0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];
|
|
|
|
|
mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=
|
|
|
|
|
mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;y.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),
|
|
|
|
|
mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;z.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),
|
|
|
|
|
!1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,
|
|
|
|
|
0),!1));return a};t.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0,
|
|
|
|
|
0),!1,null,0,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};a.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,
|
|
|
|
@ -2673,8 +2673,8 @@ if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandl
|
|
|
|
|
b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(d.getModel().isEdge(e)){var c=d.getCellGeometry(e);null!=c&&(c=c.clone(),c.points=null,d.getModel().setGeometry(e,c))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,
|
|
|
|
|
function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),k="";null!=
|
|
|
|
|
e&&(k=e.style[mxConstants.STYLE_IMAGE]||k);var c=d.cellEditor.saveSelection();b.showImageDialog(a,k,function(a,b,e){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(c),d.insertImage(a,b,e);else{var f=d.getSelectionCells();if(null!=a&&(0<a.length||0<f.length)){var g=null;d.getModel().beginUpdate();try{if(0==f.length){var n=d.getFreeInsertPoint(),g=f=[d.insertVertex(d.getDefaultParent(),null,"",n.x,n.y,b,e,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
|
|
|
|
|
d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,f);var k=d.view.getState(f[0]),u=null!=k?k.style:d.getCellStyle(f[0]);"image"!=u[mxConstants.STYLE_SHAPE]&&"label"!=u[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",f):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,f);if(1==d.getSelectionCount()&&null!=b&&null!=e){var m=f[0],y=d.getModel().getGeometry(m);null!=y&&(y=y.clone(),y.width=b,y.height=e,
|
|
|
|
|
d.getModel().setGeometry(m,y))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
|
|
|
|
|
d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,f);var k=d.view.getState(f[0]),u=null!=k?k.style:d.getCellStyle(f[0]);"image"!=u[mxConstants.STYLE_SHAPE]&&"label"!=u[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",f):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,f);if(1==d.getSelectionCount()&&null!=b&&null!=e){var m=f[0],z=d.getModel().getGeometry(m);null!=z&&(z=z.clone(),z.width=b,z.height=e,
|
|
|
|
|
d.getModel().setGeometry(m,z))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
|
|
|
|
|
function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+
|
|
|
|
|
"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));m=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
|
|
|
|
|
b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};
|
|
|
|
@ -2686,7 +2686,7 @@ DrawioFile.prototype.updateFile=function(a,b,e,d){null!=e&&e()||(this.ui.getCurr
|
|
|
|
|
DrawioFile.prototype.mergeFile=function(a,b,e,d){var k=!0;try{this.stats.fileMerged++;var m=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),q=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=q&&0<q.length){this.shadowPages=q;this.backupPatch=this.isModified()?this.ui.diffPages(m,this.ui.pages):null;var t=[this.ui.diffPages(null!=d?d:m,this.shadowPages)];if(!this.ignorePatches(t)){var v=this.ui.patchPages(m,
|
|
|
|
|
t[0]);d={};var A=this.ui.getHashValueForPages(v,d),m={},c=this.ui.getHashValueForPages(this.shadowPages,m);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",t,"checksum",c==A,A);if(null!=A&&A!=c){var f=this.compressReportData(this.getAnonymizedXmlForPages(q)),g=this.compressReportData(this.getAnonymizedXmlForPages(v)),n=this.ui.hashValue(a.getCurrentEtag()),l=this.ui.hashValue(this.getCurrentEtag());this.checksumError(e,t,"Shadow Details: "+JSON.stringify(d)+
|
|
|
|
|
"\nChecksum: "+A+"\nCurrent: "+c+"\nCurrent Details: "+JSON.stringify(m)+"\nFrom: "+n+"\nTo: "+l+"\n\nFile Data:\n"+f+"\nPatched Shadow:\n"+g,null,"mergeFile");return}this.patch(t,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw k=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
|
|
|
|
|
null!=e&&e(x);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var p=this.getCurrentUser(),z=null!=p?p.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,x)}}catch(u){}}};
|
|
|
|
|
null!=e&&e(x);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var p=this.getCurrentUser(),y=null!=p?p.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,x)}}catch(u){}}};
|
|
|
|
|
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var k=b.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(k=this.ui.anonymizeNode(k,!0));k.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,k,!0);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
|
|
|
|
|
DrawioFile.prototype.compressReportData=function(a,b,e){b=null!=b?b:1E4;null!=e&&null!=a&&a.length>e?a=a.substring(0,e)+"[...]":null!=a&&a.length>b&&(a=Graph.compress(a)+"\n");return a};
|
|
|
|
|
DrawioFile.prototype.checksumError=function(a,b,e,d,k){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var m=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(b,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
|
|
|
|
@ -2791,8 +2791,8 @@ d=0;d<a.length;d++)f[d]=String.fromCharCode(a[d]);f=f.join("")}e=null!=e?e:"data
|
|
|
|
|
"g"),"")},b=this.fontCss.split("url("),f=0,d={},e=mxUtils.bind(this,function(){if(0==f){for(var e=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");e.push('url("');e.push(d[c(b[g].substring(0,l))]);e.push('"'+b[g].substring(l))}this.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var l=b[g].indexOf(")"),p=null,n=b[g].indexOf("format(",l);0<n&&(p=c(b[g].substring(n+7,b[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;f++;var c="application/x-font-ttf";
|
|
|
|
|
if("svg"==p||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&
|
|
|
|
|
(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){d[a]=c;f--;e()}),mxUtils.bind(this,function(a){f--;e()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[g].substring(0,l)),p)}}else a()};Editor.prototype.convertMath=function(a,c,b,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(c),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=
|
|
|
|
|
function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,c,b,f,d,e,g,l,p,n,u,k,z,x){e=null!=e?e:!0;k=null!=k?k:this.graph;z=null!=z?z:0;var r=p?null:k.background;r==mxConstants.NONE&&(r=null);null==r&&(r=f);null==r&&0==p&&(r=this.graph.defaultPageBackgroundColor);this.convertImages(k.getSvg(r,null,null,x,null,null!=g?g:!0,null,null,null,n),mxUtils.bind(this,function(b){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var g=
|
|
|
|
|
document.createElement("canvas"),p=parseInt(b.getAttribute("width")),n=parseInt(b.getAttribute("height"));l=null!=l?l:1;null!=c&&(l=e?Math.min(1,Math.min(3*c/(4*n),c/p)):c/p);p=Math.ceil(l*p)+2*z;n=Math.ceil(l*n)+2*z;g.setAttribute("width",p);g.setAttribute("height",n);var u=g.getContext("2d");null!=r&&(u.beginPath(),u.rect(0,0,p,n),u.fillStyle=r,u.fill());u.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(f,z/l,z/l);a(g)},0):(u.drawImage(f,z/l,z/l),a(g))}catch(R){null!=d&&d(R)}});
|
|
|
|
|
function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,c,b,f,d,e,g,l,p,n,u,k,y,x){e=null!=e?e:!0;k=null!=k?k:this.graph;y=null!=y?y:0;var r=p?null:k.background;r==mxConstants.NONE&&(r=null);null==r&&(r=f);null==r&&0==p&&(r=this.graph.defaultPageBackgroundColor);this.convertImages(k.getSvg(r,null,null,x,null,null!=g?g:!0,null,null,null,n),mxUtils.bind(this,function(b){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var g=
|
|
|
|
|
document.createElement("canvas"),p=parseInt(b.getAttribute("width")),n=parseInt(b.getAttribute("height"));l=null!=l?l:1;null!=c&&(l=e?Math.min(1,Math.min(3*c/(4*n),c/p)):c/p);p=Math.ceil(l*p)+2*y;n=Math.ceil(l*n)+2*y;g.setAttribute("width",p);g.setAttribute("height",n);var u=g.getContext("2d");null!=r&&(u.beginPath(),u.rect(0,0,p,n),u.fillStyle=r,u.fill());u.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(f,y/l,y/l);a(g)},0):(u.drawImage(f,y/l,y/l),a(g))}catch(R){null!=d&&d(R)}});
|
|
|
|
|
f.onerror=function(a){null!=d&&d(a)};try{n&&this.graph.addSvgShadow(b);var g=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(k,b,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(g)}catch(K){null!=d&&d(K)}}),b,u)};Editor.prototype.writeGraphModelToPng=function(a,c,b,f,
|
|
|
|
|
d){function e(a,c){var b=p;p+=c;return a.substring(b,p)}function g(a){a=e(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function l(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(e(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(e(a,4),"IHDR"!=e(a,4))null!=d&&d();else{e(a,17);d=a.substring(0,p);do{var n=g(a);
|
|
|
|
|
if("IDAT"==e(a,4)){d=a.substring(0,p-8);b=b+String.fromCharCode(0)+("zTXt"==c?String.fromCharCode(0):"")+f;f=4294967295;f=EditorUi.prototype.updateCRC(f,c,0,4);f=EditorUi.prototype.updateCRC(f,b,0,b.length);d+=l(b.length)+c+b+l(f^4294967295);d+=a.substring(p-8,a.length);break}d+=a.substring(p-8,p-4+n);e(a,n);e(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";
|
|
|
|
@ -2824,23 +2824,23 @@ stroke:"#B09500",font:"#ffffff"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"
|
|
|
|
|
{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",
|
|
|
|
|
stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,c,b){if(null!=c){var f=function(a){if(null!=a)if(b)for(var f=0;f<a.length;f++)c[a[f].name]=a[f];else for(var d in c){for(var e=!1,f=0;f<a.length;f++)if(a[f].name==d&&a[f].type==c[d].type){e=!0;break}e||delete c[d]}},d=this.editorUi.editor.graph.view.getState(a);null!=d&&
|
|
|
|
|
null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(H){}}};var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
|
|
|
|
|
this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},f=a.vertices,d=a.edges,e=0;e<f.length;e++)this.findCommonProperties(f[e],b,0==e);for(e=0;e<d.length;e++)this.findCommonProperties(d[e],b,0==f.length&&0==e);0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var f=StyleFormatPanel.prototype.addStyleOps;
|
|
|
|
|
StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));
|
|
|
|
|
this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},f=a.vertices,d=a.edges,e=0;e<f.length;e++)this.findCommonProperties(f[e],b,0==e);for(e=0;e<d.length;e++)this.findCommonProperties(d[e],b,0==f.length&&0==e);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var f=
|
|
|
|
|
StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));
|
|
|
|
|
c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return f.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,c,b){function f(a,c,b,f){u.getModel().beginUpdate();try{var d=[],e=[];if(null!=b.index){for(var g=[],l=b.parentRow.nextSibling;l&&l.getAttribute("data-pName")==a;)g.push(l.getAttribute("data-pValue")),
|
|
|
|
|
l=l.nextSibling;b.index<g.length?null!=f?g.splice(f,1):g[b.index]=c:g.push(c);null!=b.size&&g.length>b.size&&(g=g.slice(0,b.size));c=g.join(",");null!=b.countProperty&&(u.setCellStyles(b.countProperty,g.length,u.getSelectionCells()),d.push(b.countProperty),e.push(g.length))}u.setCellStyles(a,c,u.getSelectionCells());d.push(a);e.push(c);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var p=b.dependentPropsDefVal[a],n=b.dependentPropsVals[a];if(n.length>c)n=n.slice(0,c);else for(var k=
|
|
|
|
|
n.length;k<c;k++)n.push(p);n=n.join(",");u.setCellStyles(b.dependentProps[a],n,u.getSelectionCells());d.push(b.dependentProps[a]);e.push(n)}r.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",e,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function d(c,b,f){var d=mxUtils.getOffset(a,!0),e=mxUtils.getOffset(c,!0);b.style.position="absolute";b.style.left=e.x-d.x+"px";b.style.top=e.y-d.y+"px";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight-(f?4:
|
|
|
|
|
0)+"px";b.style.zIndex=5}function e(a,c,b){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=c&&"none"!=c?c:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(r,function(e){this.editorUi.pickColor(c,function(c){d.style.background="none"==c?"url('"+Dialog.prototype.noColorImage+"')":c;f(a,c,b)});mxEvent.consume(e)}));btn.style.height="12px";btn.style.width="40px";btn.className=
|
|
|
|
|
"geColorBtn";btn.appendChild(d);return btn}function g(a,c,b,d,e,g,l){null!=c&&(c=c.split(","),k.push({name:a,values:c,type:b,defVal:d,countProperty:e,parentRow:g,isDeletable:!0,flipBkg:l}));btn=mxUtils.button("+",mxUtils.bind(r,function(c){for(var p=g,r=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==a)p=p.nextSibling,r++;else break;var u={type:b,parentRow:g,index:r,isDeletable:!0,defVal:d,countProperty:e},r=n(a,"",u,0==r%2,l);f(a,d,u);p.parentNode.insertBefore(r,p.nextSibling);
|
|
|
|
|
mxEvent.consume(c)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function l(a,c,b,f,d,e,g){if(0<d){var l=Array(d);c=null!=c?c.split(","):[];for(var p=0;p<d;p++)l[p]=null!=c[p]?c[p]:null!=f?f:"";k.push({name:a,values:l,type:b,defVal:f,parentRow:e,flipBkg:g,size:d})}return document.createElement("div")}function p(a,c,b){var d=document.createElement("input");d.type="checkbox";d.checked="1"==c;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",b)});
|
|
|
|
|
return d}function n(c,b,n,u,k){var z=n.dispName,x=n.type,m=document.createElement("tr");m.className="gePropRow"+(k?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",c);m.setAttribute("data-pValue",b);u=!1;null!=n.index&&(m.setAttribute("data-index",n.index),z=(null!=z?z:"")+"["+n.index+"]",u=!0);var y=document.createElement("td");y.className="gePropRowCell";y.innerHTML=mxUtils.htmlEntities(mxResources.get(z,null,z));u&&(y.style.textAlign="right");m.appendChild(y);y=document.createElement("td");
|
|
|
|
|
y.className="gePropRowCell";if("color"==x)y.appendChild(e(c,b,n));else if("bool"==x||"boolean"==x)y.appendChild(p(c,b,n));else if("enum"==x){var B=n.enumList;for(k=0;k<B.length;k++)if(z=B[k],z.val==b){y.innerHTML=mxUtils.htmlEntities(mxResources.get(z.dispName,null,z.dispName));break}mxEvent.addListener(y,"click",mxUtils.bind(r,function(){var e=document.createElement("select");d(y,e);for(var g=0;g<B.length;g++){var l=B[g],p=document.createElement("option");p.value=mxUtils.htmlEntities(l.val);p.innerHTML=
|
|
|
|
|
mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));e.appendChild(p)}e.value=b;a.appendChild(e);mxEvent.addListener(e,"change",function(){var a=mxUtils.htmlEntities(e.value);f(c,a,n)});e.focus();mxEvent.addListener(e,"blur",function(){a.removeChild(e)})}))}else"dynamicArr"==x?y.appendChild(g(c,b,n.subType,n.subDefVal,n.countProperty,m,k)):"staticArr"==x?y.appendChild(l(c,b,n.subType,n.subDefVal,n.size,m,k)):(y.innerHTML=b,mxEvent.addListener(y,"click",mxUtils.bind(r,function(){function e(){var a=
|
|
|
|
|
g.value,a=0==a.length&&"string"!=x?0:a;n.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=n.min&&a<n.min?a=n.min:null!=n.max&&a>n.max&&(a=n.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");f(c,a,n)}var g=document.createElement("input");d(y,g,!0);g.value=b;g.className="gePropEditor";"int"!=x&&"float"!=x||n.allowAuto||(g.type="number",g.step="int"==x?"1":"any",null!=n.min&&(g.min=parseFloat(n.min)),null!=n.max&&(g.max=parseFloat(n.max)));
|
|
|
|
|
a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&e()});g.focus();mxEvent.addListener(g,"blur",function(){e()})})));n.isDeletable&&(k=mxUtils.button("-",mxUtils.bind(r,function(a){f(c,"",n,n.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",y.appendChild(k));m.appendChild(y);return m}var r=this,u=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var z=document.createElement("table");
|
|
|
|
|
z.style.whiteSpace="nowrap";z.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var y=document.createElement("img");y.src=Sidebar.prototype.expandedImage;m.appendChild(y);mxUtils.write(m,mxResources.get("property"));x.style.cursor="pointer";var q=function(){var c=z.querySelectorAll(".gePropNonHeaderRow"),b;if(r.editorUi.propertiesCollapsed){y.src=Sidebar.prototype.collapsedImage;b="none";for(var f=a.childNodes.length-
|
|
|
|
|
1;0<=f;f--)try{var d=a.childNodes[f],e=d.nodeName.toUpperCase();"INPUT"!=e&&"SELECT"!=e||a.removeChild(d)}catch(Z){}}else y.src=Sidebar.prototype.expandedImage,b="";for(f=0;f<c.length;f++)c[f].style.display=b};mxEvent.addListener(x,"click",function(){r.editorUi.propertiesCollapsed=!r.editorUi.propertiesCollapsed;q()});x.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");x.appendChild(m);z.appendChild(x);var G=!1,C=!1,E;for(E in c)if(x=
|
|
|
|
|
c[E],"function"!=typeof x.isVisible||x.isVisible(b)){var t=null!=b.style[E]?mxUtils.htmlEntities(b.style[E]+""):x.defVal;if("separator"==x.type)C=!C;else{if("staticArr"==x.type)x.size=parseInt(b.style[x.sizeProperty]||c[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var v=x.dependentProps,Q=[],A=[],m=0;m<v.length;m++){var F=b.style[v[m]];A.push(c[v[m]].subDefVal);Q.push(null!=F?F.split(","):[])}x.dependentPropsDefVal=A;x.dependentPropsVals=Q}z.appendChild(n(E,t,x,G,C));G=!G}}for(m=
|
|
|
|
|
0;m<k.length;m++)for(x=k[m],c=x.parentRow,b=0;b<x.values.length;b++)E=n(x.name,x.values[b],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:b,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==b%2,x.flipBkg),c.parentNode.insertBefore(E,c.nextSibling),c=E;a.appendChild(z);q();return a};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){f.getModel().beginUpdate();try{var b=f.getSelectionCells();for(c=0;c<b.length;c++){for(var d=
|
|
|
|
|
return d}function n(c,b,n,u,k){var y=n.dispName,x=n.type,m=document.createElement("tr");m.className="gePropRow"+(k?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",c);m.setAttribute("data-pValue",b);u=!1;null!=n.index&&(m.setAttribute("data-index",n.index),y=(null!=y?y:"")+"["+n.index+"]",u=!0);var z=document.createElement("td");z.className="gePropRowCell";z.innerHTML=mxUtils.htmlEntities(mxResources.get(y,null,y));u&&(z.style.textAlign="right");m.appendChild(z);z=document.createElement("td");
|
|
|
|
|
z.className="gePropRowCell";if("color"==x)z.appendChild(e(c,b,n));else if("bool"==x||"boolean"==x)z.appendChild(p(c,b,n));else if("enum"==x){var B=n.enumList;for(k=0;k<B.length;k++)if(y=B[k],y.val==b){z.innerHTML=mxUtils.htmlEntities(mxResources.get(y.dispName,null,y.dispName));break}mxEvent.addListener(z,"click",mxUtils.bind(r,function(){var e=document.createElement("select");d(z,e);for(var g=0;g<B.length;g++){var l=B[g],p=document.createElement("option");p.value=mxUtils.htmlEntities(l.val);p.innerHTML=
|
|
|
|
|
mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));e.appendChild(p)}e.value=b;a.appendChild(e);mxEvent.addListener(e,"change",function(){var a=mxUtils.htmlEntities(e.value);f(c,a,n)});e.focus();mxEvent.addListener(e,"blur",function(){a.removeChild(e)})}))}else"dynamicArr"==x?z.appendChild(g(c,b,n.subType,n.subDefVal,n.countProperty,m,k)):"staticArr"==x?z.appendChild(l(c,b,n.subType,n.subDefVal,n.size,m,k)):(z.innerHTML=b,mxEvent.addListener(z,"click",mxUtils.bind(r,function(){function e(){var a=
|
|
|
|
|
g.value,a=0==a.length&&"string"!=x?0:a;n.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=n.min&&a<n.min?a=n.min:null!=n.max&&a>n.max&&(a=n.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");f(c,a,n)}var g=document.createElement("input");d(z,g,!0);g.value=b;g.className="gePropEditor";"int"!=x&&"float"!=x||n.allowAuto||(g.type="number",g.step="int"==x?"1":"any",null!=n.min&&(g.min=parseFloat(n.min)),null!=n.max&&(g.max=parseFloat(n.max)));
|
|
|
|
|
a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&e()});g.focus();mxEvent.addListener(g,"blur",function(){e()})})));n.isDeletable&&(k=mxUtils.button("-",mxUtils.bind(r,function(a){f(c,"",n,n.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",z.appendChild(k));m.appendChild(z);return m}var r=this,u=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var y=document.createElement("table");
|
|
|
|
|
y.style.whiteSpace="nowrap";y.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var z=document.createElement("img");z.src=Sidebar.prototype.expandedImage;m.appendChild(z);mxUtils.write(m,mxResources.get("property"));x.style.cursor="pointer";var q=function(){var c=y.querySelectorAll(".gePropNonHeaderRow"),b;if(r.editorUi.propertiesCollapsed){z.src=Sidebar.prototype.collapsedImage;b="none";for(var f=a.childNodes.length-
|
|
|
|
|
1;0<=f;f--)try{var d=a.childNodes[f],e=d.nodeName.toUpperCase();"INPUT"!=e&&"SELECT"!=e||a.removeChild(d)}catch(Z){}}else z.src=Sidebar.prototype.expandedImage,b="";for(f=0;f<c.length;f++)c[f].style.display=b};mxEvent.addListener(x,"click",function(){r.editorUi.propertiesCollapsed=!r.editorUi.propertiesCollapsed;q()});x.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");x.appendChild(m);y.appendChild(x);var C=!1,G=!1,E;for(E in c)if(x=
|
|
|
|
|
c[E],"function"!=typeof x.isVisible||x.isVisible(b)){var t=null!=b.style[E]?mxUtils.htmlEntities(b.style[E]+""):x.defVal;if("separator"==x.type)G=!G;else{if("staticArr"==x.type)x.size=parseInt(b.style[x.sizeProperty]||c[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var v=x.dependentProps,Q=[],A=[],m=0;m<v.length;m++){var F=b.style[v[m]];A.push(c[v[m]].subDefVal);Q.push(null!=F?F.split(","):[])}x.dependentPropsDefVal=A;x.dependentPropsVals=Q}y.appendChild(n(E,t,x,C,G));C=!C}}for(m=
|
|
|
|
|
0;m<k.length;m++)for(x=k[m],c=x.parentRow,b=0;b<x.values.length;b++)E=n(x.name,x.values[b],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:b,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==b%2,x.flipBkg),c.parentNode.insertBefore(E,c.nextSibling),c=E;a.appendChild(y);q();return a};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){f.getModel().beginUpdate();try{var b=f.getSelectionCells();for(c=0;c<b.length;c++){for(var d=
|
|
|
|
|
f.getModel().getStyle(b[c]),g=0;g<e.length;g++)d=mxUtils.removeStylename(d,e[g]);var l=f.getModel().isVertex(b[c])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,
|
|
|
|
|
null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,
|
|
|
|
|
mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(b[c],d)}}finally{f.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?c.style.filter=
|
|
|
|
@ -2853,53 +2853,54 @@ mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.current
|
|
|
|
|
(b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var f=this.editorUi.editor.graph,d=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=d&&null!=d.shape&&null!=d.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
|
|
|
|
|
function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px":
|
|
|
|
|
(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize=
|
|
|
|
|
"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var g=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=mxUtils.clone(a)}g.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;
|
|
|
|
|
this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var f=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if(null!=c){if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,
|
|
|
|
|
c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.resizeParent=!1;return b}if("undefined"!=typeof mxTableLayout&&"tableLayout"==c.childLayout)return b=new mxTableLayout(this.graph),b.rows=c.tableRows||2,b.columns=c.tableColumns||2,b.colPercentages=c.colPercentages,b.rowPercentages=c.rowPercentages,b.equalColumns="1"==mxUtils.getValue(c,"equalColumns",b.colPercentages?"0":"1"),
|
|
|
|
|
b.equalRows="1"==mxUtils.getValue(c,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(c,"resizeParent","1"),b.border=c.tableBorder||b.border,b.marginLeft=c.marginLeft||0,b.marginRight=c.marginRight||0,b.marginTop=c.marginTop||0,b.marginBottom=c.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(c,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(c,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=c.colWidths||"100",b.rowHeights=c.rowHeights||"50",b}return f.apply(this,arguments)}};
|
|
|
|
|
var n=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;if(null!=this.themes&&"darkTheme"==this.defaultThemeName){a=this.stylesheet;this.stylesheet=new mxStylesheet;var c=this.themes["default-style2"];(new mxCodec(c.ownerDocument)).decode(c,this.getStylesheet());this.refresh()}c=n.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return c};var l=Graph.prototype.isCssTransformsSupported;Graph.prototype.isCssTransformsSupported=function(){return l.apply(this,arguments)&&
|
|
|
|
|
!mxClient.IS_SF};var p=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=p.apply(this,arguments);if(null==c){if(null==this.globalUrlVars&&null!=urlParams.vars)try{this.globalUrlVars=JSON.parse(decodeURIComponent(urlParams.vars))}catch(Q){null!=window.console&&console.log("Error in vars URL parameter: "+Q)}null!=this.globalUrlVars&&(c=this.globalUrlVars[a])}return c};var z=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=
|
|
|
|
|
function(){z.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 x=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){x.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==
|
|
|
|
|
a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var c=0;c<a.actions.length;c++)if(null!=a.actions[c].open)if(this.isCustomLink(a.actions[c].open)){if(!this.customLinkClicked(a.actions[c].open))return}else this.openLink(a.actions[c].open);this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),
|
|
|
|
|
this.setSelectionCells(c));null!=a.highlight&&(c=this.getCellsForAction(a.highlight),this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(c=this.getCellsForAction(a.scroll));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=
|
|
|
|
|
function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))};Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var f=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=f},f));else{var d=this.model.getCell(a[b]);null!=d&&c.push(d)}return c};Graph.prototype.getCellsForTags=function(a,c,b){var f=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var d=
|
|
|
|
|
0;d<c.length;d++)if(this.model.isVertex(c[d])||this.model.isEdge(c[d])){var e=null!=c[d].value&&"object"==typeof c[d].value?mxUtils.trim(c[d].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),l=0;l<a.length&&g;l++)var p=mxUtils.trim(a[l]).toLowerCase(),g=g&&(0==p.length||0<=mxUtils.indexOf(e,p));else g=0==a.length;g&&f.push(c[d])}}return f};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],
|
|
|
|
|
!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,c){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],c)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,c,b,f){for(var d=0;d<a.length;d++)this.highlightCell(a[d],c,b,f)};Graph.prototype.highlightCell=function(a,c,b,f){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,
|
|
|
|
|
mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,c,d,!1);null!=f&&(e.opacity=f);e.highlight(a);window.setTimeout(function(){null!=e.shape&&(mxUtils.setPrefixedStyle(e.shape.node.style,"transition","all 1200ms ease-in-out"),e.shape.node.style.opacity=0);window.setTimeout(function(){e.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var f=a.ownerDocument,d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");
|
|
|
|
|
d.setAttribute("id",this.shadowId);var e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result",
|
|
|
|
|
"offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");e.setAttribute("flood-color",this.svgShadowColor);e.setAttribute("flood-opacity",this.svgShadowOpacity);e.setAttribute("result","offsetColor");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");e.setAttribute("in","offsetColor");e.setAttribute("in2","offsetBlur");e.setAttribute("operator","in");
|
|
|
|
|
e.setAttribute("result","offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");e.setAttribute("in","SourceGraphic");e.setAttribute("in2","offsetBlur");d.appendChild(e);e=a.getElementsByTagName("defs");0==e.length?(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=e[0];f.appendChild(d);b||(c=null!=c?c:a.getElementsByTagName("g")[0],
|
|
|
|
|
null!=c&&(c.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),c=a.getAttribute("viewBox"),null!=c&&0<c.length&&(c=c.split(" "),3<c.length&&(w=parseFloat(c[2])+6,h=parseFloat(c[3])+6,a.setAttribute("viewBox",c[0]+" "+c[1]+" "+w+" "+h))))));return d};Graph.prototype.setShadowVisible=function(a,c){mxClient.IS_SVG&&(c=null!=c?c:!0,(this.shadowVisible=
|
|
|
|
|
a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),c&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=this.model.getChildCount(this.model.root),c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.getValue(this.getCellStyle(c),"locked","0"));null!=c&&this.setDefaultParent(c)}};mxStencilRegistry.libraries.mockup=
|
|
|
|
|
[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+
|
|
|
|
|
"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+
|
|
|
|
|
"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/abstract"]=
|
|
|
|
|
[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",
|
|
|
|
|
STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",
|
|
|
|
|
STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=
|
|
|
|
|
[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[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.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 c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var u=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,f,d,e,g,l,p,n){if(null!=b&&null==mxMarker.markers[b]){var k=this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return u.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){x.value=Math.max(1,Math.min(l,Math.max(parseInt(x.value),parseInt(z.value))));z.value=
|
|
|
|
|
Math.max(1,Math.min(l,Math.min(parseInt(x.value),parseInt(z.value))))}function f(c){function b(c,b,d){var e=c.getGraphBounds(),g=0,l=0,n=ga.get(),p=1/c.pageScale,u=q.checked;if(u)var p=parseInt(P.value),k=parseInt(ca.value),p=Math.min(n.height*k/(e.height/c.view.scale),n.width*p/(e.width/c.view.scale));else p=parseInt(y.value)/(100*c.pageScale),isNaN(p)&&(f=1/c.pageScale,y.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*f);n.height=Math.ceil(n.height*f);p*=f;!u&&c.pageVisible?
|
|
|
|
|
(e=c.getPageLayout(),g-=e.x*n.width,l-=e.y*n.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,p,n,0,g,l,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var z=b.writeHead;b.writeHead=function(c){z.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var x=b.renderPage;b.renderPage=function(a,c,b,f,d,e){var g=mxClient.NO_FO;mxClient.NO_FO=
|
|
|
|
|
this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var l=x.apply(this,arguments);mxClient.NO_FO=g;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:l.className="geDisableMathJax";return l}}b.open(null,null,d,!0)}else{n=c.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor=n;b.autoOrigin=u;b.appendGraph(c,p,g,l,d,!0)}return b}var f=parseInt(W.value)/100;isNaN(f)&&(f=1,W.value="100 %");var f=.75*f,e=z.value,g=x.value,l=!u.checked,
|
|
|
|
|
n=null;l&&(l=e==p&&g==p);if(!l&&null!=a.pages&&a.pages.length){var k=0,l=a.pages.length-1;u.checked||(k=parseInt(e)-1,l=parseInt(g)-1);for(var r=k;r<=l;r++){var m=a.pages[r],e=m==a.currentPage?d:null;if(null==e){var e=a.createTemporaryGraph(d.getStylesheet()),g=!0,k=!1,G=null,B=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(g=m.viewState.pageVisible,k=m.viewState.mathEnabled,G=m.viewState.background,B=m.viewState.backgroundImage);e.background=G;e.backgroundImage=null!=
|
|
|
|
|
B?new mxImage(B.src,B.width,B.height):null;e.pageVisible=g;e.mathEnabled=k;var E=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?r+1:E.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);e.model.setRoot(m.root)}n=b(e,n,r!=l);e!=d&&e.container.parentNode.removeChild(e.container)}}else n=b(d);null==n?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(n.mathEnabled&&(l=n.wnd.document,l.writeln('<script type="text/x-mathjax-config">'),
|
|
|
|
|
l.writeln("MathJax.Hub.Config({"),l.writeln("showMathMenu: false,"),l.writeln('messageStyle: "none",'),l.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),l.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),l.writeln('"HTML-CSS": {'),l.writeln("imageFont: null"),l.writeln("},"),l.writeln("TeX: {"),l.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),l.writeln("},"),l.writeln("tex2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),
|
|
|
|
|
l.writeln("},"),l.writeln("asciimath2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("}"),l.writeln("});"),c&&(l.writeln("MathJax.Hub.Queue(function () {"),l.writeln("window.print();"),l.writeln("});")),l.writeln("\x3c/script>"),l.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),n.closeDocument(),!n.mathEnabled&&c&&PrintDialog.printPreview(n))}var d=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");
|
|
|
|
|
g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var l=1,p=1,n=document.createElement("div");n.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");n.appendChild(u);g=document.createElement("span");
|
|
|
|
|
mxUtils.write(g,mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var k=u.cloneNode(!0);u.setAttribute("checked","checked");k.setAttribute("value","range");n.appendChild(k);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");n.appendChild(g);var z=document.createElement("input");z.style.cssText="margin:0 8px 0 8px;";z.setAttribute("value","1");z.setAttribute("type","number");z.setAttribute("min","1");z.style.width="50px";n.appendChild(z);g=document.createElement("span");
|
|
|
|
|
mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var x=z.cloneNode(!0);n.appendChild(x);mxEvent.addListener(z,"focus",function(){k.checked=!0});mxEvent.addListener(x,"focus",function(){k.checked=!0});mxEvent.addListener(z,"change",b);mxEvent.addListener(x,"change",b);if(null!=a.pages&&(l=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){p=g+1;z.value=p;x.value=p;break}z.setAttribute("max",l);x.setAttribute("max",l);1<l&&e.appendChild(n);var r=document.createElement("div");
|
|
|
|
|
r.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");r.appendChild(m);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));r.appendChild(g);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","100 %");y.style.width="50px";r.appendChild(y);mxEvent.addListener(y,"focus",function(){m.checked=!0});
|
|
|
|
|
e.appendChild(r);var n=n.cloneNode(!1),q=m.cloneNode(!0);q.setAttribute("value","fit");m.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(q);n.appendChild(g);r=document.createElement("table");r.style.display="inline-block";var G=document.createElement("tbody"),E=document.createElement("tr"),t=E.cloneNode(!0),C=document.createElement("td"),v=C.cloneNode(!0),A=C.cloneNode(!0),fa=C.cloneNode(!0),
|
|
|
|
|
F=C.cloneNode(!0),ja=C.cloneNode(!0);C.style.textAlign="right";fa.style.textAlign="right";mxUtils.write(C,mxResources.get("fitTo"));var P=document.createElement("input");P.style.cssText="margin:0 8px 0 8px;";P.setAttribute("value","1");P.setAttribute("min","1");P.setAttribute("type","number");P.style.width="40px";v.appendChild(P);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));A.appendChild(g);mxUtils.write(fa,mxResources.get("fitToBy"));var ca=P.cloneNode(!0);
|
|
|
|
|
F.appendChild(ca);mxEvent.addListener(P,"focus",function(){q.checked=!0});mxEvent.addListener(ca,"focus",function(){q.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));ja.appendChild(g);E.appendChild(C);E.appendChild(v);E.appendChild(A);t.appendChild(fa);t.appendChild(F);t.appendChild(ja);G.appendChild(E);G.appendChild(t);r.appendChild(G);n.appendChild(r);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight=
|
|
|
|
|
"bold";g.style.marginBottom="12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ga=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","100 %");
|
|
|
|
|
W.style.width="60px";n.appendChild(W);e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:48px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&g.appendChild(n);a.isOffline()||(r=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),r.className="geBtn",g.appendChild(r));PrintDialog.previewEnabled&&(r=mxUtils.button(mxResources.get("preview"),
|
|
|
|
|
function(){a.hideDialog();f(!1)}),r.className="geBtn",g.appendChild(r));r=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});r.className="geBtn gePrimaryBtn";g.appendChild(r);a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var G=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)):(G.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 y=document.createElement("canvas"),E=new Image;E.onload=function(){try{y.getContext("2d").drawImage(E,0,0);var a=y.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(C){}};E.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(r){}})();
|
|
|
|
|
"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var g=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=document.createEventObject(a),c.type=a.type,c.canBubble=a.canBubble,c.cancelable=a.cancelable,c.view=a.view,c.detail=a.detail,c.screenX=a.screenX,c.screenY=a.screenY,c.clientX=a.clientX,c.clientY=a.clientY,c.ctrlKey=a.ctrlKey,c.altKey=a.altKey,c.shiftKey=a.shiftKey,c.metaKey=a.metaKey,c.button=
|
|
|
|
|
a.button,c.relatedTarget=a.relatedTarget}catch(H){}}g.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var f=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=
|
|
|
|
|
this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if(null!=c){if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=
|
|
|
|
|
c.marginBottom||0;b.resizeParent=!1;return b}if("undefined"!=typeof mxTableLayout&&"tableLayout"==c.childLayout)return b=new mxTableLayout(this.graph),b.rows=c.tableRows||2,b.columns=c.tableColumns||2,b.colPercentages=c.colPercentages,b.rowPercentages=c.rowPercentages,b.equalColumns="1"==mxUtils.getValue(c,"equalColumns",b.colPercentages?"0":"1"),b.equalRows="1"==mxUtils.getValue(c,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(c,"resizeParent","1"),b.border=c.tableBorder||
|
|
|
|
|
b.border,b.marginLeft=c.marginLeft||0,b.marginRight=c.marginRight||0,b.marginTop=c.marginTop||0,b.marginBottom=c.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(c,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(c,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=c.colWidths||"100",b.rowHeights=c.rowHeights||"50",b}return f.apply(this,arguments)}};var n=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;if(null!=this.themes&&"darkTheme"==this.defaultThemeName){a=this.stylesheet;
|
|
|
|
|
this.stylesheet=new mxStylesheet;var c=this.themes["default-style2"];(new mxCodec(c.ownerDocument)).decode(c,this.getStylesheet());this.refresh()}c=n.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return c};var l=Graph.prototype.isCssTransformsSupported;Graph.prototype.isCssTransformsSupported=function(){return l.apply(this,arguments)&&!mxClient.IS_SF};var p=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=p.apply(this,arguments);if(null==c){if(null==
|
|
|
|
|
this.globalUrlVars&&null!=urlParams.vars)try{this.globalUrlVars=JSON.parse(decodeURIComponent(urlParams.vars))}catch(Q){null!=window.console&&console.log("Error in vars URL parameter: "+Q)}null!=this.globalUrlVars&&(c=this.globalUrlVars[a])}return c};var y=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){y.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 x=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){x.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var c=0;c<a.actions.length;c++)if(null!=a.actions[c].open)if(this.isCustomLink(a.actions[c].open)){if(!this.customLinkClicked(a.actions[c].open))return}else this.openLink(a.actions[c].open);
|
|
|
|
|
this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),this.setSelectionCells(c));null!=a.highlight&&(c=this.getCellsForAction(a.highlight),this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&
|
|
|
|
|
this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(c=this.getCellsForAction(a.scroll));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))};Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var f=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=
|
|
|
|
|
f},f));else{var d=this.model.getCell(a[b]);null!=d&&c.push(d)}return c};Graph.prototype.getCellsForTags=function(a,c,b){var f=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var d=0;d<c.length;d++)if(this.model.isVertex(c[d])||this.model.isEdge(c[d])){var e=null!=c[d].value&&"object"==typeof c[d].value?mxUtils.trim(c[d].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),l=0;l<a.length&&g;l++)var p=mxUtils.trim(a[l]).toLowerCase(),
|
|
|
|
|
g=g&&(0==p.length||0<=mxUtils.indexOf(e,p));else g=0==a.length;g&&f.push(c[d])}}return f};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,c){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],c)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,c,b,f){for(var d=0;d<
|
|
|
|
|
a.length;d++)this.highlightCell(a[d],c,b,f)};Graph.prototype.highlightCell=function(a,c,b,f){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,c,d,!1);null!=f&&(e.opacity=f);e.highlight(a);window.setTimeout(function(){null!=e.shape&&(mxUtils.setPrefixedStyle(e.shape.node.style,"transition","all 1200ms ease-in-out"),e.shape.node.style.opacity=0);window.setTimeout(function(){e.destroy()},
|
|
|
|
|
1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var f=a.ownerDocument,d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");d.setAttribute("id",this.shadowId);var e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");d.appendChild(e);e=null!=f.createElementNS?
|
|
|
|
|
f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result","offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");e.setAttribute("flood-color",this.svgShadowColor);e.setAttribute("flood-opacity",this.svgShadowOpacity);e.setAttribute("result","offsetColor");d.appendChild(e);
|
|
|
|
|
e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");e.setAttribute("in","offsetColor");e.setAttribute("in2","offsetBlur");e.setAttribute("operator","in");e.setAttribute("result","offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");e.setAttribute("in","SourceGraphic");e.setAttribute("in2","offsetBlur");d.appendChild(e);e=a.getElementsByTagName("defs");0==e.length?
|
|
|
|
|
(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=e[0];f.appendChild(d);b||(c=null!=c?c:a.getElementsByTagName("g")[0],null!=c&&(c.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),c=a.getAttribute("viewBox"),null!=c&&0<c.length&&
|
|
|
|
|
(c=c.split(" "),3<c.length&&(w=parseFloat(c[2])+6,h=parseFloat(c[3])+6,a.setAttribute("viewBox",c[0]+" "+c[1]+" "+w+" "+h))))));return d};Graph.prototype.setShadowVisible=function(a,c){mxClient.IS_SVG&&(c=null!=c?c:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),c&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=
|
|
|
|
|
this.model.getChildCount(this.model.root),c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.getValue(this.getCellStyle(c),"locked","0"));null!=c&&this.setDefaultParent(c)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",
|
|
|
|
|
STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=
|
|
|
|
|
[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",
|
|
|
|
|
STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=
|
|
|
|
|
[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=
|
|
|
|
|
[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",
|
|
|
|
|
STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[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.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 c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var u=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,f,d,e,g,l,p,n){if(null!=b&&null==mxMarker.markers[b]){var k=
|
|
|
|
|
this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return u.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){r.value=Math.max(1,Math.min(l,Math.max(parseInt(r.value),parseInt(y.value))));y.value=Math.max(1,Math.min(l,Math.min(parseInt(r.value),parseInt(y.value))))}function f(c){function b(c,b,d){var e=c.getGraphBounds(),g=0,l=0,n=ga.get(),p=1/c.pageScale,u=q.checked;if(u)var p=parseInt(P.value),k=parseInt(ca.value),p=Math.min(n.height*k/(e.height/c.view.scale),
|
|
|
|
|
n.width*p/(e.width/c.view.scale));else p=parseInt(z.value)/(100*c.pageScale),isNaN(p)&&(f=1/c.pageScale,z.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*f);n.height=Math.ceil(n.height*f);p*=f;!u&&c.pageVisible?(e=c.getPageLayout(),g-=e.x*n.width,l-=e.y*n.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,p,n,0,g,l,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var y=b.writeHead;b.writeHead=function(c){y.apply(this,arguments);
|
|
|
|
|
null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var x=b.renderPage;b.renderPage=function(a,c,b,f,d,e){var g=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var l=x.apply(this,arguments);mxClient.NO_FO=g;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:l.className="geDisableMathJax";return l}}b.open(null,null,d,!0)}else{n=
|
|
|
|
|
c.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor=n;b.autoOrigin=u;b.appendGraph(c,p,g,l,d,!0)}return b}var f=parseInt(W.value)/100;isNaN(f)&&(f=1,W.value="100 %");var f=.75*f,e=y.value,g=r.value,l=!u.checked,n=null;l&&(l=e==p&&g==p);if(!l&&null!=a.pages&&a.pages.length){var k=0,l=a.pages.length-1;u.checked||(k=parseInt(e)-1,l=parseInt(g)-1);for(var x=k;x<=l;x++){var m=a.pages[x],e=m==a.currentPage?d:null;if(null==e){var e=a.createTemporaryGraph(d.getStylesheet()),
|
|
|
|
|
g=!0,k=!1,G=null,B=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(g=m.viewState.pageVisible,k=m.viewState.mathEnabled,G=m.viewState.background,B=m.viewState.backgroundImage);e.background=G;e.backgroundImage=null!=B?new mxImage(B.src,B.width,B.height):null;e.pageVisible=g;e.mathEnabled=k;var E=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?x+1:E.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);
|
|
|
|
|
e.model.setRoot(m.root)}n=b(e,n,x!=l);e!=d&&e.container.parentNode.removeChild(e.container)}}else n=b(d);null==n?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(n.mathEnabled&&(l=n.wnd.document,l.writeln('<script type="text/x-mathjax-config">'),l.writeln("MathJax.Hub.Config({"),l.writeln("showMathMenu: false,"),l.writeln('messageStyle: "none",'),l.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),l.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
|
|
|
|
|
l.writeln('"HTML-CSS": {'),l.writeln("imageFont: null"),l.writeln("},"),l.writeln("TeX: {"),l.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),l.writeln("},"),l.writeln("tex2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("},"),l.writeln("asciimath2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("}"),l.writeln("});"),c&&(l.writeln("MathJax.Hub.Queue(function () {"),l.writeln("window.print();"),l.writeln("});")),l.writeln("\x3c/script>"),
|
|
|
|
|
l.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),n.closeDocument(),!n.mathEnabled&&c&&PrintDialog.printPreview(n))}var d=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var l=1,p=1,n=document.createElement("div");n.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");n.appendChild(u);g=document.createElement("span");mxUtils.write(g,mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var k=u.cloneNode(!0);u.setAttribute("checked","checked");k.setAttribute("value","range");n.appendChild(k);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+
|
|
|
|
|
":");n.appendChild(g);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","1");y.setAttribute("type","number");y.setAttribute("min","1");y.style.width="50px";n.appendChild(y);g=document.createElement("span");mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var r=y.cloneNode(!0);n.appendChild(r);mxEvent.addListener(y,"focus",function(){k.checked=!0});mxEvent.addListener(r,"focus",function(){k.checked=!0});mxEvent.addListener(y,"change",b);mxEvent.addListener(r,
|
|
|
|
|
"change",b);if(null!=a.pages&&(l=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){p=g+1;y.value=p;r.value=p;break}y.setAttribute("max",l);r.setAttribute("max",l);1<l&&e.appendChild(n);var x=document.createElement("div");x.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");x.appendChild(m);g=document.createElement("span");
|
|
|
|
|
mxUtils.write(g,mxResources.get("adjustTo"));x.appendChild(g);var z=document.createElement("input");z.style.cssText="margin:0 8px 0 8px;";z.setAttribute("value","100 %");z.style.width="50px";x.appendChild(z);mxEvent.addListener(z,"focus",function(){m.checked=!0});e.appendChild(x);var n=n.cloneNode(!1),q=m.cloneNode(!0);q.setAttribute("value","fit");m.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";
|
|
|
|
|
g.appendChild(q);n.appendChild(g);x=document.createElement("table");x.style.display="inline-block";var G=document.createElement("tbody"),E=document.createElement("tr"),t=E.cloneNode(!0),C=document.createElement("td"),v=C.cloneNode(!0),A=C.cloneNode(!0),fa=C.cloneNode(!0),F=C.cloneNode(!0),ja=C.cloneNode(!0);C.style.textAlign="right";fa.style.textAlign="right";mxUtils.write(C,mxResources.get("fitTo"));var P=document.createElement("input");P.style.cssText="margin:0 8px 0 8px;";P.setAttribute("value",
|
|
|
|
|
"1");P.setAttribute("min","1");P.setAttribute("type","number");P.style.width="40px";v.appendChild(P);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));A.appendChild(g);mxUtils.write(fa,mxResources.get("fitToBy"));var ca=P.cloneNode(!0);F.appendChild(ca);mxEvent.addListener(P,"focus",function(){q.checked=!0});mxEvent.addListener(ca,"focus",function(){q.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));ja.appendChild(g);
|
|
|
|
|
E.appendChild(C);E.appendChild(v);E.appendChild(A);t.appendChild(fa);t.appendChild(F);t.appendChild(ja);G.appendChild(E);G.appendChild(t);x.appendChild(G);n.appendChild(x);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom="12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ga=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||
|
|
|
|
|
mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","100 %");W.style.width="60px";n.appendChild(W);e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:48px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&
|
|
|
|
|
g.appendChild(n);a.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",g.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),x.className="geBtn",g.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});x.className="geBtn gePrimaryBtn";g.appendChild(x);
|
|
|
|
|
a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var G=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)):(G.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 z=
|
|
|
|
|
document.createElement("canvas"),E=new Image;E.onload=function(){try{z.getContext("2d").drawImage(E,0,0);var a=z.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(C){}};E.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(r){}})();
|
|
|
|
|
var ErrorDialog=function(a,b,e,d,k,m,q,t,v,A,c){v=null!=v?v:!0;var f=document.createElement("div");f.style.textAlign="center";if(null!=b){var g=document.createElement("div");g.style.padding="0px";g.style.margin="0px";g.style.fontSize="18px";g.style.paddingBottom="16px";g.style.marginBottom="10px";g.style.borderBottom="1px solid #c0c0c0";g.style.color="gray";g.style.whiteSpace="nowrap";g.style.textOverflow="ellipsis";g.style.overflow="hidden";mxUtils.write(g,b);g.setAttribute("title",b);f.appendChild(g)}b=
|
|
|
|
|
document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=e;f.appendChild(b);e=document.createElement("div");e.style.marginTop="12px";e.style.textAlign="center";null!=m&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();m()}),b.className="geBtn",e.appendChild(b),e.style.textAlign="center");null!=A&&(A=mxUtils.button(A,function(){null!=c&&c()}),A.className="geBtn",e.appendChild(A));var n=mxUtils.button(d,function(){v&&a.hideDialog();null!=k&&k()});
|
|
|
|
|
n.className="geBtn";e.appendChild(n);null!=q&&(d=mxUtils.button(q,function(){v&&a.hideDialog();null!=t&&t()}),d.className="geBtn gePrimaryBtn",e.appendChild(d));this.init=function(){n.focus()};f.appendChild(e);this.container=f};
|
|
|
|
@ -2908,7 +2909,7 @@ EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1=
|
|
|
|
|
encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=l&&null!=l.stack?"&stack="+encodeURIComponent(l.stack):"")}}catch(x){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):
|
|
|
|
|
"")}catch(g){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(g){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
|
|
|
|
|
console.log.apply(console,a)}}catch(g){}};EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
|
|
|
|
|
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=38;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
|
|
|
|
|
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=25E3;EditorUi.prototype.sidebarFooterHeight=38;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
|
|
|
|
|
EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=
|
|
|
|
|
!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(l){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,
|
|
|
|
|
0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(p){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}try{b=document.createElement("canvas");b.width=b.height=1;var e=
|
|
|
|
@ -2919,7 +2920,7 @@ g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6p
|
|
|
|
|
(e+="..."),g.innerHTML=e,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),
|
|
|
|
|
c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};
|
|
|
|
|
EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(n){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,
|
|
|
|
|
"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var l=mxUtils.parseXml(c),p=this.editor.extractGraphModel(l.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=p?mxUtils.getXml(p):""}catch(z){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=
|
|
|
|
|
"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var l=mxUtils.parseXml(c),p=this.editor.extractGraphModel(l.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=p?mxUtils.getXml(p):""}catch(y){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+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 c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var p=this.updatePageRoot(new DiagramPage(d[e]));
|
|
|
|
|
null==p.getName()&&p.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,p,0==e?p: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])),c.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++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,l,p,k,x,u,m){b=null!=b?b:this.editor.graph;l=null!=l?l:!1;u=null!=u?u:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var n=Graph.zapGremlins(mxUtils.getXml(a)),g=Graph.compress(n);if(Graph.decompress(g)!=
|
|
|
|
@ -2944,15 +2945,15 @@ c=c[0].getElementsByTagName("div"),0<c.length&&(a=mxUtils.getTextContent(c[0])),
|
|
|
|
|
[a+1]));this.pages.push(d);null!=urlParams["page-id"]&&d.getId()==urlParams["page-id"]&&(b=d)}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)};EditorUi.prototype.getBaseFilename=function(a){var c=this.getCurrentFile(),c=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c)||/(\.drawio)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&
|
|
|
|
|
(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile=function(a,b,d,e,l,p,k){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!l),f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,l));this.saveData(f,a,g,"text/xml")}else if("html"==a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,g,"text/html");else if("svg"!=
|
|
|
|
|
a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var f=this.editor.graph.pageVisible;null!=p&&(this.editor.graph.pageVisible=p);var d=this.createDownloadRequest(c,a,e,b,k,l);this.editor.graph.pageVisible=f;return d}catch(B){this.handleError(B)}}));else{var n=null,z=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
|
|
|
|
|
mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(n)}))});if("svg"==a){var r=this.editor.graph.background;if(k||r==mxConstants.NONE)r=null;var m=this.editor.graph.getSvg(r,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(m);this.convertImages(m,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();z('<?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 f=
|
|
|
|
|
c+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();z(a)}),e)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e,l,p){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==p?!1:"xmlpng"!=b);var f="",g="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";"pdf"==b&&0==p&&(g="&allPages=1");if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&
|
|
|
|
|
a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var f=this.editor.graph.pageVisible;null!=p&&(this.editor.graph.pageVisible=p);var d=this.createDownloadRequest(c,a,e,b,k,l);this.editor.graph.pageVisible=f;return d}catch(B){this.handleError(B)}}));else{var n=null,y=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
|
|
|
|
|
mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(n)}))});if("svg"==a){var m=this.editor.graph.background;if(k||m==mxConstants.NONE)m=null;var q=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(q);this.convertImages(q,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();y('<?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 f=
|
|
|
|
|
c+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();y(a)}),e)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e,l,p){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==p?!1:"xmlpng"!=b);var f="",g="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";"pdf"==b&&0==p&&(g="&allPages=1");if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&
|
|
|
|
|
null!=this.currentPage))for(p=0;p<this.pages.length;p++)if(this.pages[p]==this.currentPage){f="&from="+p;break}p=this.editor.graph.background;"png"==b&&l&&(p=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+f+g+"&bg="+(null!=p?p:mxConstants.NONE)+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,
|
|
|
|
|
f=mxUtils.bind(this,function(f){var d=null!=a.data?a.data:"";null!=f&&0<f.length&&(0<d.length&&(d+="\n"),d+=f);f=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);f.getHash=function(){return c};this.fileLoaded(f);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?
|
|
|
|
|
parseInt(a.interval):6E4,g=null,l=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),p()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),p=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(l,
|
|
|
|
|
e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){p();l()}));p();l()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&!this.editor.isCorsEnabledForUrl(e)&&(e=PROXY_URL+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,
|
|
|
|
|
a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=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,p=e.getModel();p.beginUpdate();var k=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var m=p.getCell(a.getAttribute("id"));if(null!=m){try{var u=a.getAttribute("value");if(null!=u){var q=mxUtils.parseXml(u).documentElement;if(null!=q)if("1"==q.getAttribute("replace-value"))p.setValue(m,
|
|
|
|
|
q);else for(var y=q.attributes,E=0;E<y.length;E++)e.setAttributeForCell(m,y[E].nodeName,0<y[E].nodeValue.length?y[E].nodeValue:null)}}catch(I){null!=window.console&&console.log("Error in value for "+m.id+": "+I)}try{var r=a.getAttribute("style");null!=r&&e.model.setStyle(m,r)}catch(I){null!=window.console&&console.log("Error in style for "+m.id+": "+I)}try{var t=a.getAttribute("icon");if(null!=t){var v=0<t.length?JSON.parse(t):null;null!=v&&v.append||e.removeCellOverlays(m);null!=v&&e.addCellOverlay(m,
|
|
|
|
|
q);else for(var z=q.attributes,E=0;E<z.length;E++)e.setAttributeForCell(m,z[E].nodeName,0<z[E].nodeValue.length?z[E].nodeValue:null)}}catch(I){null!=window.console&&console.log("Error in value for "+m.id+": "+I)}try{var r=a.getAttribute("style");null!=r&&e.model.setStyle(m,r)}catch(I){null!=window.console&&console.log("Error in style for "+m.id+": "+I)}try{var t=a.getAttribute("icon");if(null!=t){var v=0<t.length?JSON.parse(t):null;null!=v&&v.append||e.removeCellOverlays(m);null!=v&&e.addCellOverlay(m,
|
|
|
|
|
c(v))}}catch(I){null!=window.console&&console.log("Error in icon for "+m.id+": "+I)}try{var A=a.getAttribute("geometry");if(null!=A){var A=JSON.parse(A),M=e.getCellGeometry(m);if(null!=M){M=M.clone();for(key in A){var H=parseFloat(A[key]);"dx"==key?M.x+=H:"dy"==key?M.y+=H:"dw"==key?M.width+=H:"dh"==key?M.height+=H:M[key]=parseFloat(A[key])}e.model.setGeometry(m,M)}}}catch(I){null!=window.console&&console.log("Error in icon for "+m.id+": "+I)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=
|
|
|
|
|
B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,p)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(e.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))e.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(k=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{p.endUpdate()}null!=
|
|
|
|
|
k&&this.chromelessResize&&this.chromelessResize(!0,k)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,f="",d=c.lastIndexOf(".");0<=d&&(f=c.substring(d),c=c.substring(0,d));if(b)var e=new Date,d=e.getFullYear(),k=e.getMonth()+1,m=e.getDate(),u=e.getHours(),q=e.getMinutes(),e=e.getSeconds(),c=c+(" "+(d+"-"+k+"-"+m+"-"+u+"-"+q+"-"+e));return c=mxResources.get("copyOf",[c])+f};EditorUi.prototype.fileLoaded=function(a,b){var c=
|
|
|
|
@ -2960,8 +2961,8 @@ this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var f=
|
|
|
|
|
(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();b||this.showSplash()});if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();
|
|
|
|
|
delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),null!=a.backupPatch&&a.patch([a.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!this.editor.isChromelessView()||this.editor.editable?
|
|
|
|
|
(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));f=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getMode()+"."+a.getSize()});if(this.editor.editable&&this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(),
|
|
|
|
|
title:a.getTitle(),mode:a.getMode()})}catch(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&console.log("error in fileLoaded:",a,z);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=z&&null!=z.message?":err:"+
|
|
|
|
|
encodeURIComponent(z.message):"")+(null!=z&&null!=z.stack?"&stack="+encodeURIComponent(z.stack):"")}catch(x){}var e=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?this.fileLoaded(c):d()});b?e():this.handleError(z,mxResources.get("errorLoadingFile"),e,!0)}else d();return f};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,f=new mxGraphModel,d=new mxCodec;null!=b&&
|
|
|
|
|
title:a.getTitle(),mode:a.getMode()})}catch(y){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(y){}}catch(y){this.fileLoadedError=y;null!=window.console&&console.log("error in fileLoaded:",a,y);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=y&&null!=y.message?":err:"+
|
|
|
|
|
encodeURIComponent(y.message):"")+(null!=y&&null!=y.stack?"&stack="+encodeURIComponent(y.stack):"")}catch(x){}var e=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?this.fileLoaded(c):d()});b?e():this.handleError(y,mxResources.get("errorLoadingFile"),e,!0)}else d();return f};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,f=new mxGraphModel,d=new mxCodec;null!=b&&
|
|
|
|
|
(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var k=a[e].node.cloneNode(!1);k.removeAttribute("name");f.root=a[e].root;var m=d.encode(f);this.editor.graph.saveViewState(a[e].viewState,m,!0);m.removeAttribute("pageWidth");m.removeAttribute("pageHeight");k.appendChild(m);null!=b&&(b.eltCount+=k.getElementsByTagName("*").length,b.nodeCount+=k.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(k,function(a,c,b,f){return!f||
|
|
|
|
|
"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=c&&"y"!=c&&"width"!=c&&"height"!=c?f&&"mxCell"==a.nodeName&&"previous"==c?null:b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){var c=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(c^=this.hashValue(a.nodeName,b,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=
|
|
|
|
|
a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=g&&(c^=this.hashValue(e,b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
|
|
|
|
@ -2971,20 +2972,20 @@ delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(
|
|
|
|
|
JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:
|
|
|
|
|
null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),f.className="geDropTarget",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b=
|
|
|
|
|
"shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),
|
|
|
|
|
d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var u=k.parentNode.previousSibling;d=u.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&u.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var m=document.createElement("div");m.style.position="absolute";m.style.right="0px";m.style.top="0px";m.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(m.style.backgroundColor="inherit");u.style.position="relative";var y=document.createElement("img");
|
|
|
|
|
y.setAttribute("src",Dialog.prototype.closeImage);y.setAttribute("title",mxResources.get("close"));y.setAttribute("valign","absmiddle");y.setAttribute("border","0");y.style.margin="0 3px";var q=null;if(".scratchpad"!=a.title||this.closableScratchpad)m.appendChild(y),mxEvent.addListener(y,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):
|
|
|
|
|
b();mxEvent.consume(c)}}));if(a.isEditable()){var r=this.editor.graph,t=null,v=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),A=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=y.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",m.insertBefore(t,
|
|
|
|
|
m.firstChild),u.style.paddingRight=18*m.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),u.style.paddingRight=18*m.childNodes.length+"px")})):null==q&&(q=y.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title",mxResources.get("save")),m.insertBefore(q,m.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==
|
|
|
|
|
d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var u=k.parentNode.previousSibling;d=u.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&u.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var m=document.createElement("div");m.style.position="absolute";m.style.right="0px";m.style.top="0px";m.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(m.style.backgroundColor="inherit");u.style.position="relative";var z=document.createElement("img");
|
|
|
|
|
z.setAttribute("src",Dialog.prototype.closeImage);z.setAttribute("title",mxResources.get("close"));z.setAttribute("valign","absmiddle");z.setAttribute("border","0");z.style.margin="0 3px";var q=null;if(".scratchpad"!=a.title||this.closableScratchpad)m.appendChild(z),mxEvent.addListener(z,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):
|
|
|
|
|
b();mxEvent.consume(c)}}));if(a.isEditable()){var r=this.editor.graph,t=null,v=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),A=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=z.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",m.insertBefore(t,
|
|
|
|
|
m.firstChild),u.style.paddingRight=18*m.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),u.style.paddingRight=18*m.childNodes.length+"px")})):null==q&&(q=z.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title",mxResources.get("save")),m.insertBefore(q,m.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==
|
|
|
|
|
LocalLibrary,!0,function(){null==q||a.isModified()||(u.style.paddingRight=18*m.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(c)})),u.style.paddingRight=18*m.childNodes.length+"px")}),M=mxUtils.bind(this,function(a,c,d,e){a=r.cloneCells(mxUtils.sortCells(r.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var l=r.getCellGeometry(a[g]);null!=l&&l.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),
|
|
|
|
|
w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);A(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(r.isSelectionEmpty())r.getRubberband().isActive()?(r.getRubberband().execute(a),r.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=r.getSelectionCells(),b=r.view.getBounds(c),d=r.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=r.view.translate.x;
|
|
|
|
|
b.y-=r.view.translate.y;M(c,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.panningManager&&null!=r.graphHandler.shape&&(r.graphHandler.shape.node.style.visibility="hidden",k.style.backgroundColor="#f1f3f4",k.style.cursor="copy",r.panningManager.stop(),r.autoScroll=!1,null!=r.graphHandler.guide&&r.graphHandler.guide.setVisible(!1),null!=r.graphHandler.hint&&(r.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),
|
|
|
|
|
mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.panningManager&&null!=r.graphHandler&&(k.style.backgroundColor="",k.style.cursor="default",this.sidebar.showTooltips=!0,r.panningManager.stop(),r.graphHandler.reset(),r.isMouseDown=!1,r.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.graphHandler.shape&&(r.graphHandler.shape.node.style.visibility="visible",k.style.backgroundColor="",k.style.cursor="",r.autoScroll=
|
|
|
|
|
!0,null!=r.graphHandler.guide&&r.graphHandler.guide.setVisible(!0),null!=r.graphHandler.hint&&(r.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){k.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.cursor="";k.style.backgroundColor="";0<a.dataTransfer.files.length&&
|
|
|
|
|
this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,l,p,n,u,m,r){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,n),c)],c[0].vertex=!0,M(c,new mxRectangle(0,0,p,n),a,mxEvent.isAltDown(a)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var z=
|
|
|
|
|
!1,y=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(g.documentElement));e(l,k);b=b.concat(l);A(a);this.spinner.stop();z=!0}catch(F){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var l=mxUtils.getTextContent(p[g]),n=this.stringToCells(Graph.decompress(l)),u=this.editor.graph.getBoundingBoxFromGeometry(n);
|
|
|
|
|
M(n,new mxRectangle(0,0,u.width,u.height),a)}z=!0}catch(F){null!=window.console&&console.log("error in drop handler:",F)}}z||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=r&&null!=u&&(/(\.v(dx|sdx?))($|\?)/i.test(u)||/(\.vs(x|sx?))($|\?)/i.test(u))?this.importVisio(r,function(a){y(a,"text/xml")},null,u):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
|
|
|
|
|
u)&&null!=r?this.parseFile(r,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?y(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):y(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){k.style.cursor="";k.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));y=y.cloneNode(!1);y.setAttribute("src",
|
|
|
|
|
Editor.editImage);y.setAttribute("title",mxResources.get("edit"));m.insertBefore(y,m.firstChild);mxEvent.addListener(y,"click",v);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&v(a)});d=y.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));m.insertBefore(d,m.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",
|
|
|
|
|
this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,l,p,n,u,m,y){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,n),c)],c[0].vertex=!0,M(c,new mxRectangle(0,0,p,n),a,mxEvent.isAltDown(a)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var r=
|
|
|
|
|
!1,z=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(g.documentElement));e(l,k);b=b.concat(l);A(a);this.spinner.stop();r=!0}catch(F){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var l=mxUtils.getTextContent(p[g]),n=this.stringToCells(Graph.decompress(l)),u=this.editor.graph.getBoundingBoxFromGeometry(n);
|
|
|
|
|
M(n,new mxRectangle(0,0,u.width,u.height),a)}r=!0}catch(F){null!=window.console&&console.log("error in drop handler:",F)}}r||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=y&&null!=u&&(/(\.v(dx|sdx?))($|\?)/i.test(u)||/(\.vs(x|sx?))($|\?)/i.test(u))?this.importVisio(y,function(a){z(a,"text/xml")},null,u):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
|
|
|
|
|
u)&&null!=y?this.parseFile(y,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?z(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):z(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){k.style.cursor="";k.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));z=z.cloneNode(!1);z.setAttribute("src",
|
|
|
|
|
Editor.editImage);z.setAttribute("title",mxResources.get("edit"));m.insertBefore(z,m.firstChild);mxEvent.addListener(z,"click",v);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&v(a)});d=z.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));m.insertBefore(d,m.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",
|
|
|
|
|
mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),m.insertBefore(d,m.firstChild))}u.appendChild(m);u.style.paddingRight=18*m.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
|
|
|
|
|
"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(Graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&
|
|
|
|
|
(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=
|
|
|
|
@ -2997,15 +2998,15 @@ b.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils
|
|
|
|
|
mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d,e){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=
|
|
|
|
|
b){var g=mxUtils.htmlEntities(mxResources.get("unknownError")),n=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(n=mxResources.get("cancel"),k=function(){c();f.retry()}),404==f.code||404==f.status||403==f.code){var g=403==f.code?null!=f.message?mxUtils.htmlEntities(f.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")),m=window.location.hash;if(null!=m&&"#G"==m.substring(0,2)&&null!=
|
|
|
|
|
a&&null!=a.error&&null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason){m=m.substring(2);this.showError(b,g,mxResources.get("cancel"),null,k,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+m)}),null,null,380);return}}else null!=f.message?g=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error?g=mxUtils.htmlEntities(f.response.error):"undefined"!==window.App&&(f.code==
|
|
|
|
|
App.ERROR_TIMEOUT?g=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(g=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,g,n,d,k,null,null,null,null,null,null,null,e?d:null)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,l,p,k,m,u,q,y,E,r){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,l,p,k,E,m,u);this.showDialog(a.container,q||340,y||(null!=b&&120<b.length?180:150),!0,!1,r);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
|
|
|
|
|
App.ERROR_TIMEOUT?g=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(g=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,g,n,d,k,null,null,null,null,null,null,null,e?d:null)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,l,p,k,m,u,q,z,E,r){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,l,p,k,E,m,u);this.showDialog(a.container,q||340,z||(null!=b&&120<b.length?180:150),!0,!1,r);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
|
|
|
|
|
null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,l,p){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,l);this.showDialog(a.container,340,90,!0,p);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
|
|
|
|
|
function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(Graph.compress(b))));return c};EditorUi.prototype.saveCanvas=
|
|
|
|
|
function(a,b,d){var c="jpeg"==d?"jpg":d,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=
|
|
|
|
|
function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,l){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,
|
|
|
|
|
!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else{var c=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof c.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);
|
|
|
|
|
try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(u){}}else this.createEchoRequest(a,b,d,e,l).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,l,p){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=l?"&format="+l:"")+(null!=p?"&base64="+p:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=
|
|
|
|
|
b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var m=1024*k,u=Math.min(m+1024,d),q=Array(u-m),y=0;m<u;++y,++m)q[y]=c[m].charCodeAt(0);e[k]=new Uint8Array(q)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,l,p,k){p=null!=p?p:!1;k=null!=k?k:"vsdx"!=l&&(!mxClient.IS_IOS||!navigator.standalone);l=this.getServiceCount(p);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||
|
|
|
|
|
"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(E){this.handleError(E)}}))}catch(y){this.handleError(y)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
|
|
|
|
b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),k=0;k<f;++k){for(var m=1024*k,u=Math.min(m+1024,d),q=Array(u-m),z=0;m<u;++z,++m)q[z]=c[m].charCodeAt(0);e[k]=new Uint8Array(q)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,l,p,k){p=null!=p?p:!1;k=null!=k?k:"vsdx"!=l&&(!mxClient.IS_IOS||!navigator.standalone);l=this.getServiceCount(p);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||
|
|
|
|
|
"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(E){this.handleError(E)}}))}catch(z){this.handleError(z)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
|
|
|
|
mxResources.get("download"),!1,p,k,null,1<l,4<l&&(!p||6>l)?3:4,a,d,e);this.showDialog(b.container,420,1==l?160:4<l?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c||null==c.document?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+
|
|
|
|
|
'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=c&&null!=c.document||mxUtils.popup(a,!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
|
|
|
|
|
this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding=
|
|
|
|
@ -3026,14 +3027,14 @@ mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addLi
|
|
|
|
|
f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=
|
|
|
|
|
mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,l,p,k,m){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
|
|
|
|
|
a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=l&&0<l.length&&f.push("edit="+encodeURIComponent(l)),p&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));d&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&f.push("page-id="+this.currentPage.getId());a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),m||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,
|
|
|
|
|
null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,l,k,m,x,u,q,y){this.getBasenames();
|
|
|
|
|
null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,l,k,m,x,u,q,z){this.getBasenames();
|
|
|
|
|
var c={};""!=l&&l!=mxConstants.NONE&&(c.highlight=l);"auto"!==e&&(c.target=e);u||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];m&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);x&&d.push("layers");0<d.length&&(u&&d.push("lightbox"),c.toolbar=d.join(" "));null!=q&&0<q.length&&(c.edit=q);null!=a?c.url=a:c.xml=this.getFileData(!0,
|
|
|
|
|
null,null,null,null,!m);b='<div class="mxgraph" style="'+(k?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";y(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
|
|
|
|
|
null,null,null,null,!m);b='<div class="mxgraph" style="'+(k?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";z(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
|
|
|
|
|
"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.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";c.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText=
|
|
|
|
|
"margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(n);mxUtils.br(g);g.appendChild(k);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));g.appendChild(n);var m=this.getCurrentFile();
|
|
|
|
|
null==d&&null!=m&&m.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),g.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(g);var y=this.addLinkSection(c),q=this.addCheckbox(c,
|
|
|
|
|
null==d&&null!=m&&m.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),g.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(g);var z=this.addLinkSection(c),q=this.addCheckbox(c,
|
|
|
|
|
mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";c.appendChild(r);var t=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,v=v=this.addCheckbox(c,mxResources.get("allPages"),g,!g),A=this.addCheckbox(c,mxResources.get("layers"),!0),M=this.addCheckbox(c,mxResources.get("lightbox"),
|
|
|
|
|
!0),H=this.addEditButton(c,M),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(M,"change",function(){M.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&M.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,q.checked,r.value,y.getTarget(),y.getColor(),t.checked,v.checked,A.checked,M.checked,H.getLink())}),null,a,
|
|
|
|
|
!0),H=this.addEditButton(c,M),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(M,"change",function(){M.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&M.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,q.checked,r.value,z.getTarget(),z.getColor(),t.checked,v.checked,A.checked,M.checked,H.getLink())}),null,a,
|
|
|
|
|
b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,l,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&
|
|
|
|
|
!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));n.style.marginTop=
|
|
|
|
|
"12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"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,
|
|
|
|
@ -3043,12 +3044,12 @@ r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="5
|
|
|
|
|
!0:t.checked,v.checked,A.getLink(),B.checked,null!=m?m.value:null,null!=r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,
|
|
|
|
|
mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),f=this.editor.graph,n=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,c,
|
|
|
|
|
mxUtils.bind(this,function(){d(!g.checked,null!=k?k.checked:!1,null!=n?n.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,l,k,m,q){m=null!=m?m:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph,g="jpeg"==q?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(p);mxUtils.write(c,mxResources.get("zoom")+
|
|
|
|
|
":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.marginRight="16px";x.style.width="60px";x.style.marginLeft="4px";x.value=this.lastExportBorder||"0";c.appendChild(x);mxUtils.br(c);var z=this.addCheckbox(c,
|
|
|
|
|
":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.marginRight="16px";y.style.width="60px";y.style.marginLeft="4px";y.value=this.lastExportBorder||"0";c.appendChild(y);mxUtils.br(c);var x=this.addCheckbox(c,
|
|
|
|
|
mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=q),t=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight="8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");k&&(c.appendChild(v),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(t,"change",function(){t.checked?v.removeAttribute("disabled"):v.setAttribute("disabled",
|
|
|
|
|
"disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var I=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),
|
|
|
|
|
m,null,null,"jpeg"!=q),A=null!=this.pages&&1<this.pages.length,V=this.addCheckbox(c,A?mxResources.get("allPages"):"",A,!A,null,"jpeg"!=q);V.style.marginLeft="24px";V.style.marginBottom="16px";A||(V.style.display="none");mxEvent.addListener(I,"change",function(){I.checked&&A?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")});m&&A||V.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"==q&&(mxUtils.write(c,mxResources.get("links")+":"),c.appendChild(U),mxUtils.br(c),
|
|
|
|
|
mxUtils.br(c),g+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=x.value;this.lastExportZoom=n.value;l(n.value,z.checked,!t.checked,H.checked,I.checked,B.checked,x.value,v.checked,!V.checked,U.value)}),null,d,e);this.showDialog(d.container,340,g,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,l){var c=document.createElement("div");
|
|
|
|
|
mxUtils.br(c),g+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=y.value;this.lastExportZoom=n.value;l(n.value,x.checked,!t.checked,H.checked,I.checked,B.checked,y.value,v.checked,!V.checked,U.value)}),null,d,e);this.showDialog(d.container,340,g,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,l){var c=document.createElement("div");
|
|
|
|
|
c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var k=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,d),q=this.addCheckbox(c,mxResources.get("lightbox"),!0),r=this.addEditButton(c,q),t=r.getEditInput(),v=1<f.model.getChildCount(f.model.getRoot()),
|
|
|
|
|
A=this.addCheckbox(c,mxResources.get("layers"),v,!v);A.style.marginLeft=t.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(v&&A.removeAttribute("disabled"),t.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&q.checked?r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,
|
|
|
|
|
function(){a(k.checked,n.checked,m.checked,q.checked,r.getLink(),A.checked)}),null,mxResources.get("embed"),l);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,l,k,m,q){function c(c){var b=" ",g="";e&&(b=" 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('"+
|
|
|
|
@ -3063,18 +3064,18 @@ this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(p){}f
|
|
|
|
|
e=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(G){null!=
|
|
|
|
|
b&&b(G)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)}catch(x){null!=b&&b(x)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,d,e,l,k,m){m=b.background;m==mxConstants.NONE&&(m=null);k=b.getSvg(m,null,null,null,null,k);b.shadowVisible&&b.addSvgShadow(k);null!=a&&k.setAttribute("content",a);null!=d&&k.setAttribute("resource",d);if(null!=l)this.convertImages(k,mxUtils.bind(this,function(a){l((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
|
|
|
|
mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(k)};EditorUi.prototype.exportImage=function(a,b,d,e,l,k,m,q,u){u=null!=u?u:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();
|
|
|
|
|
try{this.saveCanvas(a,l?this.getFileData(!0,null,null,null,d,q):null,u)}catch(E){"Invalid image"==E.message?this.downloadFile(u):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,k,m)}catch(y){this.spinner.stop(),this.handleError(y)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
|
|
|
|
|
try{this.saveCanvas(a,l?this.getFileData(!0,null,null,null,d,q):null,u)}catch(E){"Invalid image"==E.message?this.downloadFile(u):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,k,m)}catch(z){this.spinner.stop(),this.handleError(z)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
|
|
|
|
|
"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},k=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,l))]);f.push('"'+b[g].substring(l))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var m=1;m<b.length;m++){var q=b[m].indexOf(")"),u=null,t=b[m].indexOf("format(",q);0<t&&(u=c(b[m].substring(t+7,b[m].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==
|
|
|
|
|
e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==u||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==u||"embedded-opentype"==u||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==u||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==u||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==u||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==u||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=
|
|
|
|
|
a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;k()}),mxUtils.bind(this,function(a){d--;k()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[m].substring(0,q)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,l,k,m,q,u,t,y,E,r,v){k=null!=k?k:!0;E=null!=E?E:this.editor.graph;r=null!=r?r:0;var c=u?null:E.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==
|
|
|
|
|
a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;k()}),mxUtils.bind(this,function(a){d--;k()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[m].substring(0,q)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,l,k,m,q,u,t,z,E,r,v){k=null!=k?k:!0;E=null!=E?E:this.editor.graph;r=null!=r?r:0;var c=u?null:E.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==
|
|
|
|
|
c&&0==u&&(c="#ffffff");this.convertImages(E.getSvg(c,null,null,v,null,null!=m?m:!0,null,null,null,t),mxUtils.bind(this,function(d){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var e=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),p=parseInt(d.getAttribute("height"));q=null!=q?q:1;null!=b&&(q=k?Math.min(1,Math.min(3*b/(4*p),b/g)):b/g);g=Math.ceil(q*g)+2*r;p=Math.ceil(q*p)+2*r;e.setAttribute("width",g);e.setAttribute("height",p);var m=e.getContext("2d");null!=c&&(m.beginPath(),
|
|
|
|
|
m.rect(0,0,g,p),m.fillStyle=c,m.fill());m.scale(q,q);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(f,r/q,r/q);a(e)},0):(m.drawImage(f,r/q,r/q),a(e))}catch(U){null!=l&&l(U)}});f.onerror=function(a){null!=l&&l(a)};try{t&&this.editor.graph.addSvgShadow(d);var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,
|
|
|
|
|
d,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(e)}catch(B){null!=l&&l(B)}}),d,y)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var f="http://"==c.substring(0,7)||"https://"==c.substring(0,8);f&&!navigator.onLine?c=d.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.editor.isCorsEnabledForUrl(c)?"chrome-extension://"!=
|
|
|
|
|
d,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(e)}catch(B){null!=l&&l(B)}}),d,z)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var f="http://"==c.substring(0,7)||"https://"==c.substring(0,8);f&&!navigator.onLine?c=d.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.editor.isCorsEnabledForUrl(c)?"chrome-extension://"!=
|
|
|
|
|
c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var l=a.getElementsByTagName(d),k=0;k<l.length;k++)mxUtils.bind(this,function(d){var l=e.convert(d.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var k=f[l];null==k?(c++,this.convertImageToDataUri(l,function(e){null!=e&&(f[l]=e,d.setAttribute(g,
|
|
|
|
|
e));c--;0==c&&b(a)})):d.setAttribute(g,k)}else null!=l&&d.setAttribute(g,l)})(l[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,l,k,m){try{var c=!m&&(e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));l=null!=l?l:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&
|
|
|
|
|
"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}k=null!=k?k:"data:image/png;base64,";f=k+this.base64Encode(f)}b(f)}}else null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()})},c,this.timeout,function(){l&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(G){null!=
|
|
|
|
|
d&&d(G)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,
|
|
|
|
|
0,0);try{b(a.toDataURL())}catch(z){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,l){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){f.model.beginUpdate();try{var g=mxUtils.parseXml(a),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var m=k.getElementsByTagName("diagram");if(1==m.length)k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement;
|
|
|
|
|
0,0);try{b(a.toDataURL())}catch(y){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,l){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){f.model.beginUpdate();try{var g=mxUtils.parseXml(a),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var m=k.getElementsByTagName("diagram");if(1==m.length)k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement;
|
|
|
|
|
else if(1<m.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement,e=!1,a=1);a<m.length;a++){m[a].removeAttribute("id");var n=this.updatePageRoot(new DiagramPage(m[a])),q=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[q+1]));f.model.execute(new ChangePage(this,n,n,q,!0))}}null!=k&&"mxGraphModel"===k.nodeName&&(c=f.importGraphModel(k,b,d,e))}finally{f.model.endUpdate()}}}catch(r){if(l)throw r;
|
|
|
|
|
this.handleError(r)}return c};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(this.isRemoteVisioFormat(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);
|
|
|
|
|
f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{f.response.name=e,this.doImportVisio(f.response,b,d)}catch(x){d(x)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(x){d(x)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.importGraphML=function(a,b,d){d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});
|
|
|
|
@ -3082,27 +3083,27 @@ var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGra
|
|
|
|
|
"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,d){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(l){d(l)}else d({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline()?
|
|
|
|
|
window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertAsPreText=function(a,b,d){var c=this.editor.graph,f=null;c.getModel().beginUpdate();try{f=c.insertVertex(null,null,"<pre>"+a+"</pre>",b,d,1,1,"text;html=1;align=center;verticalAlign=middle;"),c.updateCellSize(f,!0)}finally{c.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,d,e,l,k,m){k=null!=k?k:!0;
|
|
|
|
|
m=null!=m?m:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(l||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==
|
|
|
|
|
a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,k,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,k,!0),0<g.length)return g}catch(y){}this.loadImage(a,mxUtils.bind(this,function(f){if("data:"==a.substring(0,5))this.resizeImage(f,
|
|
|
|
|
a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,k,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,k,!0),0<g.length)return g}catch(z){}this.loadImage(a,mxUtils.bind(this,function(f){if("data:"==a.substring(0,5))this.resizeImage(f,
|
|
|
|
|
a,mxUtils.bind(this,function(a,f,e){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
|
|
|
|
a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,k);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,
|
|
|
|
|
function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,d,k))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{c=this.editor.graph;l=null;c.getModel().beginUpdate();try{l=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[l])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),l.value=a,c.updateCellSize(l),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(l.value)&&
|
|
|
|
|
c.setLinkForCell(l,l.value),l.geometry.width+=c.gridSize,l.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[l]}}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=
|
|
|
|
|
c.setLinkForCell(l,l.value),l.geometry.width+=c.gridSize,l.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[l]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+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)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&
|
|
|
|
|
this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=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 c=new Blob([a],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(a){this.importXml(a,
|
|
|
|
|
0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,l,k,m,q,u,t,y){t=null!=t?t:!0;var c=!1,f=null,g=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,d,e,t);null!=q&&q(b)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=y?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,t),u=!0)),u||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,l,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
|
|
|
|
0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,l,k,m,q,u,t,z){t=null!=t?t:!0;var c=!1,f=null,g=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,d,e,t);null!=q&&q(b)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=z?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,t),u=!0)),u||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,l,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
|
|
|
|
a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,g)):null!=u&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(c=!0,this.importVisio(u,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(c=!0,this.parseFile(null!=u?u:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=q&&q(null))}),m)):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||
|
|
|
|
|
(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,t));c||null==q||q(f);return f};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,k,m;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}k=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);
|
|
|
|
|
b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);b+="=";break}m=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(m&192)>>6);b+=
|
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63)}return b};EditorUi.prototype.importFiles=function(a,b,d,e,l,k,m,q,u,t,y,v){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=y||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>p){g=!0;break}var z=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;
|
|
|
|
|
l=null!=l?l:mxUtils.bind(this,function(a,b,d,f,e,g,l,k,m){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,d,f,e,g,l,k,m,c,v)});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,u=n,r=[],z=mxUtils.bind(this,function(a,b){r[a]=b;if(0==--u){this.spinner.stop();if(null!=q)q(r);else{var c=[];g.getModel().beginUpdate();
|
|
|
|
|
try{for(var d=0;d<r.length;d++){var f=r[d]();null!=f&&(c=c.concat(f))}}finally{g.getModel().endUpdate()}}k(c)}}),x=0;x<n;x++)mxUtils.bind(this,function(c){var k=a[c];if(null!=k){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var n=a.target.result,r=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(r+1)))),q=mxUtils.parseXml(u),u=q.getElementsByTagName("svg");if(0<u.length){var u=u[0],
|
|
|
|
|
x=v?null:u.getAttribute("content");null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=unescape(window.atob?atob(x):Base64.decode(x,!0)));null!=x&&"%"==x.charAt(0)&&(x=decodeURIComponent(x));null==x||"<mxfile "!==x.substring(0,8)&&"<mxGraphModel "!==x.substring(0,14)?z(c,mxUtils.bind(this,function(){try{if(n.substring(0,r+1),null!=q){var a=q.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=parseFloat(f.getAttribute("width")),u=parseFloat(f.getAttribute("height")),y=f.getAttribute("viewBox");if(null==
|
|
|
|
|
y||0==y.length)f.setAttribute("viewBox","0 0 "+m+" "+u);else if(isNaN(m)||isNaN(u)){var t=y.split(" ");3<t.length&&(m=parseFloat(t[2]),u=parseFloat(t[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var z=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,u)),x=l(n,k.type,b+c*p,d+c*p,Math.max(1,Math.round(m*z)),Math.max(1,Math.round(u*z)),k.name);if(isNaN(m)||isNaN(u)){var H=new Image;H.onload=mxUtils.bind(this,function(){m=Math.max(1,H.width);u=Math.max(1,H.height);x[0].geometry.width=m;x[0].geometry.height=
|
|
|
|
|
u;f.setAttribute("viewBox","0 0 "+m+" "+u);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));g.setCellStyles("image",n,[x[0]])});H.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(ua){}return null})):z(c,mxUtils.bind(this,function(){return l(x,"text/xml",b+c*p,d+c*p,0,0,k.name)}))}else z(c,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==k.type){var H=v?null:this.extractGraphModelFromPng(a.target.result);
|
|
|
|
|
if(null!=H&&0<H.length){var B=new Image;B.src=a.target.result;z(c,mxUtils.bind(this,function(){return l(H,"text/xml",b+c*p,d+c*p,B.width,B.height,k.name)}));u=!0}}u||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,
|
|
|
|
|
a.target.result,mxUtils.bind(this,function(g,m,n){z(c,mxUtils.bind(this,function(){if(null!=g&&g.length<t){var u=f&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(e/m,e/n)):1;return l(g,k.type,b+c*p,d+c*p,Math.round(m*u),Math.round(n*u),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,k.type,b+c*p,d+c*p,240,160,k.name,
|
|
|
|
|
function(a){z(c,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?l(null,k.type,b+c*p,d+c*p,240,160,k.name,function(a){z(c,function(){return a})},k):"image"==k.type.substring(0,5)?n.readAsDataURL(k):n.readAsText(k)}})(x)});g?this.confirmImageResize(function(a){f=a;z()},u):z()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?
|
|
|
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63)}return b};EditorUi.prototype.importFiles=function(a,b,d,e,l,k,m,q,u,t,z,v){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=z||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>p){g=!0;break}var y=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;
|
|
|
|
|
l=null!=l?l:mxUtils.bind(this,function(a,b,d,f,e,g,l,k,m){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,d,f,e,g,l,k,m,c,v)});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,u=n,r=[],y=mxUtils.bind(this,function(a,b){r[a]=b;if(0==--u){this.spinner.stop();if(null!=q)q(r);else{var c=[];g.getModel().beginUpdate();
|
|
|
|
|
try{for(var d=0;d<r.length;d++){var f=r[d]();null!=f&&(c=c.concat(f))}}finally{g.getModel().endUpdate()}}k(c)}}),x=0;x<n;x++)mxUtils.bind(this,function(c){var k=a[c];if(null!=k){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var n=a.target.result,u=n.indexOf(","),r=decodeURIComponent(escape(atob(n.substring(u+1)))),q=mxUtils.parseXml(r),r=q.getElementsByTagName("svg");if(0<r.length){var r=r[0],
|
|
|
|
|
x=v?null:r.getAttribute("content");null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=unescape(window.atob?atob(x):Base64.decode(x,!0)));null!=x&&"%"==x.charAt(0)&&(x=decodeURIComponent(x));null==x||"<mxfile "!==x.substring(0,8)&&"<mxGraphModel "!==x.substring(0,14)?y(c,mxUtils.bind(this,function(){try{if(n.substring(0,u+1),null!=q){var a=q.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=parseFloat(f.getAttribute("width")),r=parseFloat(f.getAttribute("height")),z=f.getAttribute("viewBox");if(null==
|
|
|
|
|
z||0==z.length)f.setAttribute("viewBox","0 0 "+m+" "+r);else if(isNaN(m)||isNaN(r)){var y=z.split(" ");3<y.length&&(m=parseFloat(y[2]),r=parseFloat(y[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var t=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,r)),x=l(n,k.type,b+c*p,d+c*p,Math.max(1,Math.round(m*t)),Math.max(1,Math.round(r*t)),k.name);if(isNaN(m)||isNaN(r)){var B=new Image;B.onload=mxUtils.bind(this,function(){m=Math.max(1,B.width);r=Math.max(1,B.height);x[0].geometry.width=m;x[0].geometry.height=
|
|
|
|
|
r;f.setAttribute("viewBox","0 0 "+m+" "+r);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));g.setCellStyles("image",n,[x[0]])});B.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(ua){}return null})):y(c,mxUtils.bind(this,function(){return l(x,"text/xml",b+c*p,d+c*p,0,0,k.name)}))}else y(c,mxUtils.bind(this,function(){return null}))}else{r=!1;if("image/png"==k.type){var B=v?null:this.extractGraphModelFromPng(a.target.result);
|
|
|
|
|
if(null!=B&&0<B.length){var H=new Image;H.src=a.target.result;y(c,mxUtils.bind(this,function(){return l(B,"text/xml",b+c*p,d+c*p,H.width,H.height,k.name)}));r=!0}}r||(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(g){this.resizeImage(g,
|
|
|
|
|
a.target.result,mxUtils.bind(this,function(g,m,n){y(c,mxUtils.bind(this,function(){if(null!=g&&g.length<t){var r=f&&this.isResampleImage(a.target.result,z)?Math.min(1,Math.min(e/m,e/n)):1;return l(g,k.type,b+c*p,d+c*p,Math.round(m*r),Math.round(n*r),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,z)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,k.type,b+c*p,d+c*p,240,160,k.name,
|
|
|
|
|
function(a){y(c,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?l(null,k.type,b+c*p,d+c*p,240,160,k.name,function(a){y(c,function(){return a})},k):"image"==k.type.substring(0,5)?n.readAsDataURL(k):n.readAsText(k)}})(x)});g?this.confirmImageResize(function(a){f=a;y()},u):y()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?
|
|
|
|
|
mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
|
|
|
|
|
mxClient.IS_CHROMEAPP?220:200,!0,!0):f(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,l,k){l=null!=l?l:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);
|
|
|
|
|
if(e&&this.isResampleImage(b,k))try{var g=Math.max(c/l,f/l);if(1<g){var m=Math.round(c/g),p=Math.round(f/g),n=document.createElement("canvas");n.width=m;n.height=p;n.getContext("2d").drawImage(a,0,0,m,p);var r=n.toDataURL();if(r.length<b.length){var q=document.createElement("canvas");q.width=m;q.height=p;var t=q.toDataURL();r!==t&&(b=r,c=m,f=p)}}}catch(O){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var k=d,m=0;8>m;m++)k=1==(k&1)?3988292384^k>>>1:k>>>1,EditorUi.prototype.crcTable[d]=
|
|
|
|
@ -3117,9 +3118,9 @@ arguments)};var l=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=
|
|
|
|
|
arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var u=function(){window.setTimeout(function(){v.innerHTML=" ";
|
|
|
|
|
v.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||
|
|
|
|
|
b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,
|
|
|
|
|
6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var l=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],l.x,l.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(J){}}),!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace="nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,0);v.style.width="1px";v.style.height="1px";v.innerHTML=" ";var y=!1;this.keyHandler.bindControlKey(88,null);
|
|
|
|
|
this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||y||(v.style.left=b.container.scrollLeft+10+"px",v.style.top=b.container.scrollTop+10+"px",b.container.appendChild(v),
|
|
|
|
|
y=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll",!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!y||224!=c&&17!=c&&91!=c||(y=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),v.parentNode.removeChild(v),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(v,
|
|
|
|
|
6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var l=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],l.x,l.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(J){}}),!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace="nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,0);v.style.width="1px";v.style.height="1px";v.innerHTML=" ";var z=!1;this.keyHandler.bindControlKey(88,null);
|
|
|
|
|
this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||z||(v.style.left=b.container.scrollLeft+10+"px",v.style.top=b.container.scrollTop+10+"px",b.container.appendChild(v),
|
|
|
|
|
z=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll",!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!z||224!=c&&17!=c&&91!=c||(z=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),v.parentNode.removeChild(v),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(v,
|
|
|
|
|
"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(v),u())}));mxEvent.addListener(v,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(v,!0),u())}));mxEvent.addListener(v,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(v.innerHTML=" ",v.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,v);v.innerHTML=" "}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=
|
|
|
|
|
function(a){return mxEvent.getSource(a)==v?!0:E.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),
|
|
|
|
|
mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=
|
|
|
|
@ -3149,7 +3150,7 @@ c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.
|
|
|
|
|
"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var k=document.documentElement;d=(e.clientWidth||k.clientWidth)-3;e=Math.max(e.clientHeight||0,k.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;k=document.createElement("div");k.style.zIndex=mxPopupMenu.prototype.zIndex+
|
|
|
|
|
2;k.style.border="3px dotted rgb(254, 137, 12)";k.style.pointerEvents="none";k.style.position="absolute";k.style.top=b+"px";k.style.left=c+"px";k.style.width=Math.max(0,d-3)+"px";k.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(k):document.body.appendChild(k);return k};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
|
|
|
|
|
d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{var d=c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=
|
|
|
|
|
mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,
|
|
|
|
|
mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,
|
|
|
|
|
function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));
|
|
|
|
|
else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,
|
|
|
|
|
c.target.result,a.name))}catch(G){this.handleError(G,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(G){this.handleError(G)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,
|
|
|
|
@ -3169,9 +3170,9 @@ try{l.init()}catch(I){m.postMessage(JSON.stringify({event:"draft",error:I.toStri
|
|
|
|
|
null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,function(a,b,c){m.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("textContent"==
|
|
|
|
|
g.action){l=this.getDiagramTextContent();m.postMessage(JSON.stringify({event:"textContent",data:l,message:g}),"*");return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var p=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,
|
|
|
|
|
p):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(n);
|
|
|
|
|
m.postMessage(JSON.stringify(b),"*")}),z=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),x=q.getGlobalVariable,v=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?v.getName():
|
|
|
|
|
"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(v.root)}this.exportToCanvas(mxUtils.bind(this,function(a){z(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){z(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+
|
|
|
|
|
a.getText()):z(null)}),mxUtils.bind(this,function(){z(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),p.data=this.getHtml(n,this.editor.graph),p.xml=mxUtils.getXml(n),p.format=
|
|
|
|
|
m.postMessage(JSON.stringify(b),"*")}),y=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,x=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?x.getName():
|
|
|
|
|
"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,function(a){y(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){y(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+
|
|
|
|
|
a.getText()):y(null)}),mxUtils.bind(this,function(){y(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),p.data=this.getHtml(n,this.editor.graph),p.xml=mxUtils.getXml(n),p.format=
|
|
|
|
|
g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=
|
|
|
|
|
this.createSvgDataUri(a);m.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));m.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}m.postMessage(JSON.stringify(p),"*")}return}if("load"==
|
|
|
|
|
g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight=
|
|
|
|
@ -3184,14 +3185,14 @@ window.opener||window.parent,k="json"==urlParams.proto?JSON.stringify({event:"in
|
|
|
|
|
mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding=
|
|
|
|
|
"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);
|
|
|
|
|
this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=
|
|
|
|
|
function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var f={},e=null,k=null,m=null,q=null,t="",y="auto",v="auto",r=null,A=null,Q=40,O=40,M=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var I=function(){null!=b?b(W):(B.setSelectionCells(W),B.scrollCellToVisible(B.getSelectionCell()))},S=B.getFreeInsertPoint(),V=S.x,U=S.y,S=U,X=null,J="auto",q=null,aa=[],la=null,ea=null,Y=0;Y<c.length&&"#"==c[Y].charAt(0);){a=c[Y];for(Y++;Y<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Y].charAt(0);)a=a.substring(0,
|
|
|
|
|
a.length-1)+mxUtils.trim(c[Y].substring(1)),Y++;if("#"!=a.charAt(1)){var ba=a.indexOf(":");if(0<ba){var K=mxUtils.trim(a.substring(1,ba)),L=mxUtils.trim(a.substring(ba+1));"label"==K?X=B.sanitizeHtml(L):"style"==K?e=L:"parentstyle"==K?k=L:"identity"==K&&0<L.length&&"-"!=L?m=L:"parent"==K&&0<L.length&&"-"!=L?q=L:"namespace"==K&&0<L.length&&"-"!=L?t=L:"width"==K?y=L:"height"==K?v=L:"left"==K&&0<L.length?r=L:"top"==K&&0<L.length?A=L:"ignore"==K?ea=L.split(","):"connect"==K?aa.push(JSON.parse(L)):"link"==
|
|
|
|
|
function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var f={},e=null,k=null,m=null,q=null,t="",z="auto",v="auto",r=null,A=null,Q=40,O=40,M=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var I=function(){null!=b?b(W):(B.setSelectionCells(W),B.scrollCellToVisible(B.getSelectionCell()))},S=B.getFreeInsertPoint(),V=S.x,U=S.y,S=U,X=null,J="auto",q=null,aa=[],la=null,ea=null,Y=0;Y<c.length&&"#"==c[Y].charAt(0);){a=c[Y];for(Y++;Y<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Y].charAt(0);)a=a.substring(0,
|
|
|
|
|
a.length-1)+mxUtils.trim(c[Y].substring(1)),Y++;if("#"!=a.charAt(1)){var ba=a.indexOf(":");if(0<ba){var K=mxUtils.trim(a.substring(1,ba)),L=mxUtils.trim(a.substring(ba+1));"label"==K?X=B.sanitizeHtml(L):"style"==K?e=L:"parentstyle"==K?k=L:"identity"==K&&0<L.length&&"-"!=L?m=L:"parent"==K&&0<L.length&&"-"!=L?q=L:"namespace"==K&&0<L.length&&"-"!=L?t=L:"width"==K?z=L:"height"==K?v=L:"left"==K&&0<L.length?r=L:"top"==K&&0<L.length?A=L:"ignore"==K?ea=L.split(","):"connect"==K?aa.push(JSON.parse(L)):"link"==
|
|
|
|
|
K?la=L:"padding"==K?H=parseFloat(L):"edgespacing"==K?Q=parseFloat(L):"nodespacing"==K?O=parseFloat(L):"levelspacing"==K?M=parseFloat(L):"layout"==K&&(J=L)}}}var ha=this.editor.csvToArray(c[Y]),K=ba=null;if(null!=m||null!=q)for(var N=0;N<ha.length;N++)m==ha[N]&&(ba=N),q==ha[N]&&(K=N);null==X&&(X="%"+ha[0]+"%");if(null!=aa)for(var R=0;R<aa.length;R++)null==f[aa[R].to]&&(f[aa[R].to]={});B.model.beginUpdate();try{for(N=Y+1;N<c.length;N++){var ia=this.editor.csvToArray(c[N]);if(null==ia){var fa=40<c[N].length?
|
|
|
|
|
c[N].substring(0,40)+"...":c[N];throw Error(N+" ("+fa+") "+mxResources.get("containsValidationErrors"));}if(ia.length==ha.length){var F=null,ja=null!=ba?t+ia[ba]:null;null!=ja&&(F=B.model.getCell(ja));null==F&&(F=new mxCell(X,new mxGeometry(V,S,0,0),e||"whiteSpace=wrap;html=1;"),F.vertex=!0,F.id=ja);for(var P=0;P<ia.length;P++)B.setAttributeForCell(F,ha[P],ia[P]);B.setAttributeForCell(F,"placeholders","1");F.style=B.replacePlaceholders(F,F.style);for(R=0;R<aa.length;R++)f[aa[R].to][F.getAttribute(aa[R].to)]=
|
|
|
|
|
F;null!=la&&"link"!=la&&(B.setLinkForCell(F,F.getAttribute(la)),B.setAttributeForCell(F,la,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[F]));var ca=this.editor.graph.getPreferredSizeForCell(F);F.vertex&&(null!=r&&null!=F.getAttribute(r)&&(F.geometry.x=V+parseFloat(F.getAttribute(r))),null!=A&&null!=F.getAttribute(A)&&(F.geometry.y=U+parseFloat(F.getAttribute(A))),"@"==y.charAt(0)&&null!=F.getAttribute(y.substring(1))?F.geometry.width=parseFloat(F.getAttribute(y.substring(1))):F.geometry.width=
|
|
|
|
|
"auto"==y?ca.width+H:parseFloat(y),"@"==v.charAt(0)&&null!=F.getAttribute(v.substring(1))?F.geometry.height=parseFloat(F.getAttribute(v.substring(1))):F.geometry.height="auto"==v?ca.height+H:parseFloat(v),S+=F.geometry.height+O);q=null!=K?B.model.getCell(t+ia[K]):null;null!=q?(q.style=B.replacePlaceholders(q,k),B.addCell(F,q)):d.push(B.addCell(F))}}for(var ga=d.slice(),W=d.slice(),R=0;R<aa.length;R++)for(var Z=aa[R],N=0;N<d.length;N++){var F=d[N],wa=F.getAttribute(Z.from);if(null!=wa){B.setAttributeForCell(F,
|
|
|
|
|
F;null!=la&&"link"!=la&&(B.setLinkForCell(F,F.getAttribute(la)),B.setAttributeForCell(F,la,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[F]));var ca=this.editor.graph.getPreferredSizeForCell(F);F.vertex&&(null!=r&&null!=F.getAttribute(r)&&(F.geometry.x=V+parseFloat(F.getAttribute(r))),null!=A&&null!=F.getAttribute(A)&&(F.geometry.y=U+parseFloat(F.getAttribute(A))),"@"==z.charAt(0)&&null!=F.getAttribute(z.substring(1))?F.geometry.width=parseFloat(F.getAttribute(z.substring(1))):F.geometry.width=
|
|
|
|
|
"auto"==z?ca.width+H:parseFloat(z),"@"==v.charAt(0)&&null!=F.getAttribute(v.substring(1))?F.geometry.height=parseFloat(F.getAttribute(v.substring(1))):F.geometry.height="auto"==v?ca.height+H:parseFloat(v),S+=F.geometry.height+O);q=null!=K?B.model.getCell(t+ia[K]):null;null!=q?(q.style=B.replacePlaceholders(q,k),B.addCell(F,q)):d.push(B.addCell(F))}}for(var ga=d.slice(),W=d.slice(),R=0;R<aa.length;R++)for(var Z=aa[R],N=0;N<d.length;N++){var F=d[N],wa=F.getAttribute(Z.from);if(null!=wa){B.setAttributeForCell(F,
|
|
|
|
|
Z.from,null);for(var ua=wa.split(","),P=0;P<ua.length;P++){var pa=f[Z.to][ua[P]];null!=pa&&(X=Z.label,null!=Z.fromlabel&&(X=(F.getAttribute(Z.fromlabel)||"")+(X||"")),null!=Z.tolabel&&(X=(X||"")+(pa.getAttribute(Z.tolabel)||"")),W.push(B.insertEdge(null,null,X||"",Z.invert?pa:F,Z.invert?F:pa,Z.style||B.createCurrentEdgeStyle())),mxUtils.remove(Z.invert?F:pa,ga))}}}if(null!=ea)for(N=0;N<d.length;N++)for(F=d[N],P=0;P<ea.length;P++)B.setAttributeForCell(F,mxUtils.trim(ea[P]),null);var ta=new mxParallelEdgeLayout(B);
|
|
|
|
|
ta.spacing=Q;var va=function(){ta.execute(B.getDefaultParent());for(var a=0;a<d.length;a++){var b=B.getCellGeometry(d[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==y&&(b.width=Math.round(B.snap(b.width)));"auto"==v&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==J){var ma=new mxCircleLayout(B);ma.resetEdges=!1;var ra=ma.isVertexIgnored;ma.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ma.execute(B.getDefaultParent());
|
|
|
|
|
ta.spacing=Q;var va=function(){ta.execute(B.getDefaultParent());for(var a=0;a<d.length;a++){var b=B.getCellGeometry(d[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==z&&(b.width=Math.round(B.snap(b.width)));"auto"==v&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==J){var ma=new mxCircleLayout(B);ma.resetEdges=!1;var ra=ma.isVertexIgnored;ma.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ma.execute(B.getDefaultParent());
|
|
|
|
|
va()},!0,I);I=null}else if("horizontaltree"==J||"verticaltree"==J||"auto"==J&&W.length==2*d.length-1&&1==ga.length){B.view.validate();var ka=new mxCompactTreeLayout(B,"horizontaltree"==J);ka.levelDistance=O;ka.edgeRouting=!1;ka.resetEdges=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),0<ga.length?ga[0]:null)},!0,I);I=null}else if("horizontalflow"==J||"verticalflow"==J||"auto"==J&&1==ga.length){B.view.validate();var da=new mxHierarchicalLayout(B,"horizontalflow"==J?mxConstants.DIRECTION_WEST:
|
|
|
|
|
mxConstants.DIRECTION_NORTH);da.intraCellSpacing=O;da.parallelEdgeSpacing=Q;da.interRankCellSpacing=M;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(B.getDefaultParent(),W);B.moveCells(W,V,U)},!0,I);I=null}else if("organic"==J||"auto"==J&&W.length>d.length){B.view.validate();var sa=new mxFastOrganicLayout(B);sa.forceConstant=3*O;sa.resetEdges=!1;var xa=sa.isVertexIgnored;sa.isVertexIgnored=function(a){return xa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ta=new mxParallelEdgeLayout(B);
|
|
|
|
|
ta.spacing=Q;this.executeLayout(function(){sa.execute(B.getDefaultParent());va()},!0,I);I=null}this.hideDialog()}finally{B.model.endUpdate()}null!=I&&I()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=
|
|
|
|
@ -3222,7 +3223,7 @@ c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spi
|
|
|
|
|
mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in k)b[c]||this.closeLibrary(new RemoteLibrary(this,null,k[c]));0==a&&this.spinner.stop()}));this.showDialog(c.container,340,375,!0,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],
|
|
|
|
|
"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,d,e,l){d=d||{};d.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:e,error:l});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,
|
|
|
|
|
msgMarkers:d});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),
|
|
|
|
|
e.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,e);else{var k=this[c].apply(this,e);b([k])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(z){b(null,"Invalid Call: An error occured, "+z.message)}}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
|
|
|
|
|
e.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,e);else{var k=this[c].apply(this,e);b([k])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(y){b(null,"Invalid Call: An error occured, "+y.message)}}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
|
|
|
|
|
function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}
|
|
|
|
|
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(a,b,e){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b),null!=e&&(b.viewState=e,this.neverShown=!1))}
|
|
|
|
|
SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,e=b.graph,d=Graph.compressNode(b.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=e.getViewState();a.root=e.model.root;null!=a.model&&a.model.rootChanged(a.root);e.view.clear(a.root,!0);e.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;e.model.prefix=Editor.guid()+"-";e.model.rootChanged(a.root);
|
|
|
|
@ -3281,21 +3282,21 @@ this.model.setCollapsed(e[f],a))}for(f=0;f<c.length;f++)this.model.setVisible(c[
|
|
|
|
|
b?b.style:l.getCellStyle(a)).containerType);return b}function e(a){var b=!1;null!=a&&(a=p.getParent(a),b=l.view.getState(a),l.view.getState(a),b=null!=(null!=b?b.style:l.getCellStyle(a)).childLayout);return b}function t(a){a=l.view.getState(a);if(null!=a){var b=l.getIncomingEdges(a.cell);if(0<b.length&&(b=l.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 v(a,b){b=null!=b?b:!0;l.model.beginUpdate();try{var c=l.model.getParent(a),d=l.getIncomingEdges(a),e=l.cloneCells([d[0],a]);l.model.setTerminal(e[0],l.model.getTerminal(d[0],!0),!0);var f=t(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;l.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=l.view.getState(a),m=l.view.scale;if(null!=k){var p=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?p.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*m:p.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*m;var r=l.getOutgoingEdges(l.model.getTerminal(d[0],!0));if(null!=r){for(var q=f==mxConstants.DIRECTION_SOUTH||
|
|
|
|
|
f==mxConstants.DIRECTION_NORTH,n=g=d=0;n<r.length;n++){var u=l.model.getTerminal(r[n],!1);if(f==t(u)){var y=l.view.getState(u);u!=a&&null!=y&&(q&&b!=y.getCenterX()<k.getCenterX()||!q&&b!=y.getCenterY()<k.getCenterY())&&mxUtils.intersects(p,y)&&(d=10+Math.max(d,(Math.min(p.x+p.width,y.x+y.width)-Math.max(p.x,y.x))/m),g=10+Math.max(g,(Math.min(p.y+p.height,y.y+y.height)-Math.max(p.y,y.y))/m))}}q?g=0:d=0;for(n=0;n<r.length;n++)if(u=l.model.getTerminal(r[n],!1),f==t(u)&&(y=l.view.getState(u),u!=a&&null!=
|
|
|
|
|
y&&(q&&b!=y.getCenterX()<k.getCenterX()||!q&&b!=y.getCenterY()<k.getCenterY()))){var v=[];l.traverse(y.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});l.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return l.addCells(e,c)}finally{l.model.endUpdate()}}function A(a){l.model.beginUpdate();try{var b=t(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(c[0],d[1],!1);l.model.setTerminal(d[0],d[1],!0);l.model.setTerminal(d[0],a,!1);var e=l.model.getParent(a),f=e.geometry,g=[];l.view.currentRoot!=
|
|
|
|
|
f==mxConstants.DIRECTION_NORTH,n=g=d=0;n<r.length;n++){var z=l.model.getTerminal(r[n],!1);if(f==t(z)){var u=l.view.getState(z);z!=a&&null!=u&&(q&&b!=u.getCenterX()<k.getCenterX()||!q&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(p,u)&&(d=10+Math.max(d,(Math.min(p.x+p.width,u.x+u.width)-Math.max(p.x,u.x))/m),g=10+Math.max(g,(Math.min(p.y+p.height,u.y+u.height)-Math.max(p.y,u.y))/m))}}q?g=0:d=0;for(n=0;n<r.length;n++)if(z=l.model.getTerminal(r[n],!1),f==t(z)&&(u=l.view.getState(z),z!=a&&null!=
|
|
|
|
|
u&&(q&&b!=u.getCenterX()<k.getCenterX()||!q&&b!=u.getCenterY()<k.getCenterY()))){var v=[];l.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});l.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return l.addCells(e,c)}finally{l.model.endUpdate()}}function A(a){l.model.beginUpdate();try{var b=t(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(c[0],d[1],!1);l.model.setTerminal(d[0],d[1],!0);l.model.setTerminal(d[0],a,!1);var e=l.model.getParent(a),f=e.geometry,g=[];l.view.currentRoot!=
|
|
|
|
|
e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);l.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,m=-m):b==mxConstants.DIRECTION_WEST?(k=-k,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);l.moveCells(g,k,m);return l.addCells(d,e)}finally{l.model.endUpdate()}}function c(a){l.model.beginUpdate();try{var b=l.model.getParent(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],
|
|
|
|
|
a]);l.model.setTerminal(d[0],a,!0);var c=l.getOutgoingEdges(a),e=b.geometry,f=[];l.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=l.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var m=l.view.getBounds(f),p=t(a),r=l.view.translate,q=l.view.scale;p==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/q-r.x-e.x+10,d[1].geometry.y+=d[1].geometry.height-e.y+40):p==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=
|
|
|
|
|
null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/q-r.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height+e.y+40):(d[1].geometry.x=p==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+e.x+40):d[1].geometry.x+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(m.y+m.height)/q-r.y+-e.y+10);return l.addCells(d,b)}finally{l.model.endUpdate()}}function f(a,b,c){a=l.getOutgoingEdges(a);c=l.view.getState(c);var d=
|
|
|
|
|
[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=l.view.getState(l.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 g(a,b){var c=t(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():
|
|
|
|
|
c==b?(d=l.getOutgoingEdges(a),null!=d&&0<d.length&&l.setSelectionCell(l.model.getTerminal(d[0],!1))):(c=l.getIncomingEdges(a),null!=c&&0<c.length&&(d=f(l.model.getTerminal(c[0],!0),d,a),c=l.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&&l.setSelectionCell(d[c].cell)))))}var n=this,l=n.editor.graph,p=l.getModel(),z=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){z.apply(this,arguments);
|
|
|
|
|
c==b?(d=l.getOutgoingEdges(a),null!=d&&0<d.length&&l.setSelectionCell(l.model.getTerminal(d[0],!1))):(c=l.getIncomingEdges(a),null!=c&&0<c.length&&(d=f(l.model.getTerminal(c[0],!0),d,a),c=l.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&&l.setSelectionCell(d[c].cell)))))}var n=this,l=n.editor.graph,p=l.getModel(),y=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);
|
|
|
|
|
if(1==l.getSelectionCount()){c=l.getSelectionCell();var e=l.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(l.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(l.getSelectionCell())&&(a.addSeparator(),0<l.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),
|
|
|
|
|
a=l.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=l.getOutgoingEdges(l.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+S");
|
|
|
|
|
n.actions.addAction("selectParent",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getIncomingEdges(a);null!=a&&0<a.length&&l.setSelectionCell(l.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),b=[];l.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});l.setSelectionCells(b)}},null,null,"Alt+Shift+D");var x=l.removeCells;
|
|
|
|
|
l.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];p.isEdge(g)&&d(g)&&(e.push(g),g=p.getTerminal(g,!1));b(g)?(l.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=l.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return x.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
|
|
|
|
|
d))};var u=l.duplicateCells;l.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=l.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=l.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=u.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var m=l.getIncomingEdges(k[e]),g=l.getIncomingEdges(a[e]);if(0==m.length&&0<g.length){var p=this.cloneCell(g[0]);this.addEdge(p,
|
|
|
|
|
l.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var G=l.moveCells;l.moveCells=function(a,c,d,e,f,g,k){var m=null;this.model.beginUpdate();try{var p=f,r=this.view.getState(f),q=null!=r?r.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(q,"treeFolding","0")){for(var n=0;n<a.length;n++)if(b(a[n])||l.model.isEdge(a[n])&&null==l.model.getTerminal(a[n],!0)){f=l.model.getParent(a[n]);break}if(null!=p&&f!=p&&null!=this.view.getState(a[0])){var t=
|
|
|
|
|
l.getIncomingEdges(a[0]);if(0<t.length){var u=l.view.getState(l.model.getTerminal(t[0],!0));if(null!=u){var y=l.view.getState(p);null!=y&&(c=(y.getCenterX()-u.getCenterX())/l.view.scale,d=(y.getCenterY()-u.getCenterY())/l.view.scale)}}}}m=G.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(n=0;n<m.length;n++)if(this.model.isEdge(m[n]))b(p)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[n],!0))&&this.model.setTerminal(m[n],p,!0);else if(b(a[n])&&(t=l.getIncomingEdges(a[n]),0<t.length))if(!e)b(p)&&
|
|
|
|
|
0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],p,!0);else if(0==l.getIncomingEdges(m[n]).length){r=p;if(null==r||r==l.model.getParent(a[n]))r=l.model.getTerminal(t[0],!0);e=this.cloneCell(t[0]);this.addEdge(e,l.getDefaultParent(),r,m[n])}}finally{this.model.endUpdate()}return m};if(null!=n.sidebar){var y=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=l.model,g=null;f.beginUpdate();try{if(g=y.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
|
|
|
|
|
l.getIncomingEdges(a[0]);if(0<t.length){var u=l.view.getState(l.model.getTerminal(t[0],!0));if(null!=u){var z=l.view.getState(p);null!=z&&(c=(z.getCenterX()-u.getCenterX())/l.view.scale,d=(z.getCenterY()-u.getCenterY())/l.view.scale)}}}}m=G.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(n=0;n<m.length;n++)if(this.model.isEdge(m[n]))b(p)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[n],!0))&&this.model.setTerminal(m[n],p,!0);else if(b(a[n])&&(t=l.getIncomingEdges(a[n]),0<t.length))if(!e)b(p)&&
|
|
|
|
|
0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],p,!0);else if(0==l.getIncomingEdges(m[n]).length){r=p;if(null==r||r==l.model.getParent(a[n]))r=l.model.getTerminal(t[0],!0);e=this.cloneCell(t[0]);this.addEdge(e,l.getDefaultParent(),r,m[n])}}finally{this.model.endUpdate()}return m};if(null!=n.sidebar){var z=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=l.model,g=null;f.beginUpdate();try{if(g=z.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
|
|
|
|
|
null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var m=l.getCellGeometry(g[k]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var E={88:n.actions.get("selectChildren"),84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},r=n.onKeyDown;n.onKeyDown=function(a){try{if(l.isEnabled()&&!l.isEditing()&&b(l.getSelectionCell())&&1==l.getSelectionCount()){var d=null;0<l.getIncomingEdges(l.getSelectionCell()).length&&
|
|
|
|
|
(9==a.which?d=mxEvent.isShiftDown(a)?A(l.getSelectionCell()):c(l.getSelectionCell()):13==a.which&&(d=v(l.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&l.model.isEdge(d[0])?l.setSelectionCell(l.model.getTerminal(d[0],!1)):l.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(l.view.getState(l.getSelectionCell())),l.startEditingAtCell(l.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=E[a.keyCode];
|
|
|
|
|
null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(g(l.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(g(l.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(g(l.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(g(l.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(S){console.log("error",S)}mxEvent.isConsumed(a)||r.apply(this,arguments)};var C=l.connectVertex;l.connectVertex=
|
|
|
|
@ -3405,8 +3406,8 @@ e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbar
|
|
|
|
|
function(){mxUtils.setOpacity(e,0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),q=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(q(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?
|
|
|
|
|
"pointermove":"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){q(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){q(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||q(30)}));var t=this.graph,v=t.getTolerance();t.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();
|
|
|
|
|
this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-t.container.scrollLeft)<v&&Math.abs(this.scrollTop-t.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():q(30))}})}for(var A=this.toolbarItems,c=0,f=null,g=null,n=0;n<A.length;n++){var l=A[n];if("pages"==l){g=b.ownerDocument.createElement("div");
|
|
|
|
|
g.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(g,70);var p=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");p.style.borderRightStyle="none";p.style.paddingLeft="0px";p.style.paddingRight="0px";e.appendChild(g);var z=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
|
|
|
|
|
1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");z.style.paddingLeft="0px";z.style.paddingRight="0px";l=mxUtils.bind(this,function(){g.innerHTML="";mxUtils.write(g,this.currentPage+1+" / "+this.diagrams.length);g.style.display=1<this.diagrams.length?"inline-block":"none";p.style.display=g.style.display;z.style.display=g.style.display});this.addListener("graphChanged",l);l()}else if("zoom"==l)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
|
|
|
|
|
g.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(g,70);var p=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");p.style.borderRightStyle="none";p.style.paddingLeft="0px";p.style.paddingRight="0px";e.appendChild(g);var y=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
|
|
|
|
|
1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");y.style.paddingLeft="0px";y.style.paddingRight="0px";l=mxUtils.bind(this,function(){g.innerHTML="";mxUtils.write(g,this.currentPage+1+" / "+this.diagrams.length);g.style.display=1<this.diagrams.length?"inline-block":"none";p.style.display=g.style.display;y.style.display=g.style.display});this.addListener("graphChanged",l);l()}else if("zoom"==l)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
|
|
|
|
|
mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==l){if(this.layersEnabled){var x=this.graph.getModel(),u=a(mxUtils.bind(this,function(a){if(null!=f)f.parentNode.removeChild(f),
|
|
|
|
|
f=null;else{f=this.graph.createLayersDialog();mxEvent.addListener(f,"mouseleave",function(){f.parentNode.removeChild(f);f=null});a=u.getBoundingClientRect();f.style.width="140px";f.style.padding="2px 0px 2px 0px";f.style.border="1px solid #d0d0d0";f.style.backgroundColor="#eee";f.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";f.style.fontSize="11px";f.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(f,80);var b=mxUtils.getDocumentScrollOrigin(document);f.style.left=b.x+a.left+
|
|
|
|
|
"px";f.style.top=b.y+a.bottom+"px";document.body.appendChild(f)}}),Editor.layersImage,mxResources.get("layers")||"Layers");x.addListener(mxEvent.CHANGE,function(){u.style.display=1<x.getChildCount(x.root)?"inline-block":"none"});u.style.display=1<x.getChildCount(x.root)?"inline-block":"none"}}else"lightbox"==l?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(l=this.graphConfig["toolbar-buttons"][l],
|
|
|
|
@ -3433,7 +3434,7 @@ GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type=
|
|
|
|
|
GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=e;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
|
|
|
|
|
(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function q(b,c){if(!b.resizedAttached)b.resizedAttached=
|
|
|
|
|
new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
|
|
|
|
|
b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var q=!1,t=function(){b.resizedAttached&&(q&&(b.resizedAttached.call(),q=!1),a(t))};a(t);var v,y,A,r,C=function(){if((A=b.offsetWidth)!=v||(r=b.offsetHeight)!=y)q=!0,v=A,y=r;g()},Q=function(a,b,c){a.attachEvent?
|
|
|
|
|
b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var q=!1,t=function(){b.resizedAttached&&(q&&(b.resizedAttached.call(),q=!1),a(t))};a(t);var v,z,A,r,C=function(){if((A=b.offsetWidth)!=v||(r=b.offsetHeight)!=z)q=!0,v=A,z=r;g()},Q=function(a,b,c){a.attachEvent?
|
|
|
|
|
a.attachEvent("on"+b,c):a.addEventListener(b,c)};Q(d,"scroll",C);Q(f,"scroll",C)}var t=function(){GraphViewer.resizeSensorEnabled&&d()},v=Object.prototype.toString.call(e),A="[object Array]"===v||"[object NodeList]"===v||"[object HTMLCollection]"===v||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(A)for(var v=0,c=e.length;v<c;v++)q(e[v],t);else q(e,t);this.detach=function(){if(A)for(var a=0,c=e.length;a<c;a++)b.detach(e[a]);else b.detach(e)}};
|
|
|
|
|
b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})();
|
|
|
|
|
(function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();
|
|
|
|
|