parent
407ec9fec1
commit
d1aa6933ab
13 changed files with 973 additions and 944 deletions
|
@ -1,3 +1,8 @@
|
|||
21-JUN-2018: 8.8.6
|
||||
|
||||
- Improves detection of gliffy macro in conf cloud
|
||||
- Fixes inconsistent menus
|
||||
|
||||
21-JUN-2018: 8.8.5
|
||||
|
||||
- Fixes delete property in data dialog
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
8.8.5
|
||||
8.8.6
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 06/21/2018 04:02 PM
|
||||
# 06/21/2018 06:20 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
476
src/main/webapp/js/app.min.js
vendored
476
src/main/webapp/js/app.min.js
vendored
|
@ -6894,10 +6894,10 @@ StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.sav
|
|||
StorageFile.prototype.saveFile=function(a,b,c,d){if(this.isEditable()){var e=mxUtils.bind(this,function(){this.isRenamable()&&(this.title=a);try{this.ui.setLocalData(this.title,this.getData(),mxUtils.bind(this,function(){this.setModified(!1);this.contentChanged();null!=c&&c()}))}catch(g){null!=d&&d(g)}});this.isRenamable()&&"."==a.charAt(0)&&null!=d?d({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(b){this.isRenamable()&&this.getTitle()!=a&&null!=b?this.ui.confirm(mxResources.get("replaceIt",
|
||||
[a]),e,d):e()}))}else null!=c&&c()};StorageFile.prototype.rename=function(a,b,c){var d=this.getTitle();d!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(e){var g=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(d,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(d,b)}),c)});null!=e?this.ui.confirm(mxResources.get("replaceIt",[a]),g,c):g()})):b()};
|
||||
StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,b,c){StorageFile.call(this,a,b,c)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,b,c){this.saveFile(a,!1,b,c)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
|
||||
StorageLibrary.prototype.isRenamable=function(a,b,c){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,c){StorageFile.call(this,a,b,c);a=c;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,c){return!1};UrlLibrary.prototype.saveAs=function(a,b,c){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,c){function d(d,e,g,p,A,t){function w(){mxEvent.addListener(v,"click",null!=t?t:function(){g!=App.MODE_GOOGLE||a.isDriveDomain()?g==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(g,f.checked);b()})):(a.setMode(g,f.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var v=document.createElement("a");v.style.overflow="hidden";v.style.display=
|
||||
StorageLibrary.prototype.isRenamable=function(a,b,c){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,b,c){StorageFile.call(this,a,b,c);a=c;b=a.lastIndexOf("/");0<=b&&(a=a.substring(b+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,b,c){return!1};UrlLibrary.prototype.saveAs=function(a,b,c){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,b,c){function d(d,e,g,p,A,t){function x(){mxEvent.addListener(v,"click",null!=t?t:function(){g!=App.MODE_GOOGLE||a.isDriveDomain()?g==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(g,f.checked);b()})):(a.setMode(g,f.checked),b()):window.location.hostname=DriveClient.prototype.newAppHostname})}var v=document.createElement("a");v.style.overflow="hidden";v.style.display=
|
||||
mxClient.IS_QUIRKS?"inline":"inline-block";v.className="geBaseButton";v.style.boxSizing="border-box";v.style.fontSize="11px";v.style.position="relative";v.style.margin="4px";v.style.padding="8px 10px 12px 10px";v.style.width="88px";v.style.height="100px";v.style.whiteSpace="nowrap";v.setAttribute("title",e);mxClient.IS_QUIRKS&&(v.style.cssFloat="left",v.style.zoom="1");var u=document.createElement("div");u.style.textOverflow="ellipsis";u.style.overflow="hidden";if(null!=d){var q=document.createElement("img");
|
||||
q.setAttribute("src",d);q.setAttribute("border","0");q.setAttribute("align","absmiddle");q.style.width="60px";q.style.height="60px";q.style.paddingBottom="6px";v.appendChild(q)}else u.style.paddingTop="5px",u.style.whiteSpace="normal",mxClient.IS_IOS?(v.style.padding="0px 10px 20px 10px",v.style.top="6px"):mxClient.IS_FF&&(u.style.paddingTop="0px",u.style.marginTop="-2px");v.appendChild(u);mxUtils.write(u,e);if(null!=A)for(d=0;d<A.length;d++)mxUtils.br(u),mxUtils.write(u,A[d]);if(null!=p&&null==a[p]){q.style.visibility=
|
||||
"hidden";mxUtils.setOpacity(u,10);var h=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});h.spin(v);var C=window.setTimeout(function(){null==a[p]&&(h.stop(),v.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(C),mxUtils.setOpacity(u,100),q.style.visibility="",h.stop(),w(),"drive"==p&&null!=n.parentNode&&n.parentNode.removeChild(n))}))}else w();
|
||||
"hidden";mxUtils.setOpacity(u,10);var h=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});h.spin(v);var C=window.setTimeout(function(){null==a[p]&&(h.stop(),v.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(C),mxUtils.setOpacity(u,100),q.style.visibility="",h.stop(),x(),"drive"==p&&null!=n.parentNode&&n.parentNode.removeChild(n))}))}else x();
|
||||
l.appendChild(v);++k>=c&&(mxUtils.br(l),k=0)}c=null!=c?c:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var g=a.addLanguageMenu(e,!0);null!=g&&(g.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){g=document.createElement("a");g.setAttribute("href","https://about.draw.io/support/");g.setAttribute("title",mxResources.get("help"));g.setAttribute("target","_blank");g.style.position=
|
||||
"absolute";g.style.textDecoration="none";g.style.cursor="pointer";g.style.fontSize="12px";g.style.bottom="28px";g.style.left="26px";g.style.color="gray";var h=document.createElement("img");h.setAttribute("border","0");h.setAttribute("valign","bottom");h.setAttribute("src",Editor.helpImage);h.style.marginRight="2px";g.appendChild(h);mxUtils.write(g,mxResources.get("help"));e.appendChild(g)}var m=document.createElement("div");m.style.position="absolute";m.style.cursor="pointer";m.style.fontSize="12px";
|
||||
m.style.bottom="28px";m.style.color="gray";mxUtils.write(m,mxResources.get("decideLater"));a.isOfflineApp()?m.style.right="20px":(mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)"),m.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)m.style.marginLeft=-Math.round(m.clientWidth/2)+"px"};e.appendChild(m);mxEvent.addListener(m,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,
|
||||
|
@ -6932,15 +6932,15 @@ mxResources.get("drawingTooLarge")})}}),f=document.createElement("img");f.setAtt
|
|||
encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(b)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}}),f=document.createElement("img"),f.setAttribute("src",Editor.tweetImage),f.setAttribute("width","18"),f.setAttribute("height","18"),f.setAttribute("border","0"),f.style.marginBottom="5px",k.appendChild(f),k.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),k.style.verticalAlign=
|
||||
"bottom",k.style.paddingTop="4px",k.style.minWidth="46px",k.className="geBtn",h.appendChild(k))}f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.appendChild(f);k=mxUtils.button(mxResources.get("copy"),function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>b.length?mxClient.IS_SF||null!=document.documentMode?
|
||||
f.className="geBtn gePrimaryBtn":(h.appendChild(k),k.className="geBtn gePrimaryBtn",f.className="geBtn"):(h.appendChild(l),f.className="geBtn",l.className="geBtn gePrimaryBtn");d.appendChild(h);this.container=d};EmbedDialog.showPreviewOption=!0;
|
||||
var GoogleSitesDialog=function(a,b){function c(){var a=null!=x.getTitle()?x.getTitle():this.defaultFilename;if(F.checked&&""!=t.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<B.length&&(b+="&s="+B);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(A.checked?"1":"0");b+="&resize="+
|
||||
(p.checked?"1":"0");b+="&x0="+Number(k.value);b+="&y0="+l;e.mathEnabled&&(b+="&math=1");C.checked?b+="&edit=_blank":w.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));f.value=b}else x.constructor==DriveFile||x.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?b+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(b+=x.getHash().substring(1),b=x.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+
|
||||
var GoogleSitesDialog=function(a,b){function c(){var a=null!=w.getTitle()?w.getTitle():this.defaultFilename;if(E.checked&&""!=t.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<B.length&&(b+="&s="+B);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=n.value&&(b+="&height="+n.value);b+="&pan="+(q.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(A.checked?"1":"0");b+="&resize="+
|
||||
(p.checked?"1":"0");b+="&x0="+Number(k.value);b+="&y0="+l;e.mathEnabled&&(b+="&math=1");C.checked?b+="&edit=_blank":x.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));f.value=b}else w.constructor==DriveFile||w.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?b+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(b+=w.getHash().substring(1),b=w.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=a&&(b+="&title="+
|
||||
encodeURIComponent(a)),""!=n.value&&(a=parseInt(n.value)+parseInt(k.value),b+="&height="+a),f.value=b):f.value=""}var d=document.createElement("div"),e=a.editor.graph,g=e.getGraphBounds(),h=e.view.scale,m=Math.floor(g.x/h-e.view.translate.x),l=Math.floor(g.y/h-e.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var f=document.createElement("input");f.setAttribute("type","text");f.style.marginBottom="8px";f.style.marginTop="2px";f.style.width="410px";d.appendChild(f);
|
||||
mxUtils.br(d);this.init=function(){f.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?f.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var k=document.createElement("input");k.setAttribute("type","text");k.setAttribute("size","4");k.style.marginRight="16px";k.style.marginLeft="4px";k.value=m;d.appendChild(k);mxUtils.write(d,mxResources.get("height")+":");var n=document.createElement("input");n.setAttribute("type",
|
||||
"text");n.setAttribute("size","4");n.style.marginLeft="4px";n.value=Math.ceil(g.height/h);d.appendChild(n);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var t=document.createElement("input");t.setAttribute("type","text");t.setAttribute("size","28");t.style.marginBottom="8px";t.style.marginTop="2px";t.style.width="410px";t.value=b||"";
|
||||
d.appendChild(t);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";d.appendChild(u);mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";d.appendChild(q);mxUtils.write(d,mxResources.get("pan")+" ");var v=document.createElement("input");
|
||||
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";d.appendChild(v);mxUtils.write(d,mxResources.get("zoom")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.style.marginLeft="8px";w.setAttribute("title",window.location.href);d.appendChild(w);mxUtils.write(d,mxResources.get("edit")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft="8px";d.appendChild(C);mxUtils.write(d,
|
||||
mxResources.get("asNew")+" ");mxUtils.br(d);var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="16px";d.appendChild(p);mxUtils.write(d,mxResources.get("resize")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";d.appendChild(A);mxUtils.write(d,mxResources.get("fit")+" ");var F=document.createElement("input");F.setAttribute("type","checkbox");F.style.marginLeft=
|
||||
"8px";d.appendChild(F);mxUtils.write(d,mxResources.get("embed")+" ");var B=a.getBasenames().join(";"),x=a.getCurrentFile();mxEvent.addListener(q,"change",c);mxEvent.addListener(v,"change",c);mxEvent.addListener(p,"change",c);mxEvent.addListener(A,"change",c);mxEvent.addListener(w,"change",c);mxEvent.addListener(C,"change",c);mxEvent.addListener(F,"change",c);mxEvent.addListener(n,"change",c);mxEvent.addListener(k,"change",c);mxEvent.addListener(u,"change",c);mxEvent.addListener(t,"change",c);c();
|
||||
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";d.appendChild(v);mxUtils.write(d,mxResources.get("zoom")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";x.setAttribute("title",window.location.href);d.appendChild(x);mxUtils.write(d,mxResources.get("edit")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft="8px";d.appendChild(C);mxUtils.write(d,
|
||||
mxResources.get("asNew")+" ");mxUtils.br(d);var p=document.createElement("input");p.setAttribute("type","checkbox");p.setAttribute("checked","checked");p.defaultChecked=!0;p.style.marginLeft="16px";d.appendChild(p);mxUtils.write(d,mxResources.get("resize")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";d.appendChild(A);mxUtils.write(d,mxResources.get("fit")+" ");var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginLeft=
|
||||
"8px";d.appendChild(E);mxUtils.write(d,mxResources.get("embed")+" ");var B=a.getBasenames().join(";"),w=a.getCurrentFile();mxEvent.addListener(q,"change",c);mxEvent.addListener(v,"change",c);mxEvent.addListener(p,"change",c);mxEvent.addListener(A,"change",c);mxEvent.addListener(x,"change",c);mxEvent.addListener(C,"change",c);mxEvent.addListener(E,"change",c);mxEvent.addListener(n,"change",c);mxEvent.addListener(k,"change",c);mxEvent.addListener(u,"change",c);mxEvent.addListener(t,"change",c);c();
|
||||
mxEvent.addListener(f,"click",function(){f.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?f.select():document.execCommand("selectAll",!1,null)});g=document.createElement("div");g.style.paddingTop="12px";g.style.textAlign="right";h=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});h.className="geBtn gePrimaryBtn";g.appendChild(h);d.appendChild(g);this.container=d},CreateGraphDialog=function(a,b,c){var d=document.createElement("div");d.style.textAlign=
|
||||
"right";this.init=function(){var b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.width="100%";b.style.height="360px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);d.appendChild(b);var g=new Graph(b);g.setCellsCloneable(!0);g.setPanning(!0);g.setAllowDanglingEdges(!1);g.connectionHandler.select=!1;g.view.setTranslate(20,20);g.border=20;g.panningHandler.useLeftButtonForPanning=!0;var h="curved=1;";g.cellRenderer.installCellOverlayListeners=
|
||||
function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};g.getAllConnectionConstraints=function(){return null};g.connectionHandler.marker.highlight.keepOnTop=
|
||||
|
@ -6971,8 +6971,8 @@ l.vertex=!0;p=sb.cloneCell(l,0<m?"PK":"");p.connectable=!1;p.style="shape=partia
|
|||
d=f.view,p=f.getGraphBounds(),f.setSelectionCells(f.importCells(t,Math.ceil(Math.max(0,p.x/d.scale-d.translate.x)+4*f.gridSize),Math.ceil(Math.max(0,(p.y+p.height)/d.scale-d.translate.y)+4*f.gridSize))),f.scrollCellToVisible(f.getSelectionCell()))}else if("list"==c){if(0<d.length){f=a.editor.graph;n=new mxCell(d[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");
|
||||
n.vertex=!0;p=f.getPreferredSizeForCell(n);null!=p&&n.geometry.width<p.width+10&&(n.geometry.width=p.width+10);l=[n];if(1<d.length)for(h=1;h<d.length;h++)"--"==d[h]?(p=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),p.vertex=!0,n.geometry.height+=p.geometry.height,n.insert(p),l.push(p)):0<d[h].length&&";"!=d[h].charAt(0)&&(u=new mxCell(d[h],
|
||||
new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),u.vertex=!0,p=f.getPreferredSizeForCell(u),null!=p&&u.geometry.width<p.width&&(u.geometry.width=p.width),n.geometry.width=Math.max(n.geometry.width,u.geometry.width),n.geometry.height+=u.geometry.height,n.insert(u),l.push(u));f.getModel().beginUpdate();try{n=f.importCells([n],g.x,g.y)[0],f.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[n].concat(n.children)))}finally{f.getModel().endUpdate()}f.setSelectionCell(n);f.scrollCellToVisible(f.getSelectionCell())}}else{for(var l=function(a){var b=D[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,D[a]=b,t.push(b));return b},D={},t=[],h=0;h<d.length;h++)if(";"!=d[h].charAt(0)){var I=d[h].split("->");2<=I.length&&(u=l(I[0]),m=l(I[I.length-1]),I=new mxCell(2<I.length?I[1]:"",new mxGeometry),I.edge=!0,u.insertEdge(I,!0),m.insertEdge(I,!1),
|
||||
t.push(I))}if(0<t.length){d=document.createElement("div");d.style.visibility="hidden";document.body.appendChild(d);f=new Graph(d);f.getModel().beginUpdate();try{t=f.importCells(t);for(h=0;h<t.length;h++)f.getModel().isVertex(t[h])&&(p=f.getPreferredSizeForCell(t[h]),t[h].geometry.width=Math.max(t[h].geometry.width,p.width),t[h].geometry.height=Math.max(t[h].geometry.height,p.height));n=new mxFastOrganicLayout(f);n.disableEdgeStyle=!1;n.forceConstant=120;n.execute(f.getDefaultParent())}finally{f.getModel().endUpdate()}f.clearCellOverlays();
|
||||
"cells",[n].concat(n.children)))}finally{f.getModel().endUpdate()}f.setSelectionCell(n);f.scrollCellToVisible(f.getSelectionCell())}}else{for(var l=function(a){var b=D[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,D[a]=b,t.push(b));return b},D={},t=[],h=0;h<d.length;h++)if(";"!=d[h].charAt(0)){var H=d[h].split("->");2<=H.length&&(u=l(H[0]),m=l(H[H.length-1]),H=new mxCell(2<H.length?H[1]:"",new mxGeometry),H.edge=!0,u.insertEdge(H,!0),m.insertEdge(H,!1),
|
||||
t.push(H))}if(0<t.length){d=document.createElement("div");d.style.visibility="hidden";document.body.appendChild(d);f=new Graph(d);f.getModel().beginUpdate();try{t=f.importCells(t);for(h=0;h<t.length;h++)f.getModel().isVertex(t[h])&&(p=f.getPreferredSizeForCell(t[h]),t[h].geometry.width=Math.max(t[h].geometry.width,p.width),t[h].geometry.height=Math.max(t[h].geometry.height,p.height));n=new mxFastOrganicLayout(f);n.disableEdgeStyle=!1;n.forceConstant=120;n.execute(f.getDefaultParent())}finally{f.getModel().endUpdate()}f.clearCellOverlays();
|
||||
l=[];a.editor.graph.getModel().beginUpdate();try{l=a.editor.graph.importCells(f.getModel().getChildren(f.getDefaultParent()),g.x,g.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",l))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(l);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());f.destroy();d.parentNode.removeChild(d)}}}function e(){return"list"==m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":
|
||||
"table"==m.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==m.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
|
||||
"plantUmlSvg"==m.value||"plantUmlTxt"==m.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var g=a.editor.graph.getFreeInsertPoint();b=document.createElement("div");b.style.textAlign="right";var h=document.createElement("textarea");h.style.resize="none";h.style.width="100%";h.style.height=
|
||||
|
@ -6980,37 +6980,37 @@ l=[];a.editor.graph.getModel().beginUpdate();try{l=a.editor.graph.importCells(f.
|
|||
l=document.createElement("option");l.setAttribute("value","diagram");mxUtils.write(l,mxResources.get("diagram"));"plantUml"!=c&&m.appendChild(l);l=document.createElement("option");l.setAttribute("value","plantUmlSvg");mxUtils.write(l,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==c&&l.setAttribute("selected","selected");var f=document.createElement("option");f.setAttribute("value","plantUmlPng");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
|
||||
")");var k=document.createElement("option");k.setAttribute("value","plantUmlTxt");mxUtils.write(k,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==c&&(m.appendChild(l),m.appendChild(f),m.appendChild(k));var n=e();h.value=n;b.appendChild(h);this.init=function(){h.focus()};Graph.fileSupport&&(h.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),h.addEventListener("drop",function(a){a.stopPropagation();
|
||||
a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){h.value=a.target.result};b.readAsText(a)}},!1));b.appendChild(m);mxEvent.addListener(m,"change",function(){var a=e();if(0==h.value.length||h.value==n)n=a,h.value=n});c=mxUtils.button(mxResources.get("close"),function(){h.value==n?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);l=mxUtils.button(mxResources.get("insert"),
|
||||
function(){a.hideDialog();d(h.value,m.value)});b.appendChild(l);l.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(c);this.container=b},NewDialog=function(a,b,c,d,e,g,h,m,l,f,k,n,t,u,q){function v(){for(var a=!0;y<Q.length&&(a||0!=mxUtils.mod(y,30));)a=Q[y++],p(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick),a=!1}function w(){if(S)c||a.hideDialog(),u(S,O,E.value);else if(d)c||a.hideDialog(),d(Z,E.value);else{var b=E.value;null!=b&&0<b.length&&
|
||||
function(){a.hideDialog();d(h.value,m.value)});b.appendChild(l);l.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(c);this.container=b},NewDialog=function(a,b,c,d,e,g,h,m,l,f,k,n,t,u,q){function v(){for(var a=!0;y<Q.length&&(a||0!=mxUtils.mod(y,30));)a=Q[y++],p(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick),a=!1}function x(){if(S)c||a.hideDialog(),u(S,O,J.value);else if(d)c||a.hideDialog(),d(Z,J.value);else{var b=J.value;null!=b&&0<b.length&&
|
||||
a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null,function(c){a.createFile(b,Z,null!=X&&0<X.length?X:null,null,function(){a.hideDialog()},null,c)})}}function C(a,b,c,d,f){null!=N&&(N.style.backgroundColor="transparent",N.style.border="1px solid transparent");D.removeAttribute("disabled");Z=b;X=c;N=a;S=d;O=f;N.style.backgroundColor=m;N.style.border=l}function p(a,b,c,d,f,k,p,e){var n=document.createElement("div");
|
||||
n.className="geTemplate";n.style.height=R+"px";n.style.width=T+"px";null!=d&&0<d.length&&n.setAttribute("title",d);if(null!=k)n.style.backgroundImage="url("+k+")",n.style.backgroundSize="contain",n.style.backgroundPosition="center center",n.style.backgroundRepeat="no-repeat",mxEvent.addListener(n,"click",function(b){C(n,null,null,a,p)}),mxEvent.addListener(n,"dblclick",function(a){w()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);n.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,
|
||||
a.length-4)+".png)";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";var g=!1;mxEvent.addListener(n,"click",function(c){D.setAttribute("disabled","disabled");n.style.backgroundColor="transparent";n.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(C(n,a.getText(),b),g&&w())}))});mxEvent.addListener(n,"dblclick",function(a){g=!0})}else n.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
|
||||
mxResources.get(c)+"</td></tr></table>",f&&C(n),null!=e?mxEvent.addListener(n,"click",e):(mxEvent.addListener(n,"click",function(a){C(n)}),mxEvent.addListener(n,"dblclick",function(a){w()}));H.appendChild(n)}function A(){mxEvent.addListener(H,"scroll",function(a){H.scrollTop+H.clientHeight>=H.scrollHeight&&(v(),mxEvent.consume(a))});var a=null,b;for(b in V){var c=document.createElement("div"),d=mxResources.get(b),k=V[b];null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1));18<d.length&&(d=d.substring(0,
|
||||
18)+"…");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";c.setAttribute("title",d+" ("+k.length+")");mxUtils.write(c,c.getAttribute("title"));null!=f&&(c.style.padding=f);W.appendChild(c);null==a&&(a=c,a.style.backgroundColor=h);(function(b,d){mxEvent.addListener(c,"click",function(){a!=d&&(a.style.backgroundColor="",a=d,a.style.backgroundColor=h,H.scrollTop=0,H.innerHTML="",y=0,Q=V[b],z=null,v())})})(b,
|
||||
c)}v()}c=null!=c?c:!0;e=null!=e?e:!1;h=null!=h?h:"#ebf2f9";m=null!=m?m:"#e6eff8";l=null!=l?l:"1px solid #ccd9ea";k=null!=k?k:TEMPLATE_PATH+"/index.xml";var F=document.createElement("div");F.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";c&&F.appendChild(B);var x=document.createElement("img");x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.style.width="40px";x.style.height="40px";x.style.marginRight="10px";x.style.paddingBottom=
|
||||
"4px";x.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&c&&B.appendChild(x);c&&mxUtils.write(B,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
|
||||
mxResources.get("filename"))+":");x=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?x=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?x=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?x=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?x=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(x=a.trello.extension);var E=document.createElement("input");E.setAttribute("value",a.defaultFilename+x);E.style.marginRight="20px";E.style.marginLeft="10px";E.style.width=
|
||||
b?"220px":"430px";this.init=function(){c&&(E.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?E.select():document.execCommand("selectAll",!1,null))};c&&B.appendChild(E);var B=!1,y=0,D=mxUtils.button(mxResources.get("create"),function(){D.setAttribute("disabled","disabled");w();D.removeAttribute("disabled")});D.className="geBtn gePrimaryBtn";if(n||t){var I=[],z=null,J=function(a){D.setAttribute("disabled","disabled");for(var b=0;b<I.length;b++)I[b].className=b==
|
||||
a?"geBtn gePrimaryBtn":"geBtn"},B=!0,x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height="30px";F.appendChild(x);var G=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){W.style.display="";H.style.left="160px";J(0);H.scrollTop=0;H.innerHTML="";y=0;z!=Q&&(Q=z,v(),z=null)});I.push(G);x.appendChild(G);var L=function(a){W.style.display="none";H.style.left="30px";J(a?-1:1);null==z&&(z=Q);H.scrollTop=0;H.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,
|
||||
radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(H);y=0;var c=function(a,c){b.stop();Q=a;c?H.innerHTML=c:0==a.length?H.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(H.innerHTML="",v())};a?t(M.value,c):n(c)};n&&(G=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),x.appendChild(G),I.push(G));if(t){G=document.createElement("span");G.style.marginLeft="10px";G.innerHTML=mxResources.get("search")+":";x.appendChild(G);
|
||||
var M=document.createElement("input");M.style.marginRight="10px";M.style.marginLeft="10px";M.style.width="220px";mxEvent.addListener(M,"keypress",function(a){13==a.keyCode&&L(!0)});x.appendChild(M);G=mxUtils.button(mxResources.get("search"),function(){L(!0)});G.className="geBtn";x.appendChild(G)}J(0)}var X=null,Z=null,N=null,S=null,O=null,H=document.createElement("div");H.style.border="1px solid #d3d3d3";H.style.position="absolute";H.style.left="160px";H.style.right="34px";B=(c?72:40)+(B?30:0);H.style.top=
|
||||
B+"px";H.style.bottom="68px";H.style.margin="6px 0 0 -1px";H.style.padding="6px";H.style.overflow="auto";var W=document.createElement("div");W.style.cssText="position:absolute;left:30px;width:128px;top:"+B+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var R=140,T=140,V={},K=1;V.basic=[{title:"blankDiagram",select:!0}];var Q=V.basic;if(!b){F.appendChild(W);F.appendChild(H);var P=!1;mxUtils.get(k,function(a){if(!P){P=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==
|
||||
typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=V[b];null==c&&(K++,c=[],V[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=a.nextSibling}A()}})}mxEvent.addListener(E,"keypress",function(a){13==a.keyCode&&w()});k=document.createElement("div");k.style.marginTop=b?"4px":"16px";k.style.textAlign="right";k.style.position="absolute";k.style.left="40px";k.style.bottom=
|
||||
"24px";k.style.right="40px";B=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g();a.hideDialog(!0)});B.className="geBtn";!a.editor.cancelFirst||e&&null==g||k.appendChild(B);b||a.isOffline()||!c||null!=d||e||(x=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),x.className="geBtn",k.appendChild(x));b||"1"==urlParams.embed||e||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,
|
||||
"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(E.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",k.appendChild(b));Graph.fileSupport&&q&&(q=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple",
|
||||
"multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0)});b.click()}),q.className="geBtn",k.appendChild(q));k.appendChild(D);a.editor.cancelFirst||null!=d||e&&null==g||k.appendChild(B);F.appendChild(k);this.container=F},CreateDialog=function(a,b,c,d,e,g,h,m,l,f,k,n,t,u,q){function v(c,d,f,k){function p(){mxEvent.addListener(e,"click",function(){var c=f;if(h){var d=A.value,k=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>k){var c=null!=c?c:x.value,
|
||||
p="";c==App.MODE_GOOGLE?p=a.drive.extension:c==App.MODE_GITHUB?p=a.gitHub.extension:c==App.MODE_TRELLO?p=a.trello.extension:c==App.MODE_DROPBOX?p=a.dropbox.extension:c==App.MODE_ONEDRIVE?p=a.oneDrive.extension:c==App.MODE_DEVICE&&(p=".xml");0<=k&&(d=d.substring(0,k));A.value=d+p}}w(f)})}var e=document.createElement("a");e.style.overflow="hidden";var g=document.createElement("img");g.src=c;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom=
|
||||
n.className="geTemplate";n.style.height=R+"px";n.style.width=T+"px";null!=d&&0<d.length&&n.setAttribute("title",d);if(null!=k)n.style.backgroundImage="url("+k+")",n.style.backgroundSize="contain",n.style.backgroundPosition="center center",n.style.backgroundRepeat="no-repeat",mxEvent.addListener(n,"click",function(b){C(n,null,null,a,p)}),mxEvent.addListener(n,"dblclick",function(a){x()});else if(null!=a&&0<a.length){a.substring(0,a.length-4);n.style.backgroundImage="url("+TEMPLATE_PATH+"/"+a.substring(0,
|
||||
a.length-4)+".png)";n.style.backgroundPosition="center center";n.style.backgroundRepeat="no-repeat";var g=!1;mxEvent.addListener(n,"click",function(c){D.setAttribute("disabled","disabled");n.style.backgroundColor="transparent";n.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+a,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(C(n,a.getText(),b),g&&x())}))});mxEvent.addListener(n,"dblclick",function(a){g=!0})}else n.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
|
||||
mxResources.get(c)+"</td></tr></table>",f&&C(n),null!=e?mxEvent.addListener(n,"click",e):(mxEvent.addListener(n,"click",function(a){C(n)}),mxEvent.addListener(n,"dblclick",function(a){x()}));G.appendChild(n)}function A(){mxEvent.addListener(G,"scroll",function(a){G.scrollTop+G.clientHeight>=G.scrollHeight&&(v(),mxEvent.consume(a))});var a=null,b;for(b in V){var c=document.createElement("div"),d=mxResources.get(b),k=V[b];null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1));18<d.length&&(d=d.substring(0,
|
||||
18)+"…");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";c.setAttribute("title",d+" ("+k.length+")");mxUtils.write(c,c.getAttribute("title"));null!=f&&(c.style.padding=f);W.appendChild(c);null==a&&(a=c,a.style.backgroundColor=h);(function(b,d){mxEvent.addListener(c,"click",function(){a!=d&&(a.style.backgroundColor="",a=d,a.style.backgroundColor=h,G.scrollTop=0,G.innerHTML="",y=0,Q=V[b],z=null,v())})})(b,
|
||||
c)}v()}c=null!=c?c:!0;e=null!=e?e:!1;h=null!=h?h:"#ebf2f9";m=null!=m?m:"#e6eff8";l=null!=l?l:"1px solid #ccd9ea";k=null!=k?k:TEMPLATE_PATH+"/index.xml";var E=document.createElement("div");E.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";c&&E.appendChild(B);var w=document.createElement("img");w.setAttribute("border","0");w.setAttribute("align","absmiddle");w.style.width="40px";w.style.height="40px";w.style.marginRight="10px";w.style.paddingBottom=
|
||||
"4px";w.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!b&&c&&B.appendChild(w);c&&mxUtils.write(B,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
|
||||
mxResources.get("filename"))+":");w=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?w=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?w=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?w=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?w=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(w=a.trello.extension);var J=document.createElement("input");J.setAttribute("value",a.defaultFilename+w);J.style.marginRight="20px";J.style.marginLeft="10px";J.style.width=
|
||||
b?"220px":"430px";this.init=function(){c&&(J.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?J.select():document.execCommand("selectAll",!1,null))};c&&B.appendChild(J);var B=!1,y=0,D=mxUtils.button(mxResources.get("create"),function(){D.setAttribute("disabled","disabled");x();D.removeAttribute("disabled")});D.className="geBtn gePrimaryBtn";if(n||t){var H=[],z=null,I=function(a){D.setAttribute("disabled","disabled");for(var b=0;b<H.length;b++)H[b].className=b==
|
||||
a?"geBtn gePrimaryBtn":"geBtn"},B=!0,w=document.createElement("div");w.style.whiteSpace="nowrap";w.style.height="30px";E.appendChild(w);var F=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){W.style.display="";G.style.left="160px";I(0);G.scrollTop=0;G.innerHTML="";y=0;z!=Q&&(Q=z,v(),z=null)});H.push(F);w.appendChild(F);var L=function(a){W.style.display="none";G.style.left="30px";I(a?-1:1);null==z&&(z=Q);G.scrollTop=0;G.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,
|
||||
radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(G);y=0;var c=function(a,c){b.stop();Q=a;c?G.innerHTML=c:0==a.length?G.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(G.innerHTML="",v())};a?t(M.value,c):n(c)};n&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),w.appendChild(F),H.push(F));if(t){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxResources.get("search")+":";w.appendChild(F);
|
||||
var M=document.createElement("input");M.style.marginRight="10px";M.style.marginLeft="10px";M.style.width="220px";mxEvent.addListener(M,"keypress",function(a){13==a.keyCode&&L(!0)});w.appendChild(M);F=mxUtils.button(mxResources.get("search"),function(){L(!0)});F.className="geBtn";w.appendChild(F)}I(0)}var X=null,Z=null,N=null,S=null,O=null,G=document.createElement("div");G.style.border="1px solid #d3d3d3";G.style.position="absolute";G.style.left="160px";G.style.right="34px";B=(c?72:40)+(B?30:0);G.style.top=
|
||||
B+"px";G.style.bottom="68px";G.style.margin="6px 0 0 -1px";G.style.padding="6px";G.style.overflow="auto";var W=document.createElement("div");W.style.cssText="position:absolute;left:30px;width:128px;top:"+B+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var R=140,T=140,V={},K=1;V.basic=[{title:"blankDiagram",select:!0}];var Q=V.basic;if(!b){E.appendChild(W);E.appendChild(G);var P=!1;mxUtils.get(k,function(a){if(!P){P=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==
|
||||
typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=V[b];null==c&&(K++,c=[],V[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url")})}}a=a.nextSibling}A()}})}mxEvent.addListener(J,"keypress",function(a){13==a.keyCode&&x()});k=document.createElement("div");k.style.marginTop=b?"4px":"16px";k.style.textAlign="right";k.style.position="absolute";k.style.left="40px";k.style.bottom=
|
||||
"24px";k.style.right="40px";B=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g();a.hideDialog(!0)});B.className="geBtn";!a.editor.cancelFirst||e&&null==g||k.appendChild(B);b||a.isOffline()||!c||null!=d||e||(w=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),w.className="geBtn",k.appendChild(w));b||"1"==urlParams.embed||e||(b=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,
|
||||
"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(J.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),b.className="geBtn",k.appendChild(b));Graph.fileSupport&&q&&(q=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple",
|
||||
"multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0)});b.click()}),q.className="geBtn",k.appendChild(q));k.appendChild(D);a.editor.cancelFirst||null!=d||e&&null==g||k.appendChild(B);E.appendChild(k);this.container=E},CreateDialog=function(a,b,c,d,e,g,h,m,l,f,k,n,t,u,q){function v(c,d,f,k){function p(){mxEvent.addListener(e,"click",function(){var c=f;if(h){var d=A.value,k=d.lastIndexOf(".");if(0>b.lastIndexOf(".")&&0>k){var c=null!=c?c:w.value,
|
||||
p="";c==App.MODE_GOOGLE?p=a.drive.extension:c==App.MODE_GITHUB?p=a.gitHub.extension:c==App.MODE_TRELLO?p=a.trello.extension:c==App.MODE_DROPBOX?p=a.dropbox.extension:c==App.MODE_ONEDRIVE?p=a.oneDrive.extension:c==App.MODE_DEVICE&&(p=".xml");0<=k&&(d=d.substring(0,k));A.value=d+p}}x(f)})}var e=document.createElement("a");e.style.overflow="hidden";var g=document.createElement("img");g.src=c;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom=
|
||||
"6px";e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.className="geBaseButton";e.style.position="relative";e.style.margin="4px";e.style.padding="8px 8px 10px 8px";e.style.whiteSpace="nowrap";e.appendChild(g);mxClient.IS_QUIRKS&&(e.style.cssFloat="left",e.style.zoom="1");e.style.color="gray";e.style.fontSize="11px";var t=document.createElement("div");e.appendChild(t);mxUtils.write(t,d);if(null!=k&&null==a[k]){g.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=new Spinner({lines:12,
|
||||
length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(e);var v=window.setTimeout(function(){null==a[k]&&(u.stop(),e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(v),mxUtils.setOpacity(t,100),g.style.visibility="",u.stop(),p())}))}else p();F.appendChild(e);++B==n&&(mxUtils.br(F),B=0)}function w(b){var d=A.value;if(null==b||null!=d&&0<d.length)a.hideDialog(),c(d,
|
||||
length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(e);var v=window.setTimeout(function(){null==a[k]&&(u.stop(),e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(v),mxUtils.setOpacity(t,100),g.style.visibility="",u.stop(),p())}))}else p();E.appendChild(e);++B==n&&(mxUtils.br(E),B=0)}function x(b){var d=A.value;if(null==b||null!=d&&0<d.length)a.hideDialog(),c(d,
|
||||
b)}h=null!=h?h:!0;m=null!=m?m:!0;n=null!=n?n:4;var C=document.createElement("div");null==d&&a.addLanguageMenu(C);var p=document.createElement("h2");mxUtils.write(p,e||mxResources.get("create"));p.style.marginTop="0px";p.style.marginBottom="24px";C.appendChild(p);mxUtils.write(C,mxResources.get("filename")+":");var A=document.createElement("input");A.setAttribute("value",b);A.style.width="280px";A.style.marginLeft="10px";A.style.marginBottom="20px";this.init=function(){A.focus();mxClient.IS_GC||mxClient.IS_FF||
|
||||
5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",!1,null)};C.appendChild(A);null!=t&&null!=u&&"image/"==u.substring(0,6)&&(A.style.width="160px",e=null,"image/svg+xml"==u&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(t),t=e.getElementsByTagName("svg")[0],u=parseInt(t.getAttribute("width")),q=parseInt(t.getAttribute("height")),t.setAttribute("viewBox","0 0 "+u+" "+q),t.setAttribute("width","120px"),t.setAttribute("height","80px")):
|
||||
(e=document.createElement("img"),e.setAttribute("src","data:"+u+(q?";base64,":";utf8,")+t)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),C.appendChild(e),l&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){w("_blank")})));mxUtils.br(C);var F=document.createElement("div");F.style.textAlign="center";var B=0;F.style.marginTop=
|
||||
"6px";C.appendChild(F);var x=document.createElement("select");x.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(e,mxResources.get("googleDrive")),x.appendChild(e),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_ONEDRIVE),
|
||||
mxUtils.write(e,mxResources.get("oneDrive")),x.appendChild(e),a.mode==App.MODE_ONEDRIVE&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(e,mxResources.get("dropbox")),x.appendChild(e),a.mode==App.MODE_DROPBOX&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),
|
||||
App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GITHUB),mxUtils.write(e,mxResources.get("github")),x.appendChild(e),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_TRELLO),mxUtils.write(e,mxResources.get("trello")),x.appendChild(e),v(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));
|
||||
if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&!mxClient.IS_IOS)e=document.createElement("option"),e.setAttribute("value",App.MODE_DEVICE),mxUtils.write(e,mxResources.get("device")),x.appendChild(e),a.mode!=App.MODE_DEVICE&&m||e.setAttribute("selected","selected"),k&&v(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);m&&isLocalStorage&&"0"!=urlParams.browser&&(m=document.createElement("option"),m.setAttribute("value",App.MODE_BROWSER),
|
||||
mxUtils.write(m,mxResources.get("browser")),x.appendChild(m),a.mode==App.MODE_BROWSER&&m.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));m=document.createElement("div");m.style.marginTop="26px";m.style.textAlign="center";null!=f&&(e=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),e.className="geBtn",m.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),
|
||||
window.close(),window.location.href=a.getUrl())});e.className="geBtn";a.editor.cancelFirst&&m.appendChild(e);null==d&&(t=mxUtils.button(mxResources.get("decideLater"),function(){w(null)}),t.className="geBtn",m.appendChild(t));l&&Editor.popupsAllowed&&(l=mxUtils.button(mxResources.get("openInNewWindow"),function(){w("_blank")}),l.className="geBtn",m.appendChild(l));mxClient.IS_IOS||(g=mxUtils.button(g||mxResources.get("create"),function(){w(k?"download":App.MODE_DEVICE)}),g.className="geBtn gePrimaryBtn",
|
||||
m.appendChild(g));a.editor.cancelFirst||m.appendChild(e);mxEvent.addListener(A,"keypress",function(b){13==b.keyCode?w(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});C.appendChild(m);this.container=C},PopupDialog=function(a,b,c,d,e){e=null!=e?e:!0;var g=document.createElement("div");g.style.textAlign="left";mxUtils.write(g,mxResources.get("fileOpenLocation"));mxUtils.br(g);mxUtils.br(g);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();
|
||||
(e=document.createElement("img"),e.setAttribute("src","data:"+u+(q?";base64,":";utf8,")+t)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),C.appendChild(e),l&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){x("_blank")})));mxUtils.br(C);var E=document.createElement("div");E.style.textAlign="center";var B=0;E.style.marginTop=
|
||||
"6px";C.appendChild(E);var w=document.createElement("select");w.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(e,mxResources.get("googleDrive")),w.appendChild(e),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_ONEDRIVE),
|
||||
mxUtils.write(e,mxResources.get("oneDrive")),w.appendChild(e),a.mode==App.MODE_ONEDRIVE&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(e,mxResources.get("dropbox")),w.appendChild(e),a.mode==App.MODE_DROPBOX&&e.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),
|
||||
App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_GITHUB),mxUtils.write(e,mxResources.get("github")),w.appendChild(e),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(e=document.createElement("option"),e.setAttribute("value",App.MODE_TRELLO),mxUtils.write(e,mxResources.get("trello")),w.appendChild(e),v(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));
|
||||
if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&!mxClient.IS_IOS)e=document.createElement("option"),e.setAttribute("value",App.MODE_DEVICE),mxUtils.write(e,mxResources.get("device")),w.appendChild(e),a.mode!=App.MODE_DEVICE&&m||e.setAttribute("selected","selected"),k&&v(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);m&&isLocalStorage&&"0"!=urlParams.browser&&(m=document.createElement("option"),m.setAttribute("value",App.MODE_BROWSER),
|
||||
mxUtils.write(m,mxResources.get("browser")),w.appendChild(m),a.mode==App.MODE_BROWSER&&m.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));m=document.createElement("div");m.style.marginTop="26px";m.style.textAlign="center";null!=f&&(e=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),e.className="geBtn",m.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){null!=d?d():(a.fileLoaded(null),a.hideDialog(),
|
||||
window.close(),window.location.href=a.getUrl())});e.className="geBtn";a.editor.cancelFirst&&m.appendChild(e);null==d&&(t=mxUtils.button(mxResources.get("decideLater"),function(){x(null)}),t.className="geBtn",m.appendChild(t));l&&Editor.popupsAllowed&&(l=mxUtils.button(mxResources.get("openInNewWindow"),function(){x("_blank")}),l.className="geBtn",m.appendChild(l));mxClient.IS_IOS||(g=mxUtils.button(g||mxResources.get("create"),function(){x(k?"download":App.MODE_DEVICE)}),g.className="geBtn gePrimaryBtn",
|
||||
m.appendChild(g));a.editor.cancelFirst||m.appendChild(e);mxEvent.addListener(A,"keypress",function(b){13==b.keyCode?x(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});C.appendChild(m);this.container=C},PopupDialog=function(a,b,c,d,e){e=null!=e?e:!0;var g=document.createElement("div");g.style.textAlign="left";mxUtils.write(g,mxResources.get("fileOpenLocation"));mxUtils.br(g);mxUtils.br(g);var h=mxUtils.button(mxResources.get("openInThisWindow"),function(){e&&a.hideDialog();
|
||||
null!=d&&d()});h.className="geBtn";h.style.marginBottom="8px";h.style.width="280px";g.appendChild(h);mxUtils.br(g);var m=mxUtils.button(mxResources.get("openInNewWindow"),function(){e&&a.hideDialog();null!=c&&c();a.openLink(b)});m.className="geBtn gePrimaryBtn";m.style.width=h.style.width;g.appendChild(m);mxUtils.br(g);mxUtils.br(g);mxUtils.write(g,mxResources.get("allowPopups"));this.container=g},ImageDialog=function(a,b,c,d,e,g){g=null!=g?g:!0;var h=a.editor.graph,m=document.createElement("div");
|
||||
mxUtils.write(m,b);b=document.createElement("div");b.className="geTitle";b.style.backgroundColor="transparent";b.style.borderColor="transparent";b.style.whiteSpace="nowrap";b.style.textOverflow="clip";b.style.cursor="default";mxClient.IS_VML||(b.style.paddingRight="20px");var l=document.createElement("input");l.setAttribute("value",c);l.setAttribute("type","text");l.setAttribute("spellcheck","false");l.setAttribute("autocorrect","off");l.setAttribute("autocomplete","off");l.setAttribute("autocapitalize",
|
||||
"off");l.style.marginTop="6px";l.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";l.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";l.style.backgroundRepeat="no-repeat";l.style.backgroundPosition="100% 50%";l.style.paddingRight="14px";c=document.createElement("div");c.setAttribute("title",mxResources.get("reset"));c.style.position="relative";c.style.left="-16px";c.style.width="12px";c.style.height="14px";c.style.cursor="pointer";c.style.display=mxClient.IS_VML?
|
||||
|
@ -7024,21 +7024,21 @@ a.url));l.focus()};if(Graph.fileSupport){var n=document.createElement("input");n
|
|||
a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),t.className="geBtn",c.appendChild(t),null!=a.drive&&"1"==urlParams.photos&&(t=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
|
||||
a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),t.className="geBtn",c.appendChild(t)));mxEvent.addListener(l,"keypress",function(a){13==a.keyCode&&k(l.value)});t=mxUtils.button(mxResources.get("apply"),function(){k(l.value)});t.className="geBtn gePrimaryBtn";c.appendChild(t);a.editor.cancelFirst||c.appendChild(b);Graph.fileSupport&&(c.style.marginTop="120px",m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",m.style.backgroundPosition=
|
||||
"center 65%",m.style.backgroundRepeat="no-repeat",b=document.createElement("div"),b.style.position="absolute",b.style.width="420px",b.style.top="58%",b.style.textAlign="center",b.style.fontSize="18px",b.style.color="#a0c3ff",mxUtils.write(b,mxResources.get("dragImagesHere")),m.appendChild(b));m.appendChild(c);this.container=m},LinkDialog=function(a,b,c,d,e){function g(a,b,c){c=mxUtils.button("",c);c.className="geBtn";c.setAttribute("title",b);b=document.createElement("img");b.style.height="26px";
|
||||
b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);w.appendChild(c)}var h=document.createElement("div");mxUtils.write(h,mxResources.get("editLink")+":");var m=document.createElement("div");m.className="geTitle";m.style.backgroundColor="transparent";m.style.borderColor="transparent";m.style.whiteSpace="nowrap";m.style.textOverflow="clip";m.style.cursor="default";mxClient.IS_VML||(m.style.paddingRight="20px");var l=document.createElement("input");
|
||||
b.style.width="26px";b.setAttribute("src",a);c.style.minWidth="42px";c.style.verticalAlign="middle";c.appendChild(b);x.appendChild(c)}var h=document.createElement("div");mxUtils.write(h,mxResources.get("editLink")+":");var m=document.createElement("div");m.className="geTitle";m.style.backgroundColor="transparent";m.style.borderColor="transparent";m.style.whiteSpace="nowrap";m.style.textOverflow="clip";m.style.cursor="default";mxClient.IS_VML||(m.style.paddingRight="20px");var l=document.createElement("input");
|
||||
l.setAttribute("placeholder",mxResources.get("dragUrlsHere"));l.setAttribute("type","text");l.style.marginTop="6px";l.style.width="440px";l.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";l.style.backgroundRepeat="no-repeat";l.style.backgroundPosition="100% 50%";l.style.paddingRight="14px";var f=document.createElement("div");f.setAttribute("title",mxResources.get("reset"));f.style.position="relative";f.style.left="-16px";f.style.width="12px";f.style.height="14px";f.style.cursor="pointer";
|
||||
f.style.display=mxClient.IS_VML?"inline":"inline-block";f.style.top=(mxClient.IS_VML?0:3)+"px";f.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(f,"click",function(){l.value="";l.focus()});var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","current-linkdialog");var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";
|
||||
n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name","current-linkdialog");var t=document.createElement("select");t.style.width="420px";if(e&&null!=a.pages){null!=b&&"data:page/id,"==b.substring(0,13)?(n.setAttribute("checked","checked"),n.defaultChecked=!0):(l.setAttribute("value",b),k.setAttribute("checked","checked"),k.defaultChecked=!0);l.style.width="420px";m.appendChild(k);m.appendChild(l);m.appendChild(f);mxUtils.br(m);m.appendChild(n);e=!1;for(f=0;f<a.pages.length;f++){var u=
|
||||
document.createElement("option");mxUtils.write(u,a.pages[f].getName()||mxResources.get("pageWithNumber",[f+1]));u.setAttribute("value","data:page/id,"+a.pages[f].getId());b==u.getAttribute("value")&&(u.setAttribute("selected","selected"),e=!0);t.appendChild(u)}if(!e&&n.checked){var q=document.createElement("option");mxUtils.write(q,mxResources.get("pageNotFound"));q.setAttribute("disabled","disabled");q.setAttribute("selected","selected");q.setAttribute("value","pageNotFound");t.appendChild(q);mxEvent.addListener(t,
|
||||
"change",function(){null==q.parentNode||q.selected||q.parentNode.removeChild(q)})}m.appendChild(t)}else l.setAttribute("value",b),m.appendChild(l),m.appendChild(f);h.appendChild(m);var v=mxUtils.button(c,function(){a.hideDialog();d(n.checked?"pageNotFound"!==t.value?t.value:b:l.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){n.checked?t.focus():(l.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
||||
l.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(t,"focus",function(){k.removeAttribute("checked");n.setAttribute("checked","checked");n.checked=!0});mxEvent.addListener(l,"focus",function(){n.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});if(Graph.fileSupport){var b=h.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",
|
||||
mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(l.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),k.setAttribute("checked","checked"),k.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var w=document.createElement("div");
|
||||
w.style.marginTop="20px";w.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.style.verticalAlign="middle";c.className="geBtn";a.editor.cancelFirst&&w.appendChild(c);m=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});m.style.verticalAlign="middle";m.className="geBtn";w.appendChild(m);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(m.style.display="none");LinkDialog.selectedDocs=null;LinkDialog.filePicked=
|
||||
mxUtils.bind(this,function(d){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));d.stopPropagation();d.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(l.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),k.setAttribute("checked","checked"),k.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var x=document.createElement("div");
|
||||
x.style.marginTop="20px";x.style.textAlign="right";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.style.verticalAlign="middle";c.className="geBtn";a.editor.cancelFirst&&x.appendChild(c);m=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});m.style.verticalAlign="middle";m.className="geBtn";x.appendChild(m);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(m.style.display="none");LinkDialog.selectedDocs=null;LinkDialog.filePicked=
|
||||
function(a){if(a.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=a.docs;var b=a.docs[0].url;"application/mxe"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile"==a.docs[0].mimeType?(b=DriveClient.prototype.oldAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/mxr"==a.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==a.docs[0].mimeType?(b=DriveClient.prototype.newAppHostname,b="https://"+b+"/#G"+a.docs[0].id):"application/vnd.google-apps.folder"==a.docs[0].mimeType&&
|
||||
(b="https://drive.google.com/#folders/"+a.docs[0].id);l.value=b;l.focus()}else LinkDialog.selectedDocs=null;l.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&g(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.linkPicker){var b=gapi.auth.getToken().access_token,c=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),
|
||||
d=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),f=(new google.picker.DocsView).setIncludeFolders(!0).setEnableTeamDrives(!0).setSelectFolderEnabled(!0),b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES).addView(c).addView(d).addView(f).addView(google.picker.ViewId.RECENTLY_PICKED).addView(google.picker.ViewId.IMAGE_SEARCH).addView(google.picker.ViewId.VIDEO_SEARCH).addView(google.picker.ViewId.MAPS);
|
||||
"1"==urlParams.photos&&b.addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);a.linkPicker=b.setCallback(function(a){LinkDialog.filePicked(a)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&g(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(a){l.value=a[0].link;l.focus()}})});null!=
|
||||
a.oneDrive&&g(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(a,b){l.value=b.value[0].webUrl;l.focus()})});null!=a.gitHub&&g(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(a){if(null!=a){a=a.split("/");var b=a[0],c=a[1],d=a[2];a=a.slice(3,a.length).join("/");l.value="https://github.com/"+b+"/"+c+"/blob/"+d+"/"+a;l.focus()}})});mxEvent.addListener(l,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),
|
||||
d(n.checked?t.value:l.value,LinkDialog.selectedDocs))});w.appendChild(v);a.editor.cancelFirst||w.appendChild(c);h.appendChild(w);this.container=h},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var c=document.createElement("img");c.style.border="0px";mxClient.IS_SVG?(c.setAttribute("width","164"),c.setAttribute("height","221"),c.style.width="164px",c.style.height="221px",c.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):
|
||||
d(n.checked?t.value:l.value,LinkDialog.selectedDocs))});x.appendChild(v);a.editor.cancelFirst||x.appendChild(c);h.appendChild(x);this.container=h},AboutDialog=function(a){var b=document.createElement("div");b.style.marginTop="6px";b.setAttribute("align","center");var c=document.createElement("img");c.style.border="0px";mxClient.IS_SVG?(c.setAttribute("width","164"),c.setAttribute("height","221"),c.style.width="164px",c.style.height="221px",c.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):
|
||||
(c.setAttribute("width","176"),c.setAttribute("height","219"),c.style.width="170px",c.style.height="219px",c.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));b.appendChild(c);mxUtils.br(b);c=document.createElement("small");c.innerHTML="v "+EditorUi.VERSION;c.style.color="#505050";b.appendChild(c);mxUtils.br(b);mxUtils.br(b);c=document.createElement("small");c.style.color="#505050";c.innerHTML='© 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
|
||||
b.appendChild(c);mxEvent.addListener(b,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=b},FeedbackDialog=function(a){var b=document.createElement("div"),c=document.createElement("div");mxUtils.write(c,mxResources.get("sendYourFeedbackToDrawIo"));c.style.fontSize="18px";c.style.marginBottom="18px";b.appendChild(c);c=document.createElement("div");mxUtils.write(c,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");b.appendChild(c);var d=document.createElement("input");
|
||||
d.setAttribute("type","text");d.style.marginTop="6px";d.style.width="600px";var e=mxUtils.button(mxResources.get("sendMessage"),function(){var b=(h.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(d.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+
|
||||
|
@ -7048,36 +7048,36 @@ mxEvent.addListener(d,"change",function(){0<d.value.length&&0<g.test(d.value)?e.
|
|||
b.appendChild(l);c=document.createElement("div");c.style.marginTop="26px";c.style.textAlign="right";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst?(c.appendChild(m),c.appendChild(e)):(c.appendChild(e),c.appendChild(m));b.appendChild(c);this.container=b};FeedbackDialog.maxAttachmentSize=1E6;
|
||||
var RevisionDialog=function(a,b,c){var d=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));d.appendChild(e);var g=document.createElement("div");g.style.position="absolute";g.style.overflow="auto";g.style.width="170px";g.style.height="378px";d.appendChild(g);var h=document.createElement("div");h.style.position="absolute";h.style.border="1px solid lightGray";h.style.left="199px";h.style.width="470px";h.style.height=
|
||||
"376px";h.style.overflow="hidden";mxEvent.disableContextMenu(h);d.appendChild(h);var m=new Graph(h);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;var l=0,f=null,k=0,n=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=f&&null!=f[k]?f[k].getAttribute("name"):"pagenumber"==a?k+1:n.apply(this,arguments)};m.getLinkForCell=function(){return null};Editor.MathJaxRender&&
|
||||
m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.container)}));var t=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),q=null,v=null,w=null,C=null,p=mxUtils.button("",function(){null!=w&&m.zoomIn()});p.className="geSprite geSprite-zoomin";p.setAttribute("title",mxResources.get("zoomIn"));
|
||||
p.style.outline="none";p.style.border="none";p.style.margin="2px";p.setAttribute("disabled","disabled");mxUtils.setOpacity(p,20);var A=mxUtils.button("",function(){null!=w&&m.zoomOut()});A.className="geSprite geSprite-zoomout";A.setAttribute("title",mxResources.get("zoomOut"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var F=mxUtils.button("",function(){null!=w&&(m.maxFitScale=8,m.fit(8),m.center())});F.className=
|
||||
"geSprite geSprite-fit";F.setAttribute("title",mxResources.get("fit"));F.style.outline="none";F.style.border="none";F.style.margin="2px";F.setAttribute("disabled","disabled");mxUtils.setOpacity(F,20);var B=mxUtils.button("",function(){null!=w&&(m.zoomActual(),m.center())});B.className="geSprite geSprite-actualsize";B.setAttribute("title",mxResources.get("actualSize"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var x=
|
||||
document.createElement("div");x.style.position="absolute";x.style.textAlign="right";x.style.color="gray";x.style.marginTop="10px";x.style.backgroundColor="transparent";x.style.top="440px";x.style.right="32px";x.style.maxWidth="380px";x.style.cursor="default";var E=mxUtils.button(mxResources.get("download"),function(){if(null!=w){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(w.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
|
||||
(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});E.className="geBtn";E.setAttribute("disabled","disabled");var y=mxUtils.button(mxResources.get("restore"),function(){null!=w&&null!=C&&a.confirm(mxResources.get("areYouSure"),function(){null!=c?c(C):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
|
||||
a.replaceFileData(C);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});y.className="geBtn";y.setAttribute("disabled","disabled");var D=document.createElement("select");D.setAttribute("disabled","disabled");D.style.maxWidth="80px";D.style.position="relative";D.style.top="-2px";D.style.verticalAlign="bottom";D.style.marginRight="6px";D.style.display="none";var I=null;mxEvent.addListener(D,"change",function(a){null!=
|
||||
I&&(I(a),mxEvent.consume(a))});var z=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=w&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(w.documentElement)),window.openWindow(a.getUrl()))});z.className="geBtn";z.setAttribute("disabled","disabled");null!=c&&(z.style.display="none");var J=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl())});J.className="geBtn gePrimaryBtn";J.setAttribute("disabled",
|
||||
"disabled");null!=c&&(J.style.display="none",y.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var G=document.createElement("div");G.className="geToolbarContainer";G.style.backgroundColor="transparent";G.style.padding="2px";G.style.border="none";G.style.left="199px";G.style.top="442px";var L=null;if(null!=b&&0<b.length){h.style.cursor="move";var M=document.createElement("table");M.style.border=
|
||||
m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.container)}));var t=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),q=null,v=null,x=null,C=null,p=mxUtils.button("",function(){null!=x&&m.zoomIn()});p.className="geSprite geSprite-zoomin";p.setAttribute("title",mxResources.get("zoomIn"));
|
||||
p.style.outline="none";p.style.border="none";p.style.margin="2px";p.setAttribute("disabled","disabled");mxUtils.setOpacity(p,20);var A=mxUtils.button("",function(){null!=x&&m.zoomOut()});A.className="geSprite geSprite-zoomout";A.setAttribute("title",mxResources.get("zoomOut"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var E=mxUtils.button("",function(){null!=x&&(m.maxFitScale=8,m.fit(8),m.center())});E.className=
|
||||
"geSprite geSprite-fit";E.setAttribute("title",mxResources.get("fit"));E.style.outline="none";E.style.border="none";E.style.margin="2px";E.setAttribute("disabled","disabled");mxUtils.setOpacity(E,20);var B=mxUtils.button("",function(){null!=x&&(m.zoomActual(),m.center())});B.className="geSprite geSprite-actualsize";B.setAttribute("title",mxResources.get("actualSize"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var w=
|
||||
document.createElement("div");w.style.position="absolute";w.style.textAlign="right";w.style.color="gray";w.style.marginTop="10px";w.style.backgroundColor="transparent";w.style.top="440px";w.style.right="32px";w.style.maxWidth="380px";w.style.cursor="default";var J=mxUtils.button(mxResources.get("download"),function(){if(null!=x){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(x.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"):
|
||||
(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});J.className="geBtn";J.setAttribute("disabled","disabled");var y=mxUtils.button(mxResources.get("restore"),function(){null!=x&&null!=C&&a.confirm(mxResources.get("areYouSure"),function(){null!=c?c(C):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
|
||||
a.replaceFileData(C);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});y.className="geBtn";y.setAttribute("disabled","disabled");var D=document.createElement("select");D.setAttribute("disabled","disabled");D.style.maxWidth="80px";D.style.position="relative";D.style.top="-2px";D.style.verticalAlign="bottom";D.style.marginRight="6px";D.style.display="none";var H=null;mxEvent.addListener(D,"change",function(a){null!=
|
||||
H&&(H(a),mxEvent.consume(a))});var z=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=x&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(x.documentElement)),window.openWindow(a.getUrl()))});z.className="geBtn";z.setAttribute("disabled","disabled");null!=c&&(z.style.display="none");var I=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl())});I.className="geBtn gePrimaryBtn";I.setAttribute("disabled",
|
||||
"disabled");null!=c&&(I.style.display="none",y.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var F=document.createElement("div");F.className="geToolbarContainer";F.style.backgroundColor="transparent";F.style.padding="2px";F.style.border="none";F.style.left="199px";F.style.top="442px";var L=null;if(null!=b&&0<b.length){h.style.cursor="move";var M=document.createElement("table");M.style.border=
|
||||
"1px solid lightGray";M.style.borderCollapse="collapse";M.style.borderSpacing="0px";M.style.width="100%";var X=document.createElement("tbody"),Z=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(l=mxUtils.indexOf(a.pages,a.currentPage));for(var N=b.length-1;0<=N;N--){var S=function(c){var d=new Date(c.modifiedDate),e=null;if(0<=d.getTime()){var n=function(b){t.stop();var c=mxUtils.parseXml(b),n=a.editor.extractGraphModel(c.documentElement,!0);if(null!=n){var g=function(b){null!=b&&(b=
|
||||
v(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};D.style.display="none";D.innerHTML="";w=c;C=b;f=parseSelectFunction=null;k=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");f=[];for(b=0;b<c.length;b++)f.push(c[b]);
|
||||
k=Math.min(l,f.length-1);0<f.length&&g(f[k]);if(1<f.length)for(D.removeAttribute("disabled"),D.style.display="",b=0;b<f.length;b++)c=document.createElement("option"),mxUtils.write(c,f[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==k&&c.setAttribute("selected","selected"),D.appendChild(c);I=function(){k=l=parseInt(D.value);g(f[l])}}else v(n);x.innerHTML="";mxUtils.write(x,d.toLocaleDateString()+" "+d.toLocaleTimeString());x.setAttribute("title",e.getAttribute("title"));
|
||||
p.removeAttribute("disabled");A.removeAttribute("disabled");F.removeAttribute("disabled");B.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&y.removeAttribute("disabled"),E.removeAttribute("disabled"),J.removeAttribute("disabled"),z.removeAttribute("disabled"));mxUtils.setOpacity(p,60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(F,60);mxUtils.setOpacity(B,60)}else D.style.display="none",D.innerHTML="",x.innerHTML="",mxUtils.write(x,mxResources.get("errorLoadingFile"))},
|
||||
v(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";h.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};D.style.display="none";D.innerHTML="";x=c;C=b;f=parseSelectFunction=null;k=0;if("mxfile"==n.nodeName){c=n.getElementsByTagName("diagram");f=[];for(b=0;b<c.length;b++)f.push(c[b]);
|
||||
k=Math.min(l,f.length-1);0<f.length&&g(f[k]);if(1<f.length)for(D.removeAttribute("disabled"),D.style.display="",b=0;b<f.length;b++)c=document.createElement("option"),mxUtils.write(c,f[b].getAttribute("name")||mxResources.get("pageWithNumber",[b+1])),c.setAttribute("value",b),b==k&&c.setAttribute("selected","selected"),D.appendChild(c);H=function(){k=l=parseInt(D.value);g(f[l])}}else v(n);w.innerHTML="";mxUtils.write(w,d.toLocaleDateString()+" "+d.toLocaleTimeString());w.setAttribute("title",e.getAttribute("title"));
|
||||
p.removeAttribute("disabled");A.removeAttribute("disabled");E.removeAttribute("disabled");B.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&y.removeAttribute("disabled"),J.removeAttribute("disabled"),I.removeAttribute("disabled"),z.removeAttribute("disabled"));mxUtils.setOpacity(p,60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(B,60)}else D.style.display="none",D.innerHTML="",w.innerHTML="",mxUtils.write(w,mxResources.get("errorLoadingFile"))},
|
||||
e=document.createElement("tr");e.style.borderBottom="1px solid lightGray";e.style.fontSize="12px";e.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";c==b[b.length-1]?mxUtils.write(g,mxResources.get("current")):d.toDateString()===Z?mxUtils.write(g,d.toLocaleTimeString()):mxUtils.write(g,d.toLocaleDateString()+" "+d.toLocaleTimeString());e.appendChild(g);e.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+
|
||||
(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){v!=c&&(t.stop(),null!=q&&(q.style.backgroundColor=""),v=c,q=e,q.style.backgroundColor="#ebf2f9",C=w=null,x.removeAttribute("title"),x.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",m.getModel().clear(),y.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),B.setAttribute("disabled",
|
||||
"disabled"),F.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),mxUtils.setOpacity(p,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(F,20),mxUtils.setOpacity(B,20),t.spin(h),c.getXml(function(a){v==c&&n(a)},function(a){t.stop();D.style.display="none";D.innerHTML="";x.innerHTML="";mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){J.click();
|
||||
window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);X.appendChild(e)}return e}(b[N]);null!=S&&N==b.length-1&&(L=S)}M.appendChild(X);g.appendChild(M)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(h.style.display="none",G.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(h.style.display="none",G.style.display="none",mxUtils.write(g,
|
||||
mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";G.appendChild(D);G.appendChild(p);G.appendChild(A);G.appendChild(B);G.appendChild(F);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(E),e.appendChild(z),e.appendChild(y),e.appendChild(J)):(e.appendChild(E),e.appendChild(z),e.appendChild(y),e.appendChild(J),e.appendChild(g));d.appendChild(e);d.appendChild(G);d.appendChild(x);this.container=
|
||||
(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(e,"click",function(a){v!=c&&(t.stop(),null!=q&&(q.style.backgroundColor=""),v=c,q=e,q.style.backgroundColor="#ebf2f9",C=x=null,w.removeAttribute("title"),w.innerHTML=mxResources.get("loading")+"...",h.style.backgroundColor="#ffffff",m.getModel().clear(),y.setAttribute("disabled","disabled"),J.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),B.setAttribute("disabled",
|
||||
"disabled"),E.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),mxUtils.setOpacity(p,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(B,20),t.spin(h),c.getXml(function(a){v==c&&n(a)},function(a){t.stop();D.style.display="none";D.innerHTML="";w.innerHTML="";mxUtils.write(w,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(e,"dblclick",function(a){I.click();
|
||||
window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);X.appendChild(e)}return e}(b[N]);null!=S&&N==b.length-1&&(L=S)}M.appendChild(X);g.appendChild(M)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(h.style.display="none",F.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(h.style.display="none",F.style.display="none",mxUtils.write(g,
|
||||
mxResources.get("noRevisions")));this.init=function(){null!=L&&L.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";F.appendChild(D);F.appendChild(p);F.appendChild(A);F.appendChild(B);F.appendChild(E);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(J),e.appendChild(z),e.appendChild(y),e.appendChild(I)):(e.appendChild(J),e.appendChild(z),e.appendChild(y),e.appendChild(I),e.appendChild(g));d.appendChild(e);d.appendChild(F);d.appendChild(w);this.container=
|
||||
d},DraftDialog=function(a,b,c,d,e,g,h,m){var l=document.createElement("div"),f=document.createElement("div");f.style.marginTop="0px";f.style.whiteSpace="nowrap";f.style.overflow="auto";mxUtils.write(f,b);l.appendChild(f);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.marginTop="10px";k.style.width="640px";k.style.top="46px";k.style.bottom="74px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);l.appendChild(k);var n=new Graph(k);
|
||||
n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;b=mxUtils.parseXml(c);var t=a.editor.extractGraphModel(b.documentElement,!0),u=0,q=null,v=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[u]?q[u].getAttribute("name"):"pagenumber"==a?u+1:v.apply(this,arguments)};n.getLinkForCell=function(){return null};b=mxUtils.button("",function(){n.zoomIn()});b.className=
|
||||
"geSprite geSprite-zoomin";b.setAttribute("title",mxResources.get("zoomIn"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);c=mxUtils.button("",function(){n.zoomOut()});c.className="geSprite geSprite-zoomout";c.setAttribute("title",mxResources.get("zoomOut"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);f=mxUtils.button("",function(){n.maxFitScale=8;n.fit(8);n.center()});f.className="geSprite geSprite-fit";f.setAttribute("title",
|
||||
mxResources.get("fit"));f.style.outline="none";f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);var w=mxUtils.button("",function(){n.zoomActual();n.center()});w.className="geSprite geSprite-actualsize";w.setAttribute("title",mxResources.get("actualSize"));w.style.outline="none";w.style.border="none";w.style.margin="2px";mxUtils.setOpacity(w,60);e=mxUtils.button(h||mxResources.get("discard"),e);e.className="geBtn";var C=document.createElement("select");C.style.maxWidth="80px";C.style.position=
|
||||
mxResources.get("fit"));f.style.outline="none";f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);var x=mxUtils.button("",function(){n.zoomActual();n.center()});x.className="geSprite geSprite-actualsize";x.setAttribute("title",mxResources.get("actualSize"));x.style.outline="none";x.style.border="none";x.style.margin="2px";mxUtils.setOpacity(x,60);e=mxUtils.button(h||mxResources.get("discard"),e);e.className="geBtn";var C=document.createElement("select");C.style.maxWidth="80px";C.style.position=
|
||||
"relative";C.style.top="-2px";C.style.verticalAlign="bottom";C.style.marginRight="6px";C.style.display="none";d=mxUtils.button(g||mxResources.get("edit"),d);d.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.width="640px";g.style.textAlign="right";h=document.createElement("div");h.className="geToolbarContainer";h.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
|
||||
this.init=function(){function b(a){if(null!=a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,n.getModel());n.maxFitScale=1;n.fit(8);n.center()}}function c(c){null!=c&&(c=b(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(c))).documentElement));return c}mxEvent.addListener(C,"change",function(a){u=parseInt(C.value);c(q[u]);mxEvent.consume(a)});if("mxfile"==t.nodeName){var d=t.getElementsByTagName("diagram");
|
||||
q=[];for(var f=0;f<d.length;f++)q.push(d[f]);0<q.length&&c(q[u]);if(1<q.length)for(C.style.display="",f=0;f<q.length;f++)d=document.createElement("option"),mxUtils.write(d,q[f].getAttribute("name")||mxResources.get("pageWithNumber",[f+1])),d.setAttribute("value",f),f==u&&d.setAttribute("selected","selected"),C.appendChild(d)}else b(t)};h.appendChild(C);h.appendChild(b);h.appendChild(c);h.appendChild(w);h.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className=
|
||||
q=[];for(var f=0;f<d.length;f++)q.push(d[f]);0<q.length&&c(q[u]);if(1<q.length)for(C.style.display="",f=0;f<q.length;f++)d=document.createElement("option"),mxUtils.write(d,q[f].getAttribute("name")||mxResources.get("pageWithNumber",[f+1])),d.setAttribute("value",f),f==u&&d.setAttribute("selected","selected"),C.appendChild(d)}else b(t)};h.appendChild(C);h.appendChild(b);h.appendChild(c);h.appendChild(x);h.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.className=
|
||||
"geBtn";m=null!=m?mxUtils.button(mxResources.get("ignore"),m):null;null!=m&&(m.className="geBtn");a.editor.cancelFirst?(g.appendChild(b),null!=m&&g.appendChild(m),g.appendChild(e),g.appendChild(d)):(g.appendChild(d),g.appendChild(e),null!=m&&g.appendChild(m),g.appendChild(b));l.appendChild(g);l.appendChild(h);this.container=l},FindWindow=function(a,b,c,d,e){function g(a,b,c){if("object"===typeof b.value&&null!=b.value.attributes){b=b.value.attributes;for(var d=0;d<b.length;d++)if("label"!=b[d].nodeName){var f=
|
||||
mxUtils.trim(b[d].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&f.substring(0,c.length)===c||null!=a&&a.test(f))return!0}}return!1}function h(){var a=l.model.getDescendants(l.model.getRoot()),b=t.value.toLowerCase(),c=u.checked?new RegExp(b):null,d=null;f!=b&&(f=b,k=null);var e=null==k;if(0<b.length)for(var n=0;n<a.length;n++){var h=l.view.getState(a[n]);if(null!=h&&null!=h.cell.value&&(e||null==d)&&(l.model.isVertex(h.cell)||l.model.isEdge(h.cell))&&(l.isHtmlLabel(h.cell)?
|
||||
(q.innerHTML=l.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([q])):label=l.getLabel(h.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==c&&(label.substring(0,b.length)===b||g(c,h.cell,b))||null!=c&&(c.test(label)||g(c,h.cell,b))))if(e){d=h;break}else null==d&&(d=h);e=e||h==k}null!=d?(k=d,l.scrollCellToVisible(k.cell),l.isEnabled()?l.setSelectionCell(k.cell):l.highlightCell(k.cell)):l.isEnabled()&&l.clearSelection();return 0==b.length||null!=d}
|
||||
var m=a.actions.get("find"),l=a.editor.graph,f=null,k=null,n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var t=document.createElement("input");t.setAttribute("placeholder",mxResources.get("find"));t.setAttribute("type","text");t.style.marginTop="4px";t.style.marginBottom="6px";t.style.width="200px";t.style.fontSize="12px";t.style.borderRadius="4px";t.style.padding="6px";n.appendChild(t);mxUtils.br(n);var u=document.createElement("input");
|
||||
u.setAttribute("type","checkbox");u.style.marginRight="4px";n.appendChild(u);mxUtils.write(n,mxResources.get("regularExpression"));var q=document.createElement("div");mxUtils.br(n);var v=mxUtils.button(mxResources.get("reset"),function(){t.value="";t.style.backgroundColor="";f=k=null;t.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.className="geBtn";n.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{t.style.backgroundColor=
|
||||
h()?"":"#ffcfcf"}catch(w){a.handleError(w)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";n.appendChild(v);mxEvent.addListener(t,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)m.funct();else if(f!=t.value.toLowerCase()||13==a.keyCode)try{t.style.backgroundColor=h()?"":"#ffcfcf"}catch(C){t.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(n,"keydown",function(b){70==b.keyCode&&
|
||||
h()?"":"#ffcfcf"}catch(x){a.handleError(x)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";n.appendChild(v);mxEvent.addListener(t,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)m.funct();else if(f!=t.value.toLowerCase()||13==a.keyCode)try{t.style.backgroundColor=h()?"":"#ffcfcf"}catch(C){t.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(n,"keydown",function(b){70==b.keyCode&&
|
||||
a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(m.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),n,b,c,d,e,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.isVisible()?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)):l.container.focus()}))},
|
||||
TagsWindow=function(a,b,c,d,e){var g=a.editor.graph,h="tags",m=document.createElement("div");m.style.userSelect="none";m.style.overflow="hidden";m.style.padding="10px";m.style.height="100%";var l=document.createElement("input");l.setAttribute("placeholder",mxResources.get("allTags"));l.setAttribute("type","text");l.style.marginTop="4px";l.style.width="260px";l.style.fontSize="12px";l.style.borderRadius="4px";l.style.padding="6px";m.appendChild(l);if(!a.isOffline()||mxClient.IS_CHROMEAPP){l.style.width=
|
||||
"240px";var f=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");f.firstChild.style.marginBottom="6px";f.style.marginLeft="6px";m.appendChild(f)}mxEvent.addListener(l,"dblclick",function(){var b=new FilenameDialog(a,h,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&(h=a)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});l.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(m);
|
||||
|
@ -7093,9 +7093,9 @@ b.style.position="absolute";b.style.top="0px";b.style.left="0px";b.style.lineHei
|
|||
b.imageCallback?b.imageCallback(g):null!=b.image?g.innerHTML='<img border="0" src="'+b.image+'"/>':(g.innerHTML="<br>",mxUtils.write(g,mxResources.get("noPreview"))),null!=h&&(h.style.backgroundColor=""),h=c,h.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=a&&mxEvent.consume(a)};mxEvent.addListener(c,"click",p);mxEvent.addListener(c,"dblclick",function(a){k.checked=!k.checked;mxEvent.consume(a)});m.push(function(){return k.checked?b.id:null});0==f&&0==d&&p()})(b.entries[d])})(c[f]);
|
||||
d.style.padding="30px";d.appendChild(b);d.appendChild(e);d.appendChild(g);c=document.createElement("div");c.className="geDialogFooter";c.style.position="absolute";c.style.paddingRight="16px";c.style.color="gray";c.style.left="0px";c.style.right="0px";c.style.bottom="0px";c.style.height="60px";c.style.lineHeight="52px";mxClient.IS_QUIRKS&&(c.style.width=b.style.width,c.style.paddingTop="12px");var k=document.createElement("input");k.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)b=
|
||||
document.createElement("span"),b.style.paddingRight="20px",b.appendChild(k),mxUtils.write(b," "+mxResources.get("rememberThisSetting")),k.checked=!0,k.defaultChecked=!0,mxEvent.addListener(b,"click",function(a){mxEvent.getSource(a)!=k&&(k.checked=!k.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.top="-6px"),c.appendChild(b);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var n=mxUtils.button(mxResources.get("apply"),
|
||||
function(){a.hideDialog();for(var b=[],c=0;c<m.length;c++){var d=m[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),k.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var t=document.createElement("table"),u=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";var q=document.createElement("tr");t.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),v=document.createElement("td"),w=mxUtils.bind(this,function(b,
|
||||
function(){a.hideDialog();for(var b=[],c=0;c<m.length;c++){var d=m[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(b.join(";"),k.checked,!0)});n.className="geBtn gePrimaryBtn"}else{var t=document.createElement("table"),u=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";var q=document.createElement("tr");t.style.width="100%";b=document.createElement("td");var n=document.createElement("td"),v=document.createElement("td"),x=mxUtils.bind(this,function(b,
|
||||
c,d){var f=document.createElement("input");f.type="checkbox";t.appendChild(f);f.checked=a.sidebar.isEntryVisible(d);var k=document.createElement("span");mxUtils.write(k,c);c=document.createElement("div");c.style.display="block";c.appendChild(f);c.appendChild(k);mxEvent.addListener(k,"click",function(a){f.checked=!f.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return f.checked?d:null}});q.appendChild(b);q.appendChild(n);q.appendChild(v);u.appendChild(q);t.appendChild(u);for(var m=
|
||||
[],C=0,f=0;f<c.length;f++)for(u=0;u<c[f].entries.length;u++)C++;for(var p=[b,n,v],A=0,f=0;f<c.length;f++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];m.push(w(p[Math.floor(A/(C/3))],c.title,c.id));A++}})(c[f]);d.appendChild(t);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,c.appendChild(k),b=document.createElement("span"),
|
||||
[],C=0,f=0;f<c.length;f++)for(u=0;u<c[f].entries.length;u++)C++;for(var p=[b,n,v],A=0,f=0;f<c.length;f++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];m.push(x(p[Math.floor(A/(C/3))],c.title,c.id));A++}})(c[f]);d.appendChild(t);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";k=document.createElement("input");isLocalStorage&&(k.setAttribute("type","checkbox"),k.checked=!0,k.defaultChecked=!0,c.appendChild(k),b=document.createElement("span"),
|
||||
mxUtils.write(b," "+mxResources.get("rememberThisSetting")),c.appendChild(b),mxEvent.addListener(b,"click",function(a){k.checked=!k.checked;mxEvent.consume(a)}));d.appendChild(c);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<m.length;c++){var d=m[c].apply(this,arguments);null!=d&&b.push(d)}a.sidebar.showEntries(0<b.length?b.join(";"):"",k.checked);a.hideDialog()});n.className=
|
||||
"geBtn gePrimaryBtn";c=document.createElement("div");c.style.marginTop="26px";c.style.textAlign="right"}a.editor.cancelFirst?(c.appendChild(b),c.appendChild(n)):(c.appendChild(n),c.appendChild(b));d.appendChild(c);this.container=d},PluginsDialog=function(a){function b(){if(0==e.length)d.innerHTML=mxResources.get("noPlugins");else{d.innerHTML="";for(var c=0;c<e.length;c++){var f=document.createElement("span");f.style.whiteSpace="nowrap";var g=document.createElement("span");g.className="geSprite geSprite-delete";
|
||||
g.style.position="relative";g.style.cursor="pointer";g.style.top="5px";g.style.marginRight="4px";g.style.display="inline-block";f.appendChild(g);mxUtils.write(f,e[c]);d.appendChild(f);mxUtils.br(d);mxEvent.addListener(g,"click",function(c){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[c]+'"?',function(){e.splice(c,1);b()})}}(c))}}}var c=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var e=mxSettings.getPlugins().slice();
|
||||
|
@ -7105,41 +7105,41 @@ l.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(l.style.display="non
|
|||
h=document.createElement("tr"),m=document.createElement("td");m.style.whiteSpace="nowrap";m.setAttribute("colspan","2");mxUtils.write(m,mxResources.get("loading")+"...");h.appendChild(m);g.appendChild(h);var h=document.createElement("tr"),l=document.createElement("td"),f=document.createElement("td");e.style.paddingLeft="6px";mxUtils.write(l,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value="0";this.init=function(){k.focus();
|
||||
k.select()};f.appendChild(k);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value="0";f.appendChild(n);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("right")+
|
||||
":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value="0";f.appendChild(t);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("bottom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value="0";f.appendChild(u);h.appendChild(l);h.appendChild(f);g.appendChild(h);h=document.createElement("tr");
|
||||
l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("circle")+":");h.appendChild(l);var q=document.createElement("input");q.setAttribute("type","checkbox");f.appendChild(q);h.appendChild(f);g.appendChild(h);e.appendChild(g);d.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,w=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),d=b.getContext("2d"),f=v.width,
|
||||
e=v.height,g=parseInt(k.value),h=parseInt(n.value),f=Math.max(1,f-g-parseInt(t.value)),e=Math.max(1,e-h-parseInt(u.value));b.width=f;b.height=e;q.checked&&(d.fillStyle="#000000",d.arc(f/2,e/2,Math.min(f/2,e/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(v,g,h,f,e,0,0,f,e);c(b.toDataURL())});w.setAttribute("disabled","disabled");v.onload=function(){w.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+
|
||||
": "+v.height)};v.src=b;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&w.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(w)):(b.appendChild(w),b.appendChild(e));d.appendChild(b);this.container=d},EditGeometryDialog=function(a,b){var c=a.editor.graph,d=1==b.length?c.getCellGeometry(b[0]):null,e=document.createElement("div"),g=document.createElement("table"),h=document.createElement("tbody"),
|
||||
l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("circle")+":");h.appendChild(l);var q=document.createElement("input");q.setAttribute("type","checkbox");f.appendChild(q);h.appendChild(f);g.appendChild(h);e.appendChild(g);d.appendChild(e);var e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,x=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),d=b.getContext("2d"),f=v.width,
|
||||
e=v.height,g=parseInt(k.value),h=parseInt(n.value),f=Math.max(1,f-g-parseInt(t.value)),e=Math.max(1,e-h-parseInt(u.value));b.width=f;b.height=e;q.checked&&(d.fillStyle="#000000",d.arc(f/2,e/2,Math.min(f/2,e/2),0,2*Math.PI),d.fill(),d.globalCompositeOperation="source-in");d.drawImage(v,g,h,f,e,0,0,f,e);c(b.toDataURL())});x.setAttribute("disabled","disabled");v.onload=function(){x.removeAttribute("disabled");m.innerHTML="";mxUtils.write(m,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+
|
||||
": "+v.height)};v.src=b;mxEvent.addListener(d,"keypress",function(a){13==a.keyCode&&x.click()});b=document.createElement("div");b.style.marginTop="20px";b.style.textAlign="right";a.editor.cancelFirst?(b.appendChild(e),b.appendChild(x)):(b.appendChild(x),b.appendChild(e));d.appendChild(b);this.container=d},EditGeometryDialog=function(a,b){var c=a.editor.graph,d=1==b.length?c.getCellGeometry(b[0]):null,e=document.createElement("div"),g=document.createElement("table"),h=document.createElement("tbody"),
|
||||
m=document.createElement("tr"),l=document.createElement("td"),f=document.createElement("td");g.style.paddingLeft="6px";mxUtils.write(l,mxResources.get("left")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width="100px";k.value=null!=d?d.x:"";this.init=function(){k.focus();k.select()};f.appendChild(k);m.appendChild(l);m.appendChild(f);h.appendChild(m);m=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("top")+
|
||||
":");var n=document.createElement("input");n.setAttribute("type","text");n.style.width="100px";n.value=null!=d?d.y:"";f.appendChild(n);m.appendChild(l);m.appendChild(f);h.appendChild(m);m=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=d?d.width:"";f.appendChild(t);m.appendChild(l);m.appendChild(f);h.appendChild(m);
|
||||
m=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("height")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=d?d.height:"";f.appendChild(u);m.appendChild(l);m.appendChild(f);h.appendChild(m);m=document.createElement("tr");l=document.createElement("td");f=document.createElement("td");mxUtils.write(l,mxResources.get("rotation")+":");var q=document.createElement("input");
|
||||
q.setAttribute("type","text");q.style.width="100px";q.value=1==b.length?mxUtils.getValue(c.getCellStyle(b[0]),mxConstants.STYLE_ROTATION,0):"";f.appendChild(q);m.appendChild(l);m.appendChild(f);h.appendChild(m);g.appendChild(h);e.appendChild(g);var d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c.getModel().beginUpdate();try{for(var d=0;d<b.length;d++){var f=c.getCellGeometry(b[d]);null!=f&&(f=f.clone(),c.isCellMovable(b[d])&&
|
||||
(0<mxUtils.trim(k.value).length&&(f.x=Number(k.value)),0<mxUtils.trim(n.value).length&&(f.y=Number(n.value))),c.isCellResizable(b[d])&&(0<mxUtils.trim(t.value).length&&(f.width=Number(t.value)),0<mxUtils.trim(u.value).length&&(f.height=Number(u.value))),c.getModel().setGeometry(b[d],f));0<mxUtils.trim(q.value).length&&c.setCellStyles(mxConstants.STYLE_ROTATION,Number(q.value),[b[d]])}}finally{c.getModel().endUpdate()}});mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&v.click()});g=document.createElement("div");
|
||||
g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(v)):(g.appendChild(v),g.appendChild(d));e.appendChild(g);this.container=e},LibraryDialog=function(a,b,c,d,e,g){function h(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function m(b,c,d,f,e,n,g,t,C){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&
|
||||
null!=g||null==v[b]){var l=function(){J.innerHTML="";J.style.cursor="pointer";J.style.whiteSpace="nowrap";J.style.textOverflow="ellipsis";mxUtils.write(J,null!=L.title&&0<L.title.length?L.title:mxResources.get("untitled"));J.style.color=null==L.title||0==L.title.length?"#d0d0d0":""};u.style.backgroundImage="";q.style.display="none";var B=e,z=n;if(e>a.maxImageSize||n>a.maxImageSize){var x=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,n));e*=x;n*=x}B>z?(z=Math.round(100*
|
||||
z/B),B=100):(B=Math.round(100*B/z),z=100);var E=document.createElement("div");E.setAttribute("draggable","true");E.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";E.style.position="relative";E.style.cursor="move";mxUtils.setPrefixedStyle(E.style,"transition","transform .1s ease-in-out");if(null!=b){var y=document.createElement("img");y.setAttribute("src",A.convert(b));y.style.width=B+"px";y.style.height=z+"px";y.style.margin="10px";y.style.paddingBottom=Math.floor((100-z)/2)+"px";y.style.paddingLeft=
|
||||
Math.floor((100-B)/2)+"px";E.appendChild(y)}else if(null!=g){var G=a.stringToCells(a.editor.graph.decompress(g.xml));0<G.length&&(a.sidebar.createThumb(G,100,100,E,null,!0,!1),E.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",E.firstChild.style.cursor="")}var D=document.createElement("img");D.setAttribute("src",Editor.closeImage);D.setAttribute("border","0");D.setAttribute("title",mxResources.get("delete"));D.setAttribute("align","top");D.style.paddingTop="4px";D.style.position=
|
||||
"absolute";D.style.marginLeft="-12px";D.style.zIndex="1";D.style.cursor="pointer";mxEvent.addListener(D,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(D,"click",function(d){v[b]=null;for(var f=0;f<k.length;f++)if(null!=k[f].data&&k[f].data==b||null!=k[f].xml&&null!=c&&k[f].xml==c.xml){k.splice(f,1);break}E.parentNode.removeChild(a);0==k.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(d)});mxEvent.addListener(D,
|
||||
"dblclick",function(a){mxEvent.consume(a)})})(E,b,g);E.appendChild(D);E.style.marginBottom="30px";var J=document.createElement("div");J.style.position="absolute";J.style.boxSizing="border-box";J.style.bottom="-18px";J.style.left="10px";J.style.right="10px";J.style.backgroundColor="#ffffff";J.style.overflow="hidden";J.style.textAlign="center";var L=null;null!=b?(L={data:b,w:e,h:n,title:C},null!=t&&(L.aspect=t),v[b]=y,k.push(L)):null!=g&&(g.aspect="fixed",k.push(g),L=g);mxEvent.addListener(J,"keydown",
|
||||
function(a){13==a.keyCode&&null!=p&&(p(),p=null,mxEvent.consume(a))});l();E.appendChild(J);mxEvent.addListener(J,"mousedown",function(a){"true"!=J.getAttribute("contentEditable")&&mxEvent.consume(a)});G=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,L.title||"",mxResources.get("ok"),function(a){null!=a&&(L.title=a,l())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();
|
||||
mxEvent.consume(b)}else if("true"!=J.getAttribute("contentEditable")){null!=p&&(p(),p=null);if(null==L.title||0==L.title.length)J.innerHTML="";J.style.textOverflow="";J.style.whiteSpace="";J.style.cursor="text";J.style.color="";J.setAttribute("contentEditable","true");J.focus();document.execCommand("selectAll",!1,null);p=function(){J.removeAttribute("contentEditable");J.style.cursor="pointer";L.title=J.innerHTML;l()};mxEvent.consume(b)}};mxEvent.addListener(J,"click",G);mxEvent.addListener(E,"dblclick",
|
||||
G);u.appendChild(E);mxEvent.addListener(E,"dragstart",function(a){null==b&&null!=g&&(D.style.visibility="hidden",J.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.xml);w=h(a);mxClient.IS_GC&&(E.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(E.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(E,30);D.style.visibility="";J.style.visibility=""},0)});mxEvent.addListener(E,"dragend",function(a){"hidden"==D.style.visibility&&(D.style.visibility=
|
||||
"",J.style.visibility="");w=null;mxUtils.setOpacity(E,100);mxUtils.setPrefixedStyle(E.style,"transform",null)})}else F||(F=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),B=mxUtils.parseXml(b),"mxlibrary"==B.documentElement.nodeName){z=JSON.parse(mxUtils.getTextContent(B.documentElement));if(null!=z&&0<z.length)for(var M=0;M<z.length;M++)null!=z[M].xml?m(null,null,0,0,0,0,z[M]):m(z[M].data,null,0,0,z[M].w,z[M].h,null,"fixed",z[M].title);e=!0}else if("mxfile"==
|
||||
B.documentElement.nodeName){for(var I=B.documentElement.getElementsByTagName("diagram"),M=0;M<I.length;M++){var z=mxUtils.getTextContent(I[M]),G=a.stringToCells(a.editor.graph.decompress(z)),P=a.editor.graph.getBoundingBoxFromGeometry(G);m(null,null,0,0,0,0,{xml:z,w:P.width,h:P.height})}e=!0}}catch(ba){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}function l(a){a.dataTransfer.dropEffect=null!=w?"move":"copy";a.stopPropagation();a.preventDefault()}
|
||||
function f(b){b.stopPropagation();b.preventDefault();F=!1;C=h(b);if(null!=w)null!=C&&C<u.children.length?(k.splice(C>w?C-1:C,0,k.splice(w,1)[0]),u.insertBefore(u.children[w],u.children[C])):(k.push(k.splice(w,1)[0]),u.appendChild(u.children[w]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,B(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||
|
||||
null!=g||null==v[b]){var l=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow="ellipsis";mxUtils.write(I,null!=L.title&&0<L.title.length?L.title:mxResources.get("untitled"));I.style.color=null==L.title||0==L.title.length?"#d0d0d0":""};u.style.backgroundImage="";q.style.display="none";var B=e,z=n;if(e>a.maxImageSize||n>a.maxImageSize){var J=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,n));e*=J;n*=J}B>z?(z=Math.round(100*
|
||||
z/B),B=100):(B=Math.round(100*B/z),z=100);var w=document.createElement("div");w.setAttribute("draggable","true");w.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";w.style.position="relative";w.style.cursor="move";mxUtils.setPrefixedStyle(w.style,"transition","transform .1s ease-in-out");if(null!=b){var y=document.createElement("img");y.setAttribute("src",A.convert(b));y.style.width=B+"px";y.style.height=z+"px";y.style.margin="10px";y.style.paddingBottom=Math.floor((100-z)/2)+"px";y.style.paddingLeft=
|
||||
Math.floor((100-B)/2)+"px";w.appendChild(y)}else if(null!=g){var F=a.stringToCells(a.editor.graph.decompress(g.xml));0<F.length&&(a.sidebar.createThumb(F,100,100,w,null,!0,!1),w.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",w.firstChild.style.cursor="")}var D=document.createElement("img");D.setAttribute("src",Editor.closeImage);D.setAttribute("border","0");D.setAttribute("title",mxResources.get("delete"));D.setAttribute("align","top");D.style.paddingTop="4px";D.style.position=
|
||||
"absolute";D.style.marginLeft="-12px";D.style.zIndex="1";D.style.cursor="pointer";mxEvent.addListener(D,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(D,"click",function(d){v[b]=null;for(var f=0;f<k.length;f++)if(null!=k[f].data&&k[f].data==b||null!=k[f].xml&&null!=c&&k[f].xml==c.xml){k.splice(f,1);break}w.parentNode.removeChild(a);0==k.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(d)});mxEvent.addListener(D,
|
||||
"dblclick",function(a){mxEvent.consume(a)})})(w,b,g);w.appendChild(D);w.style.marginBottom="30px";var I=document.createElement("div");I.style.position="absolute";I.style.boxSizing="border-box";I.style.bottom="-18px";I.style.left="10px";I.style.right="10px";I.style.backgroundColor="#ffffff";I.style.overflow="hidden";I.style.textAlign="center";var L=null;null!=b?(L={data:b,w:e,h:n,title:C},null!=t&&(L.aspect=t),v[b]=y,k.push(L)):null!=g&&(g.aspect="fixed",k.push(g),L=g);mxEvent.addListener(I,"keydown",
|
||||
function(a){13==a.keyCode&&null!=p&&(p(),p=null,mxEvent.consume(a))});l();w.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&mxEvent.consume(a)});F=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,L.title||"",mxResources.get("ok"),function(a){null!=a&&(L.title=a,l())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();
|
||||
mxEvent.consume(b)}else if("true"!=I.getAttribute("contentEditable")){null!=p&&(p(),p=null);if(null==L.title||0==L.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace="";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable","true");I.focus();document.execCommand("selectAll",!1,null);p=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";L.title=I.innerHTML;l()};mxEvent.consume(b)}};mxEvent.addListener(I,"click",F);mxEvent.addListener(w,"dblclick",
|
||||
F);u.appendChild(w);mxEvent.addListener(w,"dragstart",function(a){null==b&&null!=g&&(D.style.visibility="hidden",I.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.xml);x=h(a);mxClient.IS_GC&&(w.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(w.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(w,30);D.style.visibility="";I.style.visibility=""},0)});mxEvent.addListener(w,"dragend",function(a){"hidden"==D.style.visibility&&(D.style.visibility=
|
||||
"",I.style.visibility="");x=null;mxUtils.setOpacity(w,100);mxUtils.setPrefixedStyle(w.style,"transform",null)})}else E||(E=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),B=mxUtils.parseXml(b),"mxlibrary"==B.documentElement.nodeName){z=JSON.parse(mxUtils.getTextContent(B.documentElement));if(null!=z&&0<z.length)for(var M=0;M<z.length;M++)null!=z[M].xml?m(null,null,0,0,0,0,z[M]):m(z[M].data,null,0,0,z[M].w,z[M].h,null,"fixed",z[M].title);e=!0}else if("mxfile"==
|
||||
B.documentElement.nodeName){for(var H=B.documentElement.getElementsByTagName("diagram"),M=0;M<H.length;M++){var z=mxUtils.getTextContent(H[M]),F=a.stringToCells(a.editor.graph.decompress(z)),P=a.editor.graph.getBoundingBoxFromGeometry(F);m(null,null,0,0,0,0,{xml:z,w:P.width,h:P.height})}e=!0}}catch(ba){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}function l(a){a.dataTransfer.dropEffect=null!=x?"move":"copy";a.stopPropagation();a.preventDefault()}
|
||||
function f(b){b.stopPropagation();b.preventDefault();E=!1;C=h(b);if(null!=x)null!=C&&C<u.children.length?(k.splice(C>x?C-1:C,0,k.splice(x,1)[0]),u.insertBefore(u.children[x],u.children[C])):(k.push(k.splice(x,1)[0]),u.appendChild(u.children[x]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,B(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||
|
||||
/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){m(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var k=[];c=document.createElement("div");c.style.height="100%";var n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="40px";c.appendChild(n);mxUtils.write(n,mxResources.get("filename")+":");null==b&&(b=a.defaultLibraryName+".xml");var t=document.createElement("input");t.setAttribute("value",
|
||||
b);t.style.marginRight="20px";t.style.marginLeft="10px";t.style.width="500px";null==e||e.isRenamable()||t.setAttribute("disabled","true");this.init=function(){if(null==e||e.isRenamable())t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};n.appendChild(t);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop="6px";
|
||||
u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==k.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var q=document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));c.appendChild(q);var v={},w=null,C=null,p=null;
|
||||
b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=p&&(p(),p=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",b);mxEvent.addListener(u,"pointerdown",b);mxEvent.addListener(u,"touchstart",b);var A=new mxUrlConverter,F=!1;if(null!=d)for(b=0;b<d.length;b++)n=d[b],m(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(u,"dragleave",function(a){q.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==q){a.stopPropagation();a.preventDefault();
|
||||
u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";0==k.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var q=document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));c.appendChild(q);var v={},x=null,C=null,p=null;
|
||||
b=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=p&&(p(),p=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",b);mxEvent.addListener(u,"pointerdown",b);mxEvent.addListener(u,"touchstart",b);var A=new mxUrlConverter,E=!1;if(null!=d)for(b=0;b<d.length;b++)n=d[b],m(n.data,null,0,0,n.w,n.h,n,n.aspect,n.title);mxEvent.addListener(u,"dragleave",function(a){q.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==q){a.stopPropagation();a.preventDefault();
|
||||
break}b=b.parentNode}});var B=function(b){return function(c,d,f,k,e,p,n,g,h){null!=h&&(/(\.vsdx)($|\?)/i.test(h.name)||/(\.vssx)($|\?)/i.test(h.name))?a.importVisio(h,mxUtils.bind(this,function(c){a.spinner.stop();m(c,d,f,k,e,p,n,"fixed",mxEvent.isAltDown(b)?null:n.substring(0,n.lastIndexOf(".")).replace(/_/g," "))})):null!=h&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,h.name)?a.parseFile(h,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=
|
||||
c.status&&(m(c.responseText,d,f,k,e,p,n,"fixed",mxEvent.isAltDown(b)?null:n.substring(0,n.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(m(c,d,f,k,e,p,n,"fixed",mxEvent.isAltDown(b)?null:n.substring(0,n.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",l);mxEvent.addListener(u,"drop",f);mxEvent.addListener(q,"dragover",l);mxEvent.addListener(q,"drop",f);c.appendChild(u);d=document.createElement("div");d.style.textAlign="right";
|
||||
d.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&d.appendChild(b);n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(k),c=t.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,
|
||||
"_blank")});n.setAttribute("id","btnDownload");n.className="geBtn";d.appendChild(n);var x=document.createElement("input");x.setAttribute("multiple","multiple");x.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(x,"change",function(b){F=!1;a.importFiles(x.files,0,0,a.maxImageSize,function(a,c,d,f,k,e,p,n,g){B(b)(a,c,d,f,k,e,p,n,g);x.value=""});u.scrollTop=u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=p&&(p(),p=null);x.click()}),n.setAttribute("id",
|
||||
"btnAddImage"),n.className="geBtn",d.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=p&&(p(),p=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){F=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}m(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})});n.setAttribute("id","btnAddImageUrl");n.className="geBtn";d.appendChild(n);this.saveBtnClickHandler=function(b,c,d,f){a.saveLibrary(b,
|
||||
"_blank")});n.setAttribute("id","btnDownload");n.className="geBtn";d.appendChild(n);var w=document.createElement("input");w.setAttribute("multiple","multiple");w.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(w,"change",function(b){E=!1;a.importFiles(w.files,0,0,a.maxImageSize,function(a,c,d,f,k,e,p,n,g){B(b)(a,c,d,f,k,e,p,n,g);w.value=""});u.scrollTop=u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=p&&(p(),p=null);w.click()}),n.setAttribute("id",
|
||||
"btnAddImage"),n.className="geBtn",d.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=p&&(p(),p=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){E=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0<d&&(a=a.substring(0,d)+";base64,"+a.substring(d+1))}m(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})});n.setAttribute("id","btnAddImageUrl");n.className="geBtn";d.appendChild(n);this.saveBtnClickHandler=function(b,c,d,f){a.saveLibrary(b,
|
||||
c,d,f)};n=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=p&&(p(),p=null);this.saveBtnClickHandler(t.value,k,e,g)}));n.setAttribute("id","btnSave");n.className="geBtn gePrimaryBtn";d.appendChild(n);a.editor.cancelFirst||d.appendChild(b);c.appendChild(d);this.container=c},EditShapeDialog=function(a,b,c,d,e){d=null!=d?d:300;e=null!=e?e:120;var g,h,m=document.createElement("table"),l=document.createElement("tbody");m.style.cellPadding="4px";g=document.createElement("tr");h=
|
||||
document.createElement("td");h.setAttribute("colspan","2");h.style.fontSize="10pt";mxUtils.write(h,c);g.appendChild(h);l.appendChild(g);g=document.createElement("tr");h=document.createElement("td");var f=document.createElement("textarea");f.style.outline="none";f.style.resize="none";f.style.width=d-200+"px";f.style.height=e+"px";this.textarea=f;this.init=function(){f.focus();f.scrollTop=0};h.appendChild(f);g.appendChild(h);h=document.createElement("td");c=document.createElement("div");c.style.position=
|
||||
"relative";c.style.border="1px solid gray";c.style.top="6px";c.style.width="200px";c.style.height=e+4+"px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);h.appendChild(c);var k=new Graph(c);k.setEnabled(!1);var n=a.editor.graph.cloneCells([b])[0];k.addCells([n]);c=k.view.getState(n);var t="";null!=c.shape&&null!=c.shape.stencil&&(t=mxUtils.getPrettyXml(c.shape.stencil.desc));mxUtils.write(f,t||"");c=k.getGraphBounds();e=Math.min(160/c.width,(e-40)/c.height);k.view.scaleAndTranslate(e,
|
||||
20/e-c.x,20/e-c.y);g.appendChild(h);l.appendChild(g);g=document.createElement("tr");h=document.createElement("td");h.setAttribute("colspan","2");h.style.paddingTop="2px";h.style.whiteSpace="nowrap";h.setAttribute("align","right");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&h.appendChild(e);a.isOffline()||(c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
|
||||
c.className="geBtn",h.appendChild(c));var u=function(b,c,d){var k=f.value,e=mxUtils.parseXml(k),k=mxUtils.getPrettyXml(e.documentElement),e=e.documentElement.getElementsByTagName("parsererror");if(null!=e&&0<e.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),e=!b.model.contains(c),!d||e||k!=t){k=a.editor.graph.compress(k);b.getModel().beginUpdate();try{if(e){var n=a.editor.graph.getInsertPoint();c.geometry.x=n.x;
|
||||
c.geometry.y=n.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+k+")",[c])}catch(F){throw F;}finally{b.getModel().endUpdate()}e&&b.setSelectionCell(c)}};c=mxUtils.button(mxResources.get("preview"),function(){u(k,n,!1)});c.className="geBtn";h.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,b,!0)});c.className="geBtn gePrimaryBtn";h.appendChild(c);a.editor.cancelFirst||h.appendChild(e);g.appendChild(h);l.appendChild(g);m.appendChild(l);this.container=
|
||||
c.geometry.y=n.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+k+")",[c])}catch(E){throw E;}finally{b.getModel().endUpdate()}e&&b.setSelectionCell(c)}};c=mxUtils.button(mxResources.get("preview"),function(){u(k,n,!1)});c.className="geBtn";h.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,b,!0)});c.className="geBtn gePrimaryBtn";h.appendChild(c);a.editor.cancelFirst||h.appendChild(e);g.appendChild(h);l.appendChild(g);m.appendChild(l);this.container=
|
||||
m},CustomDialog=function(a,b,c,d,e,g,h,m){var l=document.createElement("div");l.appendChild(b);b=document.createElement("div");b.style.marginTop="16px";b.style.textAlign="center";null!=h&&b.appendChild(h);h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d()});h.className="geBtn";m&&(h.style.display="none");a.editor.cancelFirst&&b.appendChild(h);a.isOffline()||null==g||(m=mxUtils.button(mxResources.get("help"),function(){a.openLink(g)}),m.className="geBtn",b.appendChild(m));
|
||||
e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c()});b.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(h);l.appendChild(b);this.cancelBtn=h;this.okButton=e;this.container=l};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
|
||||
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
|
||||
|
@ -7204,7 +7204,7 @@ b,c=0;do b=this.model.getChildAt(this.model.root,c);while(c++<a&&"1"==mxUtils.ge
|
|||
[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.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.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 b=
|
||||
null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var q=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,d,f,k,e,n,g,h){if(null!=c&&null==mxMarker.markers[c]){var p=this.getPackageForType(c);null!=p&&mxStencilRegistry.getStencil(p)}return q.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){v.value=Math.max(1,Math.min(n,Math.max(parseInt(v.value),parseInt(m.value))));m.value=Math.max(1,Math.min(n,
|
||||
Math.min(parseInt(v.value),parseInt(m.value))))}function d(b){function c(b,c,f){var k=b.getGraphBounds(),e=0,n=0,p=ba.get(),g=1/b.pageScale,h=C.checked;if(h)var g=parseInt(Q.value),t=parseInt(P.value),g=Math.min(p.height*t/(k.height/b.view.scale),p.width*g/(k.width/b.view.scale));else g=parseInt(w.value)/(100*b.pageScale),isNaN(g)&&(d=1/b.pageScale,w.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*d);p.height=Math.ceil(p.height*d);g*=d;!h&&b.pageVisible?(k=b.getPageLayout(),
|
||||
Math.min(parseInt(v.value),parseInt(m.value))))}function d(b){function c(b,c,f){var k=b.getGraphBounds(),e=0,n=0,p=ba.get(),g=1/b.pageScale,h=C.checked;if(h)var g=parseInt(Q.value),t=parseInt(P.value),g=Math.min(p.height*t/(k.height/b.view.scale),p.width*g/(k.width/b.view.scale));else g=parseInt(x.value)/(100*b.pageScale),isNaN(g)&&(d=1/b.pageScale,x.value="100 %");p=mxRectangle.fromRectangle(p);p.width=Math.ceil(p.width*d);p.height=Math.ceil(p.height*d);g*=d;!h&&b.pageVisible?(k=b.getPageLayout(),
|
||||
e-=k.x*p.width,n-=k.y*p.height):h=!0;if(null==c){c=PrintDialog.createPrintPreview(b,g,p,0,e,n,h);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var u=c.writeHead;c.writeHead=function(b){u.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var m=c.renderPage;c.renderPage=function(a,b,c,d,f,k){var e=m.apply(this,arguments);this.graph.mathEnabled?
|
||||
this.mathEnabled=!0:e.className="geDisableMathJax";return e}}c.open(null,null,f,!0)}else{p=b.background;if(null==p||""==p||p==mxConstants.NONE)p="#ffffff";c.backgroundColor=p;c.autoOrigin=h;c.appendGraph(b,g,e,n,f,!0)}return c}var d=parseInt(U.value)/100;isNaN(d)&&(d=1,U.value="100 %");var d=.75*d,k=m.value,e=v.value,n=!t.checked,p=null;n&&(n=k==g&&e==g);if(!n&&null!=a.pages&&a.pages.length){var h=0,n=a.pages.length-1;t.checked||(h=parseInt(k)-1,n=parseInt(e)-1);for(var u=h;u<=n;u++){var q=a.pages[u],
|
||||
k=q==a.currentPage?f:null;if(null==k){var k=a.createTemporaryGraph(f.getStylesheet()),e=!0,h=!1,A=null,l=null;null==q.viewState&&null==q.mapping&&null==q.root&&a.updatePageRoot(q);null!=q.viewState?(e=q.viewState.pageVisible,h=q.viewState.mathEnabled,A=q.viewState.background,l=q.viewState.backgroundImage):null!=q.mapping&&null!=q.mapping.diagramMap&&(h="0"!=q.mapping.diagramMap.get("mathEnabled"),A=q.mapping.diagramMap.get("background"),l=q.mapping.diagramMap.get("backgroundImage"),l=null!=l&&0<l.length?
|
||||
|
@ -7214,16 +7214,16 @@ n.writeln("asciimath2jax: {"),n.writeln('\tignoreClass: "geDisableMathJax"'),n.w
|
|||
e.style.textAlign="center";e.style.marginTop="0px";mxUtils.write(e,b||mxResources.get("print"));k.appendChild(e);var n=1,g=1,h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","all");t.setAttribute("type","radio");t.setAttribute("name","pages-printdialog");h.appendChild(t);e=document.createElement("span");mxUtils.write(e,
|
||||
mxResources.get("printAllPages"));h.appendChild(e);mxUtils.br(h);var u=t.cloneNode(!0);t.setAttribute("checked","checked");u.setAttribute("value","range");h.appendChild(u);e=document.createElement("span");mxUtils.write(e,mxResources.get("pages")+":");h.appendChild(e);var m=document.createElement("input");m.style.cssText="margin:0 8px 0 8px;";m.setAttribute("value","1");m.setAttribute("type","number");m.setAttribute("min","1");m.style.width="50px";h.appendChild(m);e=document.createElement("span");
|
||||
mxUtils.write(e,mxResources.get("to"));h.appendChild(e);var v=m.cloneNode(!0);h.appendChild(v);mxEvent.addListener(m,"focus",function(){u.checked=!0});mxEvent.addListener(v,"focus",function(){u.checked=!0});mxEvent.addListener(m,"change",c);mxEvent.addListener(v,"change",c);if(null!=a.pages&&(n=a.pages.length,null!=a.currentPage))for(e=0;e<a.pages.length;e++)if(a.currentPage==a.pages[e]){g=e+1;m.value=g;v.value=g;break}m.setAttribute("max",n);v.setAttribute("max",n);1<n&&k.appendChild(h);var q=document.createElement("div");
|
||||
q.style.marginBottom="10px";var l=document.createElement("input");l.style.marginRight="8px";l.setAttribute("value","adjust");l.setAttribute("type","radio");l.setAttribute("name","printZoom");q.appendChild(l);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));q.appendChild(e);var w=document.createElement("input");w.style.cssText="margin:0 8px 0 8px;";w.setAttribute("value","100 %");w.style.width="50px";q.appendChild(w);mxEvent.addListener(w,"focus",function(){l.checked=!0});
|
||||
k.appendChild(q);var h=h.cloneNode(!1),C=l.cloneNode(!0);C.setAttribute("value","fit");l.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(C);h.appendChild(e);q=document.createElement("table");q.style.display="inline-block";var N=document.createElement("tbody"),S=document.createElement("tr"),O=S.cloneNode(!0),H=document.createElement("td"),W=H.cloneNode(!0),R=H.cloneNode(!0),T=H.cloneNode(!0),
|
||||
V=H.cloneNode(!0),K=H.cloneNode(!0);H.style.textAlign="right";T.style.textAlign="right";mxUtils.write(H,mxResources.get("fitTo"));var Q=document.createElement("input");Q.style.cssText="margin:0 8px 0 8px;";Q.setAttribute("value","1");Q.setAttribute("min","1");Q.setAttribute("type","number");Q.style.width="40px";W.appendChild(Q);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));R.appendChild(e);mxUtils.write(T,mxResources.get("fitToBy"));var P=Q.cloneNode(!0);V.appendChild(P);
|
||||
mxEvent.addListener(Q,"focus",function(){C.checked=!0});mxEvent.addListener(P,"focus",function(){C.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));K.appendChild(e);S.appendChild(H);S.appendChild(W);S.appendChild(R);O.appendChild(T);O.appendChild(V);O.appendChild(K);N.appendChild(S);N.appendChild(O);q.appendChild(N);h.appendChild(q);k.appendChild(h);h=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom=
|
||||
q.style.marginBottom="10px";var l=document.createElement("input");l.style.marginRight="8px";l.setAttribute("value","adjust");l.setAttribute("type","radio");l.setAttribute("name","printZoom");q.appendChild(l);e=document.createElement("span");mxUtils.write(e,mxResources.get("adjustTo"));q.appendChild(e);var x=document.createElement("input");x.style.cssText="margin:0 8px 0 8px;";x.setAttribute("value","100 %");x.style.width="50px";q.appendChild(x);mxEvent.addListener(x,"focus",function(){l.checked=!0});
|
||||
k.appendChild(q);var h=h.cloneNode(!1),C=l.cloneNode(!0);C.setAttribute("value","fit");l.setAttribute("checked","checked");e=document.createElement("div");e.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";e.appendChild(C);h.appendChild(e);q=document.createElement("table");q.style.display="inline-block";var N=document.createElement("tbody"),S=document.createElement("tr"),O=S.cloneNode(!0),G=document.createElement("td"),W=G.cloneNode(!0),R=G.cloneNode(!0),T=G.cloneNode(!0),
|
||||
V=G.cloneNode(!0),K=G.cloneNode(!0);G.style.textAlign="right";T.style.textAlign="right";mxUtils.write(G,mxResources.get("fitTo"));var Q=document.createElement("input");Q.style.cssText="margin:0 8px 0 8px;";Q.setAttribute("value","1");Q.setAttribute("min","1");Q.setAttribute("type","number");Q.style.width="40px";W.appendChild(Q);e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsAcross"));R.appendChild(e);mxUtils.write(T,mxResources.get("fitToBy"));var P=Q.cloneNode(!0);V.appendChild(P);
|
||||
mxEvent.addListener(Q,"focus",function(){C.checked=!0});mxEvent.addListener(P,"focus",function(){C.checked=!0});e=document.createElement("span");mxUtils.write(e,mxResources.get("fitToSheetsDown"));K.appendChild(e);S.appendChild(G);S.appendChild(W);S.appendChild(R);O.appendChild(T);O.appendChild(V);O.appendChild(K);N.appendChild(S);N.appendChild(O);q.appendChild(N);h.appendChild(q);k.appendChild(h);h=document.createElement("div");e=document.createElement("div");e.style.fontWeight="bold";e.style.marginBottom=
|
||||
"12px";mxUtils.write(e,mxResources.get("paperSize"));h.appendChild(e);e=document.createElement("div");e.style.marginBottom="12px";var ba=PageSetupDialog.addPageFormatPanel(e,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);h.appendChild(e);e=document.createElement("span");mxUtils.write(e,mxResources.get("pageScale"));h.appendChild(e);var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","100 %");U.style.width="60px";h.appendChild(U);
|
||||
k.appendChild(h);e=document.createElement("div");e.style.cssText="text-align:right;margin:62px 0 0 0;";h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&e.appendChild(h);a.isOffline()||(q=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),q.className="geBtn",e.appendChild(q));PrintDialog.previewEnabled&&(q=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();
|
||||
d(!1)}),q.className="geBtn",e.appendChild(q));q=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();d(!0)});q.className="geBtn gePrimaryBtn";e.appendChild(q);a.editor.cancelFirst||e.appendChild(h);k.appendChild(e);this.container=k};var v=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)):(v.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))}})();
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,d){d.ui=a.ui;return c};a.afterDecode=function(a,c,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.5";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;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>';
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,d){d.ui=a.ui;return c};a.afterDecode=function(a,c,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;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=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
|
||||
EditorUi.prototype.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.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(u){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=
|
||||
|
@ -7253,16 +7253,16 @@ mxUtils.parseXml(a).documentElement:null;a=null!=b?this.editor.extractGraphModel
|
|||
0))];b=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=b&&(this.fileNode=b.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(b.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(b);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var b=this.getCurrentFile(),b=null!=b&&null!=
|
||||
b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||/(\.html)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.png)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(b=b+"-"+this.currentPage.getName());return b};EditorUi.prototype.downloadFile=function(a,b,c,d,e,g,h){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),
|
||||
k=f+"."+a;if("xml"==a){var n='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(k,a,n,"text/xml")}else if("html"==a)n=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(k,a,n,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=f+".png":"jpeg"==a&&(k=f+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(b,c){try{var f=
|
||||
this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var e=this.createDownloadRequest(b,a,d,c,h);this.editor.graph.pageVisible=f;return e}catch(z){this.handleError(z)}}));else{var t=null,m=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))});if("svg"==a){var u=this.editor.graph.background;if(h||u==
|
||||
mxConstants.NONE)u=null;var v=this.editor.graph.getSvg(u,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(v);this.convertImages(v,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();m('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=f+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();m(a)}),d)}}catch(E){this.handleError(E)}};
|
||||
this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var e=this.createDownloadRequest(b,a,d,c,h);this.editor.graph.pageVisible=f;return e}catch(z){this.handleError(z)}}));else{var m=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(m)}))});if("svg"==a){var u=this.editor.graph.background;if(h||u==
|
||||
mxConstants.NONE)u=null;var v=this.editor.graph.getSvg(u,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(v);this.convertImages(v,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();t('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=f+".svg",m=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),d)}}catch(J){this.handleError(J)}};
|
||||
EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e){var f=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=b);var k="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&null!=this.currentPage))for(var n=0;n<this.pages.length;n++)if(this.pages[n]==this.currentPage){k="&from="+n;break}n=this.editor.graph.background;"png"==b&&e&&(n=mxConstants.NONE);
|
||||
return new mxXmlRequest(EXPORT_URL,"format="+b+k+"&bg="+(null!=n?n:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml,
|
||||
null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,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,k=null,n=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(k);k=window.setTimeout(n,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();n()}));g();n()}null!=b&&b()});if(null!=a.url){var e=a.url;/^https?:\/\//.test(e)&&!this.isCorsEnabledForUrl(e)&&
|
||||
(e=PROXY_URL+"?url="+encodeURIComponent(a.url));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f(a.data)};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){editorUi.alert(a.tooltip)});return b}var c=null;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var d=
|
||||
this.editor.graph,f=d.getModel();f.beginUpdate();var e=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var g=f.getCell(a.getAttribute("id"));if(null!=g){try{var h=a.getAttribute("value");if(null!=h){var m=mxUtils.parseXml(h).documentElement;if(null!=m)if("1"==m.getAttribute("replace-value"))f.setValue(g,m);else for(var p=m.attributes,A=0;A<p.length;A++)d.setAttributeForCell(g,p[A].nodeName,0<p[A].nodeValue.length?p[A].nodeValue:null)}}catch(z){null!=window.console&&console.log("Error in value for "+
|
||||
g.id+": "+z)}try{var l=a.getAttribute("style");null!=l&&d.model.setStyle(g,l)}catch(z){null!=window.console&&console.log("Error in style for "+g.id+": "+z)}try{var B=a.getAttribute("icon");if(null!=B){var x=0<B.length?JSON.parse(B):null;null!=x&&x.append||d.removeCellOverlays(g);null!=x&&d.addCellOverlay(g,b(x))}}catch(z){null!=window.console&&console.log("Error in icon for "+g.id+": "+z)}try{var E=a.getAttribute("geometry");if(null!=E){var E=JSON.parse(E),y=d.getCellGeometry(g);if(null!=y){y=y.clone();
|
||||
for(key in E){var D=parseFloat(E[key]);"dx"==key?y.x+=D:"dy"==key?y.y+=D:"dw"==key?y.width+=D:"dh"==key?y.height+=D:y[key]=parseFloat(E[key])}d.model.setGeometry(g,y)}}}catch(z){null!=window.console&&console.log("Error in icon for "+g.id+": "+z)}}}else if("model"==a.nodeName){for(var I=a.firstChild;null!=I&&I.nodeType!=mxConstants.NODETYPE_ELEMENT;)I=I.nextSibling;null!=I&&(new mxCodec(a.firstChild)).decode(I,f)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(d.view.scale=parseFloat(a.getAttribute("scale"))),
|
||||
g.id+": "+z)}try{var l=a.getAttribute("style");null!=l&&d.model.setStyle(g,l)}catch(z){null!=window.console&&console.log("Error in style for "+g.id+": "+z)}try{var B=a.getAttribute("icon");if(null!=B){var w=0<B.length?JSON.parse(B):null;null!=w&&w.append||d.removeCellOverlays(g);null!=w&&d.addCellOverlay(g,b(w))}}catch(z){null!=window.console&&console.log("Error in icon for "+g.id+": "+z)}try{var J=a.getAttribute("geometry");if(null!=J){var J=JSON.parse(J),y=d.getCellGeometry(g);if(null!=y){y=y.clone();
|
||||
for(key in J){var D=parseFloat(J[key]);"dx"==key?y.x+=D:"dy"==key?y.y+=D:"dw"==key?y.width+=D:"dh"==key?y.height+=D:y[key]=parseFloat(J[key])}d.model.setGeometry(g,y)}}}catch(z){null!=window.console&&console.log("Error in icon for "+g.id+": "+z)}}}else if("model"==a.nodeName){for(var H=a.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=H.nextSibling;null!=H&&(new mxCodec(a.firstChild)).decode(H,f)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(d.view.scale=parseFloat(a.getAttribute("scale"))),
|
||||
a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(e=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{f.endUpdate()}null!=e&&this.chromelessResize&&this.chromelessResize(!0,e)}return c};EditorUi.prototype.fileLoaded=function(a){var b=!1;this.hideDialog();var c=this.getCurrentFile();this.setCurrentFile(null);null!=c&&(c.removeListener(this.descriptorChangedListener),
|
||||
c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));
|
||||
this.updateUi();this.showSplash()});if(null!=a)try{this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+
|
||||
|
@ -7279,19 +7279,19 @@ EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototyp
|
|||
"aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,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 b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[k]);c=null!=c&&0<c.length?c:a.getTitle();var n=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var g=
|
||||
n.parentNode.previousSibling;c=g.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&g.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var p=document.createElement("div");p.style.position="absolute";p.style.right="0px";p.style.top="0px";p.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(p.style.backgroundColor="inherit");g.style.position="relative";var h=document.createElement("img");h.setAttribute("src",Dialog.prototype.closeImage);h.setAttribute("title",
|
||||
mxResources.get("close"));h.setAttribute("valign","absmiddle");h.setAttribute("border","0");h.style.margin="0 3px";var m=null;if(".scratchpad"!=a.title||this.closableScratchpad)p.appendChild(h),mxEvent.addListener(h,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var l=
|
||||
this.editor.graph,x=null,E=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),n,b,a,a.getMode());mxEvent.consume(c)}),y=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=x&&null!=x.parentNode&&x.parentNode.removeChild(x),x=h.cloneNode(!1),x.setAttribute("src",Editor.spinImage),x.setAttribute("title",mxResources.get("saving")),x.style.cursor="default",x.style.marginRight="2px",x.style.marginTop="-2px",p.insertBefore(x,p.firstChild),g.style.paddingRight=18*p.childNodes.length+
|
||||
"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=x&&null!=x.parentNode&&(x.parentNode.removeChild(x),g.style.paddingRight=18*p.childNodes.length+"px")})):null==m&&(m=h.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),p.insertBefore(m,p.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()||
|
||||
this.editor.graph,w=null,J=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),n,b,a,a.getMode());mxEvent.consume(c)}),y=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=w&&null!=w.parentNode&&w.parentNode.removeChild(w),w=h.cloneNode(!1),w.setAttribute("src",Editor.spinImage),w.setAttribute("title",mxResources.get("saving")),w.style.cursor="default",w.style.marginRight="2px",w.style.marginTop="-2px",p.insertBefore(w,p.firstChild),g.style.paddingRight=18*p.childNodes.length+
|
||||
"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=w&&null!=w.parentNode&&(w.parentNode.removeChild(w),g.style.paddingRight=18*p.childNodes.length+"px")})):null==m&&(m=h.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),p.insertBefore(m,p.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==m||a.isModified()||
|
||||
(g.style.paddingRight=18*p.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),g.style.paddingRight=18*p.childNodes.length+"px")}),D=mxUtils.bind(this,function(a,c,d,e){a=l.cloneCells(mxUtils.sortCells(l.model.getTopmostCells(a)));for(var k=0;k<a.length;k++){var g=l.getCellGeometry(a[k]);null!=g&&g.translate(-c.x,-c.y)}n.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),
|
||||
w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);y(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),I=mxUtils.bind(this,function(a){if(l.isSelectionEmpty())l.getRubberband().isActive()?(l.getRubberband().execute(a),l.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=l.getSelectionCells(),c=l.view.getBounds(b),d=l.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=l.view.translate.x;
|
||||
w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);y(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(l.isSelectionEmpty())l.getRubberband().isActive()?(l.getRubberband().execute(a),l.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=l.getSelectionCells(),c=l.view.getBounds(b),d=l.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=l.view.translate.x;
|
||||
c.y-=l.view.translate.y;D(b,c)}mxEvent.consume(a)});n.style.border="3px solid transparent";mxEvent.addGestureListeners(n,function(){},mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":n.style.border="3px dotted rgb(254, 137, 12)",n.style.cursor="copy",l.panningManager.stop(),l.autoScroll=!1,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!1),
|
||||
null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler&&(n.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),n.style.cursor="default",this.sidebar.showTooltips=!0,l.panningManager.stop(),l.graphHandler.reset(),l.isMouseDown=!1,l.autoScroll=!0,I(a),mxEvent.consume(a))}));mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(a){l.isMouseDown&&
|
||||
null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){l.isMouseDown&&null!=l.panningManager&&null!=l.graphHandler&&(n.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),n.style.cursor="default",this.sidebar.showTooltips=!0,l.panningManager.stop(),l.graphHandler.reset(),l.isMouseDown=!1,l.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(a){l.isMouseDown&&
|
||||
null!=l.graphHandler.shape&&(l.graphHandler.shape.node.style.visibility="visible",n.style.border="3px solid transparent",n.style.cursor="",l.autoScroll=!0,null!=l.graphHandler.guide&&l.graphHandler.guide.setVisible(!0),null!=l.graphHandler.hint&&(l.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":n.style.border="3px dotted rgb(254, 137, 12)";
|
||||
a.dataTransfer.dropEffect="copy";n.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"drop",mxUtils.bind(this,function(a){n.style.border="3px solid transparent";n.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,k,g,p,h,m,t,l){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,h),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,p,h),a,mxEvent.isAltDown(a)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var q=!1,v=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(k.documentElement));e(g,n);b=b.concat(g);y(a);
|
||||
this.spinner.stop();q=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var p=k.documentElement.getElementsByTagName("diagram"),k=0;k<p.length;k++){var g=mxUtils.getTextContent(p[k]),h=this.stringToCells(this.editor.graph.decompress(g)),m=this.editor.graph.getBoundingBoxFromGeometry(h);D(h,new mxRectangle(0,0,m.width,m.height),a)}q=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}q||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=m&&(/(\.vsdx?)($|\?)/i.test(m)||/(\.vssx)($|\?)/i.test(m))?this.importVisio(l,function(a){v(a,"text/xml")},null,m):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,m)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?v(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":
|
||||
"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):v(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(n.style.border="3px solid transparent",n.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",Editor.editImage);h.setAttribute("title",mxResources.get("edit"));p.insertBefore(h,p.firstChild);mxEvent.addListener(h,"click",E);mxEvent.addListener(n,
|
||||
"dblclick",function(a){mxEvent.getSource(a)==n&&E(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));p.insertBefore(c,p.firstChild);mxEvent.addListener(c,"click",I);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,
|
||||
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,h),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,p,h),a,mxEvent.isAltDown(a)?null:m.substring(0,m.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var v=!1,q=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(k.documentElement));e(g,n);b=b.concat(g);y(a);
|
||||
this.spinner.stop();v=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var p=k.documentElement.getElementsByTagName("diagram"),k=0;k<p.length;k++){var g=mxUtils.getTextContent(p[k]),h=this.stringToCells(this.editor.graph.decompress(g)),m=this.editor.graph.getBoundingBoxFromGeometry(h);D(h,new mxRectangle(0,0,m.width,m.height),a)}v=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}v||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=l&&null!=m&&(/(\.vsdx?)($|\?)/i.test(m)||/(\.vssx)($|\?)/i.test(m))?this.importVisio(l,function(a){q(a,"text/xml")},null,m):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,m)&&null!=l?this.parseFile(l,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?q(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":
|
||||
"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):q(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(n,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(n.style.border="3px solid transparent",n.style.cursor="");a.stopPropagation();a.preventDefault()}));h=h.cloneNode(!1);h.setAttribute("src",Editor.editImage);h.setAttribute("title",mxResources.get("edit"));p.insertBefore(h,p.firstChild);mxEvent.addListener(h,"click",J);mxEvent.addListener(n,
|
||||
"dblclick",function(a){mxEvent.getSource(a)==n&&J(a)});c=h.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));p.insertBefore(c,p.firstChild);mxEvent.addListener(c,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,
|
||||
mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),p.insertBefore(c,p.firstChild))}g.appendChild(p);g.style.paddingRight=18*p.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");
|
||||
if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});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=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=
|
||||
|
@ -7303,7 +7303,7 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM
|
|||
a.style.position="absolute";a.style.overflow="hidden";a.style.borderWidth="3px";var b=document.createElement("a");b.setAttribute("href","javascript:void(0);");b.className="geTitle";b.style.height="100%";b.style.paddingTop="9px";mxUtils.write(b,mxResources.get("moreShapes")+"...");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,c){var d=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){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(e=mxResources.get("cancel"),k=function(){d();f.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.FORBIDDEN)a=mxUtils.htmlEntities(mxResources.get("forbidden"));
|
||||
else if(404==f.code||404==f.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&f.type==gapi.drive.realtime.ErrorType.NOT_FOUND){a=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var g=window.location.hash;null!=g&&"#G"==g.substring(0,2)&&(g=g.substring(2),a+=' <a href="https://drive.google.com/open?id='+g+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else f.code==App.ERROR_TIMEOUT?a=
|
||||
mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,c,k)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,g,h,m,l,p,A,F){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,h,F,m,l);this.showDialog(a.container,p||340,A||150,!0,!1);a.init()};EditorUi.prototype.alert=
|
||||
mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY?a=mxUtils.htmlEntities(mxResources.get("busy")):null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error&&(a=mxUtils.htmlEntities(f.response.error));this.showError(b,a,e,c,k)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,g,h,m,l,p,A,E){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,h,E,m,l);this.showDialog(a.container,p||340,A||150,!0,!1);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,c,d,e){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},d,e)).container,340,90,!0,!1)};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,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));
|
||||
return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!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};
|
||||
|
@ -7311,7 +7311,7 @@ EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.Blob&&navigator
|
|||
"380px",this.showDialog(b.container,620,460,!0,!0),b.init(),document.execCommand("selectall",!1,null);else{var f=document.createElement("a"),k=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),k=65==(g?parseInt(g[2],10):!1)?!1:k;if(k||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);
|
||||
try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(C){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,d,e,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&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 g=1024*k,h=Math.min(g+1024,d),p=Array(h-g),m=0;g<h;++m,++g)p[m]=c[g].charCodeAt(0);e[k]=new Uint8Array(p)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,h){g=null!=g?g:!1;h=null!=h?h:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||
|
||||
"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(F){this.handleError(F)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
||||
"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(E){this.handleError(E)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
||||
mxResources.get("download"),!1,g,h,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+
|
||||
'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var b=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=
|
||||
|
@ -7338,21 +7338,21 @@ mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURI
|
|||
mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(f);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");f=g.cloneNode(!0);f.setAttribute("value",
|
||||
"copy");k.appendChild(f);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(n);mxUtils.br(k);k.appendChild(g);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));k.appendChild(n);var p=this.getCurrentFile();null==c&&null!=p&&p.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")),
|
||||
k.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(p.getId())})));f.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");e.appendChild(k);var h=this.addLinkSection(e),m=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var l=document.createElement("input");l.setAttribute("type","text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.style.marginRight=
|
||||
"12px";l.value="100%";e.appendChild(l);var t=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,E=E=this.addCheckbox(e,mxResources.get("allPages"),k,!k),y=this.addCheckbox(e,mxResources.get("layers"),!0),D=this.addCheckbox(e,mxResources.get("lightbox"),!0),I=this.addEditButton(e,D),z=I.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&D.checked?
|
||||
I.getEditSelect().removeAttribute("disabled"):I.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(g.checked?c:null,m.checked,l.value,h.getTarget(),h.getColor(),t.checked,E.checked,y.checked,D.checked,I.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3");
|
||||
"12px";l.value="100%";e.appendChild(l);var t=this.addCheckbox(e,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,J=J=this.addCheckbox(e,mxResources.get("allPages"),k,!k),y=this.addCheckbox(e,mxResources.get("layers"),!0),D=this.addCheckbox(e,mxResources.get("lightbox"),!0),H=this.addEditButton(e,D),z=H.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?z.removeAttribute("disabled"):z.setAttribute("disabled","disabled");z.checked&&D.checked?
|
||||
H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){d(g.checked?c:null,m.checked,l.value,h.getTarget(),h.getColor(),t.checked,J.checked,y.checked,D.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3");
|
||||
mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var n=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=n&&n.constructor==window.DriveFile&&!b){a=80;var k="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 h=document.createElement("div");h.style.whiteSpace="normal";mxUtils.write(h,mxResources.get("linkAccountRequired"));p.appendChild(h);h=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(n.getId())}));h.style.marginTop="12px";h.className="geBtn";p.appendChild(h);f.appendChild(p);h=document.createElement("a");h.style.paddingLeft="12px";h.style.color="gray";h.style.fontSize="11px";h.setAttribute("href","javascript:void(0);");mxUtils.write(h,mxResources.get("check"));
|
||||
p.appendChild(h);mxEvent.addListener(h,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,l=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),m=document.createElement("input"),
|
||||
m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",f.appendChild(m),mxUtils.write(f,mxResources.get("height")+":"),l=document.createElement("input"),l.setAttribute("type","text"),l.style.width="50px",l.style.marginLeft="6px",l.style.marginBottom="10px",l.value=d+"px",f.appendChild(l),mxUtils.br(f);var t=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null;
|
||||
if(null==n||n.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var u=this.addCheckbox(f,mxResources.get("lightbox"),!0),D=this.addEditButton(f,u),I=D.getEditInput(),z=this.addCheckbox(f,mxResources.get("layers"),!0);z.style.marginLeft=I.style.marginLeft;z.style.marginBottom="16px";z.style.marginTop="8px";mxEvent.addListener(u,"change",function(){u.checked?(z.removeAttribute("disabled"),I.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),I.setAttribute("disabled",
|
||||
"disabled"));I.checked&&u.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(t.getTarget(),t.getColor(),null==q?!0:q.checked,u.checked,D.getLink(),z.checked,null!=m?m.value:null,null!=l?l.value:null)}),null,mxResources.get("create"),k);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():
|
||||
if(null==n||n.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var u=this.addCheckbox(f,mxResources.get("lightbox"),!0),D=this.addEditButton(f,u),H=D.getEditInput(),z=this.addCheckbox(f,mxResources.get("layers"),!0);z.style.marginLeft=H.style.marginLeft;z.style.marginBottom="16px";z.style.marginTop="8px";mxEvent.addListener(u,"change",function(){u.checked?(z.removeAttribute("disabled"),H.removeAttribute("disabled")):(z.setAttribute("disabled","disabled"),H.setAttribute("disabled",
|
||||
"disabled"));H.checked&&u.checked?D.getEditSelect().removeAttribute("disabled"):D.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(t.getTarget(),t.getColor(),null==q?!0:q.checked,u.checked,D.getLink(),z.checked,null!=m?m.value:null,null!=l?l.value:null)}),null,mxResources.get("create"),k);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)):t.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var e=document.createElement("div");e.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";e.appendChild(f);var k=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),
|
||||
!0),f=this.editor.graph,n=d?null:this.addCheckbox(e,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!k.checked,null!=g?g.checked:!1,null!=n?n.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,h,m){h=null!=h?h:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=
|
||||
this.editor.graph,n="jpeg"==m?196:300,l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(l);mxUtils.write(f,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";f.appendChild(t);mxUtils.write(f,mxResources.get("borderWidth")+":");
|
||||
var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.value=this.lastExportBorder||"0";f.appendChild(q);mxUtils.br(f);var v=this.addCheckbox(f,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=m),u=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),w=document.createElement("input");w.style.marginTop="16px";w.style.marginRight=
|
||||
"8px";w.style.marginLeft="24px";w.setAttribute("disabled","disabled");w.setAttribute("type","checkbox");g&&(f.appendChild(w),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),n+=26,mxEvent.addListener(u,"change",function(){u.checked?w.removeAttribute("disabled"):w.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(w.setAttribute("checked","checked"),w.defaultChecked=!0);var I=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible),z=document.createElement("input");z.style.marginTop=
|
||||
"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(f.appendChild(z),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),n+=26);var J=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=m),G=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(f,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=m);L.style.marginLeft="24px";L.style.marginBottom="16px";G||(L.style.visibility=
|
||||
"hidden");mxEvent.addListener(J,"change",function(){J.checked&&G?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")});h&&G||L.setAttribute("disabled","disabled");a=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=t.value;e(t.value,v.checked,!u.checked,I.checked,J.checked,z.checked,q.value,w.checked,!L.checked)}),null,c,d);this.showDialog(a.container,340,n,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
||||
var q=document.createElement("input");q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.value=this.lastExportBorder||"0";f.appendChild(q);mxUtils.br(f);var v=this.addCheckbox(f,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=m),u=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight=
|
||||
"8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type","checkbox");g&&(f.appendChild(x),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),n+=26,mxEvent.addListener(u,"change",function(){u.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var H=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible),z=document.createElement("input");z.style.marginTop=
|
||||
"16px";z.style.marginRight="8px";z.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||z.setAttribute("disabled","disabled");b&&(f.appendChild(z),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),n+=26);var I=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=m),F=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(f,F?mxResources.get("allPages"):"",F,!F,null,"jpeg"!=m);L.style.marginLeft="24px";L.style.marginBottom="16px";F||(L.style.visibility=
|
||||
"hidden");mxEvent.addListener(I,"change",function(){I.checked&&F?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")});h&&F||L.setAttribute("disabled","disabled");a=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=t.value;e(t.value,v.checked,!u.checked,H.checked,I.checked,z.checked,q.value,x.checked,!L.checked)}),null,c,d);this.showDialog(a.container,340,n,!0,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
||||
mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=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";f.appendChild(g)}var n=this.addCheckbox(f,mxResources.get("fit"),!0),p=this.addCheckbox(f,mxResources.get("shadow"),k.shadowVisible&&d,
|
||||
!d),h=this.addCheckbox(f,c),m=this.addCheckbox(f,mxResources.get("lightbox"),!0),l=this.addEditButton(f,m),t=l.getEditInput(),u=1<k.model.getChildCount(k.model.getRoot()),y=this.addCheckbox(f,mxResources.get("layers"),u,!u);y.style.marginLeft=t.style.marginLeft;y.style.marginBottom="12px";y.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(u&&y.removeAttribute("disabled"),t.removeAttribute("disabled")):(y.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));
|
||||
t.checked&&m.checked?l.getEditSelect().removeAttribute("disabled"):l.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){a(n.checked,p.checked,h.checked,m.checked,l.getLink(),y.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,g,h,m){function f(b){var f=" ",p="";d&&(f=" 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('https://www.draw.io/?client=1&lightbox=1"+
|
||||
|
@ -7366,13 +7366,13 @@ d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){retur
|
|||
e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),f=d.getGlobalVariable,k=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(d.container);
|
||||
d.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var f=c.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(p){null!=b&&b(p)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg=
|
||||
function(a,b,c,d,e,g,h){h=b.background;h==mxConstants.NONE&&(h=null);b=b.getSvg(h,null,null,null,null,g);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
||||
mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,h,m,l){l=null!=l?l:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,m):null,l)}catch(F){"Invalid image"==F.message?this.downloadFile(l):this.handleError(F)}}),null,
|
||||
mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,h,m,l){l=null!=l?l:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,m):null,l)}catch(E){"Invalid image"==E.message?this.downloadFile(l):this.handleError(E)}}),null,
|
||||
this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,h)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,e={},f=mxUtils.bind(this,function(){if(0==d){for(var f=[c[0]],k=1;k<c.length;k++){var g=
|
||||
c[k].indexOf(")");f.push('url("');f.push(e[b(c[k].substring(0,g))]);f.push('"'+c[k].substring(g))}this.editor.resolvedFontCss=f.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var h=c[g].indexOf(")"),m=null,p=c[g].indexOf("format(",h);0<p&&(m=b(c[g].substring(p+7,c[g].indexOf(")",p))));mxUtils.bind(this,function(a){if(null==e[a]){e[a]=a;d++;var b="application/x-font-ttf";if("svg"==m||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==m||"embedded-opentype"==m||/(\.otf)($|\?)/i.test(a))b=
|
||||
"application/x-font-opentype";else if("woff"==m||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==m||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==m||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==m||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){e[a]=b;d--;f()}),mxUtils.bind(this,
|
||||
function(a){d--;f()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,h)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,h,m,l,p,A,F,B,x){g=null!=g?g:!0;F=null!=F?F:this.editor.graph;B=null!=B?B:0;var f=l?null:F.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==l&&(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(F.getSvg(f,null,null,x,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
|
||||
function(a){d--;f()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,h)),m)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,h,m,l,p,A,E,B,w){g=null!=g?g:!0;E=null!=E?E:this.editor.graph;B=null!=B?B:0;var f=l?null:E.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==l&&(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(E.getSvg(f,null,null,w,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
|
||||
function(){try{var k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),h=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=b&&(m=g?Math.min(1,Math.min(3*b/(4*h),b/p)):b/p);p=Math.ceil(m*p)+2*B;h=Math.ceil(m*h)+2*B;k.setAttribute("width",p);k.setAttribute("height",h);var n=k.getContext("2d");null!=f&&(n.beginPath(),n.rect(0,0,p,h),n.fillStyle=f,n.fill());n.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){n.drawImage(d,B/m,B/m);a(k)},0):(n.drawImage(d,B/m,B/m),a(k))}catch(M){null!=
|
||||
e&&e(M)}});d.onerror=function(a){null!=e&&e(a)};try{p&&this.editor.graph.addSvgShadow(c);var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(F,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(z){null!=e&&e(z)}}),c,A)};EditorUi.prototype.createImageUrlConverter=
|
||||
e&&e(M)}});d.onerror=function(a){null!=e&&e(a)};try{p&&this.editor.graph.addSvgShadow(c);var k=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(k)}catch(z){null!=e&&e(z)}}),c,A)};EditorUi.prototype.createImageUrlConverter=
|
||||
function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var e="http://"==d.substring(0,7)||"https://"==d.substring(0,8);e&&!navigator.onLine?d=c.svgBrokenImage.src:!e||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==
|
||||
d&&(d=this.createImageUrlConverter());var e=0,f=c||{};c=mxUtils.bind(this,function(c,k){for(var g=a.getElementsByTagName(c),p=0;p<g.length;p++)mxUtils.bind(this,function(c){var g=d.convert(c.getAttribute(k));if(null!=g&&"data:"!=g.substring(0,5)){var p=f[g];null==p?(e++,this.convertImageToDataUri(g,function(d){null!=d&&(f[g]=d,c.setAttribute(k,d));e--;0==e&&b(a)})):c.setAttribute(k,p)}else null!=g&&c.setAttribute(k,g)})(g[p])});c("image","xlink:href");c("img","src");0==e&&b(a)};EditorUi.prototype.loadUrl=
|
||||
function(a,b,c,d,e,g){try{var f=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);e=null!=e?e:!0;var k=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(f){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=
|
||||
|
@ -7381,7 +7381,7 @@ String.fromCharCode(a[e]);d=d.join("")}g=null!=g?g:"data:image/png;base64,";d=g+
|
|||
d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=c.height;a.width=c.width;e.drawImage(c,0,0);try{b(a.toDataURL())}catch(v){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!=b?b:0;c=null!=c?c:0;var f=[];try{var k=this.editor.graph;if(null!=a&&0<a.length){var g=mxUtils.parseXml(a),h=this.editor.extractGraphModel(g.documentElement,
|
||||
null!=this.pages);if(null!=h&&"mxfile"==h.nodeName&&null!=this.pages){var p=h.getElementsByTagName("diagram");if(1==p.length)h=mxUtils.parseXml(k.decompress(mxUtils.getTextContent(p[0]))).documentElement;else if(1<p.length){k.model.beginUpdate();try{for(a=0;a<p.length;a++){var n=this.updatePageRoot(new DiagramPage(p[a])),m=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[m+1]));k.model.execute(new ChangePage(this,n,n,m))}}finally{k.model.endUpdate()}}}null!=h&&"mxGraphModel"===
|
||||
h.nodeName&&(f=k.importGraphModel(h,b,c,d))}}catch(B){throw e||this.handleError(B,mxResources.get("invalidOrMissingFile")),B;}return f};EditorUi.prototype.importVisio=function(a,b,c,d){d=null!=d?d:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var e=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(/(\.vsd)($|\?)/i.test(d)&&null!=VSD_CONVERT_URL){var e=new FormData;e.append("file1",a,d);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{this.doImportVisio(f.response,b,c)}catch(w){c(w)}else c({})});f.send(e)}else try{this.doImportVisio(a,b,c)}catch(w){c(w)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(k){this.handleError(k)}});
|
||||
"blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{this.doImportVisio(f.response,b,c)}catch(x){c(x)}else c({})});f.send(e)}else try{this.doImportVisio(a,b,c)}catch(x){c(x)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(k){this.handleError(k)}});
|
||||
"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.importLucidChart=function(a,b,c,d,e){var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.pasteLucidChart)try{this.insertLucidChart(a,b,c,d,e)}catch(v){this.handleError(v)}finally{null!=e&&e()}});this.pasteLucidChart||this.loadingExtensions||this.isOffline()?window.setTimeout(f,0):(this.loadingExtensions=!0,"1"==urlParams.dev?
|
||||
mxscript("js/diagramly/Extensions.js",f):mxscript("js/extensions.min.js",f))};EditorUi.prototype.insertLucidChart=function(a,b,c,d,e){e=JSON.parse(a);a=[];if(null!=e.state){e=JSON.parse(e.state);for(var f in e.Pages)a.push(e.Pages[f]);a.sort(function(a,b){return a.Properties.Order<b.Properties.Order?-1:a.Properties.Order>b.Properties.Order?1:0})}else a.push(e);if(0<a.length){this.editor.graph.getModel().beginUpdate();try{if(this.pasteLucidChart(a[0],b,c,d),null!=this.pages){var k=this.currentPage;
|
||||
for(b=1;b<a.length;b++)this.insertPage(),this.pasteLucidChart(a[b]);this.selectPage(k)}}finally{this.editor.graph.getModel().endUpdate()}}};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,g,h){g=null!=g?g:!0;h=null!=h?h:!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,
|
||||
|
@ -7397,15 +7397,15 @@ A){p=null!=p?p:!0;var f=!1,k=null,n=mxUtils.bind(this,function(a){var b=null;nul
|
|||
k.snap(d)),k=[k.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(a,mxUtils.bind(this,function(a){a=this.importXml(a,c,d,p);null!=m&&m(a)})):null!=l&&null!=h&&(/(\.vsdx?)($|\?)/i.test(h)||/(\.vssx)($|\?)/i.test(h))?(f=!0,this.importVisio(l,n)):!this.isOffline()&&(new XMLHttpRequest).upload&&
|
||||
this.isRemoteFileFormat(a,h)?(f=!0,this.parseFile(null!=l?l:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?n(a.responseText):null!=m&&m(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(k=this.insertTextAt(this.validateFileData(a),c,d,!0,null,p));f||null==m||m(k);return k};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,f,g;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
|
||||
2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}f=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
|
||||
2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,h,m,l,p,A,F){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;p=null!=p?p:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&
|
||||
null!=a)for(var t=A||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>t){n=!0;break}var v=mxUtils.bind(this,function(){var n=this.editor.graph,l=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,h,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,g,k,h,p,f,F)});g=null!=g?g:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,
|
||||
mxResources.get("loading")))for(var t=a.length,q=t,v=[],u=mxUtils.bind(this,function(a,b){v[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(v);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}g(c)}}),E=0;E<t;E++)mxUtils.bind(this,function(f){var g=a[f],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m=
|
||||
a.target.result,t=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(t+1)))),v=mxUtils.parseXml(q),q=v.getElementsByTagName("svg");if(0<q.length){var q=q[0],z=F?null:q.getAttribute("content");null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=unescape(window.atob?atob(z):Base64.decode(z,!0)));null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z));null==z||"<mxfile "!==z.substring(0,8)&&"<mxGraphModel "!==z.substring(0,14)?u(f,mxUtils.bind(this,function(){try{if(m.substring(0,t+1),null!=v){var a=
|
||||
v.getElementsByTagName("svg");if(0<a.length){var h=a[0],p=parseFloat(h.getAttribute("width")),A=parseFloat(h.getAttribute("height")),q=h.getAttribute("viewBox");if(null==q||0==q.length)h.setAttribute("viewBox","0 0 "+p+" "+A);else if(isNaN(p)||isNaN(A)){var u=q.split(" ");3<u.length&&(p=parseFloat(u[2]),A=parseFloat(u[3]))}m=this.createSvgDataUri(mxUtils.getXml(h));var z=Math.min(1,Math.min(d/Math.max(1,p)),d/Math.max(1,A)),E=e(m,g.type,b+f*l,c+f*l,Math.max(1,Math.round(p*z)),Math.max(1,Math.round(A*
|
||||
z)),g.name,k);if(isNaN(p)||isNaN(A)){var w=new Image;w.onload=mxUtils.bind(this,function(){p=Math.max(1,w.width);A=Math.max(1,w.height);E[0].geometry.width=p;E[0].geometry.height=A;h.setAttribute("viewBox","0 0 "+p+" "+A);m=this.createSvgDataUri(mxUtils.getXml(h));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));n.setCellStyles("image",m,[E[0]])});w.src=this.createSvgDataUri(mxUtils.getXml(h))}return E}}}catch(da){}return null})):u(f,mxUtils.bind(this,function(){return e(z,
|
||||
"text/xml",b+f*l,c+f*l,0,0,g.name)}))}}else{q=!1;if("image/png"==g.type){var E=F?null:this.extractGraphModelFromPng(a.target.result);if(null!=E&&0<E.length){var w=new Image;w.src=a.target.result;u(f,mxUtils.bind(this,function(){return e(E,"text/xml",b+f*l,c+f*l,w.width,w.height,g.name)}));q=!0}}q||(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"),
|
||||
2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,h,m,l,p,A,E){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;p=null!=p?p:this.maxImageBytes;var f=null!=b&&null!=c,k=!0,n=!1;if(!mxClient.IS_CHROMEAPP&&
|
||||
null!=a)for(var t=A||this.resampleThreshold,q=0;q<a.length;q++)if("image/"==a[q].type.substring(0,6)&&a[q].size>t){n=!0;break}var v=mxUtils.bind(this,function(){var n=this.editor.graph,l=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,k,h,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,d,e,g,k,h,p,f,E)});g=null!=g?g:mxUtils.bind(this,function(a){n.setSelectionCells(a)});if(this.spinner.spin(document.body,
|
||||
mxResources.get("loading")))for(var t=a.length,q=t,v=[],u=mxUtils.bind(this,function(a,b){v[a]=b;if(0==--q){this.spinner.stop();if(null!=m)m(v);else{var c=[];n.getModel().beginUpdate();try{for(var d=0;d<v.length;d++){var e=v[d]();null!=e&&(c=c.concat(e))}}finally{n.getModel().endUpdate()}}g(c)}}),x=0;x<t;x++)mxUtils.bind(this,function(f){var g=a[f],m=new FileReader;m.onload=mxUtils.bind(this,function(a){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m=
|
||||
a.target.result,t=m.indexOf(","),q=decodeURIComponent(escape(atob(m.substring(t+1)))),v=mxUtils.parseXml(q),q=v.getElementsByTagName("svg");if(0<q.length){var q=q[0],z=E?null:q.getAttribute("content");null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=unescape(window.atob?atob(z):Base64.decode(z,!0)));null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z));null==z||"<mxfile "!==z.substring(0,8)&&"<mxGraphModel "!==z.substring(0,14)?u(f,mxUtils.bind(this,function(){try{if(m.substring(0,t+1),null!=v){var a=
|
||||
v.getElementsByTagName("svg");if(0<a.length){var h=a[0],p=parseFloat(h.getAttribute("width")),A=parseFloat(h.getAttribute("height")),q=h.getAttribute("viewBox");if(null==q||0==q.length)h.setAttribute("viewBox","0 0 "+p+" "+A);else if(isNaN(p)||isNaN(A)){var u=q.split(" ");3<u.length&&(p=parseFloat(u[2]),A=parseFloat(u[3]))}m=this.createSvgDataUri(mxUtils.getXml(h));var z=Math.min(1,Math.min(d/Math.max(1,p)),d/Math.max(1,A)),x=e(m,g.type,b+f*l,c+f*l,Math.max(1,Math.round(p*z)),Math.max(1,Math.round(A*
|
||||
z)),g.name,k);if(isNaN(p)||isNaN(A)){var E=new Image;E.onload=mxUtils.bind(this,function(){p=Math.max(1,E.width);A=Math.max(1,E.height);x[0].geometry.width=p;x[0].geometry.height=A;h.setAttribute("viewBox","0 0 "+p+" "+A);m=this.createSvgDataUri(mxUtils.getXml(h));var a=m.indexOf(";");0<a&&(m=m.substring(0,a)+m.substring(m.indexOf(",",a+1)));n.setCellStyles("image",m,[x[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(h))}return x}}}catch(da){}return null})):u(f,mxUtils.bind(this,function(){return e(z,
|
||||
"text/xml",b+f*l,c+f*l,0,0,g.name)}))}}else{q=!1;if("image/png"==g.type){var x=E?null:this.extractGraphModelFromPng(a.target.result);if(null!=x&&0<x.length){var J=new Image;J.src=a.target.result;u(f,mxUtils.bind(this,function(){return e(x,"text/xml",b+f*l,c+f*l,J.width,J.height,g.name)}));q=!0}}q||(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(h){this.resizeImage(h,a.target.result,mxUtils.bind(this,function(h,m,n){u(f,mxUtils.bind(this,function(){if(null!=h&&h.length<p){var t=k&&this.isResampleImage(a.target.result,A)?Math.min(1,Math.min(d/m,d/n)):1;return e(h,g.type,b+f*l,c+f*l,Math.round(m*t),Math.round(n*t),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),k,d,A)}),mxUtils.bind(this,
|
||||
function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?e(null,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)})(E)});n?this.confirmImageResize(function(a){k=a;v()},l):v()};EditorUi.prototype.confirmImageResize=function(a,
|
||||
function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?e(null,g.type,b+f*l,c+f*l,240,160,g.name,function(a){u(f,function(){return a})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)})(x)});n?this.confirmImageResize(function(a){k=a;v()},l):v()};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,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+
|
||||
'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>
|
||||
b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),k=Math.max(1,a.height);if(d&&this.isResampleImage(b,g))try{var h=Math.max(f/e,k/e);if(1<h){var p=Math.round(f/h),m=Math.round(k/h),n=document.createElement("canvas");n.width=p;n.height=m;n.getContext("2d").drawImage(a,0,0,p,m);var l=n.toDataURL();if(l.length<b.length){var t=document.createElement("canvas");t.width=p;t.height=m;var q=t.toDataURL();l!==q&&(b=l,f=p,k=m)}}}catch(y){}c(b,f,k)};
|
||||
|
@ -7413,7 +7413,7 @@ EditorUi.prototype.crcTable=[];for(var c=0;256>c;c++)for(var d=c,e=0;8>e;e++)d=1
|
|||
b,c,d,e){function f(a,b){var c=h;h+=b;return a.substring(c,h)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(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 h=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,h);do{var p=
|
||||
g(a);if("IDAT"==f(a,4)){e=a.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(h-8,a.length);break}e+=a.substring(h-8,h-4+p);f(a,p);f(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?
|
||||
atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&
|
||||
"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var g=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){try{a.handleCustomLink(b)}catch(I){a.handleError(I)}};this.isOffline()||
|
||||
"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a};var g=EditorUi.prototype.init;EditorUi.prototype.init=function(){"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){try{a.handleCustomLink(b)}catch(H){a.handleError(H)}};this.isOffline()||
|
||||
"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var c=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var d=0;d<a.pages.length;d++)if(a.pages[d]==a.currentPage){0<d&&(b+=(0<b.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return c.apply(this,arguments)};var d=b.addClickHandler;b.addClickHandler=
|
||||
function(a,c,e){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null==c||!b.isCustomLink(c)||!mxEvent.isTouchEvent(a)&&mxEvent.isPopupTrigger(a)||(b.customLinkClicked(c),mxEvent.consume(a));null!=f&&f(a,c)};d.call(this,a,c,e)};g.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=
|
||||
a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var e=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:e.apply(this,arguments)};var h=b.createLinkForHint;b.createLinkForHint=function(a,c){null!=a&&b.isCustomLink(a)&&(c=b.getLinkTitle(a));var d=h.call(this,a,c);null!=a&&b.isCustomLink(a)&&mxEvent.addListener(d,
|
||||
|
@ -7424,14 +7424,14 @@ c.getTitle()?c.getTitle():b);return b};var l=this.actions.get("print");l.setEnab
|
|||
0);p.style.width="1px";p.style.height="1px";p.innerHTML=" ";var A=!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)||
|
||||
A||(p.style.left=b.container.scrollLeft+10+"px",p.style.top=b.container.scrollTop+10+"px",b.container.appendChild(p),A=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){p.focus();document.execCommand("selectAll",!1,null)},0):(p.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(){!A||224!=c&&17!=c&&91!=c||(A=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),
|
||||
p.parentNode.removeChild(p),mxUtils.clearSelection())}),0)}));mxEvent.addListener(p,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(p),C())}));mxEvent.addListener(p,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(this.copyCells(p,!0),C())}));mxEvent.addListener(p,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(p.innerHTML=" ",p.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,p);p.innerHTML=
|
||||
" "}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==p?!0:F.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!=
|
||||
" "}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==p?!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,e,f,g){b.insertImage(a,
|
||||
f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),
|
||||
d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){l=document.createElement("div");l.style.position="absolute";
|
||||
l.style.top="95px";l.style.left="250px";l.style.width="2000px";l.style.height="30px";l.style.background="whiteSmoke";document.body.appendChild(l);var B=document.createElement("div");B.style.position="absolute";B.style.top="125px";B.style.left="220px";B.style.width="30px";B.style.height="1000px";B.style.background="whiteSmoke";document.body.appendChild(B);var x=document.createElement("div");x.style.position="absolute";x.style.top="95px";x.style.left="220px";x.style.width="30px";x.style.height="30px";
|
||||
x.style.background="whiteSmoke";document.body.appendChild(x);this.vRuler=new mxRuler(this.editor.graph,B,!0);this.hRuler=new mxRuler(this.editor.graph,l,!1)}if("1"==urlParams.test){l=document.getElementById("geFooter");null!=l&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",
|
||||
l.style.top="95px";l.style.left="250px";l.style.width="2000px";l.style.height="30px";l.style.background="whiteSmoke";document.body.appendChild(l);var B=document.createElement("div");B.style.position="absolute";B.style.top="125px";B.style.left="220px";B.style.width="30px";B.style.height="1000px";B.style.background="whiteSmoke";document.body.appendChild(B);var w=document.createElement("div");w.style.position="absolute";w.style.top="95px";w.style.left="220px";w.style.width="30px";w.style.height="30px";
|
||||
w.style.background="whiteSmoke";document.body.appendChild(w);this.vRuler=new mxRuler(this.editor.graph,B,!0);this.hRuler=new mxRuler(this.editor.graph,l,!1)}if("1"==urlParams.test){l=document.getElementById("geFooter");null!=l&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",
|
||||
this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),l.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility=
|
||||
"visible"}else this.styleInput.style.visibility="hidden"})));var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:E.apply(this,arguments)}}l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var y=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=y&&(y.parentNode.removeChild(y),y=null),a.stopPropagation(),a.preventDefault())});
|
||||
"visible"}else this.styleInput.style.visibility="hidden"})));var J=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:J.apply(this,arguments)}}l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var y=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=y&&(y.parentNode.removeChild(y),y=null),a.stopPropagation(),a.preventDefault())});
|
||||
mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==y&&(!mxClient.IS_IE||10<document.documentMode)&&(y=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=y&&(y.parentNode.removeChild(y),y=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale,
|
||||
f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var h=
|
||||
a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=h;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(h=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(h=c[0].getAttribute("href")));var m=!0,n=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(h,f,g,!0,p,null,m))});p&&h.length>this.resampleThreshold?this.confirmImageResize(function(a){m=a;n()},mxEvent.isControlDown(a)):
|
||||
|
@ -7464,36 +7464,36 @@ null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};Edito
|
|||
this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?
|
||||
this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,scale:b.view.scale,page:b.view.getBackgroundPageBounds(),bounds:b.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a,
|
||||
b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,f);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&
|
||||
(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source==(window.opener||window.parent)){var p=f.data;if("json"==urlParams.proto){try{p=JSON.parse(p)}catch(G){p=null}if(null==p)return;if("dialog"==p.action){this.showError(null!=p.titleKey?mxResources.get(p.titleKey):p.title,null!=p.messageKey?mxResources.get(p.messageKey):p.message,null!=p.buttonKey?mxResources.get(p.buttonKey):p.button);null!=p.modified&&
|
||||
(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(L){}return a}if(f.source==(window.opener||window.parent)){var p=f.data;if("json"==urlParams.proto){try{p=JSON.parse(p)}catch(F){p=null}if(null==p)return;if("dialog"==p.action){this.showError(null!=p.titleKey?mxResources.get(p.titleKey):p.title,null!=p.messageKey?mxResources.get(p.messageKey):p.message,null!=p.buttonKey?mxResources.get(p.buttonKey):p.button);null!=p.modified&&
|
||||
(this.editor.modified=p.modified);return}if("prompt"==p.action){this.spinner.stop();var k=new FilenameDialog(this,p.defaultValue||"",null!=p.okKey?mxResources.get(p.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:p}),"*")},null!=p.titleKey?mxResources.get(p.titleKey):p.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==p.action){k=null;k="data:image/png;base64,"==p.xml.substring(0,22)?this.extractGraphModelFromPng(p.xml):h(p.xml);
|
||||
this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[p.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:p}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:p}),"*")}),p.editKey?mxResources.get(p.editKey):null,p.discardKey?mxResources.get(p.discardKey):null,p.ignore?mxUtils.bind(this,function(){this.hideDialog();
|
||||
g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:p}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(G){g.postMessage(JSON.stringify({event:"draft",error:G.toString(),message:p}),"*")}return}if("template"==p.action){this.spinner.stop();var k=1==p.enableRecent,m=1==p.enableSearch,k=new NewDialog(this,!1,null!=p.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=p.callback?
|
||||
g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:p}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(F){g.postMessage(JSON.stringify({event:"draft",error:F.toString(),message:p}),"*")}return}if("template"==p.action){this.spinner.stop();var k=1==p.enableRecent,m=1==p.enableSearch,k=new NewDialog(this,!1,null!=p.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=p.callback?
|
||||
g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.recentReadyCallback=a;g.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",
|
||||
docUrl:a,info:b,name:c}),"*")});this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("searchDocsList"==p.action)this.searchReadyCallback(p.list,p.errorMsg);else if("recentDocsList"==p.action)this.recentReadyCallback(p.list,p.errorMsg);else{if("status"==p.action){null!=p.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(p.messageKey))):null!=p.message&&this.editor.setStatus(mxUtils.htmlEntities(p.message));
|
||||
null!=p.modified&&(this.editor.modified=p.modified);return}if("spinner"==p.action){var l=null!=p.messageKey?mxResources.get(p.messageKey):p.message;null==p.show||p.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==p.action){if("png"==p.format||"xmlpng"==p.format){if(null==p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin)){var n=null!=p.xml?p.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var t=this.editor.graph,
|
||||
q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=p.format;b.message=p;b.data=a;b.xml=encodeURIComponent(n);g.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==p.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.graph.compress(n))));t!=this.editor.graph&&t.container.parentNode.removeChild(t.container);q(a)});if(this.isExportToCanvas()){if(null!=
|
||||
this.pages&&this.currentPage!=this.pages[0]){var t=this.createTemporaryGraph(t.getStylesheet()),u=t.getGlobalVariable,z=this.pages[0];t.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(t.container);t.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,t)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
|
||||
("xmlpng"==p.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=p.xml&&0<p.xml.length&&this.setFileData(p.xml);l=this.createLoadMessage("export");if("html2"==p.format||"html"==p.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=
|
||||
null!=p.modified&&(this.editor.modified=p.modified);return}if("spinner"==p.action){var l=null!=p.messageKey?mxResources.get(p.messageKey):p.message;null==p.show||p.show?this.spinner.spin(document.body,l):this.spinner.stop();return}if("export"==p.action){if("png"==p.format||"xmlpng"==p.format){if(null==p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin)){var n=null!=p.xml?p.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=p.format;b.message=p;b.data=a;b.xml=encodeURIComponent(n);g.postMessage(JSON.stringify(b),"*")}),v=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==p.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(this.editor.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()),u=q.getGlobalVariable,z=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?z.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(z.root)}this.exportToCanvas(mxUtils.bind(this,function(a){v(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){v(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
|
||||
("xmlpng"==p.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()):v(null)}),mxUtils.bind(this,function(){v(null)}))}}else{null!=p.xml&&0<p.xml.length&&this.setFileData(p.xml);l=this.createLoadMessage("export");if("html2"==p.format||"html"==p.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),l.xml=mxUtils.getXml(k),l.data=
|
||||
this.getFileData(null,null,!0,null,null,null,k),l.format=p.format;else if("html"==p.format)n=this.editor.getGraphXml(),l.data=this.getHtml(n,this.editor.graph),l.xml=mxUtils.getXml(n),l.format=p.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);l.xml=this.getFileData(!0);l.format="svg";if(p.embedImages||null==p.embedImages){if(null==p.spin&&null==p.spinKey||this.spinner.spin(document.body,null!=p.spinKey?mxResources.get(p.spinKey):p.spin))this.editor.graph.setEnabled(!1),
|
||||
"xmlsvg"==p.format?this.getEmbeddedSvg(l.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(l),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();l.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(l),"*")}));return}k="xmlsvg"==p.format?this.getEmbeddedSvg(this.getFileData(!0),
|
||||
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));l.data=this.createSvgDataUri(k)}g.postMessage(JSON.stringify(l),"*")}return}if("load"==p.action)d=1==p.autosave,this.hideDialog(),null!=p.modified&&null==urlParams.modified&&(urlParams.modified=p.modified),null!=p.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=p.saveAndExit),null!=p.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,p.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
|
||||
"12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),p=null!=p.xmlpng?this.extractGraphModelFromPng(p.xmlpng):null!=p.xml&&"data:image/png;base64,"==p.xml.substring(0,22)?this.extractGraphModelFromPng(p.xml):p.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",
|
||||
data:JSON.stringify(p)}),"*");return}}}p=h(p);c=!0;try{a(p,f)}catch(G){this.handleError(G)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var w=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=w();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=w();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,
|
||||
data:JSON.stringify(p)}),"*");return}}}p=h(p);c=!0;try{a(p,f)}catch(F){this.handleError(F)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var x=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=x();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=x();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,
|
||||
"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
|
||||
b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?
|
||||
"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),
|
||||
mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight=
|
||||
"20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),
|
||||
null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,h="",k="auto",p="auto",m=null,l=null,B=40,x=40,E=0,y=this.editor.graph;y.getGraphBounds();for(var D=function(){null!=b?b(aa):(y.setSelectionCells(aa),y.scrollCellToVisible(y.getSelectionCell()))},I=y.getFreeInsertPoint(),z=I.x,J=I.y,I=J,G=null,
|
||||
L="auto",M=[],X=null,Z=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var O=mxUtils.trim(a.substring(1,S)),H=mxUtils.trim(a.substring(S+1));"label"==O?G=y.sanitizeHtml(H):"style"==O?f=H:"identity"==O&&0<H.length&&"-"!=H?g=H:"namespace"==O&&0<H.length&&"-"!=H?h=H:"width"==O?k=H:"height"==O?p=H:"left"==O&&0<H.length?
|
||||
m=H:"top"==O&&0<H.length?l=H:"ignore"==O?Z=H.split(","):"connect"==O?M.push(JSON.parse(H)):"link"==O?X=H:"padding"==O?E=parseFloat(H):"edgespacing"==O?B=parseFloat(H):"nodespacing"==O?x=parseFloat(H):"layout"==O&&(L=H)}}}var W=this.editor.csvToArray(c[N]),S=null;if(null!=g)for(var R=0;R<W.length;R++)if(g==W[R]){S=R;break}null==G&&(G="%"+W[0]+"%");if(null!=M)for(var T=0;T<M.length;T++)null==e[M[T].to]&&(e[M[T].to]={});y.model.beginUpdate();try{for(R=N+1;R<c.length;R++){var V=this.editor.csvToArray(c[R]);
|
||||
if(V.length==W.length){var K=null,Q=null!=S?h+V[S]:null;null!=Q&&(K=y.model.getCell(Q));null==K&&(K=new mxCell(G,new mxGeometry(z,I,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=Q);for(var P=0;P<V.length;P++)y.setAttributeForCell(K,W[P],V[P]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(T=0;T<M.length;T++)e[M[T].to][K.getAttribute(M[T].to)]=K;null!=X&&"link"!=X&&(y.setLinkForCell(K,K.getAttribute(X)),y.setAttributeForCell(K,X,null));y.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[K]));var ba=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=m&&null!=K.getAttribute(m)&&(K.geometry.x=z+parseFloat(K.getAttribute(m))),null!=l&&null!=K.getAttribute(l)&&(K.geometry.y=J+parseFloat(K.getAttribute(l))),"@"==k.charAt(0)&&null!=K.getAttribute(k.substring(1))?K.geometry.width=parseFloat(K.getAttribute(k.substring(1))):K.geometry.width="auto"==k?ba.width+E:parseFloat(k),"@"==p.charAt(0)&&null!=K.getAttribute(p.substring(1))?K.geometry.height=parseFloat(K.getAttribute(p.substring(1))):
|
||||
K.geometry.height="auto"==p?ba.height+E:parseFloat(p),I+=K.geometry.height+x);d.push(y.addCell(K))}}for(var U=d.slice(),aa=d.slice(),T=0;T<M.length;T++)for(var Y=M[T],R=0;R<d.length;R++){var K=d[R],ia=K.getAttribute(Y.from);if(null!=ia){y.setAttributeForCell(K,Y.from,null);for(var ja=ia.split(","),P=0;P<ja.length;P++){var ca=e[Y.to][ja[P]];null!=ca&&(G=Y.label,null!=Y.fromlabel&&(G=(K.getAttribute(Y.fromlabel)||"")+(G||"")),null!=Y.tolabel&&(G=(G||"")+(ca.getAttribute(Y.tolabel)||"")),aa.push(y.insertEdge(null,
|
||||
null,G||"",Y.invert?ca:K,Y.invert?K:ca,Y.style||y.createCurrentEdgeStyle())),mxUtils.remove(Y.invert?K:ca,U))}}}if(null!=Z)for(R=0;R<d.length;R++)for(K=d[R],P=0;P<Z.length;P++)y.setAttributeForCell(K,mxUtils.trim(Z[P]),null);var fa=new mxParallelEdgeLayout(y);fa.spacing=B;var ka=function(){fa.execute(y.getDefaultParent());for(var a=0;a<d.length;a++){var b=y.getCellGeometry(d[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==k&&(b.width=Math.round(y.snap(b.width)));"auto"==p&&(b.height=
|
||||
Math.round(y.snap(b.height)))}};if("circle"==L){var da=new mxCircleLayout(y);da.resetEdges=!1;var la=da.isVertexIgnored;da.isVertexIgnored=function(a){return la.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ka()},!0,D);D=null}else if("horizontaltree"==L||"verticaltree"==L||"auto"==L&&aa.length==2*d.length-1&&1==U.length){y.view.validate();var ga=new mxCompactTreeLayout(y,"horizontaltree"==L);ga.levelDistance=x;ga.edgeRouting=!1;ga.resetEdges=
|
||||
!1;this.executeLayout(function(){ga.execute(y.getDefaultParent(),0<U.length?U[0]:null)},!0,D);D=null}else if("horizontalflow"==L||"verticalflow"==L||"auto"==L&&1==U.length){y.view.validate();var ha=new mxHierarchicalLayout(y,"horizontalflow"==L?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=x;ha.disableEdgeStyle=!1;this.executeLayout(function(){ha.execute(y.getDefaultParent(),aa);y.moveCells(aa,z,J)},!0,D);D=null}else if("organic"==L||"auto"==L&&aa.length>d.length){y.view.validate();
|
||||
var ea=new mxFastOrganicLayout(y);ea.forceConstant=3*x;ea.resetEdges=!1;var na=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(d,a)};fa=new mxParallelEdgeLayout(y);fa.spacing=B;this.executeLayout(function(){ea.execute(y.getDefaultParent());ka()},!0,D);D=null}this.hideDialog()}finally{y.model.endUpdate()}null!=D&&D()}}catch(ma){this.handleError(ma)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&
|
||||
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 e={},f=null,g=null,h="",k="auto",p="auto",m=null,l=null,B=40,w=40,J=0,y=this.editor.graph;y.getGraphBounds();for(var D=function(){null!=b?b(aa):(y.setSelectionCells(aa),y.scrollCellToVisible(y.getSelectionCell()))},H=y.getFreeInsertPoint(),z=H.x,I=H.y,H=I,F=null,
|
||||
L="auto",M=[],X=null,Z=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var S=a.indexOf(":");if(0<S){var O=mxUtils.trim(a.substring(1,S)),G=mxUtils.trim(a.substring(S+1));"label"==O?F=y.sanitizeHtml(G):"style"==O?f=G:"identity"==O&&0<G.length&&"-"!=G?g=G:"namespace"==O&&0<G.length&&"-"!=G?h=G:"width"==O?k=G:"height"==O?p=G:"left"==O&&0<G.length?
|
||||
m=G:"top"==O&&0<G.length?l=G:"ignore"==O?Z=G.split(","):"connect"==O?M.push(JSON.parse(G)):"link"==O?X=G:"padding"==O?J=parseFloat(G):"edgespacing"==O?B=parseFloat(G):"nodespacing"==O?w=parseFloat(G):"layout"==O&&(L=G)}}}var W=this.editor.csvToArray(c[N]),S=null;if(null!=g)for(var R=0;R<W.length;R++)if(g==W[R]){S=R;break}null==F&&(F="%"+W[0]+"%");if(null!=M)for(var T=0;T<M.length;T++)null==e[M[T].to]&&(e[M[T].to]={});y.model.beginUpdate();try{for(R=N+1;R<c.length;R++){var V=this.editor.csvToArray(c[R]);
|
||||
if(V.length==W.length){var K=null,Q=null!=S?h+V[S]:null;null!=Q&&(K=y.model.getCell(Q));null==K&&(K=new mxCell(F,new mxGeometry(z,H,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=Q);for(var P=0;P<V.length;P++)y.setAttributeForCell(K,W[P],V[P]);y.setAttributeForCell(K,"placeholders","1");K.style=y.replacePlaceholders(K,K.style);for(T=0;T<M.length;T++)e[M[T].to][K.getAttribute(M[T].to)]=K;null!=X&&"link"!=X&&(y.setLinkForCell(K,K.getAttribute(X)),y.setAttributeForCell(K,X,null));y.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[K]));var ba=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=m&&null!=K.getAttribute(m)&&(K.geometry.x=z+parseFloat(K.getAttribute(m))),null!=l&&null!=K.getAttribute(l)&&(K.geometry.y=I+parseFloat(K.getAttribute(l))),"@"==k.charAt(0)&&null!=K.getAttribute(k.substring(1))?K.geometry.width=parseFloat(K.getAttribute(k.substring(1))):K.geometry.width="auto"==k?ba.width+J:parseFloat(k),"@"==p.charAt(0)&&null!=K.getAttribute(p.substring(1))?K.geometry.height=parseFloat(K.getAttribute(p.substring(1))):
|
||||
K.geometry.height="auto"==p?ba.height+J:parseFloat(p),H+=K.geometry.height+w);d.push(y.addCell(K))}}for(var U=d.slice(),aa=d.slice(),T=0;T<M.length;T++)for(var Y=M[T],R=0;R<d.length;R++){var K=d[R],ia=K.getAttribute(Y.from);if(null!=ia){y.setAttributeForCell(K,Y.from,null);for(var ja=ia.split(","),P=0;P<ja.length;P++){var ca=e[Y.to][ja[P]];null!=ca&&(F=Y.label,null!=Y.fromlabel&&(F=(K.getAttribute(Y.fromlabel)||"")+(F||"")),null!=Y.tolabel&&(F=(F||"")+(ca.getAttribute(Y.tolabel)||"")),aa.push(y.insertEdge(null,
|
||||
null,F||"",Y.invert?ca:K,Y.invert?K:ca,Y.style||y.createCurrentEdgeStyle())),mxUtils.remove(Y.invert?K:ca,U))}}}if(null!=Z)for(R=0;R<d.length;R++)for(K=d[R],P=0;P<Z.length;P++)y.setAttributeForCell(K,mxUtils.trim(Z[P]),null);var fa=new mxParallelEdgeLayout(y);fa.spacing=B;var ka=function(){fa.execute(y.getDefaultParent());for(var a=0;a<d.length;a++){var b=y.getCellGeometry(d[a]);b.x=Math.round(y.snap(b.x));b.y=Math.round(y.snap(b.y));"auto"==k&&(b.width=Math.round(y.snap(b.width)));"auto"==p&&(b.height=
|
||||
Math.round(y.snap(b.height)))}};if("circle"==L){var da=new mxCircleLayout(y);da.resetEdges=!1;var la=da.isVertexIgnored;da.isVertexIgnored=function(a){return la.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){da.execute(y.getDefaultParent());ka()},!0,D);D=null}else if("horizontaltree"==L||"verticaltree"==L||"auto"==L&&aa.length==2*d.length-1&&1==U.length){y.view.validate();var ga=new mxCompactTreeLayout(y,"horizontaltree"==L);ga.levelDistance=w;ga.edgeRouting=!1;ga.resetEdges=
|
||||
!1;this.executeLayout(function(){ga.execute(y.getDefaultParent(),0<U.length?U[0]:null)},!0,D);D=null}else if("horizontalflow"==L||"verticalflow"==L||"auto"==L&&1==U.length){y.view.validate();var ha=new mxHierarchicalLayout(y,"horizontalflow"==L?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=w;ha.disableEdgeStyle=!1;this.executeLayout(function(){ha.execute(y.getDefaultParent(),aa);y.moveCells(aa,z,I)},!0,D);D=null}else if("organic"==L||"auto"==L&&aa.length>d.length){y.view.validate();
|
||||
var ea=new mxFastOrganicLayout(y);ea.forceConstant=3*w;ea.resetEdges=!1;var na=ea.isVertexIgnored;ea.isVertexIgnored=function(a){return na.apply(this,arguments)||0>mxUtils.indexOf(d,a)};fa=new mxParallelEdgeLayout(y);fa.spacing=B;this.executeLayout(function(){ea.execute(y.getDefaultParent());ka()},!0,D);D=null}this.hideDialog()}finally{y.model.endUpdate()}null!=D&&D()}}catch(ma){this.handleError(ma)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&
|
||||
null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&
|
||||
(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var h=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=h.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=
|
||||
this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*
|
||||
|
@ -7507,12 +7507,12 @@ this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.
|
|||
"4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b=
|
||||
"";break;case d.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b=
|
||||
'<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=e&&(this.offlineStatus.innerHTML=b,e=a)});mxEvent.addListener(d,"checking",b);mxEvent.addListener(d,"noupdate",b);mxEvent.addListener(d,"downloading",b);mxEvent.addListener(d,"progress",b);mxEvent.addListener(d,"cached",b);mxEvent.addListener(d,"updateready",b);mxEvent.addListener(d,"obsolete",b);mxEvent.addListener(d,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=
|
||||
function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile(),d=null!=c||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&
|
||||
c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);
|
||||
this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("find").setEnabled(d);this.actions.get("layers").setEnabled(d);this.actions.get("outline").setEnabled(d);
|
||||
this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var l=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=
|
||||
null);l.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,g){var f=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(f.getSvg(d,e,g)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null,null,!0),k=f.getGraphBounds(),p=Math.floor(k.width*e/f.view.scale),m=Math.floor(k.height*
|
||||
e/f.view.scale);h.length<=MAX_REQUEST_SIZE&&p*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+p+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);
|
||||
this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);
|
||||
this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);
|
||||
this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var l=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&
|
||||
(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);l.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,g){var f=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(f.getSvg(d,e,g)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null,
|
||||
null,!0),k=f.getGraphBounds(),p=Math.floor(k.width*e/f.view.scale),m=Math.floor(k.height*e/f.view.scale);h.length<=MAX_REQUEST_SIZE&&p*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+p+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
|
||||
|
@ -7788,7 +7788,7 @@ GitHubClient.prototype.getFile=function(a,b,c,d,e){d=null!=d?d:!1;var g=a.split(
|
|||
"/repos/"+h+"/"+m+"/contents/"+a+"?ref="+l,null,"GET"),this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.createGitHubFile(h,m,l,JSON.parse(a.getText()),d))}catch(k){c(k)}}),c))};
|
||||
GitHubClient.prototype.createGitHubFile=function(a,b,c,d,e){a={org:a,repo:b,ref:c,name:d.name,path:d.path,sha:d.sha,html_url:d.html_url,download_url:d.download_url};b=d.content;"base64"===d.encoding&&(/\.jpe?g$/i.test(d.name)?b="data:image/jpeg;base64,"+b:/\.gif$/i.test(d.name)?b="data:image/gif;base64,"+b:/\.png$/i.test(d.name)?(d=this.ui.extractGraphModelFromPng(b),b=null!=d&&0<d.length?d:"data:image/png;base64,"+b):b=Base64.decode(b));return e?new GitHubLibrary(this.ui,b,a):new GitHubFile(this.ui,
|
||||
b,a)};GitHubClient.prototype.insertLibrary=function(a,b,c,d,e){this.insertFile(a,b,c,d,!0,e,!1)};
|
||||
GitHubClient.prototype.insertFile=function(a,b,c,d,e,g,h){e=null!=e?e:!1;g=g.split("/");var m=g[0],l=g[1],f=g[2],k=g.slice(3,g.length).join("/");0<k.length&&(k+="/");k+=a;this.checkExists(m+"/"+l+"/"+f+"/"+k,!0,mxUtils.bind(this,function(g,t){g?e?(h||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,l,f,k,a,b,t,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());c(this.createGitHubFile(m,l,f,b.content,e))}catch(w){d(w)}}),d)}),d)):c(new GitHubFile(this.ui,
|
||||
GitHubClient.prototype.insertFile=function(a,b,c,d,e,g,h){e=null!=e?e:!1;g=g.split("/");var m=g[0],l=g[1],f=g[2],k=g.slice(3,g.length).join("/");0<k.length&&(k+="/");k+=a;this.checkExists(m+"/"+l+"/"+f+"/"+k,!0,mxUtils.bind(this,function(g,t){g?e?(h||(b=Base64.encode(b)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(m,l,f,k,a,b,t,mxUtils.bind(this,function(a){try{var b=JSON.parse(a.getText());c(this.createGitHubFile(m,l,f,b.content,e))}catch(x){d(x)}}),d)}),d)):c(new GitHubFile(this.ui,
|
||||
b,{org:m,repo:l,ref:f,name:a,path:k,sha:t,isNew:!0})):d()}))};GitHubClient.prototype.showCommitDialog=function(a,b,c,d){var e=this.ui.spinner.pause();a=new FilenameDialog(this.ui,mxResources.get(b?"addedFile":"updateFile",[a]),mxResources.get("ok"),mxUtils.bind(this,function(a){e();c(a)}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){d()}));this.ui.showDialog(a.container,300,80,!0,!1);a.init()};
|
||||
GitHubClient.prototype.writeFile=function(a,b,c,d,e,g,h,m,l){g.length>=this.maxFileSize?l({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(g.length)+" / 1 MB)"}):(c={path:d,branch:decodeURIComponent(c),message:e,content:g},null!=h&&(c.sha=h),a=new mxXmlRequest(this.baseUrl+"/repos/"+a+"/"+b+"/contents/"+d,JSON.stringify(c),"PUT"),this.executeRequest(a,mxUtils.bind(this,function(a){m(a)}),l))};
|
||||
GitHubClient.prototype.checkExists=function(a,b,c){this.getFile(a,mxUtils.bind(this,function(d){if(b&&null!=d.meta){var e=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[a]),function(){e();c(!0,d.meta.sha)},function(){e();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(a){c(!0)}),null,!0)};
|
||||
|
@ -7797,14 +7797,14 @@ mxResources.get("cancel"),mxUtils.bind(this,function(){c()}),null,mxResources.ge
|
|||
Base64.encode(a.getData()))}),mxUtils.bind(this,function(){c()}))};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
|
||||
GitHubClient.prototype.showGitHubDialog=function(a,b){var c=null,d=null,e=null,g=null,h=document.createElement("div");h.style.whiteSpace="nowrap";h.style.overflow="hidden";h.style.height="224px";var m=document.createElement("h3");mxUtils.write(m,mxResources.get(a?"selectFile":"selectFolder"));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";h.appendChild(m);var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="auto";l.style.height="194px";
|
||||
h.appendChild(l);var f=new CustomDialog(this.ui,h,mxUtils.bind(this,function(){b(c+"/"+d+"/"+encodeURIComponent(e)+"/"+g)}));this.ui.showDialog(f.container,340,270,!0,!0);a&&f.okButton.parentNode.removeChild(f.okButton);var k=mxUtils.bind(this,function(a,b){var c=document.createElement("a");c.setAttribute("href","javascript:void(0);");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);return c}),n=mxUtils.bind(this,function(a){var b=document.createElement("div");b.style.marginBottom="8px";b.appendChild(k(c+
|
||||
"/"+d,mxUtils.bind(this,function(){g=null;C()})));a||(mxUtils.write(b," / "),b.appendChild(k(decodeURIComponent(e),mxUtils.bind(this,function(){g=null;w()}))));if(null!=g&&0<g.length){var f=g.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(k(f[a],mxUtils.bind(this,function(){g=f.slice(0,a+1).join("/");u()})))})(a)}l.appendChild(b)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
|
||||
"/"+d,mxUtils.bind(this,function(){g=null;C()})));a||(mxUtils.write(b," / "),b.appendChild(k(decodeURIComponent(e),mxUtils.bind(this,function(){g=null;x()}))));if(null!=g&&0<g.length){var f=g.split("/");for(a=0;a<f.length;a++)(function(a){mxUtils.write(b," / ");b.appendChild(k(f[a],mxUtils.bind(this,function(){g=f.slice(0,a+1).join("/");u()})))})(a)}l.appendChild(b)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?
|
||||
(g=e=d=c=null,C()):this.ui.hideDialog()}))}),u=mxUtils.bind(this,function(){var h=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+d+"/contents/"+g+"?ref="+encodeURIComponent(e),null,"GET");f.okButton.removeAttribute("disabled");l.innerHTML="";this.ui.spinner.spin(l,mxResources.get("loading"));this.executeRequest(h,mxUtils.bind(this,function(f){n();this.ui.spinner.stop();var h=JSON.parse(f.getText());l.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==g)g=null,C();else{var a=g.split("/");
|
||||
g=a.slice(0,a.length-1).join("/");u()}})));mxUtils.br(l);null==h||0==h.length?mxUtils.write(l,mxResources.get("noFiles")):(f=mxUtils.bind(this,function(f){for(var p=0;p<h.length;p++)mxUtils.bind(this,function(h){f==("dir"==h.type)&&(l.appendChild(k(h.name+("dir"==h.type?"/":""),mxUtils.bind(this,function(){"dir"==h.type?(g=h.path,u()):a&&"file"==h.type&&(this.ui.hideDialog(),b(c+"/"+d+"/"+encodeURIComponent(e)+"/"+h.path))}))),mxUtils.br(l))})(h[p])}),f(!0),a&&f(!1))}),t)}),q=null,v=null,w=mxUtils.bind(this,
|
||||
g=a.slice(0,a.length-1).join("/");u()}})));mxUtils.br(l);null==h||0==h.length?mxUtils.write(l,mxResources.get("noFiles")):(f=mxUtils.bind(this,function(f){for(var p=0;p<h.length;p++)mxUtils.bind(this,function(h){f==("dir"==h.type)&&(l.appendChild(k(h.name+("dir"==h.type?"/":""),mxUtils.bind(this,function(){"dir"==h.type?(g=h.path,u()):a&&"file"==h.type&&(this.ui.hideDialog(),b(c+"/"+d+"/"+encodeURIComponent(e)+"/"+h.path))}))),mxUtils.br(l))})(h[p])}),f(!0),a&&f(!1))}),t)}),q=null,v=null,x=mxUtils.bind(this,
|
||||
function(a){null==a&&(l.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+d+"/branches?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(l,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(l,
|
||||
"scroll",v);w(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(n(!0),l.appendChild(k("../ [Up]",mxUtils.bind(this,function(){g=null;C()}))),mxUtils.br(l));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(l,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){l.appendChild(k(a.name,mxUtils.bind(this,function(){e=a.name;g="";u()})));mxUtils.br(l)})(b[c]);100==b.length&&(l.appendChild(q),
|
||||
"scroll",v);x(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(n(!0),l.appendChild(k("../ [Up]",mxUtils.bind(this,function(){g=null;C()}))),mxUtils.br(l));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(l,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a){l.appendChild(k(a.name,mxUtils.bind(this,function(){e=a.name;g="";u()})));mxUtils.br(l)})(b[c]);100==b.length&&(l.appendChild(q),
|
||||
v=function(){l.scrollTop>=l.scrollHeight-l.offsetHeight&&h()},mxEvent.addListener(l,"scroll",v))}}),t)}),C=mxUtils.bind(this,function(a){null==a&&(l.innerHTML="",a=1);var b=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");f.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(l,mxResources.get("loading"));null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");
|
||||
mxUtils.write(q,mxResources.get("more")+"...");var h=mxUtils.bind(this,function(){mxEvent.removeListener(l,"scroll",v);C(a+1)});mxEvent.addListener(q,"click",h);this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(l,mxResources.get("noFiles"));else{1==a&&(l.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,
|
||||
function(a){if(null!=a){var b=a.split("/");if(1<b.length){a=b[0];var f=b[1];3>b.length?(c=a,d=f,g=e=null,w()):this.ui.spinner.spin(l,mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+f+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();c=a.meta.org;d=a.meta.repo;e=decodeURIComponent(a.meta.ref);g="";u()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
|
||||
function(a){if(null!=a){var b=a.split("/");if(1<b.length){a=b[0];var f=b[1];3>b.length?(c=a,d=f,g=e=null,x()):this.ui.spinner.spin(l,mxResources.get("loading"))&&(b=encodeURIComponent(b.slice(2,b.length).join("/")),this.getFile(a+"/"+f+"/"+b,mxUtils.bind(this,function(a){this.ui.spinner.stop();c=a.meta.org;d=a.meta.repo;e=decodeURIComponent(a.meta.ref);g="";u()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),
|
||||
this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(l),mxUtils.br(l));for(var f=0;f<b.length;f++)mxUtils.bind(this,function(a){l.appendChild(k(a.full_name,mxUtils.bind(this,function(){c=a.owner.login;d=a.name;e=a.default_branch;g="";u()})));mxUtils.br(l)})(b[f])}100==b.length&&(l.appendChild(q),v=function(){l.scrollTop>=l.scrollHeight-l.offsetHeight&&h()},mxEvent.addListener(l,"scroll",
|
||||
v))}),t)});C()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,b,c){DrawioFile.call(this,a,b);this.meta=c;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};
|
||||
TrelloFile.prototype.save=function(a,b,c){this.doSave(this.getTitle(),b,c)};TrelloFile.prototype.saveAs=function(a,b,c){this.doSave(a,b,c)};TrelloFile.prototype.doSave=function(a,b,c){var d=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=d;this.saveFile(a,!1,b,c)};
|
||||
|
@ -7855,7 +7855,7 @@ null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.o
|
|||
urlParams.tr)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:",
|
||||
"1"==urlParams.test?"active":"inactive"))},function(a){document.getElementById("geStatus").innerHTML='Error loading page. <a href="javascript:void(0);">Please try refreshing.</a>';document.getElementById("geStatus").getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}})}var d=null;EditorUi.enableLogging&&(window.onerror=function(a,b,c,e,g){try{if(a!=d&&(null==a||null==b||-1==
|
||||
a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){d=a;var f=new Image,h=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";f.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+h+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+
|
||||
(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=g&&null!=g.stack?"&stack="+encodeURIComponent(g.stack):"")}}catch(w){}});if(null!=window.mxscript){if("1"==urlParams.offline||"1"==urlParams.appcache){mxscript("js/shapes.min.js");mxscript("js/stencils.min.js");mxscript("js/extensions.min.js");var e=document.createElement("iframe");e.setAttribute("width","0");e.setAttribute("height","0");e.setAttribute("src","offline.html");document.body.appendChild(e)}if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var e=
|
||||
(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=g&&null!=g.stack?"&stack="+encodeURIComponent(g.stack):"")}}catch(x){}});if(null!=window.mxscript){if("1"==urlParams.offline||"1"==urlParams.appcache){mxscript("js/shapes.min.js");mxscript("js/stencils.min.js");mxscript("js/extensions.min.js");var e=document.createElement("iframe");e.setAttribute("width","0");e.setAttribute("height","0");e.setAttribute("src","offline.html");document.body.appendChild(e)}if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var e=
|
||||
mxSettings.getPlugins(),g=urlParams.p;App.initPluginCallback();if(null!=g){var h="";"1"==urlParams.drawdev&&(h=document.location.protocol+"//drawhost.jgraph.com/");for(var m=g.split(";"),g=0;g<m.length;g++){var l=App.pluginRegistry[m[g]];null!=l?mxscript(h+l):null!=window.console&&console.log("Unknown plugin:",m[g])}}else"0"==urlParams.chrome||EditorUi.isElectronApp||mxscript(App.FOOTER_PLUGIN_URL,null,null,null,mxClient.IS_SVG);if(null!=e&&0<e.length&&"0"!=urlParams.plugins){h=window.location.protocol+
|
||||
"//"+window.location.host;m=!0;for(g=0;g<e.length&&m;g++)"/"!=e[g].charAt(0)&&e[g].substring(0,h.length)!=h&&(m=!1);if(m||mxUtils.confirm(mxResources.replacePlaceholders("The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n",[e.join("\n")]).replace(/\\n/g,"\n")))for(g=0;g<e.length;g++)try{mxscript(e[g])}catch(f){}}}"function"===typeof window.DriveClient&&
|
||||
"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,
|
||||
|
@ -7891,7 +7891,7 @@ App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxVie
|
|||
App.prototype.getThumbnail=function(a,b){var c=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var d=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),e=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}if(mxClient.IS_CHROMEAPP||!d.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
|
||||
function(a){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);b(a)}),a,this.thumbImageCache,"#ffffff",function(){b()},null,null,null,null,null,null,d),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var h=document.createElement("canvas"),m=d.getGraphBounds(),l=a/m.width,l=Math.min(1,Math.min(3*a/(4*m.height),l)),f=Math.floor(m.x),k=Math.floor(m.y);h.setAttribute("width",Math.ceil(l*(m.width+4)));h.setAttribute("height",Math.ceil(l*(m.height+4)));var n=h.getContext("2d");
|
||||
n.scale(l,l);n.translate(-f,-k);var t=d.background;if(null==t||""==t||t==mxConstants.NONE)t="#ffffff";n.save();n.fillStyle=t;n.fillRect(f,k,Math.ceil(m.width+4),Math.ceil(m.height+4));n.restore();var u=new mxJsCanvas(h),q=new mxAsyncCanvas(this.thumbImageCache);u.images=this.thumbImageCache.images;var v=new mxImageExport;v.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};v.drawText=function(a,
|
||||
b){};v.drawState(d.getView().getState(d.model.root),q);q.finish(mxUtils.bind(this,function(){v.drawState(d.getView().getState(d.model.root),u);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);b(h)}));c=!0}}catch(w){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}return c};
|
||||
b){};v.drawState(d.getView().getState(d.model.root),q);q.finish(mxUtils.bind(this,function(){v.drawState(d.getView().getState(d.model.root),u);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);b(h)}));c=!0}}catch(x){d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}return c};
|
||||
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
|
||||
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(b,c){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(c)if(isLocalStorage)localStorage.setItem(".mode",b);else if("undefined"!=typeof Storage){var d=new Date;d.setYear(d.getFullYear()+1);document.cookie="MODE="+b+"; expires="+d.toUTCString()}null!=this.appIcon&&(d=this.getCurrentFile(),b=null!=d?d.getMode():null,b==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
|
||||
[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):b==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):b==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default"))}})();
|
||||
|
@ -7959,7 +7959,7 @@ App.prototype.getLibraryStorageHint=function(a){var b=a.getTitle();a.constructor
|
|||
mxResources.get("browser")+")":a.constructor==LocalLibrary&&(b+=" ("+mxResources.get("device")+")");return b};
|
||||
App.prototype.restoreLibraries=function(){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var a=mxUtils.bind(this,function(a){mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=mxUtils.bind(this,function(b,d){var c=0,g=[],h=mxUtils.bind(this,function(){if(0==c){if(null!=b)for(var a=b.length-1;0<=a;a--)null!=g[a]&&this.loadLibrary(g[a]);null!=d&&d()}});if(null!=b)for(var m=0;m<b.length;m++){var l=encodeURIComponent(decodeURIComponent(b[m]));mxUtils.bind(this,
|
||||
function(b,d){if(null!=b&&0<b.length&&null==this.pendingLibraries[b]&&null==this.sidebar.palettes[b]){c++;var e=mxUtils.bind(this,function(a){delete this.pendingLibraries[b];g[d]=a;c--;h()}),f=mxUtils.bind(this,function(){a(b);c--;h()});this.pendingLibraries[b]=!0;var k=b.substring(0,1);if("L"==k)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var a=decodeURIComponent(b.substring(1));this.getLocalData(a,mxUtils.bind(this,function(b){".scratchpad"==a&&null==
|
||||
b&&(b=this.emptyLibraryXml);null!=b?e(new StorageLibrary(this,b,a)):f()}))}catch(C){f()}}),0);else if("U"==k){var m=decodeURIComponent(b.substring(1));if(!this.isOffline()){k=m;this.isCorsEnabledForUrl(k)||(k="t="+(new Date).getTime(),k=PROXY_URL+"?url="+encodeURIComponent(m)+"&"+k);try{mxUtils.get(k,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{e(new UrlLibrary(this,a.getText(),m))}catch(C){f()}else f()}),function(){f()})}catch(w){f()}}}else{var l=null;"G"==k?null!=
|
||||
b&&(b=this.emptyLibraryXml);null!=b?e(new StorageLibrary(this,b,a)):f()}))}catch(C){f()}}),0);else if("U"==k){var m=decodeURIComponent(b.substring(1));if(!this.isOffline()){k=m;this.isCorsEnabledForUrl(k)||(k="t="+(new Date).getTime(),k=PROXY_URL+"?url="+encodeURIComponent(m)+"&"+k);try{mxUtils.get(k,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus())try{e(new UrlLibrary(this,a.getText(),m))}catch(C){f()}else f()}),function(){f()})}catch(x){f()}}}else{var l=null;"G"==k?null!=
|
||||
this.drive&&null!=this.drive.user&&(l=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(l=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(l=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(l=this.dropbox):"W"==k&&null!=this.oneDrive&&null!=this.oneDrive.getUser()&&(l=this.oneDrive);null!=l?l.getLibrary(decodeURIComponent(b.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(C){f()}}),function(a){f()}):(delete this.pendingLibraries[b],
|
||||
f())}}})(l,m)}h()});b(mxSettings.getCustomLibraries(),function(){b((urlParams.clibs||"").split(";"))})}};
|
||||
App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile?null==this.shareButton&&(this.shareButton=document.createElement("div"),this.shareButton.className="geBtn gePrimaryBtn",this.shareButton.style.display="inline-block",this.shareButton.style.padding="0 10px 0 10px",this.shareButton.style.marginTop="-4px",this.shareButton.style.height="28px",this.shareButton.style.lineHeight="28px",this.shareButton.style.minWidth=
|
||||
|
@ -8043,67 +8043,68 @@ null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mx
|
|||
b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,d){if(!mxClient.IS_CHROMEAPP&&
|
||||
a.isOffline())this.addMenuItems(b,["about"],d);else{var e=b.addItem("Search:",null,null,d,null,null,!1);e.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";e.style.cursor="default";var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","25");f.style.marginLeft="8px";mxEvent.addListener(f,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(f.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+
|
||||
encodeURIComponent(b)),f.value="",this.editorUi.logEvent({category:"Help",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(f.value="")}));e.firstChild.nextSibling.appendChild(f);mxEvent.addGestureListeners(f,function(a){document.activeElement!=f&&f.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){f.focus()},0);this.addMenuItems(b,
|
||||
["-","quickStart","userManual","keyboardShortcuts","-"],d);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],d);this.addMenuItems(b,["support","-"],d);a.isOffline()||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],d);a.isOfflineApp()||"1"==urlParams.embed||this.addMenuItems(b,["offline"],d);this.addMenuItems(b,["-","about"],d)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);
|
||||
this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",
|
||||
mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],d));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=c.getGraphBounds(),b=c.view.translate,e=c.view.scale;c.insertVertex(d,
|
||||
null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){c.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+c.compress(mxUtils.getXml(c.encodeCells(c.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],d),mxResources.parse("testXmlImageExport=XML Image Export"),
|
||||
this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=c.getGraphBounds(),d=c.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/d),Math.floor((1-b.y)/d));e.scale(1/d);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var k=e.restore;e.restore=function(){g--;k.apply(this,arguments)};var p=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",
|
||||
a,g);p.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(c.getView().getState(c.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],d),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&
|
||||
null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&
|
||||
a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&
|
||||
null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],d),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-","testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,
|
||||
!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(c.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+
|
||||
"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,p,m){a.createHtml(b,c,d,e,f,g,h,k,p,m,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");
|
||||
d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft="26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+
|
||||
window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&
|
||||
a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();
|
||||
b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);
|
||||
b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=c.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-c.view.translate.y)/c.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),
|
||||
function(p){a.spinner.stop();p=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+h+";height:"+k+';" src="'+a.createLink(b,c,d,e,f,g,p)+'"></iframe>');a.showDialog(p.container,440,240,!0,!0);p.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(h){a.spinner.stop();h=new EmbedDialog(a,
|
||||
a.createLink(b,c,d,e,f,g,h));a.showDialog(h.container,440,240,!0,!0);h.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)k=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),
|
||||
k.setToggleAction(!0),k.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});k=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=
|
||||
function(b){c.isEditing()&&c.stopEditing();var d="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=d;b&&(e.exit=!0);d=JSON.stringify(e)}(window.opener||window.parent).postMessage(d,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),
|
||||
a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,
|
||||
["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],
|
||||
c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=k(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),
|
||||
c="image/svg+xml");g(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var g=mxUtils.bind(this,function(b,d,e){var f=c.view,g=c.getGraphBounds(),h=c.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*c.gridSize)),k=c.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*c.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,
|
||||
b,mxUtils.bind(this,function(f,m,l){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/l)):1;a.importFile(b,d,h,k,Math.round(m*f),Math.round(l*f),e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}),g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,d,h,k,0,0,e,function(b){a.spinner.stop();c.setSelectionCells(b);
|
||||
c.scrollCellToVisible(c.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+
|
||||
"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,
|
||||
function(){e(a.trello)},d):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),
|
||||
function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){g(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=g;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),
|
||||
null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();
|
||||
a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));k=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,
|
||||
c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;
|
||||
a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));k.isEnabled=function(){return this.enabled&&g.apply(this,arguments)};k.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",
|
||||
[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,
|
||||
function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),
|
||||
mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));
|
||||
this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));
|
||||
var v=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml)&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},w=function(a,b,d,e){var f=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,d),e);a.vertex=
|
||||
!0;c.getModel().beginUpdate();try{a=c.addCell(a),c.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{c.getModel().endUpdate()}c.scrollCellToVisible(a);c.setSelectionCell(a);c.container.focus();c.editAfterInsert&&c.startEditing(a);return a};a.actions.addAction("insertText",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&c.startEditingAtCell(w("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},
|
||||
null,null,Editor.ctrlKey+"+Shift+X").isEnabled=g;a.actions.addAction("insertRectangle",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&w("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=g;a.actions.addAction("insertEllipse",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&w("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=g;a.actions.addAction("insertRhombus",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&
|
||||
w("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=g;var C=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):v(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);C(b,c,["fromText","plantUml",
|
||||
"-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){C(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+
|
||||
mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},
|
||||
c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,
|
||||
function(){a.pickFile(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=
|
||||
new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&
|
||||
(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,
|
||||
App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},
|
||||
c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&
|
||||
"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,
|
||||
!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=
|
||||
b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(y){a.handleError(y,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,
|
||||
!0);b.init()},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||
|
||||
mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&
|
||||
isLocalStorage&&this.addMenuItems(b,["showStartScreen"],c);a.isOfflineApp()||"1"==urlParams.embed||this.addMenuItem(b,"plugins",c);b.addSeparator(c);this.addMenuItem(b,"tags",c)})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,
|
||||
"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",
|
||||
b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);
|
||||
this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var c=Menus.prototype.menuCreated;
|
||||
Menus.prototype.menuCreated=function(a,b){if(480>=screen.width&&a==this.get("help")){b.style.paddingRight="0px";b.style.paddingLeft="0px";b.innerHTML="";var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);b.appendChild(d)}c.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
["-","quickStart","userManual","keyboardShortcuts","-"],d);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],d);this.addMenuItems(b,["support","-"],d);a.isOffline()||EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],d);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["offline"],d);this.addMenuItems(b,["-","about"],d)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",
|
||||
mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),
|
||||
mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],d));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,
|
||||
function(){var a=c.getGraphBounds(),b=c.view.translate,e=c.view.scale;c.insertVertex(d,null,"",a.x/e-b.x,a.y/e-b.y,a.width/e,a.height/e,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){c.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+c.compress(mxUtils.getXml(c.encodeCells(c.getSelectionCells())))+"', width, height, 'Title');"))})),
|
||||
this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],d),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=c.getGraphBounds(),d=c.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-b.x)/d),Math.floor((1-b.y)/d));e.scale(1/d);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var k=
|
||||
e.restore;e.restore=function(){g--;k.apply(this,arguments)};var p=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);p.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(c.getView().getState(c.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),this.addMenuItems(b,["testXmlImageExport"],d),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),
|
||||
this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",
|
||||
mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&
|
||||
299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],d),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-",
|
||||
"testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(c.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,
|
||||
b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,g,h,k,p,m){a.createHtml(b,c,d,e,f,g,h,k,p,m,mxUtils.bind(this,function(b,c){var d=
|
||||
new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft=
|
||||
"26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},
|
||||
20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+
|
||||
"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,
|
||||
g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=c.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),
|
||||
null,"100%",Math.ceil((b.y+b.height-c.view.translate.y)/c.view.scale)+2,function(b,c,d,e,f,g,h,k){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(p){a.spinner.stop();p=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+h+";height:"+k+';" src="'+a.createLink(b,c,d,e,f,g,p)+'"></iframe>');a.showDialog(p.container,440,240,!0,!0);p.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,
|
||||
null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(h){a.spinner.stop();h=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,h));a.showDialog(h.container,440,240,!0,!0);h.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();
|
||||
b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)k=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),k.setToggleAction(!0),k.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});k=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&
|
||||
(mxSettings.settings.search=!b,mxSettings.save())});k.setToggleAction(!0);k.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){c.isEditing()&&c.stopEditing();var d="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=d;b&&(e.exit=!0);d=JSON.stringify(e)}(window.opener||window.parent).postMessage(d,
|
||||
"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),
|
||||
null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||
|
||||
this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(b,
|
||||
d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=k(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");g(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var g=mxUtils.bind(this,function(b,d,e){var f=c.view,g=c.getGraphBounds(),h=c.snap(Math.ceil(Math.max(0,
|
||||
g.x/f.scale-f.translate.x)+4*c.gridSize)),k=c.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*c.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,m,l){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/l)):1;a.importFile(b,d,h,k,Math.round(m*f),Math.round(l*f),e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}),
|
||||
g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,d,h,k,0,0,e,function(b){a.spinner.stop();c.setSelectionCells(b);c.scrollCellToVisible(c.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=
|
||||
typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},d):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
|
||||
d,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},d):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);b.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
|
||||
"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(b.addSeparator(d),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){g(a,
|
||||
c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=g;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);
|
||||
d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();
|
||||
a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));k=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&
|
||||
b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));k.isEnabled=function(){return this.enabled&&
|
||||
g.apply(this,arguments)};k.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,
|
||||
mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),
|
||||
null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));
|
||||
this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));
|
||||
this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var v=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml)&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=
|
||||
new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,d,e){var f=c.isMouseInsertPoint()?c.getInsertPoint():c.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,d),e);a.vertex=!0;c.getModel().beginUpdate();try{a=c.addCell(a),c.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{c.getModel().endUpdate()}c.scrollCellToVisible(a);
|
||||
c.setSelectionCell(a);c.container.focus();c.editAfterInsert&&c.startEditing(a);return a};a.actions.addAction("insertText",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&c.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=g;a.actions.addAction("insertRectangle",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&
|
||||
x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=g;a.actions.addAction("insertEllipse",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=g;a.actions.addAction("insertRhombus",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=g;var C=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==
|
||||
c[d]?a.addSeparator(b):v(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);C(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,
|
||||
function(a,b){C(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},
|
||||
c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);
|
||||
isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?
|
||||
"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
|
||||
"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
|
||||
"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):h&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+
|
||||
"...)",null,function(){},c,null,!1));null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):m&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):f&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);mxClient.IS_IOS||b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},
|
||||
c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(y){a.handleError(y,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),
|
||||
a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",
|
||||
new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&
|
||||
(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=
|
||||
urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage&&(d=this.addMenuItem(b,"plugins",c),a.isOffline()||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430"));b.addSeparator(c);d=this.addMenuItem(b,"tags",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||
|
||||
this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966")})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,
|
||||
["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?
|
||||
this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",
|
||||
b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var c=Menus.prototype.menuCreated;Menus.prototype.menuCreated=function(a,b){if(480>=screen.width&&a==this.get("help")){b.style.paddingRight=
|
||||
"0px";b.style.paddingLeft="0px";b.innerHTML="";var d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);b.appendChild(d)}c.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,c){this.ui=a;this.page=b;this.previous=this.name=c}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
|
||||
function MovePage(a,b,c){this.ui=a;this.oldIndex=b;this.newIndex=c}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};
|
||||
function SelectPage(a,b){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b))}
|
||||
|
@ -8164,7 +8165,7 @@ q.model.getParent(a),c=q.getIncomingEdges(a),d=q.cloneCells([c[0],a]);q.model.se
|
|||
e.y+40):l==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=l==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-n.y+-e.y+10);return q.addCells(d,b)}finally{q.model.endUpdate()}}function n(a,
|
||||
b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function t(a,b){var c=m(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
|
||||
c==mxConstants.DIRECTION_WEST)==d&&c!=b?u.actions.get("selectParent").funct():c==b?(d=q.getOutgoingEdges(a),null!=d&&0<d.length&&q.setSelectionCell(q.model.getTerminal(d[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(d=n(q.model.getTerminal(c[0],!0),d,a),c=q.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&q.setSelectionCell(d[c].cell)))))}var u=this,q=u.editor.graph,v=q.getModel();mxResources.parse("selectChildren=Select Children");
|
||||
mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var w=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){w.apply(this,arguments);if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(q.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(q.getSelectionCell())&&
|
||||
mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var x=u.menus.createPopupMenu;u.menus.createPopupMenu=function(a,c,d){x.apply(this,arguments);if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(q.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(q.getSelectionCell())&&
|
||||
(a.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};u.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),
|
||||
a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",
|
||||
function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+T");var C=q.removeCells;q.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];v.isEdge(g)&&c(g)&&(e.push(g),g=v.getTerminal(g,!1));b(g)?(q.traverse(g,!0,
|
||||
|
@ -8172,14 +8173,14 @@ function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=q.getIncomingEdges(a[f])
|
|||
a)}this.model.beginUpdate();try{var h=p.call(this,a,c);if(h.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=q.getIncomingEdges(h[e]),g=q.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var m=this.cloneCells([g[0]])[0];this.addEdge(m,q.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var A=q.moveCells;q.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var m=f,l=this.view.getState(f),n=null!=l?l.style:this.getCellStyle(f);
|
||||
if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<a.length;p++)if(b(a[p])||q.model.isEdge(a[p])&&null==q.model.getTerminal(a[p],!0)){f=q.model.getParent(a[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var v=q.getIncomingEdges(a[0]);if(0<v.length){var t=q.view.getState(q.model.getTerminal(v[0],!0));if(null!=t){var u=q.view.getState(m);null!=u&&(c=(u.getCenterX()-t.getCenterX())/q.view.scale,d=(u.getCenterY()-t.getCenterY())/q.view.scale)}}}}k=A.apply(this,arguments);
|
||||
if(null!=k&&null!=a&&k.length==a.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))b(m)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],m,!0);else if(b(a[p])&&(v=q.getIncomingEdges(a[p]),0<v.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==q.getIncomingEdges(k[p]).length){l=m;if(null==l||l==q.model.getParent(a[p]))l=q.model.getTerminal(v[0],!0);e=this.cloneCells([v[0]])[0];this.addEdge(e,
|
||||
q.getDefaultParent(),l,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var F=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=F.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=q.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var B={88:u.actions.get("selectChildren"),
|
||||
84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},x=u.onKeyDown;u.onKeyDown=function(a){try{if(q.isEnabled()&&!q.isEditing()&&b(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?f(q.getSelectionCell()):k(q.getSelectionCell()):13==a.which&&(c=l(q.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],
|
||||
q.getDefaultParent(),l,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var E=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(a,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=E.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=q.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var B={88:u.actions.get("selectChildren"),
|
||||
84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},w=u.onKeyDown;u.onKeyDown=function(a){try{if(q.isEnabled()&&!q.isEditing()&&b(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?f(q.getSelectionCell()):k(q.getSelectionCell()):13==a.which&&(c=l(q.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],
|
||||
!1)):q.setSelectionCell(c[c.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(q.view.getState(q.getSelectionCell())),q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=B[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(t(q.getSelectionCell(),
|
||||
mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(t(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(L){console.log("error",L)}mxEvent.isConsumed(a)||x.apply(this,arguments)};var E=q.connectVertex;q.connectVertex=function(a,c,d,e,g,h){var p=q.getIncomingEdges(a);return b(a)&&0<p.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?k(a):e==g?f(a):l(a,c!=mxConstants.DIRECTION_NORTH&&
|
||||
c!=mxConstants.DIRECTION_WEST)):E.call(this,a,c,d,e,g,h)};q.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&q.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var y=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){y.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
|
||||
mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(t(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(L){console.log("error",L)}mxEvent.isConsumed(a)||w.apply(this,arguments)};var J=q.connectVertex;q.connectVertex=function(a,c,d,e,g,h){var p=q.getIncomingEdges(a);return b(a)&&0<p.length?(d=m(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?k(a):e==g?f(a):l(a,c!=mxConstants.DIRECTION_NORTH&&
|
||||
c!=mxConstants.DIRECTION_WEST)):J.call(this,a,c,d,e,g,h)};q.getSubtree=function(a){var c=[a];b(a)&&!d(a)&&q.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var y=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){y.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),
|
||||
this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);
|
||||
this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var D=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){D.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=
|
||||
this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){I.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
|
||||
this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.editorUi.editor.graph;return a.concat([this.addEntry("tree container",
|
||||
function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");
|
||||
b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
|
||||
e.vertex=!0;var g=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");g.geometry.relative=!0;g.edge=!0;b.insertEdge(g,!0);e.insertEdge(g,!1);var t=new mxCell("Topic",new mxGeometry(20,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");t.vertex=!0;var u=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
||||
|
@ -8225,20 +8226,21 @@ mxResources.get("text");c.actions.get("editDiagram").label=mxResources.get("form
|
|||
mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",function(){null!=a.files&&c.importFiles(a.files,null,null,c.maxImageSize)});a.click()}));c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()}));
|
||||
c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(c,"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+
|
||||
"...",function(){a(c)}));EditorUi.enablePlantUml&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,"new open - save saveAs -".split(" "),b):"1"==urlParams.embed?
|
||||
(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile&&(c.menus.addMenuItems(a,["-","share"],b),null!=d.realtime&&c.menus.addMenuItems(a,["chatWindowTitle"],b),a.addSeparator(b));c.menus.addMenuItems(a,"- outline layers - find tags -".split(" "),
|
||||
b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,b){f.apply(this,arguments);a.addSeparator(b);c.menus.addSubmenu("openRecent",a,b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,
|
||||
["createRevision","makeCopy","-","rename","moveToFolder"],b):c.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],b);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],b);c.menus.addMenuItems(a,["-","autosave"],b)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b);c.menus.addMenuItems(a,["publishLink"],b)})));var h=this.get("language");
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"],b);"1"!=urlParams.embed&&isLocalStorage&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);c.isOfflineApp()||"1"==urlParams.embed||c.menus.addMenuItems(a,["-","plugins"],b)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,
|
||||
b){c.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",
|
||||
a,b);c.menus.addSubmenu("insertAdvanced",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,
|
||||
function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "),b)})))};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=k.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height=
|
||||
"30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c?(g.style.backgroundImage="url("+c+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px",g.innerHTML="",mxUtils.setOpacity(g,d||40)):b||(g.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",g.style.backgroundPosition="right 6px center",g.style.backgroundRepeat=
|
||||
"no-repeat",g.style.paddingRight="22px");return g}function b(a,b,c,d,e,f){var g=document.createElement("a");g.setAttribute("href","javascript:void(0)");g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";h.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize=
|
||||
"24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);mxUtils.setOpacity(g,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),mxUtils.setOpacity(g,null!=f?40:100),g.style.cursor=""):(g.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,null!=f?10:20),g.style.cursor="default")},e.addListener("stateChanged",
|
||||
a),a());return g}function d(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));h.appendChild(b);return b}q.apply(this,arguments);var e=document.createElement("div");e.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";
|
||||
e.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(e);var f=this,g=f.editor.graph;f.toolbar=this.createToolbar(f.createDiv("geToolbar"));f.defaultLibraryName=mxResources.get("untitledLibrary");var h=document.createElement("div");h.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var k=new Menubar(f,h);(e=900>c)||
|
||||
a("diagram");d([e?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",100):null,b(mxResources.get("shapes"),f.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),f.actions.get("image"),e?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),
|
||||
f.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+f.actions.get("formatPanel").shortcut+")",f.actions.get("image"),e?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
|
||||
(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile&&(c.menus.addMenuItems(a,["-","share"],b),null!=d.realtime&&c.menus.addMenuItems(a,["chatWindowTitle"],b),a.addSeparator(b));c.menus.addMenuItems(a,["-","outline",
|
||||
"layers","-","find"],b);d=this.addMenuItem(a,"tags",b);c.isOffline()&&!mxClient.IS_CHROMEAPP||c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,b){f.apply(this,
|
||||
arguments);a.addSeparator(b);c.menus.addSubmenu("openRecent",a,b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],b):c.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],b);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],b);c.menus.addMenuItems(a,["-","autosave"],b)})));var g=
|
||||
this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"],
|
||||
b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);if(!c.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(b);var d=c.menus.addMenuItem(a,"plugins",b);c.isOffline()||c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "),
|
||||
b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),
|
||||
l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "),
|
||||
b)})))};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=f.menus.get(a),g=k.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));f.menus.menuCreated(e,g,"geMenuItem");null!=c?
|
||||
(g.style.backgroundImage="url("+c+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px",g.innerHTML="",mxUtils.setOpacity(g,d||40)):b||(g.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",g.style.backgroundPosition="right 6px center",g.style.backgroundRepeat="no-repeat",g.style.paddingRight="22px");return g}function b(a,b,c,d,e,f){var g=document.createElement("a");g.setAttribute("href","javascript:void(0)");
|
||||
g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";h.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&
|
||||
b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);mxUtils.setOpacity(g,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),mxUtils.setOpacity(g,null!=f?40:100),g.style.cursor=""):(g.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,null!=f?10:20),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function d(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";
|
||||
b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));h.appendChild(b);return b}q.apply(this,arguments);var e=document.createElement("div");e.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";e.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?
|
||||
"63px":"32px";this.sidebar=this.createSidebar(e);var f=this,g=f.editor.graph;f.toolbar=this.createToolbar(f.createDiv("geToolbar"));f.defaultLibraryName=mxResources.get("untitledLibrary");var h=document.createElement("div");h.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var k=new Menubar(f,h);(e=900>c)||a("diagram");d([e?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",
|
||||
100):null,b(mxResources.get("shapes"),f.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),f.actions.get("image"),e?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),f.actions.get("toggleFormat").funct,null,mxResources.get("format")+
|
||||
" ("+f.actions.get("formatPanel").shortcut+")",f.actions.get("image"),e?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
|
||||
null)]);var l=a("insert",!0,e?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null,40);d([l,b(mxResources.get("delete"),f.actions.get("delete").funct,null,mxResources.get("delete"),f.actions.get("delete"),e?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
|
||||
null)]);if(480<=c){var m=f.actions.get("undo"),e=f.actions.get("redo"),m=b("",m.funct,null,mxResources.get("undo")+" ("+m.shortcut+")",m,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),e=b("",e.funct,
|
||||
null,mxResources.get("redo")+" ("+e.shortcut+")",e,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg==");d([m,e]);if(560<=c){var e=f.actions.get("zoomIn"),m=f.actions.get("zoomOut"),n=f.actions.get("resetView");
|
||||
|
|
519
src/main/webapp/js/atlas-viewer.min.js
vendored
519
src/main/webapp/js/atlas-viewer.min.js
vendored
File diff suppressed because one or more lines are too long
300
src/main/webapp/js/atlas.min.js
vendored
300
src/main/webapp/js/atlas.min.js
vendored
|
@ -6897,7 +6897,7 @@ StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,argum
|
|||
StorageLibrary.prototype.isRenamable=function(a,d,f){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,d,f){StorageFile.call(this,a,d,f);a=f;d=a.lastIndexOf("/");0<=d&&(a=a.substring(d+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,d,f){return!1};UrlLibrary.prototype.saveAs=function(a,d,f){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,d,f){function c(c,x,u,k,v,q){function w(){mxEvent.addListener(t,"click",null!=q?q:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,b.checked);d()})):(a.setMode(u,b.checked),d()):window.location.hostname=DriveClient.prototype.newAppHostname})}var t=document.createElement("a");t.style.overflow="hidden";t.style.display=
|
||||
mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.boxSizing="border-box";t.style.fontSize="11px";t.style.position="relative";t.style.margin="4px";t.style.padding="8px 10px 12px 10px";t.style.width="88px";t.style.height="100px";t.style.whiteSpace="nowrap";t.setAttribute("title",x);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");var A=document.createElement("div");A.style.textOverflow="ellipsis";A.style.overflow="hidden";if(null!=c){var g=document.createElement("img");
|
||||
g.setAttribute("src",c);g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";t.appendChild(g)}else A.style.paddingTop="5px",A.style.whiteSpace="normal",mxClient.IS_IOS?(t.style.padding="0px 10px 20px 10px",t.style.top="6px"):mxClient.IS_FF&&(A.style.paddingTop="0px",A.style.marginTop="-2px");t.appendChild(A);mxUtils.write(A,x);if(null!=v)for(c=0;c<v.length;c++)mxUtils.br(A),mxUtils.write(A,v[c]);if(null!=k&&null==a[k]){g.style.visibility=
|
||||
"hidden";mxUtils.setOpacity(A,10);var h=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});h.spin(t);var F=window.setTimeout(function(){null==a[k]&&(h.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(F),mxUtils.setOpacity(A,100),g.style.visibility="",h.stop(),w(),"drive"==k&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else w();
|
||||
"hidden";mxUtils.setOpacity(A,10);var F=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});F.spin(t);var h=window.setTimeout(function(){null==a[k]&&(F.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[k]&&(window.clearTimeout(h),mxUtils.setOpacity(A,100),g.style.visibility="",F.stop(),w(),"drive"==k&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else w();
|
||||
p.appendChild(t);++e>=f&&(mxUtils.br(p),e=0)}f=null!=f?f:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var h=a.addLanguageMenu(g,!0);null!=h&&(h.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){h=document.createElement("a");h.setAttribute("href","https://about.draw.io/support/");h.setAttribute("title",mxResources.get("help"));h.setAttribute("target","_blank");h.style.position=
|
||||
"absolute";h.style.textDecoration="none";h.style.cursor="pointer";h.style.fontSize="12px";h.style.bottom="28px";h.style.left="26px";h.style.color="gray";var m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("valign","bottom");m.setAttribute("src",Editor.helpImage);m.style.marginRight="2px";h.appendChild(m);mxUtils.write(h,mxResources.get("help"));g.appendChild(h)}var n=document.createElement("div");n.style.position="absolute";n.style.cursor="pointer";n.style.fontSize="12px";
|
||||
n.style.bottom="28px";n.style.color="gray";mxUtils.write(n,mxResources.get("decideLater"));a.isOfflineApp()?n.style.right="20px":(mxUtils.setPrefixedStyle(n.style,"transform","translate(-50%,0)"),n.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)n.style.marginLeft=-Math.round(n.clientWidth/2)+"px"};g.appendChild(n);mxEvent.addListener(n,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,
|
||||
|
@ -6983,7 +6983,7 @@ b.preventDefault();if(0<b.dataTransfer.files.length){b=b.dataTransfer.files[0];v
|
|||
function(){a.hideDialog();c(m.value,n.value)});d.appendChild(p);p.className="geBtn gePrimaryBtn";a.editor.cancelFirst||d.appendChild(f);this.container=d},NewDialog=function(a,d,f,c,g,h,m,n,p,b,e,l,q,u,t){function w(){for(var b=!0;z<Q.length&&(b||0!=mxUtils.mod(z,30));)b=Q[z++],k(b.url,b.libs,b.title,b.tooltip?b.tooltip:b.title,b.select,b.imgUrl,b.info,b.onClick),b=!1}function x(){if(S)f||a.hideDialog(),u(S,O,K.value);else if(c)f||a.hideDialog(),c(Z,K.value);else{var b=K.value;null!=b&&0<b.length&&
|
||||
a.pickFolder(a.mode==App.MODE_ONEDRIVE||a.mode==App.MODE_TRELLO||a.mode==App.MODE_GOOGLE&&(null==a.stateArg||null==a.stateArg.folderId)?a.mode:null,function(e){a.createFile(b,Z,null!=X&&0<X.length?X:null,null,function(){a.hideDialog()},null,e)})}}function A(b,a,e,k,c){null!=N&&(N.style.backgroundColor="transparent",N.style.border="1px solid transparent");D.removeAttribute("disabled");Z=a;X=e;N=b;S=k;O=c;N.style.backgroundColor=n;N.style.border=p}function k(b,a,e,k,c,l,v,f){var d=document.createElement("div");
|
||||
d.className="geTemplate";d.style.height=R+"px";d.style.width=T+"px";null!=k&&0<k.length&&d.setAttribute("title",k);if(null!=l)d.style.backgroundImage="url("+l+")",d.style.backgroundSize="contain",d.style.backgroundPosition="center center",d.style.backgroundRepeat="no-repeat",mxEvent.addListener(d,"click",function(a){A(d,null,null,b,v)}),mxEvent.addListener(d,"dblclick",function(b){x()});else if(null!=b&&0<b.length){b.substring(0,b.length-4);d.style.backgroundImage="url("+TEMPLATE_PATH+"/"+b.substring(0,
|
||||
b.length-4)+".png)";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";var q=!1;mxEvent.addListener(d,"click",function(e){D.setAttribute("disabled","disabled");d.style.backgroundColor="transparent";d.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+b,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(A(d,b.getText(),a),q&&x())}))});mxEvent.addListener(d,"dblclick",function(b){q=!0})}else d.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
|
||||
b.length-4)+".png)";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";var u=!1;mxEvent.addListener(d,"click",function(e){D.setAttribute("disabled","disabled");d.style.backgroundColor="transparent";d.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+b,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(A(d,b.getText(),a),u&&x())}))});mxEvent.addListener(d,"dblclick",function(b){u=!0})}else d.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
|
||||
mxResources.get(e)+"</td></tr></table>",c&&A(d),null!=f?mxEvent.addListener(d,"click",f):(mxEvent.addListener(d,"click",function(b){A(d)}),mxEvent.addListener(d,"dblclick",function(b){x()}));G.appendChild(d)}function v(){mxEvent.addListener(G,"scroll",function(b){G.scrollTop+G.clientHeight>=G.scrollHeight&&(w(),mxEvent.consume(b))});var a=null,e;for(e in V){var k=document.createElement("div"),c=mxResources.get(e),l=V[e];null==c&&(c=e.substring(0,1).toUpperCase()+e.substring(1));18<c.length&&(c=c.substring(0,
|
||||
18)+"…");k.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";k.setAttribute("title",c+" ("+l.length+")");mxUtils.write(k,k.getAttribute("title"));null!=b&&(k.style.padding=b);W.appendChild(k);null==a&&(a=k,a.style.backgroundColor=m);(function(b,e){mxEvent.addListener(k,"click",function(){a!=e&&(a.style.backgroundColor="",a=e,a.style.backgroundColor=m,G.scrollTop=0,G.innerHTML="",z=0,Q=V[b],B=null,w())})})(e,
|
||||
k)}w()}f=null!=f?f:!0;g=null!=g?g:!1;m=null!=m?m:"#ebf2f9";n=null!=n?n:"#e6eff8";p=null!=p?p:"1px solid #ccd9ea";e=null!=e?e:TEMPLATE_PATH+"/index.xml";var F=document.createElement("div");F.style.height="100%";var C=document.createElement("div");C.style.whiteSpace="nowrap";C.style.height="46px";f&&F.appendChild(C);var y=document.createElement("img");y.setAttribute("border","0");y.setAttribute("align","absmiddle");y.style.width="40px";y.style.height="40px";y.style.marginRight="10px";y.style.paddingBottom=
|
||||
|
@ -6997,10 +6997,10 @@ C+"px";G.style.bottom="68px";G.style.margin="6px 0 0 -1px";G.style.padding="6px"
|
|||
typeof b.getAttribute){var a=b.getAttribute("url");if(null!=a){var e=a.indexOf("/"),a=a.substring(0,e),e=V[a];null==e&&(I++,e=[],V[a]=e);e.push({url:b.getAttribute("url"),libs:b.getAttribute("libs"),title:b.getAttribute("title"),tooltip:b.getAttribute("url")})}}b=b.nextSibling}v()}})}mxEvent.addListener(K,"keypress",function(b){13==b.keyCode&&x()});e=document.createElement("div");e.style.marginTop=d?"4px":"16px";e.style.textAlign="right";e.style.position="absolute";e.style.left="40px";e.style.bottom=
|
||||
"24px";e.style.right="40px";C=mxUtils.button(mxResources.get("cancel"),function(){null!=h&&h();a.hideDialog(!0)});C.className="geBtn";!a.editor.cancelFirst||g&&null==h||e.appendChild(C);d||a.isOffline()||!f||null!=c||g||(y=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),y.className="geBtn",e.appendChild(y));d||"1"==urlParams.embed||g||(d=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,
|
||||
"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(K.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),d.className="geBtn",e.appendChild(d));Graph.fileSupport&&t&&(t=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple",
|
||||
"multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(e){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",e.appendChild(t));e.appendChild(D);a.editor.cancelFirst||null!=c||g&&null==h||e.appendChild(C);F.appendChild(e);this.container=F},CreateDialog=function(a,d,f,c,g,h,m,n,p,b,e,l,q,u,t){function w(b,e,k,c){function f(){mxEvent.addListener(q,"click",function(){var b=k;if(m){var e=v.value,c=e.lastIndexOf(".");if(0>d.lastIndexOf(".")&&0>c){var b=null!=b?b:y.value,
|
||||
l="";b==App.MODE_GOOGLE?l=a.drive.extension:b==App.MODE_GITHUB?l=a.gitHub.extension:b==App.MODE_TRELLO?l=a.trello.extension:b==App.MODE_DROPBOX?l=a.dropbox.extension:b==App.MODE_ONEDRIVE?l=a.oneDrive.extension:b==App.MODE_DEVICE&&(l=".xml");0<=c&&(e=e.substring(0,c));v.value=e+l}}x(k)})}var q=document.createElement("a");q.style.overflow="hidden";var u=document.createElement("img");u.src=b;u.setAttribute("border","0");u.setAttribute("align","absmiddle");u.style.width="60px";u.style.height="60px";u.style.paddingBottom=
|
||||
"6px";q.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";q.className="geBaseButton";q.style.position="relative";q.style.margin="4px";q.style.padding="8px 8px 10px 8px";q.style.whiteSpace="nowrap";q.appendChild(u);mxClient.IS_QUIRKS&&(q.style.cssFloat="left",q.style.zoom="1");q.style.color="gray";q.style.fontSize="11px";var t=document.createElement("div");q.appendChild(t);mxUtils.write(t,e);if(null!=c&&null==a[c]){u.style.visibility="hidden";mxUtils.setOpacity(t,10);var w=new Spinner({lines:12,
|
||||
length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});w.spin(q);var g=window.setTimeout(function(){null==a[c]&&(w.stop(),q.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[c]&&(window.clearTimeout(g),mxUtils.setOpacity(t,100),u.style.visibility="",w.stop(),f())}))}else f();F.appendChild(q);++C==l&&(mxUtils.br(F),C=0)}function x(b){var e=v.value;if(null==b||null!=e&&0<e.length)a.hideDialog(),f(e,
|
||||
"multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(e){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",e.appendChild(t));e.appendChild(D);a.editor.cancelFirst||null!=c||g&&null==h||e.appendChild(C);F.appendChild(e);this.container=F},CreateDialog=function(a,d,f,c,g,h,m,n,p,b,e,l,q,u,t){function w(b,e,k,c){function f(){mxEvent.addListener(u,"click",function(){var b=k;if(m){var e=v.value,c=e.lastIndexOf(".");if(0>d.lastIndexOf(".")&&0>c){var b=null!=b?b:y.value,
|
||||
l="";b==App.MODE_GOOGLE?l=a.drive.extension:b==App.MODE_GITHUB?l=a.gitHub.extension:b==App.MODE_TRELLO?l=a.trello.extension:b==App.MODE_DROPBOX?l=a.dropbox.extension:b==App.MODE_ONEDRIVE?l=a.oneDrive.extension:b==App.MODE_DEVICE&&(l=".xml");0<=c&&(e=e.substring(0,c));v.value=e+l}}x(k)})}var u=document.createElement("a");u.style.overflow="hidden";var q=document.createElement("img");q.src=b;q.setAttribute("border","0");q.setAttribute("align","absmiddle");q.style.width="60px";q.style.height="60px";q.style.paddingBottom=
|
||||
"6px";u.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";u.className="geBaseButton";u.style.position="relative";u.style.margin="4px";u.style.padding="8px 8px 10px 8px";u.style.whiteSpace="nowrap";u.appendChild(q);mxClient.IS_QUIRKS&&(u.style.cssFloat="left",u.style.zoom="1");u.style.color="gray";u.style.fontSize="11px";var t=document.createElement("div");u.appendChild(t);mxUtils.write(t,e);if(null!=c&&null==a[c]){q.style.visibility="hidden";mxUtils.setOpacity(t,10);var w=new Spinner({lines:12,
|
||||
length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});w.spin(u);var g=window.setTimeout(function(){null==a[c]&&(w.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[c]&&(window.clearTimeout(g),mxUtils.setOpacity(t,100),q.style.visibility="",w.stop(),f())}))}else f();F.appendChild(u);++C==l&&(mxUtils.br(F),C=0)}function x(b){var e=v.value;if(null==b||null!=e&&0<e.length)a.hideDialog(),f(e,
|
||||
b)}m=null!=m?m:!0;n=null!=n?n:!0;l=null!=l?l:4;var A=document.createElement("div");null==c&&a.addLanguageMenu(A);var k=document.createElement("h2");mxUtils.write(k,g||mxResources.get("create"));k.style.marginTop="0px";k.style.marginBottom="24px";A.appendChild(k);mxUtils.write(A,mxResources.get("filename")+":");var v=document.createElement("input");v.setAttribute("value",d);v.style.width="280px";v.style.marginLeft="10px";v.style.marginBottom="20px";this.init=function(){v.focus();mxClient.IS_GC||mxClient.IS_FF||
|
||||
5<=document.documentMode||mxClient.IS_QUIRKS?v.select():document.execCommand("selectAll",!1,null)};A.appendChild(v);null!=q&&null!=u&&"image/"==u.substring(0,6)&&(v.style.width="160px",g=null,"image/svg+xml"==u&&mxClient.IS_SVG?(g=document.createElement("div"),g.innerHTML=mxUtils.trim(q),q=g.getElementsByTagName("svg")[0],u=parseInt(q.getAttribute("width")),t=parseInt(q.getAttribute("height")),q.setAttribute("viewBox","0 0 "+u+" "+t),q.setAttribute("width","120px"),q.setAttribute("height","80px")):
|
||||
(g=document.createElement("img"),g.setAttribute("src","data:"+u+(t?";base64,":";utf8,")+q)),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px",mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),A.appendChild(g),p&&Editor.popupsAllowed&&(g.style.cursor="pointer",mxEvent.addListener(g,"click",function(){x("_blank")})));mxUtils.br(A);var F=document.createElement("div");F.style.textAlign="center";var C=0;F.style.marginTop=
|
||||
|
@ -7203,27 +7203,27 @@ a,e=0;do a=this.model.getChildAt(this.model.root,e);while(e++<b&&"1"==mxUtils.ge
|
|||
[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.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.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(b){var a=
|
||||
null;null!=b&&0<b.length&&("ER"==b.substring(0,2)?a="mxgraph.er":"sysML"==b.substring(0,5)&&(a="mxgraph.sysml"));return a};var t=mxMarker.createMarker;mxMarker.createMarker=function(b,a,e,c,l,f,d,q,g,u){if(null!=e&&null==mxMarker.markers[e]){var k=this.getPackageForType(e);null!=k&&mxStencilRegistry.getStencil(k)}return t.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function e(){m.value=Math.max(1,Math.min(q,Math.max(parseInt(m.value),parseInt(h.value))));h.value=Math.max(1,Math.min(q,
|
||||
Math.min(parseInt(m.value),parseInt(h.value))))}function c(a){function e(a,e,k){var l=a.getGraphBounds(),d=0,f=0,q=ba.get(),u=1/a.pageScale,g=A.checked;if(g)var u=parseInt(Q.value),v=parseInt(P.value),u=Math.min(q.height*v/(l.height/a.view.scale),q.width*u/(l.width/a.view.scale));else u=parseInt(p.value)/(100*a.pageScale),isNaN(u)&&(c=1/a.pageScale,p.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*c);q.height=Math.ceil(q.height*c);u*=c;!g&&a.pageVisible?(l=a.getPageLayout(),
|
||||
d-=l.x*q.width,f-=l.y*q.height):g=!0;if(null==e){e=PrintDialog.createPrintPreview(a,u,q,0,d,f,g);e.pageSelector=!1;e.mathEnabled=!1;a=b.getCurrentFile();null!=a&&(e.title=a.getTitle());var t=e.writeHead;e.writeHead=function(a){t.apply(this,arguments);null!=b.editor.fontCss&&(a.writeln('<style type="text/css">'),a.writeln(b.editor.fontCss),a.writeln("</style>"))};if("undefined"!==typeof MathJax){var w=e.renderPage;e.renderPage=function(b,a,e,c,k,l){var d=w.apply(this,arguments);this.graph.mathEnabled?
|
||||
this.mathEnabled=!0:d.className="geDisableMathJax";return d}}e.open(null,null,k,!0)}else{q=a.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";e.backgroundColor=q;e.autoOrigin=g;e.appendGraph(a,u,d,f,k,!0)}return e}var c=parseInt(U.value)/100;isNaN(c)&&(c=1,U.value="100 %");var c=.75*c,k=h.value,d=m.value,f=!t.checked,q=null;f&&(f=k==g&&d==g);if(!f&&null!=b.pages&&b.pages.length){var u=0,f=b.pages.length-1;t.checked||(u=parseInt(k)-1,f=parseInt(d)-1);for(var v=u;v<=f;v++){var w=b.pages[v],
|
||||
k=w==b.currentPage?l:null;if(null==k){var k=b.createTemporaryGraph(l.getStylesheet()),d=!0,u=!1,x=null,n=null;null==w.viewState&&null==w.mapping&&null==w.root&&b.updatePageRoot(w);null!=w.viewState?(d=w.viewState.pageVisible,u=w.viewState.mathEnabled,x=w.viewState.background,n=w.viewState.backgroundImage):null!=w.mapping&&null!=w.mapping.diagramMap&&(u="0"!=w.mapping.diagramMap.get("mathEnabled"),x=w.mapping.diagramMap.get("background"),n=w.mapping.diagramMap.get("backgroundImage"),n=null!=n&&0<n.length?
|
||||
JSON.parse(n):null);k.background=x;k.backgroundImage=null!=n?new mxImage(n.src,n.width,n.height):null;k.pageVisible=d;k.mathEnabled=u;var B=k.getGlobalVariable;k.getGlobalVariable=function(b){return"page"==b?w.getName():"pagenumber"==b?v+1:B.apply(this,arguments)};document.body.appendChild(k.container);b.updatePageRoot(w);k.model.setRoot(w.root)}q=e(k,q,v!=f);k!=l&&k.container.parentNode.removeChild(k.container)}}else q=e(l);q.mathEnabled&&(f=q.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),
|
||||
null;null!=b&&0<b.length&&("ER"==b.substring(0,2)?a="mxgraph.er":"sysML"==b.substring(0,5)&&(a="mxgraph.sysml"));return a};var t=mxMarker.createMarker;mxMarker.createMarker=function(b,a,e,c,l,f,d,q,u,g){if(null!=e&&null==mxMarker.markers[e]){var k=this.getPackageForType(e);null!=k&&mxStencilRegistry.getStencil(k)}return t.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function e(){m.value=Math.max(1,Math.min(q,Math.max(parseInt(m.value),parseInt(h.value))));h.value=Math.max(1,Math.min(q,
|
||||
Math.min(parseInt(m.value),parseInt(h.value))))}function c(a){function e(a,e,k){var l=a.getGraphBounds(),d=0,f=0,q=ba.get(),g=1/a.pageScale,u=A.checked;if(u)var g=parseInt(Q.value),v=parseInt(P.value),g=Math.min(q.height*v/(l.height/a.view.scale),q.width*g/(l.width/a.view.scale));else g=parseInt(p.value)/(100*a.pageScale),isNaN(g)&&(c=1/a.pageScale,p.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*c);q.height=Math.ceil(q.height*c);g*=c;!u&&a.pageVisible?(l=a.getPageLayout(),
|
||||
d-=l.x*q.width,f-=l.y*q.height):u=!0;if(null==e){e=PrintDialog.createPrintPreview(a,g,q,0,d,f,u);e.pageSelector=!1;e.mathEnabled=!1;a=b.getCurrentFile();null!=a&&(e.title=a.getTitle());var w=e.writeHead;e.writeHead=function(a){w.apply(this,arguments);null!=b.editor.fontCss&&(a.writeln('<style type="text/css">'),a.writeln(b.editor.fontCss),a.writeln("</style>"))};if("undefined"!==typeof MathJax){var t=e.renderPage;e.renderPage=function(b,a,e,c,k,l){var d=t.apply(this,arguments);this.graph.mathEnabled?
|
||||
this.mathEnabled=!0:d.className="geDisableMathJax";return d}}e.open(null,null,k,!0)}else{q=a.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";e.backgroundColor=q;e.autoOrigin=u;e.appendGraph(a,g,d,f,k,!0)}return e}var c=parseInt(U.value)/100;isNaN(c)&&(c=1,U.value="100 %");var c=.75*c,k=h.value,d=m.value,f=!t.checked,q=null;f&&(f=k==u&&d==u);if(!f&&null!=b.pages&&b.pages.length){var g=0,f=b.pages.length-1;t.checked||(g=parseInt(k)-1,f=parseInt(d)-1);for(var v=g;v<=f;v++){var w=b.pages[v],
|
||||
k=w==b.currentPage?l:null;if(null==k){var k=b.createTemporaryGraph(l.getStylesheet()),d=!0,g=!1,x=null,n=null;null==w.viewState&&null==w.mapping&&null==w.root&&b.updatePageRoot(w);null!=w.viewState?(d=w.viewState.pageVisible,g=w.viewState.mathEnabled,x=w.viewState.background,n=w.viewState.backgroundImage):null!=w.mapping&&null!=w.mapping.diagramMap&&(g="0"!=w.mapping.diagramMap.get("mathEnabled"),x=w.mapping.diagramMap.get("background"),n=w.mapping.diagramMap.get("backgroundImage"),n=null!=n&&0<n.length?
|
||||
JSON.parse(n):null);k.background=x;k.backgroundImage=null!=n?new mxImage(n.src,n.width,n.height):null;k.pageVisible=d;k.mathEnabled=g;var B=k.getGlobalVariable;k.getGlobalVariable=function(b){return"page"==b?w.getName():"pagenumber"==b?v+1:B.apply(this,arguments)};document.body.appendChild(k.container);b.updatePageRoot(w);k.model.setRoot(w.root)}q=e(k,q,v!=f);k!=l&&k.container.parentNode.removeChild(k.container)}}else q=e(l);q.mathEnabled&&(f=q.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),
|
||||
f.writeln("MathJax.Hub.Config({"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),f.writeln('"HTML-CSS": {'),f.writeln("imageFont: null"),f.writeln("},"),f.writeln("TeX: {"),f.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),f.writeln("},"),f.writeln("tex2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("},"),
|
||||
f.writeln("asciimath2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("}"),f.writeln("});"),a&&(f.writeln("MathJax.Hub.Queue(function () {"),f.writeln("window.print();"),f.writeln("});")),f.writeln("\x3c/script>"),f.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));q.closeDocument();!q.mathEnabled&&a&&PrintDialog.printPreview(q)}var l=b.editor.graph,f=document.createElement("div"),d=document.createElement("h3");d.style.width="100%";
|
||||
d.style.textAlign="center";d.style.marginTop="0px";mxUtils.write(d,a||mxResources.get("print"));f.appendChild(d);var q=1,g=1,u=document.createElement("div");u.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","all");t.setAttribute("type","radio");t.setAttribute("name","pages-printdialog");u.appendChild(t);d=document.createElement("span");mxUtils.write(d,
|
||||
mxResources.get("printAllPages"));u.appendChild(d);mxUtils.br(u);var w=t.cloneNode(!0);t.setAttribute("checked","checked");w.setAttribute("value","range");u.appendChild(w);d=document.createElement("span");mxUtils.write(d,mxResources.get("pages")+":");u.appendChild(d);var h=document.createElement("input");h.style.cssText="margin:0 8px 0 8px;";h.setAttribute("value","1");h.setAttribute("type","number");h.setAttribute("min","1");h.style.width="50px";u.appendChild(h);d=document.createElement("span");
|
||||
mxUtils.write(d,mxResources.get("to"));u.appendChild(d);var m=h.cloneNode(!0);u.appendChild(m);mxEvent.addListener(h,"focus",function(){w.checked=!0});mxEvent.addListener(m,"focus",function(){w.checked=!0});mxEvent.addListener(h,"change",e);mxEvent.addListener(m,"change",e);if(null!=b.pages&&(q=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==b.pages[d]){g=d+1;h.value=g;m.value=g;break}h.setAttribute("max",q);m.setAttribute("max",q);1<q&&f.appendChild(u);var x=document.createElement("div");
|
||||
d.style.textAlign="center";d.style.marginTop="0px";mxUtils.write(d,a||mxResources.get("print"));f.appendChild(d);var q=1,u=1,g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","all");t.setAttribute("type","radio");t.setAttribute("name","pages-printdialog");g.appendChild(t);d=document.createElement("span");mxUtils.write(d,
|
||||
mxResources.get("printAllPages"));g.appendChild(d);mxUtils.br(g);var w=t.cloneNode(!0);t.setAttribute("checked","checked");w.setAttribute("value","range");g.appendChild(w);d=document.createElement("span");mxUtils.write(d,mxResources.get("pages")+":");g.appendChild(d);var h=document.createElement("input");h.style.cssText="margin:0 8px 0 8px;";h.setAttribute("value","1");h.setAttribute("type","number");h.setAttribute("min","1");h.style.width="50px";g.appendChild(h);d=document.createElement("span");
|
||||
mxUtils.write(d,mxResources.get("to"));g.appendChild(d);var m=h.cloneNode(!0);g.appendChild(m);mxEvent.addListener(h,"focus",function(){w.checked=!0});mxEvent.addListener(m,"focus",function(){w.checked=!0});mxEvent.addListener(h,"change",e);mxEvent.addListener(m,"change",e);if(null!=b.pages&&(q=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==b.pages[d]){u=d+1;h.value=u;m.value=u;break}h.setAttribute("max",q);m.setAttribute("max",q);1<q&&f.appendChild(g);var x=document.createElement("div");
|
||||
x.style.marginBottom="10px";var n=document.createElement("input");n.style.marginRight="8px";n.setAttribute("value","adjust");n.setAttribute("type","radio");n.setAttribute("name","printZoom");x.appendChild(n);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));x.appendChild(d);var p=document.createElement("input");p.style.cssText="margin:0 8px 0 8px;";p.setAttribute("value","100 %");p.style.width="50px";x.appendChild(p);mxEvent.addListener(p,"focus",function(){n.checked=!0});
|
||||
f.appendChild(x);var u=u.cloneNode(!1),A=n.cloneNode(!0);A.setAttribute("value","fit");n.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(A);u.appendChild(d);x=document.createElement("table");x.style.display="inline-block";var N=document.createElement("tbody"),S=document.createElement("tr"),O=S.cloneNode(!0),G=document.createElement("td"),W=G.cloneNode(!0),R=G.cloneNode(!0),T=G.cloneNode(!0),
|
||||
f.appendChild(x);var g=g.cloneNode(!1),A=n.cloneNode(!0);A.setAttribute("value","fit");n.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(A);g.appendChild(d);x=document.createElement("table");x.style.display="inline-block";var N=document.createElement("tbody"),S=document.createElement("tr"),O=S.cloneNode(!0),G=document.createElement("td"),W=G.cloneNode(!0),R=G.cloneNode(!0),T=G.cloneNode(!0),
|
||||
V=G.cloneNode(!0),I=G.cloneNode(!0);G.style.textAlign="right";T.style.textAlign="right";mxUtils.write(G,mxResources.get("fitTo"));var Q=document.createElement("input");Q.style.cssText="margin:0 8px 0 8px;";Q.setAttribute("value","1");Q.setAttribute("min","1");Q.setAttribute("type","number");Q.style.width="40px";W.appendChild(Q);d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsAcross"));R.appendChild(d);mxUtils.write(T,mxResources.get("fitToBy"));var P=Q.cloneNode(!0);V.appendChild(P);
|
||||
mxEvent.addListener(Q,"focus",function(){A.checked=!0});mxEvent.addListener(P,"focus",function(){A.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));I.appendChild(d);S.appendChild(G);S.appendChild(W);S.appendChild(R);O.appendChild(T);O.appendChild(V);O.appendChild(I);N.appendChild(S);N.appendChild(O);x.appendChild(N);u.appendChild(x);f.appendChild(u);u=document.createElement("div");d=document.createElement("div");d.style.fontWeight="bold";d.style.marginBottom=
|
||||
"12px";mxUtils.write(d,mxResources.get("paperSize"));u.appendChild(d);d=document.createElement("div");d.style.marginBottom="12px";var ba=PageSetupDialog.addPageFormatPanel(d,"printdialog",b.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);u.appendChild(d);d=document.createElement("span");mxUtils.write(d,mxResources.get("pageScale"));u.appendChild(d);var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","100 %");U.style.width="60px";u.appendChild(U);
|
||||
f.appendChild(u);d=document.createElement("div");d.style.cssText="text-align:right;margin:62px 0 0 0;";u=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});u.className="geBtn";b.editor.cancelFirst&&d.appendChild(u);b.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){l.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",d.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();
|
||||
c(!1)}),x.className="geBtn",d.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});x.className="geBtn gePrimaryBtn";d.appendChild(x);b.editor.cancelFirst||d.appendChild(u);f.appendChild(d);this.container=f};var w=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=
|
||||
mxEvent.addListener(Q,"focus",function(){A.checked=!0});mxEvent.addListener(P,"focus",function(){A.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));I.appendChild(d);S.appendChild(G);S.appendChild(W);S.appendChild(R);O.appendChild(T);O.appendChild(V);O.appendChild(I);N.appendChild(S);N.appendChild(O);x.appendChild(N);g.appendChild(x);f.appendChild(g);g=document.createElement("div");d=document.createElement("div");d.style.fontWeight="bold";d.style.marginBottom=
|
||||
"12px";mxUtils.write(d,mxResources.get("paperSize"));g.appendChild(d);d=document.createElement("div");d.style.marginBottom="12px";var ba=PageSetupDialog.addPageFormatPanel(d,"printdialog",b.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(d);d=document.createElement("span");mxUtils.write(d,mxResources.get("pageScale"));g.appendChild(d);var U=document.createElement("input");U.style.cssText="margin:0 8px 0 8px;";U.setAttribute("value","100 %");U.style.width="60px";g.appendChild(U);
|
||||
f.appendChild(g);d=document.createElement("div");d.style.cssText="text-align:right;margin:62px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});g.className="geBtn";b.editor.cancelFirst&&d.appendChild(g);b.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){l.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",d.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();
|
||||
c(!1)}),x.className="geBtn",d.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();c(!0)});x.className="geBtn gePrimaryBtn";d.appendChild(x);b.editor.cancelFirst||d.appendChild(g);f.appendChild(d);this.container=f};var w=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)):(w.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))}})();
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,f,c){c.ui=a.ui;return f};a.afterDecode=function(a,f,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.5";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;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>';
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,f,c){c.ui=a.ui;return f};a.afterDecode=function(a,f,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="8.8.6";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging=/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;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=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
|
||||
EditorUi.prototype.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.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var b=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!b.getContext||!b.getContext("2d"))}catch(u){}try{var a=document.createElement("canvas"),c=new Image;c.onload=function(){try{a.getContext("2d").drawImage(c,0,0);var b=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=
|
||||
|
@ -7255,10 +7255,10 @@ a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)
|
|||
l=e+"."+b;if("xml"==b){var k='<?xml version="1.0" encoding="UTF-8"?>\n'+(a?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,f));this.saveData(l,b,k,"text/xml")}else if("html"==b)k=this.getHtml2(this.getFileData(!0),this.editor.graph,e),this.saveData(l,b,k,"text/html");else if("svg"!=b&&"xmlsvg"!=b||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==b?l=e+".png":"jpeg"==b&&(l=e+".jpg"),this.saveRequest(l,b,mxUtils.bind(this,function(a,c){try{var e=
|
||||
this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(a,b,d,c,w);this.editor.graph.pageVisible=e;return k}catch(B){this.handleError(B)}}));else{var q=null,u=mxUtils.bind(this,function(b){b.length<=MAX_REQUEST_SIZE?this.saveData(l,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(q)}))});if("svg"==b){var t=this.editor.graph.background;if(w||t==
|
||||
mxConstants.NONE)t=null;var h=this.editor.graph.getSvg(t,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(h);this.convertImages(h,mxUtils.bind(this,mxUtils.bind(this,function(b){this.spinner.stop();u('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(b))})))}else l=e+".svg",q=this.getFileData(!1,!0,null,mxUtils.bind(this,function(b){this.spinner.stop();u(b)}),d)}}catch(K){this.handleError(K)}};
|
||||
EditorUi.prototype.createDownloadRequest=function(b,a,c,d,f){var e=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=a);var l="";if(e.width*e.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==a&&(e="1",a="png",null!=this.pages&&null!=this.currentPage))for(var q=0;q<this.pages.length;q++)if(this.pages[q]==this.currentPage){l="&from="+q;break}q=this.editor.graph.background;"png"==a&&f&&(q=mxConstants.NONE);
|
||||
return new mxXmlRequest(EXPORT_URL,"format="+a+l+"&bg="+(null!=q?q:mxConstants.NONE)+"&base64="+d+"&embedXml="+e+"&xml="+encodeURIComponent(c)+(null!=b?"&filename="+encodeURIComponent(b):""))};EditorUi.prototype.setMode=function(b,a){this.mode=b};EditorUi.prototype.loadDescriptor=function(b,a,c){var e=window.location.hash,l=mxUtils.bind(this,function(c){var l=null!=b.data?b.data:"";null!=c&&0<c.length&&(0<l.length&&(l+="\n"),l+=c);c=new LocalFile(this,"csv"!=b.format&&0<l.length?l:this.emptyDiagramXml,
|
||||
EditorUi.prototype.createDownloadRequest=function(b,a,c,d,f){var e=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=a);var l="";if(e.width*e.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";if("xmlpng"==a&&(e="1",a="png",null!=this.pages&&null!=this.currentPage))for(var g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){l="&from="+g;break}g=this.editor.graph.background;"png"==a&&f&&(g=mxConstants.NONE);
|
||||
return new mxXmlRequest(EXPORT_URL,"format="+a+l+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+e+"&xml="+encodeURIComponent(c)+(null!=b?"&filename="+encodeURIComponent(b):""))};EditorUi.prototype.setMode=function(b,a){this.mode=b};EditorUi.prototype.loadDescriptor=function(b,a,c){var e=window.location.hash,l=mxUtils.bind(this,function(c){var l=null!=b.data?b.data:"";null!=c&&0<c.length&&(0<l.length&&(l+="\n"),l+=c);c=new LocalFile(this,"csv"!=b.format&&0<l.length?l:this.emptyDiagramXml,
|
||||
null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return e};this.fileLoaded(c);"csv"==b.format&&this.importCsv(l,mxUtils.bind(this,function(b){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=b.update){var d=null!=b.interval?parseInt(b.interval):6E4,k=null,f=mxUtils.bind(this,function(){var a=this.currentPage;mxUtils.post(b.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(b){a===this.currentPage&&(200<=b.getStatus()&&300>=b.getStatus()?(this.updateDiagram(b.getText()),q()):this.handleError({message:mxResources.get("error")+" "+b.getStatus()}))}),mxUtils.bind(this,function(b){this.handleError(b)}))}),q=mxUtils.bind(this,function(){window.clearTimeout(k);k=window.setTimeout(f,d)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){q();f()}));q();f()}null!=a&&a()});if(null!=b.url){var d=b.url;/^https?:\/\//.test(d)&&!this.isCorsEnabledForUrl(d)&&
|
||||
mxUtils.bind(this,function(b){a===this.currentPage&&(200<=b.getStatus()&&300>=b.getStatus()?(this.updateDiagram(b.getText()),g()):this.handleError({message:mxResources.get("error")+" "+b.getStatus()}))}),mxUtils.bind(this,function(b){this.handleError(b)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(k);k=window.setTimeout(f,d)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();f()}));g();f()}null!=a&&a()});if(null!=b.url){var d=b.url;/^https?:\/\//.test(d)&&!this.isCorsEnabledForUrl(d)&&
|
||||
(d=PROXY_URL+"?url="+encodeURIComponent(b.url));this.loadUrl(d,mxUtils.bind(this,function(b){l(b)}),mxUtils.bind(this,function(b){null!=c&&c(b)}))}else l(b.data)};EditorUi.prototype.updateDiagram=function(b){function a(b){var a=new mxCellOverlay(b.image||d.warningImage,b.tooltip,b.align,b.valign,b.offset);a.addListener(mxEvent.CLICK,function(a,c){editorUi.alert(b.tooltip)});return a}var c=null;if(null!=b&&0<b.length&&(c=mxUtils.parseXml(b),b=null!=c?c.documentElement:null,null!=b&&"updates"==b.nodeName)){var d=
|
||||
this.editor.graph,f=d.getModel();f.beginUpdate();var g=null;try{for(b=b.firstChild;null!=b;){if("update"==b.nodeName){var w=f.getCell(b.getAttribute("id"));if(null!=w){try{var h=b.getAttribute("value");if(null!=h){var m=mxUtils.parseXml(h).documentElement;if(null!=m)if("1"==m.getAttribute("replace-value"))f.setValue(w,m);else for(var k=m.attributes,v=0;v<k.length;v++)d.setAttributeForCell(w,k[v].nodeName,0<k[v].nodeValue.length?k[v].nodeValue:null)}}catch(B){null!=window.console&&console.log("Error in value for "+
|
||||
w.id+": "+B)}try{var n=b.getAttribute("style");null!=n&&d.model.setStyle(w,n)}catch(B){null!=window.console&&console.log("Error in style for "+w.id+": "+B)}try{var p=b.getAttribute("icon");if(null!=p){var y=0<p.length?JSON.parse(p):null;null!=y&&y.append||d.removeCellOverlays(w);null!=y&&d.addCellOverlay(w,a(y))}}catch(B){null!=window.console&&console.log("Error in icon for "+w.id+": "+B)}try{var K=b.getAttribute("geometry");if(null!=K){var K=JSON.parse(K),z=d.getCellGeometry(w);if(null!=z){z=z.clone();
|
||||
|
@ -7286,10 +7286,10 @@ w:c.width,h:c.height};null!=k&&(b.title=k);a.push(b);z(e);null!=d&&null!=d.paren
|
|||
c.y-=n.view.translate.y;D(a,c)}mxEvent.consume(b)});g.style.border="3px solid transparent";mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(b){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="hidden",null!=d?d.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)",g.style.cursor="copy",n.panningManager.stop(),n.autoScroll=!1,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!1),
|
||||
null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(b))}),mxUtils.bind(this,function(b){n.isMouseDown&&null!=n.panningManager&&null!=n.graphHandler&&(g.style.border="3px solid transparent",null!=d&&(d.style.border="3px dotted lightGray"),g.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,L(b),mxEvent.consume(b))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(b){n.isMouseDown&&
|
||||
null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",g.style.border="3px solid transparent",g.style.cursor="",n.autoScroll=!0,null!=n.graphHandler.guide&&n.graphHandler.guide.setVisible(!0),null!=n.graphHandler.hint&&(n.graphHandler.hint.style.visibility="visible"),null!=d&&(d.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(b){null!=d?d.style.border="3px dotted rgb(254, 137, 12)":g.style.border="3px dotted rgb(254, 137, 12)";
|
||||
b.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(b){g.style.border="3px solid transparent";g.style.cursor="";null!=d&&(d.style.border="3px dotted lightGray");0<b.dataTransfer.files.length&&this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,e,k,l,q,v,u,w,t){if(null!=c&&"image/"==e.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
|
||||
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,v),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,q,v),b,mxEvent.isAltDown(b)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var h=!1,m=mxUtils.bind(this,function(c,e){if(null!=c&&"text/xml"==e){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(k.documentElement));f(l,g);a=a.concat(l);z(b);
|
||||
this.spinner.stop();h=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var q=k.documentElement.getElementsByTagName("diagram"),k=0;k<q.length;k++){var l=mxUtils.getTextContent(q[k]),v=this.stringToCells(this.editor.graph.decompress(l)),u=this.editor.graph.getBoundingBoxFromGeometry(v);D(v,new mxRectangle(0,0,u.width,u.height),b)}h=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}h||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});null!=t&&null!=u&&(/(\.vsdx?)($|\?)/i.test(u)||/(\.vssx)($|\?)/i.test(u))?this.importVisio(t,function(b){m(b,"text/xml")},null,u):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,u)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?m(b.responseText,"text/xml"):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":
|
||||
b.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(b){g.style.border="3px solid transparent";g.style.cursor="";null!=d&&(d.style.border="3px dotted lightGray");0<b.dataTransfer.files.length&&this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,e,k,l,q,v,w,u,t){if(null!=c&&"image/"==e.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
|
||||
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,v),c)],c[0].vertex=!0,D(c,new mxRectangle(0,0,q,v),b,mxEvent.isAltDown(b)?null:w.substring(0,w.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var h=!1,m=mxUtils.bind(this,function(c,e){if(null!=c&&"text/xml"==e){var k=mxUtils.parseXml(c);if("mxlibrary"==k.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(k.documentElement));f(l,g);a=a.concat(l);z(b);
|
||||
this.spinner.stop();h=!0}catch(U){}else if("mxfile"==k.documentElement.nodeName)try{for(var q=k.documentElement.getElementsByTagName("diagram"),k=0;k<q.length;k++){var l=mxUtils.getTextContent(q[k]),v=this.stringToCells(this.editor.graph.decompress(l)),w=this.editor.graph.getBoundingBoxFromGeometry(v);D(v,new mxRectangle(0,0,w.width,w.height),b)}h=!0}catch(U){null!=window.console&&console.log("error in drop handler:",U)}}h||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});null!=t&&null!=w&&(/(\.vsdx?)($|\?)/i.test(w)||/(\.vssx)($|\?)/i.test(w))?this.importVisio(t,function(b){m(b,"text/xml")},null,w):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,w)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?m(b.responseText,"text/xml"):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":
|
||||
"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):m(c,e)}}));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(g,"dragleave",function(b){null!=d?d.style.border="3px dotted lightGray":(g.style.border="3px solid transparent",g.style.cursor="");b.stopPropagation();b.preventDefault()}));v=v.cloneNode(!1);v.setAttribute("src",Editor.editImage);v.setAttribute("title",mxResources.get("edit"));k.insertBefore(v,k.firstChild);mxEvent.addListener(v,"click",K);mxEvent.addListener(g,
|
||||
"dblclick",function(b){mxEvent.getSource(b)==g&&K(b)});c=v.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",L);this.isOffline()||".scratchpad"!=b.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,
|
||||
mxUtils.bind(this,function(b){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(b)})),k.insertBefore(c,k.firstChild))}h.appendChild(k);h.style.paddingRight=18*k.childNodes.length+"px"}};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var b=document.getElementById("geFooter");
|
||||
|
@ -7318,10 +7318,10 @@ this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exp
|
|||
"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=e.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";e=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=e.zIndex;var d=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});d.spin(this.exportDialog);
|
||||
this.exportToCanvas(mxUtils.bind(this,function(b){d.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var a=this.createImageDataUri(b,null,"png");b=document.createElement("img");b.style.maxWidth="140px";b.style.maxHeight="140px";b.style.cursor="pointer";b.setAttribute("title",mxResources.get("openInNewWindow"));b.setAttribute("border","0");b.setAttribute("src",a);this.exportDialog.appendChild(b);mxEvent.addListener(b,"click",mxUtils.bind(this,
|
||||
function(){this.openInNewWindow(a.substring(a.indexOf(",")+1),"image/png",!0);c.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}));mxEvent.addListener(this.editor.graph.container,"click",c);document.body.appendChild(this.exportDialog)}mxEvent.consume(b)}),Editor.cameraLargeImage,mxResources.get("export"))}d.apply(this,arguments)};EditorUi.prototype.saveData=function(b,a,c,d,f){this.isLocalFileSave()?this.saveLocalFile(c,
|
||||
b,d,f,a):this.saveRequest(b,a,mxUtils.bind(this,function(b,e){return this.createEchoRequest(c,b,d,f,a,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(b,a,c,d,f,g,h){h=null!=h?h:!mxClient.IS_IOS||!navigator.standalone;var e=this.getServiceCount(!1);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){if("_blank"==e||null!=b&&0<b.length){var k=c("_blank"==e?null:b,e==App.MODE_DEVICE||"download"==e||null==e||"_blank"==e?"0":"1");null!=k&&(e==App.MODE_DEVICE||"download"==e||"_blank"==e?k.simulate(document,
|
||||
b,d,f,a):this.saveRequest(b,a,mxUtils.bind(this,function(b,e){return this.createEchoRequest(c,b,d,f,a,e)}),c,f,d)};EditorUi.prototype.saveRequest=function(b,a,c,d,f,g,w){w=null!=w?w:!mxClient.IS_IOS||!navigator.standalone;var e=this.getServiceCount(!1);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,e){if("_blank"==e||null!=b&&0<b.length){var k=c("_blank"==e?null:b,e==App.MODE_DEVICE||"download"==e||null==e||"_blank"==e?"0":"1");null!=k&&(e==App.MODE_DEVICE||"download"==e||"_blank"==e?k.simulate(document,
|
||||
"_blank"):this.pickFolder(e,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==a?"application/pdf":"image/"+a;if(null!=d)try{this.exportFile(d,b,g,!0,e,c)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&k.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=k.getStatus()&&299>=k.getStatus())try{this.exportFile(k.getText(),b,g,!0,e,c)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(b){this.spinner.stop();
|
||||
this.handleError(b)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,h,null,1<e,4<e?3:4,d,g,f);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(b,a,c,d,f,g){};EditorUi.prototype.pickFolder=function(b,a,c){a(null)};EditorUi.prototype.exportSvg=function(b,a,c,d,f,g,h,m,n){if(this.spinner.spin(document.body,
|
||||
mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=a?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==a&&(e="#ffffff");var l=this.editor.graph.getSvg(e,b,h,m,null,c);d&&this.editor.graph.addSvgShadow(l);var q=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(b){this.spinner.stop();f&&b.setAttribute("content",this.getFileData(!0,null,null,null,c,n));if(null!=this.editor.fontCss){var a=b.ownerDocument,a=null!=a.createElementNS?
|
||||
this.handleError(b)})})))}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,w,null,1<e,4<e?3:4,d,g,f);this.showDialog(b.container,380,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(b,a,c,d,f,g){};EditorUi.prototype.pickFolder=function(b,a,c){a(null)};EditorUi.prototype.exportSvg=function(b,a,c,d,f,g,w,h,m){if(this.spinner.spin(document.body,
|
||||
mxResources.get("export"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;e=a?null:this.editor.graph.background;e==mxConstants.NONE&&(e=null);null==e&&0==a&&(e="#ffffff");var l=this.editor.graph.getSvg(e,b,w,h,null,c);d&&this.editor.graph.addSvgShadow(l);var q=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(b){this.spinner.stop();f&&b.setAttribute("content",this.getFileData(!0,null,null,null,c,m));if(null!=this.editor.fontCss){var a=b.ownerDocument,a=null!=a.createElementNS?
|
||||
a.createElementNS(mxConstants.NS_SVG,"style"):a.createElement("style");a.setAttribute("type","text/css");mxUtils.setTextContent(a,this.editor.fontCss);b.getElementsByTagName("defs")[0].appendChild(a)}var e='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(b);this.isLocalFileSave()||e.length<=MAX_REQUEST_SIZE?this.saveData(q,"svg",e,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),
|
||||
mxUtils.bind(this,function(){mxUtils.popup(e)}))});this.convertMath(this.editor.graph,l,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(l,u,this.thumbImageCache)):u(l)}))}};EditorUi.prototype.addCheckbox=function(b,a,c,d,f,g){g=null!=g?g:!0;var e=document.createElement("input");e.style.marginRight="8px";e.style.marginTop="16px";e.setAttribute("type","checkbox");c&&(e.setAttribute("checked","checked"),e.defaultChecked=!0);d&&e.setAttribute("disabled",
|
||||
"disabled");g&&(b.appendChild(e),c=document.createElement("span"),mxUtils.write(c,a),b.appendChild(c),f||mxUtils.br(b),mxEvent.addListener(c,"click",mxUtils.bind(this,function(b){"disabled"!=e.getAttribute("disabled")&&(e.checked=!e.checked,mxEvent.consume(b))})));return e};EditorUi.prototype.addEditButton=function(b,a){var c=this.addCheckbox(b,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var e=this.getCurrentFile(),d="";null!=e&&e.getMode()!=App.MODE_DEVICE&&e.getMode()!=App.MODE_BROWSER&&
|
||||
|
@ -7335,43 +7335,43 @@ k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));if(c&&null
|
|||
b&&null!=e&&null!=e.getTitle()&&e.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(e.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(b,a,c,d,f,g,h,m,n,k,v){this.getBasenames();var e={};""!=f&&f!=mxConstants.NONE&&(e.highlight=f);"auto"!==d&&(e.target=d);n||(e.lightbox=!1);e.nav=this.editor.graph.foldingEnabled;
|
||||
c=parseInt(c);isNaN(c)||100==c||(e.zoom=c/100);c=[];h&&(c.push("pages"),e.resize=!0,null!=this.pages&&null!=this.currentPage&&(e.page=mxUtils.indexOf(this.pages,this.currentPage)));a&&(c.push("zoom"),e.resize=!0);m&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),e.toolbar=c.join(" "));null!=k&&0<k.length&&(e.edit=k);null!=b?e.url=b:e.xml=this.getFileData(!0,null,null,null,null,!h);a='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+
|
||||
mxUtils.htmlEntities(JSON.stringify(e))+'"></div>';b=null!=b?"&fetch="+encodeURIComponent(b):"";v(a,'<script type="text/javascript" src="'+(0<b.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+b:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(b,a,c,d){var e=document.createElement("div");e.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";e.appendChild(f);var l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");f=g.cloneNode(!0);f.setAttribute("value",
|
||||
"copy");l.appendChild(f);var q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));l.appendChild(q);mxUtils.br(l);l.appendChild(g);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));l.appendChild(q);var k=this.getCurrentFile();null==c&&null!=k&&k.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),
|
||||
l.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));f.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");e.appendChild(l);var v=this.addLinkSection(e),h=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight=
|
||||
"12px";m.value="100%";e.appendChild(m);var n=this.addCheckbox(e,mxResources.get("fit"),!0),l=null!=this.pages&&1<this.pages.length,p=p=this.addCheckbox(e,mxResources.get("allPages"),l,!l),z=this.addCheckbox(e,mxResources.get("layers"),!0),D=this.addCheckbox(e,mxResources.get("lightbox"),!0),L=this.addEditButton(e,D),B=L.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&D.checked?
|
||||
L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){d(g.checked?c:null,h.checked,m.value,v.getTarget(),v.getColor(),n.checked,p.checked,z.checked,D.checked,L.getLink())}),null,b,a);this.showDialog(b.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace="nowrap";var l=document.createElement("h3");
|
||||
mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","type-embedhtmldialog");f=l.cloneNode(!0);f.setAttribute("value",
|
||||
"copy");g.appendChild(f);var q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(q);mxUtils.br(g);g.appendChild(l);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));g.appendChild(q);var k=this.getCurrentFile();null==c&&null!=k&&k.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),
|
||||
g.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));f.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");e.appendChild(g);var v=this.addLinkSection(e),h=this.addCheckbox(e,mxResources.get("zoom"),!0,null,!0);mxUtils.write(e,":");var m=document.createElement("input");m.setAttribute("type","text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.style.marginRight=
|
||||
"12px";m.value="100%";e.appendChild(m);var n=this.addCheckbox(e,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,p=p=this.addCheckbox(e,mxResources.get("allPages"),g,!g),z=this.addCheckbox(e,mxResources.get("layers"),!0),D=this.addCheckbox(e,mxResources.get("lightbox"),!0),L=this.addEditButton(e,D),B=L.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(D,"change",function(){D.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&D.checked?
|
||||
L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,e,mxUtils.bind(this,function(){d(l.checked?c:null,h.checked,m.value,v.getTarget(),v.getColor(),n.checked,p.checked,z.checked,D.checked,L.getLink())}),null,b,a);this.showDialog(b.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,f,g){var e=document.createElement("div");e.style.whiteSpace="nowrap";var l=document.createElement("h3");
|
||||
mxUtils.write(l,b||mxResources.get("link"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";e.appendChild(l);var q=this.getCurrentFile(),l="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=q&&q.constructor==window.DriveFile&&!a){b=80;var l="https://desk.draw.io/support/solutions/articles/16000039384",k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
|
||||
var v=document.createElement("div");v.style.whiteSpace="normal";mxUtils.write(v,mxResources.get("linkAccountRequired"));k.appendChild(v);v=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(q.getId())}));v.style.marginTop="12px";v.className="geBtn";k.appendChild(v);e.appendChild(k);v=document.createElement("a");v.style.paddingLeft="12px";v.style.color="gray";v.style.fontSize="11px";v.setAttribute("href","javascript:void(0);");mxUtils.write(v,mxResources.get("check"));
|
||||
k.appendChild(v);mxEvent.addListener(v,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(b){this.spinner.stop();b=new ErrorDialog(this,null,mxResources.get(null!=b?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(b.container,300,80,!0,!1);b.init()}))}))}var h=null,m=null;if(null!=c||null!=d)b+=30,mxUtils.write(e,mxResources.get("width")+":"),h=document.createElement("input"),
|
||||
h.setAttribute("type","text"),h.style.marginRight="16px",h.style.width="50px",h.style.marginLeft="6px",h.style.marginRight="16px",h.style.marginBottom="10px",h.value="100%",e.appendChild(h),mxUtils.write(e,mxResources.get("height")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.width="50px",m.style.marginLeft="6px",m.style.marginBottom="10px",m.value=d+"px",e.appendChild(m),mxUtils.br(e);var u=this.addLinkSection(e,g);c=null!=this.pages&&1<this.pages.length;var n=null;
|
||||
if(null==q||q.constructor!=window.DriveFile||a)n=this.addCheckbox(e,mxResources.get("allPages"),c,!c);var t=this.addCheckbox(e,mxResources.get("lightbox"),!0),p=this.addEditButton(e,t),L=p.getEditInput(),B=this.addCheckbox(e,mxResources.get("layers"),!0);B.style.marginLeft=L.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(t,"change",function(){t.checked?(B.removeAttribute("disabled"),L.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),L.setAttribute("disabled",
|
||||
"disabled"));L.checked&&t.checked?p.getEditSelect().removeAttribute("disabled"):p.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){f(u.getTarget(),u.getColor(),null==n?!0:n.checked,t.checked,p.getLink(),B.checked,null!=h?h.value:null,null!=m?m.value:null)}),null,mxResources.get("create"),l);this.showDialog(a.container,340,254+b,!0,!0);null!=h?(h.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?h.select():
|
||||
document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.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";e.appendChild(f);var l=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),
|
||||
!0),f=this.editor.graph,q=d?null:this.addCheckbox(e,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=q&&(q.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!l.checked,null!=g?g.checked:!1,null!=q?q.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,f,g,h,m){h=null!=h?h:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var k=
|
||||
this.editor.graph,l="jpeg"==m?196:300,q=document.createElement("h3");mxUtils.write(q,b);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(q);mxUtils.write(e,mxResources.get("zoom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.style.marginRight="12px";u.value=this.lastExportZoom||"100%";e.appendChild(u);mxUtils.write(e,mxResources.get("borderWidth")+":");
|
||||
var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.value=this.lastExportBorder||"0";e.appendChild(n);mxUtils.br(e);var w=this.addCheckbox(e,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=m),t=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),p=document.createElement("input");p.style.marginTop="16px";p.style.marginRight=
|
||||
document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var e=document.createElement("div");e.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";e.appendChild(f);var g=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=d?null:this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),
|
||||
!0),f=this.editor.graph,q=d?null:this.addCheckbox(e,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=q&&(q.style.marginBottom="16px");b=new CustomDialog(this,e,mxUtils.bind(this,function(){c(!g.checked,null!=l?l.checked:!1,null!=q?q.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,f,g,h,m){h=null!=h?h:!0;var e=document.createElement("div");e.style.whiteSpace="nowrap";var k=
|
||||
this.editor.graph,l="jpeg"==m?196:300,q=document.createElement("h3");mxUtils.write(q,b);q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";e.appendChild(q);mxUtils.write(e,mxResources.get("zoom")+":");var w=document.createElement("input");w.setAttribute("type","text");w.style.marginRight="16px";w.style.width="60px";w.style.marginLeft="4px";w.style.marginRight="12px";w.value=this.lastExportZoom||"100%";e.appendChild(w);mxUtils.write(e,mxResources.get("borderWidth")+":");
|
||||
var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.value=this.lastExportBorder||"0";e.appendChild(n);mxUtils.br(e);var u=this.addCheckbox(e,mxResources.get("transparentBackground"),k.background==mxConstants.NONE||null==k.background,null,null,"jpeg"!=m),t=this.addCheckbox(e,mxResources.get("selectionOnly"),!1,k.isSelectionEmpty()),p=document.createElement("input");p.style.marginTop="16px";p.style.marginRight=
|
||||
"8px";p.style.marginLeft="24px";p.setAttribute("disabled","disabled");p.setAttribute("type","checkbox");g&&(e.appendChild(p),mxUtils.write(e,mxResources.get("crop")),mxUtils.br(e),l+=26,mxEvent.addListener(t,"change",function(){t.checked?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled")}));k.isSelectionEmpty()||(p.setAttribute("checked","checked"),p.defaultChecked=!0);var x=this.addCheckbox(e,mxResources.get("shadow"),k.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");a&&(e.appendChild(B),mxUtils.write(e,mxResources.get("embedImages")),mxUtils.br(e),l+=26);var H=this.addCheckbox(e,mxResources.get("includeCopyOfMyDiagram"),h,null,null,"jpeg"!=m),E=null!=this.pages&&1<this.pages.length,J=this.addCheckbox(e,E?mxResources.get("allPages"):"",E,!E,null,"jpeg"!=m);J.style.marginLeft="24px";J.style.marginBottom="16px";E||(J.style.visibility=
|
||||
"hidden");mxEvent.addListener(H,"change",function(){H.checked&&E?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});h&&E||J.setAttribute("disabled","disabled");b=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=n.value;this.lastExportZoom=u.value;f(u.value,w.checked,!t.checked,x.checked,H.checked,B.checked,n.value,p.checked,!J.checked)}),null,c,d);this.showDialog(b.container,340,l,!0,!0);u.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
||||
mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var l=this.editor.graph;if(null!=a){var g=document.createElement("h3");mxUtils.write(g,a);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(g)}var q=this.addCheckbox(e,mxResources.get("fit"),!0),k=this.addCheckbox(e,mxResources.get("shadow"),l.shadowVisible&&d,
|
||||
!d),v=this.addCheckbox(e,c),h=this.addCheckbox(e,mxResources.get("lightbox"),!0),m=this.addEditButton(e,h),u=m.getEditInput(),n=1<l.model.getChildCount(l.model.getRoot()),p=this.addCheckbox(e,mxResources.get("layers"),n,!n);p.style.marginLeft=u.style.marginLeft;p.style.marginBottom="12px";p.style.marginTop="8px";mxEvent.addListener(h,"change",function(){h.checked?(n&&p.removeAttribute("disabled"),u.removeAttribute("disabled")):(p.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));
|
||||
u.checked&&h.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(q.checked,k.checked,v.checked,h.checked,m.getLink(),p.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,g,h,m){function e(a){var e=" ",l="";d&&(e=" 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('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");b&&(l+="max-width:100%;");var q="";c&&(q=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');h('<img src="'+a+'"'+q+(""!=l?' style="'+l+'"':"")+e+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(b){var a=d?this.getFileData(!0):null;b=this.createImageDataUri(b,a,"png");e(b)}),null,null,null,mxUtils.bind(this,function(b){m({message:mxResources.get("unknownError")})}),
|
||||
"hidden");mxEvent.addListener(H,"change",function(){H.checked&&E?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")});h&&E||J.setAttribute("disabled","disabled");b=new CustomDialog(this,e,mxUtils.bind(this,function(){this.lastExportBorder=n.value;this.lastExportZoom=w.value;f(w.value,u.checked,!t.checked,x.checked,H.checked,B.checked,n.value,p.checked,!J.checked)}),null,c,d);this.showDialog(b.container,340,l,!0,!0);w.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
||||
mxClient.IS_QUIRKS?w.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,f){var e=document.createElement("div");e.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=a){var l=document.createElement("h3");mxUtils.write(l,a);l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";e.appendChild(l)}var q=this.addCheckbox(e,mxResources.get("fit"),!0),k=this.addCheckbox(e,mxResources.get("shadow"),g.shadowVisible&&d,
|
||||
!d),v=this.addCheckbox(e,c),h=this.addCheckbox(e,mxResources.get("lightbox"),!0),m=this.addEditButton(e,h),n=m.getEditInput(),u=1<g.model.getChildCount(g.model.getRoot()),p=this.addCheckbox(e,mxResources.get("layers"),u,!u);p.style.marginLeft=n.style.marginLeft;p.style.marginBottom="12px";p.style.marginTop="8px";mxEvent.addListener(h,"change",function(){h.checked?(u&&p.removeAttribute("disabled"),n.removeAttribute("disabled")):(p.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled"));
|
||||
n.checked&&h.checked?m.getEditSelect().removeAttribute("disabled"):m.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,e,mxUtils.bind(this,function(){b(q.checked,k.checked,v.checked,h.checked,m.getLink(),p.checked)}),null,mxResources.get("embed"),f);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,f,g,h,m){function e(a){var e=" ",l="";d&&(e=" 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('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");b&&(l+="max-width:100%;");var v="";c&&(v=' width="'+Math.round(k.width)+'" height="'+Math.round(k.height)+'"');h('<img src="'+a+'"'+v+(""!=l?' style="'+l+'"':"")+e+"/>")}var k=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(b){var a=d?this.getFileData(!0):null;b=this.createImageDataUri(b,a,"png");e(b)}),null,null,null,mxUtils.bind(this,function(b){m({message:mxResources.get("unknownError")})}),
|
||||
null,!0,c?2:1,null,a);else if(a=this.getFileData(!0),k.width*k.height<=MAX_AREA&&a.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*k.width)+"&h="+Math.round(2*k.height));var q=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+l+"&xml="+encodeURIComponent(a));q.send(mxUtils.bind(this,function(){200<=q.getStatus()&&299>=q.getStatus()?e("data:image/png;base64,"+q.getText()):m({message:mxResources.get("unknownError")})}))}else m({message:mxResources.get("drawingTooLarge")})};
|
||||
EditorUi.prototype.createEmbedSvg=function(b,a,c,d,f,g,h){var e=this.editor.graph.getSvg(),l=e.getElementsByTagName("a");if(null!=l)for(var k=0;k<l.length;k++){var q=l[k].getAttribute("href");null!=q&&"#"==q.charAt(0)&&"_blank"==l[k].getAttribute("target")&&l[k].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));a&&this.editor.graph.addSvgShadow(e);if(c){var m=" ",u="";d&&(m="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('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",u+="cursor:pointer;");b&&(u+="max-width:100%;");this.convertImages(e,mxUtils.bind(this,function(b){h('<img src="'+this.createSvgDataUri(mxUtils.getXml(b))+'"'+(""!=u?' style="'+u+'"':"")+m+"/>")}))}else u="",d&&(e.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),u+="cursor:pointer;"),b&&(b=parseInt(e.getAttribute("width")),a=parseInt(e.getAttribute("height")),e.setAttribute("viewBox","0 0 "+b+" "+a),u+="max-width:100%;max-height:"+a+"px;",e.removeAttribute("height")),""!=u&&e.setAttribute("style",u),h(mxUtils.getXml(e))};EditorUi.prototype.timeSince=function(b){b=Math.floor((new Date-b)/1E3);var a=Math.floor(b/31536E3);if(1<a)return a+" "+mxResources.get("years");a=Math.floor(b/2592E3);if(1<a)return a+
|
||||
EditorUi.prototype.createEmbedSvg=function(b,a,c,d,f,g,h){var e=this.editor.graph.getSvg(),l=e.getElementsByTagName("a");if(null!=l)for(var k=0;k<l.length;k++){var v=l[k].getAttribute("href");null!=v&&"#"==v.charAt(0)&&"_blank"==l[k].getAttribute("target")&&l[k].removeAttribute("target")}d&&e.setAttribute("content",this.getFileData(!0));a&&this.editor.graph.addSvgShadow(e);if(c){var q=" ",m="";d&&(q="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('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");b&&(m+="max-width:100%;");this.convertImages(e,mxUtils.bind(this,function(b){h('<img src="'+this.createSvgDataUri(mxUtils.getXml(b))+'"'+(""!=m?' style="'+m+'"':"")+q+"/>")}))}else m="",d&&(e.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(f?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),m+="cursor:pointer;"),b&&(b=parseInt(e.getAttribute("width")),a=parseInt(e.getAttribute("height")),e.setAttribute("viewBox","0 0 "+b+" "+a),m+="max-width:100%;max-height:"+a+"px;",e.removeAttribute("height")),""!=m&&e.setAttribute("style",m),h(mxUtils.getXml(e))};EditorUi.prototype.timeSince=function(b){b=Math.floor((new Date-b)/1E3);var a=Math.floor(b/31536E3);if(1<a)return a+" "+mxResources.get("years");a=Math.floor(b/2592E3);if(1<a)return a+
|
||||
" "+mxResources.get("months");a=Math.floor(b/86400);if(1<a)return a+" "+mxResources.get("days");a=Math.floor(b/3600);if(1<a)return a+" "+mxResources.get("hours");a=Math.floor(b/60);return 1<a?a+" "+mxResources.get("minutes"):1==a?a+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(b,a,c,d){d()};EditorUi.prototype.decodeNodeIntoGraph=function(b,a){if(null!=b){var c=null;if("diagram"==b.nodeName)c=b;else if("mxfile"==b.nodeName){var e=b.getElementsByTagName("diagram");if(0<
|
||||
e.length){var c=e[0],d=a.getGlobalVariable;a.getGlobalVariable=function(b){return"page"==b?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==b?1:d.apply(this,arguments)}}}null!=c&&(e=a.decompress(mxUtils.getTextContent(c)),null!=e&&0<e.length&&(b=mxUtils.parseXml(e).documentElement))}e=this.editor.graph;try{this.editor.graph=a,this.editor.setGraphXml(b)}catch(t){}finally{this.editor.graph=e}return b};EditorUi.prototype.getEmbeddedPng=function(b,a,c){var e=this.editor.graph,
|
||||
d=null;if(null!=c&&0<c.length)e=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(e.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),e),d=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var e=this.createTemporaryGraph(e.getStylesheet()),f=e.getGlobalVariable,l=this.pages[0];e.getGlobalVariable=function(b){return"page"==b?l.getName():"pagenumber"==b?1:f.apply(this,arguments)};document.body.appendChild(e.container);
|
||||
e.model.setRoot(l.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==d&&(d=this.getFileData(!0));var f=c.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(d)));b(f.substring(f.lastIndexOf(",")+1));e!=this.editor.graph&&e.container.parentNode.removeChild(e.container)}catch(k){null!=a&&a(k)}}),null,null,null,mxUtils.bind(this,function(b){null!=a&&a(b)}),null,null,null,null,e.shadowVisible,null,e)};EditorUi.prototype.getEmbeddedSvg=
|
||||
d=null;if(null!=c&&0<c.length)e=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(e.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),e),d=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var e=this.createTemporaryGraph(e.getStylesheet()),f=e.getGlobalVariable,g=this.pages[0];e.getGlobalVariable=function(b){return"page"==b?g.getName():"pagenumber"==b?1:f.apply(this,arguments)};document.body.appendChild(e.container);
|
||||
e.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==d&&(d=this.getFileData(!0));var f=c.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(d)));b(f.substring(f.lastIndexOf(",")+1));e!=this.editor.graph&&e.container.parentNode.removeChild(e.container)}catch(k){null!=a&&a(k)}}),null,null,null,mxUtils.bind(this,function(b){null!=a&&a(b)}),null,null,null,null,e.shadowVisible,null,e)};EditorUi.prototype.getEmbeddedSvg=
|
||||
function(b,a,c,d,f,g,h){h=a.background;h==mxConstants.NONE&&(h=null);a=a.getSvg(h,null,null,null,null,g);null!=b&&a.setAttribute("content",b);null!=c&&a.setAttribute("resource",c);if(null!=f)this.convertImages(a,mxUtils.bind(this,function(b){f((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(b))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
||||
mxUtils.getXml(a)};EditorUi.prototype.exportImage=function(b,a,c,d,f,g,h,m,n){n=null!=n?n:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var e=this.editor.graph.isSelectionEmpty();c=null!=c?c:e;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(b){this.spinner.stop();try{this.saveCanvas(b,f?this.getFileData(!0,null,null,null,c,m):null,n)}catch(F){"Invalid image"==F.message?this.downloadFile(n):this.handleError(F)}}),null,
|
||||
this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}),null,c,b||1,a,d,null,null,g,h)}catch(v){this.spinner.stop(),this.handleError(v)}}};EditorUi.prototype.loadFonts=function(b){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var a=function(b){return b.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,f={},g=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],k=1;k<c.length;k++){var g=
|
||||
c[k].indexOf(")");e.push('url("');e.push(f[a(c[k].substring(0,g))]);e.push('"'+c[k].substring(g))}this.editor.resolvedFontCss=e.join("");b()}});if(0<c.length)for(var h=1;h<c.length;h++){var m=c[h].indexOf(")"),n=null,k=c[h].indexOf("format(",m);0<k&&(n=a(c[h].substring(k+7,c[h].indexOf(")",k))));mxUtils.bind(this,function(b){if(null==f[b]){f[b]=b;d++;var a="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(b))a="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(b))a=
|
||||
"application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(b))a="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(b))a="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(b))a="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(b))a="application/font-sfnt";var c=b;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(b));this.loadUrl(c,mxUtils.bind(this,function(a){f[b]=a;d--;g()}),mxUtils.bind(this,
|
||||
function(b){d--;g()}),!0,null,"data:"+a+";charset=utf-8;base64,")}})(a(c[h].substring(0,m)),n)}}else b()};EditorUi.prototype.exportToCanvas=function(b,a,c,d,f,g,h,m,n,k,v,p,C,y){g=null!=g?g:!0;p=null!=p?p:this.editor.graph;C=null!=C?C:0;var e=n?null:p.background;e==mxConstants.NONE&&(e=null);null==e&&(e=d);null==e&&0==n&&(e=this.editor.graph.defaultPageBackgroundColor);this.convertImages(p.getSvg(e,null,null,y,null,null!=h?h:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,
|
||||
function(){try{var k=document.createElement("canvas"),l=parseInt(c.getAttribute("width")),h=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=a&&(m=g?Math.min(1,Math.min(3*a/(4*h),a/l)):a/l);l=Math.ceil(m*l)+2*C;h=Math.ceil(m*h)+2*C;k.setAttribute("width",l);k.setAttribute("height",h);var q=k.getContext("2d");null!=e&&(q.beginPath(),q.rect(0,0,l,h),q.fillStyle=e,q.fill());q.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(d,C/m,C/m);b(k)},0):(q.drawImage(d,C/m,C/m),b(k))}catch(M){null!=
|
||||
function(){try{var k=document.createElement("canvas"),l=parseInt(c.getAttribute("width")),h=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=a&&(m=g?Math.min(1,Math.min(3*a/(4*h),a/l)):a/l);l=Math.ceil(m*l)+2*C;h=Math.ceil(m*h)+2*C;k.setAttribute("width",l);k.setAttribute("height",h);var v=k.getContext("2d");null!=e&&(v.beginPath(),v.rect(0,0,l,h),v.fillStyle=e,v.fill());v.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){v.drawImage(d,C/m,C/m);b(k)},0):(v.drawImage(d,C/m,C/m),b(k))}catch(M){null!=
|
||||
f&&f(M)}});d.onerror=function(b){null!=f&&f(b)};try{k&&this.editor.graph.addSvgShadow(c);var l=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var b=document.createElement("style");b.setAttribute("type","text/css");b.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(b)}this.convertMath(p,c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(l)}catch(B){null!=f&&f(B)}}),c,v)};EditorUi.prototype.createImageUrlConverter=
|
||||
function(){var b=new mxUrlConverter;b.updateBaseUrl();var a=b.convert,c=this;b.convert=function(e){if(null!=e){var d="http://"==e.substring(0,7)||"https://"==e.substring(0,8);d&&!navigator.onLine?e=c.svgBrokenImage.src:!d||e.substring(0,b.baseUrl.length)==b.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(e)?"chrome-extension://"!=e.substring(0,19)&&(e=a.apply(this,arguments)):e=PROXY_URL+"?url="+encodeURIComponent(e)}return e};return b};EditorUi.prototype.convertImages=function(b,a,c,d){null==
|
||||
d&&(d=this.createImageUrlConverter());var e=0,f=c||{};c=mxUtils.bind(this,function(c,g){for(var l=b.getElementsByTagName(c),k=0;k<l.length;k++)mxUtils.bind(this,function(c){var k=d.convert(c.getAttribute(g));if(null!=k&&"data:"!=k.substring(0,5)){var l=f[k];null==l?(e++,this.convertImageToDataUri(k,function(d){null!=d&&(f[k]=d,c.setAttribute(g,d));e--;0==e&&a(b)})):c.setAttribute(g,l)}else null!=k&&c.setAttribute(g,k)})(l[k])});c("image","xlink:href");c("img","src");0==e&&a(b)};EditorUi.prototype.loadUrl=
|
||||
|
@ -7398,17 +7398,17 @@ l.snap(d)),l=[l.insertVertex(null,null,"",c,d,f,g,"shape=image;verticalLabelPosi
|
|||
this.isRemoteFileFormat(b,h)?(e=!0,this.parseFile(null!=n?n:new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&(200<=b.status&&299>=b.status?q(b.responseText):null!=m&&m(null))}),h)):/(\.vsd)($|\?)/i.test(h)||(l=this.insertTextAt(this.validateFileData(b),c,d,!0,null,k));e||null==m||m(l);return l};EditorUi.prototype.base64Encode=function(b){for(var a="",c=0,d=b.length,f,g,h;c<d;){f=b.charCodeAt(c++)&255;if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>
|
||||
2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);a+="==";break}g=b.charCodeAt(c++);if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);a+="=";break}h=b.charCodeAt(c++);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>
|
||||
2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(h&192)>>6);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,f,g,h,m,n,k,v,p){a=null!=a?a:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;k=null!=k?k:this.maxImageBytes;var e=null!=a&&null!=c,l=!0,q=!1;if(!mxClient.IS_CHROMEAPP&&
|
||||
null!=b)for(var u=v||this.resampleThreshold,w=0;w<b.length;w++)if("image/"==b[w].type.substring(0,6)&&b[w].size>u){q=!0;break}var t=mxUtils.bind(this,function(){var q=this.editor.graph,n=q.gridSize;f=null!=f?f:mxUtils.bind(this,function(b,a,c,d,f,k,g,l,h){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,g)),null):this.importFile(b,a,c,d,f,k,g,l,h,e,p)});g=null!=g?g:mxUtils.bind(this,function(b){q.setSelectionCells(b)});if(this.spinner.spin(document.body,
|
||||
mxResources.get("loading")))for(var u=b.length,w=u,t=[],x=mxUtils.bind(this,function(b,a){t[b]=a;if(0==--w){this.spinner.stop();if(null!=m)m(t);else{var c=[];q.getModel().beginUpdate();try{for(var e=0;e<t.length;e++){var d=t[e]();null!=d&&(c=c.concat(d))}}finally{q.getModel().endUpdate()}}g(c)}}),F=0;F<u;F++)mxUtils.bind(this,function(e){var g=b[e],m=new FileReader;m.onload=mxUtils.bind(this,function(b){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m=
|
||||
b.target.result,u=m.indexOf(","),w=decodeURIComponent(escape(atob(m.substring(u+1)))),t=mxUtils.parseXml(w),w=t.getElementsByTagName("svg");if(0<w.length){var w=w[0],B=p?null:w.getAttribute("content");null!=B&&"<"!=B.charAt(0)&&"%"!=B.charAt(0)&&(B=unescape(window.atob?atob(B):Base64.decode(B,!0)));null!=B&&"%"==B.charAt(0)&&(B=decodeURIComponent(B));null==B||"<mxfile "!==B.substring(0,8)&&"<mxGraphModel "!==B.substring(0,14)?x(e,mxUtils.bind(this,function(){try{if(m.substring(0,u+1),null!=t){var b=
|
||||
t.getElementsByTagName("svg");if(0<b.length){var k=b[0],h=parseFloat(k.getAttribute("width")),v=parseFloat(k.getAttribute("height")),p=k.getAttribute("viewBox");if(null==p||0==p.length)k.setAttribute("viewBox","0 0 "+h+" "+v);else if(isNaN(h)||isNaN(v)){var w=p.split(" ");3<w.length&&(h=parseFloat(w[2]),v=parseFloat(w[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var B=Math.min(1,Math.min(d/Math.max(1,h)),d/Math.max(1,v)),x=f(m,g.type,a+e*n,c+e*n,Math.max(1,Math.round(h*B)),Math.max(1,Math.round(v*
|
||||
null!=b)for(var w=v||this.resampleThreshold,t=0;t<b.length;t++)if("image/"==b[t].type.substring(0,6)&&b[t].size>w){q=!0;break}var u=mxUtils.bind(this,function(){var q=this.editor.graph,n=q.gridSize;f=null!=f?f:mxUtils.bind(this,function(b,a,c,d,f,k,g,l,h){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,g)),null):this.importFile(b,a,c,d,f,k,g,l,h,e,p)});g=null!=g?g:mxUtils.bind(this,function(b){q.setSelectionCells(b)});if(this.spinner.spin(document.body,
|
||||
mxResources.get("loading")))for(var w=b.length,t=w,u=[],x=mxUtils.bind(this,function(b,a){u[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(u);else{var c=[];q.getModel().beginUpdate();try{for(var e=0;e<u.length;e++){var d=u[e]();null!=d&&(c=c.concat(d))}}finally{q.getModel().endUpdate()}}g(c)}}),F=0;F<w;F++)mxUtils.bind(this,function(e){var g=b[e],m=new FileReader;m.onload=mxUtils.bind(this,function(b){if(null==h||h(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var m=
|
||||
b.target.result,w=m.indexOf(","),t=decodeURIComponent(escape(atob(m.substring(w+1)))),u=mxUtils.parseXml(t),t=u.getElementsByTagName("svg");if(0<t.length){var t=t[0],B=p?null:t.getAttribute("content");null!=B&&"<"!=B.charAt(0)&&"%"!=B.charAt(0)&&(B=unescape(window.atob?atob(B):Base64.decode(B,!0)));null!=B&&"%"==B.charAt(0)&&(B=decodeURIComponent(B));null==B||"<mxfile "!==B.substring(0,8)&&"<mxGraphModel "!==B.substring(0,14)?x(e,mxUtils.bind(this,function(){try{if(m.substring(0,w+1),null!=u){var b=
|
||||
u.getElementsByTagName("svg");if(0<b.length){var k=b[0],h=parseFloat(k.getAttribute("width")),v=parseFloat(k.getAttribute("height")),p=k.getAttribute("viewBox");if(null==p||0==p.length)k.setAttribute("viewBox","0 0 "+h+" "+v);else if(isNaN(h)||isNaN(v)){var t=p.split(" ");3<t.length&&(h=parseFloat(t[2]),v=parseFloat(t[3]))}m=this.createSvgDataUri(mxUtils.getXml(k));var B=Math.min(1,Math.min(d/Math.max(1,h)),d/Math.max(1,v)),x=f(m,g.type,a+e*n,c+e*n,Math.max(1,Math.round(h*B)),Math.max(1,Math.round(v*
|
||||
B)),g.name,l);if(isNaN(h)||isNaN(v)){var E=new Image;E.onload=mxUtils.bind(this,function(){h=Math.max(1,E.width);v=Math.max(1,E.height);x[0].geometry.width=h;x[0].geometry.height=v;k.setAttribute("viewBox","0 0 "+h+" "+v);m=this.createSvgDataUri(mxUtils.getXml(k));var b=m.indexOf(";");0<b&&(m=m.substring(0,b)+m.substring(m.indexOf(",",b+1)));q.setCellStyles("image",m,[x[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(k))}return x}}}catch(da){}return null})):x(e,mxUtils.bind(this,function(){return f(B,
|
||||
"text/xml",a+e*n,c+e*n,0,0,g.name)}))}}else{w=!1;if("image/png"==g.type){var E=p?null:this.extractGraphModelFromPng(b.target.result);if(null!=E&&0<E.length){var F=new Image;F.src=b.target.result;x(e,mxUtils.bind(this,function(){return f(E,"text/xml",a+e*n,c+e*n,F.width,F.height,g.name)}));w=!0}}w||(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(b.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,b.target.result,mxUtils.bind(this,function(h,m,q){x(e,mxUtils.bind(this,function(){if(null!=h&&h.length<k){var u=l&&this.isResampleImage(b.target.result,v)?Math.min(1,Math.min(d/m,d/q)):1;return f(h,g.type,a+e*n,c+e*n,Math.round(m*u),Math.round(q*u),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,v)}),mxUtils.bind(this,
|
||||
function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else f(b.target.result,g.type,a+e*n,c+e*n,240,160,g.name,function(b){x(e,function(){return b})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?f(null,g.type,a+e*n,c+e*n,240,160,g.name,function(b){x(e,function(){return b})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)})(F)});q?this.confirmImageResize(function(b){l=b;t()},n):t()};EditorUi.prototype.confirmImageResize=function(b,
|
||||
"text/xml",a+e*n,c+e*n,0,0,g.name)}))}}else{t=!1;if("image/png"==g.type){var E=p?null:this.extractGraphModelFromPng(b.target.result);if(null!=E&&0<E.length){var F=new Image;F.src=b.target.result;x(e,mxUtils.bind(this,function(){return f(E,"text/xml",a+e*n,c+e*n,F.width,F.height,g.name)}));t=!0}}t||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),
|
||||
mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(b.target.result,mxUtils.bind(this,function(h){this.resizeImage(h,b.target.result,mxUtils.bind(this,function(h,m,q){x(e,mxUtils.bind(this,function(){if(null!=h&&h.length<k){var w=l&&this.isResampleImage(b.target.result,v)?Math.min(1,Math.min(d/m,d/q)):1;return f(h,g.type,a+e*n,c+e*n,Math.round(m*w),Math.round(q*w),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,v)}),mxUtils.bind(this,
|
||||
function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else f(b.target.result,g.type,a+e*n,c+e*n,240,160,g.name,function(b){x(e,function(){return b})})});/(\.vsdx?)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name)?f(null,g.type,a+e*n,c+e*n,240,160,g.name,function(b){x(e,function(){return b})},g):"image"==g.type.substring(0,5)?m.readAsDataURL(g):m.readAsText(g)})(F)});q?this.confirmImageResize(function(b){l=b;u()},n):u()};EditorUi.prototype.confirmImageResize=function(b,
|
||||
a){a=null!=a?a:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(e,d){if(e||a)mxSettings.setResizeImages(e?d:null),mxSettings.save();c();b(d)};null==e||a?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(b){d(b,!0)},function(b){d(b,!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):d(!1,e)};EditorUi.prototype.parseFile=function(b,a,c){c=null!=c?c:b.name;var e=new FormData;e.append("format","xml");e.append("upfile",b,c);var d=new XMLHttpRequest;d.open("POST",OPEN_URL);d.onreadystatechange=function(){a(d)};d.send(e)};EditorUi.prototype.isResampleImage=function(b,a){a=null!=a?a:this.resampleThreshold;return b.length>
|
||||
a};EditorUi.prototype.resizeImage=function(b,a,c,d,f,g){f=null!=f?f:this.maxImageSize;var e=Math.max(1,b.width),l=Math.max(1,b.height);if(d&&this.isResampleImage(a,g))try{var h=Math.max(e/f,l/f);if(1<h){var k=Math.round(e/h),m=Math.round(l/h),q=document.createElement("canvas");q.width=k;q.height=m;q.getContext("2d").drawImage(b,0,0,k,m);var n=q.toDataURL();if(n.length<a.length){var p=document.createElement("canvas");p.width=k;p.height=m;var u=p.toDataURL();n!==u&&(a=n,e=k,l=m)}}}catch(z){}c(a,e,l)};
|
||||
a};EditorUi.prototype.resizeImage=function(b,a,c,d,f,g){f=null!=f?f:this.maxImageSize;var e=Math.max(1,b.width),l=Math.max(1,b.height);if(d&&this.isResampleImage(a,g))try{var h=Math.max(e/f,l/f);if(1<h){var k=Math.round(e/h),m=Math.round(l/h),n=document.createElement("canvas");n.width=k;n.height=m;n.getContext("2d").drawImage(b,0,0,k,m);var q=n.toDataURL();if(q.length<a.length){var p=document.createElement("canvas");p.width=k;p.height=m;var t=p.toDataURL();q!==t&&(a=q,e=k,l=m)}}}catch(z){}c(a,e,l)};
|
||||
EditorUi.prototype.crcTable=[];for(var f=0;256>f;f++)for(var c=f,g=0;8>g;g++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[f]=c;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var e=0;e<d;e++)b=EditorUi.prototype.crcTable[(b^a[c+e])&255]^b>>>8;return b};EditorUi.prototype.crc32=function(b){this.crcTable=this.crcTable||this.createCrcTable();for(var a=-1,c=0;c<b.length;c++)a=a>>>8^this.crcTable[(a^b.charCodeAt(c))&255];return(a^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(b,
|
||||
a,c,d,f){function e(b,a){var c=h;h+=a;return b.substring(c,h)}function g(b){b=e(b,4);return b.charCodeAt(3)+(b.charCodeAt(2)<<8)+(b.charCodeAt(1)<<16)+(b.charCodeAt(0)<<24)}function l(b){return String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255)}b=b.substring(b.indexOf(",")+1);b=window.atob?atob(b):Base64.decode(b,!0);var h=0;if(e(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=f&&f();else if(e(b,4),"IHDR"!=e(b,4))null!=f&&f();else{e(b,17);f=b.substring(0,h);do{var k=
|
||||
g(b);if("IDAT"==e(b,4)){f=b.substring(0,h-8);c=c+String.fromCharCode(0)+("zTXt"==a?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,a,0,4);d=this.updateCRC(d,c,0,c.length);f+=l(c.length)+a+c+l(d^4294967295);f+=b.substring(h-8,b.length);break}f+=b.substring(h-8,h-4+k);e(b,k);e(b,4)}while(k);return"data:image/png;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(b){var a=null;try{var c=b.substring(b.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?
|
||||
|
@ -7434,8 +7434,8 @@ this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change"
|
|||
"visible"}else this.styleInput.style.visibility="hidden"})));var K=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:K.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var z=null;mxEvent.addListener(a.container,"dragleave",function(b){a.isEnabled()&&(null!=z&&(z.parentNode.removeChild(z),z=null),b.stopPropagation(),b.preventDefault())});
|
||||
mxEvent.addListener(a.container,"dragover",mxUtils.bind(this,function(b){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=this.highlightElement(a.container));null!=this.sidebar&&this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()}));mxEvent.addListener(a.container,"drop",mxUtils.bind(this,function(b){null!=z&&(z.parentNode.removeChild(z),z=null);if(a.isEnabled()){var c=mxUtils.convertPoint(a.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),e=a.view.translate,d=a.view.scale,
|
||||
f=c.x/d-e.x,k=c.y/d-e.y;mxEvent.isAltDown(b)&&(k=f=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,f,k,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var g=0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(b,null!=this.pages);if(null!=c)a.setSelectionCells(this.importXml(c,f,k,!0));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")){var l=
|
||||
b.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var h=null,e=c.getElementsByTagName("img");null!=e&&1==e.length?(l=e[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(h=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var m=!0,n=mxUtils.bind(this,function(){a.setSelectionCells(this.insertTextAt(l,f,k,!0,h,null,m))});h&&l.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;n()},mxEvent.isControlDown(b)):
|
||||
n()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(b){var c=Math.max(1,b.width);b=Math.max(1,b.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,c)),e/Math.max(1,b));a.setSelectionCell(a.insertVertex(null,null,"",f,k,c*e,b*e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+g+";"))}),mxUtils.bind(this,function(b){a.setSelectionCells(this.insertTextAt(g,
|
||||
b.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var h=null,e=c.getElementsByTagName("img");null!=e&&1==e.length?(l=e[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(h=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var m=!0,v=mxUtils.bind(this,function(){a.setSelectionCells(this.insertTextAt(l,f,k,!0,h,null,m))});h&&l.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;v()},mxEvent.isControlDown(b)):
|
||||
v()}else null!=g&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(g)?this.loadImage(decodeURIComponent(g),mxUtils.bind(this,function(b){var c=Math.max(1,b.width);b=Math.max(1,b.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,c)),e/Math.max(1,b));a.setSelectionCell(a.insertVertex(null,null,"",f,k,c*e,b*e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+g+";"))}),mxUtils.bind(this,function(b){a.setSelectionCells(this.insertTextAt(g,
|
||||
f,k,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&a.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),f,k,!0))}}b.stopPropagation();b.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(b){var a=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==b.substring(0,13)){var c=b.indexOf(",");0<c&&(a=this.getPageById(b.substring(c+1)),a=null!=a?
|
||||
a.getName():mxResources.get("pageNotFound"))}else"data:"==b.substring(0,5)&&(a=mxResources.get("action"));return a};EditorUi.prototype.handleCustomLink=function(b){if("data:page/id,"==b.substring(0,13)){var a=b.indexOf(",");(b=this.getPageById(b.substring(a+1)))&&this.selectPage(b)}else this.editor.graph.handleCustomLink(b)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=
|
||||
mxSettings.getRecentColors();this.editor.graph.currentEdgeStyle=mxSettings.getCurrentEdgeStyle();this.editor.graph.currentVertexStyle=mxSettings.getCurrentVertexStyle();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.addListener("styleChanged",mxUtils.bind(this,function(b,a){mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());
|
||||
|
@ -7470,11 +7470,11 @@ this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name|
|
|||
h.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));try{l.init()}catch(E){h.postMessage(JSON.stringify({event:"draft",error:E.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();var l=1==k.enableRecent,m=1==k.enableSearch,l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(a,c){a=a||this.emptyDiagramXml;null!=k.callback?
|
||||
h.postMessage(JSON.stringify({event:"template",xml:a,blank:a==this.emptyDiagramXml,name:c}),"*"):(b(a,e,a!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(b){this.recentReadyCallback=b;h.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(b,a){this.searchReadyCallback=a;h.postMessage(JSON.stringify({event:"searchDocs",searchStr:b}),"*")}):null,function(b,a,c){h.postMessage(JSON.stringify({event:"template",
|
||||
docUrl:b,info:a,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(b){b&&this.actions.get("exit").funct()}));l.init();return}if("searchDocsList"==k.action)this.searchReadyCallback(k.list,k.errorMsg);else if("recentDocsList"==k.action)this.recentReadyCallback(k.list,k.errorMsg);else{if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));
|
||||
null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var q=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,
|
||||
w=mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();var a=this.createLoadMessage("export");a.format=k.format;a.message=k;a.data=b;a.xml=encodeURIComponent(q);h.postMessage(JSON.stringify(a),"*")}),t=mxUtils.bind(this,function(b){null==b&&(b=Editor.blankImage);"xmlpng"==k.format&&(b=this.writeGraphModelToPng(b,"zTXt","mxGraphModel",atob(this.editor.graph.compress(q))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);w(b)});if(this.isExportToCanvas()){if(null!=
|
||||
this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),u=p.getGlobalVariable,B=this.pages[0];p.getGlobalVariable=function(b){return"page"==b?B.getName():"pagenumber"==b?1:u.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(b){t(b.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,p)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
|
||||
("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?w("data:image/png;base64,"+b.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=
|
||||
this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)q=this.editor.getGraphXml(),n.data=this.getHtml(q,this.editor.graph),n.xml=mxUtils.getXml(q),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),
|
||||
null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var n=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var p=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,
|
||||
w=mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();var a=this.createLoadMessage("export");a.format=k.format;a.message=k;a.data=b;a.xml=encodeURIComponent(p);h.postMessage(JSON.stringify(a),"*")}),t=mxUtils.bind(this,function(b){null==b&&(b=Editor.blankImage);"xmlpng"==k.format&&(b=this.writeGraphModelToPng(b,"zTXt","mxGraphModel",atob(this.editor.graph.compress(p))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);w(b)});if(this.isExportToCanvas()){if(null!=
|
||||
this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),u=q.getGlobalVariable,B=this.pages[0];q.getGlobalVariable=function(b){return"page"==b?B.getName():"pagenumber"==b?1:u.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,function(b){t(b.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+
|
||||
("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(p)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?w("data:image/png;base64,"+b.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);n=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),n.xml=mxUtils.getXml(l),n.data=
|
||||
this.getFileData(null,null,!0,null,null,null,l),n.format=k.format;else if("html"==k.format)p=this.editor.getGraphXml(),n.data=this.getHtml(p,this.editor.graph),n.xml=mxUtils.getXml(p),n.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);n.xml=this.getFileData(!0);n.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),
|
||||
"xmlsvg"==k.format?this.getEmbeddedSvg(n.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(b);h.postMessage(JSON.stringify(n),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();n.data=this.createSvgDataUri(mxUtils.getXml(b));h.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),
|
||||
this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}h.postMessage(JSON.stringify(n),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight=
|
||||
"12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(l),this.embedFilenameSpan=l),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):null!=k.xml&&"data:image/png;base64,"==k.xml.substring(0,22)?this.extractGraphModelFromPng(k.xml):k.xml;else{h.postMessage(JSON.stringify({error:"unknownMessage",
|
||||
|
@ -7507,12 +7507,12 @@ this.toolbar.edgeShapeMenu.setEnabled(b),null!=this.toolbar.edgeStyleMenu&&this.
|
|||
"4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var b=this.offlineStatus.getElementsByTagName("img");null!=b&&0<b.length&&this.alert(b[0].getAttribute("title"))}));var d=window.applicationCache,f=null,a=mxUtils.bind(this,function(){var b=d.status,a;b==d.CHECKING&&(b=d.DOWNLOADING);switch(b){case d.UNCACHED:a=
|
||||
"";break;case d.IDLE:a="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:a='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';break;case d.UPDATEREADY:a='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case d.OBSOLETE:a='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:a=
|
||||
'<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}b!=f&&(this.offlineStatus.innerHTML=a,f=b)});mxEvent.addListener(d,"checking",a);mxEvent.addListener(d,"noupdate",a);mxEvent.addListener(d,"downloading",a);mxEvent.addListener(d,"progress",a);mxEvent.addListener(d,"cached",a);mxEvent.addListener(d,"updateready",a);mxEvent.addListener(d,"obsolete",a);mxEvent.addListener(d,"error",a);a()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=
|
||||
function(){};EditorUi.prototype.isDiagramActive=function(){var b=this.getCurrentFile();return null!=b&&b.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);var b=this.editor.graph,a=this.isDiagramActive(),c=this.getCurrentFile(),d=null!=c||"1"==urlParams.embed;this.actions.get("pageSetup").setEnabled(a);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&
|
||||
c.isAutosaveOptional());this.actions.get("guides").setEnabled(a);this.actions.get("editData").setEnabled(a);this.actions.get("shadowVisible").setEnabled(a);this.actions.get("connectionArrows").setEnabled(a);this.actions.get("connectionPoints").setEnabled(a);this.actions.get("copyStyle").setEnabled(a&&!b.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(a&&!b.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(b.getModel().isVertex(b.getSelectionCell()));this.actions.get("createShape").setEnabled(a);
|
||||
this.actions.get("createRevision").setEnabled(a);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(a&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(a&&(null==c||!c.isRestricted()));this.actions.get("find").setEnabled(d);this.actions.get("layers").setEnabled(d);this.actions.get("outline").setEnabled(d);
|
||||
this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());b=b.view.getState(b.getSelectionCell());this.actions.get("editShape").setEnabled(a&&null!=b&&null!=b.shape&&null!=b.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=
|
||||
null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,a,c,d,f,g){var e=b.editor.graph;if("xml"==c)b.hideDialog(),b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var h=b.getFileData(!0,null,null,null,null,!0),l=e.getGraphBounds(),k=Math.floor(l.width*f/e.view.scale),m=Math.floor(l.height*
|
||||
f/e.view.scale);h.length<=MAX_REQUEST_SIZE&&k*m<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+k+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
function(){};EditorUi.prototype.isDiagramActive=function(){var b=this.getCurrentFile();return null!=b&&b.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var n=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){n.apply(this,arguments);var b=this.editor.graph,a=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(a);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(a);
|
||||
this.actions.get("editData").setEnabled(a);this.actions.get("shadowVisible").setEnabled(a);this.actions.get("connectionArrows").setEnabled(a);this.actions.get("connectionPoints").setEnabled(a);this.actions.get("copyStyle").setEnabled(a&&!b.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(a&&!b.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(b.getModel().isVertex(b.getSelectionCell()));this.actions.get("createShape").setEnabled(a);this.actions.get("createRevision").setEnabled(a);
|
||||
this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(a&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=c&&!c.isRestricted());this.actions.get("tags").setEnabled(a&&(null==c||!c.isRestricted()));this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);
|
||||
this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());b=b.view.getState(b.getSelectionCell());this.actions.get("editShape").setEnabled(a&&null!=b&&null!=b.shape&&null!=b.shape.stencil)};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&
|
||||
(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,a,c,d,f,g){var e=b.editor.graph;if("xml"==c)b.hideDialog(),b.saveData(a,"xml",mxUtils.getXml(b.editor.getGraphXml()),"text/xml");else if("svg"==c)b.hideDialog(),b.saveData(a,"svg",mxUtils.getXml(e.getSvg(d,f,g)),"image/svg+xml");else{var h=b.getFileData(!0,null,null,null,
|
||||
null,!0),l=e.getGraphBounds(),k=Math.floor(l.width*f/e.view.scale),m=Math.floor(l.height*f/e.view.scale);h.length<=MAX_REQUEST_SIZE&&k*m<MAX_AREA?(b.hideDialog(),b.saveRequest(a,c,function(b,a){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(a||"0")+(null!=b?"&filename="+encodeURIComponent(b):"")+"&bg="+(null!=d?d:"none")+"&w="+k+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
|
||||
|
@ -7727,67 +7727,68 @@ null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mx
|
|||
b){var c=this.get("language");null!=c&&(c=b.addMenu("",c.funct),c.setAttribute("title",mxResources.get("language")),c.style.width="16px",c.style.paddingTop="2px",c.style.paddingLeft="4px",c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>',c.style.zIndex="1",c.style.position="absolute",c.style.top="2px",c.style.right="17px",c.style.display="block",mxClient.IS_VML||mxUtils.setOpacity(c,60),document.body.appendChild(c))}return b}}this.put("help",new Menu(mxUtils.bind(this,function(b,c){if(!mxClient.IS_CHROMEAPP&&
|
||||
a.isOffline())this.addMenuItems(b,["about"],c);else{var d=b.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+
|
||||
encodeURIComponent(b)),e.value="",this.editorUi.logEvent({category:"Help",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(e.value="")}));d.firstChild.nextSibling.appendChild(e);mxEvent.addGestureListeners(e,function(a){document.activeElement!=e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(b,
|
||||
["-","quickStart","userManual","keyboardShortcuts","-"],c);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],c);this.addMenuItems(b,["support","-"],c);a.isOffline()||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],c);a.isOfflineApp()||"1"==urlParams.embed||this.addMenuItems(b,["offline"],c);this.addMenuItems(b,["-","about"],c)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);
|
||||
this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",
|
||||
mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=f.getGraphBounds(),b=f.view.translate,d=f.view.scale;f.insertVertex(c,
|
||||
null,"",a.x/d-b.x,a.y/d-b.y,a.width/d,a.height/d,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){f.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+f.compress(mxUtils.getXml(f.encodeCells(f.getSelectionCells())))+"', width, height, 'Title');"))})),this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),
|
||||
this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=f.getGraphBounds(),c=f.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var k=0,g=d.save;d.save=function(){k++;g.apply(this,arguments)};var h=d.restore;d.restore=function(){k--;h.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",
|
||||
a,k);l.apply(this,arguments);mxLog.debug("leaving shape",a,k)};a.drawState(f.getView().getState(f.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",k)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&
|
||||
null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&
|
||||
a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&
|
||||
null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],c),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-","testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,
|
||||
!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(f.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+
|
||||
"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,k,g,h,l,m){a.createHtml(b,c,d,e,f,k,g,h,l,m,mxUtils.bind(this,function(b,c){var d=new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");
|
||||
d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft="26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+
|
||||
window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&
|
||||
a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();
|
||||
b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);
|
||||
b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=f.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((b.y+b.height-f.view.translate.y)/f.view.scale)+2,function(b,c,d,e,f,k,g,h){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),
|
||||
function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+g+";height:"+h+';" src="'+a.createLink(b,c,d,e,f,k,l)+'"></iframe>');a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(k){a.spinner.stop();k=new EmbedDialog(a,
|
||||
a.createLink(b,c,d,e,f,g,k));a.showDialog(k.container,440,240,!0,!0);k.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)e=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),
|
||||
e.setToggleAction(!0),e.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});e=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});e.setToggleAction(!0);e.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=
|
||||
function(b){f.isEditing()&&f.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var d=a.createLoadMessage("save");d.xml=c;b&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),
|
||||
a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,
|
||||
["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],
|
||||
c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(c,d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=g(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),
|
||||
c="image/svg+xml");k(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var k=mxUtils.bind(this,function(b,c,d){var e=f.view,k=f.getGraphBounds(),g=f.snap(Math.ceil(Math.max(0,k.x/e.scale-e.translate.x)+4*f.gridSize)),h=f.snap(Math.ceil(Math.max(0,(k.y+k.height)/e.scale-e.translate.y)+4*f.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(e){var k=!0,l=mxUtils.bind(this,function(){a.resizeImage(e,
|
||||
b,mxUtils.bind(this,function(e,l,m){e=k?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,g,h,Math.round(l*e),Math.round(m*e),d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}),k)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){k=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,g,h,0,0,d,function(b){a.spinner.stop();f.setSelectionCells(b);
|
||||
f.scrollCellToVisible(f.getSelectionCell())})}),g=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+
|
||||
"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,
|
||||
function(){e(a.trello)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),
|
||||
function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){k(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=h;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),
|
||||
null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();
|
||||
a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));e=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,
|
||||
c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;
|
||||
a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));e.isEnabled=function(){return this.enabled&&h.apply(this,arguments)};e.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",
|
||||
[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,
|
||||
function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),
|
||||
mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));
|
||||
this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));
|
||||
var w=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml)&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,c,d){var e=f.isMouseInsertPoint()?f.getInsertPoint():f.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(e.x,e.y,b,c),d);a.vertex=
|
||||
!0;f.getModel().beginUpdate();try{a=f.addCell(a),f.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{f.getModel().endUpdate()}f.scrollCellToVisible(a);f.setSelectionCell(a);f.container.focus();f.editAfterInsert&&f.startEditing(a);return a};a.actions.addAction("insertText",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&f.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},
|
||||
null,null,Editor.ctrlKey+"+Shift+X").isEnabled=h;a.actions.addAction("insertRectangle",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=h;a.actions.addAction("insertEllipse",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=h;a.actions.addAction("insertRhombus",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&
|
||||
x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=h;var A=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):w(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);A(b,c,["fromText","plantUml",
|
||||
"-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){A(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+
|
||||
mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(c,d){null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},
|
||||
d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,
|
||||
function(){a.pickFile(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=
|
||||
new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&
|
||||
(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,
|
||||
App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},
|
||||
d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)})),this.put("openLibraryFrom",new Menu(function(c,d){"undefined"!=typeof google&&
|
||||
"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,
|
||||
!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=
|
||||
b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(z){a.handleError(z,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,
|
||||
!0);b.init()},d))})));this.put("edit",new Menu(mxUtils.bind(this,function(b,a){this.addMenuItems(b,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||
|
||||
mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&
|
||||
isLocalStorage&&this.addMenuItems(b,["showStartScreen"],c);a.isOfflineApp()||"1"==urlParams.embed||this.addMenuItem(b,"plugins",c);b.addSeparator(c);this.addMenuItem(b,"tags",c)})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,
|
||||
"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",
|
||||
b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);
|
||||
this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var f=Menus.prototype.menuCreated;
|
||||
Menus.prototype.menuCreated=function(a,d){if(480>=screen.width&&a==this.get("help")){d.style.paddingRight="0px";d.style.paddingLeft="0px";d.innerHTML="";var c=document.createElement("img");c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);d.appendChild(c)}f.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
["-","quickStart","userManual","keyboardShortcuts","-"],c);mxClient.IS_CHROMEAPP||this.addMenuItems(b,["feedback"],c);this.addMenuItems(b,["support","-"],c);a.isOffline()||EditorUi.isElectronApp||navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["download"],c);navigator.standalone||"1"==urlParams.embed||this.addMenuItems(b,["offline"],c);this.addMenuItems(b,["-","about"],c)}"1"==urlParams.ruler&&(mxResources.parse("rulerInch=Ruler unit: Inches"),this.editorUi.actions.addAction("rulerInch",
|
||||
mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.hRuler.setUnit(mxRuler.prototype.INCHES);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),mxResources.parse("rulerCM=Ruler unit: CMs"),this.editorUi.actions.addAction("rulerCM",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.hRuler.setUnit(mxRuler.prototype.CENTIMETER);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),
|
||||
mxResources.parse("rulerPixel=Ruler unit: Pixels"),this.editorUi.actions.addAction("rulerPixel",mxUtils.bind(this,function(){this.editorUi.vRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.hRuler.setUnit(mxRuler.prototype.PIXELS);this.editorUi.vRuler.drawRuler(!0);this.editorUi.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c));"1"==urlParams.test&&(mxResources.parse("showBoundingBox=Show bounding box"),this.editorUi.actions.addAction("showBoundingBox",mxUtils.bind(this,
|
||||
function(){var a=f.getGraphBounds(),b=f.view.translate,d=f.view.scale;f.insertVertex(c,null,"",a.x/d-b.x,a.y/d-b.y,a.width/d,a.height/d,"fillColor=none;strokeColor=red;")})),mxResources.parse("createSidebarEntry=Create sidebar entry"),this.editorUi.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){f.isSelectionEmpty()||(mxLog.show(),mxLog.debug("sb.createVertexTemplateFromData('"+f.compress(mxUtils.getXml(f.encodeCells(f.getSelectionCells())))+"', width, height, 'Title');"))})),
|
||||
this.addMenuItems(b,["-","createSidebarEntry","showBoundingBox"],c),mxResources.parse("testXmlImageExport=XML Image Export"),this.editorUi.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=f.getGraphBounds(),c=f.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var k=0,g=d.save;d.save=function(){k++;g.apply(this,arguments)};var h=
|
||||
d.restore;d.restore=function(){k--;h.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,k);l.apply(this,arguments);mxLog.debug("leaving shape",a,k)};a.drawState(f.getView().getState(f.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",k)})),this.addMenuItems(b,["testXmlImageExport"],c),mxResources.parse("testShowRtModel=Show RT model"),mxResources.parse("testDebugRtModel=Debug RT model"),mxResources.parse("testDownloadRtModel=Download RT model"),
|
||||
this.editorUi.actions.addAction("testShowRtModel",mxUtils.bind(this,function(){null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&(console.log("bytesUsed",this.editorUi.getCurrentFile().realtime.rtModel.bytesUsed),console.log("root",this.editorUi.getCurrentFile().realtime.dumpRoot()),this.editorUi.getCurrentFile().realtime.check())})),this.editorUi.actions.addAction("testDebugRtModel",mxUtils.bind(this,function(){gapi.drive.realtime.debug()})),this.editorUi.actions.addAction("testDownloadRtModel",
|
||||
mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();null!=b&&null!=b.realtime&&a.spinner.spin(document.body,mxResources.get("export"))&&(b=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b.getHash().substring(1)+"/realtime",null,"GET"),b.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization","Bearer "+b)},b.send(function(b){a.spinner.stop();200<=b.getStatus()&&
|
||||
299>=b.getStatus()&&a.saveLocalFile(b.getText(),"realtime.txt","text/plain")}))})),null!=this.editorUi.getCurrentFile()&&null!=this.editorUi.getCurrentFile().realtime&&this.addMenuItems(b,["-","testShowRtModel","testDebugRtModel","testDownloadRtModel"],c),mxResources.parse("testShowConsole=Show Console"),this.editorUi.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.addMenuItems(b,["-",
|
||||
"testShowConsole"]))})));a.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!a.isOffline()?a.showDialog((new MoreShapesDialog(a,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):a.showDialog((new MoreShapesDialog(a,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});a.actions.addAction("createShape...",function(){a.getCurrentFile();if(f.isEnabled()){var b=new mxCell("",new mxGeometry(0,0,120,120),a.defaultCustomShapeStyle);b.vertex=!0;b=new EditShapeDialog(a,
|
||||
b,mxResources.get("editShape")+":",630,400);a.showDialog(b.container,640,480,!0,!1);b.init()}});a.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",b,function(b,c,d,e,f,k,g,h,l,m){a.createHtml(b,c,d,e,f,k,g,h,l,m,mxUtils.bind(this,function(b,c){var d=
|
||||
new EmbedDialog(a,b+"\n"+c,null,null,function(){var a=window.open(),d=a.document;"CSS1Compat"===document.compatMode&&d.writeln("<!DOCTYPE html>");d.writeln("<html>");d.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');d.writeln("<body>");d.writeln(b);var e=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;e&&d.writeln(c);d.writeln("</body>");d.writeln("</html>");d.close();if(!e){var f=a.document.createElement("div");f.marginLeft=
|
||||
"26px";f.marginTop="26px";mxUtils.write(f,mxResources.get("updatingDocument"));e=a.document.createElement("img");e.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");e.style.marginLeft="6px";f.appendChild(e);a.document.body.insertBefore(f,a.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];d.body.appendChild(a);f.parentNode.removeChild(f)},
|
||||
20)}});a.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));a.actions.put("liveImage",new Action("Live image...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();null!=b?(b=encodeURIComponent(b),b=new EmbedDialog(a,EXPORT_URL+"?format=png&url="+b,0),a.showDialog(b.container,440,240,!0,!0),b.init()):a.handleError({message:mxResources.get("invalidPublicUrl")})})}));a.actions.put("embedImage",new Action(mxResources.get("image")+
|
||||
"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedImage(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("image"),mxResources.get("retina"),a.isExportToCanvas())}));a.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showEmbedImageDialog(function(b,c,d,e,f,
|
||||
g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.createEmbedSvg(b,c,d,e,f,g,function(b){a.spinner.stop();b=new EmbedDialog(a,b);a.showDialog(b.container,440,240,!0,!0);b.init()},function(b){a.spinner.stop();a.handleError(b)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));a.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var b=f.getGraphBounds();a.showPublishLinkDialog(mxResources.get("iframe"),
|
||||
null,"100%",Math.ceil((b.y+b.height-f.view.translate.y)/f.view.scale)+2,function(b,c,d,e,f,k,g,h){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(l){a.spinner.stop();l=new EmbedDialog(a,'<iframe frameborder="0" style="width:'+g+";height:"+h+';" src="'+a.createLink(b,c,d,e,f,k,l)+'"></iframe>');a.showDialog(l.container,440,240,!0,!0);l.init()})},!0)}));a.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){a.showPublishLinkDialog(null,
|
||||
null,null,null,function(b,c,d,e,f,g){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(k){a.spinner.stop();k=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,k));a.showDialog(k.container,440,240,!0,!0);k.init()})})}));a.actions.addAction("googleDocs...",function(){a.openLink("http://docsaddon.draw.io")});a.actions.addAction("googleSites...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();
|
||||
b=new GoogleSitesDialog(a,b);a.showDialog(b.container,420,256,!0,!0);b.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)e=a.actions.addAction("scratchpad",function(){a.toggleScratchpad()}),e.setToggleAction(!0),e.setSelectedCallback(function(){return null!=a.scratchpad}),a.actions.addAction("plugins...",function(){a.showDialog((new PluginsDialog(a)).container,360,170,!0,!1)});e=a.actions.addAction("search",function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&
|
||||
(mxSettings.settings.search=!b,mxSettings.save())});e.setToggleAction(!0);e.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){f.isEditing()&&f.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var d=a.createLoadMessage("save");d.xml=c;b&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c,
|
||||
"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),
|
||||
null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||
|
||||
this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE11||mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.editorUi.actions.addAction("chatWindowTitle...",mxUtils.bind(this.editorUi,this.editorUi.toggleChat));this.put("importFrom",new Menu(function(c,
|
||||
d){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=g(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");k(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var k=mxUtils.bind(this,function(b,c,d){var e=f.view,k=f.getGraphBounds(),g=f.snap(Math.ceil(Math.max(0,
|
||||
k.x/e.scale-e.translate.x)+4*f.gridSize)),h=f.snap(Math.ceil(Math.max(0,(k.y+k.height)/e.scale-e.translate.y)+4*f.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(e){var k=!0,l=mxUtils.bind(this,function(){a.resizeImage(e,b,mxUtils.bind(this,function(e,l,m){e=k?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,g,h,Math.round(l*e),Math.round(m*e),d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}),
|
||||
k)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){k=a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,g,h,0,0,d,function(b){a.spinner.stop();f.setSelectionCells(b);f.scrollCellToVisible(f.getSelectionCell())})}),g=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=
|
||||
typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
|
||||
d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+
|
||||
"...",null,function(){a.importLocalFile(!1)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){k(a,
|
||||
c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})).isEnabled=h;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"!=uiTheme&&"dark"!=uiTheme&&"min"!=uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);
|
||||
d=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage);d=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();
|
||||
a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==uiTheme&&b.addCheckmark(d,Editor.checkmarkImage)})));e=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&
|
||||
b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));e.isEnabled=function(){return this.enabled&&
|
||||
h.apply(this,arguments)};e.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():a.defaultFilename,d="",e=c.lastIndexOf(".");0<=e&&(d=c.substring(e),c=c.substring(0,e));c=mxResources.get("copyOf",[c])+d;b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,
|
||||
mxResources.get("saving"))&&b.save(!1,mxUtils.bind(this,function(){b.saveAs(c,mxUtils.bind(this,function(b){a.spinner.stop();var c=a.getUrl();window.openWindow(c+"#G"+b.id,null,mxUtils.bind(this,function(){window.location.hash="G"+b.id}))}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):this.editorUi.createFile(c,this.editorUi.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),
|
||||
null,null,null,null,!0),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));
|
||||
this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("offline",new Action(mxResources.get("offline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("download",new Action(mxResources.get("download")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));
|
||||
this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleSites","googleDocs"],c)})));var w=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml)&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=
|
||||
new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},x=function(a,b,c,d){var e=f.isMouseInsertPoint()?f.getInsertPoint():f.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(e.x,e.y,b,c),d);a.vertex=!0;f.getModel().beginUpdate();try{a=f.addCell(a),f.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{f.getModel().endUpdate()}f.scrollCellToVisible(a);
|
||||
f.setSelectionCell(a);f.container.focus();f.editAfterInsert&&f.startEditing(a);return a};a.actions.addAction("insertText",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&f.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))},null,null,Editor.ctrlKey+"+Shift+X").isEnabled=h;a.actions.addAction("insertRectangle",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&
|
||||
x("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=h;a.actions.addAction("insertEllipse",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=h;a.actions.addAction("insertRhombus",function(){f.isEnabled()&&!f.isCellLocked(f.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=h;var A=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==
|
||||
c[d]?a.addSeparator(b):w(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);A(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,
|
||||
function(a,b){A(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},
|
||||
c)}));this.put("openFrom",new Menu(function(c,d){null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);
|
||||
isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?
|
||||
"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+
|
||||
"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+
|
||||
"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},d)})),this.put("openLibraryFrom",new Menu(function(c,d){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?c.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},d):m&&c.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+
|
||||
"...)",null,function(){},d,null,!1));null!=a.gitHub&&c.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},d);null!=a.dropbox?c.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},d):n&&c.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.oneDrive?c.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},d):p&&c.addItem(mxResources.get("oneDrive")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);null!=a.trello?c.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},d):b&&c.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},d,null,!1);c.addSeparator(d);isLocalStorage&&"0"!=urlParams.browser&&c.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},d);mxClient.IS_IOS||c.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},
|
||||
d);a.isOffline()||(c.addSeparator(d),c.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(z){a.handleError(z,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),
|
||||
a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},d))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip editStyle - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",
|
||||
new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&
|
||||
(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=
|
||||
urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage&&(d=this.addMenuItem(b,"plugins",c),a.isOffline()||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430"));b.addSeparator(c);d=this.addMenuItem(b,"tags",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||
|
||||
this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966")})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,
|
||||
["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();null!=d&&d.constructor==DriveFile?(d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c),null==d.realtime?this.addMenuItems(b,["save","share","-"],c):(d.isAutosave()||this.addMenuItems(b,["save"],c),this.addMenuItems(b,["share","chatWindowTitle","-"],c))):this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?
|
||||
this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(this.addMenuItems(b,["-","save","saveAs","-","rename"],c),a.isOfflineApp()?a.isOffline()||this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",
|
||||
b,c);this.addSubmenu("openLibraryFrom",b,c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||this.addMenuItems(b,["-","revisionHistory"],c);null!=d&&d.constructor==DriveFile&&this.addMenuItems(b,["createRevision"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))};var f=Menus.prototype.menuCreated;Menus.prototype.menuCreated=function(a,d){if(480>=screen.width&&a==this.get("help")){d.style.paddingRight=
|
||||
"0px";d.style.paddingLeft="0px";d.innerHTML="";var c=document.createElement("img");c.setAttribute("border","0");c.setAttribute("valign","bottom");c.setAttribute("src",Editor.helpImage);d.appendChild(c)}f.apply(this,arguments)}})();function DiagramPage(a){this.node=a;(null==this.node.hasAttribute&&null==this.node.getAttribute("id")||null!=this.node.hasAttribute&&!this.node.hasAttribute("id"))&&this.node.setAttribute("id",function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};
|
||||
DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,d,f){this.ui=a;this.page=d;this.previous=this.name=f}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};
|
||||
function MovePage(a,d,f){this.ui=a;this.oldIndex=d;this.newIndex=f}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,d){this.ui=a;this.previousPage=this.page=d;this.neverShown=!0;null!=d&&(this.neverShown=null==d.viewState,this.ui.updatePageRoot(d))}
|
||||
|
@ -7841,8 +7842,8 @@ a))}for(g=0;g<e.length;g++)this.model.setVisible(e[g],!a);f=b;f=d.apply(this,arg
|
|||
return a}function f(b){var a=!1;null!=b&&(b=w.getParent(b),a=t.view.getState(b),t.view.getState(b),a=null!=(null!=a?a.style:t.getCellStyle(b)).childLayout);return a}function n(b){b=t.view.getState(b);if(null!=b){var a=t.getIncomingEdges(b.cell);if(0<a.length&&(a=t.view.getState(a[0]),null!=a&&(a=a.absolutePoints,null!=a&&0<a.length&&(a=a[a.length-1],null!=a)))){if(a.y==b.y&&Math.abs(a.x-b.getCenterX())<b.width/2)return mxConstants.DIRECTION_SOUTH;if(a.y==b.y+b.height&&Math.abs(a.x-b.getCenterX())<
|
||||
b.width/2)return mxConstants.DIRECTION_NORTH;if(a.x>b.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function p(b,a){a=null!=a?a:!0;t.model.beginUpdate();try{var c=t.model.getParent(b),d=t.getIncomingEdges(b),e=t.cloneCells([d[0],b]);t.model.setTerminal(e[0],t.model.getTerminal(d[0],!0),!0);var f=n(b),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=a?b.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=a?b.geometry.height+
|
||||
10:-e[1].geometry.height-10;f==mxConstants.DIRECTION_WEST&&(e[1].geometry.x=b.geometry.x+b.geometry.width-e[1].geometry.width);t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=t.view.getState(b),h=t.view.scale;if(null!=k){var l=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?l.x+=(a?b.geometry.width+10:-e[1].geometry.width-10)*h:l.y+=(a?b.geometry.height+10:-e[1].geometry.height-10)*h;var m=t.getOutgoingEdges(t.model.getTerminal(d[0],
|
||||
!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=d=0;q<m.length;q++){var w=t.model.getTerminal(m[q],!1);if(f==n(w)){var u=t.view.getState(w);w!=b&&null!=u&&(p&&a!=u.getCenterX()<k.getCenterX()||!p&&a!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(l,u)&&(d=10+Math.max(d,(Math.min(l.x+l.width,u.x+u.width)-Math.max(l.x,u.x))/h),g=10+Math.max(g,(Math.min(l.y+l.height,u.y+u.height)-Math.max(l.y,u.y))/h))}}p?g=0:d=0;for(q=0;q<m.length;q++)if(w=t.model.getTerminal(m[q],
|
||||
!1),f==n(w)&&(u=t.view.getState(w),w!=b&&null!=u&&(p&&a!=u.getCenterX()<k.getCenterX()||!p&&a!=u.getCenterY()<k.getCenterY()))){var v=[];t.traverse(u.cell,!0,function(b,a){null!=a&&v.push(a);v.push(b);return!0});t.moveCells(v,(a?1:-1)*d,(a?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function b(b){t.model.beginUpdate();try{var a=n(b),c=t.getIncomingEdges(b),d=t.cloneCells([c[0],b]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],b,!1);
|
||||
!0));if(null!=m){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=d=0;q<m.length;q++){var w=t.model.getTerminal(m[q],!1);if(f==n(w)){var v=t.view.getState(w);w!=b&&null!=v&&(p&&a!=v.getCenterX()<k.getCenterX()||!p&&a!=v.getCenterY()<k.getCenterY())&&mxUtils.intersects(l,v)&&(d=10+Math.max(d,(Math.min(l.x+l.width,v.x+v.width)-Math.max(l.x,v.x))/h),g=10+Math.max(g,(Math.min(l.y+l.height,v.y+v.height)-Math.max(l.y,v.y))/h))}}p?g=0:d=0;for(q=0;q<m.length;q++)if(w=t.model.getTerminal(m[q],
|
||||
!1),f==n(w)&&(v=t.view.getState(w),w!=b&&null!=v&&(p&&a!=v.getCenterX()<k.getCenterX()||!p&&a!=v.getCenterY()<k.getCenterY()))){var u=[];t.traverse(v.cell,!0,function(b,a){null!=a&&u.push(a);u.push(b);return!0});t.moveCells(u,(a?1:-1)*d,(a?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function b(b){t.model.beginUpdate();try{var a=n(b),c=t.getIncomingEdges(b),d=t.cloneCells([c[0],b]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],b,!1);
|
||||
var e=t.model.getParent(b),f=e.geometry,g=[];t.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(b,!0,function(b,a){null!=a&&g.push(a);g.push(b);return!0});var k=b.geometry.width+40,h=b.geometry.height+40;a==mxConstants.DIRECTION_SOUTH?k=0:a==mxConstants.DIRECTION_NORTH?(k=0,h=-40):a==mxConstants.DIRECTION_WEST?(k=-40,h=0):a==mxConstants.DIRECTION_EAST&&(h=0);t.moveCells(g,k,h);return t.addCells(d,e)}finally{t.model.endUpdate()}}function e(b){t.model.beginUpdate();try{var a=
|
||||
t.model.getParent(b),c=t.getIncomingEdges(b),d=t.cloneCells([c[0],b]);t.model.setTerminal(d[0],b,!0);var c=t.getOutgoingEdges(b),e=a.geometry,f=[];t.view.currentRoot==a&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=t.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var h=t.view.getBounds(f),l=n(b),m=t.view.translate,p=t.view.scale;l==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==h?b.geometry.x+(b.geometry.width-d[1].geometry.width)/2:(h.x+h.width)/p-m.x-e.x+10,d[1].geometry.y+=b.geometry.height-
|
||||
e.y+40):l==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==h?b.geometry.x+(b.geometry.width-d[1].geometry.width)/2:(h.x+h.width)/p-m.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=l==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(b.geometry.width-e.x+40),d[1].geometry.y=null==h?b.geometry.y+(b.geometry.height-d[1].geometry.height)/2:(h.y+h.height)/p-m.y+-e.y+10);return t.addCells(d,a)}finally{t.model.endUpdate()}}function l(b,
|
||||
|
@ -7909,20 +7910,21 @@ mxResources.get("text");b.actions.get("editDiagram").label=mxResources.get("form
|
|||
mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importFile",new Action("File...",function(){c.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",function(){null!=a.files&&b.importFiles(a.files,null,null,b.maxImageSize)});a.click()}));b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){c.popupMenuHandler.hideMenu();b.showImportCsvDialog()}));
|
||||
b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){d(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+
|
||||
"...",function(){a(b)}));EditorUi.enablePlantUml&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,"new open - save saveAs -".split(" "),c):"1"==urlParams.embed?
|
||||
(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a,"- outline layers - find tags -".split(" "),
|
||||
c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,c){f.apply(this,arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,
|
||||
["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"],c)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"],c);"1"!=urlParams.embed&&isLocalStorage&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);b.isOfflineApp()||"1"==urlParams.embed||b.menus.addMenuItems(a,["-","plugins"],c)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,
|
||||
c){b.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "),c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",
|
||||
a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var l="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<l.length;c++)"-"==l[c]?a.addSeparator(b):m(a,b,mxResources.get(l[c])+"...",l[c])})));this.put("view",new Menu(mxUtils.bind(this,
|
||||
function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "),c)})))};var t=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var f=e.menus.get(a),g=l.addMenu(mxResources.get(a),mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height=
|
||||
"30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));e.menus.menuCreated(f,g,"geMenuItem");null!=c?(g.style.backgroundImage="url("+c+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px",g.innerHTML="",mxUtils.setOpacity(g,d||40)):b||(g.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",g.style.backgroundPosition="right 6px center",g.style.backgroundRepeat=
|
||||
"no-repeat",g.style.paddingRight="22px");return g}function b(a,b,c,d,e,f){var g=document.createElement("a");g.setAttribute("href","javascript:void(0)");g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";h.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize=
|
||||
"24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);mxUtils.setOpacity(g,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),mxUtils.setOpacity(g,null!=f?40:100),g.style.cursor=""):(g.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,null!=f?10:20),g.style.cursor="default")},e.addListener("stateChanged",
|
||||
a),a());return g}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));h.appendChild(b);return b}t.apply(this,arguments);var d=document.createElement("div");d.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";
|
||||
d.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(d);var e=this,g=e.editor.graph;e.toolbar=this.createToolbar(e.createDiv("geToolbar"));e.defaultLibraryName=mxResources.get("untitledLibrary");var h=document.createElement("div");h.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var l=new Menubar(e,h);(d=900>f)||
|
||||
a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",100):null,b(mxResources.get("shapes"),e.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),e.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),
|
||||
e.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+e.actions.get("formatPanel").shortcut+")",e.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
|
||||
(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile&&(b.menus.addMenuItems(a,["-","share"],c),null!=d.realtime&&b.menus.addMenuItems(a,["chatWindowTitle"],c),a.addSeparator(c));b.menus.addMenuItems(a,["-","outline",
|
||||
"layers","-","find"],c);d=this.addMenuItem(a,"tags",c);b.isOffline()&&!mxClient.IS_CHROMEAPP||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000046966");a.addSeparator(c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,c){f.apply(this,
|
||||
arguments);a.addSeparator(c);b.menus.addSubmenu("openRecent",a,c)}}this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],c):b.menus.addMenuItems(a,["save","saveAs","-","rename","makeCopy"],c);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||b.menus.addMenuItems(a,["-","revisionHistory"],c);b.menus.addMenuItems(a,["-","autosave"],c)})));var g=
|
||||
this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){g.funct(a,c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=h&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","pageScale"],
|
||||
c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);if(!b.isOfflineApp()&&"1"!=urlParams.embed&&isLocalStorage){a.addSeparator(c);var d=b.menus.addMenuItem(a,"plugins",c);b.isOffline()||b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000056430")}})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText createShape plantUml - importCsv formatSql editDiagram".split(" "),
|
||||
c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c)})));var l="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),
|
||||
m=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<l.length;c++)"-"==l[c]?a.addSeparator(b):m(a,b,mxResources.get(l[c])+"...",l[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints - copyConnect collapseExpand - mathematicalTypesetting".split(" "),
|
||||
c)})))};var t=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var f=e.menus.get(a),g=l.addMenu(mxResources.get(a),mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.top="6px";g.style.marginRight="6px";g.style.height="30px";g.style.paddingTop="6px";g.style.paddingBottom="6px";g.setAttribute("title",mxResources.get(a));e.menus.menuCreated(f,g,"geMenuItem");null!=c?
|
||||
(g.style.backgroundImage="url("+c+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px",g.innerHTML="",mxUtils.setOpacity(g,d||40)):b||(g.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",g.style.backgroundPosition="right 6px center",g.style.backgroundRepeat="no-repeat",g.style.paddingRight="22px");return g}function b(a,b,c,d,e,f){var g=document.createElement("a");g.setAttribute("href","javascript:void(0)");
|
||||
g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";h.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&
|
||||
b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);mxUtils.setOpacity(g,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),mxUtils.setOpacity(g,null!=f?40:100),g.style.cursor=""):(g.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,null!=f?10:20),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";
|
||||
b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));h.appendChild(b);return b}t.apply(this,arguments);var d=document.createElement("div");d.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";d.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?
|
||||
"63px":"32px";this.sidebar=this.createSidebar(d);var e=this,g=e.editor.graph;e.toolbar=this.createToolbar(e.createDiv("geToolbar"));e.defaultLibraryName=mxResources.get("untitledLibrary");var h=document.createElement("div");h.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var l=new Menubar(e,h);(d=900>f)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",
|
||||
100):null,b(mxResources.get("shapes"),e.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),e.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),e.actions.get("toggleFormat").funct,null,mxResources.get("format")+
|
||||
" ("+e.actions.get("formatPanel").shortcut+")",e.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
|
||||
null)]);var m=a("insert",!0,d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null,40);c([m,b(mxResources.get("delete"),e.actions.get("delete").funct,null,mxResources.get("delete"),e.actions.get("delete"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
|
||||
null)]);if(480<=f){var n=e.actions.get("undo"),d=e.actions.get("redo"),n=b("",n.funct,null,mxResources.get("undo")+" ("+n.shortcut+")",n,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),d=b("",d.funct,
|
||||
null,mxResources.get("redo")+" ("+d.shortcut+")",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg==");c([n,d]);if(560<=f){var d=e.actions.get("zoomIn"),n=e.actions.get("zoomOut"),p=e.actions.get("resetView");
|
||||
|
|
|
@ -10687,9 +10687,9 @@
|
|||
this.actions.get('editDiagram').setEnabled(active && (file == null || !file.isRestricted()));
|
||||
this.actions.get('publishLink').setEnabled(file != null && !file.isRestricted());
|
||||
this.actions.get('tags').setEnabled(active && (file == null || !file.isRestricted()));
|
||||
this.actions.get('find').setEnabled(enabled);
|
||||
this.actions.get('layers').setEnabled(enabled);
|
||||
this.actions.get('outline').setEnabled(enabled);
|
||||
this.actions.get('find').setEnabled(this.diagramContainer.style.visibility != 'hidden');
|
||||
this.actions.get('layers').setEnabled(this.diagramContainer.style.visibility != 'hidden');
|
||||
this.actions.get('outline').setEnabled(this.diagramContainer.style.visibility != 'hidden');
|
||||
this.actions.get('rename').setEnabled((file != null && file.isRenamable()) || urlParams['embed'] == '1');
|
||||
this.actions.get('close').setEnabled(file != null);
|
||||
this.menus.get('publish').setEnabled(file != null && !file.isRestricted());
|
||||
|
|
|
@ -80,6 +80,11 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
|
|||
menusInit.apply(this, arguments);
|
||||
|
||||
var editorUi = this.editorUi;
|
||||
|
||||
editorUi.actions.put('offline', new Action(mxResources.get('online') + '...', function()
|
||||
{
|
||||
editorUi.openLink('https://www.draw.io/')
|
||||
}));
|
||||
|
||||
// Replaces file menu to replace openFrom menu with open and rename downloadAs to export
|
||||
this.put('file', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
|
@ -88,28 +93,11 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
|
|||
this.addSubmenu('exportAs', menu, parent);
|
||||
menu.addSeparator(parent);
|
||||
this.addSubmenu('embed', menu, parent);
|
||||
this.addSubmenu('publish', menu, parent);
|
||||
menu.addSeparator(parent);
|
||||
this.addMenuItems(menu, ['newLibrary', 'openLibrary', '-', 'pageSetup',
|
||||
'print', '-', 'close'], parent);
|
||||
// LATER: Find API for application.quit
|
||||
})));
|
||||
|
||||
this.put('extras', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
{
|
||||
this.addSubmenu('theme', menu, parent);
|
||||
menu.addSeparator(parent);
|
||||
this.addMenuItems(menu, ['copyConnect', 'collapseExpand', '-'], parent);
|
||||
|
||||
if (typeof(MathJax) !== 'undefined')
|
||||
{
|
||||
var item = this.addMenuItem(menu, 'mathematicalTypesetting', parent);
|
||||
this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000032875');
|
||||
}
|
||||
|
||||
this.addMenuItems(menu, ['autosave', '-', 'createShape', 'editDiagram', '-',
|
||||
'plugins', 'tags', '-', 'online'], parent);
|
||||
})));
|
||||
};
|
||||
|
||||
var graphCreateLinkForHint = Graph.prototype.createLinkForHint;
|
||||
|
|
|
@ -886,12 +886,13 @@
|
|||
|
||||
this.addMenuItems(menu, ['support', '-'], parent);
|
||||
|
||||
if (!editorUi.isOffline() && !navigator.standalone && urlParams['embed'] != '1')
|
||||
if (!editorUi.isOffline() && !EditorUi.isElectronApp &&
|
||||
!navigator.standalone && urlParams['embed'] != '1')
|
||||
{
|
||||
this.addMenuItems(menu, ['download'], parent);
|
||||
}
|
||||
|
||||
if (!editorUi.isOfflineApp() && urlParams['embed'] != '1')
|
||||
if (!navigator.standalone && urlParams['embed'] != '1')
|
||||
{
|
||||
this.addMenuItems(menu, ['offline'], parent);
|
||||
}
|
||||
|
@ -2529,18 +2530,29 @@
|
|||
|
||||
menu.addSeparator(parent);
|
||||
|
||||
if (urlParams['embed'] != '1' && isLocalStorage)
|
||||
if (urlParams['embed'] != '1' && (isLocalStorage || mxClient.IS_CHROMEAPP))
|
||||
{
|
||||
this.addMenuItems(menu, ['showStartScreen'], parent);
|
||||
}
|
||||
|
||||
if (!editorUi.isOfflineApp() && urlParams['embed'] != '1')
|
||||
if (!editorUi.isOfflineApp() && urlParams['embed'] != '1' && isLocalStorage)
|
||||
{
|
||||
this.addMenuItem(menu, 'plugins', parent);
|
||||
var item = this.addMenuItem(menu, 'plugins', parent);
|
||||
|
||||
if (!editorUi.isOffline())
|
||||
{
|
||||
this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000056430');
|
||||
}
|
||||
}
|
||||
|
||||
menu.addSeparator(parent);
|
||||
this.addMenuItem(menu, 'tags', parent);
|
||||
|
||||
var item = this.addMenuItem(menu, 'tags', parent);
|
||||
|
||||
if (!editorUi.isOffline() || mxClient.IS_CHROMEAPP)
|
||||
{
|
||||
this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000046966');
|
||||
}
|
||||
})));
|
||||
|
||||
this.put('file', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
|
|
|
@ -750,7 +750,16 @@ EditorUi.initMinimalTheme = function()
|
|||
menu.addSeparator(parent);
|
||||
}
|
||||
|
||||
ui.menus.addMenuItems(menu, ['-', 'outline', 'layers', '-', 'find', 'tags', '-'], parent);
|
||||
ui.menus.addMenuItems(menu, ['-', 'outline', 'layers', '-', 'find'], parent);
|
||||
|
||||
var item = this.addMenuItem(menu, 'tags', parent);
|
||||
|
||||
if (!ui.isOffline() || mxClient.IS_CHROMEAPP)
|
||||
{
|
||||
ui.menus.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000046966');
|
||||
}
|
||||
|
||||
menu.addSeparator(parent);
|
||||
|
||||
// Cannot use print in standalone mode on iOS as we cannot open new windows
|
||||
if (!mxClient.IS_IOS || !navigator.standalone)
|
||||
|
@ -813,9 +822,13 @@ EditorUi.initMinimalTheme = function()
|
|||
exportAsMenu.funct(menu, parent);
|
||||
menu.addSeparator(parent);
|
||||
ui.menus.addSubmenu('embed', menu, parent);
|
||||
// Publish menu contains only one element by default...
|
||||
//ui.menus.addSubmenu('publish', menu, parent);
|
||||
ui.menus.addMenuItems(menu, ['publishLink'], parent);
|
||||
|
||||
if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
|
||||
{
|
||||
// Publish menu contains only one element by default...
|
||||
//ui.menus.addSubmenu('publish', menu, parent);
|
||||
ui.menus.addMenuItems(menu, ['publishLink'], parent);
|
||||
}
|
||||
})));
|
||||
|
||||
var langMenu = this.get('language');
|
||||
|
@ -834,17 +847,22 @@ EditorUi.initMinimalTheme = function()
|
|||
}
|
||||
|
||||
menu.addSeparator(parent);
|
||||
|
||||
ui.menus.addMenuItems(menu, ['scrollbars', 'tooltips', 'pageScale'], parent);
|
||||
ui.menus.addMenuItems(menu, ['scrollbars', 'tooltips', 'pageScale'], parent);
|
||||
|
||||
if (urlParams['embed'] != '1' && isLocalStorage)
|
||||
if (urlParams['embed'] != '1' && (isLocalStorage || mxClient.IS_CHROMEAPP))
|
||||
{
|
||||
ui.menus.addMenuItems(menu, ['-', 'search', 'scratchpad', '-', 'showStartScreen'], parent);
|
||||
}
|
||||
|
||||
if (!ui.isOfflineApp() && urlParams['embed'] != '1')
|
||||
|
||||
if (!ui.isOfflineApp() && urlParams['embed'] != '1' && isLocalStorage)
|
||||
{
|
||||
ui.menus.addMenuItems(menu, ['-', 'plugins'], parent);
|
||||
menu.addSeparator(parent);
|
||||
var item = ui.menus.addMenuItem(menu, 'plugins', parent);
|
||||
|
||||
if (!ui.isOffline())
|
||||
{
|
||||
ui.menus.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000056430');
|
||||
}
|
||||
}
|
||||
})));
|
||||
|
||||
|
|
2
src/main/webapp/js/embed-static.min.js
vendored
2
src/main/webapp/js/embed-static.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.5",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
2
src/main/webapp/js/reader.min.js
vendored
2
src/main/webapp/js/reader.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.5",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"8.8.6",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
519
src/main/webapp/js/viewer.min.js
vendored
519
src/main/webapp/js/viewer.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue