9.0.1 release
This commit is contained in:
parent
e3b1e08237
commit
6612ce8d07
19 changed files with 3133 additions and 3068 deletions
|
@ -1,3 +1,7 @@
|
|||
31-JUL-2018: 9.0.1
|
||||
|
||||
- Fixes insert to GitHub with URL parameter
|
||||
|
||||
28-JUL-2018: 9.0.0
|
||||
|
||||
- Disables persisted default styles
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
9.0.0
|
||||
9.0.1
|
13
etc/docker/Dockerfile
Normal file
13
etc/docker/Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
|||
FROM frekele/ant:1.10.3-jdk8 as BUILD
|
||||
RUN mkdir /usr/build
|
||||
COPY src /usr/build/src
|
||||
COPY etc /usr/build/etc
|
||||
COPY war /usr/build/war
|
||||
COPY VERSION /usr/build
|
||||
RUN cd /usr/build/etc/build/
|
||||
RUN ant -file /usr/build/etc/build/build.xml war
|
||||
|
||||
FROM tomcat:9.0 as TARGET
|
||||
COPY --from=BUILD /usr/build/build/draw.war /usr/local/tomcat/webapps/
|
||||
EXPOSE 8080
|
||||
CMD ["catalina.sh", "run"]
|
9
etc/docker/README.md
Normal file
9
etc/docker/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
Docker
|
||||
------
|
||||
After successful checkout, from the project directory run,
|
||||
|
||||
```bash
|
||||
docker build -t draw .
|
||||
docker run -d -p 8888:8080 draw
|
||||
```
|
||||
Now the app will be accessible at `http://localhost:8888/draw/?https=0`
|
|
@ -72,7 +72,7 @@ namespace VsdConverter.Controllers
|
|||
//TODO is this secure or it only returns the header?
|
||||
String origin = Request.GetCorsRequestContext().Origin;
|
||||
|
||||
if (!origin.EndsWith("draw.io") && !origin.EndsWith("jgraph.com"))
|
||||
if (!origin.EndsWith(".draw.io") && !origin.EndsWith(".jgraph.com") && !origin.EndsWith(".quipelements.com"))
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.Forbidden);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 07/28/2018 12:14 PM
|
||||
# 07/31/2018 05:24 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
|
@ -391,16 +391,16 @@
|
|||
</div>
|
||||
<table align="center" height="100%">
|
||||
<tr>
|
||||
<td id="geFooterItem2" align="center" style="width:280px;transition: all 1s ease;">
|
||||
<a title="Quick Start Video" href="https://www.youtube.com/watch?v=Z0D96ZikMkc" target="_blank">
|
||||
<td id="geFooterItem1" align="center" style="width:280px;transition: all 1s ease;">
|
||||
<a title="GitHub" href="https://github.com/jgraph/drawio" target="_blank">
|
||||
<img border="0" align="absmiddle" style="margin-top:-4px;padding-right:10px;"
|
||||
width="26" height="20" src="images/youtube.png"/>Quick Start Video</a>
|
||||
width="24" height="24" src="images/glyphicons_github.png"/>Fork us on GitHub</a>
|
||||
</td>
|
||||
<td id="geFooterItem1" align="center" style="width:260px;">
|
||||
<a id="geFooterLink1" title="#1 Rated Confluence Add-on" target="_blank"
|
||||
href="https://about.draw.io/integrations/confluence-integration/">
|
||||
<img border="0" width="24" height="24" align="absmiddle" style="padding-right:10px;"
|
||||
src="images/logo-confluence.png"/>#1 Rated Confluence App
|
||||
<td id="geFooterItem2" align="center" style="width:260px;">
|
||||
<a id="geFooterLink1" title="Download draw.io Desktop" target="_blank"
|
||||
href="https://get.draw.io/">
|
||||
<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:10px;"
|
||||
width="26" src="images/drawlogo48.png">Download draw.io Desktop
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
1496
src/main/webapp/js/app.min.js
vendored
1496
src/main/webapp/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
1759
src/main/webapp/js/atlas-viewer.min.js
vendored
1759
src/main/webapp/js/atlas-viewer.min.js
vendored
File diff suppressed because one or more lines are too long
560
src/main/webapp/js/atlas.min.js
vendored
560
src/main/webapp/js/atlas.min.js
vendored
|
@ -2467,9 +2467,8 @@ HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangle
|
|||
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
|
||||
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(a){this.reset()}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(c){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||
|
||||
!mxEvent.isTouchEvent(c.getEvent())||this.graph.model.isVertex(c.getCell())||this.reset()});var c=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,b){c=!1;var d=b.getEvent();if(this.isResetEvent(d))this.reset();else if(!this.isActive()){var e=this.getState(b.getState());null==e&&mxEvent.isTouchEvent(d)||this.update(e)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,b){var d=b.getEvent();this.isResetEvent(d)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(d)||
|
||||
this.update(this.getState(b.getState()),b.getGraphX(),b.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(c=!0)}),mouseUp:mxUtils.bind(this,function(a,b){var d=b.getEvent();this.isResetEvent(d)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(b.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(b.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?c||this.click(this.currentState,this.getDirection(),b):this.isActive()?1==
|
||||
this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(b.getGraphX(),b.getGraphY())))):mxEvent.isTouchEvent(d)||null!=this.bbox&&mxUtils.contains(this.bbox,b.getGraphX(),b.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(d)||this.reset();c=!1;this.resetActiveArrow()})})};
|
||||
HoverIcons.prototype.isResetEvent=function(a,c){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
||||
this.update(this.getState(b.getState()),b.getGraphX(),b.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(c=!0)}),mouseUp:mxUtils.bind(this,function(a,b){var d=b.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(d),mxEvent.getClientY(d));this.isResetEvent(d)?this.reset():this.isActive()&&!c&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),b):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
|
||||
this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(b.getGraphX(),b.getGraphY())))):mxEvent.isTouchEvent(d)||null!=this.bbox&&mxUtils.contains(this.bbox,b.getGraphX(),b.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(d)||this.reset();c=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,c){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
||||
HoverIcons.prototype.createArrow=function(a,c){var d=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(d=document.createElement(mxClient.VML_PREFIX+":image"),d.setAttribute("src",a.src),d.style.borderStyle="none"):(d=document.createElement("div"),d.style.backgroundImage="url("+a.src+")",d.style.backgroundPosition="center",d.style.backgroundRepeat="no-repeat"),d.style.width=a.width+4+"px",d.style.height=a.height+4+"px",d.style.display=mxClient.IS_QUIRKS?"inline":
|
||||
"inline-block"):(d=mxUtils.createImage(a.src),d.style.width=a.width+"px",d.style.height=a.height+"px",d.style.padding=this.tolerance+"px");null!=c&&d.setAttribute("title",c);d.style.position="absolute";d.style.cursor=this.cssCursor;mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){null==this.currentState||this.isResetEvent(a)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),
|
||||
this.activeArrow=d,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redirectMouseEvents(d,this.graph,this.currentState);mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=d&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(d,100),this.activeArrow=d)}));mxEvent.addListener(d,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||
|
||||
|
@ -6970,10 +6969,10 @@ StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.sav
|
|||
StorageFile.prototype.saveFile=function(a,e,d,c){if(this.isEditable()){var h=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!=d&&d()}))}catch(k){null!=c&&c(k)}});this.isRenamable()&&"."==a.charAt(0)&&null!=c?c({message:mxResources.get("invalidName")}):this.ui.getLocalData(a,mxUtils.bind(this,function(d){this.isRenamable()&&this.getTitle()!=a&&null!=d?this.ui.confirm(mxResources.get("replaceIt",
|
||||
[a]),h,c):h()}))}else null!=d&&d()};StorageFile.prototype.rename=function(a,e,d){var c=this.getTitle();c!=a?this.ui.getLocalData(a,mxUtils.bind(this,function(h){var k=mxUtils.bind(this,function(){this.title=a;this.hasSameExtension(c,a)||this.setData(this.ui.getFileData());this.saveFile(a,!1,mxUtils.bind(this,function(){this.ui.removeLocalData(c,e)}),d)});null!=h?this.ui.confirm(mxResources.get("replaceIt",[a]),k,d):k()})):e()};
|
||||
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,e,d){StorageFile.call(this,a,e,d)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,e,d){this.saveFile(a,!1,e,d)};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,e,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,e,d){StorageFile.call(this,a,e,d);a=d;e=a.lastIndexOf("/");0<=e&&(a=a.substring(e+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,e,d){return!1};UrlLibrary.prototype.saveAs=function(a,e,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,e,d){function c(c,q,u,g,w,E){function v(){mxEvent.addListener(t,"click",null!=E?E: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);e()})):(a.setMode(u,b.checked),e()):window.location.hostname=DriveClient.prototype.newAppHostname})}var t=document.createElement("a");t.style.overflow="hidden";t.style.display=
|
||||
StorageLibrary.prototype.isRenamable=function(a,e,d){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,e,d){StorageFile.call(this,a,e,d);a=d;e=a.lastIndexOf("/");0<=e&&(a=a.substring(e+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,e,d){return!1};UrlLibrary.prototype.saveAs=function(a,e,d){};UrlLibrary.prototype.open=function(){};var StorageDialog=function(a,e,d){function c(c,q,u,g,v,D){function w(){mxEvent.addListener(t,"click",null!=D?D: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);e()})):(a.setMode(u,b.checked),e()):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",q);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");var h=document.createElement("div");h.style.textOverflow="ellipsis";h.style.overflow="hidden";if(null!=c){var k=document.createElement("img");
|
||||
k.setAttribute("src",c);k.setAttribute("border","0");k.setAttribute("align","absmiddle");k.style.width="60px";k.style.height="60px";k.style.paddingBottom="6px";t.appendChild(k)}else h.style.paddingTop="5px",h.style.whiteSpace="normal",mxClient.IS_IOS?(t.style.padding="0px 10px 20px 10px",t.style.top="6px"):mxClient.IS_FF&&(h.style.paddingTop="0px",h.style.marginTop="-2px");t.appendChild(h);mxUtils.write(h,q);if(null!=w)for(c=0;c<w.length;c++)mxUtils.br(h),mxUtils.write(h,w[c]);if(null!=g&&null==a[g]){k.style.visibility=
|
||||
"hidden";mxUtils.setOpacity(h,10);var y=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});y.spin(t);var m=window.setTimeout(function(){null==a[g]&&(y.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(m),mxUtils.setOpacity(h,100),k.style.visibility="",y.stop(),v(),"drive"==g&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else v();
|
||||
k.setAttribute("src",c);k.setAttribute("border","0");k.setAttribute("align","absmiddle");k.style.width="60px";k.style.height="60px";k.style.paddingBottom="6px";t.appendChild(k)}else h.style.paddingTop="5px",h.style.whiteSpace="normal",mxClient.IS_IOS?(t.style.padding="0px 10px 20px 10px",t.style.top="6px"):mxClient.IS_FF&&(h.style.paddingTop="0px",h.style.marginTop="-2px");t.appendChild(h);mxUtils.write(h,q);if(null!=v)for(c=0;c<v.length;c++)mxUtils.br(h),mxUtils.write(h,v[c]);if(null!=g&&null==a[g]){k.style.visibility=
|
||||
"hidden";mxUtils.setOpacity(h,10);var y=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});y.spin(t);var m=window.setTimeout(function(){null==a[g]&&(y.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(m),mxUtils.setOpacity(h,100),k.style.visibility="",y.stop(),w(),"drive"==g&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else w();
|
||||
p.appendChild(t);++f>=d&&(mxUtils.br(p),f=0)}d=null!=d?d:2;var h=document.createElement("div");h.style.textAlign="center";h.style.whiteSpace="nowrap";h.style.paddingTop="0px";h.style.paddingBottom="20px";var k=a.addLanguageMenu(h,!0);null!=k&&(k.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){k=document.createElement("a");k.setAttribute("href","https://about.draw.io/support/");k.setAttribute("title",mxResources.get("help"));k.setAttribute("target","_blank");k.style.position=
|
||||
"absolute";k.style.textDecoration="none";k.style.cursor="pointer";k.style.fontSize="12px";k.style.bottom="28px";k.style.left="26px";k.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";k.appendChild(m);mxUtils.write(k,mxResources.get("help"));h.appendChild(k)}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"};h.appendChild(n);mxEvent.addListener(n,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,
|
||||
|
@ -6990,13 +6989,13 @@ c.style.height="40px";c.style.marginRight="12px";c.style.paddingBottom="4px";var
|
|||
"/trello-logo.svg",h=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(c.src=IMAGE_PATH+"/osa_database.png",h=mxResources.get("browser")):(c.src=IMAGE_PATH+"/osa_drive-harddisk.png",h=mxResources.get("device"));var k=document.createElement("div");k.style.margin="4px 0px 0px 0px";var m=document.createElement("button");m.className="geBigButton";m.style.overflow="hidden";m.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(k.style.padding="42px 0px 56px 0px",m.style.marginBottom="12px"):
|
||||
(d.appendChild(c),mxUtils.write(d,h),e.appendChild(d),k.style.border="1px solid #d3d3d3",k.style.borderWidth="1px 0px 1px 0px",k.style.padding="18px 0px 24px 0px",m.style.marginBottom="8px");mxClient.IS_QUIRKS&&(k.style.whiteSpace="nowrap",k.style.cssFloat="left");mxClient.IS_QUIRKS&&(m.style.width="340px");mxUtils.write(m,mxResources.get("createNewDiagram"));mxEvent.addListener(m,"click",function(){a.hideDialog();a.actions.get("new").funct()});k.appendChild(m);mxUtils.br(k);m=document.createElement("button");
|
||||
m.className="geBigButton";m.style.marginBottom="22px";m.style.overflow="hidden";m.style.width="340px";mxClient.IS_QUIRKS&&(m.style.width="340px");mxUtils.write(m,mxResources.get("openExistingDiagram"));mxEvent.addListener(m,"click",function(){a.actions.get("open").funct()});k.appendChild(m);d="undefined";a.mode==App.MODE_GOOGLE?d=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?d=mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?d=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?d=mxResources.get("github"):
|
||||
a.mode==App.MODE_TRELLO?d=mxResources.get("trello"):a.mode==App.MODE_DEVICE?d=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(d=mxResources.get("browser"));mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(h=function(c){m.style.marginBottom="24px";var d=document.createElement("a");d.setAttribute("href","javascript:void(0)");d.style.display="block";d.style.marginTop="6px";mxUtils.write(d,mxResources.get("signOut"));m.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(d,"click",
|
||||
function(){a.confirm(mxResources.get("areYouSure"),function(){c()})});k.appendChild(d)},c=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=c?(m.style.marginBottom="24px",h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="block",h.style.marginTop="6px",mxUtils.write(h,mxResources.get("changeUser")+" ("+c.displayName+")"),m.style.marginBottom="16px",k.style.paddingBottom="18px",mxEvent.addListener(h,"click",function(){a.hideDialog();a.drive.clearUserId();
|
||||
a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();a.showSplash()})),mxUtils.bind(this,function(c){a.handleError(c,null,function(){a.hideDialog();a.showSplash()})}))}),k.appendChild(h)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?h(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?h(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):
|
||||
a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&h(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&h(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")}),h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="block",h.style.marginTop="8px",mxUtils.write(h,mxResources.get("notUsingService",[d])),mxEvent.addListener(h,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),
|
||||
k.appendChild(h));e.appendChild(k);this.container=e},ConfirmDialog=function(a,e,d,c,h,k,m,n,p){var b=document.createElement("div");b.style.textAlign="center";var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight="44px";mxClient.IS_QUIRKS&&(f.style.height="60px");mxUtils.write(f,e);b.appendChild(f);f=document.createElement("div");f.style.textAlign="center";f.style.whiteSpace="nowrap";var l=document.createElement("input");l.setAttribute("type","checkbox");
|
||||
k=mxUtils.button(k||mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c(l.checked)});k.className="geBtn";null!=n&&(k.innerHTML=n+"<br>"+k.innerHTML,k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.style.width="40%");a.editor.cancelFirst&&f.appendChild(k);h=mxUtils.button(h||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d(l.checked)});f.appendChild(h);null!=m?(h.innerHTML=m+"<br>"+h.innerHTML+"<br>",h.style.paddingBottom="8px",h.style.paddingTop="8px",
|
||||
h.style.height="auto",h.className="geBtn",h.style.width="40%"):h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||f.appendChild(k);b.appendChild(f);p?(f.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop="20px",f.appendChild(l),m=document.createElement("span"),mxUtils.write(m," "+mxResources.get("rememberThisSetting")),f.appendChild(m),b.appendChild(f),mxEvent.addListener(m,"click",function(b){l.checked=!l.checked;mxEvent.consume(b)})):f.style.marginTop="16px";this.container=
|
||||
a.mode==App.MODE_TRELLO?d=mxResources.get("trello"):a.mode==App.MODE_DEVICE?d=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(d=mxResources.get("browser"));mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(h=function(c){m.style.marginBottom="24px";var d=document.createElement("a");d.setAttribute("href","javascript:void(0)");d.style.display="inline-block";d.style.marginTop="6px";mxUtils.write(d,mxResources.get("signOut"));m.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(d,
|
||||
"click",function(){a.confirm(mxResources.get("areYouSure"),function(){c()})});k.appendChild(d)},c=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=c?(m.style.marginBottom="24px",h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="inline-block",h.style.marginTop="6px",mxUtils.write(h,mxResources.get("changeUser")+" ("+c.displayName+")"),m.style.marginBottom="16px",k.style.paddingBottom="18px",mxEvent.addListener(h,"click",function(){a.hideDialog();
|
||||
a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();a.showSplash()})),mxUtils.bind(this,function(c){a.handleError(c,null,function(){a.hideDialog();a.showSplash()})}))}),k.appendChild(h)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?h(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?h(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):
|
||||
a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&h(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&h(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")}),mxUtils.br(k),h=document.createElement("a"),h.setAttribute("href","javascript:void(0)"),h.style.display="inline-block",h.style.marginTop="8px",mxUtils.write(h,mxResources.get("notUsingService",[d])),mxEvent.addListener(h,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();
|
||||
a.showSplash(!0)}),k.appendChild(h));e.appendChild(k);this.container=e},ConfirmDialog=function(a,e,d,c,h,k,m,n,p){var b=document.createElement("div");b.style.textAlign="center";var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight="44px";mxClient.IS_QUIRKS&&(f.style.height="60px");mxUtils.write(f,e);b.appendChild(f);f=document.createElement("div");f.style.textAlign="center";f.style.whiteSpace="nowrap";var l=document.createElement("input");l.setAttribute("type",
|
||||
"checkbox");k=mxUtils.button(k||mxResources.get("cancel"),function(){a.hideDialog();null!=c&&c(l.checked)});k.className="geBtn";null!=n&&(k.innerHTML=n+"<br>"+k.innerHTML,k.style.paddingBottom="8px",k.style.paddingTop="8px",k.style.height="auto",k.style.width="40%");a.editor.cancelFirst&&f.appendChild(k);h=mxUtils.button(h||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d(l.checked)});f.appendChild(h);null!=m?(h.innerHTML=m+"<br>"+h.innerHTML+"<br>",h.style.paddingBottom="8px",h.style.paddingTop=
|
||||
"8px",h.style.height="auto",h.className="geBtn",h.style.width="40%"):h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||f.appendChild(k);b.appendChild(f);p?(f.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop="20px",f.appendChild(l),m=document.createElement("span"),mxUtils.write(m," "+mxResources.get("rememberThisSetting")),f.appendChild(m),b.appendChild(f),mxEvent.addListener(m,"click",function(b){l.checked=!l.checked;mxEvent.consume(b)})):f.style.marginTop="16px";this.container=
|
||||
b},EmbedDialog=function(a,e,d,c,h,k){c=document.createElement("div");var m=/^https?:\/\//.test(e)||/^mailto:\/\//.test(e);null!=k?mxUtils.write(c,k):mxUtils.write(c,mxResources.get(5E5>e.length?m?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(c);k=document.createElement("div");k.style.position="absolute";k.style.top="30px";k.style.right="30px";k.style.color="gray";mxUtils.write(k,a.formatFileSize(e.length));c.appendChild(k);var n=document.createElement("textarea");n.setAttribute("autocomplete",
|
||||
"off");n.setAttribute("autocorrect","off");n.setAttribute("autocapitalize","off");n.setAttribute("spellcheck","false");n.style.marginTop="10px";n.style.resize="none";n.style.height="150px";n.style.width="440px";n.style.border="1px solid gray";n.value=mxResources.get("updatingDocument");c.appendChild(n);mxUtils.br(c);this.init=function(){window.setTimeout(function(){5E5>e.length?(n.value=e,n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",
|
||||
!1,null)):(n.setAttribute("readonly","true"),n.value=e.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};k=document.createElement("div");k.style.position="absolute";k.style.bottom="36px";k.style.right="32px";var p=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!m||navigator.standalone||!(m||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(p=mxUtils.button(mxResources.get(5E5>e.length?"preview":"openInNewWindow"),function(){var b=5E5>e.length?
|
||||
|
@ -7006,15 +7005,15 @@ b=document.createElement("img");b.setAttribute("src",Editor.facebookImage);b.set
|
|||
"&url="+encodeURIComponent(n.value);a.openLink(b)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}}),b=document.createElement("img"),b.setAttribute("src",Editor.tweetImage),b.setAttribute("width","18"),b.setAttribute("height","18"),b.setAttribute("border","0"),b.style.marginBottom="5px",f.appendChild(b),f.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",
|
||||
f.className="geBtn",k.appendChild(f))}b=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.appendChild(b);f=mxUtils.button(mxResources.get("copy"),function(){n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>e.length?mxClient.IS_SF||null!=document.documentMode?b.className="geBtn gePrimaryBtn":(k.appendChild(f),
|
||||
f.className="geBtn gePrimaryBtn",b.className="geBtn"):(k.appendChild(p),b.className="geBtn",p.className="geBtn gePrimaryBtn");c.appendChild(k);this.container=c};EmbedDialog.showPreviewOption=!0;
|
||||
var GoogleSitesDialog=function(a,e){function d(){var a=null!=x.getTitle()?x.getTitle():this.defaultFilename;if(E.checked&&""!=q.value){var c="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=a&&(c+="&title="+encodeURIComponent(a));0<C.length&&(c+="&s="+C);""!=u.value&&"0"!=u.value&&(c+="&border="+u.value);""!=l.value&&(c+="&height="+l.value);c+="&pan="+(t.checked?"1":"0");c+="&zoom="+(v.checked?"1":"0");c+="&fit="+(w.checked?"1":"0");c+="&resize="+
|
||||
var GoogleSitesDialog=function(a,e){function d(){var a=null!=x.getTitle()?x.getTitle():this.defaultFilename;if(D.checked&&""!=q.value){var c="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(q.value));null!=a&&(c+="&title="+encodeURIComponent(a));0<C.length&&(c+="&s="+C);""!=u.value&&"0"!=u.value&&(c+="&border="+u.value);""!=l.value&&(c+="&height="+l.value);c+="&pan="+(t.checked?"1":"0");c+="&zoom="+(w.checked?"1":"0");c+="&fit="+(v.checked?"1":"0");c+="&resize="+
|
||||
(g.checked?"1":"0");c+="&x0="+Number(f.value);c+="&y0="+p;h.mathEnabled&&(c+="&math=1");B.checked?c+="&edit=_blank":y.checked&&(c+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));b.value=c}else x.constructor==DriveFile||x.constructor==DropboxFile?(c="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=q.value?c+=encodeURIComponent(mxUtils.htmlEntities(q.value))+"&type=3":(c+=x.getHash().substring(1),c=x.constructor==DropboxFile?c+"&type=2":c+"&type=1"),null!=a&&(c+="&title="+
|
||||
encodeURIComponent(a)),""!=l.value&&(a=parseInt(l.value)+parseInt(f.value),c+="&height="+a),b.value=c):b.value=""}var c=document.createElement("div"),h=a.editor.graph,k=h.getGraphBounds(),m=h.view.scale,n=Math.floor(k.x/m-h.view.translate.x),p=Math.floor(k.y/m-h.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var b=document.createElement("input");b.setAttribute("type","text");b.style.marginBottom="8px";b.style.marginTop="2px";b.style.width="410px";c.appendChild(b);
|
||||
mxUtils.br(c);this.init=function(){b.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?b.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=n;c.appendChild(f);mxUtils.write(c,mxResources.get("height")+":");var l=document.createElement("input");l.setAttribute("type",
|
||||
"text");l.setAttribute("size","4");l.style.marginLeft="4px";l.value=Math.ceil(k.height/m);c.appendChild(l);mxUtils.br(c);k=document.createElement("hr");k.setAttribute("size","1");k.style.marginBottom="16px";k.style.marginTop="16px";c.appendChild(k);mxUtils.write(c,mxResources.get("publicDiagramUrl")+":");mxUtils.br(c);var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","28");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px";q.value=e||"";
|
||||
c.appendChild(q);mxUtils.br(c);mxUtils.write(c,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";c.appendChild(u);mxUtils.br(c);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";c.appendChild(t);mxUtils.write(c,mxResources.get("pan")+" ");var v=document.createElement("input");
|
||||
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";c.appendChild(v);mxUtils.write(c,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);c.appendChild(y);mxUtils.write(c,mxResources.get("edit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft="8px";c.appendChild(B);mxUtils.write(c,
|
||||
mxResources.get("asNew")+" ");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=!0;g.style.marginLeft="16px";c.appendChild(g);mxUtils.write(c,mxResources.get("resize")+" ");var w=document.createElement("input");w.setAttribute("type","checkbox");w.style.marginLeft="8px";c.appendChild(w);mxUtils.write(c,mxResources.get("fit")+" ");var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginLeft=
|
||||
"8px";c.appendChild(E);mxUtils.write(c,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),x=a.getCurrentFile();mxEvent.addListener(t,"change",d);mxEvent.addListener(v,"change",d);mxEvent.addListener(g,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(B,"change",d);mxEvent.addListener(E,"change",d);mxEvent.addListener(l,"change",d);mxEvent.addListener(f,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(q,"change",d);d();
|
||||
c.appendChild(q);mxUtils.br(c);mxUtils.write(c,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";c.appendChild(u);mxUtils.br(c);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";c.appendChild(t);mxUtils.write(c,mxResources.get("pan")+" ");var w=document.createElement("input");
|
||||
w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="8px";c.appendChild(w);mxUtils.write(c,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);c.appendChild(y);mxUtils.write(c,mxResources.get("edit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft="8px";c.appendChild(B);mxUtils.write(c,
|
||||
mxResources.get("asNew")+" ");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=!0;g.style.marginLeft="16px";c.appendChild(g);mxUtils.write(c,mxResources.get("resize")+" ");var v=document.createElement("input");v.setAttribute("type","checkbox");v.style.marginLeft="8px";c.appendChild(v);mxUtils.write(c,mxResources.get("fit")+" ");var D=document.createElement("input");D.setAttribute("type","checkbox");D.style.marginLeft=
|
||||
"8px";c.appendChild(D);mxUtils.write(c,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),x=a.getCurrentFile();mxEvent.addListener(t,"change",d);mxEvent.addListener(w,"change",d);mxEvent.addListener(g,"change",d);mxEvent.addListener(v,"change",d);mxEvent.addListener(y,"change",d);mxEvent.addListener(B,"change",d);mxEvent.addListener(D,"change",d);mxEvent.addListener(l,"change",d);mxEvent.addListener(f,"change",d);mxEvent.addListener(u,"change",d);mxEvent.addListener(q,"change",d);d();
|
||||
mxEvent.addListener(b,"click",function(){b.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?b.select():document.execCommand("selectAll",!1,null)});k=document.createElement("div");k.style.paddingTop="12px";k.style.textAlign="right";m=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});m.className="geBtn gePrimaryBtn";k.appendChild(m);c.appendChild(k);this.container=c},CreateGraphDialog=function(a,e,d){var c=document.createElement("div");c.style.textAlign=
|
||||
"right";this.init=function(){var e=document.createElement("div");e.style.position="relative";e.style.border="1px solid gray";e.style.width="100%";e.style.height="360px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);c.appendChild(e);var k=new Graph(e);k.setCellsCloneable(!0);k.setPanning(!0);k.setAllowDanglingEdges(!1);k.connectionHandler.select=!1;k.view.setTranslate(20,20);k.border=20;k.panningHandler.useLeftButtonForPanning=!0;var m="curved=1;";k.cellRenderer.installCellOverlayListeners=
|
||||
function(b,a,f){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(f.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(g){a.fireEvent(new mxEventObject("pointerdown","event",g,"state",b))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(f.node,"touchstart",function(g){a.fireEvent(new mxEventObject("pointerdown","event",g,"state",b))})};k.getAllConnectionConstraints=function(){return null};k.connectionHandler.marker.highlight.keepOnTop=
|
||||
|
@ -7036,17 +7035,17 @@ b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);if(!a.isOffline()&&"u
|
|||
f.className="geBtn";c.appendChild(f);null!=a.drive&&"1"==urlParams.photos&&(f=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(b){ImageDialog.filePicked(b)}).build()}a.photoPicker.setVisible(!0)}))}),f.className="geBtn",c.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();e(""!=h.value?new mxImage(mxUtils.trim(h.value),n.value,p.value):null)});f.className="geBtn gePrimaryBtn";c.appendChild(f);a.editor.cancelFirst||c.appendChild(b);d.appendChild(c);this.container=d},ParseDialog=function(a,e,d){function c(b,f){var c=b.split("\n");if("plantUmlPng"==f||"plantUmlSvg"==
|
||||
f||"plantUmlTxt"==f){var c="plantUmlTxt"==f?PLANT_URL+"/txt/":"plantUmlPng"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/",l=a.editor.graph;if(a.spinner.spin(document.body,mxResources.get("inserting"))){var d=function(b){if(10>b)return String.fromCharCode(48+b);b-=10;if(26>b)return String.fromCharCode(65+b);b-=26;if(26>b)return String.fromCharCode(97+b);b-=26;return 0==b?"-":1==b?"_":"?"},e=function(b,a,g){c1=b>>2;c2=(b&3)<<4|a>>4;c3=(a&15)<<2|g>>6;c4=g&63;r="";r+=d(c1&63);r+=d(c2&63);r+=d(c3&63);return r+=
|
||||
d(c4&63)},g=new XMLHttpRequest;g.open("GET",c+function(b){r="";for(h=0;h<b.length;h+=3)r=h+2==b.length?r+e(b.charCodeAt(h),b.charCodeAt(h+1),0):h+1==b.length?r+e(b.charCodeAt(h),0,0):r+e(b.charCodeAt(h),b.charCodeAt(h+1),b.charCodeAt(h+2));return r}(l.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);"plantUmlTxt"!=f&&(g.responseType="blob");g.onload=function(g){if(200<=this.status&&300>this.status)if("plantUmlTxt"==f){a.spinner.stop();l.getModel().beginUpdate();try{cell=l.insertVertex(null,
|
||||
null,"<pre>"+this.response+"</pre>",k.x,k.y,1,1,"text;html=1;overflow=fill;"),l.updateCellSize(cell,!0)}finally{l.getModel().endUpdate()}l.setSelectionCell(cell);l.scrollCellToVisible(l.getSelectionCell())}else g=new FileReader,g.readAsDataURL(this.response),g.onload=function(g){var f=new Image;f.onload=function(){a.spinner.stop();var c=f.width,w=f.height;if(0==c&&0==w){var d=g.target.result,q=d.indexOf(","),d=decodeURIComponent(escape(atob(d.substring(q+1)))),d=mxUtils.parseXml(d).getElementsByTagName("svg");
|
||||
0<d.length&&(c=parseFloat(d[0].getAttribute("width")),w=parseFloat(d[0].getAttribute("height")))}l.getModel().beginUpdate();try{cell=l.insertVertex(null,null,b,k.x,k.y,c,w,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(g.target.result)+";")}finally{l.getModel().endUpdate()}l.setSelectionCell(cell);l.scrollCellToVisible(l.getSelectionCell())};f.src=g.target.result},g.onerror=function(b){a.handleError(b)};else a.spinner.stop(),a.handleError(g)};g.onerror=
|
||||
function(b){a.handleError(b)};g.send()}}else if("table"==f){for(var w=null,q=[],u=0,h=0;h<c.length;h++)if(g=mxUtils.trim(c[h]),"create table"==g.substring(0,12).toLowerCase())g=mxUtils.trim(g.substring(12)),"("==g.charAt(g.length-1)&&(g=g.substring(0,g.lastIndexOf(" "))),w=new mxCell(g,new mxGeometry(u,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),
|
||||
w.vertex=!0,q.push(w),g=a.editor.graph.getPreferredSizeForCell(n),null!=g&&(w.geometry.width=g.width+10);else if(null!=w&&")"==g.charAt(0))u+=w.geometry.width+40,w=null;else if("("!=g&&null!=w&&(g=g.substring(0,","==g.charAt(g.length-1)?g.length-1:g.length),"primary key"!=g.substring(0,11).toLowerCase())){var m=g.toLowerCase().indexOf("primary key"),g=g.replace(/primary key/i,""),n=new mxCell(g,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
|
||||
n.vertex=!0;g=sb.cloneCell(n,0<m?"PK":"");g.connectable=!1;g.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";g.geometry.width=30;g.geometry.height=26;n.insert(g);g=a.editor.graph.getPreferredSizeForCell(n);null!=g&&w.geometry.width<g.width+10&&(w.geometry.width=Math.min(220,g.width+10));w.insert(n);w.geometry.height+=26}0<q.length&&(l=a.editor.graph,
|
||||
c=l.view,g=l.getGraphBounds(),l.setSelectionCells(l.importCells(q,Math.ceil(Math.max(0,g.x/c.scale-c.translate.x)+4*l.gridSize),Math.ceil(Math.max(0,(g.y+g.height)/c.scale-c.translate.y)+4*l.gridSize))),l.scrollCellToVisible(l.getSelectionCell()))}else if("list"==f){if(0<c.length){l=a.editor.graph;w=new mxCell(c[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;");
|
||||
w.vertex=!0;g=l.getPreferredSizeForCell(w);null!=g&&w.geometry.width<g.width+10&&(w.geometry.width=g.width+10);n=[w];if(1<c.length)for(h=1;h<c.length;h++)"--"==c[h]?(g=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;"),g.vertex=!0,w.geometry.height+=g.geometry.height,w.insert(g),n.push(g)):0<c[h].length&&";"!=c[h].charAt(0)&&(u=new mxCell(c[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,g=l.getPreferredSizeForCell(u),null!=g&&u.geometry.width<g.width&&(u.geometry.width=g.width),w.geometry.width=Math.max(w.geometry.width,u.geometry.width),w.geometry.height+=u.geometry.height,w.insert(u),n.push(u));l.getModel().beginUpdate();try{w=l.importCells([w],k.x,k.y)[0],l.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[w].concat(w.children)))}finally{l.getModel().endUpdate()}l.setSelectionCell(w);l.scrollCellToVisible(l.getSelectionCell())}}else{for(var n=function(b){var a=p[b];null==a&&(a=new mxCell(b,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),a.vertex=!0,p[b]=a,q.push(a));return a},p={},q=[],h=0;h<c.length;h++)if(";"!=c[h].charAt(0)){var A=c[h].split("->");2<=A.length&&(u=n(A[0]),m=n(A[A.length-1]),A=new mxCell(2<A.length?A[1]:"",new mxGeometry),A.edge=!0,u.insertEdge(A,!0),m.insertEdge(A,!1),
|
||||
q.push(A))}if(0<q.length){c=document.createElement("div");c.style.visibility="hidden";document.body.appendChild(c);l=new Graph(c);l.getModel().beginUpdate();try{q=l.importCells(q);for(h=0;h<q.length;h++)l.getModel().isVertex(q[h])&&(g=l.getPreferredSizeForCell(q[h]),q[h].geometry.width=Math.max(q[h].geometry.width,g.width),q[h].geometry.height=Math.max(q[h].geometry.height,g.height));w=new mxFastOrganicLayout(l);w.disableEdgeStyle=!1;w.forceConstant=120;w.execute(l.getDefaultParent())}finally{l.getModel().endUpdate()}l.clearCellOverlays();
|
||||
d(c4&63)},g=new XMLHttpRequest;g.open("GET",c+function(b){r="";for(h=0;h<b.length;h+=3)r=h+2==b.length?r+e(b.charCodeAt(h),b.charCodeAt(h+1),0):h+1==b.length?r+e(b.charCodeAt(h),0,0):r+e(b.charCodeAt(h),b.charCodeAt(h+1),b.charCodeAt(h+2));return r}(l.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);"plantUmlTxt"!=f&&(g.responseType="blob");g.onload=function(g){if(200<=this.status&&300>this.status)if("plantUmlTxt"==f)a.spinner.stop(),l.setSelectionCell(a.insertAsPreText(this.response,
|
||||
k.x,k.y)),l.scrollCellToVisible(l.getSelectionCell());else{var c=new FileReader;c.readAsDataURL(this.response);c.onloadend=function(g){var f=new Image;f.onload=function(){a.spinner.stop();var g=f.width,v=f.height;if(0==g&&0==v){var d=c.result,q=d.indexOf(","),d=decodeURIComponent(escape(atob(d.substring(q+1)))),d=mxUtils.parseXml(d).getElementsByTagName("svg");0<d.length&&(g=parseFloat(d[0].getAttribute("width")),v=parseFloat(d[0].getAttribute("height")))}l.getModel().beginUpdate();try{cell=l.insertVertex(null,
|
||||
null,b,k.x,k.y,g,v,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c.result)+";")}finally{l.getModel().endUpdate()}l.setSelectionCell(cell);l.scrollCellToVisible(l.getSelectionCell())};f.src=c.result};c.onerror=function(b){a.handleError(b)}}else a.spinner.stop(),a.handleError(g)};g.onerror=function(b){a.handleError(b)};g.send()}}else if("table"==f){for(var v=null,q=[],u=0,h=0;h<c.length;h++)if(g=mxUtils.trim(c[h]),"create table"==g.substring(0,12).toLowerCase())g=
|
||||
mxUtils.trim(g.substring(12)),"("==g.charAt(g.length-1)&&(g=g.substring(0,g.lastIndexOf(" "))),v=new mxCell(g,new mxGeometry(u,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),v.vertex=!0,q.push(v),g=a.editor.graph.getPreferredSizeForCell(n),null!=g&&(v.geometry.width=g.width+10);else if(null!=v&&")"==g.charAt(0))u+=v.geometry.width+
|
||||
40,v=null;else if("("!=g&&null!=v&&(g=g.substring(0,","==g.charAt(g.length-1)?g.length-1:g.length),"primary key"!=g.substring(0,11).toLowerCase())){var m=g.toLowerCase().indexOf("primary key"),g=g.replace(/primary key/i,""),n=new mxCell(g,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");n.vertex=
|
||||
!0;g=sb.cloneCell(n,0<m?"PK":"");g.connectable=!1;g.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";g.geometry.width=30;g.geometry.height=26;n.insert(g);g=a.editor.graph.getPreferredSizeForCell(n);null!=g&&v.geometry.width<g.width+10&&(v.geometry.width=Math.min(220,g.width+10));v.insert(n);v.geometry.height+=26}0<q.length&&(l=a.editor.graph,c=l.view,
|
||||
g=l.getGraphBounds(),l.setSelectionCells(l.importCells(q,Math.ceil(Math.max(0,g.x/c.scale-c.translate.x)+4*l.gridSize),Math.ceil(Math.max(0,(g.y+g.height)/c.scale-c.translate.y)+4*l.gridSize))),l.scrollCellToVisible(l.getSelectionCell()))}else if("list"==f){if(0<c.length){l=a.editor.graph;v=new mxCell(c[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;");
|
||||
v.vertex=!0;g=l.getPreferredSizeForCell(v);null!=g&&v.geometry.width<g.width+10&&(v.geometry.width=g.width+10);n=[v];if(1<c.length)for(h=1;h<c.length;h++)"--"==c[h]?(g=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;"),g.vertex=!0,v.geometry.height+=g.geometry.height,v.insert(g),n.push(g)):0<c[h].length&&";"!=c[h].charAt(0)&&(u=new mxCell(c[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,g=l.getPreferredSizeForCell(u),null!=g&&u.geometry.width<g.width&&(u.geometry.width=g.width),v.geometry.width=Math.max(v.geometry.width,u.geometry.width),v.geometry.height+=u.geometry.height,v.insert(u),n.push(u));l.getModel().beginUpdate();try{v=l.importCells([v],k.x,k.y)[0],l.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[v].concat(v.children)))}finally{l.getModel().endUpdate()}l.setSelectionCell(v);l.scrollCellToVisible(l.getSelectionCell())}}else{for(var n=function(b){var a=p[b];null==a&&(a=new mxCell(b,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),a.vertex=!0,p[b]=a,q.push(a));return a},p={},q=[],h=0;h<c.length;h++)if(";"!=c[h].charAt(0)){var A=c[h].split("->");2<=A.length&&(u=n(A[0]),m=n(A[A.length-1]),A=new mxCell(2<A.length?A[1]:"",new mxGeometry),A.edge=!0,u.insertEdge(A,!0),m.insertEdge(A,!1),
|
||||
q.push(A))}if(0<q.length){c=document.createElement("div");c.style.visibility="hidden";document.body.appendChild(c);l=new Graph(c);l.getModel().beginUpdate();try{q=l.importCells(q);for(h=0;h<q.length;h++)l.getModel().isVertex(q[h])&&(g=l.getPreferredSizeForCell(q[h]),q[h].geometry.width=Math.max(q[h].geometry.width,g.width),q[h].geometry.height=Math.max(q[h].geometry.height,g.height));v=new mxFastOrganicLayout(l);v.disableEdgeStyle=!1;v.forceConstant=120;v.execute(l.getDefaultParent())}finally{l.getModel().endUpdate()}l.clearCellOverlays();
|
||||
n=[];a.editor.graph.getModel().beginUpdate();try{n=a.editor.graph.importCells(l.getModel().getChildren(l.getDefaultParent()),k.x,k.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",n))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(n);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());l.destroy();c.parentNode.removeChild(c)}}}function h(){return"list"==n.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":
|
||||
"table"==n.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"==n.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"==n.value||"plantUmlTxt"==n.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 k=a.editor.graph.getFreeInsertPoint();e=document.createElement("div");e.style.textAlign="right";var m=document.createElement("textarea");m.style.resize="none";m.style.width="100%";m.style.height=
|
||||
|
@ -7054,46 +7053,46 @@ n=[];a.editor.graph.getModel().beginUpdate();try{n=a.editor.graph.importCells(l.
|
|||
p=document.createElement("option");p.setAttribute("value","diagram");mxUtils.write(p,mxResources.get("diagram"));"plantUml"!=d&&n.appendChild(p);p=document.createElement("option");p.setAttribute("value","plantUmlSvg");mxUtils.write(p,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==d&&p.setAttribute("selected","selected");var b=document.createElement("option");b.setAttribute("value","plantUmlPng");mxUtils.write(b,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
|
||||
")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==d&&(n.appendChild(p),n.appendChild(b),n.appendChild(f));var l=h();m.value=l;e.appendChild(m);this.init=function(){m.focus()};Graph.fileSupport&&(m.addEventListener("dragover",function(b){b.stopPropagation();b.preventDefault()},!1),m.addEventListener("drop",function(b){b.stopPropagation();
|
||||
b.preventDefault();if(0<b.dataTransfer.files.length){b=b.dataTransfer.files[0];var a=new FileReader;a.onload=function(b){m.value=b.target.result};a.readAsText(b)}},!1));e.appendChild(n);mxEvent.addListener(n,"change",function(){var b=h();if(0==m.value.length||m.value==l)l=b,m.value=l});d=mxUtils.button(mxResources.get("close"),function(){m.value==l?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});d.className="geBtn";a.editor.cancelFirst&&e.appendChild(d);p=mxUtils.button(mxResources.get("insert"),
|
||||
function(){a.hideDialog();c(m.value,n.value)});e.appendChild(p);p.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(d);this.container=e},NewDialog=function(a,e,d,c,h,k,m,n,p,b,f,l,q,u,t){function v(){for(var b=!0;D<V.length&&(b||0!=mxUtils.mod(D,30));)b=V[D++],g(b.url,b.libs,b.title,b.tooltip?b.tooltip:b.title,b.select,b.imgUrl,b.info,b.onClick),b=!1}function y(){if(aa)d||a.hideDialog(),u(aa,X,I.value);else if(c)d||a.hideDialog(),c(T,I.value);else{var b=I.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(g){a.createFile(b,T,null!=Q&&0<Q.length?Q:null,null,function(){a.hideDialog()},null,g)})}}function B(b,a,g,f,c){null!=U&&(U.style.backgroundColor="transparent",U.style.border="1px solid transparent");F.removeAttribute("disabled");T=a;Q=g;U=b;aa=f;X=c;U.style.backgroundColor=n;U.style.border=p}function g(b,a,g,f,c,l,w,d){var e=document.createElement("div");
|
||||
e.className="geTemplate";e.style.height=M+"px";e.style.width=ba+"px";null!=f&&0<f.length&&e.setAttribute("title",f);if(null!=l)e.style.backgroundImage="url("+l+")",e.style.backgroundSize="contain",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",mxEvent.addListener(e,"click",function(a){B(e,null,null,b,w)}),mxEvent.addListener(e,"dblclick",function(b){y()});else if(null!=b&&0<b.length){b.substring(0,b.length-4);e.style.backgroundImage="url("+TEMPLATE_PATH+"/"+b.substring(0,
|
||||
b.length-4)+".png)";e.style.backgroundPosition="center center";e.style.backgroundRepeat="no-repeat";var u=!1;mxEvent.addListener(e,"click",function(g){F.setAttribute("disabled","disabled");e.style.backgroundColor="transparent";e.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+b,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(B(e,b.getText(),a),u&&y())}))});mxEvent.addListener(e,"dblclick",function(b){u=!0})}else e.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+
|
||||
mxResources.get(g)+"</td></tr></table>",c&&B(e),null!=d?mxEvent.addListener(e,"click",d):(mxEvent.addListener(e,"click",function(b){B(e)}),mxEvent.addListener(e,"dblclick",function(b){y()}));N.appendChild(e)}function w(){mxEvent.addListener(N,"scroll",function(b){N.scrollTop+N.clientHeight>=N.scrollHeight&&(v(),mxEvent.consume(b))});var a=null,g;for(g in P){var f=document.createElement("div"),c=mxResources.get(g),l=P[g];null==c&&(c=g.substring(0,1).toUpperCase()+g.substring(1));18<c.length&&(c=c.substring(0,
|
||||
18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";f.setAttribute("title",c+" ("+l.length+")");mxUtils.write(f,f.getAttribute("title"));null!=b&&(f.style.padding=b);O.appendChild(f);null==a&&(a=f,a.style.backgroundColor=m);(function(b,g){mxEvent.addListener(f,"click",function(){a!=g&&(a.style.backgroundColor="",a=g,a.style.backgroundColor=m,N.scrollTop=0,N.innerHTML="",D=0,V=P[b],z=null,v())})})(g,
|
||||
f)}v()}d=null!=d?d:!0;h=null!=h?h:!1;m=null!=m?m:"#ebf2f9";n=null!=n?n:"#e6eff8";p=null!=p?p:"1px solid #ccd9ea";f=null!=f?f:TEMPLATE_PATH+"/index.xml";var E=document.createElement("div");E.style.height="100%";var C=document.createElement("div");C.style.whiteSpace="nowrap";C.style.height="46px";d&&E.appendChild(C);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";!e&&d&&C.appendChild(x);d&&mxUtils.write(C,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
|
||||
function(){a.hideDialog();c(m.value,n.value)});e.appendChild(p);p.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(d);this.container=e},NewDialog=function(a,e,d,c,h,k,m,n,p,b,f,l,q,u,t){function w(){for(var b=!0;E<V.length&&(b||0!=mxUtils.mod(E,30));)b=V[E++],g(b.url,b.libs,b.title,b.tooltip?b.tooltip:b.title,b.select,b.imgUrl,b.info,b.onClick),b=!1}function y(){if(aa)d||a.hideDialog(),u(aa,X,I.value);else if(c)d||a.hideDialog(),c(T,I.value);else{var b=I.value;null!=b&&0<b.length&&
|
||||
a.pickFolder(a.mode,function(g){a.createFile(b,T,null!=Q&&0<Q.length?Q:null,null,function(){a.hideDialog()},null,g)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function B(b,a,g,f,c){null!=U&&(U.style.backgroundColor="transparent",U.style.border="1px solid transparent");F.removeAttribute("disabled");T=a;Q=g;U=b;aa=f;X=c;U.style.backgroundColor=n;U.style.border=p}function g(b,a,g,f,c,l,v,d){var e=document.createElement("div");e.className="geTemplate";e.style.height=M+"px";
|
||||
e.style.width=ba+"px";null!=f&&0<f.length&&e.setAttribute("title",f);if(null!=l)e.style.backgroundImage="url("+l+")",e.style.backgroundSize="contain",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",mxEvent.addListener(e,"click",function(a){B(e,null,null,b,v)}),mxEvent.addListener(e,"dblclick",function(b){y()});else if(null!=b&&0<b.length){b.substring(0,b.length-4);e.style.backgroundImage="url("+TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png)";e.style.backgroundPosition=
|
||||
"center center";e.style.backgroundRepeat="no-repeat";var u=!1;mxEvent.addListener(e,"click",function(g){F.setAttribute("disabled","disabled");e.style.backgroundColor="transparent";e.style.border="1px solid transparent";mxUtils.get(TEMPLATE_PATH+"/"+b,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(B(e,b.getText(),a),u&&y())}))});mxEvent.addListener(e,"dblclick",function(b){u=!0})}else e.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="middle">'+mxResources.get(g)+
|
||||
"</td></tr></table>",c&&B(e),null!=d?mxEvent.addListener(e,"click",d):(mxEvent.addListener(e,"click",function(b){B(e)}),mxEvent.addListener(e,"dblclick",function(b){y()}));N.appendChild(e)}function v(){mxEvent.addListener(N,"scroll",function(b){N.scrollTop+N.clientHeight>=N.scrollHeight&&(w(),mxEvent.consume(b))});var a=null,g;for(g in P){var f=document.createElement("div"),c=mxResources.get(g),l=P[g];null==c&&(c=g.substring(0,1).toUpperCase()+g.substring(1));18<c.length&&(c=c.substring(0,18)+"…");
|
||||
f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";f.setAttribute("title",c+" ("+l.length+")");mxUtils.write(f,f.getAttribute("title"));null!=b&&(f.style.padding=b);O.appendChild(f);null==a&&(a=f,a.style.backgroundColor=m);(function(b,g){mxEvent.addListener(f,"click",function(){a!=g&&(a.style.backgroundColor="",a=g,a.style.backgroundColor=m,N.scrollTop=0,N.innerHTML="",E=0,V=P[b],z=null,w())})})(g,f)}w()}d=null!=
|
||||
d?d:!0;h=null!=h?h:!1;m=null!=m?m:"#ebf2f9";n=null!=n?n:"#e6eff8";p=null!=p?p:"1px solid #ccd9ea";f=null!=f?f:TEMPLATE_PATH+"/index.xml";var D=document.createElement("div");D.style.height="100%";var C=document.createElement("div");C.style.whiteSpace="nowrap";C.style.height="46px";d&&D.appendChild(C);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";!e&&d&&C.appendChild(x);d&&mxUtils.write(C,(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 I=document.createElement("input");I.setAttribute("value",a.defaultFilename+x);I.style.marginRight="20px";I.style.marginLeft="10px";I.style.width=
|
||||
e?"220px":"430px";this.init=function(){d&&(I.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?I.select():document.execCommand("selectAll",!1,null))};d&&C.appendChild(I);var C=!1,D=0,F=mxUtils.button(mxResources.get("create"),function(){F.setAttribute("disabled","disabled");y();F.removeAttribute("disabled")});F.className="geBtn gePrimaryBtn";if(l||q){var A=[],z=null,G=function(b){F.setAttribute("disabled","disabled");for(var a=0;a<A.length;a++)A[a].className=a==
|
||||
b?"geBtn gePrimaryBtn":"geBtn"},C=!0,x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height="30px";E.appendChild(x);var J=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){O.style.display="";N.style.left="160px";G(0);N.scrollTop=0;N.innerHTML="";D=0;z!=V&&(V=z,v(),z=null)});A.push(J);x.appendChild(J);var H=function(b){O.style.display="none";N.style.left="30px";G(b?-1:1);null==z&&(z=V);N.scrollTop=0;N.innerHTML="";var a=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});a.spin(N);D=0;var g=function(b,g){a.stop();V=b;g?N.innerHTML=g:0==b.length?N.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(N.innerHTML="",v())};b?q(L.value,g):l(g)};l&&(J=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){H()}),x.appendChild(J),A.push(J));if(q){J=document.createElement("span");J.style.marginLeft="10px";J.innerHTML=mxResources.get("search")+":";x.appendChild(J);
|
||||
e?"220px":"430px";this.init=function(){d&&(I.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?I.select():document.execCommand("selectAll",!1,null))};d&&C.appendChild(I);var C=!1,E=0,F=mxUtils.button(mxResources.get("create"),function(){F.setAttribute("disabled","disabled");y();F.removeAttribute("disabled")});F.className="geBtn gePrimaryBtn";if(l||q){var A=[],z=null,G=function(b){F.setAttribute("disabled","disabled");for(var a=0;a<A.length;a++)A[a].className=a==
|
||||
b?"geBtn gePrimaryBtn":"geBtn"},C=!0,x=document.createElement("div");x.style.whiteSpace="nowrap";x.style.height="30px";D.appendChild(x);var J=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){O.style.display="";N.style.left="160px";G(0);N.scrollTop=0;N.innerHTML="";E=0;z!=V&&(V=z,w(),z=null)});A.push(J);x.appendChild(J);var H=function(b){O.style.display="none";N.style.left="30px";G(b?-1:1);null==z&&(z=V);N.scrollTop=0;N.innerHTML="";var a=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});a.spin(N);E=0;var g=function(b,g){a.stop();V=b;g?N.innerHTML=g:0==b.length?N.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(N.innerHTML="",w())};b?q(L.value,g):l(g)};l&&(J=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){H()}),x.appendChild(J),A.push(J));if(q){J=document.createElement("span");J.style.marginLeft="10px";J.innerHTML=mxResources.get("search")+":";x.appendChild(J);
|
||||
var L=document.createElement("input");L.style.marginRight="10px";L.style.marginLeft="10px";L.style.width="220px";mxEvent.addListener(L,"keypress",function(b){13==b.keyCode&&H(!0)});x.appendChild(L);J=mxUtils.button(mxResources.get("search"),function(){H(!0)});J.className="geBtn";x.appendChild(J)}G(0)}var Q=null,T=null,U=null,aa=null,X=null,N=document.createElement("div");N.style.border="1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";C=(d?72:40)+(C?30:0);N.style.top=
|
||||
C+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var O=document.createElement("div");O.style.cssText="position:absolute;left:30px;width:128px;top:"+C+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var M=140,ba=140,P={},S=1;P.basic=[{title:"blankDiagram",select:!0}];var V=P.basic;if(!e){E.appendChild(O);E.appendChild(N);var K=!1;mxUtils.get(f,function(b){if(!K){K=!0;for(b=b.getXml().documentElement.firstChild;null!=b;){if("undefined"!==
|
||||
typeof b.getAttribute){var a=b.getAttribute("url");if(null!=a){var g=a.indexOf("/"),a=a.substring(0,g),g=P[a];null==g&&(S++,g=[],P[a]=g);g.push({url:b.getAttribute("url"),libs:b.getAttribute("libs"),title:b.getAttribute("title"),tooltip:b.getAttribute("url")})}}b=b.nextSibling}w()}})}mxEvent.addListener(I,"keypress",function(b){13==b.keyCode&&y()});f=document.createElement("div");f.style.marginTop=e?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom=
|
||||
C+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var O=document.createElement("div");O.style.cssText="position:absolute;left:30px;width:128px;top:"+C+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var M=140,ba=140,P={},S=1;P.basic=[{title:"blankDiagram",select:!0}];var V=P.basic;if(!e){D.appendChild(O);D.appendChild(N);var K=!1;mxUtils.get(f,function(b){if(!K){K=!0;for(b=b.getXml().documentElement.firstChild;null!=b;){if("undefined"!==
|
||||
typeof b.getAttribute){var a=b.getAttribute("url");if(null!=a){var g=a.indexOf("/"),a=a.substring(0,g),g=P[a];null==g&&(S++,g=[],P[a]=g);g.push({url:b.getAttribute("url"),libs:b.getAttribute("libs"),title:b.getAttribute("title"),tooltip:b.getAttribute("url")})}}b=b.nextSibling}v()}})}mxEvent.addListener(I,"keypress",function(b){13==b.keyCode&&y()});f=document.createElement("div");f.style.marginTop=e?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom=
|
||||
"24px";f.style.right="40px";C=mxUtils.button(mxResources.get("cancel"),function(){null!=k&&k();a.hideDialog(!0)});C.className="geBtn";!a.editor.cancelFirst||h&&null==k||f.appendChild(C);e||a.isOffline()||!d||null!=c||h||(x=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),x.className="geBtn",f.appendChild(x));e||"1"==urlParams.embed||h||(e=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(I.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()}),e.className="geBtn",f.appendChild(e));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(g){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",f.appendChild(t));f.appendChild(F);a.editor.cancelFirst||null!=c||h&&null==k||f.appendChild(C);E.appendChild(f);this.container=E},CreateDialog=function(a,e,d,c,h,k,m,n,p,b,f,l,q,u,t){function v(b,g,f,c){function d(){mxEvent.addListener(u,"click",function(){var b=f;if(m){var g=w.value,c=g.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>c){var b=null!=b?b:x.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&&(g=g.substring(0,c));w.value=g+l}}y(f)})}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=
|
||||
"multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(g){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",f.appendChild(t));f.appendChild(F);a.editor.cancelFirst||null!=c||h&&null==k||f.appendChild(C);D.appendChild(f);this.container=D},CreateDialog=function(a,e,d,c,h,k,m,n,p,b,f,l,q,u,t){function w(b,g,f,c){function d(){mxEvent.addListener(u,"click",function(){var b=f;if(m){var g=v.value,c=g.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>c){var b=null!=b?b:x.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&&(g=g.substring(0,c));v.value=g+l}}y(f)})}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 h=document.createElement("div");u.appendChild(h);mxUtils.write(h,g);if(null!=c&&null==a[c]){q.style.visibility="hidden";mxUtils.setOpacity(h,10);var t=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});t.spin(u);var v=window.setTimeout(function(){null==a[c]&&(t.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[c]&&(window.clearTimeout(v),mxUtils.setOpacity(h,100),q.style.visibility="",t.stop(),d())}))}else d();E.appendChild(u);++C==l&&(mxUtils.br(E),C=0)}function y(b){var g=w.value;if(null==b||null!=g&&0<g.length)a.hideDialog(),d(g,
|
||||
b)}m=null!=m?m:!0;n=null!=n?n:!0;l=null!=l?l:4;var B=document.createElement("div");null==c&&a.addLanguageMenu(B);var g=document.createElement("h2");mxUtils.write(g,h||mxResources.get("create"));g.style.marginTop="0px";g.style.marginBottom="24px";B.appendChild(g);mxUtils.write(B,mxResources.get("filename")+":");var w=document.createElement("input");w.setAttribute("value",e);w.style.width="280px";w.style.marginLeft="10px";w.style.marginBottom="20px";this.init=function(){w.focus();mxClient.IS_GC||mxClient.IS_FF||
|
||||
5<=document.documentMode||mxClient.IS_QUIRKS?w.select():document.execCommand("selectAll",!1,null)};B.appendChild(w);null!=q&&null!=u&&"image/"==u.substring(0,6)&&(w.style.width="160px",h=null,"image/svg+xml"==u&&mxClient.IS_SVG?(h=document.createElement("div"),h.innerHTML=mxUtils.trim(q),q=h.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")):
|
||||
(h=document.createElement("img"),h.setAttribute("src","data:"+u+(t?";base64,":";utf8,")+q)),h.style.position="absolute",h.style.top="70px",h.style.right="100px",h.style.maxWidth="120px",h.style.maxHeight="80px",mxUtils.setPrefixedStyle(h.style,"transform","translate(50%,-50%)"),B.appendChild(h),p&&Editor.popupsAllowed&&(h.style.cursor="pointer",mxEvent.addListener(h,"click",function(){y("_blank")})));mxUtils.br(B);var E=document.createElement("div");E.style.textAlign="center";var C=0;E.style.marginTop=
|
||||
"6px";B.appendChild(E);var x=document.createElement("select");x.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(h,mxResources.get("googleDrive")),x.appendChild(h),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_ONEDRIVE),
|
||||
mxUtils.write(h,mxResources.get("oneDrive")),x.appendChild(h),a.mode==App.MODE_ONEDRIVE&&h.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(h,mxResources.get("dropbox")),x.appendChild(h),a.mode==App.MODE_DROPBOX&&h.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),
|
||||
App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GITHUB),mxUtils.write(h,mxResources.get("github")),x.appendChild(h),v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_TRELLO),mxUtils.write(h,mxResources.get("trello")),x.appendChild(h),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)h=document.createElement("option"),h.setAttribute("value",App.MODE_DEVICE),mxUtils.write(h,mxResources.get("device")),x.appendChild(h),a.mode!=App.MODE_DEVICE&&n||h.setAttribute("selected","selected"),f&&v(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);n&&isLocalStorage&&"0"!=urlParams.browser&&(n=document.createElement("option"),n.setAttribute("value",App.MODE_BROWSER),
|
||||
mxUtils.write(n,mxResources.get("browser")),x.appendChild(n),a.mode==App.MODE_BROWSER&&n.setAttribute("selected","selected"),v(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=b&&(h=mxUtils.button(mxResources.get("help"),function(){a.openLink(b)}),h.className="geBtn",n.appendChild(h));h=mxUtils.button(mxResources.get("cancel"),function(){null!=c?c():(a.fileLoaded(null),a.hideDialog(),
|
||||
length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});t.spin(u);var w=window.setTimeout(function(){null==a[c]&&(t.stop(),u.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[c]&&(window.clearTimeout(w),mxUtils.setOpacity(h,100),q.style.visibility="",t.stop(),d())}))}else d();D.appendChild(u);++C==l&&(mxUtils.br(D),C=0)}function y(b){var g=v.value;if(null==b||null!=g&&0<g.length)a.hideDialog(),d(g,
|
||||
b)}m=null!=m?m:!0;n=null!=n?n:!0;l=null!=l?l:4;var B=document.createElement("div");null==c&&a.addLanguageMenu(B);var g=document.createElement("h2");mxUtils.write(g,h||mxResources.get("create"));g.style.marginTop="0px";g.style.marginBottom="24px";B.appendChild(g);mxUtils.write(B,mxResources.get("filename")+":");var v=document.createElement("input");v.setAttribute("value",e);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)};B.appendChild(v);null!=q&&null!=u&&"image/"==u.substring(0,6)&&(v.style.width="160px",h=null,"image/svg+xml"==u&&mxClient.IS_SVG?(h=document.createElement("div"),h.innerHTML=mxUtils.trim(q),q=h.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")):
|
||||
(h=document.createElement("img"),h.setAttribute("src","data:"+u+(t?";base64,":";utf8,")+q)),h.style.position="absolute",h.style.top="70px",h.style.right="100px",h.style.maxWidth="120px",h.style.maxHeight="80px",mxUtils.setPrefixedStyle(h.style,"transform","translate(50%,-50%)"),B.appendChild(h),p&&Editor.popupsAllowed&&(h.style.cursor="pointer",mxEvent.addListener(h,"click",function(){y("_blank")})));mxUtils.br(B);var D=document.createElement("div");D.style.textAlign="center";var C=0;D.style.marginTop=
|
||||
"6px";B.appendChild(D);var x=document.createElement("select");x.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(h,mxResources.get("googleDrive")),x.appendChild(h),w(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_ONEDRIVE),
|
||||
mxUtils.write(h,mxResources.get("oneDrive")),x.appendChild(h),a.mode==App.MODE_ONEDRIVE&&h.setAttribute("selected","selected"),w(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(h,mxResources.get("dropbox")),x.appendChild(h),a.mode==App.MODE_DROPBOX&&h.setAttribute("selected","selected"),w(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),
|
||||
App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_GITHUB),mxUtils.write(h,mxResources.get("github")),x.appendChild(h),w(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(h=document.createElement("option"),h.setAttribute("value",App.MODE_TRELLO),mxUtils.write(h,mxResources.get("trello")),x.appendChild(h),w(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));
|
||||
if(!Editor.useLocalStorage||"device"==urlParams.storage||null!=a.getCurrentFile()&&!mxClient.IS_IOS)h=document.createElement("option"),h.setAttribute("value",App.MODE_DEVICE),mxUtils.write(h,mxResources.get("device")),x.appendChild(h),a.mode!=App.MODE_DEVICE&&n||h.setAttribute("selected","selected"),f&&w(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);n&&isLocalStorage&&"0"!=urlParams.browser&&(n=document.createElement("option"),n.setAttribute("value",App.MODE_BROWSER),
|
||||
mxUtils.write(n,mxResources.get("browser")),x.appendChild(n),a.mode==App.MODE_BROWSER&&n.setAttribute("selected","selected"),w(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));n=document.createElement("div");n.style.marginTop="26px";n.style.textAlign="center";null!=b&&(h=mxUtils.button(mxResources.get("help"),function(){a.openLink(b)}),h.className="geBtn",n.appendChild(h));h=mxUtils.button(mxResources.get("cancel"),function(){null!=c?c():(a.fileLoaded(null),a.hideDialog(),
|
||||
window.close(),window.location.href=a.getUrl())});h.className="geBtn";a.editor.cancelFirst&&n.appendChild(h);null==c&&(q=mxUtils.button(mxResources.get("decideLater"),function(){y(null)}),q.className="geBtn",n.appendChild(q));p&&Editor.popupsAllowed&&(p=mxUtils.button(mxResources.get("openInNewWindow"),function(){y("_blank")}),p.className="geBtn",n.appendChild(p));mxClient.IS_IOS||(k=mxUtils.button(k||mxResources.get("create"),function(){y(f?"download":App.MODE_DEVICE)}),k.className="geBtn gePrimaryBtn",
|
||||
n.appendChild(k));a.editor.cancelFirst||n.appendChild(h);mxEvent.addListener(w,"keypress",function(b){13==b.keyCode?y(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});B.appendChild(n);this.container=B},PopupDialog=function(a,e,d,c,h){h=null!=h?h:!0;var k=document.createElement("div");k.style.textAlign="left";mxUtils.write(k,mxResources.get("fileOpenLocation"));mxUtils.br(k);mxUtils.br(k);var m=mxUtils.button(mxResources.get("openInThisWindow"),function(){h&&a.hideDialog();
|
||||
n.appendChild(k));a.editor.cancelFirst||n.appendChild(h);mxEvent.addListener(v,"keypress",function(b){13==b.keyCode?y(App.MODE_DEVICE):27==b.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});B.appendChild(n);this.container=B},PopupDialog=function(a,e,d,c,h){h=null!=h?h:!0;var k=document.createElement("div");k.style.textAlign="left";mxUtils.write(k,mxResources.get("fileOpenLocation"));mxUtils.br(k);mxUtils.br(k);var m=mxUtils.button(mxResources.get("openInThisWindow"),function(){h&&a.hideDialog();
|
||||
null!=c&&c()});m.className="geBtn";m.style.marginBottom="8px";m.style.width="280px";k.appendChild(m);mxUtils.br(k);var n=mxUtils.button(mxResources.get("openInNewWindow"),function(){h&&a.hideDialog();null!=d&&d();a.openLink(e)});n.className="geBtn gePrimaryBtn";n.style.width=m.style.width;k.appendChild(n);mxUtils.br(k);mxUtils.br(k);mxUtils.write(k,mxResources.get("allowPopups"));this.container=k},ImageDialog=function(a,e,d,c,h,k){k=null!=k?k:!0;var m=a.editor.graph,n=document.createElement("div");
|
||||
mxUtils.write(n,e);e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor="default";mxClient.IS_VML||(e.style.paddingRight="20px");var p=document.createElement("input");p.setAttribute("value",d);p.setAttribute("type","text");p.setAttribute("spellcheck","false");p.setAttribute("autocorrect","off");p.setAttribute("autocomplete","off");p.setAttribute("autocapitalize",
|
||||
"off");p.style.marginTop="6px";p.style.width=(Graph.fileSupport?420:340)+(mxClient.IS_QUIRKS?20:-20)+"px";p.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";p.style.backgroundRepeat="no-repeat";p.style.backgroundPosition="100% 50%";p.style.paddingRight="14px";d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));d.style.position="relative";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";d.style.display=mxClient.IS_VML?
|
||||
"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){p.value="";p.focus()});e.appendChild(p);e.appendChild(d);n.appendChild(e);var b=function(b,f,l,d){var e="data:"==b.substring(0,5);!a.isOffline()||e&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(g){a.spinner.stop();a.hideDialog();var w=!1===d?1:null!=f&&null!=l?Math.max(f/
|
||||
g.width,l/g.height):Math.min(1,Math.min(520/g.width,520/g.height));k&&(b=a.convertDataUri(b));c(b,Math.round(Number(g.width)*w),Math.round(Number(g.height)*w))},function(){a.spinner.stop();c(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),c(b)):(b=a.convertDataUri(b),f=null==f?120:f,l=null==l?100:l,a.hideDialog(),c(b,f,l))},f=function(f,l){if(null!=f){var d=h?null:m.getModel().getGeometry(m.getSelectionCell());null!=d?b(f,d.width,
|
||||
"inline":"inline-block";d.style.top=(mxClient.IS_VML?0:3)+"px";d.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(d,"click",function(){p.value="";p.focus()});e.appendChild(p);e.appendChild(d);n.appendChild(e);var b=function(b,f,l,d){var e="data:"==b.substring(0,5);!a.isOffline()||e&&"undefined"===typeof chrome?0<b.length&&a.spinner.spin(document.body,mxResources.get("inserting"))?a.loadImage(b,function(g){a.spinner.stop();a.hideDialog();var v=!1===d?1:null!=f&&null!=l?Math.max(f/
|
||||
g.width,l/g.height):Math.min(1,Math.min(520/g.width,520/g.height));k&&(b=a.convertDataUri(b));c(b,Math.round(Number(g.width)*v),Math.round(Number(g.height)*v))},function(){a.spinner.stop();c(null);a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(a.hideDialog(),c(b)):(b=a.convertDataUri(b),f=null==f?120:f,l=null==l?100:l,a.hideDialog(),c(b,f,l))},f=function(f,l){if(null!=f){var d=h?null:m.getModel().getGeometry(m.getSelectionCell());null!=d?b(f,d.width,
|
||||
d.height,l):b(f,null,null,l)}else a.hideDialog(),c(null)};this.init=function(){p.focus();if(Graph.fileSupport){p.setAttribute("placeholder",mxResources.get("dragImagesHere"));var b=n.parentNode,c=null;mxEvent.addListener(b,"dragleave",function(b){null!=c&&(c.parentNode.removeChild(c),c=null);b.stopPropagation();b.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));
|
||||
mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,function(b,a,c,l,d,e,q,u){f(b,u)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var l=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(l)&&
|
||||
f(decodeURIComponent(l))}b.stopPropagation();b.preventDefault()}),!1)}};d=document.createElement("div");d.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";d.style.textAlign="right";e=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&d.appendChild(e);ImageDialog.filePicked=function(b){b.action==google.picker.Action.PICKED&&null!=b.docs[0].thumbnails&&(b=b.docs[0].thumbnails[b.docs[0].thumbnails.length-1],null!=b&&(p.value=
|
||||
b.url));p.focus()};if(Graph.fileSupport){var l=document.createElement("input");l.setAttribute("multiple","multiple");l.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(l,"change",function(b){a.importFiles(l.files,0,0,a.maxImageSize,function(b,a,c,l,g,w){f(b)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},!0)});var q=mxUtils.button(mxResources.get("open"),function(){l.click()});q.className="geBtn";d.appendChild(q)}}document.createElement("canvas").getContext&&
|
||||
b.url));p.focus()};if(Graph.fileSupport){var l=document.createElement("input");l.setAttribute("multiple","multiple");l.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(l,"change",function(b){a.importFiles(l.files,0,0,a.maxImageSize,function(b,a,c,l,g,v){f(b)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},!0)});var q=mxUtils.button(mxResources.get("open"),function(){l.click()});q.className="geBtn";d.appendChild(q)}}document.createElement("canvas").getContext&&
|
||||
"data:image/"==p.value.substring(0,11)&&"data:image/svg"!=p.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,p.value,function(b){p.value=b});a.showDialog(b.container,200,180,!0,!0);b.init()}),q.className="geBtn",d.appendChild(q));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(q=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);
|
||||
a.imageSearchPicker=b.setCallback(function(b){ImageDialog.filePicked(b)}).build()}a.imageSearchPicker.setVisible(!0)}),q.className="geBtn",d.appendChild(q),null!=a.drive&&"1"==urlParams.photos&&(q=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(b){ImageDialog.filePicked(b)}).build()}a.photoPicker.setVisible(!0)}))}),q.className="geBtn",d.appendChild(q)));mxEvent.addListener(p,"keypress",function(b){13==b.keyCode&&f(p.value)});q=mxUtils.button(mxResources.get("apply"),function(){f(p.value)});q.className="geBtn gePrimaryBtn";d.appendChild(q);a.editor.cancelFirst||d.appendChild(e);Graph.fileSupport&&(d.style.marginTop="120px",n.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.backgroundPosition=
|
||||
|
@ -7103,16 +7102,16 @@ p.setAttribute("placeholder",mxResources.get("dragUrlsHere"));p.setAttribute("ty
|
|||
b.style.display=mxClient.IS_VML?"inline":"inline-block";b.style.top=(mxClient.IS_VML?0:3)+"px";b.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(b,"click",function(){p.value="";p.focus()});var f=document.createElement("input");f.style.cssText="margin-right:8px;margin-bottom:8px;";f.setAttribute("value","url");f.setAttribute("type","radio");f.setAttribute("name","current-linkdialog");var l=document.createElement("input");l.style.cssText="margin-right:8px;margin-bottom:8px;";
|
||||
l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","current-linkdialog");var q=document.createElement("select");q.style.width="420px";if(h&&null!=a.pages){null!=e&&"data:page/id,"==e.substring(0,13)?(l.setAttribute("checked","checked"),l.defaultChecked=!0):(p.setAttribute("value",e),f.setAttribute("checked","checked"),f.defaultChecked=!0);p.style.width="420px";n.appendChild(f);n.appendChild(p);n.appendChild(b);mxUtils.br(n);n.appendChild(l);h=!1;for(b=0;b<a.pages.length;b++){var u=
|
||||
document.createElement("option");mxUtils.write(u,a.pages[b].getName()||mxResources.get("pageWithNumber",[b+1]));u.setAttribute("value","data:page/id,"+a.pages[b].getId());e==u.getAttribute("value")&&(u.setAttribute("selected","selected"),h=!0);q.appendChild(u)}if(!h&&l.checked){var t=document.createElement("option");mxUtils.write(t,mxResources.get("pageNotFound"));t.setAttribute("disabled","disabled");t.setAttribute("selected","selected");t.setAttribute("value","pageNotFound");q.appendChild(t);mxEvent.addListener(q,
|
||||
"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}n.appendChild(q)}else p.setAttribute("value",e),n.appendChild(p),n.appendChild(b);m.appendChild(n);var v=mxUtils.button(d,function(){a.hideDialog();c(l.checked?"pageNotFound"!==q.value?q.value:e:p.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=function(){l.checked?q.focus():(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
||||
"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}n.appendChild(q)}else p.setAttribute("value",e),n.appendChild(p),n.appendChild(b);m.appendChild(n);var w=mxUtils.button(d,function(){a.hideDialog();c(l.checked?"pageNotFound"!==q.value?q.value:e:p.value,LinkDialog.selectedDocs)});w.style.verticalAlign="middle";w.className="geBtn gePrimaryBtn";this.init=function(){l.checked?q.focus():(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
||||
p.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(q,"focus",function(){f.removeAttribute("checked");l.setAttribute("checked","checked");l.checked=!0});mxEvent.addListener(p,"focus",function(){l.removeAttribute("checked");f.setAttribute("checked","checked");f.checked=!0});if(Graph.fileSupport){var b=m.parentNode,g=null;mxEvent.addListener(b,"dragleave",function(b){null!=g&&(g.parentNode.removeChild(g),g=null);b.stopPropagation();b.preventDefault()});mxEvent.addListener(b,"dragover",
|
||||
mxUtils.bind(this,function(f){null==g&&(!mxClient.IS_IE||10<document.documentMode)&&(g=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=g&&(g.parentNode.removeChild(g),g=null);0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")&&(p.value=decodeURIComponent(b.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,v.click());b.stopPropagation();b.preventDefault()}),!1)}};var y=document.createElement("div");
|
||||
mxUtils.bind(this,function(f){null==g&&(!mxClient.IS_IE||10<document.documentMode)&&(g=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=g&&(g.parentNode.removeChild(g),g=null);0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")&&(p.value=decodeURIComponent(b.dataTransfer.getData("text/uri-list")),f.setAttribute("checked","checked"),f.checked=!0,w.click());b.stopPropagation();b.preventDefault()}),!1)}};var y=document.createElement("div");
|
||||
y.style.marginTop="20px";y.style.textAlign="right";d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.style.verticalAlign="middle";d.className="geBtn";a.editor.cancelFirst&&y.appendChild(d);n=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});n.style.verticalAlign="middle";n.className="geBtn";y.appendChild(n);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(n.style.display="none");LinkDialog.selectedDocs=null;LinkDialog.filePicked=
|
||||
function(b){if(b.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=b.docs;var a=b.docs[0].url;"application/mxe"==b.docs[0].mimeType||"application/vnd.jgraph.mxfile"==b.docs[0].mimeType?(a=DriveClient.prototype.oldAppHostname,a="https://"+a+"/#G"+b.docs[0].id):"application/mxr"==b.docs[0].mimeType||"application/vnd.jgraph.mxfile.realtime"==b.docs[0].mimeType?(a=DriveClient.prototype.newAppHostname,a="https://"+a+"/#G"+b.docs[0].id):"application/vnd.google-apps.folder"==b.docs[0].mimeType&&
|
||||
(a="https://drive.google.com/#folders/"+b.docs[0].id);p.value=a;p.focus()}else LinkDialog.selectedDocs=null;p.focus()};"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=a.drive&&k(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,g=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0),
|
||||
f=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),c=(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(g).addView(f).addView(c).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(b){LinkDialog.filePicked(b)}).build()}a.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&k(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(b){p.value=b[0].link;p.focus()}})});null!=
|
||||
a.oneDrive&&k(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),function(){a.oneDrive.pickFile(function(b,a){p.value=a.value[0].webUrl;p.focus()})});null!=a.gitHub&&k(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),function(){a.gitHub.pickFile(function(b){if(null!=b){b=b.split("/");var a=b[0],f=b[1],c=b[2];b=b.slice(3,b.length).join("/");p.value="https://github.com/"+a+"/"+f+"/blob/"+c+"/"+b;p.focus()}})});mxEvent.addListener(p,"keypress",function(b){13==b.keyCode&&(a.hideDialog(),
|
||||
c(l.checked?q.value:p.value,LinkDialog.selectedDocs))});y.appendChild(v);a.editor.cancelFirst||y.appendChild(d);m.appendChild(y);this.container=m},AboutDialog=function(a){var e=document.createElement("div");e.style.marginTop="6px";e.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):
|
||||
c(l.checked?q.value:p.value,LinkDialog.selectedDocs))});y.appendChild(w);a.editor.cancelFirst||y.appendChild(d);m.appendChild(y);this.container=m},AboutDialog=function(a){var e=document.createElement("div");e.style.marginTop="6px";e.setAttribute("align","center");var d=document.createElement("img");d.style.border="0px";mxClient.IS_SVG?(d.setAttribute("width","164"),d.setAttribute("height","221"),d.style.width="164px",d.style.height="221px",d.setAttribute("src",IMAGE_PATH+"/drawlogo-text-bottom.svg")):
|
||||
(d.setAttribute("width","176"),d.setAttribute("height","219"),d.style.width="170px",d.style.height="219px",d.setAttribute("src",IMAGE_PATH+"/logo-flat.png"));e.appendChild(d);mxUtils.br(e);d=document.createElement("small");d.innerHTML="v "+EditorUi.VERSION;d.style.color="#505050";e.appendChild(d);mxUtils.br(e);mxUtils.br(e);d=document.createElement("small");d.style.color="#505050";d.innerHTML='© 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
|
||||
e.appendChild(d);mxEvent.addListener(e,"click",function(c){"A"!=mxEvent.getSource(c).nodeName&&a.hideDialog()});this.container=e},FeedbackDialog=function(a){var e=document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";e.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");e.appendChild(d);var c=document.createElement("input");
|
||||
c.setAttribute("type","text");c.style.marginTop="6px";c.style.width="600px";var h=mxUtils.button(mxResources.get("sendMessage"),function(){var b=(m.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(c.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+
|
||||
|
@ -7122,25 +7121,25 @@ mxEvent.addListener(c,"change",function(){0<c.value.length&&0<k.test(c.value)?h.
|
|||
e.appendChild(p);d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst?(d.appendChild(n),d.appendChild(h)):(d.appendChild(h),d.appendChild(n));e.appendChild(d);this.container=e};FeedbackDialog.maxAttachmentSize=1E6;
|
||||
var RevisionDialog=function(a,e,d){var c=document.createElement("div"),h=document.createElement("h3");h.style.marginTop="0px";mxUtils.write(h,mxResources.get("revisionHistory"));c.appendChild(h);var k=document.createElement("div");k.style.position="absolute";k.style.overflow="auto";k.style.width="170px";k.style.height="378px";c.appendChild(k);var m=document.createElement("div");m.style.position="absolute";m.style.border="1px solid lightGray";m.style.left="199px";m.style.width="470px";m.style.height=
|
||||
"376px";m.style.overflow="hidden";mxEvent.disableContextMenu(m);c.appendChild(m);var n=new Graph(m);n.setEnabled(!1);n.setPanning(!0);n.panningHandler.ignoreCell=!0;n.panningHandler.useLeftButtonForPanning=!0;n.minFitScale=null;n.maxFitScale=null;n.centerZoom=!0;var p=0,b=null,f=0,l=n.getGlobalVariable;n.getGlobalVariable=function(a){return"page"==a&&null!=b&&null!=b[f]?b[f].getAttribute("name"):"pagenumber"==a?f+1:l.apply(this,arguments)};n.getLinkForCell=function(){return null};Editor.MathJaxRender&&
|
||||
n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,g){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var q=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(),t=null,v=null,y=null,B=null,g=mxUtils.button("",function(){null!=y&&n.zoomIn()});g.className="geSprite geSprite-zoomin";g.setAttribute("title",mxResources.get("zoomIn"));
|
||||
g.style.outline="none";g.style.border="none";g.style.margin="2px";g.setAttribute("disabled","disabled");mxUtils.setOpacity(g,20);var w=mxUtils.button("",function(){null!=y&&n.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var E=mxUtils.button("",function(){null!=y&&(n.maxFitScale=8,n.fit(8),n.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 C=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var x=
|
||||
n.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,g){a.editor.graph.mathEnabled&&Editor.MathJaxRender(n.container)}));var q=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(),t=null,w=null,y=null,B=null,g=mxUtils.button("",function(){null!=y&&n.zoomIn()});g.className="geSprite geSprite-zoomin";g.setAttribute("title",mxResources.get("zoomIn"));
|
||||
g.style.outline="none";g.style.border="none";g.style.margin="2px";g.setAttribute("disabled","disabled");mxUtils.setOpacity(g,20);var v=mxUtils.button("",function(){null!=y&&n.zoomOut()});v.className="geSprite geSprite-zoomout";v.setAttribute("title",mxResources.get("zoomOut"));v.style.outline="none";v.style.border="none";v.style.margin="2px";v.setAttribute("disabled","disabled");mxUtils.setOpacity(v,20);var D=mxUtils.button("",function(){null!=y&&(n.maxFitScale=8,n.fit(8),n.center())});D.className=
|
||||
"geSprite geSprite-fit";D.setAttribute("title",mxResources.get("fit"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var C=mxUtils.button("",function(){null!=y&&(n.zoomActual(),n.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,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 I=mxUtils.button(mxResources.get("download"),function(){if(null!=y){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,g=mxUtils.getXml(y.documentElement);a.isLocalFileSave()?a.saveLocalFile(g,b,"text/xml"):
|
||||
(g="undefined"===typeof pako?"&xml="+encodeURIComponent(g):"&data="+encodeURIComponent(a.editor.graph.compress(g)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+g)).simulate(document,"_blank"))}});I.className="geBtn";I.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=B&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(B):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
|
||||
a.replaceFileData(B);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});D.className="geBtn";D.setAttribute("disabled","disabled");var F=document.createElement("select");F.setAttribute("disabled","disabled");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";var A=null;mxEvent.addListener(F,"change",function(b){null!=
|
||||
A&&(A(b),mxEvent.consume(b))});var z=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),window.openWindow(a.getUrl()))});z.className="geBtn";z.setAttribute("disabled","disabled");null!=d&&(z.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled",
|
||||
"disabled");null!=d&&(G.style.display="none",D.className="geBtn gePrimaryBtn");h=document.createElement("div");h.style.position="absolute";h.style.top="482px";h.style.width="640px";h.style.textAlign="right";var J=document.createElement("div");J.className="geToolbarContainer";J.style.backgroundColor="transparent";J.style.padding="2px";J.style.border="none";J.style.left="199px";J.style.top="442px";var H=null;if(null!=e&&0<e.length){m.style.cursor="move";var L=document.createElement("table");L.style.border=
|
||||
(g="undefined"===typeof pako?"&xml="+encodeURIComponent(g):"&data="+encodeURIComponent(a.editor.graph.compress(g)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+g)).simulate(document,"_blank"))}});I.className="geBtn";I.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("restore"),function(){null!=y&&null!=B&&a.confirm(mxResources.get("areYouSure"),function(){null!=d?d(B):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop();
|
||||
a.replaceFileData(B);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});E.className="geBtn";E.setAttribute("disabled","disabled");var F=document.createElement("select");F.setAttribute("disabled","disabled");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";var A=null;mxEvent.addListener(F,"change",function(b){null!=
|
||||
A&&(A(b),mxEvent.consume(b))});var z=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=y&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(y.documentElement)),window.openWindow(a.getUrl()))});z.className="geBtn";z.setAttribute("disabled","disabled");null!=d&&(z.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=w&&a.openLink(w.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled",
|
||||
"disabled");null!=d&&(G.style.display="none",E.className="geBtn gePrimaryBtn");h=document.createElement("div");h.style.position="absolute";h.style.top="482px";h.style.width="640px";h.style.textAlign="right";var J=document.createElement("div");J.className="geToolbarContainer";J.style.backgroundColor="transparent";J.style.padding="2px";J.style.border="none";J.style.left="199px";J.style.top="442px";var H=null;if(null!=e&&0<e.length){m.style.cursor="move";var L=document.createElement("table");L.style.border=
|
||||
"1px solid lightGray";L.style.borderCollapse="collapse";L.style.borderSpacing="0px";L.style.width="100%";var Q=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(p=mxUtils.indexOf(a.pages,a.currentPage));for(var U=e.length-1;0<=U;U--){var aa=function(c){var l=new Date(c.modifiedDate),d=null;if(0<=l.getTime()){var h=function(c){q.stop();var e=mxUtils.parseXml(c),h=a.editor.extractGraphModel(e.documentElement,!0);if(null!=h){var t=function(b){null!=b&&(b=
|
||||
v(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},v=function(b){var a=b.getAttribute("background");if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";m.style.backgroundColor=a;(new mxCodec(b.ownerDocument)).decode(b,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return b};F.style.display="none";F.innerHTML="";y=e;B=c;b=parseSelectFunction=null;f=0;if("mxfile"==h.nodeName){e=h.getElementsByTagName("diagram");b=[];for(c=0;c<e.length;c++)b.push(e[c]);
|
||||
f=Math.min(p,b.length-1);0<b.length&&t(b[f]);if(1<b.length)for(F.removeAttribute("disabled"),F.style.display="",c=0;c<b.length;c++)e=document.createElement("option"),mxUtils.write(e,b[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),F.appendChild(e);A=function(){f=p=parseInt(F.value);t(b[p])}}else v(h);x.innerHTML="";mxUtils.write(x,l.toLocaleDateString()+" "+l.toLocaleTimeString());x.setAttribute("title",d.getAttribute("title"));
|
||||
g.removeAttribute("disabled");w.removeAttribute("disabled");E.removeAttribute("disabled");C.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&D.removeAttribute("disabled"),I.removeAttribute("disabled"),G.removeAttribute("disabled"),z.removeAttribute("disabled"));mxUtils.setOpacity(g,60);mxUtils.setOpacity(w,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(C,60)}else F.style.display="none",F.innerHTML="",x.innerHTML="",mxUtils.write(x,mxResources.get("errorLoadingFile"))},
|
||||
w(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},w=function(b){var a=b.getAttribute("background");if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";m.style.backgroundColor=a;(new mxCodec(b.ownerDocument)).decode(b,n.getModel());n.maxFitScale=1;n.fit(8);n.center();return b};F.style.display="none";F.innerHTML="";y=e;B=c;b=parseSelectFunction=null;f=0;if("mxfile"==h.nodeName){e=h.getElementsByTagName("diagram");b=[];for(c=0;c<e.length;c++)b.push(e[c]);
|
||||
f=Math.min(p,b.length-1);0<b.length&&t(b[f]);if(1<b.length)for(F.removeAttribute("disabled"),F.style.display="",c=0;c<b.length;c++)e=document.createElement("option"),mxUtils.write(e,b[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),F.appendChild(e);A=function(){f=p=parseInt(F.value);t(b[p])}}else w(h);x.innerHTML="";mxUtils.write(x,l.toLocaleDateString()+" "+l.toLocaleTimeString());x.setAttribute("title",d.getAttribute("title"));
|
||||
g.removeAttribute("disabled");v.removeAttribute("disabled");D.removeAttribute("disabled");C.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&E.removeAttribute("disabled"),I.removeAttribute("disabled"),G.removeAttribute("disabled"),z.removeAttribute("disabled"));mxUtils.setOpacity(g,60);mxUtils.setOpacity(v,60);mxUtils.setOpacity(D,60);mxUtils.setOpacity(C,60)}else F.style.display="none",F.innerHTML="",x.innerHTML="",mxUtils.write(x,mxResources.get("errorLoadingFile"))},
|
||||
d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var k=document.createElement("td");k.style.padding="6px";k.style.whiteSpace="nowrap";c==e[e.length-1]?mxUtils.write(k,mxResources.get("current")):l.toDateString()===T?mxUtils.write(k,l.toLocaleTimeString()):mxUtils.write(k,l.toLocaleDateString()+" "+l.toLocaleTimeString());d.appendChild(k);d.setAttribute("title",l.toLocaleDateString()+" "+l.toLocaleTimeString()+" "+a.formatFileSize(parseInt(c.fileSize))+
|
||||
(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(b){v!=c&&(q.stop(),null!=t&&(t.style.backgroundColor=""),v=c,t=d,t.style.backgroundColor="#ebf2f9",B=y=null,x.removeAttribute("title"),x.innerHTML=mxResources.get("loading")+"...",m.style.backgroundColor="#ffffff",n.getModel().clear(),D.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),C.setAttribute("disabled",
|
||||
"disabled"),E.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,20),mxUtils.setOpacity(w,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(C,20),q.spin(m),c.getXml(function(b){v==c&&h(b)},function(b){q.stop();F.style.display="none";F.innerHTML="";x.innerHTML="";mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(b))});mxEvent.addListener(d,"dblclick",function(b){G.click();
|
||||
(null!=c.lastModifyingUserName?" "+c.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(b){w!=c&&(q.stop(),null!=t&&(t.style.backgroundColor=""),w=c,t=d,t.style.backgroundColor="#ebf2f9",B=y=null,x.removeAttribute("title"),x.innerHTML=mxResources.get("loading")+"...",m.style.backgroundColor="#ffffff",n.getModel().clear(),E.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),g.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"),C.setAttribute("disabled",
|
||||
"disabled"),D.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(g,20),mxUtils.setOpacity(v,20),mxUtils.setOpacity(D,20),mxUtils.setOpacity(C,20),q.spin(m),c.getXml(function(b){w==c&&h(b)},function(b){q.stop();F.style.display="none";F.innerHTML="";x.innerHTML="";mxUtils.write(x,mxResources.get("errorLoadingFile"))}),mxEvent.consume(b))});mxEvent.addListener(d,"dblclick",function(b){G.click();
|
||||
window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(b)},!1);Q.appendChild(d)}return d}(e[U]);null!=aa&&U==e.length-1&&(H=aa)}L.appendChild(Q);k.appendChild(L)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(m.style.display="none",J.style.display="none",mxUtils.write(k,mxResources.get("notAvailable"))):(m.style.display="none",J.style.display="none",mxUtils.write(k,
|
||||
mxResources.get("noRevisions")));this.init=function(){null!=H&&H.click()};k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn";J.appendChild(F);J.appendChild(g);J.appendChild(w);J.appendChild(C);J.appendChild(E);a.editor.cancelFirst?(h.appendChild(k),h.appendChild(I),h.appendChild(z),h.appendChild(D),h.appendChild(G)):(h.appendChild(I),h.appendChild(z),h.appendChild(D),h.appendChild(G),h.appendChild(k));c.appendChild(h);c.appendChild(J);c.appendChild(x);this.container=
|
||||
mxResources.get("noRevisions")));this.init=function(){null!=H&&H.click()};k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn";J.appendChild(F);J.appendChild(g);J.appendChild(v);J.appendChild(C);J.appendChild(D);a.editor.cancelFirst?(h.appendChild(k),h.appendChild(I),h.appendChild(z),h.appendChild(E),h.appendChild(G)):(h.appendChild(I),h.appendChild(z),h.appendChild(E),h.appendChild(G),h.appendChild(k));c.appendChild(h);c.appendChild(J);c.appendChild(x);this.container=
|
||||
c},DraftDialog=function(a,e,d,c,h,k,m,n){var p=document.createElement("div"),b=document.createElement("div");b.style.marginTop="0px";b.style.whiteSpace="nowrap";b.style.overflow="auto";mxUtils.write(b,e);p.appendChild(b);var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";f.style.marginTop="10px";f.style.width="640px";f.style.top="46px";f.style.bottom="74px";f.style.overflow="hidden";mxEvent.disableContextMenu(f);p.appendChild(f);var l=new Graph(f);
|
||||
l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;e=mxUtils.parseXml(d);var q=a.editor.extractGraphModel(e.documentElement,!0),u=0,t=null,v=l.getGlobalVariable;l.getGlobalVariable=function(b){return"page"==b&&null!=t&&null!=t[u]?t[u].getAttribute("name"):"pagenumber"==b?u+1:v.apply(this,arguments)};l.getLinkForCell=function(){return null};e=mxUtils.button("",function(){l.zoomIn()});e.className=
|
||||
l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;e=mxUtils.parseXml(d);var q=a.editor.extractGraphModel(e.documentElement,!0),u=0,t=null,w=l.getGlobalVariable;l.getGlobalVariable=function(b){return"page"==b&&null!=t&&null!=t[u]?t[u].getAttribute("name"):"pagenumber"==b?u+1:w.apply(this,arguments)};l.getLinkForCell=function(){return null};e=mxUtils.button("",function(){l.zoomIn()});e.className=
|
||||
"geSprite geSprite-zoomin";e.setAttribute("title",mxResources.get("zoomIn"));e.style.outline="none";e.style.border="none";e.style.margin="2px";mxUtils.setOpacity(e,60);d=mxUtils.button("",function(){l.zoomOut()});d.className="geSprite geSprite-zoomout";d.setAttribute("title",mxResources.get("zoomOut"));d.style.outline="none";d.style.border="none";d.style.margin="2px";mxUtils.setOpacity(d,60);b=mxUtils.button("",function(){l.maxFitScale=8;l.fit(8);l.center()});b.className="geSprite geSprite-fit";b.setAttribute("title",
|
||||
mxResources.get("fit"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);var y=mxUtils.button("",function(){l.zoomActual();l.center()});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";mxUtils.setOpacity(y,60);h=mxUtils.button(m||mxResources.get("discard"),h);h.className="geBtn";var B=document.createElement("select");B.style.maxWidth="80px";B.style.position=
|
||||
"relative";B.style.top="-2px";B.style.verticalAlign="bottom";B.style.marginRight="6px";B.style.display="none";c=mxUtils.button(k||mxResources.get("edit"),c);c.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.position="absolute";k.style.bottom="30px";k.style.width="640px";k.style.textAlign="right";m=document.createElement("div");m.className="geToolbarContainer";m.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";
|
||||
|
@ -7150,8 +7149,8 @@ t=[];for(var e=0;e<d.length;e++)t.push(d[e]);0<t.length&&c(t[u]);if(1<t.length)f
|
|||
mxUtils.trim(a[f].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==b&&c.substring(0,g.length)===g||null!=b&&b.test(c))return!0}}return!1}function m(){var a=p.model.getDescendants(p.model.getRoot()),c=q.value.toLowerCase(),g=u.checked?new RegExp(c):null,l=null;b!=c&&(b=c,f=null);var d=null==f;if(0<c.length)for(var e=0;e<a.length;e++){var h=p.view.getState(a[e]);if(null!=h&&null!=h.cell.value&&(d||null==l)&&(p.model.isVertex(h.cell)||p.model.isEdge(h.cell))&&(p.isHtmlLabel(h.cell)?
|
||||
(t.innerHTML=p.getLabel(h.cell),label=mxUtils.extractTextWithWhitespace([t])):label=p.getLabel(h.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==g&&(label.substring(0,c.length)===c||k(g,h.cell,c))||null!=g&&(g.test(label)||k(g,h.cell,c))))if(d){l=h;break}else null==l&&(l=h);d=d||h==f}null!=l?(f=l,p.scrollCellToVisible(f.cell),p.isEnabled()?p.setSelectionCell(f.cell):p.highlightCell(f.cell)):p.isEnabled()&&p.clearSelection();return 0==c.length||null!=l}
|
||||
var n=a.actions.get("find"),p=a.editor.graph,b=null,f=null,l=document.createElement("div");l.style.userSelect="none";l.style.overflow="hidden";l.style.padding="10px";l.style.height="100%";var q=document.createElement("input");q.setAttribute("placeholder",mxResources.get("find"));q.setAttribute("type","text");q.style.marginTop="4px";q.style.marginBottom="6px";q.style.width="200px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";l.appendChild(q);mxUtils.br(l);var u=document.createElement("input");
|
||||
u.setAttribute("type","checkbox");u.style.marginRight="4px";l.appendChild(u);mxUtils.write(l,mxResources.get("regularExpression"));var t=document.createElement("div");mxUtils.br(l);var v=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";b=f=null;q.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.className="geBtn";l.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{q.style.backgroundColor=
|
||||
m()?"":"#ffcfcf"}catch(y){a.handleError(y)}});v.setAttribute("title",mxResources.get("find")+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";l.appendChild(v);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(b!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=m()?"":"#ffcfcf"}catch(B){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(l,"keydown",function(b){70==b.keyCode&&
|
||||
u.setAttribute("type","checkbox");u.style.marginRight="4px";l.appendChild(u);mxUtils.write(l,mxResources.get("regularExpression"));var t=document.createElement("div");mxUtils.br(l);var w=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";b=f=null;q.focus()});w.setAttribute("title",mxResources.get("reset"));w.style.marginTop="6px";w.style.marginRight="4px";w.className="geBtn";l.appendChild(w);w=mxUtils.button(mxResources.get("find"),function(){try{q.style.backgroundColor=
|
||||
m()?"":"#ffcfcf"}catch(y){a.handleError(y)}});w.setAttribute("title",mxResources.get("find")+" (Enter)");w.style.marginTop="6px";w.className="geBtn gePrimaryBtn";l.appendChild(w);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)n.funct();else if(b!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=m()?"":"#ffcfcf"}catch(B){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(l,"keydown",function(b){70==b.keyCode&&
|
||||
a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(n.funct(),mxEvent.consume(b))});this.window=new mxWindow(mxResources.get("find"),l,e,d,c,h,!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()?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)):p.container.focus()}))},
|
||||
TagsWindow=function(a,e,d,c,h){var k=a.editor.graph,m="tags",n=document.createElement("div");n.style.userSelect="none";n.style.overflow="hidden";n.style.padding="10px";n.style.height="100%";var p=document.createElement("input");p.setAttribute("placeholder",mxResources.get("allTags"));p.setAttribute("type","text");p.style.marginTop="4px";p.style.width="260px";p.style.fontSize="12px";p.style.borderRadius="4px";p.style.padding="6px";n.appendChild(p);if(!a.isOffline()||mxClient.IS_CHROMEAPP){p.style.width=
|
||||
"240px";var b=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000046966");b.firstChild.style.marginBottom="6px";b.style.marginLeft="6px";n.appendChild(b)}mxEvent.addListener(p,"dblclick",function(){var b=new FilenameDialog(a,m,mxResources.get("ok"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&(m=b)}),mxResources.get("enterPropertyName"));a.showDialog(b.container,300,80,!0,!0);b.init()});p.setAttribute("title",mxResources.get("doubleClickChangeProperty"));mxUtils.br(n);
|
||||
|
@ -7163,13 +7162,13 @@ e==a.gitHub?(m=mxResources.get("github"),n.src=IMAGE_PATH+"/github-logo-white.sv
|
|||
h.appendChild(m);d&&(d=document.createElement("p"),d.style.marginTop="20px",d.appendChild(p),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberMe")),d.appendChild(k),h.appendChild(d),p.checked=!0,p.defaultChecked=!0,mxEvent.addListener(k,"click",function(b){p.checked=!p.checked;mxEvent.consume(b)}));this.container=h},MoreShapesDialog=function(a,e,d){d=null!=d?d:a.sidebar.entries;var c=document.createElement("div");if(e){e=document.createElement("div");e.className="geDialogTitle";
|
||||
mxUtils.write(e,mxResources.get("shapes"));e.style.position="absolute";e.style.top="0px";e.style.left="0px";e.style.lineHeight="40px";e.style.height="40px";e.style.right="0px";mxClient.IS_QUIRKS&&(e.style.width="718px");var h=document.createElement("div"),k=document.createElement("div");h.style.position="absolute";h.style.top="40px";h.style.left="0px";h.style.width="202px";h.style.bottom="60px";h.style.overflow="auto";mxClient.IS_QUIRKS&&(h.style.height="437px",h.style.marginTop="1px");k.style.position=
|
||||
"absolute";k.style.left="202px";k.style.right="0px";k.style.top="40px";k.style.bottom="60px";k.style.overflow="auto";k.style.borderLeft="1px solid rgb(211, 211, 211)";k.style.textAlign="center";mxClient.IS_QUIRKS&&(k.style.width=parseInt(e.style.width)-202+"px",k.style.height=h.style.height,k.style.marginTop=h.style.marginTop);var m=null,n=[],p=document.createElement("div");p.style.position="relative";p.style.left="0px";p.style.right="0px";for(var b=0;b<d.length;b++)(function(g){var f=p.cloneNode(!1);
|
||||
f.style.fontWeight="bold";f.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";f.style.padding="6px 0px 6px 20px";mxUtils.write(f,g.title);h.appendChild(f);for(var c=0;c<g.entries.length;c++)(function(g){var f=p.cloneNode(!1);f.style.cursor="pointer";f.style.padding="4px 0px 4px 20px";var l=document.createElement("input");l.setAttribute("type","checkbox");l.checked=a.sidebar.isEntryVisible(g.id);l.defaultChecked=l.checked;f.appendChild(l);mxUtils.write(f," "+g.title);h.appendChild(f);var w=
|
||||
function(b){if(null==b||"INPUT"!=mxEvent.getSource(b).nodeName)null!=g.imageCallback?g.imageCallback(k):null!=g.image?k.innerHTML='<img border="0" src="'+g.image+'"/>':(k.innerHTML="<br>",mxUtils.write(k,mxResources.get("noPreview"))),null!=m&&(m.style.backgroundColor=""),m=f,m.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=b&&mxEvent.consume(b)};mxEvent.addListener(f,"click",w);mxEvent.addListener(f,"dblclick",function(b){l.checked=!l.checked;mxEvent.consume(b)});n.push(function(){return l.checked?
|
||||
g.id:null});0==b&&0==c&&w()})(g.entries[c])})(d[b]);c.style.padding="30px";c.appendChild(e);c.appendChild(h);c.appendChild(k);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=e.style.width,d.style.paddingTop="12px");var f=document.createElement("input");f.setAttribute("type",
|
||||
f.style.fontWeight="bold";f.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";f.style.padding="6px 0px 6px 20px";mxUtils.write(f,g.title);h.appendChild(f);for(var c=0;c<g.entries.length;c++)(function(g){var f=p.cloneNode(!1);f.style.cursor="pointer";f.style.padding="4px 0px 4px 20px";var l=document.createElement("input");l.setAttribute("type","checkbox");l.checked=a.sidebar.isEntryVisible(g.id);l.defaultChecked=l.checked;f.appendChild(l);mxUtils.write(f," "+g.title);h.appendChild(f);var v=
|
||||
function(b){if(null==b||"INPUT"!=mxEvent.getSource(b).nodeName)null!=g.imageCallback?g.imageCallback(k):null!=g.image?k.innerHTML='<img border="0" src="'+g.image+'"/>':(k.innerHTML="<br>",mxUtils.write(k,mxResources.get("noPreview"))),null!=m&&(m.style.backgroundColor=""),m=f,m.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9",null!=b&&mxEvent.consume(b)};mxEvent.addListener(f,"click",v);mxEvent.addListener(f,"dblclick",function(b){l.checked=!l.checked;mxEvent.consume(b)});n.push(function(){return l.checked?
|
||||
g.id:null});0==b&&0==c&&v()})(g.entries[c])})(d[b]);c.style.padding="30px";c.appendChild(e);c.appendChild(h);c.appendChild(k);d=document.createElement("div");d.className="geDialogFooter";d.style.position="absolute";d.style.paddingRight="16px";d.style.color="gray";d.style.left="0px";d.style.right="0px";d.style.bottom="0px";d.style.height="60px";d.style.lineHeight="52px";mxClient.IS_QUIRKS&&(d.style.width=e.style.width,d.style.paddingTop="12px");var f=document.createElement("input");f.setAttribute("type",
|
||||
"checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)e=document.createElement("span"),e.style.paddingRight="20px",e.appendChild(f),mxUtils.write(e," "+mxResources.get("rememberThisSetting")),f.checked=!0,f.defaultChecked=!0,mxEvent.addListener(e,"click",function(b){mxEvent.getSource(b)!=f&&(f.checked=!f.checked,mxEvent.consume(b))}),mxClient.IS_QUIRKS&&(e.style.position="relative",e.style.top="-6px"),d.appendChild(e);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className=
|
||||
"geBtn";var l=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],g=0;g<n.length;g++){var c=n[g].apply(this,arguments);null!=c&&b.push(c)}a.sidebar.showEntries(b.join(";"),f.checked,!0)});l.className="geBtn gePrimaryBtn"}else{var q=document.createElement("table"),u=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";var t=document.createElement("tr");q.style.width="100%";e=document.createElement("td");var l=document.createElement("td"),v=document.createElement("td"),
|
||||
y=mxUtils.bind(this,function(b,g,f){var c=document.createElement("input");c.type="checkbox";q.appendChild(c);c.checked=a.sidebar.isEntryVisible(f);var l=document.createElement("span");mxUtils.write(l,g);g=document.createElement("div");g.style.display="block";g.appendChild(c);g.appendChild(l);mxEvent.addListener(l,"click",function(b){c.checked=!c.checked;mxEvent.consume(b)});b.appendChild(g);return function(){return c.checked?f:null}});t.appendChild(e);t.appendChild(l);t.appendChild(v);u.appendChild(t);
|
||||
q.appendChild(u);for(var n=[],B=0,b=0;b<d.length;b++)for(u=0;u<d[b].entries.length;u++)B++;for(var g=[e,l,v],w=0,b=0;b<d.length;b++)(function(b){for(var a=0;a<b.entries.length;a++){var f=b.entries[a];n.push(y(g[Math.floor(w/(B/3))],f.title,f.id));w++}})(d[b]);c.appendChild(q);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";f=document.createElement("input");isLocalStorage&&(f.setAttribute("type","checkbox"),f.checked=!0,f.defaultChecked=!0,d.appendChild(f),e=document.createElement("span"),
|
||||
"geBtn";var l=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],g=0;g<n.length;g++){var c=n[g].apply(this,arguments);null!=c&&b.push(c)}a.sidebar.showEntries(b.join(";"),f.checked,!0)});l.className="geBtn gePrimaryBtn"}else{var q=document.createElement("table"),u=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";var t=document.createElement("tr");q.style.width="100%";e=document.createElement("td");var l=document.createElement("td"),w=document.createElement("td"),
|
||||
y=mxUtils.bind(this,function(b,g,f){var c=document.createElement("input");c.type="checkbox";q.appendChild(c);c.checked=a.sidebar.isEntryVisible(f);var l=document.createElement("span");mxUtils.write(l,g);g=document.createElement("div");g.style.display="block";g.appendChild(c);g.appendChild(l);mxEvent.addListener(l,"click",function(b){c.checked=!c.checked;mxEvent.consume(b)});b.appendChild(g);return function(){return c.checked?f:null}});t.appendChild(e);t.appendChild(l);t.appendChild(w);u.appendChild(t);
|
||||
q.appendChild(u);for(var n=[],B=0,b=0;b<d.length;b++)for(u=0;u<d[b].entries.length;u++)B++;for(var g=[e,l,w],v=0,b=0;b<d.length;b++)(function(b){for(var a=0;a<b.entries.length;a++){var f=b.entries[a];n.push(y(g[Math.floor(v/(B/3))],f.title,f.id));v++}})(d[b]);c.appendChild(q);d=document.createElement("div");d.style.marginTop="18px";d.style.textAlign="center";f=document.createElement("input");isLocalStorage&&(f.setAttribute("type","checkbox"),f.checked=!0,f.defaultChecked=!0,d.appendChild(f),e=document.createElement("span"),
|
||||
mxUtils.write(e," "+mxResources.get("rememberThisSetting")),d.appendChild(e),mxEvent.addListener(e,"click",function(b){f.checked=!f.checked;mxEvent.consume(b)}));c.appendChild(d);e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";l=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],g=0;g<n.length;g++){var c=n[g].apply(this,arguments);null!=c&&b.push(c)}a.sidebar.showEntries(0<b.length?b.join(";"):"",f.checked);a.hideDialog()});l.className=
|
||||
"geBtn gePrimaryBtn";d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="right"}a.editor.cancelFirst?(d.appendChild(e),d.appendChild(l)):(d.appendChild(l),d.appendChild(e));c.appendChild(d);this.container=c},PluginsDialog=function(a){function e(){if(0==h.length)c.innerHTML=mxResources.get("noPlugins");else{c.innerHTML="";for(var b=0;b<h.length;b++){var l=document.createElement("span");l.style.whiteSpace="nowrap";var d=document.createElement("span");d.className="geSprite geSprite-delete";
|
||||
d.style.position="relative";d.style.cursor="pointer";d.style.top="5px";d.style.marginRight="4px";d.style.display="inline-block";l.appendChild(d);mxUtils.write(l,h[b]);c.appendChild(l);mxUtils.br(c);mxEvent.addListener(d,"click",function(b){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+h[b]+'"?',function(){h.splice(b,1);e()})}}(b))}}}var d=document.createElement("div"),c=document.createElement("div");c.style.height="120px";c.style.overflow="auto";var h=mxSettings.getPlugins().slice();
|
||||
|
@ -7179,43 +7178,43 @@ p.className="geBtn";a.isOffline()&&!mxClient.IS_CHROMEAPP&&(p.style.display="non
|
|||
m=document.createElement("tr"),n=document.createElement("td");n.style.whiteSpace="nowrap";n.setAttribute("colspan","2");mxUtils.write(n,mxResources.get("loading")+"...");m.appendChild(n);k.appendChild(m);var m=document.createElement("tr"),p=document.createElement("td"),b=document.createElement("td");h.style.paddingLeft="6px";mxUtils.write(p,mxResources.get("left")+":");var f=document.createElement("input");f.setAttribute("type","text");f.style.width="100px";f.value="0";this.init=function(){f.focus();
|
||||
f.select()};b.appendChild(f);m.appendChild(p);m.appendChild(b);k.appendChild(m);m=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("top")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.width="100px";l.value="0";b.appendChild(l);m.appendChild(p);m.appendChild(b);k.appendChild(m);m=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("right")+
|
||||
":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value="0";b.appendChild(q);m.appendChild(p);m.appendChild(b);k.appendChild(m);m=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("bottom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value="0";b.appendChild(u);m.appendChild(p);m.appendChild(b);k.appendChild(m);m=document.createElement("tr");
|
||||
p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("circle")+":");m.appendChild(p);var t=document.createElement("input");t.setAttribute("type","checkbox");b.appendChild(t);m.appendChild(b);k.appendChild(m);h.appendChild(k);c.appendChild(h);var h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),v=new Image,y=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),g=b.getContext("2d"),c=v.width,
|
||||
e=v.height,h=parseInt(f.value),k=parseInt(l.value),c=Math.max(1,c-h-parseInt(q.value)),e=Math.max(1,e-k-parseInt(u.value));b.width=c;b.height=e;t.checked&&(g.fillStyle="#000000",g.arc(c/2,e/2,Math.min(c/2,e/2),0,2*Math.PI),g.fill(),g.globalCompositeOperation="source-in");g.drawImage(v,h,k,c,e,0,0,c,e);d(b.toDataURL())});y.setAttribute("disabled","disabled");v.onload=function(){y.removeAttribute("disabled");n.innerHTML="";mxUtils.write(n,mxResources.get("width")+": "+v.width+" "+mxResources.get("height")+
|
||||
": "+v.height)};v.src=e;mxEvent.addListener(c,"keypress",function(b){13==b.keyCode&&y.click()});e=document.createElement("div");e.style.marginTop="20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(h),e.appendChild(y)):(e.appendChild(y),e.appendChild(h));c.appendChild(e);this.container=c},EditGeometryDialog=function(a,e){var d=a.editor.graph,c=1==e.length?d.getCellGeometry(e[0]):null,h=document.createElement("div"),k=document.createElement("table"),m=document.createElement("tbody"),
|
||||
p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("circle")+":");m.appendChild(p);var t=document.createElement("input");t.setAttribute("type","checkbox");b.appendChild(t);m.appendChild(b);k.appendChild(m);h.appendChild(k);c.appendChild(h);var h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()}),w=new Image,y=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();var b=document.createElement("canvas"),g=b.getContext("2d"),c=w.width,
|
||||
e=w.height,h=parseInt(f.value),k=parseInt(l.value),c=Math.max(1,c-h-parseInt(q.value)),e=Math.max(1,e-k-parseInt(u.value));b.width=c;b.height=e;t.checked&&(g.fillStyle="#000000",g.arc(c/2,e/2,Math.min(c/2,e/2),0,2*Math.PI),g.fill(),g.globalCompositeOperation="source-in");g.drawImage(w,h,k,c,e,0,0,c,e);d(b.toDataURL())});y.setAttribute("disabled","disabled");w.onload=function(){y.removeAttribute("disabled");n.innerHTML="";mxUtils.write(n,mxResources.get("width")+": "+w.width+" "+mxResources.get("height")+
|
||||
": "+w.height)};w.src=e;mxEvent.addListener(c,"keypress",function(b){13==b.keyCode&&y.click()});e=document.createElement("div");e.style.marginTop="20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(h),e.appendChild(y)):(e.appendChild(y),e.appendChild(h));c.appendChild(e);this.container=c},EditGeometryDialog=function(a,e){var d=a.editor.graph,c=1==e.length?d.getCellGeometry(e[0]):null,h=document.createElement("div"),k=document.createElement("table"),m=document.createElement("tbody"),
|
||||
n=document.createElement("tr"),p=document.createElement("td"),b=document.createElement("td");k.style.paddingLeft="6px";mxUtils.write(p,mxResources.get("relative")+":");var f=document.createElement("input");f.setAttribute("type","checkbox");null!=c&&c.relative&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);this.init=function(){f.focus()};b.appendChild(f);n.appendChild(p);n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");
|
||||
mxUtils.write(p,mxResources.get("left")+":");var l=document.createElement("input");l.setAttribute("type","text");l.style.width="100px";l.value=null!=c?c.x:"";b.appendChild(l);n.appendChild(p);n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("top")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=c?c.y:"";b.appendChild(q);n.appendChild(p);
|
||||
n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("dx")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=c&&null!=c.offset?c.offset.x:"";b.appendChild(u);n.appendChild(p);n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("dy")+
|
||||
":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=c&&null!=c.offset?c.offset.y:"";b.appendChild(t);n.appendChild(p);n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("width")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=c?c.width:"";b.appendChild(v);n.appendChild(p);n.appendChild(b);
|
||||
":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=c&&null!=c.offset?c.offset.y:"";b.appendChild(t);n.appendChild(p);n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("width")+":");var w=document.createElement("input");w.setAttribute("type","text");w.style.width="100px";w.value=null!=c?c.width:"";b.appendChild(w);n.appendChild(p);n.appendChild(b);
|
||||
m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("height")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=c?c.height:"";b.appendChild(y);n.appendChild(p);n.appendChild(b);m.appendChild(n);n=document.createElement("tr");p=document.createElement("td");b=document.createElement("td");mxUtils.write(p,mxResources.get("rotation")+":");var B=document.createElement("input");
|
||||
B.setAttribute("type","text");B.style.width="100px";B.value=1==e.length?mxUtils.getValue(d.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";b.appendChild(B);n.appendChild(p);n.appendChild(b);m.appendChild(n);k.appendChild(m);h.appendChild(k);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.className="geBtn";var g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.getModel().beginUpdate();try{for(var b=0;b<e.length;b++){var g=d.getCellGeometry(e[b]);null!=
|
||||
g&&(g=g.clone(),d.isCellMovable(e[b])&&(g.relative=f.checked,0<mxUtils.trim(l.value).length&&(g.x=Number(l.value)),0<mxUtils.trim(q.value).length&&(g.y=Number(q.value)),0<mxUtils.trim(u.value).length&&(null==g.offset&&(g.offset=new mxPoint),g.offset.x=Number(u.value)),0<mxUtils.trim(t.value).length&&(null==g.offset&&(g.offset=new mxPoint),g.offset.y=Number(t.value))),d.isCellResizable(e[b])&&(0<mxUtils.trim(v.value).length&&(g.width=Number(v.value)),0<mxUtils.trim(y.value).length&&(g.height=Number(y.value))),
|
||||
g&&(g=g.clone(),d.isCellMovable(e[b])&&(g.relative=f.checked,0<mxUtils.trim(l.value).length&&(g.x=Number(l.value)),0<mxUtils.trim(q.value).length&&(g.y=Number(q.value)),0<mxUtils.trim(u.value).length&&(null==g.offset&&(g.offset=new mxPoint),g.offset.x=Number(u.value)),0<mxUtils.trim(t.value).length&&(null==g.offset&&(g.offset=new mxPoint),g.offset.y=Number(t.value))),d.isCellResizable(e[b])&&(0<mxUtils.trim(w.value).length&&(g.width=Number(w.value)),0<mxUtils.trim(y.value).length&&(g.height=Number(y.value))),
|
||||
d.getModel().setGeometry(e[b],g));0<mxUtils.trim(B.value).length&&d.setCellStyles(mxConstants.STYLE_ROTATION,Number(B.value),[e[b]])}}finally{d.getModel().endUpdate()}});g.className="geBtn gePrimaryBtn";mxEvent.addListener(h,"keypress",function(b){13==b.keyCode&&g.click()});k=document.createElement("div");k.style.marginTop="20px";k.style.textAlign="right";a.editor.cancelFirst?(k.appendChild(c),k.appendChild(g)):(k.appendChild(g),k.appendChild(c));h.appendChild(k);this.container=h},LibraryDialog=function(a,
|
||||
e,d,c,h,k){function m(b){for(b=document.elementFromPoint(b.clientX,b.clientY);null!=b&&b.parentNode!=u;)b=b.parentNode;var a=null;if(null!=b)for(var g=u.firstChild,a=0;null!=g&&g!=b;)g=g.nextSibling,a++;return a}function n(b,c,l,d,e,h,q,k,C){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=q||null==v[b]){var z=function(){H.innerHTML="";H.style.cursor="pointer";H.style.whiteSpace="nowrap";H.style.textOverflow="ellipsis";mxUtils.write(H,null!=F.title&&0<F.title.length?F.title:mxResources.get("untitled"));
|
||||
e,d,c,h,k){function m(b){for(b=document.elementFromPoint(b.clientX,b.clientY);null!=b&&b.parentNode!=u;)b=b.parentNode;var a=null;if(null!=b)for(var g=u.firstChild,a=0;null!=g&&g!=b;)g=g.nextSibling,a++;return a}function n(b,c,l,d,e,h,q,k,C){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=q||null==w[b]){var z=function(){H.innerHTML="";H.style.cursor="pointer";H.style.whiteSpace="nowrap";H.style.textOverflow="ellipsis";mxUtils.write(H,null!=F.title&&0<F.title.length?F.title:mxResources.get("untitled"));
|
||||
H.style.color=null==F.title||0==F.title.length?"#d0d0d0":""};u.style.backgroundImage="";t.style.display="none";var I=e,x=h;if(e>a.maxImageSize||h>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,e)),a.maxImageSize/Math.max(1,h));e*=B;h*=B}I>x?(x=Math.round(100*x/I),I=100):(I=Math.round(100*I/x),x=100);var p=document.createElement("div");p.setAttribute("draggable","true");p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";p.style.position="relative";p.style.cursor="move";
|
||||
mxUtils.setPrefixedStyle(p.style,"transition","transform .1s ease-in-out");if(null!=b){var D=document.createElement("img");D.setAttribute("src",w.convert(b));D.style.width=I+"px";D.style.height=x+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-x)/2)+"px";D.style.paddingLeft=Math.floor((100-I)/2)+"px";p.appendChild(D)}else if(null!=q){var J=a.stringToCells(a.editor.graph.decompress(q.xml));0<J.length&&(a.sidebar.createThumb(J,100,100,p,null,!0,!1),p.firstChild.style.display=mxClient.IS_QUIRKS?
|
||||
"inline":"inline-block",p.firstChild.style.cursor="")}var G=document.createElement("img");G.setAttribute("src",Editor.closeImage);G.setAttribute("border","0");G.setAttribute("title",mxResources.get("delete"));G.setAttribute("align","top");G.style.paddingTop="4px";G.style.position="absolute";G.style.marginLeft="-12px";G.style.zIndex="1";G.style.cursor="pointer";mxEvent.addListener(G,"dragstart",function(b){mxEvent.consume(b)});(function(b,a,g){mxEvent.addListener(G,"click",function(c){v[a]=null;for(var l=
|
||||
mxUtils.setPrefixedStyle(p.style,"transition","transform .1s ease-in-out");if(null!=b){var E=document.createElement("img");E.setAttribute("src",v.convert(b));E.style.width=I+"px";E.style.height=x+"px";E.style.margin="10px";E.style.paddingBottom=Math.floor((100-x)/2)+"px";E.style.paddingLeft=Math.floor((100-I)/2)+"px";p.appendChild(E)}else if(null!=q){var J=a.stringToCells(a.editor.graph.decompress(q.xml));0<J.length&&(a.sidebar.createThumb(J,100,100,p,null,!0,!1),p.firstChild.style.display=mxClient.IS_QUIRKS?
|
||||
"inline":"inline-block",p.firstChild.style.cursor="")}var G=document.createElement("img");G.setAttribute("src",Editor.closeImage);G.setAttribute("border","0");G.setAttribute("title",mxResources.get("delete"));G.setAttribute("align","top");G.style.paddingTop="4px";G.style.position="absolute";G.style.marginLeft="-12px";G.style.zIndex="1";G.style.cursor="pointer";mxEvent.addListener(G,"dragstart",function(b){mxEvent.consume(b)});(function(b,a,g){mxEvent.addListener(G,"click",function(c){w[a]=null;for(var l=
|
||||
0;l<f.length;l++)if(null!=f[l].data&&f[l].data==a||null!=f[l].xml&&null!=g&&f[l].xml==g.xml){f.splice(l,1);break}p.parentNode.removeChild(b);0==f.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(c)});mxEvent.addListener(G,"dblclick",function(b){mxEvent.consume(b)})})(p,b,q);p.appendChild(G);p.style.marginBottom="30px";var H=document.createElement("div");H.style.position="absolute";H.style.boxSizing="border-box";H.style.bottom="-18px";H.style.left=
|
||||
"10px";H.style.right="10px";H.style.backgroundColor="#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var F=null;null!=b?(F={data:b,w:e,h:h,title:C},null!=k&&(F.aspect=k),v[b]=D,f.push(F)):null!=q&&(q.aspect="fixed",f.push(q),F=q);mxEvent.addListener(H,"keydown",function(b){13==b.keyCode&&null!=g&&(g(),g=null,mxEvent.consume(b))});z();p.appendChild(H);mxEvent.addListener(H,"mousedown",function(b){"true"!=H.getAttribute("contentEditable")&&mxEvent.consume(b)});J=function(b){if(mxClient.IS_IOS||
|
||||
"10px";H.style.right="10px";H.style.backgroundColor="#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var F=null;null!=b?(F={data:b,w:e,h:h,title:C},null!=k&&(F.aspect=k),w[b]=E,f.push(F)):null!=q&&(q.aspect="fixed",f.push(q),F=q);mxEvent.addListener(H,"keydown",function(b){13==b.keyCode&&null!=g&&(g(),g=null,mxEvent.consume(b))});z();p.appendChild(H);mxEvent.addListener(H,"mousedown",function(b){"true"!=H.getAttribute("contentEditable")&&mxEvent.consume(b)});J=function(b){if(mxClient.IS_IOS||
|
||||
mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,F.title||"",mxResources.get("ok"),function(b){null!=b&&(F.title=b,z())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=H.getAttribute("contentEditable")){null!=g&&(g(),g=null);if(null==F.title||0==F.title.length)H.innerHTML="";H.style.textOverflow="";H.style.whiteSpace="";H.style.cursor="text";H.style.color="";H.setAttribute("contentEditable",
|
||||
"true");H.focus();document.execCommand("selectAll",!1,null);g=function(){H.removeAttribute("contentEditable");H.style.cursor="pointer";F.title=H.innerHTML;z()};mxEvent.consume(b)}};mxEvent.addListener(H,"click",J);mxEvent.addListener(p,"dblclick",J);u.appendChild(p);mxEvent.addListener(p,"dragstart",function(a){null==b&&null!=q&&(G.style.visibility="hidden",H.style.visibility="hidden");mxClient.IS_FF&&null!=q.xml&&a.dataTransfer.setData("Text",q.xml);y=m(a);mxClient.IS_GC&&(p.style.opacity="0.9");
|
||||
window.setTimeout(function(){mxUtils.setPrefixedStyle(p.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(p,30);G.style.visibility="";H.style.visibility=""},0)});mxEvent.addListener(p,"dragend",function(b){"hidden"==G.style.visibility&&(G.style.visibility="",H.style.visibility="");y=null;mxUtils.setOpacity(p,100);mxUtils.setPrefixedStyle(p.style,"transform",null)})}else E||(E=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),I=mxUtils.parseXml(b),"mxlibrary"==
|
||||
window.setTimeout(function(){mxUtils.setPrefixedStyle(p.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(p,30);G.style.visibility="";H.style.visibility=""},0)});mxEvent.addListener(p,"dragend",function(b){"hidden"==G.style.visibility&&(G.style.visibility="",H.style.visibility="");y=null;mxUtils.setOpacity(p,100);mxUtils.setPrefixedStyle(p.style,"transform",null)})}else D||(D=!0,a.handleError({message:mxResources.get("fileExists")}));else{e=!1;try{if(a.spinner.stop(),I=mxUtils.parseXml(b),"mxlibrary"==
|
||||
I.documentElement.nodeName){x=JSON.parse(mxUtils.getTextContent(I.documentElement));if(null!=x&&0<x.length)for(var L=0;L<x.length;L++)null!=x[L].xml?n(null,null,0,0,0,0,x[L]):n(x[L].data,null,0,0,x[L].w,x[L].h,null,"fixed",x[L].title);e=!0}else if("mxfile"==I.documentElement.nodeName){for(var A=I.documentElement.getElementsByTagName("diagram"),L=0;L<A.length;L++){var x=mxUtils.getTextContent(A[L]),J=a.stringToCells(a.editor.graph.decompress(x)),K=a.editor.graph.getBoundingBoxFromGeometry(J);n(null,
|
||||
null,0,0,0,0,{xml:x,w:K.width,h:K.height})}e=!0}}catch(W){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(W){}return null}function p(b){b.dataTransfer.dropEffect=null!=y?"move":"copy";b.stopPropagation();b.preventDefault()}function b(b){b.stopPropagation();b.preventDefault();E=!1;B=m(b);if(null!=y)null!=B&&B<u.children.length?(f.splice(B>y?B-1:B,0,f.splice(y,1)[0]),u.insertBefore(u.children[y],u.children[B])):(f.push(f.splice(y,1)[0]),u.appendChild(u.children[y]));
|
||||
null,0,0,0,0,{xml:x,w:K.width,h:K.height})}e=!0}}catch(W){}e||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(W){}return null}function p(b){b.dataTransfer.dropEffect=null!=y?"move":"copy";b.stopPropagation();b.preventDefault()}function b(b){b.stopPropagation();b.preventDefault();D=!1;B=m(b);if(null!=y)null!=B&&B<u.children.length?(f.splice(B>y?B-1:B,0,f.splice(y,1)[0]),u.insertBefore(u.children[y],u.children[B])):(f.push(f.splice(y,1)[0]),u.appendChild(u.children[y]));
|
||||
else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,C(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var g=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(g)||/(\.png)($|\?)/i.test(g)||/(\.gif)($|\?)/i.test(g)||/(\.svg)($|\?)/i.test(g))&&a.loadImage(g,function(b){n(g,null,0,0,b.width,b.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var f=[];d=document.createElement("div");
|
||||
d.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="40px";d.appendChild(l);mxUtils.write(l,mxResources.get("filename")+":");null==e&&(e=a.defaultLibraryName+".xml");var q=document.createElement("input");q.setAttribute("value",e);q.style.marginRight="20px";q.style.marginLeft="10px";q.style.width="500px";null==h||h.isRenamable()||q.setAttribute("disabled","true");this.init=function(){if(null==h||h.isRenamable())q.focus(),mxClient.IS_GC||mxClient.IS_FF||
|
||||
5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};l.appendChild(q);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==f.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=
|
||||
document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));d.appendChild(t);var v={},y=null,B=null,g=null;e=function(b){"true"!=mxEvent.getSource(b).getAttribute("contentEditable")&&null!=g&&(g(),g=null,mxEvent.consume(b))};mxEvent.addListener(u,"mousedown",e);mxEvent.addListener(u,"pointerdown",e);mxEvent.addListener(u,"touchstart",
|
||||
e);var w=new mxUrlConverter,E=!1;if(null!=c)for(e=0;e<c.length;e++)l=c[e],n(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(b){t.style.cursor="";for(var a=mxEvent.getSource(b);null!=a;){if(a==u||a==t){b.stopPropagation();b.preventDefault();break}a=a.parentNode}});var C=function(b){return function(g,c,f,l,d,e,w,h,q){null!=q&&(/(\.vsdx)($|\?)/i.test(q.name)||/(\.vssx)($|\?)/i.test(q.name))?a.importVisio(q,mxUtils.bind(this,function(g){a.spinner.stop();n(g,c,f,
|
||||
l,d,e,w,"fixed",mxEvent.isAltDown(b)?null:w.substring(0,w.lastIndexOf(".")).replace(/_/g," "))})):null!=q&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(g,q.name)?a.parseFile(q,mxUtils.bind(this,function(g){4==g.readyState&&(a.spinner.stop(),200<=g.status&&299>=g.status&&(n(g.responseText,c,f,l,d,e,w,"fixed",mxEvent.isAltDown(b)?null:w.substring(0,w.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(n(g,c,f,l,d,e,w,"fixed",mxEvent.isAltDown(b)?null:w.substring(0,
|
||||
w.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",p);mxEvent.addListener(u,"drop",b);mxEvent.addListener(t,"dragover",p);mxEvent.addListener(t,"drop",b);d.appendChild(u);c=document.createElement("div");c.style.textAlign="right";c.style.marginTop="20px";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.setAttribute("id","btnCancel");e.className="geBtn";a.editor.cancelFirst&&c.appendChild(e);l=mxUtils.button(mxResources.get("export"),
|
||||
document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));d.appendChild(t);var w={},y=null,B=null,g=null;e=function(b){"true"!=mxEvent.getSource(b).getAttribute("contentEditable")&&null!=g&&(g(),g=null,mxEvent.consume(b))};mxEvent.addListener(u,"mousedown",e);mxEvent.addListener(u,"pointerdown",e);mxEvent.addListener(u,"touchstart",
|
||||
e);var v=new mxUrlConverter,D=!1;if(null!=c)for(e=0;e<c.length;e++)l=c[e],n(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(b){t.style.cursor="";for(var a=mxEvent.getSource(b);null!=a;){if(a==u||a==t){b.stopPropagation();b.preventDefault();break}a=a.parentNode}});var C=function(b){return function(g,c,f,l,d,e,v,h,q){null!=q&&(/(\.vsdx)($|\?)/i.test(q.name)||/(\.vssx)($|\?)/i.test(q.name))?a.importVisio(q,mxUtils.bind(this,function(g){a.spinner.stop();n(g,c,f,
|
||||
l,d,e,v,"fixed",mxEvent.isAltDown(b)?null:v.substring(0,v.lastIndexOf(".")).replace(/_/g," "))})):null!=q&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(g,q.name)?a.parseFile(q,mxUtils.bind(this,function(g){4==g.readyState&&(a.spinner.stop(),200<=g.status&&299>=g.status&&(n(g.responseText,c,f,l,d,e,v,"fixed",mxEvent.isAltDown(b)?null:v.substring(0,v.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(n(g,c,f,l,d,e,v,"fixed",mxEvent.isAltDown(b)?null:v.substring(0,
|
||||
v.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",p);mxEvent.addListener(u,"drop",b);mxEvent.addListener(t,"dragover",p);mxEvent.addListener(t,"drop",b);d.appendChild(u);c=document.createElement("div");c.style.textAlign="right";c.style.marginTop="20px";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.setAttribute("id","btnCancel");e.className="geBtn";a.editor.cancelFirst&&c.appendChild(e);l=mxUtils.button(mxResources.get("export"),
|
||||
function(){var b=a.createLibraryDataFromImages(f),g=q.value;/(\.xml)$/i.test(g)||(g+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,g,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(g)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";c.appendChild(l);var x=document.createElement("input");x.setAttribute("multiple","multiple");x.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(x,
|
||||
"change",function(b){E=!1;a.importFiles(x.files,0,0,a.maxImageSize,function(a,g,c,f,l,d,e,w,h){C(b)(a,g,c,f,l,d,e,w,h);x.value=""});u.scrollTop=u.scrollHeight}),l=mxUtils.button(mxResources.get("import"),function(){null!=g&&(g(),g=null);x.click()}),l.setAttribute("id","btnAddImage"),l.className="geBtn",c.appendChild(l));l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=g&&(g(),g=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(b,a,g){E=!1;if(null!=b){if("data:image/"==
|
||||
"change",function(b){D=!1;a.importFiles(x.files,0,0,a.maxImageSize,function(a,g,c,f,l,d,e,v,h){C(b)(a,g,c,f,l,d,e,v,h);x.value=""});u.scrollTop=u.scrollHeight}),l=mxUtils.button(mxResources.get("import"),function(){null!=g&&(g(),g=null);x.click()}),l.setAttribute("id","btnAddImage"),l.className="geBtn",c.appendChild(l));l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=g&&(g(),g=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(b,a,g){D=!1;if(null!=b){if("data:image/"==
|
||||
b.substring(0,11)){var c=b.indexOf(",");0<c&&(b=b.substring(0,c)+";base64,"+b.substring(c+1))}n(b,null,0,0,a,g);u.scrollTop=u.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";c.appendChild(l);this.saveBtnClickHandler=function(b,g,c,f){a.saveLibrary(b,g,c,f)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=g&&(g(),g=null);this.saveBtnClickHandler(q.value,f,h,k)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";c.appendChild(l);
|
||||
a.editor.cancelFirst||c.appendChild(e);d.appendChild(c);this.container=d},EditShapeDialog=function(a,e,d,c,h){c=null!=c?c:300;h=null!=h?h:120;var k,m,n=document.createElement("table"),p=document.createElement("tbody");n.style.cellPadding="4px";k=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan","2");m.style.fontSize="10pt";mxUtils.write(m,d);k.appendChild(m);p.appendChild(k);k=document.createElement("tr");m=document.createElement("td");var b=document.createElement("textarea");
|
||||
b.style.outline="none";b.style.resize="none";b.style.width=c-200+"px";b.style.height=h+"px";this.textarea=b;this.init=function(){b.focus();b.scrollTop=0};m.appendChild(b);k.appendChild(m);m=document.createElement("td");d=document.createElement("div");d.style.position="relative";d.style.border="1px solid gray";d.style.top="6px";d.style.width="200px";d.style.height=h+4+"px";d.style.overflow="hidden";d.style.marginBottom="16px";mxEvent.disableContextMenu(d);m.appendChild(d);var f=new Graph(d);f.setEnabled(!1);
|
||||
var l=a.editor.graph.cloneCells([e])[0];f.addCells([l]);d=f.view.getState(l);var q="";null!=d.shape&&null!=d.shape.stencil&&(q=mxUtils.getPrettyXml(d.shape.stencil.desc));mxUtils.write(b,q||"");d=f.getGraphBounds();h=Math.min(160/d.width,(h-40)/d.height);f.view.scaleAndTranslate(h,20/h-d.x,20/h-d.y);k.appendChild(m);p.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.setAttribute("colspan","2");m.style.paddingTop="2px";m.style.whiteSpace="nowrap";m.setAttribute("align",
|
||||
"right");h=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&m.appendChild(h);a.isOffline()||(d=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),d.className="geBtn",m.appendChild(d));var u=function(c,f,l){var d=b.value,g=mxUtils.parseXml(d),d=mxUtils.getPrettyXml(g.documentElement),g=g.documentElement.getElementsByTagName("parsererror");if(null!=g&&0<g.length)a.showError(mxResources.get("error"),
|
||||
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&a.hideDialog(),g=!c.model.contains(f),!l||g||d!=q){d=a.editor.graph.compress(d);c.getModel().beginUpdate();try{if(g){var e=a.editor.graph.getInsertPoint();f.geometry.x=e.x;f.geometry.y=e.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[f])}catch(E){throw E;}finally{c.getModel().endUpdate()}g&&c.setSelectionCell(f)}};d=mxUtils.button(mxResources.get("preview"),function(){u(f,l,!1)});d.className="geBtn";
|
||||
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(l&&a.hideDialog(),g=!c.model.contains(f),!l||g||d!=q){d=a.editor.graph.compress(d);c.getModel().beginUpdate();try{if(g){var e=a.editor.graph.getInsertPoint();f.geometry.x=e.x;f.geometry.y=e.y;c.addCell(f)}c.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+d+")",[f])}catch(D){throw D;}finally{c.getModel().endUpdate()}g&&c.setSelectionCell(f)}};d=mxUtils.button(mxResources.get("preview"),function(){u(f,l,!1)});d.className="geBtn";
|
||||
m.appendChild(d);d=mxUtils.button(mxResources.get("apply"),function(){u(a.editor.graph,e,!0)});d.className="geBtn gePrimaryBtn";m.appendChild(d);a.editor.cancelFirst||m.appendChild(h);k.appendChild(m);p.appendChild(k);n.appendChild(p);this.container=n},CustomDialog=function(a,e,d,c,h,k,m,n){var p=document.createElement("div");p.appendChild(e);e=document.createElement("div");e.style.marginTop="16px";e.style.textAlign="center";null!=m&&e.appendChild(m);m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();
|
||||
null!=c&&c()});m.className="geBtn";n&&(m.style.display="none");a.editor.cancelFirst&&e.appendChild(m);a.isOffline()||null==k||(n=mxUtils.button(mxResources.get("help"),function(){a.openLink(k)}),n.className="geBtn",e.appendChild(n));h=mxUtils.button(h||mxResources.get("ok"),function(){a.hideDialog();null!=d&&d()});e.appendChild(h);h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(m);p.appendChild(e);this.cancelBtn=m;this.okButton=h;this.container=p};(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=":
|
||||
|
@ -7265,11 +7264,11 @@ function(b){this.editorUi.actions.get("editShape").funct()})),a.setAttribute("ti
|
|||
this.getInsertPoint=function(){return null!=a?this.getPointForEvent(a):c.apply(this,arguments)};var f=this.layoutManager.getLayout;this.layoutManager.getLayout=function(b){var a=this.graph.view.getState(b),a=null!=a?a.style:this.graph.getCellStyle(b);if("undefined"!=typeof mxRackContainer&&"rack"==a.childLayout){var c=new mxStackLayout(this.graph,!1);c.setChildGeometry=function(b,a){a.height=Math.max(a.height,20);if(1<a.height/20){var c=a.height%20;a.height+=10<c?20-c:-c}this.graph.getModel().setGeometry(b,
|
||||
a)};c.fill=!0;c.unitSize=mxRackContainer.unitSize|20;c.marginLeft=a.marginLeft||0;c.marginRight=a.marginRight||0;c.marginTop=a.marginTop||0;c.marginBottom=a.marginBottom||0;c.resizeParent=!1;return c}return f.apply(this,arguments)}};var u=Graph.prototype.isCssTransformsSupported;Graph.prototype.isCssTransformsSupported=function(){return u.apply(this,arguments)&&!mxClient.IS_SF};var t=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){t.apply(this,
|
||||
arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var b=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),
|
||||
this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",b.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,b.ownerSVGElement))}};var v=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){v.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(b){if("data:action/json,"==b.substring(0,17)&&(b=JSON.parse(b.substring(17)),
|
||||
this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",b.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,b.ownerSVGElement))}};var w=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){w.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(b){if("data:action/json,"==b.substring(0,17)&&(b=JSON.parse(b.substring(17)),
|
||||
null!=b.actions)){for(var a=0;a<b.actions.length;a++)if(null!=b.actions[a].open)if(this.isCustomLink(b.actions[a].open)){if(!this.customLinkClicked(b.actions[a].open))return}else this.openLink(b.actions[a].open);this.model.beginUpdate();try{for(a=0;a<b.actions.length;a++)this.handleLinkAction(b.actions[a])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(b){var a=[];null!=b.select&&this.isEnabled()&&(a=this.getCellsForAction(b.select),this.setSelectionCells(a));null!=b.highlight&&
|
||||
(a=this.getCellsForAction(b.highlight),this.highlightCells(a,b.highlight.color,b.highlight.duration,b.highlight.opacity));null!=b.toggle&&this.toggleCells(this.getCellsForAction(b.toggle));null!=b.show&&this.setCellsVisible(this.getCellsForAction(b.show),!0);null!=b.hide&&this.setCellsVisible(this.getCellsForAction(b.hide),!1);null!=b.scroll&&(a=this.getCellsForAction(b.scroll));0<a.length&&this.scrollCellToVisible(a[0])};Graph.prototype.getCellsForAction=function(b){return this.getCellsById(b.cells).concat(this.getCellsForTags(b.tags))};
|
||||
Graph.prototype.getCellsById=function(b){var a=[];if(null!=b)for(var c=0;c<b.length;c++)if("*"==b[c])var f=this.getDefaultParent(),a=a.concat(this.model.filterDescendants(function(b){return b!=f},f));else{var g=this.model.getCell(b[c]);null!=g&&a.push(g)}return a};Graph.prototype.getCellsForTags=function(b,a,c){var f=[];if(null!=b){a=null!=a?a:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var g=0;g<a.length;g++)if(this.model.isVertex(a[g])||this.model.isEdge(a[g])){var l=
|
||||
null!=a[g].value&&"object"==typeof a[g].value?mxUtils.trim(a[g].value.getAttribute(c)||""):"",d=!0;if(0<l.length)for(var l=l.toLowerCase().split(" "),e=0;e<b.length&&d;e++)var h=mxUtils.trim(b[e]).toLowerCase(),d=d&&(0==h.length||0<=mxUtils.indexOf(l,h));else d=0==b.length;d&&f.push(a[g])}}return f};Graph.prototype.toggleCells=function(b){this.model.beginUpdate();try{for(var a=0;a<b.length;a++)this.model.setVisible(b[a],!this.model.isVisible(b[a]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=
|
||||
Graph.prototype.getCellsById=function(b){var a=[];if(null!=b)for(var c=0;c<b.length;c++)if("*"==b[c])var g=this.getDefaultParent(),a=a.concat(this.model.filterDescendants(function(b){return b!=g},g));else{var f=this.model.getCell(b[c]);null!=f&&a.push(f)}return a};Graph.prototype.getCellsForTags=function(b,a,c){var g=[];if(null!=b){a=null!=a?a:this.model.getDescendants(this.model.getRoot());c=null!=c?c:"tags";for(var f=0;f<a.length;f++)if(this.model.isVertex(a[f])||this.model.isEdge(a[f])){var l=
|
||||
null!=a[f].value&&"object"==typeof a[f].value?mxUtils.trim(a[f].value.getAttribute(c)||""):"",d=!0;if(0<l.length)for(var l=l.toLowerCase().split(" "),e=0;e<b.length&&d;e++)var h=mxUtils.trim(b[e]).toLowerCase(),d=d&&(0==h.length||0<=mxUtils.indexOf(l,h));else d=0==b.length;d&&g.push(a[f])}}return g};Graph.prototype.toggleCells=function(b){this.model.beginUpdate();try{for(var a=0;a<b.length;a++)this.model.setVisible(b[a],!this.model.isVisible(b[a]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=
|
||||
function(b,a){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setVisible(b[c],a)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(b,a,c,f){for(var g=0;g<b.length;g++)this.highlightCell(b[g],a,c,f)};Graph.prototype.highlightCell=function(b,a,c,f){a=null!=a?a:mxConstants.DEFAULT_VALID_COLOR;c=null!=c?c:1E3;b=this.view.getState(b);if(null!=b){var g=Math.max(5,mxUtils.getValue(b.style,mxConstants.STYLE_STROKEWIDTH,1)+4),l=new mxCellHighlight(this,a,g,!1);null!=
|
||||
f&&(l.opacity=f);l.highlight(b);window.setTimeout(function(){null!=l.shape&&(mxUtils.setPrefixedStyle(l.shape.node.style,"transition","all 1200ms ease-in-out"),l.shape.node.style.opacity=0);window.setTimeout(function(){l.destroy()},1200)},c)}};Graph.prototype.addSvgShadow=function(b,a,c){c=null!=c?c:!1;var f=b.ownerDocument,g=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");g.setAttribute("id",this.shadowId);var l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,
|
||||
"feGaussianBlur"):f.createElement("feGaussianBlur");l.setAttribute("in","SourceAlpha");l.setAttribute("stdDeviation",this.svgShadowBlur);l.setAttribute("result","blur");g.appendChild(l);l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");l.setAttribute("in","blur");l.setAttribute("dx",this.svgShadowSize);l.setAttribute("dy",this.svgShadowSize);l.setAttribute("result","offsetBlur");g.appendChild(l);l=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,
|
||||
|
@ -7283,18 +7282,18 @@ a,c=0;do a=this.model.getChildAt(this.model.root,c);while(c++<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.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=
|
||||
[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(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 y=mxMarker.createMarker;mxMarker.createMarker=function(b,a,c,f,l,d,e,h,q,u){if(null!=c&&null==mxMarker.markers[c]){var g=this.getPackageForType(c);null!=g&&mxStencilRegistry.getStencil(g)}return y.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function c(){w.value=Math.max(1,
|
||||
Math.min(e,Math.max(parseInt(w.value),parseInt(v.value))));v.value=Math.max(1,Math.min(e,Math.min(parseInt(w.value),parseInt(v.value))))}function f(a){function c(a,c,g){var l=a.getGraphBounds(),d=0,e=0,q=ga.get(),h=1/a.pageScale,u=n.checked;if(u)var h=parseInt(W.value),v=parseInt(R.value),h=Math.min(q.height*v/(l.height/a.view.scale),q.width*h/(l.width/a.view.scale));else h=parseInt(y.value)/(100*a.pageScale),isNaN(h)&&(f=1/a.pageScale,y.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*
|
||||
f);q.height=Math.ceil(q.height*f);h*=f;!u&&a.pageVisible?(l=a.getPageLayout(),d-=l.x*q.width,e-=l.y*q.height):u=!0;if(null==c){c=PrintDialog.createPrintPreview(a,h,q,0,d,e,u);c.pageSelector=!1;c.mathEnabled=!1;a=b.getCurrentFile();null!=a&&(c.title=a.getTitle());var t=c.writeHead;c.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=c.renderPage;c.renderPage=
|
||||
function(b,a,c,f,g,l){var d=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=w.apply(this,arguments);mxClient.NO_FO=d;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,g,!0)}else{q=a.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";c.backgroundColor=q;c.autoOrigin=u;c.appendGraph(a,h,d,e,g,!0)}return c}var f=parseInt(Y.value)/100;isNaN(f)&&(f=1,
|
||||
Y.value="100 %");var f=.75*f,l=v.value,d=w.value,e=!u.checked,q=null;e&&(e=l==h&&d==h);if(!e&&null!=b.pages&&b.pages.length){var t=0,e=b.pages.length-1;u.checked||(t=parseInt(l)-1,e=parseInt(d)-1);for(var k=t;k<=e;k++){var m=b.pages[k],l=m==b.currentPage?g:null;if(null==l){var l=b.createTemporaryGraph(g.getStylesheet()),d=!0,t=!1,E=null,z=null;null==m.viewState&&null==m.mapping&&null==m.root&&b.updatePageRoot(m);null!=m.viewState?(d=m.viewState.pageVisible,t=m.viewState.mathEnabled,E=m.viewState.background,
|
||||
z=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(t="0"!=m.mapping.diagramMap.get("mathEnabled"),E=m.mapping.diagramMap.get("background"),z=m.mapping.diagramMap.get("backgroundImage"),z=null!=z&&0<z.length?JSON.parse(z):null);l.background=E;l.backgroundImage=null!=z?new mxImage(z.src,z.width,z.height):null;l.pageVisible=d;l.mathEnabled=t;var p=l.getGlobalVariable;l.getGlobalVariable=function(b){return"page"==b?m.getName():"pagenumber"==b?k+1:p.apply(this,arguments)};document.body.appendChild(l.container);
|
||||
[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 y=mxMarker.createMarker;mxMarker.createMarker=function(b,a,c,f,l,d,e,h,q,u){if(null!=c&&null==mxMarker.markers[c]){var g=this.getPackageForType(c);null!=g&&mxStencilRegistry.getStencil(g)}return y.apply(this,arguments)};PrintDialog.prototype.create=function(b,a){function c(){v.value=Math.max(1,
|
||||
Math.min(e,Math.max(parseInt(v.value),parseInt(w.value))));w.value=Math.max(1,Math.min(e,Math.min(parseInt(v.value),parseInt(w.value))))}function f(a){function c(a,c,g){var l=a.getGraphBounds(),d=0,e=0,q=ga.get(),h=1/a.pageScale,u=n.checked;if(u)var h=parseInt(W.value),w=parseInt(R.value),h=Math.min(q.height*w/(l.height/a.view.scale),q.width*h/(l.width/a.view.scale));else h=parseInt(y.value)/(100*a.pageScale),isNaN(h)&&(f=1/a.pageScale,y.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*
|
||||
f);q.height=Math.ceil(q.height*f);h*=f;!u&&a.pageVisible?(l=a.getPageLayout(),d-=l.x*q.width,e-=l.y*q.height):u=!0;if(null==c){c=PrintDialog.createPrintPreview(a,h,q,0,d,e,u);c.pageSelector=!1;c.mathEnabled=!1;a=b.getCurrentFile();null!=a&&(c.title=a.getTitle());var t=c.writeHead;c.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 v=c.renderPage;c.renderPage=
|
||||
function(b,a,c,f,g,l){var d=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=v.apply(this,arguments);mxClient.NO_FO=d;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,g,!0)}else{q=a.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";c.backgroundColor=q;c.autoOrigin=u;c.appendGraph(a,h,d,e,g,!0)}return c}var f=parseInt(Y.value)/100;isNaN(f)&&(f=1,
|
||||
Y.value="100 %");var f=.75*f,l=w.value,d=v.value,e=!u.checked,q=null;e&&(e=l==h&&d==h);if(!e&&null!=b.pages&&b.pages.length){var t=0,e=b.pages.length-1;u.checked||(t=parseInt(l)-1,e=parseInt(d)-1);for(var k=t;k<=e;k++){var m=b.pages[k],l=m==b.currentPage?g:null;if(null==l){var l=b.createTemporaryGraph(g.getStylesheet()),d=!0,t=!1,D=null,p=null;null==m.viewState&&null==m.mapping&&null==m.root&&b.updatePageRoot(m);null!=m.viewState?(d=m.viewState.pageVisible,t=m.viewState.mathEnabled,D=m.viewState.background,
|
||||
p=m.viewState.backgroundImage):null!=m.mapping&&null!=m.mapping.diagramMap&&(t="0"!=m.mapping.diagramMap.get("mathEnabled"),D=m.mapping.diagramMap.get("background"),p=m.mapping.diagramMap.get("backgroundImage"),p=null!=p&&0<p.length?JSON.parse(p):null);l.background=D;l.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height):null;l.pageVisible=d;l.mathEnabled=t;var z=l.getGlobalVariable;l.getGlobalVariable=function(b){return"page"==b?m.getName():"pagenumber"==b?k+1:z.apply(this,arguments)};document.body.appendChild(l.container);
|
||||
b.updatePageRoot(m);l.model.setRoot(m.root)}q=c(l,q,k!=e);l!=g&&l.container.parentNode.removeChild(l.container)}}else q=c(g);q.mathEnabled&&(e=q.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),e.writeln("MathJax.Hub.Config({"),e.writeln("showMathMenu: false,"),e.writeln('messageStyle: "none",'),e.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),e.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),e.writeln('"HTML-CSS": {'),
|
||||
e.writeln("imageFont: null"),e.writeln("},"),e.writeln("TeX: {"),e.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),e.writeln("},"),e.writeln("tex2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("},"),e.writeln("asciimath2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("}"),e.writeln("});"),a&&(e.writeln("MathJax.Hub.Queue(function () {"),e.writeln("window.print();"),e.writeln("});")),e.writeln("\x3c/script>"),e.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));
|
||||
q.closeDocument();!q.mathEnabled&&a&&PrintDialog.printPreview(q)}var g=b.editor.graph,l=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"));l.appendChild(d);var e=1,h=1,q=document.createElement("div");q.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";
|
||||
u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");q.appendChild(u);d=document.createElement("span");mxUtils.write(d,mxResources.get("printAllPages"));q.appendChild(d);mxUtils.br(q);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");q.appendChild(t);d=document.createElement("span");mxUtils.write(d,mxResources.get("pages")+":");q.appendChild(d);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";
|
||||
v.setAttribute("value","1");v.setAttribute("type","number");v.setAttribute("min","1");v.style.width="50px";q.appendChild(v);d=document.createElement("span");mxUtils.write(d,mxResources.get("to"));q.appendChild(d);var w=v.cloneNode(!0);q.appendChild(w);mxEvent.addListener(v,"focus",function(){t.checked=!0});mxEvent.addListener(w,"focus",function(){t.checked=!0});mxEvent.addListener(v,"change",c);mxEvent.addListener(w,"change",c);if(null!=b.pages&&(e=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==
|
||||
b.pages[d]){h=d+1;v.value=h;w.value=h;break}v.setAttribute("max",e);w.setAttribute("max",e);1<e&&l.appendChild(q);var k=document.createElement("div");k.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");k.appendChild(m);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));k.appendChild(d);var y=document.createElement("input");y.style.cssText=
|
||||
u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");q.appendChild(u);d=document.createElement("span");mxUtils.write(d,mxResources.get("printAllPages"));q.appendChild(d);mxUtils.br(q);var t=u.cloneNode(!0);u.setAttribute("checked","checked");t.setAttribute("value","range");q.appendChild(t);d=document.createElement("span");mxUtils.write(d,mxResources.get("pages")+":");q.appendChild(d);var w=document.createElement("input");w.style.cssText="margin:0 8px 0 8px;";
|
||||
w.setAttribute("value","1");w.setAttribute("type","number");w.setAttribute("min","1");w.style.width="50px";q.appendChild(w);d=document.createElement("span");mxUtils.write(d,mxResources.get("to"));q.appendChild(d);var v=w.cloneNode(!0);q.appendChild(v);mxEvent.addListener(w,"focus",function(){t.checked=!0});mxEvent.addListener(v,"focus",function(){t.checked=!0});mxEvent.addListener(w,"change",c);mxEvent.addListener(v,"change",c);if(null!=b.pages&&(e=b.pages.length,null!=b.currentPage))for(d=0;d<b.pages.length;d++)if(b.currentPage==
|
||||
b.pages[d]){h=d+1;w.value=h;v.value=h;break}w.setAttribute("max",e);v.setAttribute("max",e);1<e&&l.appendChild(q);var k=document.createElement("div");k.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");k.appendChild(m);d=document.createElement("span");mxUtils.write(d,mxResources.get("adjustTo"));k.appendChild(d);var y=document.createElement("input");y.style.cssText=
|
||||
"margin:0 8px 0 8px;";y.setAttribute("value","100 %");y.style.width="50px";k.appendChild(y);mxEvent.addListener(y,"focus",function(){m.checked=!0});l.appendChild(k);var q=q.cloneNode(!1),n=m.cloneNode(!0);n.setAttribute("value","fit");m.setAttribute("checked","checked");d=document.createElement("div");d.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";d.appendChild(n);q.appendChild(d);k=document.createElement("table");k.style.display="inline-block";var p=document.createElement("tbody"),
|
||||
B=document.createElement("tr"),O=B.cloneNode(!0),M=document.createElement("td"),ba=M.cloneNode(!0),P=M.cloneNode(!0),S=M.cloneNode(!0),V=M.cloneNode(!0),K=M.cloneNode(!0);M.style.textAlign="right";S.style.textAlign="right";mxUtils.write(M,mxResources.get("fitTo"));var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","1");W.setAttribute("min","1");W.setAttribute("type","number");W.style.width="40px";ba.appendChild(W);d=document.createElement("span");mxUtils.write(d,
|
||||
mxResources.get("fitToSheetsAcross"));P.appendChild(d);mxUtils.write(S,mxResources.get("fitToBy"));var R=W.cloneNode(!0);V.appendChild(R);mxEvent.addListener(W,"focus",function(){n.checked=!0});mxEvent.addListener(R,"focus",function(){n.checked=!0});d=document.createElement("span");mxUtils.write(d,mxResources.get("fitToSheetsDown"));K.appendChild(d);B.appendChild(M);B.appendChild(ba);B.appendChild(P);O.appendChild(S);O.appendChild(V);O.appendChild(K);p.appendChild(B);p.appendChild(O);k.appendChild(p);
|
||||
|
@ -7306,7 +7305,7 @@ this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnab
|
|||
var ErrorDialog=function(a,e,d,c,h,k,m,n,p,b,f){p=null!=p?p:!0;var l=document.createElement("div");l.style.textAlign="center";if(null!=e){var q=document.createElement("div");q.style.padding="0px";q.style.margin="0px";q.style.fontSize="18px";q.style.paddingBottom="16px";q.style.marginBottom="16px";q.style.borderBottom="1px solid #c0c0c0";q.style.color="gray";mxUtils.write(q,e);l.appendChild(q)}e=document.createElement("div");e.style.padding="6px";e.innerHTML=d;l.appendChild(e);d=document.createElement("div");
|
||||
d.style.marginTop="16px";d.style.textAlign="center";null!=k&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();k()}),e.className="geBtn",d.appendChild(e),d.style.textAlign="center");null!=b&&(b=mxUtils.button(b,function(){null!=f&&f()}),b.className="geBtn",d.appendChild(b));var u=mxUtils.button(c,function(){p&&a.hideDialog();null!=h&&h()});u.className="geBtn";d.appendChild(u);null!=m&&(c=mxUtils.button(m,function(){p&&a.hideDialog();null!=n&&n()}),c.className="geBtn gePrimaryBtn",
|
||||
d.appendChild(c));this.init=function(){u.focus()};l.appendChild(d);this.container=l};
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,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="9.0.0";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,d,c){c.ui=a.ui;return d};a.afterDecode=function(a,d,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="9.0.1";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;EditorUi.prototype.persistCurrentEdgeStyle=!1;EditorUi.prototype.persistCurrentVertexStyle=!1;(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=
|
||||
|
@ -7318,14 +7317,14 @@ e.style.fontFamily="Helvetica, Arial",e.style.fontSize="9pt",e.style.padding="6p
|
|||
document.documentMode||8>=document.documentMode)&&(e.style.left=Math.round(Math.max(0,b-e.offsetWidth/2))+"px",e.style.top=Math.round(Math.max(0,a+70-e.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var b=function(){};this.active&&(b=mxUtils.bind(this,function(){this.spin(c,d)}));this.stop();return b}),e=!0);return e};var d=f.stop;f.stop=function(){d.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),f.status=null)};f.pause=function(){return function(){}};
|
||||
return f};EditorUi.parsePng=function(b,a,c){function f(b,a){var c=d;d+=a;return b.substring(c,d)}function l(b){b=f(b,4);return b.charCodeAt(3)+(b.charCodeAt(2)<<8)+(b.charCodeAt(1)<<16)+(b.charCodeAt(0)<<24)}var d=0;if(f(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(b,4),"IHDR"!=f(b,4))null!=c&&c();else{f(b,17);do{c=l(b);var e=f(b,4);if(null!=a&&a(d-8,e,c))break;value=f(b,c);f(b,4);if("IEND"==e)break}while(c)}};EditorUi.prototype.isCompatibleString=function(b){try{var a=
|
||||
mxUtils.parseXml(b),c=this.editor.extractGraphModel(a.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(q){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var l=b.indexOf("<mxfile ");if(0<=l){var d=b.lastIndexOf("</mxfile>");d>l&&(c=b.substring(l,d+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var e=
|
||||
mxUtils.parseXml(b),h=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=h?mxUtils.getXml(h):""}catch(v){}return c};EditorUi.prototype.validateFileData=function(b){if(null!=b&&0<b.length){var a=b.indexOf('<meta charset="utf-8">');0<=a&&(b=b.slice(0,a)+'<meta charset="utf-8"/>'+b.slice(a+23-1,b.length))}return b};EditorUi.prototype.replaceFileData=function(b){b=this.validateFileData(b);b=null!=b&&0<b.length?mxUtils.parseXml(b).documentElement:
|
||||
mxUtils.parseXml(b),h=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=h?mxUtils.getXml(h):""}catch(w){}return c};EditorUi.prototype.validateFileData=function(b){if(null!=b&&0<b.length){var a=b.indexOf('<meta charset="utf-8">');0<=a&&(b=b.slice(0,a)+'<meta charset="utf-8"/>'+b.slice(a+23-1,b.length))}return b};EditorUi.prototype.replaceFileData=function(b){b=this.validateFileData(b);b=null!=b&&0<b.length?mxUtils.parseXml(b).documentElement:
|
||||
null;var a=null!=b?this.editor.extractGraphModel(b,!0):null;null!=a&&(b=a);if(null!=b){a=this.editor.graph;a.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,d=b.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=b;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));
|
||||
a.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=b.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(b.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),a.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(b),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=c)for(e=0;e<c.length;e++)a.model.execute(new ChangePage(this,
|
||||
c[e],null))}finally{a.model.endUpdate()}}};EditorUi.prototype.createFileData=function(b,a,c,d,e,h,v,k,m,g){a=null!=a?a:this.editor.graph;e=null!=e?e:!1;m=null!=m?m:!0;var f,l=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":l=f=d;if(null==b)return"";var q=b;if("mxfile"!=q.nodeName.toLowerCase()){var u=a.zapGremlins(mxUtils.getXml(b)),q=a.compress(u);if(a.decompress(q)!=u)return u;u=b.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,q);q=b.ownerDocument.createElement("mxfile");
|
||||
q.appendChild(u)}g?(q=q.cloneNode(!0),q.removeAttribute("userAgent"),q.removeAttribute("version"),q.removeAttribute("editor"),q.removeAttribute("type")):(q.setAttribute("userAgent",navigator.userAgent),q.setAttribute("version",EditorUi.VERSION),q.setAttribute("editor","www.draw.io"),b=null!=c?c.getMode():this.mode,null!=b&&q.setAttribute("type",b));b=mxUtils.getXml(q);if(!h&&!e&&(v||null!=c&&/(\.html)$/i.test(c.getTitle())))b=this.getHtml2(mxUtils.getXml(q),a,null!=c?c.getTitle():null,f,l);else if(h||
|
||||
c[e],null))}finally{a.model.endUpdate()}}};EditorUi.prototype.createFileData=function(b,a,c,d,e,h,w,k,m,g){a=null!=a?a:this.editor.graph;e=null!=e?e:!1;m=null!=m?m:!0;var f,l=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":l=f=d;if(null==b)return"";var q=b;if("mxfile"!=q.nodeName.toLowerCase()){var u=a.zapGremlins(mxUtils.getXml(b)),q=a.compress(u);if(a.decompress(q)!=u)return u;u=b.ownerDocument.createElement("diagram");mxUtils.setTextContent(u,q);q=b.ownerDocument.createElement("mxfile");
|
||||
q.appendChild(u)}g?(q=q.cloneNode(!0),q.removeAttribute("userAgent"),q.removeAttribute("version"),q.removeAttribute("editor"),q.removeAttribute("type")):(q.setAttribute("userAgent",navigator.userAgent),q.setAttribute("version",EditorUi.VERSION),q.setAttribute("editor","www.draw.io"),b=null!=c?c.getMode():this.mode,null!=b&&q.setAttribute("type",b));b=mxUtils.getXml(q);if(!h&&!e&&(w||null!=c&&/(\.html)$/i.test(c.getTitle())))b=this.getHtml2(mxUtils.getXml(q),a,null!=c?c.getTitle():null,f,l);else if(h||
|
||||
!e&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),b=this.getEmbeddedSvg(b,a,d,null,k,m,l);return b};EditorUi.prototype.getXmlFileData=function(b,a){b=null!=b?b:!0;a=null!=a?a:!1;var c=this.editor.getGraphXml(b);if(b&&null!=this.fileNode&&null!=this.currentPage){var f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(c)));mxUtils.setTextContent(this.currentPage.node,f);c=this.fileNode.cloneNode(!1);if(a)c.appendChild(this.currentPage.node);
|
||||
else for(var d=0;d<this.pages.length;d++){var e=this.pages[d].mapping;this.currentPage!=this.pages[d]&&null!=e&&e.needsUpdate&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(f),f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(f))),mxUtils.setTextContent(this.pages[d].node,f),e.needsUpdate=!1);c.appendChild(this.pages[d].node)}}return c};EditorUi.prototype.getFileData=function(b,a,c,d,e,h,v,k,m){e=null!=e?e:!0;v=null!=v?v:this.getXmlFileData(e,
|
||||
null!=h?h:!1);m=null!=m?m:this.getCurrentFile();h=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(a||!b&&null!=m&&/(\.svg)$/i.test(m.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var f=h.getGlobalVariable,l=this.pages[0];h.getGlobalVariable=function(b){return"page"==b?l.getName():"pagenumber"==b?1:f.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(l.root)}b=this.createFileData(v,h,m,window.location.href,b,a,c,d,e,k);h!=this.editor.graph&&
|
||||
else for(var d=0;d<this.pages.length;d++){var e=this.pages[d].mapping;this.currentPage!=this.pages[d]&&null!=e&&e.needsUpdate&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(e.graphModel),e.writeRealtimeToNode(f),f=this.editor.graph.compress(this.editor.graph.zapGremlins(mxUtils.getXml(f))),mxUtils.setTextContent(this.pages[d].node,f),e.needsUpdate=!1);c.appendChild(this.pages[d].node)}}return c};EditorUi.prototype.getFileData=function(b,a,c,d,e,h,w,k,m){e=null!=e?e:!0;w=null!=w?w:this.getXmlFileData(e,
|
||||
null!=h?h:!1);m=null!=m?m:this.getCurrentFile();h=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(a||!b&&null!=m&&/(\.svg)$/i.test(m.getTitle()))){h=this.createTemporaryGraph(h.getStylesheet());var f=h.getGlobalVariable,l=this.pages[0];h.getGlobalVariable=function(b){return"page"==b?l.getName():"pagenumber"==b?1:f.apply(this,arguments)};document.body.appendChild(h.container);h.model.setRoot(l.root)}b=this.createFileData(w,h,m,window.location.href,b,a,c,d,e,k);h!=this.editor.graph&&
|
||||
h.container.parentNode.removeChild(h.container);return b};EditorUi.prototype.getHtml=function(b,a,c,d,e,h){h=null!=h?h:!0;var f=null,l="https://www.draw.io/js/embed-static.min.js";if(null!=a){var f=h?a.getGraphBounds():a.getBoundingBox(a.getSelectionCells()),q=a.view.scale;h=Math.floor(f.x/q-a.view.translate.x);q=Math.floor(f.y/q-a.view.translate.y);f=a.background;null==e&&(a=this.getBasenames().join(";"),0<a.length&&(l="https://www.draw.io/embed.js?s="+a));b.setAttribute("x0",h);b.setAttribute("y0",
|
||||
q)}null!=b&&(b.setAttribute("pan","1"),b.setAttribute("zoom","1"),b.setAttribute("resize","0"),b.setAttribute("fit","0"),b.setAttribute("border","20"),b.setAttribute("links","1"),null!=d&&b.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&"));b=null!=b?this.editor.graph.zapGremlins(mxUtils.getXml(b)):"";d=this.editor.graph.compress(b);this.editor.graph.decompress(d)!=b&&(d=encodeURIComponent(b));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
|
||||
"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=f&&f!=mxConstants.NONE?' style="background-color:'+f+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+
|
||||
|
@ -7334,18 +7333,18 @@ null!=this.pages&&null!=this.currentPage&&(b.page=mxUtils.indexOf(this.pages,thi
|
|||
mxUtils.htmlEntities(JSON.stringify(b))+'"></div>\n'+(null==e?'<script type="text/javascript" src="https://www.draw.io/js/viewer.min.js">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="https://www.draw.io/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(b){b=this.validateFileData(b);this.pages=this.fileNode=this.currentPage=null;var a=null!=b&&0<b.length?
|
||||
mxUtils.parseXml(b).documentElement:null;b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a&&"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<b.length||1==b.length&&b[0].hasAttribute("name"))){this.fileNode=a;this.pages=[];for(a=0;a<b.length;a++){var c=new DiagramPage(b[a]);null==c.getName()&&c.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(c)}this.currentPage=this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||
|
||||
0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(b){var a=this.getCurrentFile(),a=null!=a&&null!=
|
||||
a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));!b&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(a=a+"-"+this.currentPage.getName());return a};EditorUi.prototype.downloadFile=function(b,a,c,d,e,h,v){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),
|
||||
a.getTitle()?a.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(a)||/(\.html)$/i.test(a)||/(\.svg)$/i.test(a)||/(\.png)$/i.test(a))a=a.substring(0,a.lastIndexOf("."));!b&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(a=a+"-"+this.currentPage.getName());return a};EditorUi.prototype.downloadFile=function(b,a,c,d,e,h,w){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),
|
||||
l=f+"."+b;if("xml"==b){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(a?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(l,b,g,"text/xml")}else if("html"==b)g=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(l,b,g,"text/html");else if("svg"!=b&&"xmlsvg"!=b||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==b?l=f+".png":"jpeg"==b&&(l=f+".jpg"),this.saveRequest(l,b,mxUtils.bind(this,function(a,c){try{var f=
|
||||
this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var g=this.createDownloadRequest(a,b,d,c,v);this.editor.graph.pageVisible=f;return g}catch(z){this.handleError(z)}}));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 k=this.editor.graph.background;if(v||k==
|
||||
this.editor.graph.pageVisible;null!=h&&(this.editor.graph.pageVisible=h);var g=this.createDownloadRequest(a,b,d,c,w);this.editor.graph.pageVisible=f;return g}catch(z){this.handleError(z)}}));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 k=this.editor.graph.background;if(w||k==
|
||||
mxConstants.NONE)k=null;var t=this.editor.graph.getSvg(k,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(t);this.convertImages(t,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=f+".svg",q=this.getFileData(!1,!0,null,mxUtils.bind(this,function(b){this.spinner.stop();u(b)}),d)}}catch(I){this.handleError(I)}};
|
||||
EditorUi.prototype.createDownloadRequest=function(b,a,c,d,e){var f=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,"xmlpng"!=a);var l="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";if("xmlpng"==a&&(f="1",a="png",null!=this.pages&&null!=this.currentPage))for(var h=0;h<this.pages.length;h++)if(this.pages[h]==this.currentPage){l="&from="+h;break}h=this.editor.graph.background;"png"==a&&e&&(h=mxConstants.NONE);
|
||||
return new mxXmlRequest(EXPORT_URL,"format="+a+l+"&bg="+(null!=h?h:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&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 f=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 f};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,g=null,e=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()),h()):this.handleError({message:mxResources.get("error")+" "+b.getStatus()}))}),mxUtils.bind(this,function(b){this.handleError(b)}))}),h=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(e,d)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){h();e()}));h();e()}null!=a&&a()});if(null!=b.url&&0<b.url.length){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("")};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,e=d.getModel();e.beginUpdate();var h=null;try{for(b=b.firstChild;null!=b;){if("update"==b.nodeName){var v=e.getCell(b.getAttribute("id"));if(null!=v){try{var k=b.getAttribute("value");if(null!=k){var m=mxUtils.parseXml(k).documentElement;if(null!=m)if("1"==m.getAttribute("replace-value"))e.setValue(v,m);else for(var g=m.attributes,w=0;w<g.length;w++)d.setAttributeForCell(v,g[w].nodeName,0<g[w].nodeValue.length?g[w].nodeValue:null)}}catch(z){null!=
|
||||
window.console&&console.log("Error in value for "+v.id+": "+z)}try{var n=b.getAttribute("style");null!=n&&d.model.setStyle(v,n)}catch(z){null!=window.console&&console.log("Error in style for "+v.id+": "+z)}try{var p=b.getAttribute("icon");if(null!=p){var x=0<p.length?JSON.parse(p):null;null!=x&&x.append||d.removeCellOverlays(v);null!=x&&d.addCellOverlay(v,a(x))}}catch(z){null!=window.console&&console.log("Error in icon for "+v.id+": "+z)}try{var I=b.getAttribute("geometry");if(null!=I){var I=JSON.parse(I),
|
||||
D=d.getCellGeometry(v);if(null!=D){D=D.clone();for(key in I){var F=parseFloat(I[key]);"dx"==key?D.x+=F:"dy"==key?D.y+=F:"dw"==key?D.width+=F:"dh"==key?D.height+=F:D[key]=parseFloat(I[key])}d.model.setGeometry(v,D)}}}catch(z){null!=window.console&&console.log("Error in icon for "+v.id+": "+z)}}}else if("model"==b.nodeName){for(var A=b.firstChild;null!=A&&A.nodeType!=mxConstants.NODETYPE_ELEMENT;)A=A.nextSibling;null!=A&&(new mxCodec(b.firstChild)).decode(A,e)}else if("view"==b.nodeName){if(b.hasAttribute("scale")&&
|
||||
null!=b&&"updates"==b.nodeName)){var d=this.editor.graph,e=d.getModel();e.beginUpdate();var h=null;try{for(b=b.firstChild;null!=b;){if("update"==b.nodeName){var k=e.getCell(b.getAttribute("id"));if(null!=k){try{var m=b.getAttribute("value");if(null!=m){var n=mxUtils.parseXml(m).documentElement;if(null!=n)if("1"==n.getAttribute("replace-value"))e.setValue(k,n);else for(var g=n.attributes,v=0;v<g.length;v++)d.setAttributeForCell(k,g[v].nodeName,0<g[v].nodeValue.length?g[v].nodeValue:null)}}catch(z){null!=
|
||||
window.console&&console.log("Error in value for "+k.id+": "+z)}try{var D=b.getAttribute("style");null!=D&&d.model.setStyle(k,D)}catch(z){null!=window.console&&console.log("Error in style for "+k.id+": "+z)}try{var p=b.getAttribute("icon");if(null!=p){var x=0<p.length?JSON.parse(p):null;null!=x&&x.append||d.removeCellOverlays(k);null!=x&&d.addCellOverlay(k,a(x))}}catch(z){null!=window.console&&console.log("Error in icon for "+k.id+": "+z)}try{var I=b.getAttribute("geometry");if(null!=I){var I=JSON.parse(I),
|
||||
E=d.getCellGeometry(k);if(null!=E){E=E.clone();for(key in I){var F=parseFloat(I[key]);"dx"==key?E.x+=F:"dy"==key?E.y+=F:"dw"==key?E.width+=F:"dh"==key?E.height+=F:E[key]=parseFloat(I[key])}d.model.setGeometry(k,E)}}}catch(z){null!=window.console&&console.log("Error in icon for "+k.id+": "+z)}}}else if("model"==b.nodeName){for(var A=b.firstChild;null!=A&&A.nodeType!=mxConstants.NODETYPE_ELEMENT;)A=A.nextSibling;null!=A&&(new mxCodec(b.firstChild)).decode(A,e)}else if("view"==b.nodeName){if(b.hasAttribute("scale")&&
|
||||
(d.view.scale=parseFloat(b.getAttribute("scale"))),b.hasAttribute("dx")||b.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(b.getAttribute("dx")||0),parseFloat(b.getAttribute("dy")||0))}else"fit"==b.nodeName&&(h=b.hasAttribute("max-scale")?parseFloat(b.getAttribute("max-scale")):1);b=b.nextSibling}}finally{e.endUpdate()}null!=h&&this.chromelessResize&&this.chromelessResize(!0,h)}return c};EditorUi.prototype.fileLoaded=function(b){var a=!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.editor.setStatus("");this.updateUi();this.showSplash()});if(null!=b)try{this.setCurrentFile(b);b.addListener("descriptorChanged",this.descriptorChangedListener);b.addListener("contentChanged",this.descriptorChangedListener);b.open();this.setGraphEnabled(!0);this.setMode(b.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==b.realtime&&(b.isEditable()?this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+
|
||||
|
@ -7357,24 +7356,24 @@ mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScr
|
|||
return mxUtils.getXml(a)};EditorUi.prototype.closeLibrary=function(b){null!=b&&(this.removeLibrarySidebar(b.getHash()),b.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(b.getHash()),".scratchpad"==b.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(b){var a=this.sidebar.palettes[b];if(null!=a){for(var c=0;c<a.length;c++)a[c].parentNode.removeChild(a[c]);delete this.sidebar.palettes[b]}};EditorUi.prototype.repositionLibrary=function(b){var a=this.sidebar.container;
|
||||
if(null==b){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(b=c[c.length-1].nextSibling)}b=null!=b?b:a.firstChild.nextSibling.nextSibling;var c=a.lastChild,d=c.previousSibling;a.insertBefore(c,b);a.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(b){var a=mxUtils.parseXml(b.getData());if("mxlibrary"==a.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(a.documentElement));this.libraryLoaded(b,c,a.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
};EditorUi.prototype.getLibraryStorageHint=function(b){return""};EditorUi.prototype.libraryLoaded=function(b,a,c){if(null!=this.sidebar){b.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(b.getHash());".scratchpad"==b.title&&(this.scratchpad=b);var f=this.sidebar.palettes[b.getHash()],f=null!=f?f[f.length-1].nextSibling:null;this.removeLibrarySidebar(b.getHash());var d=null,e=mxUtils.bind(this,function(a,c){if(0==a.length&&b.isEditable())null==d&&(d=document.createElement("div"),mxUtils.setPrefixedStyle(d.style,
|
||||
"borderRadius","6px"),d.style.border="3px dotted lightGray",d.style.textAlign="center",d.style.padding="8px",d.style.color="#B3B3B3",mxUtils.write(d,mxResources.get("dragElementsHere"))),c.appendChild(d);else for(var g=0;g<a.length;g++){var f=a[g],e=f.data;if(null!=e){var e=this.convertDataUri(e),l="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==f.aspect&&(l+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(l+"image="+e,f.w,f.h,"",f.title||"",!1,
|
||||
!1,!0))}else null!=f.xml&&(e=this.stringToCells(this.editor.graph.decompress(f.xml)),0<e.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(e,f.w,f.h,f.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=a)for(var l=0;l<a.length;l++)mxUtils.bind(this,function(b){var a=b.data;null!=a&&null!=b.title?this.sidebar.addEntry(b.title,mxUtils.bind(this,function(){a=this.convertDataUri(a);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==b.aspect&&(c+=
|
||||
"borderRadius","6px"),d.style.border="3px dotted lightGray",d.style.textAlign="center",d.style.padding="8px",d.style.color="#B3B3B3",mxUtils.write(d,mxResources.get("dragElementsHere"))),c.appendChild(d);else for(var f=0;f<a.length;f++){var g=a[f],e=g.data;if(null!=e){var e=this.convertDataUri(e),l="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==g.aspect&&(l+="aspect=fixed;");c.appendChild(this.sidebar.createVertexTemplate(l+"image="+e,g.w,g.h,"",g.title||"",!1,
|
||||
!1,!0))}else null!=g.xml&&(e=this.stringToCells(this.editor.graph.decompress(g.xml)),0<e.length&&c.appendChild(this.sidebar.createVertexTemplateFromCells(e,g.w,g.h,g.title||"",!0,!1,!0)))}});if(null!=this.sidebar&&null!=a)for(var l=0;l<a.length;l++)mxUtils.bind(this,function(b){var a=b.data;null!=a&&null!=b.title?this.sidebar.addEntry(b.title,mxUtils.bind(this,function(){a=this.convertDataUri(a);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==b.aspect&&(c+=
|
||||
"aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+a,b.w,b.h,"",b.title||"",!1,!1,!0)})):null!=b.xml&&null!=b.title&&this.sidebar.addEntry(b.title,mxUtils.bind(this,function(){var a=this.stringToCells(this.editor.graph.decompress(b.xml));return this.sidebar.createVertexTemplateFromCells(a,b.w,b.h,b.title||"",!0,!1,!0)}))})(a[l]);c=null!=c&&0<c.length?c:b.getTitle();var h=this.sidebar.addPalette(b.getHash(),c,!0,mxUtils.bind(this,function(b){e(a,b)}));this.repositionLibrary(f);var k=
|
||||
h.parentNode.previousSibling;c=k.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=b.title&&k.setAttribute("title",this.getLibraryStorageHint(b)+"\n"+c);var g=document.createElement("div");g.style.position="absolute";g.style.right="0px";g.style.top="0px";g.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(g.style.backgroundColor="inherit");k.style.position="relative";var w=document.createElement("img");w.setAttribute("src",Dialog.prototype.closeImage);w.setAttribute("title",
|
||||
mxResources.get("close"));w.setAttribute("valign","absmiddle");w.setAttribute("border","0");w.style.margin="0 3px";var m=null;if(".scratchpad"!=b.title||this.closableScratchpad)g.appendChild(w),mxEvent.addListener(w,"click",mxUtils.bind(this,function(a){if(!mxEvent.isConsumed(a)){var c=mxUtils.bind(this,function(){this.closeLibrary(b)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(a)}}));if(b.isEditable()){var n=
|
||||
this.editor.graph,p=null,I=mxUtils.bind(this,function(c){this.showLibraryDialog(b.getTitle(),h,a,b,b.getMode());mxEvent.consume(c)}),D=mxUtils.bind(this,function(c){b.setModified(!0);b.isAutosave()?(null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p),p=w.cloneNode(!1),p.setAttribute("src",Editor.spinImage),p.setAttribute("title",mxResources.get("saving")),p.style.cursor="default",p.style.marginRight="2px",p.style.marginTop="-2px",g.insertBefore(p,g.firstChild),k.style.paddingRight=18*g.childNodes.length+
|
||||
"px",this.saveLibrary(b.getTitle(),a,b,b.getMode(),!0,!0,function(){null!=p&&null!=p.parentNode&&(p.parentNode.removeChild(p),k.style.paddingRight=18*g.childNodes.length+"px")})):null==m&&(m=w.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),g.insertBefore(m,g.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(b.getTitle(),a,b,b.getMode(),b.constructor==LocalLibrary,!0,function(){null==m||b.isModified()||
|
||||
(k.style.paddingRight=18*g.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),k.style.paddingRight=18*g.childNodes.length+"px")}),F=mxUtils.bind(this,function(b,c,f,g){b=n.cloneCells(mxUtils.sortCells(n.model.getTopmostCells(b)));for(var e=0;e<b.length;e++){var l=n.getCellGeometry(b[e]);null!=l&&l.translate(-c.x,-c.y)}h.appendChild(this.sidebar.createVertexTemplateFromCells(b,c.width,c.height,g||"",!0,!1,!1));b={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(b))),
|
||||
w:c.width,h:c.height};null!=g&&(b.title=g);a.push(b);D(f);null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)}),A=mxUtils.bind(this,function(b){if(n.isSelectionEmpty())n.getRubberband().isActive()?(n.getRubberband().execute(b),n.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var a=n.getSelectionCells(),c=n.view.getBounds(a),f=n.view.scale;c.x/=f;c.y/=f;c.width/=f;c.height/=f;c.x-=n.view.translate.x;
|
||||
h.parentNode.previousSibling;c=k.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=b.title&&k.setAttribute("title",this.getLibraryStorageHint(b)+"\n"+c);var g=document.createElement("div");g.style.position="absolute";g.style.right="0px";g.style.top="0px";g.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(g.style.backgroundColor="inherit");k.style.position="relative";var v=document.createElement("img");v.setAttribute("src",Dialog.prototype.closeImage);v.setAttribute("title",
|
||||
mxResources.get("close"));v.setAttribute("valign","absmiddle");v.setAttribute("border","0");v.style.margin="0 3px";var m=null;if(".scratchpad"!=b.title||this.closableScratchpad)g.appendChild(v),mxEvent.addListener(v,"click",mxUtils.bind(this,function(a){if(!mxEvent.isConsumed(a)){var c=mxUtils.bind(this,function(){this.closeLibrary(b)});null!=m?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(a)}}));if(b.isEditable()){var n=
|
||||
this.editor.graph,p=null,I=mxUtils.bind(this,function(c){this.showLibraryDialog(b.getTitle(),h,a,b,b.getMode());mxEvent.consume(c)}),E=mxUtils.bind(this,function(c){b.setModified(!0);b.isAutosave()?(null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p),p=v.cloneNode(!1),p.setAttribute("src",Editor.spinImage),p.setAttribute("title",mxResources.get("saving")),p.style.cursor="default",p.style.marginRight="2px",p.style.marginTop="-2px",g.insertBefore(p,g.firstChild),k.style.paddingRight=18*g.childNodes.length+
|
||||
"px",this.saveLibrary(b.getTitle(),a,b,b.getMode(),!0,!0,function(){null!=p&&null!=p.parentNode&&(p.parentNode.removeChild(p),k.style.paddingRight=18*g.childNodes.length+"px")})):null==m&&(m=v.cloneNode(!1),m.setAttribute("src",IMAGE_PATH+"/download.png"),m.setAttribute("title",mxResources.get("save")),g.insertBefore(m,g.firstChild),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){this.saveLibrary(b.getTitle(),a,b,b.getMode(),b.constructor==LocalLibrary,!0,function(){null==m||b.isModified()||
|
||||
(k.style.paddingRight=18*g.childNodes.length+"px",m.parentNode.removeChild(m),m=null)});mxEvent.consume(c)})),k.style.paddingRight=18*g.childNodes.length+"px")}),F=mxUtils.bind(this,function(b,c,g,f){b=n.cloneCells(mxUtils.sortCells(n.model.getTopmostCells(b)));for(var e=0;e<b.length;e++){var l=n.getCellGeometry(b[e]);null!=l&&l.translate(-c.x,-c.y)}h.appendChild(this.sidebar.createVertexTemplateFromCells(b,c.width,c.height,f||"",!0,!1,!1));b={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(b))),
|
||||
w:c.width,h:c.height};null!=f&&(b.title=f);a.push(b);E(g);null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)}),A=mxUtils.bind(this,function(b){if(n.isSelectionEmpty())n.getRubberband().isActive()?(n.getRubberband().execute(b),n.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var a=n.getSelectionCells(),c=n.view.getBounds(a),g=n.view.scale;c.x/=g;c.y/=g;c.width/=g;c.height/=g;c.x-=n.view.translate.x;
|
||||
c.y-=n.view.translate.y;F(a,c)}mxEvent.consume(b)});h.style.border="3px solid transparent";mxEvent.addGestureListeners(h,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)":h.style.border="3px dotted rgb(254, 137, 12)",h.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&&(h.style.border="3px solid transparent",null!=d&&(d.style.border="3px dotted lightGray"),h.style.cursor="default",this.sidebar.showTooltips=!0,n.panningManager.stop(),n.graphHandler.reset(),n.isMouseDown=!1,n.autoScroll=!0,A(b),mxEvent.consume(b))}));mxEvent.addListener(h,"mouseleave",mxUtils.bind(this,function(b){n.isMouseDown&&
|
||||
null!=n.graphHandler.shape&&(n.graphHandler.shape.node.style.visibility="visible",h.style.border="3px solid transparent",h.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(h,"dragover",mxUtils.bind(this,function(b){null!=d?d.style.border="3px dotted rgb(254, 137, 12)":h.style.border="3px dotted rgb(254, 137, 12)";
|
||||
b.dataTransfer.dropEffect="copy";h.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(h,"drop",mxUtils.bind(this,function(b){h.style.border="3px solid transparent";h.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,f,g,l,q,k,v,w,u){if(null!=c&&"image/"==f.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
|
||||
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,k),c)],c[0].vertex=!0,F(c,new mxRectangle(0,0,q,k),b,mxEvent.isAltDown(b)?null:v.substring(0,v.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null);else{var t=!1,m=mxUtils.bind(this,function(c,f){if(null!=c&&"text/xml"==f){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(g.documentElement));e(l,h);a=a.concat(l);D(b);
|
||||
this.spinner.stop();t=!0}catch(R){}else if("mxfile"==g.documentElement.nodeName)try{for(var q=g.documentElement.getElementsByTagName("diagram"),g=0;g<q.length;g++){var l=mxUtils.getTextContent(q[g]),k=this.stringToCells(this.editor.graph.decompress(l)),v=this.editor.graph.getBoundingBoxFromGeometry(k);F(k,new mxRectangle(0,0,v.width,v.height),b)}t=!0}catch(R){null!=window.console&&console.log("error in drop handler:",R)}}t||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});null!=u&&null!=v&&(/(\.vsdx?)($|\?)/i.test(v)||/(\.vssx?)($|\?)/i.test(v))?this.importVisio(u,function(b){m(b,"text/xml")},null,v):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,v)&&null!=u?this.parseFile(u,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,f)}}));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(h,"dragleave",function(b){null!=d?d.style.border="3px dotted lightGray":(h.style.border="3px solid transparent",h.style.cursor="");b.stopPropagation();b.preventDefault()}));w=w.cloneNode(!1);w.setAttribute("src",Editor.editImage);w.setAttribute("title",mxResources.get("edit"));g.insertBefore(w,g.firstChild);mxEvent.addListener(w,"click",I);mxEvent.addListener(h,
|
||||
"dblclick",function(b){mxEvent.getSource(b)==h&&I(b)});c=w.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));g.insertBefore(c,g.firstChild);mxEvent.addListener(c,"click",A);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,
|
||||
b.dataTransfer.dropEffect="copy";h.style.cursor="copy";this.sidebar.hideTooltip();b.stopPropagation();b.preventDefault()})),mxEvent.addListener(h,"drop",mxUtils.bind(this,function(b){h.style.border="3px solid transparent";h.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,g,f,l,q,k,u,v,w){if(null!=c&&"image/"==g.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+
|
||||
this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,q,k),c)],c[0].vertex=!0,F(c,new mxRectangle(0,0,q,k),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 t=!1,m=mxUtils.bind(this,function(c,g){if(null!=c&&"text/xml"==g){var f=mxUtils.parseXml(c);if("mxlibrary"==f.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(f.documentElement));e(l,h);a=a.concat(l);E(b);
|
||||
this.spinner.stop();t=!0}catch(R){}else if("mxfile"==f.documentElement.nodeName)try{for(var q=f.documentElement.getElementsByTagName("diagram"),f=0;f<q.length;f++){var l=mxUtils.getTextContent(q[f]),k=this.stringToCells(this.editor.graph.decompress(l)),u=this.editor.graph.getBoundingBoxFromGeometry(k);F(k,new mxRectangle(0,0,u.width,u.height),b)}t=!0}catch(R){null!=window.console&&console.log("error in drop handler:",R)}}t||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
||||
null!=d&&null!=d.parentNode&&0<a.length&&(d.parentNode.removeChild(d),d=null)});null!=w&&null!=u&&(/(\.vsdx?)($|\?)/i.test(u)||/(\.vssx?)($|\?)/i.test(u))?this.importVisio(w,function(b){m(b,"text/xml")},null,u):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,u)&&null!=w?this.parseFile(w,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,g)}}));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(h,"dragleave",function(b){null!=d?d.style.border="3px dotted lightGray":(h.style.border="3px solid transparent",h.style.cursor="");b.stopPropagation();b.preventDefault()}));v=v.cloneNode(!1);v.setAttribute("src",Editor.editImage);v.setAttribute("title",mxResources.get("edit"));g.insertBefore(v,g.firstChild);mxEvent.addListener(v,"click",I);mxEvent.addListener(h,
|
||||
"dblclick",function(b){mxEvent.getSource(b)==h&&I(b)});c=v.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));g.insertBefore(c,g.firstChild);mxEvent.addListener(c,"click",A);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)})),g.insertBefore(c,g.firstChild))}k.appendChild(g);k.style.paddingRight=18*g.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");
|
||||
if(null!=b){b.style.visibility="visible";var a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("hide"));b.appendChild(a);mxClient.IS_QUIRKS&&(a.style.position="relative",a.style.styleFloat="right",a.style.top="-30px",a.style.left="164px",a.style.cursor="pointer");mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return b});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=
|
||||
|
@ -7386,15 +7385,15 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM
|
|||
b.style.position="absolute";b.style.overflow="hidden";b.style.borderWidth="3px";var a=document.createElement("a");a.setAttribute("href","javascript:void(0);");a.className="geTitle";a.style.height="100%";a.style.paddingTop="9px";mxUtils.write(a,mxResources.get("moreShapes")+"...");mxEvent.addListener(a,"click",mxUtils.bind(this,function(b){this.actions.get("shapes").funct();mxEvent.consume(b)}));b.appendChild(a);return b};EditorUi.prototype.handleError=function(b,a,c){var f=null!=this.spinner&&null!=
|
||||
this.spinner.pause?this.spinner.pause():function(){},d=null!=b&&null!=b.error?b.error:b;if(null!=d||null!=a){b=mxUtils.htmlEntities(mxResources.get("unknownError"));var e=mxResources.get("ok"),l=null;a=null!=a?a:mxResources.get("error");if(null!=d)if(null!=d.retry&&(e=mxResources.get("cancel"),l=function(){f();d.retry()}),"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&d.type==gapi.drive.realtime.ErrorType.FORBIDDEN)b=mxUtils.htmlEntities(mxResources.get("forbidden"));
|
||||
else if(404==d.code||404==d.status||"undefined"!=typeof gapi&&"undefined"!=typeof gapi.drive&&"undefined"!=typeof gapi.drive.realtime&&d.type==gapi.drive.realtime.ErrorType.NOT_FOUND){b=mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var h=window.location.hash;null!=h&&"#G"==h.substring(0,2)&&(h=h.substring(2),b+=' <a href="https://drive.google.com/open?id='+h+'" target="_blank">'+mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else null!=d.message?b=mxUtils.htmlEntities(d.message):
|
||||
null!=d.response&&null!=d.response.error?b=mxUtils.htmlEntities(d.response.error):"undefined"!==window.App&&(d.code==App.ERROR_TIMEOUT?b=mxUtils.htmlEntities(mxResources.get("timeout")):d.code==App.ERROR_BUSY&&(b=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(a,b,e,c,l)}else null!=c&&c()};EditorUi.prototype.showError=function(b,a,c,d,e,h,k,m,n,g,w,E){b=new ErrorDialog(this,b,a,c||mxResources.get("ok"),d,e,h,k,E,m,n);this.showDialog(b.container,g||340,w||150,!0,!1);b.init()};EditorUi.prototype.alert=
|
||||
null!=d.response&&null!=d.response.error?b=mxUtils.htmlEntities(d.response.error):"undefined"!==window.App&&(d.code==App.ERROR_TIMEOUT?b=mxUtils.htmlEntities(mxResources.get("timeout")):d.code==App.ERROR_BUSY&&(b=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(a,b,e,c,l)}else null!=c&&c()};EditorUi.prototype.showError=function(b,a,c,d,e,h,k,m,n,g,v,D){b=new ErrorDialog(this,b,a,c||mxResources.get("ok"),d,e,h,k,D,m,n);this.showDialog(b.container,g||340,v||150,!0,!1);b.init()};EditorUi.prototype.alert=
|
||||
function(b,a){var c=new ErrorDialog(this,null,b,mxResources.get("ok"),a);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(b,a,c,d,e){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,b,function(){f();null!=a&&a()},function(){f();null!=c&&c()},d,e)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(b){this.currentFile=b};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(b){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(b)))};EditorUi.prototype.createImageDataUri=function(b,a,c){var f=b.toDataURL("image/"+c);if(6>=f.length||f==b.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=a&&(f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(this.editor.graph.compress(a))));
|
||||
return f};EditorUi.prototype.saveCanvas=function(b,a,c){var f="jpeg"==c?"jpg":c,d=this.getBaseFilename()+"."+f;b=this.createImageDataUri(b,a,c);this.saveData(d,f,b.substring(b.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};
|
||||
EditorUi.prototype.doSaveLocalFile=function(b,a,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)b=d?this.base64ToBlob(b,c):new Blob([b],{type:c}),navigator.msSaveOrOpenBlob(b,a);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(b,!0):(c.document.write(b),c.document.close(),c.document.execCommand("SaveAs",!0,a),c.close());else if(mxClient.IS_IOS)a=new TextareaDialog(this,a+":",b,null,null,mxResources.get("close")),a.textarea.style.width="600px",a.textarea.style.height=
|
||||
"380px",this.showDialog(a.container,620,460,!0,!0),a.init(),document.execCommand("selectall",!1,null);else{var f=document.createElement("a"),l=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var h=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),l=65==(h?parseInt(h[2],10):!1)?!1:l;if(l||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(b,c):new Blob([b],{type:c}));l?f.download=a:f.setAttribute("target","_blank");document.body.appendChild(f);
|
||||
try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(B){}}else this.createEchoRequest(b,a,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(b,a,c,d,e,h){b="xml="+encodeURIComponent(b);return new mxXmlRequest(SAVE_URL,b+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=h?"&base64="+h:"")+(null!=a?"&filename="+encodeURIComponent(a):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(b,a){a=
|
||||
a||"";for(var c=atob(b),f=c.length,d=Math.ceil(f/1024),e=Array(d),h=0;h<d;++h){for(var k=1024*h,m=Math.min(k+1024,f),g=Array(m-k),w=0;k<m;++w,++k)g[w]=c[k].charCodeAt(0);e[h]=new Uint8Array(g)}return new Blob(e,{type:a})};EditorUi.prototype.saveLocalFile=function(b,a,c,d,e,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(h);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||
|
||||
"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(b,!0):(g.document.write(mxUtils.htmlEntities(b,!1)),g.document.close())}else this.openInNewWindow(b,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(b,a,c,d):null!=a&&0<a.length&&this.pickFolder(f,mxUtils.bind(this,function(g){try{this.exportFile(b,a,c,d,f,g)}catch(E){this.handleError(E)}}))}catch(w){this.handleError(w)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
||||
a||"";for(var c=atob(b),f=c.length,d=Math.ceil(f/1024),e=Array(d),h=0;h<d;++h){for(var k=1024*h,m=Math.min(k+1024,f),g=Array(m-k),v=0;k<m;++v,++k)g[v]=c[k].charCodeAt(0);e[h]=new Uint8Array(g)}return new Blob(e,{type:a})};EditorUi.prototype.saveLocalFile=function(b,a,c,d,e,h,k){h=null!=h?h:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(h);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||
|
||||
"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var g=window.open("about:blank");null==g?mxUtils.popup(b,!0):(g.document.write(mxUtils.htmlEntities(b,!1)),g.document.close())}else this.openInNewWindow(b,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(b,a,c,d):null!=a&&0<a.length&&this.pickFolder(f,mxUtils.bind(this,function(g){try{this.exportFile(b,a,c,d,f,g)}catch(D){this.handleError(D)}}))}catch(v){this.handleError(v)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
|
||||
mxResources.get("download"),!1,h,k,null,1<e,4<e&&(!h||6>e)?3:4,b,c,d);this.showDialog(a.container,420,e==(mxClient.IS_IOS?0:1)?160:4<e?390:270,!0,!0);a.init()};EditorUi.prototype.openInNewWindow=function(b,a,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var f=window.open("about:blank");null==f?mxUtils.popup(b,!0):("image/svg+xml"==a?f.document.write("<html>"+b+"</html>"):f.document.write('<html><img src="data:'+a+(c?";base64,"+b:";charset=utf8,"+encodeURIComponent(b))+
|
||||
'"/></html>'),f.document.close())}else f=window.open("data:"+a+(c?";base64,"+b:";charset=utf8,"+encodeURIComponent(b))),null==f&&mxUtils.popup(b,!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(b){if(this.isExportToCanvas()){this.exportDialog=null;var a=b(mxUtils.bind(this,function(b){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
|
||||
this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div");var f=a.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=
|
||||
|
@ -7415,14 +7414,14 @@ f.style.width="100px";f.style.marginLeft="8px";f.style.marginRight="10px";f.clas
|
|||
(d=document.createElement("option"),d.setAttribute("value","frame"),mxUtils.write(d,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),f.appendChild(d));b.appendChild(f);mxUtils.write(b,mxResources.get("borderColor")+":");var e="#0000ff",h=null,h=mxUtils.button("",mxUtils.bind(this,function(b){this.pickColor(e||"none",function(b){e=b;c()});mxEvent.consume(b)}));c();h.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";h.style.marginLeft="4px";h.style.height="22px";h.style.width=
|
||||
"22px";h.style.position="relative";h.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";h.className="geColorBtn";b.appendChild(h);mxUtils.br(b);return{getColor:function(){return e},getTarget:function(){return f.value},focus:function(){f.focus()}}};EditorUi.prototype.createLink=function(b,a,c,d,e,h,k,m){var f=this.getCurrentFile(),g=[];d&&(g.push("lightbox=1"),"auto"!=b&&g.push("target="+b),null!=a&&a!=mxConstants.NONE&&g.push("highlight="+("#"==a.charAt(0)?a.substring(1):a)),
|
||||
null!=e&&0<e.length&&g.push("edit="+encodeURIComponent(e)),h&&g.push("layers=1"),this.editor.graph.foldingEnabled&&g.push("nav=1"));if(c&&null!=this.pages&&null!=this.currentPage)for(b=0;b<this.pages.length;b++)if(this.pages[b]==this.currentPage){0<b&&g.push("page="+b);break}b=!0;null!=k?c="#U"+encodeURIComponent(k):(f=this.getCurrentFile(),m||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):
|
||||
(c="#"+f.getHash(),b=!1));b&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&g.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<g.length?"?"+g.join("&"):"")+c};EditorUi.prototype.createHtml=function(b,a,c,d,e,h,k,m,n,g,w){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);
|
||||
(c="#"+f.getHash(),b=!1));b&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&g.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<g.length?"?"+g.join("&"):"")+c};EditorUi.prototype.createHtml=function(b,a,c,d,e,h,k,m,n,g,v){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);
|
||||
n||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];k&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));a&&(c.push("zoom"),f.resize=!0);m&&c.push("layers");0<c.length&&(n&&c.push("lightbox"),f.toolbar=c.join(" "));null!=g&&0<g.length&&(f.edit=g);null!=b?f.url=b:f.xml=this.getFileData(!0,null,null,null,null,!k);a='<div class="mxgraph" style="'+(h?"max-width:100%;":
|
||||
"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';b=null!=b?"&fetch="+encodeURIComponent(b):"";w(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 f=document.createElement("div");
|
||||
"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></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 f=document.createElement("div");
|
||||
f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("html"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(e);var h=document.createElement("div");h.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");e=l.cloneNode(!0);e.setAttribute("value","copy");h.appendChild(e);var k=document.createElement("span");mxUtils.write(k,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(k);mxUtils.br(h);h.appendChild(l);k=document.createElement("span");mxUtils.write(k,mxResources.get("publicDiagramUrl"));h.appendChild(k);var g=this.getCurrentFile();null==c&&null!=g&&g.constructor==window.DriveFile&&(k=document.createElement("a"),k.style.paddingLeft="12px",k.style.color="gray",k.setAttribute("href",
|
||||
"javascript:void(0);"),mxUtils.write(k,mxResources.get("share")),h.appendChild(k),mxEvent.addListener(k,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(g.getId())})));e.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");f.appendChild(h);var q=this.addLinkSection(f),m=this.addCheckbox(f,mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";
|
||||
n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value="100%";f.appendChild(n);var p=this.addCheckbox(f,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,I=I=this.addCheckbox(f,mxResources.get("allPages"),h,!h),D=this.addCheckbox(f,mxResources.get("layers"),!0),F=this.addCheckbox(f,mxResources.get("lightbox"),!0),A=this.addEditButton(f,F),z=A.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?z.removeAttribute("disabled"):
|
||||
z.setAttribute("disabled","disabled");z.checked&&F.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){d(l.checked?c:null,m.checked,n.value,q.getTarget(),q.getColor(),p.checked,I.checked,D.checked,F.checked,A.getLink())}),null,b,a);this.showDialog(b.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,e,h){var f=document.createElement("div");f.style.whiteSpace=
|
||||
n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value="100%";f.appendChild(n);var p=this.addCheckbox(f,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,I=I=this.addCheckbox(f,mxResources.get("allPages"),h,!h),E=this.addCheckbox(f,mxResources.get("layers"),!0),F=this.addCheckbox(f,mxResources.get("lightbox"),!0),A=this.addEditButton(f,F),z=A.getEditInput();z.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?z.removeAttribute("disabled"):
|
||||
z.setAttribute("disabled","disabled");z.checked&&F.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){d(l.checked?c:null,m.checked,n.value,q.getTarget(),q.getColor(),p.checked,I.checked,E.checked,F.checked,A.getLink())}),null,b,a);this.showDialog(b.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(b,a,c,d,e,h){var f=document.createElement("div");f.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";f.appendChild(l);var k=this.getCurrentFile(),l="https://desk.draw.io/support/solutions/articles/16000051941";b=0;if(null!=k&&k.constructor==window.DriveFile&&!a){b=80;var l="https://desk.draw.io/support/solutions/articles/16000039384",g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";
|
||||
var q=document.createElement("div");q.style.whiteSpace="normal";mxUtils.write(q,mxResources.get("linkAccountRequired"));g.appendChild(q);q=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));q.style.marginTop="12px";q.className="geBtn";g.appendChild(q);f.appendChild(g);q=document.createElement("a");q.style.paddingLeft="12px";q.style.color="gray";q.style.fontSize="11px";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("check"));
|
||||
g.appendChild(q);mxEvent.addListener(q,"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 m=null,n=null;if(null!=c||null!=d)b+=30,mxUtils.write(f,mxResources.get("width")+":"),m=document.createElement("input"),
|
||||
|
@ -7432,13 +7431,13 @@ if(null==k||k.constructor!=window.DriveFile||a)t=this.addCheckbox(f,mxResources.
|
|||
document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(b,a,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(e);var h=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),l=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),
|
||||
!0),e=this.editor.graph,k=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=k&&(k.style.marginBottom="16px");b=new CustomDialog(this,f,mxUtils.bind(this,function(){c(!h.checked,null!=l?l.checked:!1,null!=k?k.checked:!1)}),null,b,a);this.showDialog(b.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(b,a,c,d,e,h,k,m){k=null!=k?k:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var g=
|
||||
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";f.appendChild(q);mxUtils.write(f,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";f.appendChild(n);mxUtils.write(f,mxResources.get("borderWidth")+":");
|
||||
var v=document.createElement("input");v.setAttribute("type","text");v.style.marginRight="16px";v.style.width="60px";v.style.marginLeft="4px";v.value=this.lastExportBorder||"0";f.appendChild(v);mxUtils.br(f);var u=this.addCheckbox(f,mxResources.get("transparentBackground"),g.background==mxConstants.NONE||null==g.background,null,null,"jpeg"!=m),t=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),p=document.createElement("input");p.style.marginTop="16px";p.style.marginRight=
|
||||
var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";f.appendChild(u);mxUtils.br(f);var w=this.addCheckbox(f,mxResources.get("transparentBackground"),g.background==mxConstants.NONE||null==g.background,null,null,"jpeg"!=m),t=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,g.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");h&&(f.appendChild(p),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),l+=26,mxEvent.addListener(t,"change",function(){t.checked?p.removeAttribute("disabled"):p.setAttribute("disabled","disabled")}));g.isSelectionEmpty()||(p.setAttribute("checked","checked"),p.defaultChecked=!0);var y=this.addCheckbox(f,mxResources.get("shadow"),g.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");a&&(f.appendChild(z),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),l+=26);var G=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=m),J=null!=this.pages&&1<this.pages.length,H=this.addCheckbox(f,J?mxResources.get("allPages"):"",J,!J,null,"jpeg"!=m);H.style.marginLeft="24px";H.style.marginBottom="16px";J||(H.style.visibility=
|
||||
"hidden");mxEvent.addListener(G,"change",function(){G.checked&&J?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});k&&J||H.setAttribute("disabled","disabled");b=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=v.value;this.lastExportZoom=n.value;e(n.value,u.checked,!t.checked,y.checked,G.checked,z.checked,v.value,p.checked,!H.checked)}),null,c,d);this.showDialog(b.container,340,l,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
||||
"hidden");mxEvent.addListener(G,"change",function(){G.checked&&J?H.removeAttribute("disabled"):H.setAttribute("disabled","disabled")});k&&J||H.setAttribute("disabled","disabled");b=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=n.value;e(n.value,w.checked,!t.checked,y.checked,G.checked,z.checked,u.value,p.checked,!H.checked)}),null,c,d);this.showDialog(b.container,340,l,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||
|
||||
mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(b,a,c,d,e){var f=document.createElement("div");f.style.whiteSpace="nowrap";var h=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";f.appendChild(l)}var k=this.addCheckbox(f,mxResources.get("fit"),!0),g=this.addCheckbox(f,mxResources.get("shadow"),h.shadowVisible&&d,
|
||||
!d),q=this.addCheckbox(f,c),m=this.addCheckbox(f,mxResources.get("lightbox"),!0),n=this.addEditButton(f,m),u=n.getEditInput(),p=1<h.model.getChildCount(h.model.getRoot()),D=this.addCheckbox(f,mxResources.get("layers"),p,!p);D.style.marginLeft=u.style.marginLeft;D.style.marginBottom="12px";D.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(p&&D.removeAttribute("disabled"),u.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));
|
||||
u.checked&&m.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){b(k.checked,g.checked,q.checked,m.checked,n.getLink(),D.checked)}),null,mxResources.get("embed"),e);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,e,h,k,m){function f(a){var f=" ",l="";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"+
|
||||
!d),q=this.addCheckbox(f,c),m=this.addCheckbox(f,mxResources.get("lightbox"),!0),n=this.addEditButton(f,m),u=n.getEditInput(),p=1<h.model.getChildCount(h.model.getRoot()),E=this.addCheckbox(f,mxResources.get("layers"),p,!p);E.style.marginLeft=u.style.marginLeft;E.style.marginBottom="12px";E.style.marginTop="8px";mxEvent.addListener(m,"change",function(){m.checked?(p&&E.removeAttribute("disabled"),u.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"));
|
||||
u.checked&&m.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){b(k.checked,g.checked,q.checked,m.checked,n.getLink(),E.checked)}),null,mxResources.get("embed"),e);this.showDialog(a.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(b,a,c,d,e,h,k,m){function f(a){var f=" ",l="";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"+
|
||||
(e?"&edit=_blank":"")+(h?"&layers=1":"")+"');}})(this);\"",l+="cursor:pointer;");b&&(l+="max-width:100%;");var q="";c&&(q=' width="'+Math.round(g.width)+'" height="'+Math.round(g.height)+'"');k('<img src="'+a+'"'+q+(""!=l?' style="'+l+'"':"")+f+"/>")}var g=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");f(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),g.width*g.height<=MAX_AREA&&a.length<=MAX_REQUEST_SIZE){var l="";c&&(l="&w="+Math.round(2*g.width)+"&h="+Math.round(2*g.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()?f("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,e,h,k){var f=this.editor.graph.getSvg(),l=f.getElementsByTagName("a");if(null!=l)for(var g=0;g<l.length;g++){var q=l[g].getAttribute("href");null!=q&&"#"==q.charAt(0)&&"_blank"==l[g].getAttribute("target")&&l[g].removeAttribute("target")}d&&f.setAttribute("content",this.getFileData(!0));a&&this.editor.graph.addSvgShadow(f);if(c){var m=" ",n="";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"+
|
||||
|
@ -7450,103 +7449,103 @@ this.editor.graph;try{this.editor.graph=a,this.editor.setGraphXml(b)}catch(t){}f
|
|||
e=f.getGlobalVariable,h=this.pages[0];f.getGlobalVariable=function(b){return"page"==b?h.getName():"pagenumber"==b?1:e.apply(this,arguments)};document.body.appendChild(f.container);f.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==d&&(d=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(d)));b(e.substring(e.lastIndexOf(",")+1));f!=this.editor.graph&&f.container.parentNode.removeChild(f.container)}catch(g){null!=
|
||||
a&&a(g)}}),null,null,null,mxUtils.bind(this,function(b){null!=a&&a(b)}),null,null,null,null,f.shadowVisible,null,f)};EditorUi.prototype.getEmbeddedSvg=function(b,a,c,d,e,h,k){k=a.background;k==mxConstants.NONE&&(k=null);a=a.getSvg(k,null,null,null,null,h);null!=b&&a.setAttribute("content",b);null!=c&&a.setAttribute("resource",c);if(null!=e)this.convertImages(a,mxUtils.bind(this,function(b){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(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,e,h,k,m,n){n=null!=n?n:"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(b){this.spinner.stop();
|
||||
try{this.saveCanvas(b,e?this.getFileData(!0,null,null,null,c,m):null,n)}catch(E){"Invalid image"==E.message?this.downloadFile(n):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}),null,c,b||1,a,d,null,null,h,k)}catch(w){this.spinner.stop(),this.handleError(w)}}};EditorUi.prototype.loadFonts=function(b){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var a=function(b){return b.replace(RegExp("^[\\s\"']+","g"),
|
||||
try{this.saveCanvas(b,e?this.getFileData(!0,null,null,null,c,m):null,n)}catch(D){"Invalid image"==D.message?this.downloadFile(n):this.handleError(D)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}),null,c,b||1,a,d,null,null,h,k)}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,e={},h=mxUtils.bind(this,function(){if(0==d){for(var f=[c[0]],g=1;g<c.length;g++){var h=c[g].indexOf(")");f.push('url("');f.push(e[a(c[g].substring(0,h))]);f.push('"'+c[g].substring(h))}this.editor.resolvedFontCss=f.join("");b()}});if(0<c.length)for(var k=1;k<c.length;k++){var m=c[k].indexOf(")"),n=null,g=c[k].indexOf("format(",m);0<g&&(n=a(c[k].substring(g+7,c[k].indexOf(")",g))));mxUtils.bind(this,function(b){if(null==
|
||||
e[b]){e[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){e[b]=a;d--;h()}),mxUtils.bind(this,function(b){d--;h()}),!0,null,"data:"+a+";charset=utf-8;base64,")}})(a(c[k].substring(0,m)),n)}}else b()};EditorUi.prototype.exportToCanvas=function(b,a,c,d,e,h,k,m,n,g,w,p,C,x){h=null!=h?h:!0;p=null!=p?p:this.editor.graph;C=null!=C?C:0;var f=n?null:p.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==n&&
|
||||
b;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(b));this.loadUrl(c,mxUtils.bind(this,function(a){e[b]=a;d--;h()}),mxUtils.bind(this,function(b){d--;h()}),!0,null,"data:"+a+";charset=utf-8;base64,")}})(a(c[k].substring(0,m)),n)}}else b()};EditorUi.prototype.exportToCanvas=function(b,a,c,d,e,h,k,m,n,g,v,p,C,x){h=null!=h?h:!0;p=null!=p?p:this.editor.graph;C=null!=C?C:0;var f=n?null:p.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==n&&
|
||||
(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(p.getSvg(f,null,null,x,null,null!=k?k:!0),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var g=document.createElement("canvas"),l=parseInt(c.getAttribute("width")),k=parseInt(c.getAttribute("height"));m=null!=m?m:1;null!=a&&(m=h?Math.min(1,Math.min(3*a/(4*k),a/l)):a/l);l=Math.ceil(m*l)+2*C;k=Math.ceil(m*k)+2*C;g.setAttribute("width",l);g.setAttribute("height",k);var q=g.getContext("2d");null!=
|
||||
f&&(q.beginPath(),q.rect(0,0,l,k),q.fillStyle=f,q.fill());q.scale(m,m);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(d,C/m,C/m);b(g)},0):(q.drawImage(d,C/m,C/m),b(g))}catch(L){null!=e&&e(L)}});d.onerror=function(b){null!=e&&e(b)};try{g&&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(z){null!=e&&e(z)}}),c,w)};EditorUi.prototype.createImageUrlConverter=function(){var b=new mxUrlConverter;b.updateBaseUrl();var a=b.convert,c=this;b.convert=function(f){if(null!=f){var d="http://"==f.substring(0,7)||"https://"==f.substring(0,8);d&&!navigator.onLine?f=c.svgBrokenImage.src:!d||f.substring(0,b.baseUrl.length)==b.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"!=
|
||||
c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(l)}catch(z){null!=e&&e(z)}}),c,v)};EditorUi.prototype.createImageUrlConverter=function(){var b=new mxUrlConverter;b.updateBaseUrl();var a=b.convert,c=this;b.convert=function(f){if(null!=f){var d="http://"==f.substring(0,7)||"https://"==f.substring(0,8);d&&!navigator.onLine?f=c.svgBrokenImage.src:!d||f.substring(0,b.baseUrl.length)==b.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"!=
|
||||
f.substring(0,19)&&(f=a.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return b};EditorUi.prototype.convertImages=function(b,a,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,e=c||{};c=mxUtils.bind(this,function(c,h){for(var l=b.getElementsByTagName(c),g=0;g<l.length;g++)mxUtils.bind(this,function(c){var g=d.convert(c.getAttribute(h));if(null!=g&&"data:"!=g.substring(0,5)){var l=e[g];null==l?(f++,this.convertImageToDataUri(g,function(d){null!=d&&(e[g]=d,c.setAttribute(h,
|
||||
d));f--;0==f&&a(b)})):c.setAttribute(h,l)}else null!=g&&c.setAttribute(h,g)})(l[g])});c("image","xlink:href");c("img","src");0==f&&a(b)};EditorUi.prototype.loadUrl=function(b,a,c,d,e,h){try{var f=d||/(\.png)($|\?)/i.test(b)||/(\.jpe?g)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b);e=null!=e?e:!0;var l=mxUtils.bind(this,function(){mxUtils.get(b,mxUtils.bind(this,function(b){if(200<=b.getStatus()&&299>=b.getStatus()){if(null!=a){var g=b.getText();if(f){if((9==document.documentMode||10==document.documentMode)&&
|
||||
"undefined"!==typeof window.mxUtilsBinaryToArray){b=mxUtilsBinaryToArray(b.request.responseBody).toArray();for(var g=Array(b.length),d=0;d<b.length;d++)g[d]=String.fromCharCode(b[d]);g=g.join("")}h=null!=h?h:"data:image/png;base64,";g=h+this.base64Encode(g)}a(g)}}else null!=c&&c({code:App.ERROR_UNKNOWN},b)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},f,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:l})})});l()}catch(B){null!=c&&c(B)}};EditorUi.prototype.isCorsEnabledForUrl=
|
||||
function(b){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(b)||"https://raw.githubusercontent.com/"===b.substring(0,34)||"https://cdn.rawgit.com/"===b.substring(0,23)||"https://rawgit.com/"===b.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(b)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(b)||/^https?:\/\/[^\/]*\.github\.io\//.test(b)};EditorUi.prototype.convertImageToDataUri=
|
||||
function(b,a){if(/(\.svg)$/i.test(b))mxUtils.get(b,mxUtils.bind(this,function(b){a(this.createSvgDataUri(b.getText()))}),function(){a(this.svgBrokenImage.src)});else{var c=new Image,f=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var b=document.createElement("canvas"),d=b.getContext("2d");b.height=c.height;b.width=c.width;d.drawImage(c,0,0);try{a(b.toDataURL())}catch(v){a(f.svgBrokenImage.src)}};c.onerror=function(){a(f.svgBrokenImage.src)};c.src=b}};EditorUi.prototype.importXml=
|
||||
function(b,a){if(/(\.svg)$/i.test(b))mxUtils.get(b,mxUtils.bind(this,function(b){a(this.createSvgDataUri(b.getText()))}),function(){a(this.svgBrokenImage.src)});else{var c=new Image,f=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var b=document.createElement("canvas"),d=b.getContext("2d");b.height=c.height;b.width=c.width;d.drawImage(c,0,0);try{a(b.toDataURL())}catch(w){a(f.svgBrokenImage.src)}};c.onerror=function(){a(f.svgBrokenImage.src)};c.src=b}};EditorUi.prototype.importXml=
|
||||
function(b,a,c,d,e){a=null!=a?a:0;c=null!=c?c:0;var f=[];try{var h=this.editor.graph;if(null!=b&&0<b.length){var l=mxUtils.parseXml(b),k=this.editor.extractGraphModel(l.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var g=k.getElementsByTagName("diagram");if(1==g.length)k=mxUtils.parseXml(h.decompress(mxUtils.getTextContent(g[0]))).documentElement;else if(1<g.length){h.model.beginUpdate();try{for(b=0;b<g.length;b++){g[b].removeAttribute("id");var m=this.updatePageRoot(new DiagramPage(g[b])),
|
||||
q=this.pages.length;null==m.getName()&&m.setName(mxResources.get("pageWithNumber",[q+1]));h.model.execute(new ChangePage(this,m,m,q))}}finally{h.model.endUpdate()}}}null!=k&&"mxGraphModel"===k.nodeName&&(f=h.importGraphModel(k,a,c,d))}}catch(C){throw e||this.handleError(C,mxResources.get("invalidOrMissingFile")),C;}return f};EditorUi.prototype.isRemoteVisioFormat=function(b){return/(\.vsd)($|\?)/i.test(b)||/(\.vss)($|\?)/i.test(b)};EditorUi.prototype.importVisio=function(b,a,c,d){d=null!=d?d:b.name;
|
||||
c=null!=c?c:mxUtils.bind(this,function(b){this.handleError(b)});var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(this.isRemoteVisioFormat(d)&&null!=VSD_CONVERT_URL){var f=new FormData;f.append("file1",b,d);var e=new XMLHttpRequest;e.open("POST",VSD_CONVERT_URL);e.responseType="blob";e.onreadystatechange=mxUtils.bind(this,function(){if(4==e.readyState)if(200<=e.status&&299>=e.status)try{e.response.name=d,this.doImportVisio(e.response,a,c)}catch(y){c(y)}else c({})});
|
||||
e.send(f)}else try{this.doImportVisio(b,a,c)}catch(y){c(y)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.exportVisio=function(){var b=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()}catch(f){this.handleError(f)}});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?b():(this.loadingExtensions=
|
||||
!0,mxscript("js/extensions.min.js",b))};EditorUi.prototype.convertLucidChart=function(b,a,c){var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{a(LucidImporter.importState(JSON.parse(b)))}catch(u){c(u)}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||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.insertTextAt=function(b,a,c,d,e,h,k){h=null!=h?h:!0;k=null!=k?k:!0;if(null!=b)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b))this.parseFile(new Blob([b.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&200<=b.status&&299>=b.status&&this.editor.graph.setSelectionCells(this.insertTextAt(b.responseText,a,c,!0))}));else if("data:"==b.substring(0,
|
||||
5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b))){var f=this.editor.graph;if("data:image/png;base64,"==b.substring(0,22)){var l=this.extractGraphModelFromPng(b),g=this.importXml(l,a,c,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==b.substring(0,19))try{if(l=null,"data:image/svg+xml;base64,"==b.substring(0,26)?(l=b.substring(b.indexOf(",")+1),l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0)):l=decodeURIComponent(b.substring(b.indexOf(",")+1)),g=this.importXml(l,
|
||||
a,c,h,!0),0<g.length)return g}catch(w){}this.loadImage(b,mxUtils.bind(this,function(g){if("data:"==b.substring(0,5))this.resizeImage(g,b,mxUtils.bind(this,function(b,g,d){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(a),f.snap(c),g,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(b)+";"))}),k,this.maxImageSize);else{var d=Math.min(1,Math.min(this.maxImageSize/g.width,this.maxImageSize/g.height)),
|
||||
e=Math.round(g.width*d);g=Math.round(g.height*d);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(a),f.snap(c),e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b+";"))}}),mxUtils.bind(this,function(){var g=null;f.getModel().beginUpdate();try{g=f.insertVertex(f.getDefaultParent(),null,b,f.snap(a),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(g),f.fireEvent(new mxEventObject("textInserted","cells",[g]))}finally{f.getModel().endUpdate()}f.setSelectionCell(g)}))}else{b=
|
||||
this.editor.graph.zapGremlins(mxUtils.trim(b));if(this.isCompatibleString(b))return this.importXml(b,a,c,h);if(0<b.length)if(this.isLucidChartData(b))this.convertLucidChart(b,mxUtils.bind(this,function(b){this.editor.graph.setSelectionCells(this.importXml(b,a,c,h))}),mxUtils.bind(this,function(b){this.handleError(b)}));else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(a),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted",
|
||||
"cells",[e])),"<"==b.charAt(0)&&b.indexOf(">")==b.length-1&&(b=mxUtils.htmlEntities(b)),e.value=b,f.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(e.value)&&f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gridSize}finally{f.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=
|
||||
function(b){var a=-1;do b/=1024,a++;while(1024<b);return Math.max(b,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[a]};EditorUi.prototype.convertDataUri=function(b){if("data:"==b.substring(0,5)){var a=b.indexOf(";");0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1)))}return b};EditorUi.prototype.isRemoteFileFormat=function(b,a){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(b)};EditorUi.prototype.isLucidChartData=function(b){return null!=b&&'{"state":"{\\"Properties\\":'==
|
||||
b.substring(0,26)};EditorUi.prototype.importLocalFile=function(b,a){if(b&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!a){var f=Editor.useLocalStorage;Editor.useLocalStorage=!b}window.openFile=
|
||||
new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,a){if(null!=a&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(a)){var c=new Blob([b],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(b){this.importXml(b)}),null,a)}else this.editor.graph.setSelectionCells(this.importXml(b))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!a){var d=this.dialog,e=
|
||||
d.close;this.dialog.close=mxUtils.bind(this,function(b){Editor.useLocalStorage=f;e.apply(d,arguments);b&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(b,a,c,d,e,h,k,m,n,g,w){g=null!=g?g:!0;var f=!1,l=null,q=mxUtils.bind(this,function(b){var a=null;null!=b&&"<mxlibrary"==b.substring(0,10)?this.loadLibrary(new LocalLibrary(this,b,k)):a=this.importXml(b,c,d,g);null!=m&&m(a)});"image"==a.substring(0,5)?(n=!1,"image/png"==a.substring(0,
|
||||
9)&&(a=w?null:this.extractGraphModelFromPng(b),null!=a&&0<a.length&&(l=this.importXml(a,c,d,g),n=!0)),n||(l=this.editor.graph,a=b.indexOf(";"),0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1))),g&&l.isGridEnabled()&&(c=l.snap(c),d=l.snap(d)),l=[l.insertVertex(null,null,"",c,d,e,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b+";")])):/(\.*<graphml )/.test(b)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(b,
|
||||
mxUtils.bind(this,function(b){b=this.importXml(b,c,d,g);null!=m&&m(b)})):null!=n&&null!=k&&(/(\.vsdx?)($|\?)/i.test(k)||/(\.vssx?)($|\?)/i.test(k))?(f=!0,this.importVisio(n,q)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,k)?(f=!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))}),k)):/(\.vsd)($|\?)/i.test(k)||/(\.vss)($|\?)/i.test(k)||
|
||||
(l=this.insertTextAt(this.validateFileData(b),c,d,!0,null,g));f||null==m||m(l);return l};EditorUi.prototype.base64Encode=function(b){for(var a="",c=0,d=b.length,e,h,k;c<d;){e=b.charCodeAt(c++)&255;if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);a+="==";break}h=b.charCodeAt(c++);if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);
|
||||
a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);a+="=";break}k=b.charCodeAt(c++);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2|(k&192)>>6);a+=
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,e,h,k,m,n,g,w,p){a=null!=a?a:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;g=null!=g?g:this.maxImageBytes;var f=null!=a&&null!=c,l=!0,q=!1;if(!mxClient.IS_CHROMEAPP&&null!=b)for(var v=w||this.resampleThreshold,t=0;t<b.length;t++)if("image/"==b[t].type.substring(0,6)&&b[t].size>v){q=!0;break}var u=mxUtils.bind(this,function(){var n=this.editor.graph,q=n.gridSize;
|
||||
e=null!=e?e:mxUtils.bind(this,function(b,a,c,g,d,e,h,l,k){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,h)),null):this.importFile(b,a,c,g,d,e,h,l,k,f,p)});h=null!=h?h:mxUtils.bind(this,function(b){n.setSelectionCells(b)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var v=b.length,t=v,u=[],E=mxUtils.bind(this,function(b,a){u[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(u);else{var c=[];n.getModel().beginUpdate();
|
||||
try{for(var f=0;f<u.length;f++){var g=u[f]();null!=g&&(c=c.concat(g))}}finally{n.getModel().endUpdate()}}h(c)}}),y=0;y<v;y++)mxUtils.bind(this,function(f){var h=b[f],m=new FileReader;m.onload=mxUtils.bind(this,function(b){if(null==k||k(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var m=b.target.result,v=m.indexOf(","),t=decodeURIComponent(escape(atob(m.substring(v+1)))),u=mxUtils.parseXml(t),t=u.getElementsByTagName("svg");if(0<t.length){var t=t[0],z=p?null:t.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)?E(f,mxUtils.bind(this,function(){try{if(m.substring(0,v+1),null!=u){var b=u.getElementsByTagName("svg");if(0<b.length){var g=b[0],l=parseFloat(g.getAttribute("width")),k=parseFloat(g.getAttribute("height")),w=g.getAttribute("viewBox");if(null==w||0==w.length)g.setAttribute("viewBox",
|
||||
"0 0 "+l+" "+k);else if(isNaN(l)||isNaN(k)){var p=w.split(" ");3<p.length&&(l=parseFloat(p[2]),k=parseFloat(p[3]))}m=this.createSvgDataUri(mxUtils.getXml(g));var t=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,k)),E=e(m,h.type,a+f*q,c+f*q,Math.max(1,Math.round(l*t)),Math.max(1,Math.round(k*t)),h.name);if(isNaN(l)||isNaN(k)){var z=new Image;z.onload=mxUtils.bind(this,function(){l=Math.max(1,z.width);k=Math.max(1,z.height);E[0].geometry.width=l;E[0].geometry.height=k;g.setAttribute("viewBox","0 0 "+
|
||||
l+" "+k);m=this.createSvgDataUri(mxUtils.getXml(g));var b=m.indexOf(";");0<b&&(m=m.substring(0,b)+m.substring(m.indexOf(",",b+1)));n.setCellStyles("image",m,[E[0]])});z.src=this.createSvgDataUri(mxUtils.getXml(g))}return E}}}catch(ea){}return null})):E(f,mxUtils.bind(this,function(){return e(z,"text/xml",a+f*q,c+f*q,0,0,h.name)}))}}else{t=!1;if("image/png"==h.type){var y=p?null:this.extractGraphModelFromPng(b.target.result);if(null!=y&&0<y.length){var x=new Image;x.src=b.target.result;E(f,mxUtils.bind(this,
|
||||
function(){return e(y,"text/xml",a+f*q,c+f*q,x.width,x.height,h.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(k){this.resizeImage(k,b.target.result,mxUtils.bind(this,function(k,m,n){E(f,mxUtils.bind(this,
|
||||
function(){if(null!=k&&k.length<g){var p=l&&this.isResampleImage(b.target.result,w)?Math.min(1,Math.min(d/m,d/n)):1;return e(k,h.type,a+f*q,c+f*q,Math.round(m*p),Math.round(n*p),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,w)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(b.target.result,h.type,a+f*q,c+f*q,240,160,h.name,function(b){E(f,function(){return b})})});/(\.vsdx?)($|\?)/i.test(h.name)||
|
||||
/(\.vssx?)($|\?)/i.test(h.name)?e(null,h.type,a+f*q,c+f*q,240,160,h.name,function(b){E(f,function(){return b})},h):"image"==h.type.substring(0,5)?m.readAsDataURL(h):m.readAsText(h)})(y)});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(){},f=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(f,d){if(f||a)mxSettings.setResizeImages(f?
|
||||
f):mxscript("js/extensions.min.js",f))};EditorUi.prototype.insertAsPreText=function(b,a,c){var f=this.editor.graph,d=null;f.getModel().beginUpdate();try{d=f.insertVertex(null,null,"<pre>"+b+"</pre>",a,c,1,1,"text;html=1;align=center;verticalAlign=middle;"),f.updateCellSize(d,!0)}finally{f.getModel().endUpdate()}return d};EditorUi.prototype.insertTextAt=function(b,a,c,d,e,h,k){h=null!=h?h:!0;k=null!=k?k:!0;if(null!=b)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b))this.parseFile(new Blob([b.replace(/\s+/g,
|
||||
" ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){4==b.readyState&&200<=b.status&&299>=b.status&&this.editor.graph.setSelectionCells(this.insertTextAt(b.responseText,a,c,!0))}));else if("data:"==b.substring(0,5)||!this.isOffline()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(b))){var f=this.editor.graph;if("data:image/png;base64,"==b.substring(0,22)){var l=this.extractGraphModelFromPng(b),g=this.importXml(l,a,c,h,!0);if(0<g.length)return g}if("data:image/svg+xml;"==b.substring(0,
|
||||
19))try{if(l=null,"data:image/svg+xml;base64,"==b.substring(0,26)?(l=b.substring(b.indexOf(",")+1),l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0)):l=decodeURIComponent(b.substring(b.indexOf(",")+1)),g=this.importXml(l,a,c,h,!0),0<g.length)return g}catch(v){}this.loadImage(b,mxUtils.bind(this,function(g){if("data:"==b.substring(0,5))this.resizeImage(g,b,mxUtils.bind(this,function(b,g,d){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(a),f.snap(c),g,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
||||
this.convertDataUri(b)+";"))}),k,this.maxImageSize);else{var d=Math.min(1,Math.min(this.maxImageSize/g.width,this.maxImageSize/g.height)),e=Math.round(g.width*d);g=Math.round(g.height*d);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(a),f.snap(c),e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b+";"))}}),mxUtils.bind(this,function(){var g=null;f.getModel().beginUpdate();try{g=f.insertVertex(f.getDefaultParent(),
|
||||
null,b,f.snap(a),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(g),f.fireEvent(new mxEventObject("textInserted","cells",[g]))}finally{f.getModel().endUpdate()}f.setSelectionCell(g)}))}else{b=this.editor.graph.zapGremlins(mxUtils.trim(b));if(this.isCompatibleString(b))return this.importXml(b,a,c,h);if(0<b.length)if(this.isLucidChartData(b))this.convertLucidChart(b,mxUtils.bind(this,function(b){this.editor.graph.setSelectionCells(this.importXml(b,a,c,h))}),mxUtils.bind(this,function(b){this.handleError(b)}));
|
||||
else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(a),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted","cells",[e])),"<"==b.charAt(0)&&b.indexOf(">")==b.length-1&&(b=mxUtils.htmlEntities(b)),e.value=b,f.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(e.value)&&
|
||||
f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gridSize}finally{f.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=function(b){var a=-1;do b/=1024,a++;while(1024<b);return Math.max(b,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[a]};EditorUi.prototype.convertDataUri=function(b){if("data:"==b.substring(0,5)){var a=b.indexOf(";");0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1)))}return b};EditorUi.prototype.isRemoteFileFormat=
|
||||
function(b,a){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(b)};EditorUi.prototype.isLucidChartData=function(b){return null!=b&&'{"state":"{\\"Properties\\":'==b.substring(0,26)};EditorUi.prototype.importLocalFile=function(b,a){if(b&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&
|
||||
this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!a){var f=Editor.useLocalStorage;Editor.useLocalStorage=!b}window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));window.openFile.setConsumer(mxUtils.bind(this,function(b,a){if(null!=a&&Graph.fileSupport&&/(\.vsdx?)($|\?)/i.test(a)){var c=new Blob([b],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(b){this.importXml(b)}),null,
|
||||
a)}else this.editor.graph.setSelectionCells(this.importXml(b))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!a){var d=this.dialog,e=d.close;this.dialog.close=mxUtils.bind(this,function(b){Editor.useLocalStorage=f;e.apply(d,arguments);b&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(b,a,c,d,e,h,k,m,n,g,v){g=null!=g?g:!0;var f=!1,l=null,q=mxUtils.bind(this,function(b){var a=null;
|
||||
null!=b&&"<mxlibrary"==b.substring(0,10)?this.loadLibrary(new LocalLibrary(this,b,k)):a=this.importXml(b,c,d,g);null!=m&&m(a)});"image"==a.substring(0,5)?(n=!1,"image/png"==a.substring(0,9)&&(a=v?null:this.extractGraphModelFromPng(b),null!=a&&0<a.length&&(l=this.importXml(a,c,d,g),n=!0)),n||(l=this.editor.graph,a=b.indexOf(";"),0<a&&(b=b.substring(0,a)+b.substring(b.indexOf(",",a+1))),g&&l.isGridEnabled()&&(c=l.snap(c),d=l.snap(d)),l=[l.insertVertex(null,null,"",c,d,e,h,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
||||
b+";")])):/(\.*<graphml )/.test(b)&&"undefined"!==typeof window.mxGraphMlCodec?(new mxGraphMlCodec).decode(b,mxUtils.bind(this,function(b){b=this.importXml(b,c,d,g);null!=m&&m(b)})):null!=n&&null!=k&&(/(\.vsdx?)($|\?)/i.test(k)||/(\.vssx?)($|\?)/i.test(k))?(f=!0,this.importVisio(n,q)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,k)?(f=!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))}),k)):/(\.vsd)($|\?)/i.test(k)||/(\.vss)($|\?)/i.test(k)||(l=this.insertTextAt(this.validateFileData(b),c,d,!0,null,g));f||null==m||m(l);return l};EditorUi.prototype.base64Encode=function(b){for(var a="",c=0,d=b.length,e,h,k;c<d;){e=b.charCodeAt(c++)&255;if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);a+="==";break}h=b.charCodeAt(c++);
|
||||
if(c==d){a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&15)<<2);a+="=";break}k=b.charCodeAt(c++);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(h&240)>>4);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((h&
|
||||
15)<<2|(k&192)>>6);a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(k&63)}return a};EditorUi.prototype.importFiles=function(b,a,c,d,e,h,k,m,n,g,v,p){a=null!=a?a:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;g=null!=g?g:this.maxImageBytes;var f=null!=a&&null!=c,l=!0,q=!1;if(!mxClient.IS_CHROMEAPP&&null!=b)for(var u=v||this.resampleThreshold,t=0;t<b.length;t++)if("image/"==b[t].type.substring(0,6)&&b[t].size>u){q=!0;break}var w=mxUtils.bind(this,function(){var n=this.editor.graph,
|
||||
q=n.gridSize;e=null!=e?e:mxUtils.bind(this,function(b,a,c,g,d,e,h,l,k){return null!=b&&"<mxlibrary"==b.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,b,h)),null):this.importFile(b,a,c,g,d,e,h,l,k,f,p)});h=null!=h?h:mxUtils.bind(this,function(b){n.setSelectionCells(b)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var u=b.length,t=u,w=[],D=mxUtils.bind(this,function(b,a){w[b]=a;if(0==--t){this.spinner.stop();if(null!=m)m(w);else{var c=[];n.getModel().beginUpdate();
|
||||
try{for(var f=0;f<w.length;f++){var g=w[f]();null!=g&&(c=c.concat(g))}}finally{n.getModel().endUpdate()}}h(c)}}),y=0;y<u;y++)mxUtils.bind(this,function(f){var h=b[f],m=new FileReader;m.onload=mxUtils.bind(this,function(b){if(null==k||k(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var m=b.target.result,u=m.indexOf(","),t=decodeURIComponent(escape(atob(m.substring(u+1)))),w=mxUtils.parseXml(t),t=w.getElementsByTagName("svg");if(0<t.length){var t=t[0],z=p?null:t.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)?D(f,mxUtils.bind(this,function(){try{if(m.substring(0,u+1),null!=w){var b=w.getElementsByTagName("svg");if(0<b.length){var g=b[0],l=parseFloat(g.getAttribute("width")),k=parseFloat(g.getAttribute("height")),v=g.getAttribute("viewBox");if(null==v||0==v.length)g.setAttribute("viewBox",
|
||||
"0 0 "+l+" "+k);else if(isNaN(l)||isNaN(k)){var p=v.split(" ");3<p.length&&(l=parseFloat(p[2]),k=parseFloat(p[3]))}m=this.createSvgDataUri(mxUtils.getXml(g));var t=Math.min(1,Math.min(d/Math.max(1,l)),d/Math.max(1,k)),D=e(m,h.type,a+f*q,c+f*q,Math.max(1,Math.round(l*t)),Math.max(1,Math.round(k*t)),h.name);if(isNaN(l)||isNaN(k)){var z=new Image;z.onload=mxUtils.bind(this,function(){l=Math.max(1,z.width);k=Math.max(1,z.height);D[0].geometry.width=l;D[0].geometry.height=k;g.setAttribute("viewBox","0 0 "+
|
||||
l+" "+k);m=this.createSvgDataUri(mxUtils.getXml(g));var b=m.indexOf(";");0<b&&(m=m.substring(0,b)+m.substring(m.indexOf(",",b+1)));n.setCellStyles("image",m,[D[0]])});z.src=this.createSvgDataUri(mxUtils.getXml(g))}return D}}}catch(ea){}return null})):D(f,mxUtils.bind(this,function(){return e(z,"text/xml",a+f*q,c+f*q,0,0,h.name)}))}}else{t=!1;if("image/png"==h.type){var y=p?null:this.extractGraphModelFromPng(b.target.result);if(null!=y&&0<y.length){var x=new Image;x.src=b.target.result;D(f,mxUtils.bind(this,
|
||||
function(){return e(y,"text/xml",a+f*q,c+f*q,x.width,x.height,h.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(k){this.resizeImage(k,b.target.result,mxUtils.bind(this,function(k,m,n){D(f,mxUtils.bind(this,
|
||||
function(){if(null!=k&&k.length<g){var p=l&&this.isResampleImage(b.target.result,v)?Math.min(1,Math.min(d/m,d/n)):1;return e(k,h.type,a+f*q,c+f*q,Math.round(m*p),Math.round(n*p),h.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),l,d,v)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(b.target.result,h.type,a+f*q,c+f*q,240,160,h.name,function(b){D(f,function(){return b})})});/(\.vsdx?)($|\?)/i.test(h.name)||
|
||||
/(\.vssx?)($|\?)/i.test(h.name)?e(null,h.type,a+f*q,c+f*q,240,160,h.name,function(b){D(f,function(){return b})},h):"image"==h.type.substring(0,5)?m.readAsDataURL(h):m.readAsText(h)})(y)});q?this.confirmImageResize(function(b){l=b;w()},n):w()};EditorUi.prototype.confirmImageResize=function(b,a){a=null!=a?a:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,d=function(f,d){if(f||a)mxSettings.setResizeImages(f?
|
||||
d:null),mxSettings.save();c();b(d)};null==f||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,f)};EditorUi.prototype.parseFile=function(b,a,
|
||||
c){c=null!=c?c:b.name;var f=new FormData;f.append("format","xml");f.append("upfile",b,c);var d=new XMLHttpRequest;d.open("POST",OPEN_URL);d.onreadystatechange=function(){a(d)};d.send(f)};EditorUi.prototype.isResampleImage=function(b,a){a=null!=a?a:this.resampleThreshold;return b.length>a};EditorUi.prototype.resizeImage=function(b,a,c,d,e,h){e=null!=e?e:this.maxImageSize;var f=Math.max(1,b.width),l=Math.max(1,b.height);if(d&&this.isResampleImage(a,h))try{var k=Math.max(f/e,l/e);if(1<k){var g=Math.round(f/
|
||||
k),m=Math.round(l/k),n=document.createElement("canvas");n.width=g;n.height=m;n.getContext("2d").drawImage(b,0,0,g,m);var q=n.toDataURL();if(q.length<a.length){var p=document.createElement("canvas");p.width=g;p.height=m;var t=p.toDataURL();q!==t&&(a=q,f=g,l=m)}}}catch(D){}c(a,f,l)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,h=0;8>h;h++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var f=0;f<d;f++)b=EditorUi.prototype.crcTable[(b^
|
||||
k),m=Math.round(l/k),n=document.createElement("canvas");n.width=g;n.height=m;n.getContext("2d").drawImage(b,0,0,g,m);var q=n.toDataURL();if(q.length<a.length){var p=document.createElement("canvas");p.width=g;p.height=m;var t=p.toDataURL();q!==t&&(a=q,f=g,l=m)}}}catch(E){}c(a,f,l)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var c=d,h=0;8>h;h++)c=1==(c&1)?3988292384^c>>>1:c>>>1,EditorUi.prototype.crcTable[d]=c;EditorUi.prototype.updateCRC=function(b,a,c,d){for(var f=0;f<d;f++)b=EditorUi.prototype.crcTable[(b^
|
||||
a[c+f])&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,e){function f(b,a){var c=k;k+=a;return b.substring(c,k)}function h(b){b=f(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 k=0;if(f(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(b,4),"IHDR"!=f(b,4))null!=e&&e();else{f(b,17);e=b.substring(0,k);do{var g=h(b);if("IDAT"==f(b,4)){e=b.substring(0,k-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);e+=l(c.length)+a+c+l(d^4294967295);e+=b.substring(k-
|
||||
8,b.length);break}e+=b.substring(k-8,k-4+g);f(b,g);f(b,4)}while(g);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(b){var a=null;try{var c=b.substring(b.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(b,c,f){b=d.substring(b+8,b+8+f);"zTXt"==c?(f=b.indexOf(String.fromCharCode(0)),"mxGraphModel"==b.substring(0,f)&&(b=this.editor.graph.bytesToString(pako.inflateRaw(b.substring(f+
|
||||
2))).replace(/\+/g," "),null!=b&&0<b.length&&(a=b))):"tEXt"==c&&(b=b.split(String.fromCharCode(0)),1<b.length&&"mxGraphModel"==b[0]&&(a=b[1]));if(null!=a||"IDAT"==c)return!0}))}catch(u){}null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));null!=a&&"%"==a.charAt(0)&&(a=decodeURIComponent(a));return a};EditorUi.prototype.loadImage=function(b,a,c){var f=new Image;f.onload=function(){a(f)};null!=c&&(f.onerror=c);f.src=b};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=
|
||||
!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,a=this.editor.graph;a.getLinkTitle=function(a){return b.getLinkTitle(a)};a.customLinkClicked=function(a){var c=!1;try{b.handleCustomLink(a),c=!0}catch(z){b.handleError(z)}return c};var c=this.clearDefaultStyle;this.clearDefaultStyle=function(){c.apply(this,arguments);this.persistCurrentEdgeStyle||(mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle),mxSettings.save());
|
||||
this.persistCurrentVertexStyle||(mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle),mxSettings.save())};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<a.length?"&":"?")+
|
||||
"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=a.addClickHandler;a.addClickHandler=function(b,c,g){var f=c;c=function(b,c){if(null==c){var g=mxEvent.getSource(b);"a"==g.nodeName.toLowerCase()&&(c=g.getAttribute("href"))}null!=c&&a.isCustomLink(c)&&(mxEvent.isTouchEvent(b)||!mxEvent.isPopupTrigger(b))&&a.customLinkClicked(c)&&mxEvent.consume(b);null!=f&&f(b,c)};e.call(this,b,c,g)};k.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(a.view.canvas.ownerSVGElement,
|
||||
null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=a.getGlobalVariable;a.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var m=a.labelLinkClicked;a.labelLinkClicked=function(b,c,g){var f=
|
||||
c.getAttribute("href");if(null==f||!a.isCustomLink(f)||!mxEvent.isTouchEvent(g)&&mxEvent.isPopupTrigger(g))m.apply(this,arguments);else{if(!a.isEnabled()||null!=b&&a.isCellLocked(b.cell))a.customLinkClicked(f),a.getRubberband().reset();mxEvent.consume(g)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();
|
||||
if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){g.innerHTML=" ";g.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,
|
||||
"insertEllipse",!0);mxClient.IS_IE||a.container.addEventListener("paste",mxUtils.bind(this,function(b){var a=this.editor.graph;if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,g=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){g=!0;break}if(!g){var d=c.items;for(index in d){var e=d[index];if("file"===e.kind){if(a.isEditing())this.importFiles([e.getAsFile()],0,0,this.maxImageSize,function(b,c,g,f,d,e){a.insertImage(b,d,e)},function(){},function(b){return"image/"==
|
||||
b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([e.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(T){}}),!1);var g=document.createElement("div");g.style.position="absolute";g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.display="block";g.contentEditable=!0;mxUtils.setOpacity(g,0);g.style.width="1px";g.style.height="1px";g.innerHTML=" ";var w=!1;this.keyHandler.bindControlKey(88,
|
||||
null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(b){var c=mxEvent.getSource(b);null==a.container||!a.isEnabled()||a.isMouseDown||a.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==b.keyCode||!mxClient.IS_MAC&&17==b.keyCode||mxClient.IS_MAC&&91==b.keyCode)||w||(g.style.left=a.container.scrollLeft+10+"px",g.style.top=a.container.scrollTop+10+"px",a.container.appendChild(g),
|
||||
w=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){g.focus();document.execCommand("selectAll",!1,null)},0):(g.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(b){var c=b.keyCode;window.setTimeout(mxUtils.bind(this,function(){!w||224!=c&&17!=c&&91!=c||(w=!1,a.isEditing()||null!=this.dialog||null==a.container||a.container.focus(),g.parentNode.removeChild(g),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(g,
|
||||
"copy",mxUtils.bind(this,function(b){a.isEnabled()&&(mxClipboard.copy(a),this.copyCells(g),p())}));mxEvent.addListener(g,"cut",mxUtils.bind(this,function(b){a.isEnabled()&&(mxClipboard.copy(a),this.copyCells(g,!0),p())}));mxEvent.addListener(g,"paste",mxUtils.bind(this,function(b){a.isEnabled()&&!a.isCellLocked(a.getDefaultParent())&&(g.innerHTML=" ",g.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(b,g);g.innerHTML=" "}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=
|
||||
function(b){return mxEvent.getSource(b)==g?!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(b){var a=this.editor.graph,c=a.cellEditor.text2,g=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(b){null!=g&&(g.parentNode.removeChild(g),g=null);b.stopPropagation();b.preventDefault()}),
|
||||
mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==g&&(!mxClient.IS_IE||10<document.documentMode)&&(g=this.highlightElement(c));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=g&&(g.parentNode.removeChild(g),g=null);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,function(b,c,g,f,d,e){a.insertImage(b,d,e)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=
|
||||
0;a<b.length;a++)b[a]()},mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(b){var g=Math.max(1,b.width);b=Math.max(1,b.height);var f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,g)),f/Math.max(1,b));a.insertImage(decodeURIComponent(c),g*f,b*f)})):document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"))}else 0<=
|
||||
mxUtils.indexOf(b.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"));b.stopPropagation();b.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){n=document.createElement("div");n.style.position="absolute";n.style.top="95px";n.style.left="250px";n.style.width="2000px";n.style.height="30px";n.style.background=
|
||||
"whiteSmoke";document.body.appendChild(n);var C=document.createElement("div");C.style.position="absolute";C.style.top="125px";C.style.left="220px";C.style.width="30px";C.style.height="1000px";C.style.background="whiteSmoke";document.body.appendChild(C);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,
|
||||
C,!0);this.hRuler=new mxRuler(this.editor.graph,n,!1)}if("1"==urlParams.test){n=document.getElementById("geFooter");null!=n&&(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)})),n.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(b,a){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 I=this.isSelectionAllowed;
|
||||
this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:I.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var D=null;mxEvent.addListener(a.container,"dragleave",function(b){a.isEnabled()&&(null!=D&&(D.parentNode.removeChild(D),D=null),b.stopPropagation(),b.preventDefault())});mxEvent.addListener(a.container,"dragover",mxUtils.bind(this,function(b){null==
|
||||
D&&(!mxClient.IS_IE||10<document.documentMode)&&(D=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!=D&&(D.parentNode.removeChild(D),D=null);if(a.isEnabled()){var c=mxUtils.convertPoint(a.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g=a.view.translate,f=a.view.scale,d=c.x/f-g.x,e=c.y/f-g.y;mxEvent.isAltDown(b)&&(e=d=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,
|
||||
d,e,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var h=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,d,e,!0));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")){var k=b.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=k;var l=null,g=c.getElementsByTagName("img");
|
||||
null!=g&&1==g.length?(k=g[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(l=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var m=!0,n=mxUtils.bind(this,function(){a.setSelectionCells(this.insertTextAt(k,d,e,!0,l,null,m))});l&&k.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;n()},mxEvent.isControlDown(b)):n()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,
|
||||
function(b){var c=Math.max(1,b.width);b=Math.max(1,b.height);var g=this.maxImageSize,g=Math.min(1,Math.min(g/Math.max(1,c)),g/Math.max(1,b));a.setSelectionCell(a.insertVertex(null,null,"",d,e,c*g,b*g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(b){a.setSelectionCells(this.insertTextAt(h,d,e,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&a.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),
|
||||
d,e,!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(",");if(b=this.getPageById(b.substring(a+1)))this.selectPage(b);else throw Error(mxResources.get("pageNotFound")||"Page not found");}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){this.persistCurrentEdgeStyle&&(mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle),mxSettings.save());this.persistCurrentVertexStyle&&(mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle),
|
||||
mxSettings.save())}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(b,a){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(b,a){mxSettings.setPageFormat(this.editor.graph.pageFormat);
|
||||
mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(b,a){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(b,a){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
|
||||
mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(b,a){var c=this.editor.graph;if(c.isSelectionEmpty())b.innerHTML="";else{var f=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),
|
||||
d=mxUtils.getXml(this.editor.graph.encodeCells(f));mxUtils.setTextContent(b,encodeURIComponent(d));a?(c.removeCells(f,!1),c.lastPasteXml=null):(c.lastPasteXml=d,c.pasteCounter=0);b.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(b,a){if(!mxEvent.isConsumed(b)){var c=a.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&
|
||||
(this.convertLucidChart(d,mxUtils.bind(this,function(b){this.editor.graph.setSelectionCells(this.importXml(b,0,0))}),mxUtils.bind(this,function(b){this.handleError(b)})),mxEvent.consume(b))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(a):a.textContent),e=!1;try{var h=f.lastIndexOf("%3E");0<=h&&h<f.length-3&&(f=f.substring(0,h+3))}catch(B){}try{var c=a.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):
|
||||
decodeURIComponent(f);this.isCompatibleString(k)&&(e=!0,f=k)}catch(B){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,e.x+c,e.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=
|
||||
this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(b)}catch(B){}}}}};EditorUi.prototype.addFileDropHandler=function(b){if(Graph.fileSupport)for(var a=null,c=0;c<b.length;c++)mxEvent.addListener(b[c],"dragleave",function(b){null!=a&&(a.parentNode.removeChild(a),a=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(b[c],"dragover",mxUtils.bind(this,function(b){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==a&&(!mxClient.IS_IE||
|
||||
10<document.documentMode&&12>document.documentMode)&&(a=this.highlightElement());b.stopPropagation();b.preventDefault()})),mxEvent.addListener(b[c],"drop",mxUtils.bind(this,function(b){null!=a&&(a.parentNode.removeChild(a),a=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<b.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(b)&&!mxEvent.isShiftDown(b)):this.openFiles(b.dataTransfer.files,
|
||||
!0);else{var c=this.extractGraphModelFromEvent(b);if(null==c){var d=null!=b.dataTransfer?b.dataTransfer:b.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):
|
||||
0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&this.openLocalFile(b.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash=
|
||||
"#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}b.stopPropagation();b.preventDefault()}))};EditorUi.prototype.highlightElement=function(b){var a=0,c=0,d,e;if(null==b){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-3}else a=b.offsetTop,c=b.offsetLeft,d=b.clientWidth,
|
||||
e=b.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=a+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=b&&b.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=function(b){b=mxUtils.parseXml(b);
|
||||
var a=this.editor.extractGraphModel(b.documentElement);b=[];if(null!=a){var c=new mxCodec(a.ownerDocument),d=new mxGraphModel;c.decode(a,d);a=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(a);c++)b.push(d.getChildAt(a,c))}return b};EditorUi.prototype.openFiles=function(b,a){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<b.length;c++)mxUtils.bind(this,function(b){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,f=b.name;if(null!=
|
||||
f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=mxUtils.bind(this,function(b){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==b.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,b,f))}catch(w){this.handleError(w,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(b,
|
||||
f,a)});if(/(\.vsdx?)($|\?)/i.test(f)||/(\.vssx?)($|\?)/i.test(f))this.importVisio(b,mxUtils.bind(this,function(b){this.spinner.stop();e(b)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(b,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?e(b.responseText):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));
|
||||
else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(b){this.spinner.stop();this.openLocalFile(b,f,a)}),mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,
|
||||
c.target.result,b.name))}catch(g){this.handleError(g,mxResources.get("errorLoadingFile"))}}else"image/png"==b.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,a)}});c.onerror=mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b);window.openFile=null});"image"===b.type.substring(0,5)&&"image/svg"!==b.type.substring(0,9)?c.readAsDataURL(b):c.readAsText(b)})(b[c])};EditorUi.prototype.openLocalFile=function(b,a,c){var d=this.getCurrentFile(),
|
||||
f=mxUtils.bind(this,function(){window.openFile=null;if(null==a&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(b);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,b,a||this.defaultFilename,c))});null!=b&&0<b.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),
|
||||
null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b,a),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()}))))};EditorUi.prototype.getBasenames=function(){var b={};if(null!=this.pages)for(var a=0;a<this.pages.length;a++)this.updatePageRoot(this.pages[a]),
|
||||
this.addBasenamesForCell(this.pages[a].root,b);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),b);var a=[],c;for(c in b)a.push(c);return a};EditorUi.prototype.addBasenamesForCell=function(b,a){function c(b){if(null!=b){var c=b.lastIndexOf(".");0<c&&(b=b.substring(c+1,b.length));null==a[b]&&(a[b]=!0)}}var d=this.editor.graph,f=d.getCellStyle(b);c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));d.model.isEdge(b)&&(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),
|
||||
c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(b),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(b,e),a)};EditorUi.prototype.setGraphEnabled=function(b){this.diagramContainer.style.visibility=b?"":"hidden";this.formatContainer.style.visibility=b?"":"hidden";this.sidebarFooterContainer.style.display=b?"":"none";this.sidebarContainer.style.display=b?"":"none";this.hsplit.style.display=b?"":"none";this.editor.graph.setEnabled(b);null!=this.tabContainer&&
|
||||
(this.tabContainer.style.visibility=b?"":"hidden");b||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||
|
||||
this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(b,a,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=b&&0<b.length?(this.setFileData(b),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&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(b,a){null!=b?b.getPublicUrl(a):a(null)};EditorUi.prototype.createLoadMessage=
|
||||
mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var b=this,a=this.editor.graph;a.getLinkTitle=function(a){return b.getLinkTitle(a)};a.customLinkClicked=function(a){var c=!1;try{b.handleCustomLink(a),c=!0}catch(z){b.handleError(z)}return c};var c=this.clearDefaultStyle;this.clearDefaultStyle=function(){c.apply(this,arguments);this.persistCurrentEdgeStyle||(mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle),
|
||||
mxSettings.save());this.persistCurrentVertexStyle||(mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle),mxSettings.save())};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=b.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(a){a=null!=a?a:"";if(null!=b.pages&&null!=b.currentPage)for(var c=0;c<b.pages.length;c++)if(b.pages[c]==b.currentPage){0<c&&(a+=(0<
|
||||
a.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(a+=(0<a.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=a.addClickHandler;a.addClickHandler=function(b,c,g){var f=c;c=function(b,c){if(null==c){var g=mxEvent.getSource(b);"a"==g.nodeName.toLowerCase()&&(c=g.getAttribute("href"))}null!=c&&a.isCustomLink(c)&&(mxEvent.isTouchEvent(b)||!mxEvent.isPopupTrigger(b))&&a.customLinkClicked(c)&&mxEvent.consume(b);null!=f&&f(b,c)};e.call(this,b,c,g)};k.apply(this,arguments);mxClient.IS_SVG&&
|
||||
this.editor.graph.addSvgShadow(a.view.canvas.ownerSVGElement,null,!0);b.actions.get("print").funct=function(){b.showDialog((new PrintDialog(b)).container,360,null!=b.pages&&1<b.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var h=a.getGlobalVariable;a.getGlobalVariable=function(a){return"page"==a&&null!=b.currentPage?b.currentPage.getName():"pagenumber"==a?null!=b.currentPage&&null!=b.pages?mxUtils.indexOf(b.pages,b.currentPage)+1:1:h.apply(this,arguments)};var m=
|
||||
a.labelLinkClicked;a.labelLinkClicked=function(b,c,g){var f=c.getAttribute("href");if(null==f||!a.isCustomLink(f)||!mxEvent.isTouchEvent(g)&&mxEvent.isPopupTrigger(g))m.apply(this,arguments);else{if(!a.isEnabled()||null!=b&&a.isCellLocked(b.cell))a.customLinkClicked(f),a.getRubberband().reset();mxEvent.consume(g)}};this.editor.getOrCreateFilename=function(){var a=b.defaultFilename,c=b.getCurrentFile();null!=c&&(a=null!=c.getTitle()?c.getTitle():a);return a};var n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||
|
||||
!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable){var p=function(){window.setTimeout(function(){g.innerHTML=" ";g.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");
|
||||
this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_IE||a.container.addEventListener("paste",mxUtils.bind(this,function(b){var a=this.editor.graph;if(!mxEvent.isConsumed(b))try{for(var c=b.clipboardData||b.originalEvent.clipboardData,g=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){g=!0;break}if(!g){var d=c.items;for(index in d){var e=d[index];if("file"===e.kind){if(a.isEditing())this.importFiles([e.getAsFile()],0,0,this.maxImageSize,function(b,c,g,f,d,e){a.insertImage(b,
|
||||
d,e)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([e.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(T){}}),!1);var g=document.createElement("div");g.style.position="absolute";g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.display="block";g.contentEditable=!0;mxUtils.setOpacity(g,0);g.style.width="1px";g.style.height="1px";g.innerHTML=
|
||||
" ";var v=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(b){var c=mxEvent.getSource(b);null==a.container||!a.isEnabled()||a.isMouseDown||a.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==b.keyCode||!mxClient.IS_MAC&&17==b.keyCode||mxClient.IS_MAC&&91==b.keyCode)||v||(g.style.left=a.container.scrollLeft+10+"px",g.style.top=
|
||||
a.container.scrollTop+10+"px",a.container.appendChild(g),v=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){g.focus();document.execCommand("selectAll",!1,null)},0):(g.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(b){var c=b.keyCode;window.setTimeout(mxUtils.bind(this,function(){!v||224!=c&&17!=c&&91!=c||(v=!1,a.isEditing()||null!=this.dialog||null==a.container||a.container.focus(),g.parentNode.removeChild(g),null==this.dialog&&
|
||||
mxUtils.clearSelection())}),0)}));mxEvent.addListener(g,"copy",mxUtils.bind(this,function(b){a.isEnabled()&&(mxClipboard.copy(a),this.copyCells(g),p())}));mxEvent.addListener(g,"cut",mxUtils.bind(this,function(b){a.isEnabled()&&(mxClipboard.copy(a),this.copyCells(g,!0),p())}));mxEvent.addListener(g,"paste",mxUtils.bind(this,function(b){a.isEnabled()&&!a.isCellLocked(a.getDefaultParent())&&(g.innerHTML=" ",g.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(b,g);g.innerHTML=
|
||||
" "}),0))}),!0);var D=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==g?!0:D.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(b){var a=this.editor.graph,c=a.cellEditor.text2,g=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(b){null!=
|
||||
g&&(g.parentNode.removeChild(g),g=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(b){null==g&&(!mxClient.IS_IE||10<document.documentMode)&&(g=this.highlightElement(c));b.stopPropagation();b.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(b){null!=g&&(g.parentNode.removeChild(g),g=null);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,function(b,c,g,f,d,e){a.insertImage(b,
|
||||
d,e)},function(){},function(b){return"image/"==b.type.substring(0,6)},function(b){for(var a=0;a<b.length;a++)b[a]()},mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(b){var g=Math.max(1,b.width);b=Math.max(1,b.height);var f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,g)),f/Math.max(1,b));a.insertImage(decodeURIComponent(c),
|
||||
g*f,b*f)})):document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(b.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,b.dataTransfer.getData("text/plain"));b.stopPropagation();b.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){n=document.createElement("div");n.style.position="absolute";
|
||||
n.style.top="95px";n.style.left="250px";n.style.width="2000px";n.style.height="30px";n.style.background="whiteSmoke";document.body.appendChild(n);var C=document.createElement("div");C.style.position="absolute";C.style.top="125px";C.style.left="220px";C.style.width="30px";C.style.height="1000px";C.style.background="whiteSmoke";document.body.appendChild(C);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,C,!0);this.hRuler=new mxRuler(this.editor.graph,n,!1)}if("1"==urlParams.test){n=document.getElementById("geFooter");null!=n&&(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)})),n.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(b,a){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 I=this.isSelectionAllowed;this.isSelectionAllowed=function(b){return mxEvent.getSource(b)==this.styleInput?!0:I.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(a.container,"dragleave",function(b){a.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E),E=null),b.stopPropagation(),b.preventDefault())});
|
||||
mxEvent.addListener(a.container,"dragover",mxUtils.bind(this,function(b){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=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!=E&&(E.parentNode.removeChild(E),E=null);if(a.isEnabled()){var c=mxUtils.convertPoint(a.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),g=a.view.translate,f=a.view.scale,
|
||||
d=c.x/f-g.x,e=c.y/f-g.y;mxEvent.isAltDown(b)&&(e=d=0);if(0<b.dataTransfer.files.length)this.importFiles(b.dataTransfer.files,d,e,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(b),null,null,mxEvent.isShiftDown(b));else{var h=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,d,e,!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 k=null,g=c.getElementsByTagName("img");null!=g&&1==g.length?(l=g[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(k=!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,d,e,!0,k,null,m))});k&&l.length>this.resampleThreshold?this.confirmImageResize(function(b){m=b;n()},mxEvent.isControlDown(b)):
|
||||
n()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,function(b){var c=Math.max(1,b.width);b=Math.max(1,b.height);var g=this.maxImageSize,g=Math.min(1,Math.min(g/Math.max(1,c)),g/Math.max(1,b));a.setSelectionCell(a.insertVertex(null,null,"",d,e,c*g,b*g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(b){a.setSelectionCells(this.insertTextAt(h,
|
||||
d,e,!0))})):0<=mxUtils.indexOf(b.dataTransfer.types,"text/plain")&&a.setSelectionCells(this.insertTextAt(b.dataTransfer.getData("text/plain"),d,e,!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(",");if(b=this.getPageById(b.substring(a+1)))this.selectPage(b);else throw Error(mxResources.get("pageNotFound")||"Page not found");}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){this.persistCurrentEdgeStyle&&(mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle),
|
||||
mxSettings.save());this.persistCurrentVertexStyle&&(mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle),mxSettings.save())}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(b,a){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();
|
||||
this.addListener("pageFormatChanged",mxUtils.bind(this,function(b,a){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(b,a){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(b,a){mxSettings.setAutosave(this.editor.autosave);
|
||||
mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(b,a){var c=this.editor.graph;
|
||||
if(c.isSelectionEmpty())b.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(b,encodeURIComponent(f));a?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,c.pasteCounter=0);b.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(b,a){if(!mxEvent.isConsumed(b)){var c=a.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===
|
||||
c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.convertLucidChart(d,mxUtils.bind(this,function(b){this.editor.graph.setSelectionCells(this.importXml(b,0,0))}),mxUtils.bind(this,function(b){this.handleError(b)})),mxEvent.consume(b))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(a):a.textContent),e=!1;try{var h=f.lastIndexOf("%3E");0<=h&&h<f.length-3&&(f=f.substring(0,h+3))}catch(B){}try{var c=
|
||||
a.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(f);this.isCompatibleString(k)&&(e=!0,f=k)}catch(B){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,
|
||||
e.x+c,e.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(b)}catch(B){}}}}};EditorUi.prototype.addFileDropHandler=function(b){if(Graph.fileSupport)for(var a=null,c=0;c<b.length;c++)mxEvent.addListener(b[c],"dragleave",function(b){null!=a&&(a.parentNode.removeChild(a),a=null);b.stopPropagation();b.preventDefault()}),mxEvent.addListener(b[c],"dragover",mxUtils.bind(this,
|
||||
function(b){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==a&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(a=this.highlightElement());b.stopPropagation();b.preventDefault()})),mxEvent.addListener(b[c],"drop",mxUtils.bind(this,function(b){null!=a&&(a.parentNode.removeChild(a),a=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<b.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(b.dataTransfer.files,0,0,this.maxImageSize,
|
||||
null,null,null,null,!mxEvent.isControlDown(b)&&!mxEvent.isShiftDown(b)):this.openFiles(b.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(b);if(null==c){var d=null!=b.dataTransfer?b.dataTransfer:b.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?b.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),
|
||||
d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&this.openLocalFile(b.getText(),
|
||||
null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}b.stopPropagation();b.preventDefault()}))};EditorUi.prototype.highlightElement=function(b){var a=0,c=0,d,e;if(null==b){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||
|
||||
0,h.clientHeight)-3}else a=b.offsetTop,c=b.offsetLeft,d=b.clientWidth,e=b.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=a+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=b&&b.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);
|
||||
return h};EditorUi.prototype.stringToCells=function(b){b=mxUtils.parseXml(b);var a=this.editor.extractGraphModel(b.documentElement);b=[];if(null!=a){var c=new mxCodec(a.ownerDocument),d=new mxGraphModel;c.decode(a,d);a=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(a);c++)b.push(d.getChildAt(a,c))}return b};EditorUi.prototype.openFiles=function(b,a){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<b.length;c++)mxUtils.bind(this,function(b){var c=new FileReader;c.onload=
|
||||
mxUtils.bind(this,function(c){var d=c.target.result,f=b.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=mxUtils.bind(this,function(b){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==b.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,a);try{this.loadLibrary(new LocalLibrary(this,b,f))}catch(v){this.handleError(v,
|
||||
mxResources.get("errorLoadingFile"))}}else this.openLocalFile(b,f,a)});if(/(\.vsdx?)($|\?)/i.test(f)||/(\.vssx?)($|\?)/i.test(f))this.importVisio(b,mxUtils.bind(this,function(b){this.spinner.stop();e(b)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(b,mxUtils.bind(this,function(b){4==b.readyState&&(this.spinner.stop(),200<=b.status&&299>=b.status?e(b.responseText):this.handleError({message:mxResources.get(413==b.status?"drawingTooLarge":
|
||||
"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(b){this.spinner.stop();this.openLocalFile(b,f,a)}),mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,
|
||||
a);try{this.loadLibrary(new LocalLibrary(this,c.target.result,b.name))}catch(g){this.handleError(g,mxResources.get("errorLoadingFile"))}}else"image/png"==b.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,a)}});c.onerror=mxUtils.bind(this,function(b){this.spinner.stop();this.handleError(b);window.openFile=null});"image"===b.type.substring(0,5)&&"image/svg"!==b.type.substring(0,9)?c.readAsDataURL(b):c.readAsText(b)})(b[c])};EditorUi.prototype.openLocalFile=
|
||||
function(b,a,c){var d=this.getCurrentFile(),f=mxUtils.bind(this,function(){window.openFile=null;if(null==a&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(b);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,b,a||this.defaultFilename,c))});null!=b&&0<b.length&&(null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?
|
||||
this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b,a),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()}))))};EditorUi.prototype.getBasenames=function(){var b={};if(null!=this.pages)for(var a=
|
||||
0;a<this.pages.length;a++)this.updatePageRoot(this.pages[a]),this.addBasenamesForCell(this.pages[a].root,b);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),b);var a=[],c;for(c in b)a.push(c);return a};EditorUi.prototype.addBasenamesForCell=function(b,a){function c(b){if(null!=b){var c=b.lastIndexOf(".");0<c&&(b=b.substring(c+1,b.length));null==a[b]&&(a[b]=!0)}}var d=this.editor.graph,f=d.getCellStyle(b);c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));d.model.isEdge(b)&&
|
||||
(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(b),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(b,e),a)};EditorUi.prototype.setGraphEnabled=function(b){this.diagramContainer.style.visibility=b?"":"hidden";this.formatContainer.style.visibility=b?"":"hidden";this.sidebarFooterContainer.style.display=b?"":"none";this.sidebarContainer.style.display=b?"":"none";this.hsplit.style.display=
|
||||
b?"":"none";this.editor.graph.setEnabled(b);null!=this.tabContainer&&(this.tabContainer.style.visibility=b?"":"hidden");b||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);
|
||||
(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(b,a,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=b&&0<b.length?(this.setFileData(b),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&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(b,a){null!=b?b.getPublicUrl(a):a(null)};EditorUi.prototype.createLoadMessage=
|
||||
function(b){var a=this.editor.graph;return{event:b,pageVisible:a.pageVisible,translate:a.view.translate,scale:a.view.scale,page:a.view.getBackgroundPageBounds(),bounds:a.getGraphBounds()}};EditorUi.prototype.installMessageHandler=function(b){var a=null,c=!1,d=!1,e=null,h=mxUtils.bind(this,function(b,a){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,
|
||||
h);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){function h(b){if(null!=b&&"function"===typeof b.charAt&&"<"!=b.charAt(0))try{"data:image/svg+xml;base64,"==b.substring(0,26)?b=atob(b.substring(26)):"data:image/svg+xml;utf8,"==b.substring(0,24)&&(b=b.substring(24)),null!=b&&("%"==b.charAt(0)?b=decodeURIComponent(b):"<"!=b.charAt(0)&&(b=this.editor.graph.decompress(b)))}catch(H){}return b}if(f.source==(window.opener||window.parent)){var g=f.data;if("json"==urlParams.proto){try{g=
|
||||
JSON.parse(g)}catch(J){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();var l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(b){null!=b&&k.postMessage(JSON.stringify({event:"prompt",
|
||||
|
@ -7555,10 +7554,10 @@ function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:
|
|||
error:J.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var l=1==g.enableRecent,m=1==g.enableSearch,l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(a,c){a=a||this.emptyDiagramXml;null!=g.callback?k.postMessage(JSON.stringify({event:"template",xml:a,blank:a==this.emptyDiagramXml,name:c}),"*"):(b(a,f,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;k.postMessage(JSON.stringify({event:"recentDocs"}),"*")}):null,m?mxUtils.bind(this,function(b,a){this.searchReadyCallback=a;k.postMessage(JSON.stringify({event:"searchDocs",searchStr:b}),"*")}):null,function(b,a,c){k.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"==g.action)this.searchReadyCallback(g.list,g.errorMsg);else if("recentDocsList"==
|
||||
g.action)this.recentReadyCallback(g.list,g.errorMsg);else{if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var n=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,n):this.spinner.stop();return}if("export"==g.action){if("png"==
|
||||
g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var q=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var p=this.editor.graph,v=mxUtils.bind(this,function(b){this.editor.graph.setEnabled(!0);this.spinner.stop();var a=this.createLoadMessage("export");a.format=g.format;a.message=g;a.data=b;a.xml=encodeURIComponent(q);k.postMessage(JSON.stringify(a),"*")}),t=mxUtils.bind(this,function(b){null==
|
||||
b&&(b=Editor.blankImage);"xmlpng"==g.format&&(b=this.writeGraphModelToPng(b,"zTXt","mxGraphModel",atob(this.editor.graph.compress(q))));p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);v(b)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var p=this.createTemporaryGraph(p.getStylesheet()),u=p.getGlobalVariable,z=this.pages[0];p.getGlobalVariable=function(b){return"page"==b?z.getName():"pagenumber"==b?1:u.apply(this,arguments)};document.body.appendChild(p.container);
|
||||
p.model.setRoot(z.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"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(q)))).send(mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?v("data:image/png;base64,"+b.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=
|
||||
g.xml&&0<g.xml.length&&this.setFileData(g.xml);n=this.createLoadMessage("export");if("html2"==g.format||"html"==g.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=g.format;else if("html"==g.format)q=this.editor.getGraphXml(),n.data=this.getHtml(q,this.editor.graph),n.xml=mxUtils.getXml(q),n.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;
|
||||
g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var p=null!=g.xml?g.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=g.format;a.message=g;a.data=b;a.xml=encodeURIComponent(p);k.postMessage(JSON.stringify(a),"*")}),t=mxUtils.bind(this,function(b){null==
|
||||
b&&(b=Editor.blankImage);"xmlpng"==g.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,z=this.pages[0];q.getGlobalVariable=function(b){return"page"==b?z.getName():"pagenumber"==b?1:u.apply(this,arguments)};document.body.appendChild(q.container);
|
||||
q.model.setRoot(z.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"==g.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!=
|
||||
g.xml&&0<g.xml.length&&this.setFileData(g.xml);n=this.createLoadMessage("export");if("html2"==g.format||"html"==g.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=g.format;else if("html"==g.format)p=this.editor.getGraphXml(),n.data=this.getHtml(p,this.editor.graph),n.xml=mxUtils.getXml(p),n.format=g.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(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(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);k.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));k.postMessage(JSON.stringify(n),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));n.data=this.createSvgDataUri(l)}k.postMessage(JSON.stringify(n),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=
|
||||
g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(l=document.createElement("span"),mxUtils.write(l,g.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),
|
||||
|
@ -7568,16 +7567,16 @@ a),this.addListener("backgroundColorChanged",a),this.addListener("backgroundImag
|
|||
urlParams.ready||"ready";k.postMessage(h,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var b=document.createElement("div");b.style.display="inline-block";b.style.position="absolute";b.style.paddingTop="atlas"==uiTheme?"2px":"3px";b.style.paddingLeft="8px";b.style.paddingBottom="2px";var a=document.createElement("button");mxUtils.write(a,mxResources.get("save"));a.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");a.className="geBigButton";a.style.fontSize=
|
||||
"12px";a.style.padding="4px 6px 4px 6px";a.style.borderRadius="3px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));b.appendChild(a);"1"==urlParams.saveAndExit&&(a=document.createElement("a"),mxUtils.write(a,mxResources.get("saveAndExit")),a.setAttribute("title",mxResources.get("saveAndExit")),a.style.fontSize="12px",a.style.marginLeft="6px",a.style.padding="4px",a.style.cursor="pointer",mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),
|
||||
b.appendChild(a));a=document.createElement("a");mxUtils.write(a,mxResources.get("exit"));a.setAttribute("title",mxResources.get("exit"));a.style.fontSize="12px";a.style.marginLeft="6px";a.style.marginRight="20px";a.style.padding="4px";a.style.cursor="pointer";mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));b.appendChild(a);this.toolbar.container.appendChild(b);this.toolbar.staticElements.push(b);b.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(b){this.importCsv(b)}),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(b,a){try{var c=b.split("\n"),d=[];if(0<c.length){var f={},e=null,h=null,k=null,m=null,g="",n="auto",p="auto",C=null,x=null,I=40,D=
|
||||
function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(b){this.importCsv(b)}),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(b,a){try{var c=b.split("\n"),d=[];if(0<c.length){var e={},f=null,h=null,k=null,m=null,g="",n="auto",p="auto",C=null,x=null,I=40,E=
|
||||
40,F=0,A=this.editor.graph;A.getGraphBounds();for(var z=function(){null!=a?a(ca):(A.setSelectionCells(ca),A.scrollCellToVisible(A.getSelectionCell()))},G=A.getFreeInsertPoint(),J=G.x,H=G.y,G=H,L=null,Q="auto",m=null,T=[],U=null,aa=null,X=0;X<c.length&&"#"==c[X].charAt(0);){b=c[X];for(X++;X<c.length&&"\\"==b.charAt(b.length-1)&&"#"==c[X].charAt(0);)b=b.substring(0,b.length-1)+mxUtils.trim(c[X].substring(1)),X++;if("#"!=b.charAt(1)){var N=b.indexOf(":");if(0<N){var O=mxUtils.trim(b.substring(1,N)),
|
||||
M=mxUtils.trim(b.substring(N+1));"label"==O?L=A.sanitizeHtml(M):"style"==O?e=M:"parentstyle"==O?h=M:"identity"==O&&0<M.length&&"-"!=M?k=M:"parent"==O&&0<M.length&&"-"!=M?m=M:"namespace"==O&&0<M.length&&"-"!=M?g=M:"width"==O?n=M:"height"==O?p=M:"left"==O&&0<M.length?C=M:"top"==O&&0<M.length?x=M:"ignore"==O?aa=M.split(","):"connect"==O?T.push(JSON.parse(M)):"link"==O?U=M:"padding"==O?F=parseFloat(M):"edgespacing"==O?I=parseFloat(M):"nodespacing"==O?D=parseFloat(M):"layout"==O&&(Q=M)}}}var ba=this.editor.csvToArray(c[X]),
|
||||
O=N=null;if(null!=k||null!=m)for(var P=0;P<ba.length;P++)k==ba[P]&&(N=P),m==ba[P]&&(O=P);null==L&&(L="%"+ba[0]+"%");if(null!=T)for(var S=0;S<T.length;S++)null==f[T[S].to]&&(f[T[S].to]={});A.model.beginUpdate();try{for(P=X+1;P<c.length;P++){var V=this.editor.csvToArray(c[P]);if(V.length==ba.length){var K=null,W=null!=N?g+V[N]:null;null!=W&&(K=A.model.getCell(W));null==K&&(K=new mxCell(L,new mxGeometry(J,G,0,0),e||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=W);for(var R=0;R<V.length;R++)A.setAttributeForCell(K,
|
||||
ba[R],V[R]);A.setAttributeForCell(K,"placeholders","1");K.style=A.replacePlaceholders(K,K.style);for(S=0;S<T.length;S++)f[T[S].to][K.getAttribute(T[S].to)]=K;null!=U&&"link"!=U&&(A.setLinkForCell(K,K.getAttribute(U)),A.setAttributeForCell(K,U,null));A.fireEvent(new mxEventObject("cellsInserted","cells",[K]));var ga=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=C&&null!=K.getAttribute(C)&&(K.geometry.x=J+parseFloat(K.getAttribute(C))),null!=x&&null!=K.getAttribute(x)&&(K.geometry.y=
|
||||
H+parseFloat(K.getAttribute(x))),"@"==n.charAt(0)&&null!=K.getAttribute(n.substring(1))?K.geometry.width=parseFloat(K.getAttribute(n.substring(1))):K.geometry.width="auto"==n?ga.width+F:parseFloat(n),"@"==p.charAt(0)&&null!=K.getAttribute(p.substring(1))?K.geometry.height=parseFloat(K.getAttribute(p.substring(1))):K.geometry.height="auto"==p?ga.height+F:parseFloat(p),G+=K.geometry.height+D);m=null!=O?A.model.getCell(g+V[O]):null;null!=m?(m.style=A.replacePlaceholders(m,h),A.addCell(K,m)):d.push(A.addCell(K))}}for(var Y=
|
||||
d.slice(),ca=d.slice(),S=0;S<T.length;S++)for(var Z=T[S],P=0;P<d.length;P++){var K=d[P],ka=K.getAttribute(Z.from);if(null!=ka){A.setAttributeForCell(K,Z.from,null);for(var la=ka.split(","),R=0;R<la.length;R++){var da=f[Z.to][la[R]];null!=da&&(L=Z.label,null!=Z.fromlabel&&(L=(K.getAttribute(Z.fromlabel)||"")+(L||"")),null!=Z.tolabel&&(L=(L||"")+(da.getAttribute(Z.tolabel)||"")),ca.push(A.insertEdge(null,null,L||"",Z.invert?da:K,Z.invert?K:da,Z.style||A.createCurrentEdgeStyle())),mxUtils.remove(Z.invert?
|
||||
M=mxUtils.trim(b.substring(N+1));"label"==O?L=A.sanitizeHtml(M):"style"==O?f=M:"parentstyle"==O?h=M:"identity"==O&&0<M.length&&"-"!=M?k=M:"parent"==O&&0<M.length&&"-"!=M?m=M:"namespace"==O&&0<M.length&&"-"!=M?g=M:"width"==O?n=M:"height"==O?p=M:"left"==O&&0<M.length?C=M:"top"==O&&0<M.length?x=M:"ignore"==O?aa=M.split(","):"connect"==O?T.push(JSON.parse(M)):"link"==O?U=M:"padding"==O?F=parseFloat(M):"edgespacing"==O?I=parseFloat(M):"nodespacing"==O?E=parseFloat(M):"layout"==O&&(Q=M)}}}var ba=this.editor.csvToArray(c[X]),
|
||||
O=N=null;if(null!=k||null!=m)for(var P=0;P<ba.length;P++)k==ba[P]&&(N=P),m==ba[P]&&(O=P);null==L&&(L="%"+ba[0]+"%");if(null!=T)for(var S=0;S<T.length;S++)null==e[T[S].to]&&(e[T[S].to]={});A.model.beginUpdate();try{for(P=X+1;P<c.length;P++){var V=this.editor.csvToArray(c[P]);if(V.length==ba.length){var K=null,W=null!=N?g+V[N]:null;null!=W&&(K=A.model.getCell(W));null==K&&(K=new mxCell(L,new mxGeometry(J,G,0,0),f||"whiteSpace=wrap;html=1;"),K.vertex=!0,K.id=W);for(var R=0;R<V.length;R++)A.setAttributeForCell(K,
|
||||
ba[R],V[R]);A.setAttributeForCell(K,"placeholders","1");K.style=A.replacePlaceholders(K,K.style);for(S=0;S<T.length;S++)e[T[S].to][K.getAttribute(T[S].to)]=K;null!=U&&"link"!=U&&(A.setLinkForCell(K,K.getAttribute(U)),A.setAttributeForCell(K,U,null));A.fireEvent(new mxEventObject("cellsInserted","cells",[K]));var ga=this.editor.graph.getPreferredSizeForCell(K);K.vertex&&(null!=C&&null!=K.getAttribute(C)&&(K.geometry.x=J+parseFloat(K.getAttribute(C))),null!=x&&null!=K.getAttribute(x)&&(K.geometry.y=
|
||||
H+parseFloat(K.getAttribute(x))),"@"==n.charAt(0)&&null!=K.getAttribute(n.substring(1))?K.geometry.width=parseFloat(K.getAttribute(n.substring(1))):K.geometry.width="auto"==n?ga.width+F:parseFloat(n),"@"==p.charAt(0)&&null!=K.getAttribute(p.substring(1))?K.geometry.height=parseFloat(K.getAttribute(p.substring(1))):K.geometry.height="auto"==p?ga.height+F:parseFloat(p),G+=K.geometry.height+E);m=null!=O?A.model.getCell(g+V[O]):null;null!=m?(m.style=A.replacePlaceholders(m,h),A.addCell(K,m)):d.push(A.addCell(K))}}for(var Y=
|
||||
d.slice(),ca=d.slice(),S=0;S<T.length;S++)for(var Z=T[S],P=0;P<d.length;P++){var K=d[P],ka=K.getAttribute(Z.from);if(null!=ka){A.setAttributeForCell(K,Z.from,null);for(var la=ka.split(","),R=0;R<la.length;R++){var da=e[Z.to][la[R]];null!=da&&(L=Z.label,null!=Z.fromlabel&&(L=(K.getAttribute(Z.fromlabel)||"")+(L||"")),null!=Z.tolabel&&(L=(L||"")+(da.getAttribute(Z.tolabel)||"")),ca.push(A.insertEdge(null,null,L||"",Z.invert?da:K,Z.invert?K:da,Z.style||A.createCurrentEdgeStyle())),mxUtils.remove(Z.invert?
|
||||
K:da,Y))}}}if(null!=aa)for(P=0;P<d.length;P++)for(K=d[P],R=0;R<aa.length;R++)A.setAttributeForCell(K,mxUtils.trim(aa[R]),null);var ea=new mxParallelEdgeLayout(A);ea.spacing=I;var ma=function(){ea.execute(A.getDefaultParent());for(var b=0;b<d.length;b++){var a=A.getCellGeometry(d[b]);a.x=Math.round(A.snap(a.x));a.y=Math.round(A.snap(a.y));"auto"==n&&(a.width=Math.round(A.snap(a.width)));"auto"==p&&(a.height=Math.round(A.snap(a.height)))}};if("circle"==Q){var ha=new mxCircleLayout(A);ha.resetEdges=
|
||||
!1;var oa=ha.isVertexIgnored;ha.isVertexIgnored=function(b){return oa.apply(this,arguments)||0>mxUtils.indexOf(d,b)};this.executeLayout(function(){ha.execute(A.getDefaultParent());ma()},!0,z);z=null}else if("horizontaltree"==Q||"verticaltree"==Q||"auto"==Q&&ca.length==2*d.length-1&&1==Y.length){A.view.validate();var ia=new mxCompactTreeLayout(A,"horizontaltree"==Q);ia.levelDistance=D;ia.edgeRouting=!1;ia.resetEdges=!1;this.executeLayout(function(){ia.execute(A.getDefaultParent(),0<Y.length?Y[0]:null)},
|
||||
!0,z);z=null}else if("horizontalflow"==Q||"verticalflow"==Q||"auto"==Q&&1==Y.length){A.view.validate();var ja=new mxHierarchicalLayout(A,"horizontalflow"==Q?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=D;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(A.getDefaultParent(),ca);A.moveCells(ca,J,H)},!0,z);z=null}else if("organic"==Q||"auto"==Q&&ca.length>d.length){A.view.validate();var fa=new mxFastOrganicLayout(A);fa.forceConstant=3*D;fa.resetEdges=!1;
|
||||
!1;var oa=ha.isVertexIgnored;ha.isVertexIgnored=function(b){return oa.apply(this,arguments)||0>mxUtils.indexOf(d,b)};this.executeLayout(function(){ha.execute(A.getDefaultParent());ma()},!0,z);z=null}else if("horizontaltree"==Q||"verticaltree"==Q||"auto"==Q&&ca.length==2*d.length-1&&1==Y.length){A.view.validate();var ia=new mxCompactTreeLayout(A,"horizontaltree"==Q);ia.levelDistance=E;ia.edgeRouting=!1;ia.resetEdges=!1;this.executeLayout(function(){ia.execute(A.getDefaultParent(),0<Y.length?Y[0]:null)},
|
||||
!0,z);z=null}else if("horizontalflow"==Q||"verticalflow"==Q||"auto"==Q&&1==Y.length){A.view.validate();var ja=new mxHierarchicalLayout(A,"horizontalflow"==Q?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ja.intraCellSpacing=E;ja.disableEdgeStyle=!1;this.executeLayout(function(){ja.execute(A.getDefaultParent(),ca);A.moveCells(ca,J,H)},!0,z);z=null}else if("organic"==Q||"auto"==Q&&ca.length>d.length){A.view.validate();var fa=new mxFastOrganicLayout(A);fa.forceConstant=3*E;fa.resetEdges=!1;
|
||||
var pa=fa.isVertexIgnored;fa.isVertexIgnored=function(b){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,b)};ea=new mxParallelEdgeLayout(A);ea.spacing=I;this.executeLayout(function(){fa.execute(A.getDefaultParent());ma()},!0,z);z=null}this.hideDialog()}finally{A.model.endUpdate()}null!=z&&z()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(b){var a="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=b&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>
|
||||
mxUtils.indexOf(b,d)&&null!=urlParams[d]&&(a+=c+d+"="+urlParams[d],c="&")}else a=window.location.search;return a};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var a=0<b.indexOf("?")?1:0;if("1"==urlParams.offline)b+=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)&&(b=0==a?b+"?":b+"&",null!=urlParams[d]&&(b+=d+"="+urlParams[d],a++))}return b};
|
||||
EditorUi.prototype.showLinkDialog=function(b,a,c){b=new LinkDialog(this,b,a,c,!0);this.showDialog(b.container,480,130,!0,!0);b.init()};var m=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(b){var a=m.apply(this,arguments),c=this.editor.graph,d=a.getSourceGraphBounds;a.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var b=this.source.getPagePadding(),a=this.source.view.scale;return new mxRectangle(0,
|
||||
|
@ -7596,8 +7595,8 @@ return null!=b&&b.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnable
|
|||
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("hidden"!=this.diagramContainer.style.visibility);this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);
|
||||
this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());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,e,h){var f=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(f.getSvg(d,e,h)),"image/svg+xml");else{var k=b.getFileData(!0,null,null,null,null,!0),m=f.getGraphBounds(),g=Math.floor(m.width*e/f.view.scale),l=Math.floor(m.height*
|
||||
e/f.view.scale);k.length<=MAX_REQUEST_SIZE&&g*l<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="+g+"&h="+l+"&border="+h+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
null);p.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(b,a,c,d,e,h){var f=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(f.getSvg(d,e,h)),"image/svg+xml");else{var k=b.getFileData(!0,null,null,null,null,!0),l=f.getGraphBounds(),g=Math.floor(l.width*e/f.view.scale),m=Math.floor(l.height*
|
||||
e/f.view.scale);k.length<=MAX_REQUEST_SIZE&&g*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="+g+"&h="+m+"&border="+h+"&xml="+encodeURIComponent(k))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}})})();var mxSettings={currentVersion:16,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},getCurrentEdgeStyle:function(){return mxSettings.settings.currentEdgeStyle},setCurrentEdgeStyle:function(a){mxSettings.settings.currentEdgeStyle=a},getCurrentVertexStyle:function(){return mxSettings.settings.currentVertexStyle},
|
||||
|
@ -7659,8 +7658,8 @@ App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.mod
|
|||
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,e=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=e&&(a=(null!=e.getTitle()?e.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],e,d=0;256>d;d++){e=d;for(var c=0;8>c;c++)e=e&1?3988292384^e>>>1:e>>>1;a[d]=e}return a};
|
||||
App.prototype.getThumbnail=function(a,e){var d=!1;try{null==this.thumbImageCache&&(this.thumbImageCache={});var c=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),h=c.getGlobalVariable,k=this.pages[0];c.getGlobalVariable=function(b){return"page"==b?k.getName():"pagenumber"==b?1:h.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(k.root)}if(mxClient.IS_CHROMEAPP||!c.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,
|
||||
function(b){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);e(b)}),a,this.thumbImageCache,"#ffffff",function(){e()},null,null,null,null,null,null,c),d=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var m=document.createElement("canvas"),n=c.getGraphBounds(),p=a/n.width,p=Math.min(1,Math.min(3*a/(4*n.height),p)),b=Math.floor(n.x),f=Math.floor(n.y);m.setAttribute("width",Math.ceil(p*(n.width+4)));m.setAttribute("height",Math.ceil(p*(n.height+4)));var l=m.getContext("2d");
|
||||
l.scale(p,p);l.translate(-b,-f);var q=c.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";l.save();l.fillStyle=q;l.fillRect(b,f,Math.ceil(n.width+4),Math.ceil(n.height+4));l.restore();var u=new mxJsCanvas(m),t=new mxAsyncCanvas(this.thumbImageCache);u.images=this.thumbImageCache.images;var v=new mxImageExport;v.drawShape=function(b,a){b.shape instanceof mxShape&&b.shape.checkBounds()&&(a.save(),a.translate(.5,.5),b.shape.paint(a),a.translate(-.5,-.5),a.restore())};v.drawText=function(b,
|
||||
a){};v.drawState(c.getView().getState(c.model.root),t);t.finish(mxUtils.bind(this,function(){v.drawState(c.getView().getState(c.model.root),u);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);e(m)}));d=!0}}catch(y){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}return d};
|
||||
l.scale(p,p);l.translate(-b,-f);var q=c.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";l.save();l.fillStyle=q;l.fillRect(b,f,Math.ceil(n.width+4),Math.ceil(n.height+4));l.restore();var u=new mxJsCanvas(m),t=new mxAsyncCanvas(this.thumbImageCache);u.images=this.thumbImageCache.images;var w=new mxImageExport;w.drawShape=function(b,a){b.shape instanceof mxShape&&b.shape.checkBounds()&&(a.save(),a.translate(.5,.5),b.shape.paint(a),a.translate(-.5,-.5),a.restore())};w.drawText=function(b,
|
||||
a){};w.drawState(c.getView().getState(c.model.root),t);t.finish(mxUtils.bind(this,function(){w.drawState(c.getView().getState(c.model.root),u);c!=this.editor.graph&&c.container.parentNode.removeChild(c.container);e(m)}));d=!0}}catch(y){c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}return d};
|
||||
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(e,d){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(d)if(isLocalStorage)localStorage.setItem(".mode",e);else if("undefined"!=typeof Storage){var c=new Date;c.setYear(c.getFullYear()+1);document.cookie="MODE="+e+"; expires="+c.toUTCString()}null!=this.appIcon&&(c=this.getCurrentFile(),e=null!=c?c.getMode():null,e==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",
|
||||
[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):e==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),this.appIcon.style.cursor="pointer"):e==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"))}})();
|
||||
|
@ -7708,9 +7707,10 @@ c,mxUtils.bind(this,function(a,c){null!=a&&0<a.length&&(null==k&&c==App.MODE_DEV
|
|||
App.prototype.loadTemplate=function(a,e,d){var c=a;this.isCorsEnabledForUrl(c)||(c="t="+(new Date).getTime(),c=PROXY_URL+"?url="+encodeURIComponent(a)+"&"+c);this.loadUrl(c,mxUtils.bind(this,function(c){/(\.vsdx)($|\?)/i.test(a)?this.importVisio(this.base64ToBlob(c.substring(c.indexOf(",")+1)),function(a){e(a)},d,a):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,a)?this.parseFile(new Blob([c],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&
|
||||
200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&e(a.responseText)}),a):this.isLucidChartData(c)?this.convertLucidChart(c,mxUtils.bind(this,function(a){e(a)}),mxUtils.bind(this,function(a){d(a)})):(/(\.png)($|\?)/i.test(a)&&(c=this.extractGraphModelFromPng(c)),e(c))}),d,/(\.png)($|\?)/i.test(a)||/(\.vsdx)($|\?)/i.test(a))};
|
||||
App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
|
||||
App.prototype.createFile=function(a,e,d,c,h,k,m,n){c=n?null:null!=c?c:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){e=null!=e?e:this.emptyDiagramXml;var p=mxUtils.bind(this,function(){this.spinner.stop()}),b=mxUtils.bind(this,function(b){p();null==b&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=b&&this.handleError(b)});c==App.MODE_GOOGLE&&null!=this.drive?(m=null!=this.stateArg?this.stateArg.folderId:m,this.drive.insertFile(a,e,m,mxUtils.bind(this,
|
||||
function(b){p();this.fileCreated(b,d,k,h)}),b)):c==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b,!1,m):c==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b,!1,m):c==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b):c==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.insertFile(a,
|
||||
e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b,!1,m):c==App.MODE_BROWSER?(p(),c=mxUtils.bind(this,function(){var c=new StorageFile(this,e,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(c,d,k,h)}),b)}),null==localStorage.getItem(a)?c():this.confirm(mxResources.get("replaceIt",[a]),c,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))):(p(),this.fileCreated(new LocalFile(this,e,a,null==c),d,k,h))}};
|
||||
App.prototype.createFile=function(a,e,d,c,h,k,m,n){c=n?null:null!=c?c:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){e=null!=e?e:this.emptyDiagramXml;var p=mxUtils.bind(this,function(){this.spinner.stop()}),b=mxUtils.bind(this,function(b){p();null==b&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=b&&this.handleError(b)});try{if(c==App.MODE_GOOGLE&&null!=this.drive)null==m&&null!=this.stateArg&&null!=this.stateArg.folderId&&(m=this.stateArg.folderId),
|
||||
this.drive.insertFile(a,e,m,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b);else if(c==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b,!1,m);else if(c==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b,!1,m);else if(c==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,
|
||||
d,k,h)}),b);else if(c==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,e,mxUtils.bind(this,function(b){p();this.fileCreated(b,d,k,h)}),b,!1,m);else if(c==App.MODE_BROWSER){p();var f=mxUtils.bind(this,function(){var c=new StorageFile(this,e,a);c.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(c,d,k,h)}),b)});null==localStorage.getItem(a)?f():this.confirm(mxResources.get("replaceIt",[a]),f,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else p(),
|
||||
this.fileCreated(new LocalFile(this,e,a,null==c),d,k,h)}catch(l){p(),this.handleError(l)}}};
|
||||
App.prototype.fileCreated=function(a,e,d,c){var h=window.location.pathname;null!=e&&0<e.length&&(h+="?libs="+e);h=this.getUrl(h);a.getMode()!=App.MODE_DEVICE&&(h+="#"+a.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var k=a.getData(),k=0<k.length?this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,!0):null,m=window.location.protocol+"//"+window.location.hostname+h,n=k,p=null;null!=k&&/\.svg$/i.test(a.getTitle())&&(p=this.createTemporaryGraph(this.editor.graph.getStylesheet()),
|
||||
document.body.appendChild(p.container),n=this.decodeNodeIntoGraph(n,p));a.setData(this.createFileData(k,p,a,m));null!=p&&p.container.parentNode.removeChild(p.container);var b=mxUtils.bind(this,function(){this.spinner.stop()}),f=mxUtils.bind(this,function(){b();var f=this.getCurrentFile();null==d&&null!=f&&(d=!f.isModified()&&null==f.getMode());var k=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(a);d&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")));
|
||||
null!=e&&this.sidebar.showEntries(e)}),m=mxUtils.bind(this,function(){d||null==f||!f.isModified()?k():this.confirm(mxResources.get("allChangesLost"),null,k,mxResources.get("cancel"),mxResources.get("discardChanges"))});null!=c&&c();null==d||d?m():(a.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a.getData(),a.getTitle(),null==a.getMode())),null!=c&&c(),window.openWindow(h,null,m))});a.constructor==LocalFile||a.constructor==DriveFile?
|
||||
|
@ -7792,7 +7792,7 @@ a.getBaseFilename(h),g='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" conten
|
|||
mxEvent.addListener(e,"change",function(){e.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!e.checked,null,!f.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){function b(){a.fileLoaded(null)}var c=a.getCurrentFile();null!=c&&c.isModified()?a.confirm(mxResources.get("allChangesLost"),
|
||||
null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();if(1==d.getSelectionCount()){var b=d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();if(null==b||b.constructor!=
|
||||
DriveFile&&b.constructor!=DropboxFile||null==a.drive&&b.constructor==DriveFile||null==a.dropbox&&b.constructor==DropboxFile)a.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"));else if(a.spinner.spin(document.body,mxResources.get("loading")))if(b.constructor==DropboxFile){var c=a.dropbox.client.filesListRevisions({path:b.stat.path_lower,limit:100});c.then(mxUtils.bind(this,function(c){a.spinner.stop();try{for(var d=[],e=c.entries.length-1;0<=e;e--)(function(c){d.push({modifiedDate:c.client_modified,
|
||||
fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var g=new RevisionDialog(a,d);a.showDialog(g.container,640,480,!0,!0);g.init()}catch(D){a.handleError(D)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();
|
||||
fileSize:c.size,getXml:function(d,e){a.dropbox.readFile({path:b.stat.path_lower,rev:c.rev},d,e)},getUrl:function(){return a.getUrl(window.location.pathname+"?rev="+c.rev+"&chrome=0&edit=_blank")+window.location.hash}})})(c.entries[e]);var g=new RevisionDialog(a,d);a.showDialog(g.container,640,480,!0,!0);g.init()}catch(E){a.handleError(E)}}));c["catch"](function(b){a.spinner.stop();a.handleError(b)})}else a.drive.executeRequest(gapi.client.drive.revisions.list({fileId:b.getId()}),function(c){a.spinner.stop();
|
||||
for(var d=0;d<c.items.length;d++)(function(d){d.getXml=function(e,g){a.drive.executeRequest(gapi.client.drive.revisions.get({fileId:b.getId(),revisionId:c.items[c.items.length-1]===d?b.desc.headRevisionId:d.id}),function(b){a.drive.getXmlFile(b,null,function(a){e(a.getData())},function(a){g(a)})},function(a){g(a)})};d.getUrl=function(){return a.getUrl(window.location.pathname+"?rev="+d.id+"&chrome=0&edit=_blank")+window.location.hash}})(c.items[d]);d=new RevisionDialog(a,c.items);a.showDialog(d.container,
|
||||
640,480,!0,!0);d.init()},function(b){a.spinner.stop();a.handleError(b)})});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b)))});
|
||||
if("undefined"!==typeof MathJax){var f=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)});f.setToggleAction(!0);f.setSelectedCallback(function(){return a.isMathEnabled()});f.isEnabled=k}if(isLocalStorage||mxClient.IS_CHROMEAPP)f=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),f.setToggleAction(!0),
|
||||
|
@ -7848,11 +7848,11 @@ return!1});this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()}}));f.isE
|
|||
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&&
|
||||
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&&
|
||||
!a.isOffline())&&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)},y=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),
|
||||
d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.addAction("insertText",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(y("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=
|
||||
k;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=k;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=k;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=
|
||||
k;var B=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);B(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,
|
||||
k;var B=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);B(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){B(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")+
|
||||
|
@ -7864,7 +7864,7 @@ null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},d):m&&
|
|||
"...",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(D){a.handleError(D,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 editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));
|
||||
c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(E){a.handleError(E,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 editGeometry - 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);
|
||||
|
@ -7927,38 +7927,38 @@ mxResources.get("copyOf",[a.getName()]))}),c)})};(function(){var a=EditorUi.prot
|
|||
a)?c:void 0})),null!=c.relatedPage.root&&a.encodeCell(c.relatedPage.root,h));return h};a.beforeDecode=function(a,c,e){e.ui=a.ui;e.relatedPage=e.ui.getPageById(c.getAttribute("relatedPage"));if(null==e.relatedPage){var d=c.ownerDocument.createElement("diagram");d.setAttribute("id",c.getAttribute("relatedPage"));d.setAttribute("name",c.getAttribute("name"));e.relatedPage=new DiagramPage(d);d=c.getAttribute("viewState");null!=d&&(e.relatedPage.viewState=JSON.parse(d),c.removeAttribute("viewState"));
|
||||
c=c.cloneNode(!0);d=c.firstChild;if(null!=d)for(e.relatedPage.root=a.decodeCell(d,!1),e=d.nextSibling,d.parentNode.removeChild(d),d=e;null!=d;){e=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var h=d.getAttribute("id");null==a.lookup(h)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=e}}return c};a.afterDecode=function(a,c,e){e.index=e.previousIndex;return e};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png",e=Graph.prototype.foldCells;
|
||||
Graph.prototype.foldCells=function(a,c,d,n,p){c=null!=c?c:!1;null==d&&(d=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var b=d.slice(),f=[],h=0;h<d.length;h++){var k=this.view.getState(d[h]),m=null!=k?k.style:this.getCellStyle(d[h]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(d[h],!0,mxUtils.bind(this,function(b,a){null!=a&&f.push(a);b!=d[h]&&f.push(b);return b==d[h]||!this.model.isCollapsed(b)})),this.model.setCollapsed(d[h],
|
||||
a))}for(h=0;h<f.length;h++)this.model.setVisible(f[h],!a);d=b;d=e.apply(this,arguments)}finally{this.model.endUpdate()}return d};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function c(b){return v.isVertex(b)&&d(b)}function d(b){var a=!1;null!=b&&(b=v.getParent(b),a=t.view.getState(b),t.view.getState(b),a="tree"==(null!=a?a.style:t.getCellStyle(b)).containerType);
|
||||
return a}function e(b){var a=!1;null!=b&&(b=v.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())<
|
||||
a))}for(h=0;h<f.length;h++)this.model.setVisible(f[h],!a);d=b;d=e.apply(this,arguments)}finally{this.model.endUpdate()}return d};var d=EditorUi.prototype.init;EditorUi.prototype.init=function(){d.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function c(b){return w.isVertex(b)&&d(b)}function d(b){var a=!1;null!=b&&(b=w.getParent(b),a=t.view.getState(b),t.view.getState(b),a="tree"==(null!=a?a.style:t.getCellStyle(b)).containerType);
|
||||
return a}function e(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 h=t.view.getState(b),k=t.view.scale;if(null!=h){var m=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(a?b.geometry.width+10:-e[1].geometry.width-10)*k:m.y+=(a?b.geometry.height+10:-e[1].geometry.height-10)*k;var l=t.getOutgoingEdges(t.model.getTerminal(d[0],
|
||||
!0));if(null!=l){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=d=0;q<l.length;q++){var v=t.model.getTerminal(l[q],!1);if(f==n(v)){var u=t.view.getState(v);v!=b&&null!=u&&(p&&a!=u.getCenterX()<h.getCenterX()||!p&&a!=u.getCenterY()<h.getCenterY())&&mxUtils.intersects(m,u)&&(d=10+Math.max(d,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/k),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/k))}}p?g=0:d=0;for(q=0;q<l.length;q++)if(v=t.model.getTerminal(l[q],
|
||||
!1),f==n(v)&&(u=t.view.getState(v),v!=b&&null!=u&&(p&&a!=u.getCenterX()<h.getCenterX()||!p&&a!=u.getCenterY()<h.getCenterY()))){var z=[];t.traverse(u.cell,!0,function(b,a){null!=a&&z.push(a);z.push(b);return!0});t.moveCells(z,(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 h=b.geometry.width+40,k=b.geometry.height+40;a==mxConstants.DIRECTION_SOUTH?h=0:a==mxConstants.DIRECTION_NORTH?(h=0,k=-40):a==mxConstants.DIRECTION_WEST?(h=-40,k=0):a==mxConstants.DIRECTION_EAST&&(k=0);t.moveCells(g,h,k);return t.addCells(d,e)}finally{t.model.endUpdate()}}function f(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 h=t.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=t.view.getBounds(f),m=n(b),l=t.view.translate,p=t.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?b.geometry.x+(b.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-l.x-e.x+10,d[1].geometry.y+=b.geometry.height-
|
||||
e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?b.geometry.x+(b.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-l.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=m==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==k?b.geometry.y+(b.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-l.y+-e.y+10);return t.addCells(d,a)}finally{t.model.endUpdate()}}function l(b,
|
||||
a,c){b=t.getOutgoingEdges(b);c=t.view.getState(c);var d=[];if(null!=c&&null!=b){for(var e=0;e<b.length;e++){var f=t.view.getState(t.model.getTerminal(b[e],!1));null!=f&&(!a&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||a&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(b,c){return a?b.x+b.width-c.x-c.width:b.y+b.height-c.y-c.height})}return d}function q(b,a){var c=n(b),d=a==mxConstants.DIRECTION_EAST||a==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||
|
||||
c==mxConstants.DIRECTION_WEST)==d&&c!=a?u.actions.get("selectParent").funct():c==a?(d=t.getOutgoingEdges(b),null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(b),null!=c&&0<c.length&&(d=l(t.model.getTerminal(c[0],!0),d,b),c=t.view.getState(b),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&t.setSelectionCell(d[c].cell)))))}var u=this,t=u.editor.graph,v=t.getModel();mxResources.parse("selectChildren=Select Children");
|
||||
mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");mxResources.parse("selectParent=Select Parent");var y=u.menus.createPopupMenu;u.menus.createPopupMenu=function(b,a,d){y.apply(this,arguments);if(1==t.getSelectionCount()){a=t.getSelectionCell();var e=t.getOutgoingEdges(a);b.addSeparator();null!=e&&0<e.length&&(c(t.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));c(t.getSelectionCell())&&
|
||||
(b.addSeparator(),0<t.getIncomingEdges(a).length&&this.addMenuItems(b,["selectSiblings","selectParent"],null,d))}};u.actions.addAction("selectChildren",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),b=t.getOutgoingEdges(b);if(null!=b){for(var a=[],c=0;c<b.length;c++)a.push(t.model.getTerminal(b[c],!1));t.setSelectionCells(a)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),
|
||||
b=t.getIncomingEdges(b);if(null!=b&&0<b.length&&(b=t.getOutgoingEdges(t.model.getTerminal(b[0],!0)),null!=b)){for(var a=[],c=0;c<b.length;c++)a.push(t.model.getTerminal(b[c],!1));t.setSelectionCells(a)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),b=t.getIncomingEdges(b);null!=b&&0<b.length&&t.setSelectionCell(t.model.getTerminal(b[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",
|
||||
function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),a=[];t.traverse(b,!0,function(b,c){null!=c&&a.push(c);a.push(b);return!0});t.setSelectionCells(a)}},null,null,"Alt+Shift+T");var B=t.removeCells;t.removeCells=function(b,a){a=null!=a?a:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));a&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var e=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&d(g)&&(e.push(g),g=v.getTerminal(g,!1));c(g)?(t.traverse(g,!0,
|
||||
function(b,a){null!=a&&e.push(a);e.push(b);return!0}),g=t.getIncomingEdges(b[f]),b=b.concat(g)):e.push(b[f])}b=e;return B.apply(this,arguments)};u.hoverIcons.getStateAt=function(b,a,d){return c(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(a,d))};var g=t.duplicateCells;t.duplicateCells=function(b,a){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&c(f.cell))for(var h=t.getIncomingEdges(f.cell),f=0;f<h.length;f++)mxUtils.remove(h[f],
|
||||
b)}this.model.beginUpdate();try{var k=g.call(this,b,a);if(k.length==b.length)for(e=0;e<b.length;e++)if(c(b[e])){var m=t.getIncomingEdges(k[e]),h=t.getIncomingEdges(b[e]);if(0==m.length&&0<h.length){var l=this.cloneCells([h[0]])[0];this.addEdge(l,t.getDefaultParent(),this.model.getTerminal(h[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var w=t.moveCells;t.moveCells=function(b,a,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!=b&&c(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(c(b[p])||t.model.isEdge(b[p])&&null==t.model.getTerminal(b[p],!0)){f=t.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var q=t.getIncomingEdges(b[0]);if(0<q.length){var v=t.view.getState(t.model.getTerminal(q[0],!0));if(null!=v){var u=t.view.getState(m);null!=u&&(a=(u.getCenterX()-v.getCenterX())/t.view.scale,d=(u.getCenterY()-v.getCenterY())/t.view.scale)}}}}k=w.apply(this,arguments);
|
||||
if(null!=k&&null!=b&&k.length==b.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))c(m)&&0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],m,!0);else if(c(b[p])&&(q=t.getIncomingEdges(b[p]),0<q.length))if(!e)c(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],m,!0);else if(0==t.getIncomingEdges(k[p]).length){l=m;if(null==l||l==t.model.getParent(b[p]))l=t.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e,
|
||||
t.getDefaultParent(),l,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var E=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(b,a,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=E.apply(this,arguments),c(b))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],b,!0);var k=t.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={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(t.isEnabled()&&!t.isEditing()&&c(t.getSelectionCell())&&1==t.getSelectionCount()){var d=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?b(t.getSelectionCell()):f(t.getSelectionCell()):13==a.which&&(d=p(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&t.model.isEdge(d[0])?t.setSelectionCell(t.model.getTerminal(d[0],
|
||||
!1)):t.setSelectionCell(d[d.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=C[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(q(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(q(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(q(t.getSelectionCell(),
|
||||
mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(q(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(H){console.log("error",H)}mxEvent.isConsumed(a)||x.apply(this,arguments)};var I=t.connectVertex;t.connectVertex=function(a,d,e,g,h,k){var m=t.getIncomingEdges(a);return c(a)&&0<m.length?(e=n(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,h=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==h?b(a):p(a,d!=mxConstants.DIRECTION_NORTH&&
|
||||
d!=mxConstants.DIRECTION_WEST)):I.call(this,a,d,e,g,h,k)};t.getSubtree=function(b){var a=[b];c(b)&&!e(b)&&t.traverse(b,!0,function(b,c){null!=c&&0>mxUtils.indexOf(a,c)&&a.push(c);0>mxUtils.indexOf(a,b)&&a.push(b);return!0});return a};var D=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){D.apply(this,arguments);c(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(b){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(b),mxEvent.getClientY(b));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(b);this.graph.isMouseDown=!0;mxEvent.consume(b)})))};var F=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){F.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 A=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(b,a){A.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var c=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=c.apply(this,arguments),d=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 c=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");
|
||||
c.vertex=!0;var d=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;");d.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.relative=!0;b.edge=!0;c.insertEdge(b,!0);d.insertEdge(b,!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;");
|
||||
10:-e[1].geometry.height-10;t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=t.view.getState(b),k=t.view.scale;if(null!=h){var m=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(a?b.geometry.width+10:-e[1].geometry.width-10)*k:m.y+=(a?b.geometry.height+10:-e[1].geometry.height-10)*k;var l=t.getOutgoingEdges(t.model.getTerminal(d[0],!0));if(null!=l){for(var p=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=g=
|
||||
d=0;q<l.length;q++){var w=t.model.getTerminal(l[q],!1);if(f==n(w)){var u=t.view.getState(w);w!=b&&null!=u&&(p&&a!=u.getCenterX()<h.getCenterX()||!p&&a!=u.getCenterY()<h.getCenterY())&&mxUtils.intersects(m,u)&&(d=10+Math.max(d,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/k),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/k))}}p?g=0:d=0;for(q=0;q<l.length;q++)if(w=t.model.getTerminal(l[q],!1),f==n(w)&&(u=t.view.getState(w),w!=b&&null!=u&&(p&&a!=u.getCenterX()<h.getCenterX()||
|
||||
!p&&a!=u.getCenterY()<h.getCenterY()))){var z=[];t.traverse(u.cell,!0,function(b,a){null!=a&&z.push(a);z.push(b);return!0});t.moveCells(z,(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 h=b.geometry.width+40,k=b.geometry.height+40;a==mxConstants.DIRECTION_SOUTH?h=0:a==mxConstants.DIRECTION_NORTH?(h=0,k=-40):a==mxConstants.DIRECTION_WEST?(h=-40,k=0):a==mxConstants.DIRECTION_EAST&&(k=0);t.moveCells(g,h,k);return t.addCells(d,e)}finally{t.model.endUpdate()}}function f(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 h=t.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=t.view.getBounds(f),m=n(b),l=t.view.translate,p=t.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?b.geometry.x+(b.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-l.x-e.x+10,d[1].geometry.y+=b.geometry.height-e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==k?b.geometry.x+(b.geometry.width-
|
||||
d[1].geometry.width)/2:(k.x+k.width)/p-l.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=m==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==k?b.geometry.y+(b.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-l.y+-e.y+10);return t.addCells(d,a)}finally{t.model.endUpdate()}}function l(b,a,c){b=t.getOutgoingEdges(b);c=t.view.getState(c);var d=[];if(null!=c&&null!=b){for(var e=0;e<b.length;e++){var f=
|
||||
t.view.getState(t.model.getTerminal(b[e],!1));null!=f&&(!a&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||a&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(b,c){return a?b.x+b.width-c.x-c.width:b.y+b.height-c.y-c.height})}return d}function q(b,a){var c=n(b),d=a==mxConstants.DIRECTION_EAST||a==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=a?u.actions.get("selectParent").funct():c==a?(d=t.getOutgoingEdges(b),
|
||||
null!=d&&0<d.length&&t.setSelectionCell(t.model.getTerminal(d[0],!1))):(c=t.getIncomingEdges(b),null!=c&&0<c.length&&(d=l(t.model.getTerminal(c[0],!0),d,b),c=t.view.getState(b),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&t.setSelectionCell(d[c].cell)))))}var u=this,t=u.editor.graph,w=t.getModel();mxResources.parse("selectChildren=Select Children");mxResources.parse("selectSiblings=Select Siblings");mxResources.parse("selectDescendants=Select Descendants");
|
||||
mxResources.parse("selectParent=Select Parent");var y=u.menus.createPopupMenu;u.menus.createPopupMenu=function(b,a,d){y.apply(this,arguments);if(1==t.getSelectionCount()){a=t.getSelectionCell();var e=t.getOutgoingEdges(a);b.addSeparator();null!=e&&0<e.length&&(c(t.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));c(t.getSelectionCell())&&(b.addSeparator(),0<t.getIncomingEdges(a).length&&this.addMenuItems(b,["selectSiblings","selectParent"],
|
||||
null,d))}};u.actions.addAction("selectChildren",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),b=t.getOutgoingEdges(b);if(null!=b){for(var a=[],c=0;c<b.length;c++)a.push(t.model.getTerminal(b[c],!1));t.setSelectionCells(a)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),b=t.getIncomingEdges(b);if(null!=b&&0<b.length&&(b=t.getOutgoingEdges(t.model.getTerminal(b[0],!0)),
|
||||
null!=b)){for(var a=[],c=0;c<b.length;c++)a.push(t.model.getTerminal(b[c],!1));t.setSelectionCells(a)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),b=t.getIncomingEdges(b);null!=b&&0<b.length&&t.setSelectionCell(t.model.getTerminal(b[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var b=t.getSelectionCell(),a=[];t.traverse(b,
|
||||
!0,function(b,c){null!=c&&a.push(c);a.push(b);return!0});t.setSelectionCells(a)}},null,null,"Alt+Shift+T");var B=t.removeCells;t.removeCells=function(b,a){a=null!=a?a:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));a&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var e=[],f=0;f<b.length;f++){var g=b[f];w.isEdge(g)&&d(g)&&(e.push(g),g=w.getTerminal(g,!1));c(g)?(t.traverse(g,!0,function(b,a){null!=a&&e.push(a);e.push(b);return!0}),g=t.getIncomingEdges(b[f]),b=b.concat(g)):e.push(b[f])}b=
|
||||
e;return B.apply(this,arguments)};u.hoverIcons.getStateAt=function(b,a,d){return c(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(a,d))};var g=t.duplicateCells;t.duplicateCells=function(b,a){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&c(f.cell))for(var h=t.getIncomingEdges(f.cell),f=0;f<h.length;f++)mxUtils.remove(h[f],b)}this.model.beginUpdate();try{var k=g.call(this,b,a);if(k.length==b.length)for(e=0;e<b.length;e++)if(c(b[e])){var m=
|
||||
t.getIncomingEdges(k[e]),h=t.getIncomingEdges(b[e]);if(0==m.length&&0<h.length){var l=this.cloneCells([h[0]])[0];this.addEdge(l,t.getDefaultParent(),this.model.getTerminal(h[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var v=t.moveCells;t.moveCells=function(b,a,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!=b&&c(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(c(b[p])||t.model.isEdge(b[p])&&
|
||||
null==t.model.getTerminal(b[p],!0)){f=t.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var q=t.getIncomingEdges(b[0]);if(0<q.length){var w=t.view.getState(t.model.getTerminal(q[0],!0));if(null!=w){var u=t.view.getState(m);null!=u&&(a=(u.getCenterX()-w.getCenterX())/t.view.scale,d=(u.getCenterY()-w.getCenterY())/t.view.scale)}}}}k=v.apply(this,arguments);if(null!=k&&null!=b&&k.length==b.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))c(m)&&0>mxUtils.indexOf(k,
|
||||
this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],m,!0);else if(c(b[p])&&(q=t.getIncomingEdges(b[p]),0<q.length))if(!e)c(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(q[0],!0))&&this.model.setTerminal(q[0],m,!0);else if(0==t.getIncomingEdges(k[p]).length){l=m;if(null==l||l==t.model.getParent(b[p]))l=t.model.getTerminal(q[0],!0);e=this.cloneCells([q[0]])[0];this.addEdge(e,t.getDefaultParent(),l,k[p])}}finally{this.model.endUpdate()}return k};if(null!=u.sidebar){var D=u.sidebar.dropAndConnect;
|
||||
u.sidebar.dropAndConnect=function(b,a,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=D.apply(this,arguments),c(b))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],b,!0);var k=t.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={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(t.isEnabled()&&!t.isEditing()&&c(t.getSelectionCell())&&1==t.getSelectionCount()){var d=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?b(t.getSelectionCell()):f(t.getSelectionCell()):13==a.which&&(d=p(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&t.model.isEdge(d[0])?t.setSelectionCell(t.model.getTerminal(d[0],!1)):t.setSelectionCell(d[d.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(t.view.getState(t.getSelectionCell())),
|
||||
t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=C[a.keyCode];null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(q(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(q(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(q(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(q(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
|
||||
mxEvent.consume(a))}}catch(H){console.log("error",H)}mxEvent.isConsumed(a)||x.apply(this,arguments)};var I=t.connectVertex;t.connectVertex=function(a,d,e,g,h,k){var m=t.getIncomingEdges(a);return c(a)&&0<m.length?(e=n(a),g=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,h=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?f(a):g==h?b(a):p(a,d!=mxConstants.DIRECTION_NORTH&&d!=mxConstants.DIRECTION_WEST)):I.call(this,a,d,e,g,h,k)};t.getSubtree=function(b){var a=[b];c(b)&&
|
||||
!e(b)&&t.traverse(b,!0,function(b,c){null!=c&&0>mxUtils.indexOf(a,c)&&a.push(c);0>mxUtils.indexOf(a,b)&&a.push(b);return!0});return a};var E=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){E.apply(this,arguments);c(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(b){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(b),mxEvent.getClientY(b));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(b);this.graph.isMouseDown=!0;mxEvent.consume(b)})))};var F=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){F.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 A=mxVertexHandler.prototype.destroy;
|
||||
mxVertexHandler.prototype.destroy=function(b,a){A.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var c=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=c.apply(this,arguments),d=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 c=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");c.vertex=!0;var d=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;");d.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.relative=!0;b.edge=!0;c.insertEdge(b,!0);d.insertEdge(b,!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 h=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");h.geometry.relative=!0;h.edge=!0;c.insertEdge(h,!0);e.insertEdge(h,!1);var k=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;");k.vertex=!0;var u=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
||||
u.geometry.relative=!0;u.edge=!0;c.insertEdge(u,!0);k.insertEdge(u,!1);var t=new mxCell("Branch",new mxGeometry(20,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;");t.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
||||
v.geometry.relative=!0;v.edge=!0;c.insertEdge(v,!0);t.insertEdge(v,!1);a.insert(b);a.insert(h);a.insert(u);a.insert(v);a.insert(c);a.insert(d);a.insert(e);a.insert(k);a.insert(t);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
|
||||
u.geometry.relative=!0;u.edge=!0;c.insertEdge(u,!0);k.insertEdge(u,!1);var t=new mxCell("Branch",new mxGeometry(20,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;");t.vertex=!0;var w=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
||||
w.geometry.relative=!0;w.edge=!0;c.insertEdge(w,!0);t.insertEdge(w,!1);a.insert(b);a.insert(h);a.insert(u);a.insert(w);a.insert(c);a.insert(d);a.insert(e);a.insert(k);a.insert(t);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
|
||||
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"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;");a.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
||||
c.geometry.setTerminalPoint(new mxPoint(-40,40),!0);c.geometry.relative=!0;c.edge=!0;a.insertEdge(c,!1);return sb.createVertexTemplateFromCells([a,c],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var c=new mxCell("",new mxGeometry(0,
|
||||
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");c.geometry.setTerminalPoint(new mxPoint(-40,40),!0);c.geometry.relative=!0;c.edge=!0;a.insertEdge(c,!1);return sb.createVertexTemplateFromCells([a,c],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var c=new mxCell("Organization",
|
||||
|
@ -7973,8 +7973,8 @@ g.className="geTitle";b.appendChild(g);return g}var d=document.createElement("di
|
|||
"0";else if(null!=a.actions.get("newLibrary")){d=document.createElement("div");d.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;";d.className="geTitle";var f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("newLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("newLibrary").funct);d=document.createElement("div");
|
||||
d.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;";d.className="geTitle";f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("openLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=c("newLibrary",mxResources.get("newLibrary")),d.style.left=
|
||||
"0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.left="50%";b.appendChild(a.sidebar.container);b.style.overflow="hidden";return b});a.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()}
|
||||
if("1"!=urlParams.lightbox&&"0"!=urlParams.chrome){var d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var c=document.createElement("style");c.type="text/css";c.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0;}html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }.geDialog input, .geToolbarContainer input, .mxWindow input {padding:2px !important;display:inline-block !important; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }.mxWindow .geColorBtn, .geDialog .geColorBtn { background: none !important; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }a.geMenuItem:active { opacity: 0.4; }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }";
|
||||
document.getElementsByTagName("head")[0].appendChild(c)}catch(v){}var h=function(a,b,c,d,e,f,h){a=document.createElement("div");a.className="geSidebarContainer";a.style.position="absolute";a.style.width="100%";a.style.height="100%";a.style.border="1px solid whiteSmoke";a.style.overflowX="hidden";a.style.overflowY="auto";h(a);this.window=new mxWindow(b,a,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
|
||||
if("1"!=urlParams.lightbox&&"0"!=urlParams.chrome){var d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var c=document.createElement("style");c.type="text/css";c.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0;}html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }.geDialog input, .geToolbarContainer input, .mxWindow input {padding:2px !important;display:inline-block !important; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }a.geMenuItem:active { opacity: 0.4; }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }";
|
||||
document.getElementsByTagName("head")[0].appendChild(c)}catch(w){}var h=function(a,b,c,d,e,f,h){a=document.createElement("div");a.className="geSidebarContainer";a.style.position="absolute";a.style.width="100%";a.style.height="100%";a.style.border="1px solid whiteSmoke";a.style.overflowX="hidden";a.style.overflowY="auto";h(a);this.window=new mxWindow(b,a,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
|
||||
this.window.setLocation=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)}};Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;
|
||||
mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxVertexHandler.prototype.handleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/>');
|
||||
mxEdgeHandler.prototype.handleImage=mxVertexHandler.prototype.handleImage;mxEdgeHandler.prototype.terminalHandleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/><circle cx="8" cy="8" r="3" stroke="#ffffff" fill="#29b6f2"/>');mxEdgeHandler.prototype.fixedHandleImage=Graph.createSvgImage(16,16,'<circle cx="8" cy="8" r="5" stroke="#ffffff" fill="#29b6f2"/><path d="m 6 6 L 10 10 M 6 10 L 10 6" stroke="#ffffff"/>');mxConstraintHandler.prototype.pointImage=
|
||||
|
|
|
@ -3132,82 +3132,93 @@ App.prototype.createFile = function(title, data, libs, mode, done, replace, fold
|
|||
}
|
||||
});
|
||||
|
||||
if (mode == App.MODE_GOOGLE && this.drive != null)
|
||||
try
|
||||
{
|
||||
folderId = (this.stateArg != null) ? this.stateArg.folderId : folderId;
|
||||
|
||||
this.drive.insertFile(title, data, folderId, mxUtils.bind(this, function(file)
|
||||
if (mode == App.MODE_GOOGLE && this.drive != null)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error);
|
||||
}
|
||||
else if (mode == App.MODE_GITHUB && this.gitHub != null)
|
||||
{
|
||||
this.gitHub.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error, false, folderId);
|
||||
}
|
||||
else if (mode == App.MODE_TRELLO && this.trello != null)
|
||||
{
|
||||
this.trello.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error, false, folderId);
|
||||
}
|
||||
else if (mode == App.MODE_DROPBOX && this.dropbox != null)
|
||||
{
|
||||
this.dropbox.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error);
|
||||
}
|
||||
else if (mode == App.MODE_ONEDRIVE && this.oneDrive != null)
|
||||
{
|
||||
this.oneDrive.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error, false, folderId);
|
||||
}
|
||||
else if (mode == App.MODE_BROWSER)
|
||||
{
|
||||
complete();
|
||||
|
||||
var fn = mxUtils.bind(this, function()
|
||||
{
|
||||
var file = new StorageFile(this, data, title);
|
||||
|
||||
// Inserts data into local storage
|
||||
file.saveFile(title, false, mxUtils.bind(this, function()
|
||||
if (folderId == null && this.stateArg != null && this.stateArg.folderId != null)
|
||||
{
|
||||
folderId = this.stateArg.folderId;
|
||||
}
|
||||
|
||||
this.drive.insertFile(title, data, folderId, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error);
|
||||
});
|
||||
|
||||
if (localStorage.getItem(title) == null)
|
||||
}
|
||||
else if (mode == App.MODE_GITHUB && this.gitHub != null)
|
||||
{
|
||||
fn();
|
||||
this.gitHub.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error, false, folderId);
|
||||
}
|
||||
else if (mode == App.MODE_TRELLO && this.trello != null)
|
||||
{
|
||||
this.trello.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error, false, folderId);
|
||||
}
|
||||
else if (mode == App.MODE_DROPBOX && this.dropbox != null)
|
||||
{
|
||||
this.dropbox.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error);
|
||||
}
|
||||
else if (mode == App.MODE_ONEDRIVE && this.oneDrive != null)
|
||||
{
|
||||
this.oneDrive.insertFile(title, data, mxUtils.bind(this, function(file)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error, false, folderId);
|
||||
}
|
||||
else if (mode == App.MODE_BROWSER)
|
||||
{
|
||||
complete();
|
||||
|
||||
var fn = mxUtils.bind(this, function()
|
||||
{
|
||||
var file = new StorageFile(this, data, title);
|
||||
|
||||
// Inserts data into local storage
|
||||
file.saveFile(title, false, mxUtils.bind(this, function()
|
||||
{
|
||||
this.fileCreated(file, libs, replace, done);
|
||||
}), error);
|
||||
});
|
||||
|
||||
if (localStorage.getItem(title) == null)
|
||||
{
|
||||
fn();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.confirm(mxResources.get('replaceIt', [title]), fn, mxUtils.bind(this, function()
|
||||
{
|
||||
if (this.getCurrentFile() == null && this.dialog == null)
|
||||
{
|
||||
this.showSplash();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.confirm(mxResources.get('replaceIt', [title]), fn, mxUtils.bind(this, function()
|
||||
{
|
||||
if (this.getCurrentFile() == null && this.dialog == null)
|
||||
{
|
||||
this.showSplash();
|
||||
}
|
||||
}));
|
||||
complete();
|
||||
this.fileCreated(new LocalFile(this, data, title, mode == null), libs, replace, done);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (e)
|
||||
{
|
||||
complete();
|
||||
this.fileCreated(new LocalFile(this, data, title, mode == null), libs, replace, done);
|
||||
this.handleError(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -624,7 +624,7 @@ var SplashDialog = function(editorUi)
|
|||
|
||||
var link = document.createElement('a');
|
||||
link.setAttribute('href', 'javascript:void(0)');
|
||||
link.style.display = 'block';
|
||||
link.style.display = 'inline-block';
|
||||
link.style.marginTop = '6px';
|
||||
mxUtils.write(link, mxResources.get('signOut'));
|
||||
|
||||
|
@ -649,7 +649,7 @@ var SplashDialog = function(editorUi)
|
|||
|
||||
var link = document.createElement('a');
|
||||
link.setAttribute('href', 'javascript:void(0)');
|
||||
link.style.display = 'block';
|
||||
link.style.display = 'inline-block';
|
||||
link.style.marginTop = '6px';
|
||||
mxUtils.write(link, mxResources.get('changeUser') + ' (' + driveUser.displayName + ')');
|
||||
|
||||
|
@ -721,9 +721,10 @@ var SplashDialog = function(editorUi)
|
|||
});
|
||||
}
|
||||
|
||||
mxUtils.br(buttons);
|
||||
var link = document.createElement('a');
|
||||
link.setAttribute('href', 'javascript:void(0)');
|
||||
link.style.display = 'block';
|
||||
link.style.display = 'inline-block';
|
||||
link.style.marginTop = '8px';
|
||||
mxUtils.write(link, mxResources.get('notUsingService', [storage]));
|
||||
|
||||
|
@ -2012,170 +2013,183 @@ var ParseDialog = function(editorUi, title, defaultType)
|
|||
{
|
||||
var plantUmlServerUrl = (type == 'plantUmlTxt') ? PLANT_URL + '/txt/' :
|
||||
((type == 'plantUmlPng') ? PLANT_URL + '/png/' : PLANT_URL + '/svg/');
|
||||
var graph = editorUi.editor.graph;
|
||||
|
||||
// TODO: Change server to return base64 & accept POST request
|
||||
if (editorUi.spinner.spin(document.body, mxResources.get('inserting')))
|
||||
{
|
||||
function encode64(data) {
|
||||
r = "";
|
||||
for (i=0; i<data.length; i+=3) {
|
||||
if (i+2==data.length) {
|
||||
r +=append3bytes(data.charCodeAt(i), data.charCodeAt(i+1), 0);
|
||||
} else if (i+1==data.length) {
|
||||
r += append3bytes(data.charCodeAt(i), 0, 0);
|
||||
} else {
|
||||
r += append3bytes(data.charCodeAt(i), data.charCodeAt(i+1),
|
||||
data.charCodeAt(i+2));
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function append3bytes(b1, b2, b3)
|
||||
var graph = editorUi.editor.graph;
|
||||
|
||||
// TODO: Change server to return base64 and accept POST request
|
||||
if (editorUi.spinner.spin(document.body, mxResources.get('inserting')))
|
||||
{
|
||||
c1 = b1 >> 2;
|
||||
c2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
||||
c3 = ((b2 & 0xF) << 2) | (b3 >> 6);
|
||||
c4 = b3 & 0x3F;
|
||||
r = "";
|
||||
r += encode6bit(c1 & 0x3F);
|
||||
r += encode6bit(c2 & 0x3F);
|
||||
r += encode6bit(c3 & 0x3F);
|
||||
r += encode6bit(c4 & 0x3F);
|
||||
return r;
|
||||
}
|
||||
|
||||
function encode6bit(b)
|
||||
{
|
||||
if (b < 10) {
|
||||
return String.fromCharCode(48 + b);
|
||||
}
|
||||
b -= 10;
|
||||
if (b < 26) {
|
||||
return String.fromCharCode(65 + b);
|
||||
}
|
||||
b -= 26;
|
||||
if (b < 26) {
|
||||
return String.fromCharCode(97 + b);
|
||||
}
|
||||
b -= 26;
|
||||
if (b == 0) {
|
||||
return '-';
|
||||
}
|
||||
if (b == 1) {
|
||||
return '_';
|
||||
}
|
||||
return '?';
|
||||
}
|
||||
|
||||
// TODO: Remove unescape, use btoa for compatibility with graph.compress
|
||||
function compress(s)
|
||||
{
|
||||
return encode64(graph.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(s)))));
|
||||
};
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', plantUmlServerUrl + compress(text), true);
|
||||
|
||||
if (type != 'plantUmlTxt')
|
||||
{
|
||||
xhr.responseType = 'blob';
|
||||
}
|
||||
|
||||
xhr.onload = function(e)
|
||||
{
|
||||
if (this.status >= 200 && this.status < 300)
|
||||
{
|
||||
if (type == 'plantUmlTxt')
|
||||
function encode64(data)
|
||||
{
|
||||
editorUi.spinner.stop();
|
||||
r = "";
|
||||
|
||||
graph.getModel().beginUpdate();
|
||||
try
|
||||
for (i = 0; i < data.length; i += 3)
|
||||
{
|
||||
cell = graph.insertVertex(null, null, '<pre>' + this.response + '</pre>',
|
||||
insertPoint.x, insertPoint.y, 1, 1, 'text;html=1;overflow=fill;');
|
||||
graph.updateCellSize(cell, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
graph.getModel().endUpdate();
|
||||
if (i + 2 == data.length)
|
||||
{
|
||||
r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1), 0);
|
||||
}
|
||||
else if (i + 1 == data.length)
|
||||
{
|
||||
r += append3bytes(data.charCodeAt(i), 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
r += append3bytes(data.charCodeAt(i), data.charCodeAt(i + 1),
|
||||
data.charCodeAt(i + 2));
|
||||
}
|
||||
}
|
||||
|
||||
graph.setSelectionCell(cell);
|
||||
graph.scrollCellToVisible(graph.getSelectionCell());
|
||||
return r;
|
||||
}
|
||||
else
|
||||
|
||||
function append3bytes(b1, b2, b3)
|
||||
{
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(this.response);
|
||||
|
||||
reader.onload = function(e)
|
||||
{
|
||||
var img = new Image();
|
||||
|
||||
img.onload = function()
|
||||
{
|
||||
editorUi.spinner.stop();
|
||||
var w = img.width;
|
||||
var h = img.height;
|
||||
|
||||
// Workaround for 0 image size in IE11
|
||||
if (w == 0 && h == 0)
|
||||
{
|
||||
var data = e.target.result;
|
||||
var comma = data.indexOf(',');
|
||||
var svgText = decodeURIComponent(escape(atob(data.substring(comma + 1))));
|
||||
var root = mxUtils.parseXml(svgText);
|
||||
var svgs = root.getElementsByTagName('svg');
|
||||
|
||||
if (svgs.length > 0)
|
||||
{
|
||||
w = parseFloat(svgs[0].getAttribute('width'));
|
||||
h = parseFloat(svgs[0].getAttribute('height'));
|
||||
}
|
||||
}
|
||||
|
||||
graph.getModel().beginUpdate();
|
||||
try
|
||||
{
|
||||
cell = graph.insertVertex(null, null, text, insertPoint.x, insertPoint.y,
|
||||
w, h, 'shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;' +
|
||||
'image=' + editorUi.convertDataUri(e.target.result) + ';');
|
||||
}
|
||||
finally
|
||||
{
|
||||
graph.getModel().endUpdate();
|
||||
}
|
||||
|
||||
graph.setSelectionCell(cell);
|
||||
graph.scrollCellToVisible(graph.getSelectionCell());
|
||||
};
|
||||
|
||||
img.src = e.target.result;
|
||||
};
|
||||
|
||||
reader.onerror = function(e)
|
||||
{
|
||||
editorUi.handleError(e);
|
||||
};
|
||||
c1 = b1 >> 2;
|
||||
c2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
||||
c3 = ((b2 & 0xF) << 2) | (b3 >> 6);
|
||||
c4 = b3 & 0x3F;
|
||||
r = "";
|
||||
r += encode6bit(c1 & 0x3F);
|
||||
r += encode6bit(c2 & 0x3F);
|
||||
r += encode6bit(c3 & 0x3F);
|
||||
r += encode6bit(c4 & 0x3F);
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
editorUi.spinner.stop();
|
||||
editorUi.handleError(e);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function(e)
|
||||
{
|
||||
editorUi.handleError(e);
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function encode6bit(b)
|
||||
{
|
||||
if (b < 10)
|
||||
{
|
||||
return String.fromCharCode(48 + b);
|
||||
}
|
||||
|
||||
b -= 10;
|
||||
|
||||
if (b < 26)
|
||||
{
|
||||
return String.fromCharCode(65 + b);
|
||||
}
|
||||
|
||||
b -= 26;
|
||||
|
||||
if (b < 26)
|
||||
{
|
||||
return String.fromCharCode(97 + b);
|
||||
}
|
||||
|
||||
b -= 26;
|
||||
|
||||
if (b == 0)
|
||||
{
|
||||
return '-';
|
||||
}
|
||||
|
||||
if (b == 1)
|
||||
{
|
||||
return '_';
|
||||
}
|
||||
|
||||
return '?';
|
||||
}
|
||||
|
||||
// TODO: Remove unescape, use btoa for compatibility with graph.compress
|
||||
function compress(s)
|
||||
{
|
||||
return encode64(graph.bytesToString(
|
||||
pako.deflateRaw(unescape(
|
||||
encodeURIComponent(s)))));
|
||||
};
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', plantUmlServerUrl + compress(text), true);
|
||||
|
||||
if (type != 'plantUmlTxt')
|
||||
{
|
||||
xhr.responseType = 'blob';
|
||||
}
|
||||
|
||||
xhr.onload = function(e)
|
||||
{
|
||||
if (this.status >= 200 && this.status < 300)
|
||||
{
|
||||
if (type == 'plantUmlTxt')
|
||||
{
|
||||
editorUi.spinner.stop();
|
||||
graph.setSelectionCell(editorUi.insertAsPreText(
|
||||
this.response, insertPoint.x, insertPoint.y));
|
||||
graph.scrollCellToVisible(graph.getSelectionCell());
|
||||
}
|
||||
else
|
||||
{
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(this.response);
|
||||
|
||||
reader.onloadend = function(e)
|
||||
{
|
||||
var img = new Image();
|
||||
|
||||
img.onload = function()
|
||||
{
|
||||
editorUi.spinner.stop();
|
||||
var w = img.width;
|
||||
var h = img.height;
|
||||
|
||||
// Workaround for 0 image size in IE11
|
||||
if (w == 0 && h == 0)
|
||||
{
|
||||
var data = reader.result;
|
||||
var comma = data.indexOf(',');
|
||||
var svgText = decodeURIComponent(escape(atob(data.substring(comma + 1))));
|
||||
var root = mxUtils.parseXml(svgText);
|
||||
var svgs = root.getElementsByTagName('svg');
|
||||
|
||||
if (svgs.length > 0)
|
||||
{
|
||||
w = parseFloat(svgs[0].getAttribute('width'));
|
||||
h = parseFloat(svgs[0].getAttribute('height'));
|
||||
}
|
||||
}
|
||||
|
||||
graph.getModel().beginUpdate();
|
||||
try
|
||||
{
|
||||
cell = graph.insertVertex(null, null, text, insertPoint.x, insertPoint.y,
|
||||
w, h, 'shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;' +
|
||||
'image=' + editorUi.convertDataUri(reader.result) + ';');
|
||||
}
|
||||
finally
|
||||
{
|
||||
graph.getModel().endUpdate();
|
||||
}
|
||||
|
||||
graph.setSelectionCell(cell);
|
||||
graph.scrollCellToVisible(graph.getSelectionCell());
|
||||
};
|
||||
|
||||
img.src = reader.result;
|
||||
};
|
||||
|
||||
reader.onerror = function(e)
|
||||
{
|
||||
editorUi.handleError(e);
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
editorUi.spinner.stop();
|
||||
editorUi.handleError(e);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function(e)
|
||||
{
|
||||
editorUi.handleError(e);
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
else if (type == 'table')
|
||||
{
|
||||
|
@ -2958,18 +2972,16 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
|
|||
|
||||
if (title != null && title.length > 0)
|
||||
{
|
||||
var tempMode = (editorUi.mode == App.MODE_ONEDRIVE || editorUi.mode == App.MODE_TRELLO ||
|
||||
(editorUi.mode == App.MODE_GOOGLE && (editorUi.stateArg == null ||
|
||||
editorUi.stateArg.folderId == null))) ? editorUi.mode : null;
|
||||
|
||||
editorUi.pickFolder(tempMode, function(folderId)
|
||||
editorUi.pickFolder(editorUi.mode, function(folderId)
|
||||
{
|
||||
editorUi.createFile(title, templateXml, (templateLibs != null &&
|
||||
templateLibs.length > 0) ? templateLibs : null, null, function()
|
||||
{
|
||||
editorUi.hideDialog();
|
||||
}, null, folderId);
|
||||
});
|
||||
}, editorUi.mode != App.MODE_GOOGLE ||
|
||||
editorUi.stateArg == null ||
|
||||
editorUi.stateArg.folderId == null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5975,6 +5975,29 @@
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Inserts the given text as a preformatted HTML text.
|
||||
*/
|
||||
EditorUi.prototype.insertAsPreText = function(text, x, y)
|
||||
{
|
||||
var graph = this.editor.graph;
|
||||
var cell = null;
|
||||
|
||||
graph.getModel().beginUpdate();
|
||||
try
|
||||
{
|
||||
cell = graph.insertVertex(null, null, '<pre>' + text + '</pre>',
|
||||
x, y, 1, 1, 'text;html=1;align=center;verticalAlign=middle;');
|
||||
graph.updateCellSize(cell, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
graph.getModel().endUpdate();
|
||||
}
|
||||
|
||||
return cell;
|
||||
};
|
||||
|
||||
/**
|
||||
* Imports the given XML into the existing diagram.
|
||||
* TODO: Make this function asynchronous
|
||||
|
@ -7194,7 +7217,7 @@
|
|||
var editorUiInit = EditorUi.prototype.init;
|
||||
EditorUi.prototype.init = function()
|
||||
{
|
||||
mxStencilRegistry.allowEval = !this.isOfflineApp();
|
||||
mxStencilRegistry.allowEval = mxStencilRegistry.allowEval && !this.isOfflineApp();
|
||||
|
||||
// Must be set before UI is created in superclass
|
||||
if (typeof window.mxSettings !== 'undefined')
|
||||
|
|
|
@ -23,7 +23,7 @@ EditorUi.initMinimalTheme = function()
|
|||
'div.geDialog { border-radius: 5px; }' +
|
||||
'html body div.geDialog button.geBigButton { color: #fff !important; }' +
|
||||
'.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }' +
|
||||
'.mxWindow .geColorBtn, .geDialog .geColorBtn { background: none !important; }' +
|
||||
'html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }' +
|
||||
'html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }' +
|
||||
'div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }' +
|
||||
'div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }' +
|
||||
|
|
|
@ -613,11 +613,6 @@
|
|||
-clones[1].geometry.height - spacing;
|
||||
}
|
||||
|
||||
if (dir == mxConstants.DIRECTION_WEST)
|
||||
{
|
||||
clones[1].geometry.x = cell.geometry.x + cell.geometry.width - clones[1].geometry.width;
|
||||
}
|
||||
|
||||
if (graph.view.currentRoot != parent)
|
||||
{
|
||||
clones[1].geometry.x -= pgeo.x;
|
||||
|
|
21
src/main/webapp/js/embed-static.min.js
vendored
21
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:"9.0.0",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:"9.0.1",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/")||
|
||||
|
@ -1426,13 +1426,13 @@ this.currentState||this.isCellEnabled(this.currentState.cell)||(this.currentStat
|
|||
this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/c/c,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.isCellEnabled=function(a){return!0};mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y};
|
||||
mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}};
|
||||
mxConnectionHandler.prototype.mouseMove=function(a,b){if(b.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);var c=this.graph.getView(),d=c.scale,e=c.translate,c=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(c=new mxPoint((this.graph.snap(c.x/d-e.x)+e.x)*d,(this.graph.snap(c.y/d-e.y)+e.y)*d));
|
||||
this.snapToPreview(b,c);this.currentPoint=c;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(b,c);if(null!=this.first){var f=null,d=c;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(f=this.constraintHandler.currentConstraint,d=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())&&(Math.abs(this.previous.getCenterX()-
|
||||
c.x)<Math.abs(this.previous.getCenterY()-c.y)?c.x=this.previous.getCenterX():c.y=this.previous.getCenterY());e=this.first;if(null!=this.selectedIcon){var g=this.selectedIcon.bounds.width,h=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(g=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=g.x,this.selectedIcon.bounds.y=g.y):(g=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,g,h),this.selectedIcon.bounds=
|
||||
g);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(d,f),d=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],e=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(g=this.getTargetPerimeterPoint(this.currentState,b),null!=g&&(d=g)),null==this.sourceConstraint&&null!=this.previous&&(g=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:d,b),null!=g&&
|
||||
(e=g)));if(null==this.currentState&&this.movePreviewAway){g=e;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(f=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=f&&(g=f));f=d.x-g.x;g=d.y-g.y;h=Math.sqrt(f*f+g*g);if(0==h)return;this.originalPoint=d.clone();d.x-=4*f/h;d.y-=4*g/h}else this.originalPoint=null;null==this.shape&&(f=Math.abs(c.x-this.first.x),g=Math.abs(c.y-this.first.y),f>this.graph.tolerance||g>this.graph.tolerance)&&(this.shape=this.createShape(),
|
||||
null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,c));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(c=[e],null!=this.waypoints&&(c=c.concat(this.waypoints)),c.push(d),this.shape.points=c),this.drawPreview());null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),
|
||||
null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){c=!1;d=b.getSource();for(e=
|
||||
0;e<this.icons.length&&!c;e++)c=d==this.icons[e].node||d.parentNode==this.icons[e].node;c||this.updateIcons(this.currentState,this.icons,b)}}};
|
||||
this.snapToPreview(b,c);this.currentPoint=c;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(b.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(b.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(b,c);if(null!=this.first){var f=null,d=c;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(f=this.constraintHandler.currentConstraint,
|
||||
d=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())&&(Math.abs(this.previous.getCenterX()-c.x)<Math.abs(this.previous.getCenterY()-c.y)?c.x=this.previous.getCenterX():c.y=this.previous.getCenterY());e=this.first;if(null!=this.selectedIcon){var g=this.selectedIcon.bounds.width,h=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(g=this.getIconPosition(this.selectedIcon,
|
||||
this.currentState),this.selectedIcon.bounds.x=g.x,this.selectedIcon.bounds.y=g.y):(g=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,g,h),this.selectedIcon.bounds=g);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(d,f),d=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],e=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(g=this.getTargetPerimeterPoint(this.currentState,
|
||||
b),null!=g&&(d=g)),null==this.sourceConstraint&&null!=this.previous&&(g=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:d,b),null!=g&&(e=g)));if(null==this.currentState&&this.movePreviewAway){g=e;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(f=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=f&&(g=f));f=d.x-g.x;g=d.y-g.y;h=Math.sqrt(f*f+g*g);if(0==h)return;this.originalPoint=d.clone();d.x-=4*f/
|
||||
h;d.y-=4*g/h}else this.originalPoint=null;null==this.shape&&(f=Math.abs(b.getGraphX()-this.first.x),g=Math.abs(b.getGraphY()-this.first.y),f>this.graph.tolerance||g>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,c));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(c=[e],null!=this.waypoints&&(c=c.concat(this.waypoints)),c.push(d),this.shape.points=c),this.drawPreview());
|
||||
null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!=
|
||||
this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){c=!1;d=b.getSource();for(e=0;e<this.icons.length&&!c;e++)c=d==this.icons[e].node||d.parentNode==this.icons[e].node;c||this.updateIcons(this.currentState,this.icons,b)}}};
|
||||
mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]);
|
||||
this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));var c=null;if(null!=this.waypoints)for(var c=[],d=0;d<this.waypoints.length;d++){var e=this.waypoints[d].clone();
|
||||
this.convertWaypoint(e);c[d]=e}this.graph.view.updatePoints(this.edgeState,c,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};
|
||||
|
@ -1615,9 +1615,8 @@ HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangle
|
|||
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
|
||||
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(a){this.reset()}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||
|
||||
!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var c=d.getEvent();if(this.isResetEvent(c))this.reset();else if(!this.isActive()){var f=this.getState(d.getState());null==f&&mxEvent.isTouchEvent(c)||this.update(f)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var c=d.getEvent();this.isResetEvent(c)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(c)||
|
||||
this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var c=d.getEvent();this.isResetEvent(c)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(d.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(d.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?b||this.click(this.currentState,this.getDirection(),d):this.isActive()?1==
|
||||
this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(c)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(c)||this.reset();b=!1;this.resetActiveArrow()})})};
|
||||
HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
||||
this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var c=d.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));this.isResetEvent(c)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
|
||||
this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(c)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(c)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
||||
HoverIcons.prototype.createArrow=function(a,b){var c=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(c=document.createElement(mxClient.VML_PREFIX+":image"),c.setAttribute("src",a.src),c.style.borderStyle="none"):(c=document.createElement("div"),c.style.backgroundImage="url("+a.src+")",c.style.backgroundPosition="center",c.style.backgroundRepeat="no-repeat"),c.style.width=a.width+4+"px",c.style.height=a.height+4+"px",c.style.display=mxClient.IS_QUIRKS?"inline":
|
||||
"inline-block"):(c=mxUtils.createImage(a.src),c.style.width=a.width+"px",c.style.height=a.height+"px",c.style.padding=this.tolerance+"px");null!=b&&c.setAttribute("title",b);c.style.position="absolute";c.style.cursor=this.cssCursor;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){null==this.currentState||this.isResetEvent(a)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),
|
||||
this.activeArrow=c,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redirectMouseEvents(c,this.graph,this.currentState);mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=c&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(c,100),this.activeArrow=c)}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||
|
||||
|
|
|
@ -3159,10 +3159,12 @@ HoverIcons.prototype.init = function()
|
|||
}
|
||||
else if (!this.graph.isMouseDown && !mxEvent.isTouchEvent(evt))
|
||||
{
|
||||
this.update(this.getState(me.getState()), me.getGraphX(), me.getGraphY());
|
||||
this.update(this.getState(me.getState()),
|
||||
me.getGraphX(), me.getGraphY());
|
||||
}
|
||||
|
||||
if (this.graph.connectionHandler != null && this.graph.connectionHandler.shape != null)
|
||||
if (this.graph.connectionHandler != null &&
|
||||
this.graph.connectionHandler.shape != null)
|
||||
{
|
||||
connectionHandlerActive = true;
|
||||
}
|
||||
|
@ -3170,34 +3172,34 @@ HoverIcons.prototype.init = function()
|
|||
mouseUp: mxUtils.bind(this, function(sender, me)
|
||||
{
|
||||
var evt = me.getEvent();
|
||||
var pt = mxUtils.convertPoint(this.graph.container,
|
||||
mxEvent.getClientX(evt), mxEvent.getClientY(evt))
|
||||
|
||||
if (this.isResetEvent(evt))
|
||||
{
|
||||
this.reset();
|
||||
}
|
||||
else if (this.isActive() && this.mouseDownPoint != null &&
|
||||
Math.abs(me.getGraphX() - this.mouseDownPoint.x) < this.graph.tolerance &&
|
||||
Math.abs(me.getGraphY() - this.mouseDownPoint.y) < this.graph.tolerance)
|
||||
else if (this.isActive() && !connectionHandlerActive &&
|
||||
this.mouseDownPoint != null)
|
||||
{
|
||||
// Executes click event on highlighted arrow
|
||||
if (!connectionHandlerActive)
|
||||
{
|
||||
this.click(this.currentState, this.getDirection(), me);
|
||||
}
|
||||
this.click(this.currentState, this.getDirection(), me);
|
||||
}
|
||||
else if (this.isActive())
|
||||
{
|
||||
// Selects target vertex after drag and clone if not only new edge was inserted
|
||||
if (this.graph.getSelectionCount() != 1 || !this.graph.model.isEdge(this.graph.getSelectionCell()))
|
||||
if (this.graph.getSelectionCount() != 1 || !this.graph.model.isEdge(
|
||||
this.graph.getSelectionCell()))
|
||||
{
|
||||
this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(me.getGraphX(), me.getGraphY()))));
|
||||
this.update(this.getState(this.graph.view.getState(
|
||||
this.graph.getCellAt(me.getGraphX(), me.getGraphY()))));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
else if (mxEvent.isTouchEvent(evt) || (this.bbox != null && mxUtils.contains(this.bbox, me.getGraphX(), me.getGraphY())))
|
||||
else if (mxEvent.isTouchEvent(evt) || (this.bbox != null &&
|
||||
mxUtils.contains(this.bbox, me.getGraphX(), me.getGraphY())))
|
||||
{
|
||||
// Shows existing hover icons if inside bounding box
|
||||
this.setDisplay('');
|
||||
|
|
21
src/main/webapp/js/reader.min.js
vendored
21
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:"9.0.0",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:"9.0.1",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/")||
|
||||
|
@ -1426,13 +1426,13 @@ this.currentState||this.isCellEnabled(this.currentState.cell)||(this.currentStat
|
|||
this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/c/c,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.isCellEnabled=function(a){return!0};mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y};
|
||||
mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}};
|
||||
mxConnectionHandler.prototype.mouseMove=function(a,b){if(b.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);var c=this.graph.getView(),d=c.scale,e=c.translate,c=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(c=new mxPoint((this.graph.snap(c.x/d-e.x)+e.x)*d,(this.graph.snap(c.y/d-e.y)+e.y)*d));
|
||||
this.snapToPreview(b,c);this.currentPoint=c;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(b,c);if(null!=this.first){var f=null,d=c;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(f=this.constraintHandler.currentConstraint,d=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())&&(Math.abs(this.previous.getCenterX()-
|
||||
c.x)<Math.abs(this.previous.getCenterY()-c.y)?c.x=this.previous.getCenterX():c.y=this.previous.getCenterY());e=this.first;if(null!=this.selectedIcon){var g=this.selectedIcon.bounds.width,h=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(g=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=g.x,this.selectedIcon.bounds.y=g.y):(g=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,g,h),this.selectedIcon.bounds=
|
||||
g);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(d,f),d=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],e=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(g=this.getTargetPerimeterPoint(this.currentState,b),null!=g&&(d=g)),null==this.sourceConstraint&&null!=this.previous&&(g=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:d,b),null!=g&&
|
||||
(e=g)));if(null==this.currentState&&this.movePreviewAway){g=e;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(f=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=f&&(g=f));f=d.x-g.x;g=d.y-g.y;h=Math.sqrt(f*f+g*g);if(0==h)return;this.originalPoint=d.clone();d.x-=4*f/h;d.y-=4*g/h}else this.originalPoint=null;null==this.shape&&(f=Math.abs(c.x-this.first.x),g=Math.abs(c.y-this.first.y),f>this.graph.tolerance||g>this.graph.tolerance)&&(this.shape=this.createShape(),
|
||||
null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,c));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(c=[e],null!=this.waypoints&&(c=c.concat(this.waypoints)),c.push(d),this.shape.points=c),this.drawPreview());null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),
|
||||
null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){c=!1;d=b.getSource();for(e=
|
||||
0;e<this.icons.length&&!c;e++)c=d==this.icons[e].node||d.parentNode==this.icons[e].node;c||this.updateIcons(this.currentState,this.icons,b)}}};
|
||||
this.snapToPreview(b,c);this.currentPoint=c;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(b.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(b.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(b,c);if(null!=this.first){var f=null,d=c;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(f=this.constraintHandler.currentConstraint,
|
||||
d=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())&&(Math.abs(this.previous.getCenterX()-c.x)<Math.abs(this.previous.getCenterY()-c.y)?c.x=this.previous.getCenterX():c.y=this.previous.getCenterY());e=this.first;if(null!=this.selectedIcon){var g=this.selectedIcon.bounds.width,h=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(g=this.getIconPosition(this.selectedIcon,
|
||||
this.currentState),this.selectedIcon.bounds.x=g.x,this.selectedIcon.bounds.y=g.y):(g=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,g,h),this.selectedIcon.bounds=g);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(d,f),d=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],e=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(g=this.getTargetPerimeterPoint(this.currentState,
|
||||
b),null!=g&&(d=g)),null==this.sourceConstraint&&null!=this.previous&&(g=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:d,b),null!=g&&(e=g)));if(null==this.currentState&&this.movePreviewAway){g=e;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(f=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=f&&(g=f));f=d.x-g.x;g=d.y-g.y;h=Math.sqrt(f*f+g*g);if(0==h)return;this.originalPoint=d.clone();d.x-=4*f/
|
||||
h;d.y-=4*g/h}else this.originalPoint=null;null==this.shape&&(f=Math.abs(b.getGraphX()-this.first.x),g=Math.abs(b.getGraphY()-this.first.y),f>this.graph.tolerance||g>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,c));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(c=[e],null!=this.waypoints&&(c=c.concat(this.waypoints)),c.push(d),this.shape.points=c),this.drawPreview());
|
||||
null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!=
|
||||
this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){c=!1;d=b.getSource();for(e=0;e<this.icons.length&&!c;e++)c=d==this.icons[e].node||d.parentNode==this.icons[e].node;c||this.updateIcons(this.currentState,this.icons,b)}}};
|
||||
mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]);
|
||||
this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));var c=null;if(null!=this.waypoints)for(var c=[],d=0;d<this.waypoints.length;d++){var e=this.waypoints[d].clone();
|
||||
this.convertWaypoint(e);c[d]=e}this.graph.view.updatePoints(this.edgeState,c,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};
|
||||
|
@ -1615,9 +1615,8 @@ HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangle
|
|||
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
|
||||
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(a){this.reset()}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||
|
||||
!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var c=d.getEvent();if(this.isResetEvent(c))this.reset();else if(!this.isActive()){var f=this.getState(d.getState());null==f&&mxEvent.isTouchEvent(c)||this.update(f)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var c=d.getEvent();this.isResetEvent(c)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(c)||
|
||||
this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var c=d.getEvent();this.isResetEvent(c)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(d.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(d.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?b||this.click(this.currentState,this.getDirection(),d):this.isActive()?1==
|
||||
this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(c)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(c)||this.reset();b=!1;this.resetActiveArrow()})})};
|
||||
HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
||||
this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var c=d.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));this.isResetEvent(c)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
|
||||
this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(c)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(c)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
||||
HoverIcons.prototype.createArrow=function(a,b){var c=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(c=document.createElement(mxClient.VML_PREFIX+":image"),c.setAttribute("src",a.src),c.style.borderStyle="none"):(c=document.createElement("div"),c.style.backgroundImage="url("+a.src+")",c.style.backgroundPosition="center",c.style.backgroundRepeat="no-repeat"),c.style.width=a.width+4+"px",c.style.height=a.height+4+"px",c.style.display=mxClient.IS_QUIRKS?"inline":
|
||||
"inline-block"):(c=mxUtils.createImage(a.src),c.style.width=a.width+"px",c.style.height=a.height+"px",c.style.padding=this.tolerance+"px");null!=b&&c.setAttribute("title",b);c.style.position="absolute";c.style.cursor=this.cssCursor;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){null==this.currentState||this.isResetEvent(a)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),
|
||||
this.activeArrow=c,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redirectMouseEvents(c,this.graph,this.currentState);mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=c&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(c,100),this.activeArrow=c)}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||
|
||||
|
|
1759
src/main/webapp/js/viewer.min.js
vendored
1759
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