|
|
|
@ -226,7 +226,8 @@ String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromC
|
|
|
|
|
window.DRAWIO_LIGHTBOX_URL=window.DRAWIO_LIGHTBOX_URL||"https://viewer.diagrams.net";window.EXPORT_URL=window.EXPORT_URL||"https://exp.draw.io/ImageExport4/export";window.PLANT_URL=window.PLANT_URL||"https://plant-aws.diagrams.net";window.DRAW_MATH_URL=window.DRAW_MATH_URL||window.DRAWIO_BASE_URL+"/math";window.VSD_CONVERT_URL=window.VSD_CONVERT_URL||"https://convert.draw.io/VsdConverter/api/converter";window.EMF_CONVERT_URL=window.EMF_CONVERT_URL||"https://convert.draw.io/emf2png/convertEMF";
|
|
|
|
|
window.REALTIME_URL=window.REALTIME_URL||"cache";window.DRAWIO_GITLAB_URL=window.DRAWIO_GITLAB_URL||"https://gitlab.com";window.DRAWIO_GITLAB_ID=window.DRAWIO_GITLAB_ID||"5cdc018a32acddf6eba37592d9374945241e644b8368af847422d74c8709bc44";window.SAVE_URL=window.SAVE_URL||"save";window.OPEN_URL=window.OPEN_URL||"import";window.PROXY_URL=window.PROXY_URL||"proxy";window.DRAWIO_VIEWER_URL=window.DRAWIO_VIEWER_URL||null;window.SHAPES_PATH=window.SHAPES_PATH||"shapes";
|
|
|
|
|
window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||((null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE")||urlParams.dev)&&"file:"!=window.location.protocol?"iconSearch":window.DRAWIO_BASE_URL+"/iconSearch");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.NEW_DIAGRAM_CATS_PATH=window.NEW_DIAGRAM_CATS_PATH||"newDiagramCats";window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";
|
|
|
|
|
window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_CONFIG=window.DRAWIO_CONFIG||null;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||function(){var a=urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null)}catch(c){isLocalStorage=!1}return a}();
|
|
|
|
|
window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_CONFIG=window.DRAWIO_CONFIG||null;window.mxLoadResources=window.mxLoadResources||!1;
|
|
|
|
|
window.mxLanguage=window.mxLanguage||function(){var a=urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null);if(!a&&window.mxIsElectron&&(a=require("electron").remote.app.getLocale(),null!=a)){var c=a.indexOf("-");0<=c&&(a=a.substring(0,c));a=a.toLowerCase()}}catch(d){isLocalStorage=!1}return a}();
|
|
|
|
|
window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",eu:"Euskadi",fil:"Filipino",fr:"Français",gl:"Galego",it:"Italiano",hu:"Magyar",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά",ru:"Русский",sr:"Српски",uk:"Українська",
|
|
|
|
|
he:"עברית",ar:"العربية",th:"ไทย",ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph");if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang)}
|
|
|
|
|
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}try{null==a&&414>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)&&(a="min")}catch(c){}return a}();function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
|
|
|
|
@ -9106,32 +9107,31 @@ var StorageDialog=function(a,e,c){function b(b,m,f,k,q,v){function n(){mxEvent.a
|
|
|
|
|
"nowrap";p.setAttribute("title",m);mxClient.IS_QUIRKS&&(p.style.cssFloat="left",p.style.zoom="1");var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.overflow="hidden";t.style.position="absolute";t.style.bottom="8px";t.style.left="0px";t.style.right="0px";mxUtils.write(t,m);p.appendChild(t);if(null!=b){var z=document.createElement("img");z.setAttribute("src",b);z.setAttribute("border","0");z.setAttribute("align","absmiddle");z.style.width="60px";z.style.height="60px";z.style.paddingBottom=
|
|
|
|
|
"6px";p.appendChild(z)}else t.style.paddingTop="5px",t.style.whiteSpace="normal",mxClient.IS_IOS?(p.style.padding="0px 10px 20px 10px",p.style.top="6px"):mxClient.IS_FF&&(t.style.paddingTop="0px",t.style.marginTop="-2px");if(null!=q)for(b=0;b<q.length;b++)mxUtils.br(t),mxUtils.write(t,q[b]);if(null!=k&&null==a[k]){z.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=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});u.spin(p);var C=window.setTimeout(function(){null==a[k]&&(u.stop(),p.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(d,b){null!=a[k]&&b.getProperty("client")==a[k]&&(window.clearTimeout(C),mxUtils.setOpacity(t,100),z.style.visibility="",u.stop(),n(),"drive"==k&&null!=g.parentNode&&g.parentNode.removeChild(g))}))}else n();d.appendChild(p)}c=null!=c?c:2;var k=document.createElement("div");k.style.textAlign="center";k.style.whiteSpace=
|
|
|
|
|
"nowrap";k.style.paddingTop="0px";k.style.paddingBottom="20px";this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)demo.style.marginLeft=-Math.round(demo.clientWidth/2)+"px"};var f=document.createElement("div");f.style.border="1px solid #d3d3d3";f.style.borderWidth="1px 0px 1px 0px";f.style.padding="10px 0px 20px 0px";mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");var l=0,d=document.createElement("div");d.style.paddingTop="2px";f.appendChild(d);var g=document.createElement("p"),
|
|
|
|
|
m=document.createElement("p");m.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(m,mxResources.get("saveDiagramsTo")+":");k.appendChild(m);k.appendChild(f);l=0;"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");b(IMAGE_PATH+"/osa_drive-harddisk.png",
|
|
|
|
|
mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&b(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=a.gitHub&&b(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=a.gitLab&&b(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,
|
|
|
|
|
"gitLab");f=document.createElement("span");f.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(f.style,"transform","translate(-50%,0)");mxUtils.write(f,mxResources.get("decideLater"));mxEvent.addListener(f,"click",function(){a.hideDialog();var d=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=d});k.appendChild(f);mxClient.IS_SVG&&isLocalStorage&&
|
|
|
|
|
"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(g.style.padding="7px",g.style.fontSize="9pt",g.style.marginTop="-14px",g.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+
|
|
|
|
|
"</a>",k.appendChild(g))},5E3);this.container=k},SplashDialog=function(a){var e=document.createElement("div");e.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var c=a.addLanguageMenu(e,!0);null!=c&&(c.style.bottom="19px")}a.getServiceCount();var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("align","absmiddle");b.style.width="32px";b.style.height="32px";b.style.marginRight="8px";b.style.marginTop="-4px";var k=document.createElement("div");
|
|
|
|
|
k.style.margin="8px 0px 0px 0px";k.style.padding="18px 0px 24px 0px";c="";a.mode==App.MODE_GOOGLE?(b.src=IMAGE_PATH+"/google-drive-logo.svg",c=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(b.src=IMAGE_PATH+"/dropbox-logo.svg",c=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(b.src=IMAGE_PATH+"/onedrive-logo.svg",c=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(b.src=IMAGE_PATH+"/github-logo.svg",c=mxResources.get("github")):a.mode==App.MODE_GITLAB?(b.src=IMAGE_PATH+"/gitlab-logo.svg",
|
|
|
|
|
c=mxResources.get("gitlab")):a.mode==App.MODE_BROWSER?(b.src=IMAGE_PATH+"/osa_database.png",c=mxResources.get("browser")):a.mode==App.MODE_TRELLO?(b.src=IMAGE_PATH+"/trello-logo.svg",c=mxResources.get("trello")):(b.src=IMAGE_PATH+"/osa_drive-harddisk.png",k.style.paddingBottom="10px",k.style.paddingTop="30px",c=mxResources.get("device"));var f=document.createElement("button");f.className="geBigButton";f.style.marginBottom="8px";f.style.fontSize="18px";f.style.padding="10px";f.style.width="340px";
|
|
|
|
|
if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)k.style.padding="42px 0px 56px 0px",f.style.marginBottom="12px";else{k.style.border="1px solid #d3d3d3";k.style.borderWidth="1px 0px 1px 0px";var l=document.createElement("table"),d=document.createElement("tbody"),g=document.createElement("tr"),m=document.createElement("td"),n=document.createElement("td");l.setAttribute("align","center");m.appendChild(b);b=document.createElement("div");b.style.fontSize="22px";b.style.paddingBottom="6px";b.style.color=
|
|
|
|
|
"gray";mxUtils.write(b,c);n.style.textAlign="left";n.appendChild(b);g.appendChild(m);g.appendChild(n);d.appendChild(g);l.appendChild(d);e.appendChild(l);c=document.createElement("span");c.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0)");mxUtils.write(c,mxResources.get("changeStorage"));mxEvent.addListener(c,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();
|
|
|
|
|
a.showSplash(!0)});e.appendChild(c)}mxClient.IS_QUIRKS&&(k.style.whiteSpace="nowrap",k.style.cssFloat="left");mxClient.IS_QUIRKS&&(f.style.width="340px");mxUtils.write(f,mxResources.get("createNewDiagram"));mxEvent.addListener(f,"click",function(){a.hideDialog();a.actions.get("new").funct()});k.appendChild(f);mxUtils.br(k);f=document.createElement("button");f.className="geBigButton";f.style.marginBottom="22px";f.style.fontSize="18px";f.style.padding="10px";f.style.width="340px";mxClient.IS_QUIRKS&&
|
|
|
|
|
(f.style.width="340px");mxUtils.write(f,mxResources.get("openExistingDiagram"));mxEvent.addListener(f,"click",function(){a.actions.get("open").funct()});k.appendChild(f);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_GITLAB?mxResources.get("gitlab"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?
|
|
|
|
|
mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(c=function(d){f.style.marginBottom="24px";var b=document.createElement("a");b.style.display="inline-block";b.style.color="gray";b.style.cursor="pointer";b.style.marginTop="6px";mxUtils.write(b,mxResources.get("signOut"));f.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(b,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){d()})});
|
|
|
|
|
k.appendChild(b)},a.mode==App.MODE_GOOGLE&&null!=a.drive){var p=a.drive.getUsersList();if(0<p.length){b=document.createElement("span");b.style.marginTop="6px";mxUtils.write(b,mxResources.get("changeUser")+":");f.style.marginBottom="16px";k.style.paddingBottom="18px";k.appendChild(b);var t=document.createElement("select");t.style.marginLeft="4px";t.style.width="140px";for(c=0;c<p.length;c++)l=document.createElement("option"),mxUtils.write(l,p[c].displayName),l.value=c,t.appendChild(l),l=document.createElement("option"),
|
|
|
|
|
l.innerHTML=" ",mxUtils.write(l,"<"+p[c].email+">"),l.setAttribute("disabled","disabled"),t.appendChild(l);l=document.createElement("option");mxUtils.write(l,mxResources.get("addAccount"));l.value=p.length;t.appendChild(l);mxEvent.addListener(t,"change",function(){var d=t.value,b=p.length!=d;b&&a.drive.setUser(p[d]);a.drive.authorize(b,function(){a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash()},function(d){a.handleError(d,null,function(){a.hideDialog();a.showSplash()})},
|
|
|
|
|
!0)});k.appendChild(t)}else c(function(){a.drive.logout()})}else a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?c(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?c(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_GITLAB&&null!=a.gitLab?c(function(){a.gitLab.logout();a.openLink(DRAWIO_GITLAB_URL+"/users/sign_out")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&c(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&
|
|
|
|
|
null!=a.dropbox&&c(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")});e.appendChild(k);this.container=e},EmbedDialog=function(a,e,c,b,k,f,l){l=null!=l?l:"Check out the diagram I made using @drawio";b=document.createElement("div");var d=/^https?:\/\//.test(e)||/^mailto:\/\//.test(e);null!=f?mxUtils.write(b,f):mxUtils.write(b,mxResources.get(5E5>e.length?d?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(b);f=document.createElement("div");f.style.position="absolute";f.style.top=
|
|
|
|
|
"30px";f.style.right="30px";f.style.color="gray";mxUtils.write(f,a.formatFileSize(e.length));b.appendChild(f);var g=document.createElement("textarea");g.setAttribute("autocomplete","off");g.setAttribute("autocorrect","off");g.setAttribute("autocapitalize","off");g.setAttribute("spellcheck","false");g.style.fontFamily="monospace";g.style.wordBreak="break-all";g.style.marginTop="10px";g.style.resize="none";g.style.height="150px";g.style.width="440px";g.style.border="1px solid gray";g.value=mxResources.get("updatingDocument");
|
|
|
|
|
b.appendChild(g);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>e.length?(g.value=e,g.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null)):(g.setAttribute("readonly","true"),g.value=mxResources.get("tooLargeUseDownload"))},0)};f=document.createElement("div");f.style.position="absolute";f.style.bottom="36px";f.style.right="32px";var m=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&
|
|
|
|
|
!d||navigator.standalone||!(d||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(mxResources.get(5E5>e.length?"preview":"openInNewWindow"),function(){var b=5E5>e.length?g.value:e;if(null!=k)k(b);else if(d)try{var m=a.openLink(b);null!=m&&(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=m&&null!=m.location.href&&m.location.href.substring(0,8)!=b.substring(0,8)&&(m.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}catch(v){}}),
|
|
|
|
|
c||500)}catch(v){a.handleError({message:v.message||mxResources.get("drawingTooLarge")})}else{var f=window.open(),f=null!=f?f.document:null;null!=f?(f.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+e+"</body></html>"),f.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),m.className="geBtn",f.appendChild(m));if(!d||7500<e.length){var n=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();
|
|
|
|
|
a.saveData("embed.txt","txt",e,"text/plain")});n.className="geBtn";f.appendChild(n)}if(d&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>e.length){var p=mxUtils.button("",function(){try{var d="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(g.value);a.openLink(d)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),n=document.createElement("img");n.setAttribute("src",Editor.facebookImage);n.setAttribute("width","18");n.setAttribute("height","18");n.setAttribute("border",
|
|
|
|
|
"0");p.appendChild(n);p.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");p.style.verticalAlign="bottom";p.style.paddingTop="4px";p.style.minWidth="46px";p.className="geBtn";f.appendChild(p)}7168>e.length&&(p=mxUtils.button("",function(){try{var d="https://twitter.com/intent/tweet?text="+encodeURIComponent(l)+"&url="+encodeURIComponent(g.value);a.openLink(d)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),n=document.createElement("img"),
|
|
|
|
|
n.setAttribute("src",Editor.tweetImage),n.setAttribute("width","18"),n.setAttribute("height","18"),n.setAttribute("border","0"),n.style.marginBottom="5px",p.appendChild(n),p.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),p.style.verticalAlign="bottom",p.style.paddingTop="4px",p.style.minWidth="46px",p.className="geBtn",f.appendChild(p))}n=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.appendChild(n);p=mxUtils.button(mxResources.get("copy"),
|
|
|
|
|
function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>e.length?mxClient.IS_SF||null!=document.documentMode?n.className="geBtn gePrimaryBtn":(f.appendChild(p),p.className="geBtn gePrimaryBtn",n.className="geBtn"):(f.appendChild(m),n.className="geBtn",m.className="geBtn gePrimaryBtn");b.appendChild(f);this.container=b};
|
|
|
|
|
EmbedDialog.showPreviewOption=!0;
|
|
|
|
|
"nowrap";k.style.paddingTop="0px";k.style.paddingBottom="20px";var f=document.createElement("div");f.style.border="1px solid #d3d3d3";f.style.borderWidth="1px 0px 1px 0px";f.style.padding="10px 0px 20px 0px";mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");var l=0,d=document.createElement("div");d.style.paddingTop="2px";f.appendChild(d);var g=document.createElement("p"),m=document.createElement("p");m.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";
|
|
|
|
|
mxUtils.write(m,mxResources.get("saveDiagramsTo")+":");k.appendChild(m);k.appendChild(f);l=0;"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");b(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||
|
|
|
|
|
b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&b(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=a.gitHub&&b(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=a.gitLab&&b(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");f=document.createElement("span");f.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";
|
|
|
|
|
mxUtils.setPrefixedStyle(f.style,"transform","translate(-50%,0)");mxUtils.write(f,mxResources.get("decideLater"));mxEvent.addListener(f,"click",function(){a.hideDialog();var d=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=d});k.appendChild(f);mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(g.style.padding="7px",g.style.fontSize=
|
|
|
|
|
"9pt",g.style.marginTop="-14px",g.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",k.appendChild(g))},5E3);this.container=k},SplashDialog=function(a){var e=document.createElement("div");e.style.textAlign="center";if(mxClient.IS_CHROMEAPP||
|
|
|
|
|
EditorUi.isElectronApp){var c=a.addLanguageMenu(e,!0);null!=c&&(c.style.bottom="19px")}a.getServiceCount();var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("align","absmiddle");b.style.width="32px";b.style.height="32px";b.style.marginRight="8px";b.style.marginTop="-4px";var k=document.createElement("div");k.style.margin="8px 0px 0px 0px";k.style.padding="18px 0px 24px 0px";c="";a.mode==App.MODE_GOOGLE?(b.src=IMAGE_PATH+"/google-drive-logo.svg",c=mxResources.get("googleDrive")):
|
|
|
|
|
a.mode==App.MODE_DROPBOX?(b.src=IMAGE_PATH+"/dropbox-logo.svg",c=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(b.src=IMAGE_PATH+"/onedrive-logo.svg",c=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(b.src=IMAGE_PATH+"/github-logo.svg",c=mxResources.get("github")):a.mode==App.MODE_GITLAB?(b.src=IMAGE_PATH+"/gitlab-logo.svg",c=mxResources.get("gitlab")):a.mode==App.MODE_BROWSER?(b.src=IMAGE_PATH+"/osa_database.png",c=mxResources.get("browser")):a.mode==App.MODE_TRELLO?(b.src=IMAGE_PATH+
|
|
|
|
|
"/trello-logo.svg",c=mxResources.get("trello")):(b.src=IMAGE_PATH+"/osa_drive-harddisk.png",k.style.paddingBottom="10px",k.style.paddingTop="30px",c=mxResources.get("device"));var f=document.createElement("button");f.className="geBigButton";f.style.marginBottom="8px";f.style.fontSize="18px";f.style.padding="10px";f.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)k.style.padding="42px 0px 56px 0px",f.style.marginBottom="12px";else{k.style.border="1px solid #d3d3d3";k.style.borderWidth=
|
|
|
|
|
"1px 0px 1px 0px";var l=document.createElement("table"),d=document.createElement("tbody"),g=document.createElement("tr"),m=document.createElement("td"),n=document.createElement("td");l.setAttribute("align","center");m.appendChild(b);b=document.createElement("div");b.style.fontSize="22px";b.style.paddingBottom="6px";b.style.color="gray";mxUtils.write(b,c);n.style.textAlign="left";n.appendChild(b);g.appendChild(m);g.appendChild(n);d.appendChild(g);l.appendChild(d);e.appendChild(l);c=document.createElement("span");
|
|
|
|
|
c.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(c.style,"transform","translate(-50%,0)");mxUtils.write(c,mxResources.get("changeStorage"));mxEvent.addListener(c,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)});e.appendChild(c)}mxClient.IS_QUIRKS&&(k.style.whiteSpace="nowrap",k.style.cssFloat="left");mxClient.IS_QUIRKS&&(f.style.width="340px");mxUtils.write(f,mxResources.get("createNewDiagram"));
|
|
|
|
|
mxEvent.addListener(f,"click",function(){a.hideDialog();a.actions.get("new").funct()});k.appendChild(f);mxUtils.br(k);f=document.createElement("button");f.className="geBigButton";f.style.marginBottom="22px";f.style.fontSize="18px";f.style.padding="10px";f.style.width="340px";mxClient.IS_QUIRKS&&(f.style.width="340px");mxUtils.write(f,mxResources.get("openExistingDiagram"));mxEvent.addListener(f,"click",function(){a.actions.get("open").funct()});k.appendChild(f);a.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):
|
|
|
|
|
a.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?mxResources.get("github"):a.mode==App.MODE_GITLAB?mxResources.get("gitlab"):a.mode==App.MODE_TRELLO?mxResources.get("trello"):a.mode==App.MODE_DEVICE?mxResources.get("device"):a.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(c=function(d){f.style.marginBottom="24px";var b=document.createElement("a");b.style.display=
|
|
|
|
|
"inline-block";b.style.color="gray";b.style.cursor="pointer";b.style.marginTop="6px";mxUtils.write(b,mxResources.get("signOut"));f.style.marginBottom="16px";k.style.paddingBottom="18px";mxEvent.addListener(b,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){d()})});k.appendChild(b)},a.mode==App.MODE_GOOGLE&&null!=a.drive){var p=a.drive.getUsersList();if(0<p.length){b=document.createElement("span");b.style.marginTop="6px";mxUtils.write(b,mxResources.get("changeUser")+":");f.style.marginBottom=
|
|
|
|
|
"16px";k.style.paddingBottom="18px";k.appendChild(b);var t=document.createElement("select");t.style.marginLeft="4px";t.style.width="140px";for(c=0;c<p.length;c++)l=document.createElement("option"),mxUtils.write(l,p[c].displayName),l.value=c,t.appendChild(l),l=document.createElement("option"),l.innerHTML=" ",mxUtils.write(l,"<"+p[c].email+">"),l.setAttribute("disabled","disabled"),t.appendChild(l);l=document.createElement("option");mxUtils.write(l,mxResources.get("addAccount"));l.value=
|
|
|
|
|
p.length;t.appendChild(l);mxEvent.addListener(t,"change",function(){var d=t.value,b=p.length!=d;b&&a.drive.setUser(p[d]);a.drive.authorize(b,function(){a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash()},function(d){a.handleError(d,null,function(){a.hideDialog();a.showSplash()})},!0)});k.appendChild(t)}else c(function(){a.drive.logout()})}else a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?c(function(){a.oneDrive.logout()}):a.mode==App.MODE_GITHUB&&null!=a.gitHub?c(function(){a.gitHub.logout();
|
|
|
|
|
a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_GITLAB&&null!=a.gitLab?c(function(){a.gitLab.logout();a.openLink(DRAWIO_GITLAB_URL+"/users/sign_out")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&c(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&c(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")});e.appendChild(k);this.container=e},EmbedDialog=function(a,e,c,b,k,f,l){l=null!=l?l:"Check out the diagram I made using @drawio";
|
|
|
|
|
b=document.createElement("div");var d=/^https?:\/\//.test(e)||/^mailto:\/\//.test(e);null!=f?mxUtils.write(b,f):mxUtils.write(b,mxResources.get(5E5>e.length?d?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(b);f=document.createElement("div");f.style.position="absolute";f.style.top="30px";f.style.right="30px";f.style.color="gray";mxUtils.write(f,a.formatFileSize(e.length));b.appendChild(f);var g=document.createElement("textarea");g.setAttribute("autocomplete","off");g.setAttribute("autocorrect",
|
|
|
|
|
"off");g.setAttribute("autocapitalize","off");g.setAttribute("spellcheck","false");g.style.fontFamily="monospace";g.style.wordBreak="break-all";g.style.marginTop="10px";g.style.resize="none";g.style.height="150px";g.style.width="440px";g.style.border="1px solid gray";g.value=mxResources.get("updatingDocument");b.appendChild(g);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>e.length?(g.value=e,g.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?
|
|
|
|
|
g.select():document.execCommand("selectAll",!1,null)):(g.setAttribute("readonly","true"),g.value=mxResources.get("tooLargeUseDownload"))},0)};f=document.createElement("div");f.style.position="absolute";f.style.bottom="36px";f.style.right="32px";var m=null;!EmbedDialog.showPreviewOption||mxClient.IS_CHROMEAPP&&!d||navigator.standalone||!(d||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(m=mxUtils.button(mxResources.get(5E5>e.length?"preview":"openInNewWindow"),function(){var b=
|
|
|
|
|
5E5>e.length?g.value:e;if(null!=k)k(b);else if(d)try{var m=a.openLink(b);null!=m&&(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=m&&null!=m.location.href&&m.location.href.substring(0,8)!=b.substring(0,8)&&(m.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}catch(v){}}),c||500)}catch(v){a.handleError({message:v.message||mxResources.get("drawingTooLarge")})}else{var f=window.open(),f=null!=f?f.document:null;null!=f?(f.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+
|
|
|
|
|
'</title><meta charset="utf-8"></head><body>'+e+"</body></html>"),f.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),m.className="geBtn",f.appendChild(m));if(!d||7500<e.length){var n=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();a.saveData("embed.txt","txt",e,"text/plain")});n.className="geBtn";f.appendChild(n)}if(d&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>e.length){var p=mxUtils.button("",function(){try{var d="https://www.facebook.com/sharer.php?p[url]="+
|
|
|
|
|
encodeURIComponent(g.value);a.openLink(d)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),n=document.createElement("img");n.setAttribute("src",Editor.facebookImage);n.setAttribute("width","18");n.setAttribute("height","18");n.setAttribute("border","0");p.appendChild(n);p.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");p.style.verticalAlign="bottom";p.style.paddingTop="4px";p.style.minWidth="46px";p.className="geBtn";f.appendChild(p)}7168>
|
|
|
|
|
e.length&&(p=mxUtils.button("",function(){try{var d="https://twitter.com/intent/tweet?text="+encodeURIComponent(l)+"&url="+encodeURIComponent(g.value);a.openLink(d)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),n=document.createElement("img"),n.setAttribute("src",Editor.tweetImage),n.setAttribute("width","18"),n.setAttribute("height","18"),n.setAttribute("border","0"),n.style.marginBottom="5px",p.appendChild(n),p.setAttribute("title",mxResources.get("twitter")+
|
|
|
|
|
" ("+a.formatFileSize(7168)+" max)"),p.style.verticalAlign="bottom",p.style.paddingTop="4px",p.style.minWidth="46px",p.className="geBtn",f.appendChild(p))}n=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.appendChild(n);p=mxUtils.button(mxResources.get("copy"),function(){g.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});
|
|
|
|
|
5E5>e.length?mxClient.IS_SF||null!=document.documentMode?n.className="geBtn gePrimaryBtn":(f.appendChild(p),p.className="geBtn gePrimaryBtn",n.className="geBtn"):(f.appendChild(m),n.className="geBtn",m.className="geBtn gePrimaryBtn");b.appendChild(f);this.container=b};EmbedDialog.showPreviewOption=!0;
|
|
|
|
|
var GoogleSitesDialog=function(a,e){function c(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(B.checked&&""!=t.value){var d="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(t.value));null!=a&&(d+="&title="+encodeURIComponent(a));0<C.length&&(d+="&s="+C);""!=u.value&&"0"!=u.value&&(d+="&border="+u.value);""!=p.value&&(d+="&height="+p.value);d+="&pan="+(q.checked?"1":"0");d+="&zoom="+(v.checked?"1":"0");d+="&fit="+(z.checked?"1":"0");
|
|
|
|
|
d+="&resize="+(A.checked?"1":"0");d+="&x0="+Number(n.value);d+="&y0="+g;k.mathEnabled&&(d+="&math=1");y.checked?d+="&edit=_blank":x.checked&&(d+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));m.value=d}else D.constructor==DriveFile||D.constructor==DropboxFile?(d="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=t.value?d+=encodeURIComponent(mxUtils.htmlEntities(t.value))+"&type=3":(d+=D.getHash().substring(1),d=D.constructor==DropboxFile?d+"&type=2":d+"&type=1"),null!=
|
|
|
|
|
a&&(d+="&title="+encodeURIComponent(a)),""!=p.value&&(a=parseInt(p.value)+parseInt(n.value),d+="&height="+a),m.value=d):m.value=""}var b=document.createElement("div"),k=a.editor.graph,f=k.getGraphBounds(),l=k.view.scale,d=Math.floor(f.x/l-k.view.translate.x),g=Math.floor(f.y/l-k.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var m=document.createElement("input");m.setAttribute("type","text");m.style.marginBottom="8px";m.style.marginTop="2px";m.style.width="410px";
|
|
|
|
@ -9307,7 +9307,7 @@ d.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils
|
|
|
|
|
d={title:a.getResource(l.title),entries:[]},g=0;g<l.entries.length;g++){var m=l.entries[g];d.entries.push({id:m.id,title:a.getResource(m.title),desc:a.getResource(m.desc),image:m.preview})}k.push(d)}for(f=0;f<c.length;f++)if(null==a.sidebar.enabledLibraries)k.push(c[f]);else{d={title:c[f].title,entries:[]};for(g=0;g<c[f].entries.length;g++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,c[f].entries[g].id)&&d.entries.push(c[f].entries[g]);0<d.entries.length&&k.push(d)}c=k;if(e){g=mxUtils.bind(this,
|
|
|
|
|
function(d){for(var b=0;b<d.length;b++)(function(d){var c=q.cloneNode(!1);c.style.fontWeight="bold";c.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,d.title);n.appendChild(c);for(var e=0;e<d.entries.length;e++)(function(d){var c=q.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.setAttribute("title",d.title+" ("+d.id+")");var g=
|
|
|
|
|
document.createElement("input");g.setAttribute("type","checkbox");g.checked=a.sidebar.isEntryVisible(d.id);g.defaultChecked=g.checked;c.appendChild(g);mxUtils.write(c," "+d.title);n.appendChild(c);var m=function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName){p.style.textAlign="center";p.style.padding="0px";p.style.color="";p.innerHTML="";if(null!=d.desc){var b=document.createElement("pre");b.style.boxSizing="border-box";b.style.fontFamily="inherit";b.style.margin="20px";b.style.right="0px";
|
|
|
|
|
b.style.textAlign="left";mxUtils.write(b,d.desc);p.appendChild(b)}null!=d.imageCallback?d.imageCallback(p):null!=d.image?p.innerHTML+='<img border="0" src="'+d.image+'"/>':null==d.desc&&(p.style.padding="20px",p.style.color="rgb(179, 179, 179)",mxUtils.write(p,mxResources.get("noPreview")));null!=t&&(t.style.backgroundColor="");t=c;t.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(c,"click",m);mxEvent.addListener(c,"dblclick",function(a){g.checked=
|
|
|
|
|
b.style.textAlign="left";mxUtils.write(b,d.desc);p.appendChild(b)}null!=d.imageCallback?d.imageCallback(p):null!=d.image?p.innerHTML+='<img border="0" src="'+d.image+'"/>':null==d.desc&&(p.style.padding="20px",p.style.color="rgb(179, 179, 179)",mxUtils.write(p,mxResources.get("noPreview")));null!=t&&(t.style.backgroundColor="");t=c;t.style.backgroundColor="dark"==uiTheme?"#000000":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(c,"click",m);mxEvent.addListener(c,"dblclick",function(a){g.checked=
|
|
|
|
|
!g.checked;mxEvent.consume(a)});u.push(function(){return g.checked?d.id:null});0==b&&0==e&&m()})(d.entries[e])})(d[b])});f=document.createElement("div");f.className="geDialogTitle";mxUtils.write(f,mxResources.get("shapes"));f.style.position="absolute";f.style.top="0px";f.style.left="0px";f.style.lineHeight="40px";f.style.height="40px";f.style.right="0px";mxClient.IS_QUIRKS&&(f.style.width="718px");var n=document.createElement("div"),p=document.createElement("div");n.style.position="absolute";n.style.top=
|
|
|
|
|
"40px";n.style.left="0px";n.style.width="202px";n.style.bottom="60px";n.style.overflow="auto";mxClient.IS_QUIRKS&&(n.style.height="437px",n.style.marginTop="1px");p.style.position="absolute";p.style.left="202px";p.style.right="0px";p.style.top="40px";p.style.bottom="60px";p.style.overflow="auto";p.style.borderLeft="1px solid rgb(211, 211, 211)";p.style.textAlign="center";mxClient.IS_QUIRKS&&(p.style.width=parseInt(f.style.width)-202+"px",p.style.height=n.style.height,p.style.marginTop=n.style.marginTop);
|
|
|
|
|
var t=null,u=[],q=document.createElement("div");q.style.position="relative";q.style.left="0px";q.style.right="0px";g(c);b.style.padding="30px";b.appendChild(f);b.appendChild(n);b.appendChild(p);c=document.createElement("div");c.className="geDialogFooter";c.style.position="absolute";c.style.paddingRight="16px";c.style.color="gray";c.style.left="0px";c.style.right="0px";c.style.bottom="0px";c.style.height="60px";c.style.lineHeight="52px";mxClient.IS_QUIRKS&&(c.style.width=f.style.width,c.style.paddingTop=
|
|
|
|
@ -9565,20 +9565,20 @@ d,l.getSelectionCells());e.push(a);g.push(d);if(null!=b.dependentProps)for(a=0;a
|
|
|
|
|
function e(d,b,c){var e=mxUtils.getOffset(a,!0),g=mxUtils.getOffset(d,!0);b.style.position="absolute";b.style.left=g.x-e.x+"px";b.style.top=g.y-e.y+"px";b.style.width=d.offsetWidth+"px";b.style.height=d.offsetHeight-(c?4:0)+"px";b.style.zIndex=5}function g(a,d,b){var e=document.createElement("div");e.style.width="32px";e.style.height="4px";e.style.margin="2px";e.style.border="1px solid black";e.style.background=d&&"none"!=d?d:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(k,
|
|
|
|
|
function(g){this.editorUi.pickColor(d,function(d){e.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(g)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(e);return btn}function m(a,d,b,e,g,m,f){null!=d&&(d=d.split(","),t.push({name:a,values:d,type:b,defVal:e,countProperty:g,parentRow:m,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(k,function(d){for(var n=m,k=0;null!=n.nextSibling;)if(n.nextSibling.getAttribute("data-pName")==
|
|
|
|
|
a)n=n.nextSibling,k++;else break;var l={type:b,parentRow:m,index:k,isDeletable:!0,defVal:e,countProperty:g},k=p(a,"",l,0==k%2,f);c(a,e,l);n.parentNode.insertBefore(k,n.nextSibling);mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,d,b,c,e,g,m){if(0<e){var f=Array(e);d=null!=d?d.split(","):[];for(var n=0;n<e;n++)f[n]=null!=d[n]?d[n]:null!=c?c:"";t.push({name:a,values:f,type:b,defVal:c,parentRow:g,flipBkg:m,size:e})}return document.createElement("div")}
|
|
|
|
|
function n(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function p(d,b,p,l,t){var z=p.dispName,u=p.type,q=document.createElement("tr");q.className="gePropRow"+(t?"Dark":"")+(l?"Alt":"")+" gePropNonHeaderRow";q.setAttribute("data-pName",d);q.setAttribute("data-pValue",b);l=!1;null!=p.index&&(q.setAttribute("data-index",p.index),z=(null!=z?z:"")+"["+p.index+"]",l=!0);var v=document.createElement("td");
|
|
|
|
|
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(z,null,z));l&&(v.style.textAlign="right");q.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==u)v.appendChild(g(d,b,p));else if("bool"==u||"boolean"==u)v.appendChild(n(d,b,p));else if("enum"==u){var B=p.enumList;for(t=0;t<B.length;t++)if(z=B[t],z.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(z.dispName,null,z.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(k,function(){var g=
|
|
|
|
|
document.createElement("select");e(v,g);for(var m=0;m<B.length;m++){var f=B[m],n=document.createElement("option");n.value=mxUtils.htmlEntities(f.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));g.appendChild(n)}g.value=b;a.appendChild(g);mxEvent.addListener(g,"change",function(){var a=mxUtils.htmlEntities(g.value);c(d,a,p)});g.focus();mxEvent.addListener(g,"blur",function(){a.removeChild(g)})}))}else"dynamicArr"==u?v.appendChild(m(d,b,p.subType,p.subDefVal,p.countProperty,
|
|
|
|
|
q,t)):"staticArr"==u?v.appendChild(f(d,b,p.subType,p.subDefVal,p.size,q,t)):(v.innerHTML=b,mxEvent.addListener(v,"click",mxUtils.bind(k,function(){function g(){var a=m.value,a=0==a.length&&"string"!=u?0:a;p.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",u="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=p.min&&a<p.min?a=p.min:null!=p.max&&a>p.max&&(a=p.max);a=mxUtils.htmlEntities(("int"==u?parseInt(a):a)+"");c(d,a,p)}var m=document.createElement("input");e(v,m,!0);m.value=b;m.className=
|
|
|
|
|
"gePropEditor";"int"!=u&&"float"!=u||p.allowAuto||(m.type="number",m.step="int"==u?"1":"any",null!=p.min&&(m.min=parseFloat(p.min)),null!=p.max&&(m.max=parseFloat(p.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&g()});m.focus();mxEvent.addListener(m,"blur",function(){g()})})));p.isDeletable&&(t=mxUtils.button("-",mxUtils.bind(k,function(a){c(d,"",p,p.index);mxEvent.consume(a)})),t.style.height="16px",t.style.width="25px",t.style["float"]="right",t.className="geColorBtn",
|
|
|
|
|
v.appendChild(t));q.appendChild(v);return q}var k=this,l=this.editorUi.editor.graph,t=[];a.style.position="relative";a.style.padding="0";var z=document.createElement("table");z.className="geProperties";z.style.whiteSpace="nowrap";z.style.width="100%";var u=document.createElement("tr");u.className="gePropHeader";var q=document.createElement("th");q.className="gePropHeaderCell";var v=document.createElement("img");v.src=Sidebar.prototype.expandedImage;q.appendChild(v);mxUtils.write(q,mxResources.get("property"));
|
|
|
|
|
u.style.cursor="pointer";var B=function(){var d=z.querySelectorAll(".gePropNonHeaderRow"),b;if(k.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],g=e.nodeName.toUpperCase();"INPUT"!=g&&"SELECT"!=g||a.removeChild(e)}catch(ma){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(u,"click",function(){k.editorUi.propertiesCollapsed=!k.editorUi.propertiesCollapsed;
|
|
|
|
|
B()});u.appendChild(q);q=document.createElement("th");q.className="gePropHeaderCell";q.innerHTML=mxResources.get("value");u.appendChild(q);z.appendChild(u);var x=!1,C=!1,y;for(y in d)if(u=d[y],"function"!=typeof u.isVisible||u.isVisible(b,this)){var I=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=u.getDefaultValue?u.getDefaultValue(b,this):u.defVal;if("separator"==u.type)C=!C;else{if("staticArr"==u.type)u.size=parseInt(b.style[u.sizeProperty]||d[u.sizeProperty].defVal)||0;else if(null!=
|
|
|
|
|
u.dependentProps){for(var G=u.dependentProps,D=[],A=[],q=0;q<G.length;q++){var K=b.style[G[q]];A.push(d[G[q]].subDefVal);D.push(null!=K?K.split(","):[])}u.dependentPropsDefVal=A;u.dependentPropsVals=D}z.appendChild(p(y,I,u,x,C));x=!x}}for(q=0;q<t.length;q++)for(u=t[q],d=u.parentRow,b=0;b<u.values.length;b++)y=p(u.name,u.values[b],{type:u.type,parentRow:u.parentRow,isDeletable:u.isDeletable,index:b,defVal:u.defVal,countProperty:u.countProperty,size:u.size},0==b%2,u.flipBkg),d.parentNode.insertBefore(y,
|
|
|
|
|
function n(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function p(d,b,p,l,t){var z=p.dispName,q=p.type,u=document.createElement("tr");u.className="gePropRow"+(t?"Dark":"")+(l?"Alt":"")+" gePropNonHeaderRow";u.setAttribute("data-pName",d);u.setAttribute("data-pValue",b);l=!1;null!=p.index&&(u.setAttribute("data-index",p.index),z=(null!=z?z:"")+"["+p.index+"]",l=!0);var v=document.createElement("td");
|
|
|
|
|
v.className="gePropRowCell";v.innerHTML=mxUtils.htmlEntities(mxResources.get(z,null,z));l&&(v.style.textAlign="right");u.appendChild(v);v=document.createElement("td");v.className="gePropRowCell";if("color"==q)v.appendChild(g(d,b,p));else if("bool"==q||"boolean"==q)v.appendChild(n(d,b,p));else if("enum"==q){var B=p.enumList;for(t=0;t<B.length;t++)if(z=B[t],z.val==b){v.innerHTML=mxUtils.htmlEntities(mxResources.get(z.dispName,null,z.dispName));break}mxEvent.addListener(v,"click",mxUtils.bind(k,function(){var g=
|
|
|
|
|
document.createElement("select");e(v,g);for(var m=0;m<B.length;m++){var f=B[m],n=document.createElement("option");n.value=mxUtils.htmlEntities(f.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));g.appendChild(n)}g.value=b;a.appendChild(g);mxEvent.addListener(g,"change",function(){var a=mxUtils.htmlEntities(g.value);c(d,a,p)});g.focus();mxEvent.addListener(g,"blur",function(){a.removeChild(g)})}))}else"dynamicArr"==q?v.appendChild(m(d,b,p.subType,p.subDefVal,p.countProperty,
|
|
|
|
|
u,t)):"staticArr"==q?v.appendChild(f(d,b,p.subType,p.subDefVal,p.size,u,t)):(v.innerHTML=b,mxEvent.addListener(v,"click",mxUtils.bind(k,function(){function g(){var a=m.value,a=0==a.length&&"string"!=q?0:a;p.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",q="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=p.min&&a<p.min?a=p.min:null!=p.max&&a>p.max&&(a=p.max);a=mxUtils.htmlEntities(("int"==q?parseInt(a):a)+"");c(d,a,p)}var m=document.createElement("input");e(v,m,!0);m.value=b;m.className=
|
|
|
|
|
"gePropEditor";"int"!=q&&"float"!=q||p.allowAuto||(m.type="number",m.step="int"==q?"1":"any",null!=p.min&&(m.min=parseFloat(p.min)),null!=p.max&&(m.max=parseFloat(p.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&g()});m.focus();mxEvent.addListener(m,"blur",function(){g()})})));p.isDeletable&&(t=mxUtils.button("-",mxUtils.bind(k,function(a){c(d,"",p,p.index);mxEvent.consume(a)})),t.style.height="16px",t.style.width="25px",t.style["float"]="right",t.className="geColorBtn",
|
|
|
|
|
v.appendChild(t));u.appendChild(v);return u}var k=this,l=this.editorUi.editor.graph,t=[];a.style.position="relative";a.style.padding="0";var z=document.createElement("table");z.className="geProperties";z.style.whiteSpace="nowrap";z.style.width="100%";var q=document.createElement("tr");q.className="gePropHeader";var u=document.createElement("th");u.className="gePropHeaderCell";var v=document.createElement("img");v.src=Sidebar.prototype.expandedImage;u.appendChild(v);mxUtils.write(u,mxResources.get("property"));
|
|
|
|
|
q.style.cursor="pointer";var B=function(){var d=z.querySelectorAll(".gePropNonHeaderRow"),b;if(k.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],g=e.nodeName.toUpperCase();"INPUT"!=g&&"SELECT"!=g||a.removeChild(e)}catch(ma){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(q,"click",function(){k.editorUi.propertiesCollapsed=!k.editorUi.propertiesCollapsed;
|
|
|
|
|
B()});q.appendChild(u);u=document.createElement("th");u.className="gePropHeaderCell";u.innerHTML=mxResources.get("value");q.appendChild(u);z.appendChild(q);var x=!1,C=!1,y;for(y in d)if(q=d[y],"function"!=typeof q.isVisible||q.isVisible(b,this)){var I=null!=b.style[y]?mxUtils.htmlEntities(b.style[y]+""):null!=q.getDefaultValue?q.getDefaultValue(b,this):q.defVal;if("separator"==q.type)C=!C;else{if("staticArr"==q.type)q.size=parseInt(b.style[q.sizeProperty]||d[q.sizeProperty].defVal)||0;else if(null!=
|
|
|
|
|
q.dependentProps){for(var G=q.dependentProps,D=[],A=[],u=0;u<G.length;u++){var K=b.style[G[u]];A.push(d[G[u]].subDefVal);D.push(null!=K?K.split(","):[])}q.dependentPropsDefVal=A;q.dependentPropsVals=D}z.appendChild(p(y,I,q,x,C));x=!x}}for(u=0;u<t.length;u++)for(q=t[u],d=q.parentRow,b=0;b<q.values.length;b++)y=p(q.name,q.values[b],{type:q.type,parentRow:q.parentRow,isDeletable:q.isDeletable,index:b,defVal:q.defVal,countProperty:q.countProperty,size:q.size},0==b%2,q.flipBkg),d.parentNode.insertBefore(y,
|
|
|
|
|
d.nextSibling),d=y;a.appendChild(z);B();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var b=this.editorUi,c=b.editor.graph,e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.paddingLeft="24px";e.style.paddingRight="20px";a.style.paddingLeft="16px";a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(e);
|
|
|
|
|
var g="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" "),m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.position="relative";m.style.textAlign="center";for(var f=[],n=0;n<this.defaultColorSchemes.length;n++){var p=document.createElement("div");p.style.display="inline-block";p.style.width="6px";p.style.height="6px";p.style.marginLeft="4px";p.style.marginRight=
|
|
|
|
|
"3px";p.style.borderRadius="3px";p.style.cursor="pointer";p.style.background="transparent";p.style.border="1px solid #b5b6b7";mxUtils.bind(this,function(a){mxEvent.addListener(p,"click",mxUtils.bind(this,function(){k(a)}))})(n);f.push(p);m.appendChild(p)}var k=mxUtils.bind(this,function(a){null!=this.format.currentScheme&&(f[this.format.currentScheme].style.background="transparent");this.format.currentScheme=a;l(this.defaultColorSchemes[this.format.currentScheme]);f[this.format.currentScheme].style.background=
|
|
|
|
|
"#84d7ff"}),l=mxUtils.bind(this,function(a){var d=mxUtils.bind(this,function(a){var d=mxUtils.button("",function(d){c.getModel().beginUpdate();try{for(var e=c.getSelectionCells(),m=0;m<e.length;m++){for(var f=c.getModel().getStyle(e[m]),n=0;n<g.length;n++)f=mxUtils.removeStylename(f,g[n]);var p=c.getModel().isVertex(e[m])?b.initialDefaultVertexStyle:b.initialdefaultEdgeStyle;null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(p,mxConstants.STYLE_GRADIENTCOLOR,
|
|
|
|
|
null)),mxEvent.isControlDown(d)||mxClient.IS_MAC&&mxEvent.isMetaDown(d)||(f=""==a.fill?mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(p,mxConstants.STYLE_FILLCOLOR,null))),mxEvent.isShiftDown(d)||(f=""==a.stroke?mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(p,mxConstants.STYLE_STROKECOLOR,null))),!mxEvent.isAltDown(d)&&c.getModel().isVertex(e[m])&&
|
|
|
|
|
null)),mxEvent.isAltDown(d)||(f=""==a.fill?mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(p,mxConstants.STYLE_FILLCOLOR,null))),mxEvent.isShiftDown(d)||(f=""==a.stroke?mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(p,mxConstants.STYLE_STROKECOLOR,null))),mxEvent.isControlDown(d)||mxClient.IS_MAC&&mxEvent.isMetaDown(d)||!c.getModel().isVertex(e[m])||
|
|
|
|
|
(f=mxUtils.setStyle(f,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(p,mxConstants.STYLE_FONTCOLOR,null)))):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(p,mxConstants.STYLE_FILLCOLOR,"#ffffff")),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(p,mxConstants.STYLE_STROKECOLOR,"#000000")),f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(p,mxConstants.STYLE_GRADIENTCOLOR,null)),c.getModel().isVertex(e[m])&&(f=mxUtils.setStyle(f,mxConstants.STYLE_FONTCOLOR,
|
|
|
|
|
mxUtils.getValue(p,mxConstants.STYLE_FONTCOLOR,null))));c.getModel().setStyle(e[m],f)}}finally{c.getModel().endUpdate()}});d.className="geStyleButton";d.style.width="36px";d.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";d.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?d.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":d.style.backgroundImage=
|
|
|
|
|
"linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":a.fill==mxConstants.NONE?d.style.background="url('"+Dialog.prototype.noColorImage+"')":d.style.backgroundColor=""==a.fill?mxUtils.getValue(b.initialDefaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"):a.fill||mxUtils.getValue(b.initialDefaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#2a2a2a":"#ffffff"),d.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(b.initialDefaultVertexStyle,
|
|
|
|
@ -9596,8 +9596,8 @@ if(null!=d){if("rack"==d.childLayout){var b=new mxStackLayout(this.graph,!1);b.g
|
|
|
|
|
"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(d,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=d.colWidths||"100",b.rowHeights=d.rowHeights||"50",b}return c.apply(this,arguments)};this.updateGlobalUrlVariables()};var x=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return x.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=
|
|
|
|
|
null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=a)for(var d in a)this.globalVars[d]=a[d]}catch(G){null!=window.console&&console.log("Error in vars URL parameter: "+G)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var y=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=y.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);
|
|
|
|
|
return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,g,m,f,n,p,k,l){var t=null;l||null==this.themes||"darkTheme"!=this.defaultThemeName||(t=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),
|
|
|
|
|
this.refresh());var z=A.apply(this,arguments);if(k&&null!=this.extFonts&&0<this.extFonts.length){var u=z.ownerDocument,q=null!=u.createElementNS?u.createElementNS(mxConstants.NS_SVG,"style"):u.createElement("style");null!=u.setAttributeNS?q.setAttributeNS("type","text/css"):q.setAttribute("type","text/css");for(var v="",B="",x=0;x<this.extFonts.length;x++){var C=this.extFonts[x].name,y=this.extFonts[x].url;0==y.indexOf(Editor.GOOGLE_FONTS)?v+="@import url("+y+");\n":B+='@font-face {\nfont-family: "'+
|
|
|
|
|
C+'";\nsrc: url("'+y+'");\n}\n'}q.appendChild(u.createTextNode(v+B));z.getElementsByTagName("defs")[0].appendChild(q)}null!=t&&(this.stylesheet=t,this.refresh());return z};var z=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=z.apply(this,arguments);if(this.mathEnabled){this.container.getBoundingClientRect();var d=a.drawText;a.drawText=function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&(mxUtils.isNode(a.text.value)||a.text.dialect==
|
|
|
|
|
this.refresh());var z=A.apply(this,arguments);if(k&&null!=this.extFonts&&0<this.extFonts.length){var q=z.ownerDocument,u=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"style"):q.createElement("style");null!=q.setAttributeNS?u.setAttributeNS("type","text/css"):u.setAttribute("type","text/css");for(var v="",B="",x=0;x<this.extFonts.length;x++){var C=this.extFonts[x].name,y=this.extFonts[x].url;0==y.indexOf(Editor.GOOGLE_FONTS)?v+="@import url("+y+");\n":B+='@font-face {\nfont-family: "'+
|
|
|
|
|
C+'";\nsrc: url("'+y+'");\n}\n'}u.appendChild(q.createTextNode(v+B));z.getElementsByTagName("defs")[0].appendChild(u)}null!=t&&(this.stylesheet=t,this.refresh());return z};var z=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=z.apply(this,arguments);if(this.mathEnabled){this.container.getBoundingClientRect();var d=a.drawText;a.drawText=function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&(mxUtils.isNode(a.text.value)||a.text.dialect==
|
|
|
|
|
mxConstants.DIALECT_STRICTHTML)){var c=a.text.getContentNode();if(null!=c){c=c.cloneNode(!0);if(c.getElementsByTagNameNS)for(var e=c.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<e.length;)e[0].parentNode.removeChild(e[0]);null!=c.innerHTML&&(e=a.text.value,a.text.value=c.innerHTML,d.apply(this,arguments),a.text.value=e)}}else d.apply(this,arguments)}}return a};var B=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){B.apply(this,
|
|
|
|
|
arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),
|
|
|
|
|
this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}};var C=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){C.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"==a.substring(0,17)&&(a=JSON.parse(a.substring(17)),
|
|
|
|
@ -9626,29 +9626,29 @@ STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people
|
|
|
|
|
[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=
|
|
|
|
|
[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var d=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?d="mxgraph.er":"sysML"==a.substring(0,5)&&(d="mxgraph.sysml"));return d};var D=mxMarker.createMarker;mxMarker.createMarker=
|
|
|
|
|
function(a,d,b,c,e,g,m,f,n,p){if(null!=b&&null==mxMarker.markers[b]){var k=this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return D.apply(this,arguments)};PrintDialog.prototype.create=function(a,d){function b(){z.value=Math.max(1,Math.min(f,Math.max(parseInt(z.value),parseInt(t.value))));t.value=Math.max(1,Math.min(f,Math.min(parseInt(z.value),parseInt(t.value))))}function c(d){function b(d,b,g){var m=d.useCssTransforms,f=d.currentTranslate,n=d.currentScale,p=d.view.translate,k=
|
|
|
|
|
d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var l=d.getGraphBounds(),t=0,z=0,u=oa.get(),q=1/d.pageScale,x=B.checked;if(x)var q=parseInt(K.value),C=parseInt(ja.value),q=Math.min(u.height*C/(l.height/d.view.scale),u.width*q/(l.width/d.view.scale));else q=parseInt(v.value)/(100*d.pageScale),isNaN(q)&&(c=1/d.pageScale,v.value="100 %");u=mxRectangle.fromRectangle(u);u.width=Math.ceil(u.width*
|
|
|
|
|
c);u.height=Math.ceil(u.height*c);q*=c;!x&&d.pageVisible?(l=d.getPageLayout(),t-=l.x*u.width,z-=l.y*u.height):x=!0;if(null==b){b=PrintDialog.createPrintPreview(d,q,u,0,t,z,x);b.pageSelector=!1;b.mathEnabled=!1;t=a.getCurrentFile();null!=t&&(b.title=t.getTitle());var y=b.writeHead;b.writeHead=function(b){y.apply(this,arguments);mxClient.IS_GC&&(b.writeln('<style type="text/css">'),b.writeln("@media print {"),b.writeln("span.MathJax_SVG svg { shape-rendering: crispEdges; }"),b.writeln("}"),b.writeln("</style>"));
|
|
|
|
|
d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var l=d.getGraphBounds(),t=0,z=0,q=oa.get(),u=1/d.pageScale,x=B.checked;if(x)var u=parseInt(K.value),C=parseInt(ja.value),u=Math.min(q.height*C/(l.height/d.view.scale),q.width*u/(l.width/d.view.scale));else u=parseInt(v.value)/(100*d.pageScale),isNaN(u)&&(c=1/d.pageScale,v.value="100 %");q=mxRectangle.fromRectangle(q);q.width=Math.ceil(q.width*
|
|
|
|
|
c);q.height=Math.ceil(q.height*c);u*=c;!x&&d.pageVisible?(l=d.getPageLayout(),t-=l.x*q.width,z-=l.y*q.height):x=!0;if(null==b){b=PrintDialog.createPrintPreview(d,u,q,0,t,z,x);b.pageSelector=!1;b.mathEnabled=!1;t=a.getCurrentFile();null!=t&&(b.title=t.getTitle());var y=b.writeHead;b.writeHead=function(b){y.apply(this,arguments);mxClient.IS_GC&&(b.writeln('<style type="text/css">'),b.writeln("@media print {"),b.writeln("span.MathJax_SVG svg { shape-rendering: crispEdges; }"),b.writeln("}"),b.writeln("</style>"));
|
|
|
|
|
null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"));if(null!=d.extFonts)for(var c=0;c<d.extFonts.length;c++){var e=d.extFonts[c].name,g=d.extFonts[c].url;0==g.indexOf(Editor.GOOGLE_FONTS)?b.writeln('<link rel="stylesheet" href="'+g+'" charset="UTF-8" type="text/css">'):(b.writeln('<style type="text/css">'),b.writeln('@font-face {\n\tfont-family: "'+e+'";\n\tsrc: url("'+g+'");\n}'),b.writeln("</style>"))}};if("undefined"!==typeof MathJax){var D=
|
|
|
|
|
b.renderPage;b.renderPage=function(d,b,c,e,g,m){var f=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var n=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:n.className="geDisableMathJax";return n}}t=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(t=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,g,!0);null!=t&&(e.stylesheet=t,e.refresh())}else{u=
|
|
|
|
|
d.background;if(null==u||""==u||u==mxConstants.NONE)u="#ffffff";b.backgroundColor=u;b.autoOrigin=x;b.appendGraph(d,q,t,z,g,!0);if(null!=d.extFonts&&null!=b.wnd)for(g=0;g<d.extFonts.length;g++)t=d.extFonts[g].name,z=d.extFonts[g].url,0==z.indexOf(Editor.GOOGLE_FONTS)?b.wnd.document.writeln('<link rel="stylesheet" href="'+z+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\n\tfont-family: "'+t+'";\n\tsrc: url("'+z+'");\n}'),
|
|
|
|
|
b.renderPage;b.renderPage=function(d,b,c,e,g,m){var f=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var n=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:n.className="geDisableMathJax";return n}}t=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(t=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,g,!0);null!=t&&(e.stylesheet=t,e.refresh())}else{q=
|
|
|
|
|
d.background;if(null==q||""==q||q==mxConstants.NONE)q="#ffffff";b.backgroundColor=q;b.autoOrigin=x;b.appendGraph(d,u,t,z,g,!0);if(null!=d.extFonts&&null!=b.wnd)for(g=0;g<d.extFonts.length;g++)t=d.extFonts[g].name,z=d.extFonts[g].url,0==z.indexOf(Editor.GOOGLE_FONTS)?b.wnd.document.writeln('<link rel="stylesheet" href="'+z+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\n\tfont-family: "'+t+'";\n\tsrc: url("'+z+'");\n}'),
|
|
|
|
|
b.wnd.document.writeln("</style>"))}m&&(d.useCssTransforms=m,d.currentTranslate=f,d.currentScale=n,d.view.translate=p,d.view.scale=k);return b}var c=parseInt(ha.value)/100;isNaN(c)&&(c=1,ha.value="100 %");var c=.75*c,g=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(g=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var m=t.value,f=z.value,p=!k.checked,l=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,k.checked,m,f,B.checked,K.value,ja.value,parseInt(v.value)/100,
|
|
|
|
|
parseInt(ha.value)/100,oa.get());else{p&&(p=m==n&&f==n);if(!p&&null!=a.pages&&a.pages.length){var u=0,p=a.pages.length-1;k.checked||(u=parseInt(m)-1,p=parseInt(f)-1);for(var q=u;q<=p;q++){var x=a.pages[q],m=x==a.currentPage?e:null;if(null==m){var m=a.createTemporaryGraph(e.stylesheet),f=!0,u=!1,C=null,y=null;null==x.viewState&&null==x.root&&a.updatePageRoot(x);null!=x.viewState&&(f=x.viewState.pageVisible,u=x.viewState.mathEnabled,C=x.viewState.background,y=x.viewState.backgroundImage,m.extFonts=
|
|
|
|
|
x.viewState.extFonts);m.background=C;m.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;m.pageVisible=f;m.mathEnabled=u;var D=m.getGlobalVariable;m.getGlobalVariable=function(d){return"page"==d?x.getName():"pagenumber"==d?q+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(m.container);a.updatePageRoot(x);m.model.setRoot(x.root)}l=b(m,l,q!=p);m!=e&&m.container.parentNode.removeChild(m.container)}}else l=b(e);null==l?a.handleError({message:mxResources.get("errorUpdatingPreview")}):
|
|
|
|
|
parseInt(ha.value)/100,oa.get());else{p&&(p=m==n&&f==n);if(!p&&null!=a.pages&&a.pages.length){var q=0,p=a.pages.length-1;k.checked||(q=parseInt(m)-1,p=parseInt(f)-1);for(var u=q;u<=p;u++){var x=a.pages[u],m=x==a.currentPage?e:null;if(null==m){var m=a.createTemporaryGraph(e.stylesheet),f=!0,q=!1,C=null,y=null;null==x.viewState&&null==x.root&&a.updatePageRoot(x);null!=x.viewState&&(f=x.viewState.pageVisible,q=x.viewState.mathEnabled,C=x.viewState.background,y=x.viewState.backgroundImage,m.extFonts=
|
|
|
|
|
x.viewState.extFonts);m.background=C;m.backgroundImage=null!=y?new mxImage(y.src,y.width,y.height):null;m.pageVisible=f;m.mathEnabled=q;var D=m.getGlobalVariable;m.getGlobalVariable=function(d){return"page"==d?x.getName():"pagenumber"==d?u+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(m.container);a.updatePageRoot(x);m.model.setRoot(x.root)}l=b(m,l,u!=p);m!=e&&m.container.parentNode.removeChild(m.container)}}else l=b(e);null==l?a.handleError({message:mxResources.get("errorUpdatingPreview")}):
|
|
|
|
|
(l.mathEnabled&&(p=l.wnd.document,d&&(l.wnd.IMMEDIATE_PRINT=!0),p.writeln('<script type="text/javascript" src="'+DRAWIO_BASE_URL+'/js/math-print.js">\x3c/script>')),l.closeDocument(),!l.mathEnabled&&d&&PrintDialog.printPreview(l));null!=g&&(e.stylesheet=g,e.refresh())}}var e=a.editor.graph,g=document.createElement("div"),m=document.createElement("h3");m.style.width="100%";m.style.textAlign="center";m.style.marginTop="0px";mxUtils.write(m,d||mxResources.get("print"));g.appendChild(m);var f=1,n=1,p=
|
|
|
|
|
document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","all");k.setAttribute("type","radio");k.setAttribute("name","pages-printdialog");p.appendChild(k);m=document.createElement("span");mxUtils.write(m,mxResources.get("printAllPages"));p.appendChild(m);mxUtils.br(p);var l=k.cloneNode(!0);k.setAttribute("checked","checked");
|
|
|
|
|
l.setAttribute("value","range");p.appendChild(l);m=document.createElement("span");mxUtils.write(m,mxResources.get("pages")+":");p.appendChild(m);var t=document.createElement("input");t.style.cssText="margin:0 8px 0 8px;";t.setAttribute("value","1");t.setAttribute("type","number");t.setAttribute("min","1");t.style.width="50px";p.appendChild(t);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));p.appendChild(m);var z=t.cloneNode(!0);p.appendChild(z);mxEvent.addListener(t,"focus",
|
|
|
|
|
function(){l.checked=!0});mxEvent.addListener(z,"focus",function(){l.checked=!0});mxEvent.addListener(t,"change",b);mxEvent.addListener(z,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){n=m+1;t.value=n;z.value=n;break}t.setAttribute("max",f);z.setAttribute("max",f);a.isPagesEnabled()?1<f&&(g.appendChild(p),l.checked=!0):l.checked=!0;var u=document.createElement("div");u.style.marginBottom="10px";var q=document.createElement("input");
|
|
|
|
|
q.style.marginRight="8px";q.setAttribute("value","adjust");q.setAttribute("type","radio");q.setAttribute("name","printZoom");u.appendChild(q);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));u.appendChild(m);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";u.appendChild(v);mxEvent.addListener(v,"focus",function(){q.checked=!0});g.appendChild(u);var p=p.cloneNode(!1),B=q.cloneNode(!0);B.setAttribute("value",
|
|
|
|
|
"fit");q.setAttribute("checked","checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(B);p.appendChild(m);u=document.createElement("table");u.style.display="inline-block";var x=document.createElement("tbody"),C=document.createElement("tr"),y=C.cloneNode(!0),D=document.createElement("td"),A=D.cloneNode(!0),I=D.cloneNode(!0),E=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0);D.style.textAlign="right";E.style.textAlign=
|
|
|
|
|
function(){l.checked=!0});mxEvent.addListener(z,"focus",function(){l.checked=!0});mxEvent.addListener(t,"change",b);mxEvent.addListener(z,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){n=m+1;t.value=n;z.value=n;break}t.setAttribute("max",f);z.setAttribute("max",f);a.isPagesEnabled()?1<f&&(g.appendChild(p),l.checked=!0):l.checked=!0;var q=document.createElement("div");q.style.marginBottom="10px";var u=document.createElement("input");
|
|
|
|
|
u.style.marginRight="8px";u.setAttribute("value","adjust");u.setAttribute("type","radio");u.setAttribute("name","printZoom");q.appendChild(u);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));q.appendChild(m);var v=document.createElement("input");v.style.cssText="margin:0 8px 0 8px;";v.setAttribute("value","100 %");v.style.width="50px";q.appendChild(v);mxEvent.addListener(v,"focus",function(){u.checked=!0});g.appendChild(q);var p=p.cloneNode(!1),B=u.cloneNode(!0);B.setAttribute("value",
|
|
|
|
|
"fit");u.setAttribute("checked","checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(B);p.appendChild(m);q=document.createElement("table");q.style.display="inline-block";var x=document.createElement("tbody"),C=document.createElement("tr"),y=C.cloneNode(!0),D=document.createElement("td"),A=D.cloneNode(!0),I=D.cloneNode(!0),E=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0);D.style.textAlign="right";E.style.textAlign=
|
|
|
|
|
"right";mxUtils.write(D,mxResources.get("fitTo"));var K=document.createElement("input");K.style.cssText="margin:0 8px 0 8px;";K.setAttribute("value","1");K.setAttribute("min","1");K.setAttribute("type","number");K.style.width="40px";A.appendChild(K);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));I.appendChild(m);mxUtils.write(E,mxResources.get("fitToBy"));var ja=K.cloneNode(!0);F.appendChild(ja);mxEvent.addListener(K,"focus",function(){B.checked=!0});mxEvent.addListener(ja,
|
|
|
|
|
"focus",function(){B.checked=!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));H.appendChild(m);C.appendChild(D);C.appendChild(A);C.appendChild(I);y.appendChild(E);y.appendChild(F);y.appendChild(H);x.appendChild(C);x.appendChild(y);u.appendChild(x);p.appendChild(u);g.appendChild(p);p=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));p.appendChild(m);
|
|
|
|
|
"focus",function(){B.checked=!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));H.appendChild(m);C.appendChild(D);C.appendChild(A);C.appendChild(I);y.appendChild(E);y.appendChild(F);y.appendChild(H);x.appendChild(C);x.appendChild(y);q.appendChild(x);p.appendChild(q);g.appendChild(p);p=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));p.appendChild(m);
|
|
|
|
|
m=document.createElement("div");m.style.marginBottom="12px";var oa=PageSetupDialog.addPageFormatPanel(m,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);p.appendChild(m);m=document.createElement("span");mxUtils.write(m,mxResources.get("pageScale"));p.appendChild(m);var ha=document.createElement("input");ha.style.cssText="margin:0 8px 0 8px;";ha.setAttribute("value","100 %");ha.style.width="60px";p.appendChild(ha);g.appendChild(p);m=document.createElement("div");m.style.cssText=
|
|
|
|
|
"text-align:right;margin:48px 0 0 0;";p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&m.appendChild(p);a.isOffline()||(u=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),u.className="geBtn",m.appendChild(u));PrintDialog.previewEnabled&&(u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),u.className="geBtn",m.appendChild(u));u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
|
|
|
|
|
"print":"ok"),function(){a.hideDialog();c(!0)});u.className="geBtn gePrimaryBtn";m.appendChild(u);a.editor.cancelFirst||m.appendChild(p);g.appendChild(m);this.container=g};var E=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
|
|
|
|
|
"text-align:right;margin:48px 0 0 0;";p=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});p.className="geBtn";a.editor.cancelFirst&&m.appendChild(p);a.isOffline()||(q=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),q.className="geBtn",m.appendChild(q));PrintDialog.previewEnabled&&(q=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),q.className="geBtn",m.appendChild(q));q=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
|
|
|
|
|
"print":"ok"),function(){a.hideDialog();c(!0)});q.className="geBtn gePrimaryBtn";m.appendChild(q);a.editor.cancelFirst||m.appendChild(p);g.appendChild(m);this.container=g};var E=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
|
|
|
|
|
(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(E.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
|
|
|
|
|
this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var F=document.createElement("canvas"),H=new Image;H.onload=function(){try{F.getContext("2d").drawImage(H,0,0);var a=F.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(K){}};H.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(I){}})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.6.2";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangeGridColor,["ui"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.6.3";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;
|
|
|
|
|
EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;
|
|
|
|
|
EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},
|
|
|
|
|
gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(a,b,c,e,f,k,l){k=null!=k?k:0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";if(EditorUi.enableLogging&&"1"!=urlParams.dev)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&
|
|
|
|
@ -9730,10 +9730,10 @@ b,a,a.getMode(),!0,!0,function(){null!=B&&null!=B.parentNode&&(B.parentNode.remo
|
|
|
|
|
E(b,d)}mxEvent.consume(a)});mxEvent.addGestureListeners(m,function(){},mxUtils.bind(this,function(a){z.isMouseDown&&null!=z.panningManager&&null!=z.graphHandler.first&&(z.graphHandler.suspend(),null!=z.graphHandler.hint&&(z.graphHandler.hint.style.visibility="hidden"),m.style.backgroundColor="#f1f3f4",m.style.cursor="copy",z.panningManager.stop(),z.autoScroll=!1,mxEvent.consume(a))}),mxUtils.bind(this,function(a){z.isMouseDown&&null!=z.panningManager&&null!=z.graphHandler&&(m.style.backgroundColor=
|
|
|
|
|
"",m.style.cursor="default",this.sidebar.showTooltips=!0,z.panningManager.stop(),z.graphHandler.reset(),z.isMouseDown=!1,z.autoScroll=!0,F(a),mxEvent.consume(a))}));mxEvent.addListener(m,"mouseleave",mxUtils.bind(this,function(a){z.isMouseDown&&null!=z.graphHandler.first&&(z.graphHandler.resume(),null!=z.graphHandler.hint&&(z.graphHandler.hint.style.visibility="visible"),m.style.backgroundColor="",m.style.cursor="",z.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(m,"dragover",mxUtils.bind(this,
|
|
|
|
|
function(a){m.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";m.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"drop",mxUtils.bind(this,function(a){m.style.cursor="";m.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,e,k,n,p,l,z,t){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+
|
|
|
|
|
this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,n,p),d)],d[0].vertex=!0,E(d,new mxRectangle(0,0,n,p),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null);else{var u=!1,q=mxUtils.bind(this,function(d,c){if(null!=d&&"application/pdf"==c){var e=Editor.extractGraphModelFromPdf(d);null!=e&&0<e.length&&(d=e)}if(null!=d)if(e=mxUtils.parseXml(d),"mxlibrary"==e.documentElement.nodeName)try{var k=
|
|
|
|
|
JSON.parse(mxUtils.getTextContent(e.documentElement));f(k,m);b=b.concat(k);D(a);this.spinner.stop();u=!0}catch(M){}else if("mxfile"==e.documentElement.nodeName)try{for(var n=e.documentElement.getElementsByTagName("diagram"),k=0;k<n.length;k++){var p=this.stringToCells(Editor.getDiagramNodeXml(n[k])),l=this.editor.graph.getBoundingBoxFromGeometry(p);E(p,new mxRectangle(0,0,l.width,l.height),a)}u=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
|
|
|
|
null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=t&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(t,function(a){q(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,l)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?q(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?
|
|
|
|
|
"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):q(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"dragleave",function(a){m.style.cursor="";m.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",Editor.editImage);l.setAttribute("title",mxResources.get("edit"));n.insertBefore(l,n.firstChild);mxEvent.addListener(l,"click",C);mxEvent.addListener(m,"dblclick",function(a){mxEvent.getSource(a)==
|
|
|
|
|
this.convertDataUri(d),d=[new mxCell("",new mxGeometry(0,0,n,p),d)],d[0].vertex=!0,E(d,new mxRectangle(0,0,n,p),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null);else{var q=!1,u=mxUtils.bind(this,function(d,c){if(null!=d&&"application/pdf"==c){var e=Editor.extractGraphModelFromPdf(d);null!=e&&0<e.length&&(d=e)}if(null!=d)if(e=mxUtils.parseXml(d),"mxlibrary"==e.documentElement.nodeName)try{var k=
|
|
|
|
|
JSON.parse(mxUtils.getTextContent(e.documentElement));f(k,m);b=b.concat(k);D(a);this.spinner.stop();q=!0}catch(M){}else if("mxfile"==e.documentElement.nodeName)try{for(var n=e.documentElement.getElementsByTagName("diagram"),k=0;k<n.length;k++){var p=this.stringToCells(Editor.getDiagramNodeXml(n[k])),l=this.editor.graph.getBoundingBoxFromGeometry(p);E(p,new mxRectangle(0,0,l.width,l.height),a)}q=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}q||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
|
|
|
|
|
null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=t&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(t,function(a){u(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,l)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?u(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?
|
|
|
|
|
"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):u(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"dragleave",function(a){m.style.cursor="";m.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",Editor.editImage);l.setAttribute("title",mxResources.get("edit"));n.insertBefore(l,n.firstChild);mxEvent.addListener(l,"click",C);mxEvent.addListener(m,"dblclick",function(a){mxEvent.getSource(a)==
|
|
|
|
|
m&&C(a)});e=l.cloneNode(!1);e.setAttribute("src",Editor.plusImage);e.setAttribute("title",mxResources.get("add"));n.insertBefore(e,n.firstChild);mxEvent.addListener(e,"click",F);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(e=document.createElement("span"),e.setAttribute("title",mxResources.get("help")),e.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(e,"?"),mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);
|
|
|
|
|
mxEvent.consume(a)})),n.insertBefore(e,n.firstChild))}k.appendChild(n);k.style.paddingRight=18*n.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var d=0;d<a.length;d++){var c=a[d],e=c.data;if(null!=e){var e=this.convertDataUri(e),g="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==c.aspect&&(g+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(g+"image="+e,c.w,c.h,"",c.title||"",!1,!1,!0))}else null!=c.xml&&(e=this.stringToCells(Graph.decompress(c.xml)),
|
|
|
|
|
0<e.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(e,c.w,c.h,c.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?
|
|
|
|
@ -9837,34 +9837,34 @@ this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});thi
|
|
|
|
|
this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(g){this.handleError(g)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});
|
|
|
|
|
"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length}),EditorUi.debug("convertLucidChart",a)}catch(p){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(p){null!=window.console&&
|
|
|
|
|
console.error(p),c(p)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generateMermaidImage=function(a,b,c,e){var d=this,g=function(){try{this.loadingMermaid=!1,b=null!=b?b:EditorUi.defaultMermaidConfig,b.securityLevel="strict",b.startOnLoad=
|
|
|
|
|
!1,mermaid.mermaidAPI.initialize(b),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),a,function(a){try{if(mxClient.IS_IE||mxClient.IS_IE11)a=a.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var b=mxUtils.parseXml(a).getElementsByTagName("svg");if(0<b.length){var g=parseFloat(b[0].getAttribute("width")),f=parseFloat(b[0].getAttribute("height"));c(d.convertDataUri(Editor.createSvgDataUri(a)),g,
|
|
|
|
|
f)}else e({message:mxResources.get("invalidInput")})}catch(y){e(y)}})}catch(u){e(u)}};"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?g():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.generatePlantUmlImage=function(a,b,c,e){function d(a,b,d){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|d>>6;c4=d&63;r="";r+=g(c1&63);r+=g(c2&63);r+=g(c3&63);return r+=g(c4&63)}function g(a){if(10>a)return String.fromCharCode(48+
|
|
|
|
|
a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var f=new XMLHttpRequest;f.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+d(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+d(a.charCodeAt(i),0,0):r+d(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(f.responseType=
|
|
|
|
|
"blob");f.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)c(this.response);else{var d=new FileReader;d.readAsDataURL(this.response);d.onloadend=function(a){var b=new Image;b.onload=function(){try{var a=b.width,g=b.height;if(0==a&&0==g){var f=d.result,m=f.indexOf(","),k=decodeURIComponent(escape(atob(f.substring(m+1)))),l=mxUtils.parseXml(k).getElementsByTagName("svg");0<l.length&&(a=parseFloat(l[0].getAttribute("width")),g=parseFloat(l[0].getAttribute("height")))}c(d.result,a,
|
|
|
|
|
g)}catch(F){e(F)}};b.src=d.result};d.onerror=function(a){e(a)}}else e(a)};f.onerror=function(a){e(a)};f.send()};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,e=null;d.getModel().beginUpdate();try{e=d.insertVertex(null,null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=left;verticalAlign=top;"),d.updateCellSize(e,!0)}finally{d.getModel().endUpdate()}return e};EditorUi.prototype.insertTextAt=function(a,b,c,e,f,k,l){k=null!=k?k:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&
|
|
|
|
|
!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d=this.editor.graph;if("data:application/pdf;base64,"==a.substring(0,28)){var g=
|
|
|
|
|
Editor.extractGraphModelFromPdf(a);if(null!=g&&0<g.length)return this.importXml(g,b,c,k,!0)}if("data:image/png;base64,"==a.substring(0,22)&&(g=this.extractGraphModelFromPng(a),null!=g&&0<g.length))return this.importXml(g,b,c,k,!0);if("data:image/svg+xml;"==a.substring(0,19))try{g=null;"data:image/svg+xml;base64,"==a.substring(0,26)?(g=a.substring(a.indexOf(",")+1),g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0)):g=decodeURIComponent(a.substring(a.indexOf(",")+1));var m=this.importXml(g,
|
|
|
|
|
b,c,k,!0);if(0<m.length)return m}catch(A){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,g){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var g=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),
|
|
|
|
|
f=Math.round(e.width*g);e=Math.round(e.height*g);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var g=null;d.getModel().beginUpdate();try{g=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(g),d.fireEvent(new mxEventObject("textInserted","cells",[g]))}finally{d.getModel().endUpdate()}d.setSelectionCell(g)}))}else{a=
|
|
|
|
|
Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,k);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,k))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{d=this.editor.graph;f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,"",d.snap(b),d.snap(c),1,1,"text;whiteSpace=wrap;"+(e?"html=1;":""));d.fireEvent(new mxEventObject("textInserted",
|
|
|
|
|
"cells",[f]));"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a));a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"...");f.value=a;d.updateCellSize(f);if(0<this.maxTextWidth&&f.geometry.width>this.maxTextWidth){var n=d.getPreferredSizeForCell(f,this.maxTextWidth);f.geometry.width=n.width;f.geometry.height=n.height}Graph.isLink(f.value)&&d.setLinkForCell(f,f.value);f.geometry.width+=d.gridSize;f.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[f]}}return[]};
|
|
|
|
|
EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.isLucidChartData=function(a){return null!=
|
|
|
|
|
a&&('{"state":"{\\"Properties\\":'==a.substring(0,26)||'{"Properties":'==a.substring(0,14))};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport){if(null==this.importFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){null!=d.files&&(this.importFiles(d.files,null,null,this.maxImageSize),d.type="",d.type="file",d.value="")}));d.style.display="none";document.body.appendChild(d);this.importFileInputElt=
|
|
|
|
|
d}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";if(!b){var c=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var d=new Blob([a],{type:"application/octet-stream"});this.importVisio(d,mxUtils.bind(this,function(a){this.importXml(a,0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,
|
|
|
|
|
0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,g=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=c;g.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,c){var d=this,e=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(e){if(0==
|
|
|
|
|
Object.keys(e.files).length)c();else{var g=0,f,k=!1;e.forEach(function(a,d){var e=d.name.toLowerCase();"diagram/diagram.xml"==e?(k=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==e.indexOf("versions/")&&(e=parseInt(e.substr(9)),e>g&&(g=e,f=d))});0<g?f.async("string").then(function(e){!d.isOffline()&&(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=
|
|
|
|
|
a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):k||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,k,l,q,v,x,y){x=null!=x?x:!0;var d=!1,g=null,m=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,e,x);null!=q&&q(b)});"image"==
|
|
|
|
|
b.substring(0,5)?(v=!1,"image/png"==b.substring(0,9)&&(b=y?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(g=this.importXml(b,c,e,x),v=!0)),v||(b=this.editor.graph,y=a.indexOf(";"),0<y&&(a=a.substring(0,y)+a.substring(a.indexOf(",",y+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),g=[b.insertVertex(null,null,"",c,e,f,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(d=!0,
|
|
|
|
|
this.importGraphML(a,m)):null!=v&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(d=!0,this.importVisio(v,m)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=v?v:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=q&&q(null))}),l)):0==a.indexOf("PK")&&null!=v?(d=!0,this.importZipFile(v,m,mxUtils.bind(this,function(){g=
|
|
|
|
|
this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);q(g)}))):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||(g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==q||q(g);return g};EditorUi.prototype.importFiles=function(a,b,c,e,f,k,l,q,v,x,y,A){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;var d=null!=b&&null!=c,g=!0;b=null!=b?b:0;c=null!=c?c:0;var m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=y||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==
|
|
|
|
|
a[p].type.substring(0,6)&&a[p].size>n){m=!0;break}var t=mxUtils.bind(this,function(){var m=this.editor.graph,n=m.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,g,f,k,m,l){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,e,g,f,k,m,l,d,A)}catch(T){return this.handleError(T),null}});k=null!=k?k:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=
|
|
|
|
|
a.length,z=p,t=[],B=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--z){this.spinner.stop();if(null!=q)q(t);else{var d=[];m.getModel().beginUpdate();try{for(var c=0;c<t.length;c++){var e=t[c]();null!=e&&(d=d.concat(e))}}finally{m.getModel().endUpdate()}}k(d)}}),u=0;u<p;u++)mxUtils.bind(this,function(d){var k=a[d];if(null!=k){var p=new FileReader;p.onload=mxUtils.bind(this,function(a){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var p=a.target.result,z=p.indexOf(","),
|
|
|
|
|
t=decodeURIComponent(escape(atob(p.substring(z+1)))),u=mxUtils.parseXml(t),t=u.getElementsByTagName("svg");if(0<t.length){var t=t[0],q=A?null:t.getAttribute("content");null!=q&&"<"!=q.charAt(0)&&"%"!=q.charAt(0)&&(q=unescape(window.atob?atob(q):Base64.decode(q,!0)));null!=q&&"%"==q.charAt(0)&&(q=decodeURIComponent(q));null==q||"<mxfile "!==q.substring(0,8)&&"<mxGraphModel "!==q.substring(0,14)?B(d,mxUtils.bind(this,function(){try{if(p.substring(0,z+1),null!=u){var a=u.getElementsByTagName("svg");
|
|
|
|
|
if(0<a.length){var g=a[0],l=g.getAttribute("width"),t=g.getAttribute("height"),l=null!=l&&"%"!=l.charAt(l.length-1)?parseFloat(l):NaN,t=null!=t&&"%"!=t.charAt(t.length-1)?parseFloat(t):NaN,B=g.getAttribute("viewBox");if(null==B||0==B.length)g.setAttribute("viewBox","0 0 "+l+" "+t);else if(isNaN(l)||isNaN(t)){var q=B.split(" ");3<q.length&&(l=parseFloat(q[2]),t=parseFloat(q[3]))}p=Editor.createSvgDataUri(mxUtils.getXml(g));var v=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,t)),C=f(p,k.type,b+
|
|
|
|
|
d*n,c+d*n,Math.max(1,Math.round(l*v)),Math.max(1,Math.round(t*v)),k.name);if(isNaN(l)||isNaN(t)){var x=new Image;x.onload=mxUtils.bind(this,function(){l=Math.max(1,x.width);t=Math.max(1,x.height);C[0].geometry.width=l;C[0].geometry.height=t;g.setAttribute("viewBox","0 0 "+l+" "+t);p=Editor.createSvgDataUri(mxUtils.getXml(g));var a=p.indexOf(";");0<a&&(p=p.substring(0,a)+p.substring(p.indexOf(",",a+1)));m.setCellStyles("image",p,[C[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(g))}return C}}}catch(fa){}return null})):
|
|
|
|
|
B(d,mxUtils.bind(this,function(){return f(q,"text/xml",b+d*n,c+d*n,0,0,k.name)}))}else B(d,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==k.type){var v=A?null:this.extractGraphModelFromPng(a.target.result);if(null!=v&&0<v.length){var C=new Image;C.src=a.target.result;B(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*n,c+d*n,C.width,C.height,k.name)}));t=!0}}t||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),
|
|
|
|
|
!1,mermaid.mermaidAPI.initialize(b),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),a,function(a){try{if(mxClient.IS_IE||mxClient.IS_IE11)a=a.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var b=mxUtils.parseXml(a).getElementsByTagName("svg");if(0<b.length){var g=parseFloat(b[0].getAttribute("width")),f=parseFloat(b[0].getAttribute("height"));if(isNaN(g)||isNaN(f))try{var m=b[0].getAttribute("viewBox").split(/\s+/),
|
|
|
|
|
g=parseFloat(m[2]),f=parseFloat(m[3])}catch(A){g=g||100,f=f||100}c(d.convertDataUri(Editor.createSvgDataUri(a)),g,f)}else e({message:mxResources.get("invalidInput")})}catch(A){e(A)}})}catch(u){e(u)}};"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?g():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.generatePlantUmlImage=function(a,b,c,e){function d(a,b,d){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&
|
|
|
|
|
15)<<2|d>>6;c4=d&63;r="";r+=g(c1&63);r+=g(c2&63);r+=g(c3&63);return r+=g(c4&63)}function g(a){if(10>a)return String.fromCharCode(48+a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var f=new XMLHttpRequest;f.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+d(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+d(a.charCodeAt(i),
|
|
|
|
|
0,0):r+d(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(f.responseType="blob");f.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)c(this.response);else{var d=new FileReader;d.readAsDataURL(this.response);d.onloadend=function(a){var b=new Image;b.onload=function(){try{var a=b.width,g=b.height;if(0==a&&0==g){var f=d.result,m=f.indexOf(","),k=decodeURIComponent(escape(atob(f.substring(m+1)))),l=mxUtils.parseXml(k).getElementsByTagName("svg");
|
|
|
|
|
0<l.length&&(a=parseFloat(l[0].getAttribute("width")),g=parseFloat(l[0].getAttribute("height")))}c(d.result,a,g)}catch(F){e(F)}};b.src=d.result};d.onerror=function(a){e(a)}}else e(a)};f.onerror=function(a){e(a)};f.send()};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,e=null;d.getModel().beginUpdate();try{e=d.insertVertex(null,null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=left;verticalAlign=top;"),d.updateCellSize(e,!0)}finally{d.getModel().endUpdate()}return e};EditorUi.prototype.insertTextAt=
|
|
|
|
|
function(a,b,c,e,f,k,l){k=null!=k?k:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d=
|
|
|
|
|
this.editor.graph;if("data:application/pdf;base64,"==a.substring(0,28)){var g=Editor.extractGraphModelFromPdf(a);if(null!=g&&0<g.length)return this.importXml(g,b,c,k,!0)}if("data:image/png;base64,"==a.substring(0,22)&&(g=this.extractGraphModelFromPng(a),null!=g&&0<g.length))return this.importXml(g,b,c,k,!0);if("data:image/svg+xml;"==a.substring(0,19))try{g=null;"data:image/svg+xml;base64,"==a.substring(0,26)?(g=a.substring(a.indexOf(",")+1),g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0)):
|
|
|
|
|
g=decodeURIComponent(a.substring(a.indexOf(",")+1));var m=this.importXml(g,b,c,k,!0);if(0<m.length)return m}catch(A){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,g){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var g=
|
|
|
|
|
Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),f=Math.round(e.width*g);e=Math.round(e.height*g);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var g=null;d.getModel().beginUpdate();try{g=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(g),
|
|
|
|
|
d.fireEvent(new mxEventObject("textInserted","cells",[g]))}finally{d.getModel().endUpdate()}d.setSelectionCell(g)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,k);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,k))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{d=this.editor.graph;f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),
|
|
|
|
|
null,"",d.snap(b),d.snap(c),1,1,"text;whiteSpace=wrap;"+(e?"html=1;":""));d.fireEvent(new mxEventObject("textInserted","cells",[f]));"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a));a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"...");f.value=a;d.updateCellSize(f);if(0<this.maxTextWidth&&f.geometry.width>this.maxTextWidth){var n=d.getPreferredSizeForCell(f,this.maxTextWidth);f.geometry.width=n.width;f.geometry.height=n.height}Graph.isLink(f.value)&&d.setLinkForCell(f,
|
|
|
|
|
f.value);f.geometry.width+=d.gridSize;f.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[f]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};
|
|
|
|
|
EditorUi.prototype.isLucidChartData=function(a){return null!=a&&('{"state":"{\\"Properties\\":'==a.substring(0,26)||'{"Properties":'==a.substring(0,14))};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport){if(null==this.importFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){null!=d.files&&(this.importFiles(d.files,null,null,this.maxImageSize),d.type="",d.type="file",d.value="")}));d.style.display=
|
|
|
|
|
"none";document.body.appendChild(d);this.importFileInputElt=d}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";if(!b){var c=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var d=new Blob([a],{type:"application/octet-stream"});this.importVisio(d,mxUtils.bind(this,function(a){this.importXml(a,
|
|
|
|
|
0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,g=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=c;g.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,c){var d=this,e=mxUtils.bind(this,function(){this.loadingExtensions=
|
|
|
|
|
!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(e){if(0==Object.keys(e.files).length)c();else{var g=0,f,k=!1;e.forEach(function(a,d){var e=d.name.toLowerCase();"diagram/diagram.xml"==e?(k=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==e.indexOf("versions/")&&(e=parseInt(e.substr(9)),e>g&&(g=e,f=d))});0<g?f.async("string").then(function(e){!d.isOffline()&&(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),
|
|
|
|
|
mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):k||c()}},function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,k,l,q,v,x,y){x=null!=x?x:!0;var d=!1,g=null,m=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,
|
|
|
|
|
a,l)):b=this.importXml(a,c,e,x);null!=q&&q(b)});"image"==b.substring(0,5)?(v=!1,"image/png"==b.substring(0,9)&&(b=y?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(g=this.importXml(b,c,e,x),v=!0)),v||(b=this.editor.graph,y=a.indexOf(";"),0<y&&(a=a.substring(0,y)+a.substring(a.indexOf(",",y+1))),x&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),g=[b.insertVertex(null,null,"",c,e,f,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
|
|
|
|
a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,m)):null!=v&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?(d=!0,this.importVisio(v,m)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=v?v:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=q&&q(null))}),l)):0==a.indexOf("PK")&&null!=v?(d=!0,this.importZipFile(v,
|
|
|
|
|
m,mxUtils.bind(this,function(){g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x);q(g)}))):/(\.v(sd|dx))($|\?)/i.test(l)||/(\.vs(s|x))($|\?)/i.test(l)||(g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,x));d||null==q||q(g);return g};EditorUi.prototype.importFiles=function(a,b,c,e,f,k,l,q,v,x,y,A){e=null!=e?e:this.maxImageSize;x=null!=x?x:this.maxImageBytes;var d=null!=b&&null!=c,g=!0;b=null!=b?b:0;c=null!=c?c:0;var m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=y||this.resampleThreshold,
|
|
|
|
|
p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>n){m=!0;break}var t=mxUtils.bind(this,function(){var m=this.editor.graph,n=m.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,g,f,k,m,l){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,e,g,f,k,m,l,d,A)}catch(T){return this.handleError(T),null}});k=null!=k?k:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,
|
|
|
|
|
mxResources.get("loading")))for(var p=a.length,z=p,t=[],B=mxUtils.bind(this,function(a,b){t[a]=b;if(0==--z){this.spinner.stop();if(null!=q)q(t);else{var d=[];m.getModel().beginUpdate();try{for(var c=0;c<t.length;c++){var e=t[c]();null!=e&&(d=d.concat(e))}}finally{m.getModel().endUpdate()}}k(d)}}),v=0;v<p;v++)mxUtils.bind(this,function(d){var k=a[d];if(null!=k){var p=new FileReader;p.onload=mxUtils.bind(this,function(a){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,
|
|
|
|
|
9)){var p=a.target.result,z=p.indexOf(","),t=decodeURIComponent(escape(atob(p.substring(z+1)))),q=mxUtils.parseXml(t),t=q.getElementsByTagName("svg");if(0<t.length){var t=t[0],v=A?null:t.getAttribute("content");null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(v,!0)));null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v));null==v||"<mxfile "!==v.substring(0,8)&&"<mxGraphModel "!==v.substring(0,14)?B(d,mxUtils.bind(this,function(){try{if(p.substring(0,z+1),null!=
|
|
|
|
|
q){var a=q.getElementsByTagName("svg");if(0<a.length){var g=a[0],l=g.getAttribute("width"),t=g.getAttribute("height"),l=null!=l&&"%"!=l.charAt(l.length-1)?parseFloat(l):NaN,t=null!=t&&"%"!=t.charAt(t.length-1)?parseFloat(t):NaN,B=g.getAttribute("viewBox");if(null==B||0==B.length)g.setAttribute("viewBox","0 0 "+l+" "+t);else if(isNaN(l)||isNaN(t)){var v=B.split(" ");3<v.length&&(l=parseFloat(v[2]),t=parseFloat(v[3]))}p=Editor.createSvgDataUri(mxUtils.getXml(g));var u=Math.min(1,Math.min(e/Math.max(1,
|
|
|
|
|
l)),e/Math.max(1,t)),C=f(p,k.type,b+d*n,c+d*n,Math.max(1,Math.round(l*u)),Math.max(1,Math.round(t*u)),k.name);if(isNaN(l)||isNaN(t)){var x=new Image;x.onload=mxUtils.bind(this,function(){l=Math.max(1,x.width);t=Math.max(1,x.height);C[0].geometry.width=l;C[0].geometry.height=t;g.setAttribute("viewBox","0 0 "+l+" "+t);p=Editor.createSvgDataUri(mxUtils.getXml(g));var a=p.indexOf(";");0<a&&(p=p.substring(0,a)+p.substring(p.indexOf(",",a+1)));m.setCellStyles("image",p,[C[0]])});x.src=Editor.createSvgDataUri(mxUtils.getXml(g))}return C}}}catch(fa){}return null})):
|
|
|
|
|
B(d,mxUtils.bind(this,function(){return f(v,"text/xml",b+d*n,c+d*n,0,0,k.name)}))}else B(d,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==k.type){var u=A?null:this.extractGraphModelFromPng(a.target.result);if(null!=u&&0<u.length){var C=new Image;C.src=a.target.result;B(d,mxUtils.bind(this,function(){return f(u,"text/xml",b+d*n,c+d*n,C.width,C.height,k.name)}));t=!0}}t||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),
|
|
|
|
|
mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(m){this.resizeImage(m,a.target.result,mxUtils.bind(this,function(m,l,p){B(d,mxUtils.bind(this,function(){if(null!=m&&m.length<x){var z=g&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(e/l,e/p)):1;return f(m,k.type,b+d*n,c+d*n,Math.round(l*z),Math.round(p*z),k.name)}this.handleError({message:mxResources.get("imageTooBig")});
|
|
|
|
|
return null}))}),g,e,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else p=a.target.result,f(p,k.type,b+d*n,c+d*n,240,160,k.name,function(a){B(d,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?f(null,k.type,b+d*n,c+d*n,240,160,k.name,function(a){B(d,function(){return a})},k):"image"==k.type.substring(0,5)||"application/pdf"==k.type?p.readAsDataURL(k):p.readAsText(k)}})(u)});if(m){m=[];
|
|
|
|
|
return null}))}),g,e,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else p=a.target.result,f(p,k.type,b+d*n,c+d*n,240,160,k.name,function(a){B(d,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?f(null,k.type,b+d*n,c+d*n,240,160,k.name,function(a){B(d,function(){return a})},k):"image"==k.type.substring(0,5)||"application/pdf"==k.type?p.readAsDataURL(k):p.readAsText(k)}})(v)});if(m){m=[];
|
|
|
|
|
for(p=0;p<a.length;p++)m.push(a[p]);a=m;this.confirmImageResize(function(a){g=a;t()},v)}else t()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),
|
|
|
|
|
function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",
|
|
|
|
|
OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(t){}};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,e,f,k){f=null!=f?f:this.maxImageSize;var d=Math.max(1,a.width),g=Math.max(1,a.height);if(e&&this.isResampleImage(b,k))try{var m=Math.max(d/f,g/f);if(1<m){var l=Math.round(d/m),n=Math.round(g/m),p=document.createElement("canvas");
|
|
|
|
@ -9973,11 +9973,11 @@ function(a){return xa.apply(this,arguments)||0>mxUtils.indexOf(e,a)};this.execut
|
|
|
|
|
V||"verticalflow"==V||"auto"==V&&1==ma.length){J.view.validate();var pa=new mxHierarchicalLayout(J,"horizontalflow"==V?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);pa.intraCellSpacing=G;pa.parallelEdgeSpacing=K;pa.interRankCellSpacing=L;pa.disableEdgeStyle=!1;this.executeLayout(function(){pa.execute(J.getDefaultParent(),ka);J.moveCells(ka,aa,ca)},!0,S);S=null}else if("organic"==V||"auto"==V&&ka.length>e.length){J.view.validate();var qa=new mxFastOrganicLayout(J);qa.forceConstant=3*G;qa.resetEdges=
|
|
|
|
|
!1;var ya=qa.isVertexIgnored;qa.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(e,a)};la=new mxParallelEdgeLayout(J);la.spacing=K;this.executeLayout(function(){qa.execute(J.getDefaultParent());ta()},!0,S);S=null}}this.hideDialog()}finally{J.model.endUpdate()}null!=S&&S()}}catch(za){this.handleError(za)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var d="?",c;for(c in urlParams)0>
|
|
|
|
|
mxUtils.indexOf(a,c)&&null!=urlParams[c]&&(b+=d+c+"="+urlParams[c],d="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var d="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),c;for(c in urlParams)0>mxUtils.indexOf(d,c)&&(a=0==b?a+"?":a+"&",null!=urlParams[c]&&(a+=c+"="+urlParams[c],b++))}return a};
|
|
|
|
|
EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,560,130,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
|
|
|
|
|
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
|
|
|
|
|
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
|
|
|
|
|
function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
|
|
|
|
|
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=1;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
|
|
|
|
|
EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,560,130,!0,!0);a.init()};var k=EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.apply(this,arguments),d=this.editor.graph,c=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(d.container)&&d.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,
|
|
|
|
|
0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return c.apply(this,arguments)};var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,
|
|
|
|
|
arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var c=this.source.getPagePadding();return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*c.x))/2)-c.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*c.y))/2)-c.y-5/a))}return new mxPoint(8/a,8/a)};var f=b.init;b.init=function(){f.apply(this,arguments);b.outline.view.getBackgroundPageBounds=
|
|
|
|
|
function(){var a=d.getPageLayout(),b=d.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,d){var c=d.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=
|
|
|
|
|
mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(c.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a){var b=1;null==this.drive&&"function"!==typeof window.DriveClient||b++;null==this.dropbox&&"function"!==typeof window.DropboxClient||b++;null==this.oneDrive&&
|
|
|
|
|
"function"!==typeof window.OneDriveClient||b++;null!=this.gitHub&&b++;null!=this.gitLab&&b++;a&&isLocalStorage&&"1"==urlParams.browser&&b++;return b};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());
|
|
|
|
|
this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(c);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(c),this.menus.get("newLibrary").setEnabled(c));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);
|
|
|
|
|
this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.actions.get("undo").setEnabled(this.canUndo()&&a);this.actions.get("redo").setEnabled(this.canRedo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&
|
|
|
|
@ -10102,8 +10102,8 @@ DrawioFileSync.prototype.fileChanged=function(a,e,c,b){return this.notifyThread=
|
|
|
|
|
DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorRevisionId(a,this.file.getCurrentRevisionId()),this.updateDescriptor(a),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(a){this.file.inConflictState=!0;this.file.handleFileError(a)}))};
|
|
|
|
|
DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
|
|
|
|
|
DrawioFileSync.prototype.catchup=function(a,e,c,b){if(null!=a&&(null==b||!b())){var k=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==k)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=e&&e();else if(this.isValidState()){var l=this.file.getDescriptorSecret(a);if(null==l)this.reload(e,c,b);else{var d=0,g=!1,m=mxUtils.bind(this,function(){if(null==b||!b())if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var n=!0,p=window.setTimeout(mxUtils.bind(this,
|
|
|
|
|
function(){n=!1;this.reload(e,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(k)+(null!=l?"&secret="+encodeURIComponent(l):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(p);if(n&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var l=null,t=[];if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var v=
|
|
|
|
|
JSON.parse(k.getText());if(null!=v&&0<v.length)for(var x=0;x<v.length;x++){var y=this.stringToObject(v[x]);if(y.v>DrawioFileSync.PROTOCOL){g=!0;t=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)l=y.d.checksum,t.push(y.d.patch);else{g=!0;t=[];break}}}catch(A){t=[],null!=window.console&&"1"==urlParams.test&&console.log(A)}try{0<t.length?(this.file.stats.cacheHits++,this.merge(t,l,a,e,c,b)):d<=this.maxCacheReadyRetries-1&&!g&&401!=k.getStatus()&&503!=k.getStatus()?(d++,this.file.stats.cacheMiss++,
|
|
|
|
|
function(){n=!1;this.reload(e,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(k)+(null!=l?"&secret="+encodeURIComponent(l):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(p);if(n&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var l=null,q=[];if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var v=
|
|
|
|
|
JSON.parse(k.getText());if(null!=v&&0<v.length)for(var t=0;t<v.length;t++){var y=this.stringToObject(v[t]);if(y.v>DrawioFileSync.PROTOCOL){g=!0;q=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)l=y.d.checksum,q.push(y.d.patch);else{g=!0;q=[];break}}}catch(A){q=[],null!=window.console&&"1"==urlParams.test&&console.log(A)}try{0<q.length?(this.file.stats.cacheHits++,this.merge(q,l,a,e,c,b)):d<=this.maxCacheReadyRetries-1&&!g&&401!=k.getStatus()&&503!=k.getStatus()?(d++,this.file.stats.cacheMiss++,
|
|
|
|
|
window.setTimeout(m,(d+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(e,c,b))}catch(A){null!=c&&c(A)}}else null!=c&&c()}))}else null!=c&&c()});window.setTimeout(m,this.cacheReadyDelay)}}else null!=c&&c()}};DrawioFileSync.prototype.reload=function(a,e,c,b){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=e&&e(a)}),c,b)};
|
|
|
|
|
DrawioFileSync.prototype.merge=function(a,e,c,b,k,f){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var l=this.file.ignorePatches(a),d=this.file.getDescriptorRevisionId(c);if(!l){for(f=0;f<a.length;f++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
|
|
|
|
|
a[f]);var g=null!=e?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",d,"etag",this.file.getDescriptorEtag(c),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",e==g,e);if(null!=e&&e!=g){var m=this.ui.hashValue(this.file.getCurrentRevisionId()),n=this.ui.hashValue(d);this.file.checksumError(k,a,"From: "+m+"\nTo: "+n+"\nChecksum: "+e+"\nCurrent: "+g,d,"merge");
|
|
|
|
@ -10300,11 +10300,11 @@ OneDriveClient.prototype.getAccountTypeAndEndpoint=function(a,e){this.get(this.b
|
|
|
|
|
a();return}}catch(f){}e({message:mxResources.get("unknownError")+" (Code: "+c.getStatus()+")"})}),e)};
|
|
|
|
|
OneDriveClient.prototype.executeRequest=function(a,e,c){var b=mxUtils.bind(this,function(k){var f=!0,l=window.setTimeout(mxUtils.bind(this,function(){f=!1;c({code:App.ERROR_TIMEOUT,retry:b})}),this.ui.timeout);this.get(a,mxUtils.bind(this,function(a){window.clearTimeout(l);f&&(200<=a.getStatus()&&299>=a.getStatus()||404==a.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),e(a)):k||401!==a.getStatus()&&400!==a.getStatus()?c(this.parseRequestText(a)):this.authenticate(function(){b(!0)},
|
|
|
|
|
c,k))}),mxUtils.bind(this,function(a){window.clearTimeout(l);f&&c(a)}))});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){b(!0)},c):b(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var e=a.split("/");return 1<e.length?{driveId:e[0],id:e[1]}:{id:a}};
|
|
|
|
|
OneDriveClient.prototype.getItemURL=function(a,e){var c=a.split("/");return 1<c.length?(e?"":this.baseUrl)+"/drives/"+c[0]+"/items/"+c[1]:(e?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,e,c){this.getFile(a,e,c,!1,!0)};
|
|
|
|
|
OneDriveClient.prototype.getItemURL=function(a,e){var c=a.split("/");return 1<c.length?(e?"":this.baseUrl)+"/drives/"+c[0]+"/items/"+c[1]:(e?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,e,c){this.getFile(a,e,c,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(a){var e=a.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');0<e&&(a=a.substring(0,e));return a};
|
|
|
|
|
OneDriveClient.prototype.getFile=function(a,e,c,b,k){k=null!=k?k:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var b=JSON.parse(a.getText()),d=/\.png$/i.test(b.name);if(/\.v(dx|sdx?)$/i.test(b.name)||/\.gliffy$/i.test(b.name)||/\.pdf$/i.test(b.name)||!this.ui.useCanvasForExport&&d)this.ui.convertFile(b["@microsoft.graph.downloadUrl"],b.name,null!=b.file?b.file.mimeType:null,this.extension,e,c);else{var f=!0,m=window.setTimeout(mxUtils.bind(this,
|
|
|
|
|
function(){f=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(b["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(m),f){var g=d?a.lastIndexOf(","):-1,l=null;if(0<g){var n=this.ui.extractGraphModelFromPng(a.substring(g+1));null!=n&&0<n.length?a=n:l=new LocalFile(this.ui,a,b.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var q=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(q):Base64.decode(q)}Graph.fileSupport&&
|
|
|
|
|
(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(a,b["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this.ui,a.responseText,b.name+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(x){if(null!=c)c(x);else throw x;}}),b.name):null!=l?e(l):k?e(new OneDriveLibrary(this.ui,a,b)):e(new OneDriveFile(this.ui,a,b))}}catch(v){if(null!=
|
|
|
|
|
c)c(v);else throw v;}}),mxUtils.bind(this,function(a){window.clearTimeout(m);f&&c(this.parseRequestText(a))}),d||null!=b.file&&null!=b.file.mimeType&&("image/"==b.file.mimeType.substring(0,6)||"application/pdf"==b.file.mimeType))}}else c(this.parseRequestText(a))}),c)};
|
|
|
|
|
function(){f=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(b["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(m),f){/\.html$/i.test(b.name)&&(a=this.removeExtraHtmlContent(a));var g=d?a.lastIndexOf(","):-1,l=null;if(0<g){var n=this.ui.extractGraphModelFromPng(a.substring(g+1));null!=n&&0<n.length?a=n:l=new LocalFile(this.ui,a,b.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var q=a.substring(22);a=window.atob&&
|
|
|
|
|
!mxClient.IS_SF?atob(q):Base64.decode(q)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(a,b["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this.ui,a.responseText,b.name+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(x){if(null!=c)c(x);else throw x;}}),b.name):null!=l?e(l):k?e(new OneDriveLibrary(this.ui,
|
|
|
|
|
a,b)):e(new OneDriveFile(this.ui,a,b))}}catch(v){if(null!=c)c(v);else throw v;}}),mxUtils.bind(this,function(a){window.clearTimeout(m);f&&c(this.parseRequestText(a))}),d||null!=b.file&&null!=b.file.mimeType&&("image/"==b.file.mimeType.substring(0,6)||"application/pdf"==b.file.mimeType))}}else c(this.parseRequestText(a))}),c)};
|
|
|
|
|
OneDriveClient.prototype.renameFile=function(a,e,c,b){null!=a&&null!=e&&(this.isValidFilename(e)?this.checkExists(a.getParentId(),e,!1,mxUtils.bind(this,function(k){k?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:e}),"PATCH","application/json",c,b):b()})):b({message:this.invalidFilenameRegExs[0].test(e)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};
|
|
|
|
|
OneDriveClient.prototype.moveFile=function(a,e,c,b){e=this.getItemRef(e);var k=this.getItemRef(a);e.driveId!=k.driveId?b({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(a),JSON.stringify({parentReference:e}),"PATCH","application/json",c,b)};OneDriveClient.prototype.insertLibrary=function(a,e,c,b,k){this.insertFile(a,e,c,b,!0,k)};
|
|
|
|
|
OneDriveClient.prototype.insertFile=function(a,e,c,b,k,f){this.isValidFilename(a)?(k=null!=k?k:!1,this.checkExists(f,a,!0,mxUtils.bind(this,function(l){l?(l="/me/drive/root",null!=f&&(l=this.getItemURL(f,!0)),l=this.baseUrl+l+"/children/"+encodeURIComponent(a)+"/content",this.writeFile(l,e,"PUT",null,mxUtils.bind(this,function(a){k?c(new OneDriveLibrary(this.ui,e,a)):c(new OneDriveFile(this.ui,e,a))}),b)):b()}))):b({message:this.invalidFilenameRegExs[0].test(a)?mxResources.get("oneDriveCharsNotAllowed"):
|
|
|
|
@ -10408,8 +10408,8 @@ GitLabClient.prototype.showGitLabDialog=function(a,e){var c=null,b=null,k=null,f
|
|
|
|
|
mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("title",a);d.style.cursor="pointer";mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=m.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),t=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(p(c+"/"+b,mxUtils.bind(this,function(){f=null;A()})));a||(mxUtils.write(d," / "),d.appendChild(p(decodeURIComponent(k),mxUtils.bind(this,function(){f=
|
|
|
|
|
null;y()}))));if(null!=f&&0<f.length){var e=f.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(p(e[a],mxUtils.bind(this,function(){f=e.slice(0,a+1).join("/");x()})))})(a)}g.appendChild(d)}),u=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=k=b=c=null,A()):this.ui.hideDialog()}))}),q=null,v=null,x=mxUtils.bind(this,function(d){null==d&&(g.innerHTML="",d=1);var l=new mxXmlRequest(this.baseUrl+
|
|
|
|
|
"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/tree?path="+f+"&ref="+k+"&per_page=100&page="+d,null,"GET");this.ui.spinner.spin(g,mxResources.get("loading"));n.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var z=mxUtils.bind(this,function(){x(d+1)});mxEvent.addListener(q,
|
|
|
|
|
"click",z);this.executeRequest(l,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==d&&(t(!k),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");x()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(g,mxResources.get("noFiles"));else{var B=!0,u=0;l=mxUtils.bind(this,function(d){for(var l=0;l<n.length;l++)mxUtils.bind(this,function(l){if(d==("tree"==l.type)){var n=m.cloneNode();n.style.backgroundColor=
|
|
|
|
|
B?"dark"==uiTheme?"#000000":"#eeeeee":"";B=!B;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(p(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,x()):a&&"blob"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+k+"/"+l.path))})));g.appendChild(n);u++}})(n[l])});l(!0);a&&l(!1);100==u&&(g.appendChild(q),
|
|
|
|
|
"click",z);this.executeRequest(l,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==d&&(t(!k),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");x()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(g,mxResources.get("noFiles"));else{var B=!0,C=0;l=mxUtils.bind(this,function(d){for(var l=0;l<n.length;l++)mxUtils.bind(this,function(l){if(d==("tree"==l.type)){var n=m.cloneNode();n.style.backgroundColor=
|
|
|
|
|
B?"dark"==uiTheme?"#000000":"#eeeeee":"";B=!B;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(p(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,x()):a&&"blob"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+k+"/"+l.path))})));g.appendChild(n);C++}})(n[l])});l(!0);a&&l(!1);100==C&&(g.appendChild(q),
|
|
|
|
|
v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&z()},mxEvent.addListener(g,"scroll",v))}}),u,!0)}),y=mxUtils.bind(this,function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);
|
|
|
|
|
q=document.createElement("a");q.style.display="block";q.style.cursor="pointer";mxUtils.write(q,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(q,"click",e);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(t(!0),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(g,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,
|
|
|
|
|
function(a,b){var c=m.cloneNode();c.style.backgroundColor=0==b%2?"dark"==uiTheme?"#000000":"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){k=encodeURIComponent(a.name);f="";x()})));g.appendChild(c)})(b[c],c);100==b.length&&(g.appendChild(q),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}}),u)});n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));var A=mxUtils.bind(this,function(a){this.ui.spinner.stop();
|
|
|
|
@ -10525,7 +10525,7 @@ App.prototype.checkDrafts=function(){try{var a=Editor.guid();localStorage.setIte
|
|
|
|
|
null!=b&&b()}),mxResources.get("no"),mxResources.get("yes"))}),null,null,null,1<c.length?c:null),this.showDialog(e.container,640,480,!0,!1,mxUtils.bind(this,function(a){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)})),e.init()):"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}),mxUtils.bind(this,function(){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,
|
|
|
|
|
this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(e){}};
|
|
|
|
|
App.prototype.showSplash=function(a){var e=this.getServiceCount(!0),c=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=a)}),!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()||mxClient.IS_ANDROID||
|
|
|
|
|
mxClient.IS_IOS||this.mode!=App.MODE_DEVICE||this.showDownloadDesktopBanner()});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&c();else{a=4==e?2:3;var b=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();c()}),a);this.showDialog(b.container,3>a?200:300,3<e?320:210,!0,!1);b.init()}};
|
|
|
|
|
mxClient.IS_IOS||this.mode!=App.MODE_DEVICE||this.showDownloadDesktopBanner()});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&c();else{a=4==e?2:3;var b=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();c()}),a);this.showDialog(b.container,3>a?200:300,3<e?320:210,!0,!1)}};
|
|
|
|
|
App.prototype.addLanguageMenu=function(a,e){var c=null;if(null!=this.menus.get("language")){c=document.createElement("div");c.setAttribute("title",mxResources.get("language"));c.className="geIcon geSprite geSprite-globe";c.style.position="absolute";c.style.cursor="pointer";c.style.bottom="20px";c.style.right="20px";if(e){c.style.direction="rtl";c.style.textAlign="right";c.style.right="24px";var b=document.createElement("span");b.style.display="inline-block";b.style.fontSize="12px";b.style.margin=
|
|
|
|
|
"5px 24px 0 0";b.style.color="gray";b.style.userSelect="none";mxUtils.write(b,mxResources.get("language"));c.appendChild(b)}mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(this.menus.get("language").funct);b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var e=mxUtils.getOffset(c);
|
|
|
|
|
b.popup(e.x,e.y+c.offsetHeight,null,a);this.setCurrentMenu(b)}));a.appendChild(c)}return c};
|
|
|
|
@ -10670,70 +10670,71 @@ b.actions.addAction("editGeometry...",function(){for(var a=k.getSelectionCells()
|
|
|
|
|
mxUtils.bind(this,function(a,c,d,e,f,g,k,l,m,n,p,v){a=parseInt(a);!isNaN(a)&&0<a&&b.exportImage(a/100,!1,d,e,!1,k,!l,!1,"jpeg",p,null,v)}),!0,!1,"jpeg"):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||b.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(a,c,d,e,f){b.downloadFile("jpeg",null,null,a,null,null,null,e,f)}),!0,!0)}));n=b.actions.put("shadowVisible",new Action(mxResources.get("shadow"),function(){k.setShadowVisible(!k.shadowVisible)}));n.setToggleAction(!0);
|
|
|
|
|
n.setSelectedCallback(function(){return k.shadowVisible});b.actions.put("about",new Action(mxResources.get("about")+" "+EditorUi.VERSION+"...",function(){b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.alert(b.editor.appName+" "+EditorUi.VERSION):b.openLink("https://www.diagrams.net/")}));b.actions.addAction("support...",function(){b.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});b.actions.addAction("exportOptionsDisabled...",function(){b.handleError({message:mxResources.get("exportOptionsDisabledDetails")},
|
|
|
|
|
mxResources.get("exportOptionsDisabled"))});b.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):b.openLink("shortcuts.svg")});b.actions.addAction("feedback...",function(){var a=new FeedbackDialog(b);b.showDialog(a.container,610,360,!0,!1);a.init()});b.actions.addAction("quickStart...",function(){b.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});
|
|
|
|
|
n=b.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(b,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));n.setToggleAction(!0);
|
|
|
|
|
n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));n=b.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(b,document.body.offsetWidth-300,110,240,155),this.findWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),
|
|
|
|
|
b.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));b.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){b.exportVisio()}));isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&b.actions.addAction("configuration...",function(){var a=localStorage.getItem(".configuration"),
|
|
|
|
|
a=new TextareaDialog(b,mxResources.get("configuration")+":",null!=a?JSON.stringify(JSON.parse(a),null,2):"",function(a){if(null!=a)try{if(0<a.length){var c=JSON.parse(a);localStorage.setItem(".configuration",JSON.stringify(c))}else localStorage.removeItem(".configuration");b.hideDialog();b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}},null,null,null,null,null,!0,null,null,"https://desk.draw.io/support/solutions/articles/16000058316",EditorUi.isElectronApp?null:[[mxResources.get("reset"),
|
|
|
|
|
function(a,c){b.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(".configuration"),localStorage.removeItem(".drawio-config"),localStorage.removeItem(".mode"),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}})}],[mxResources.get("link"),function(a,c){if(0<c.value.length)try{var d=JSON.parse(c.value),e=window.location.protocol+"//"+window.location.host+"/"+b.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(d)),f=new EmbedDialog(b,
|
|
|
|
|
e);b.showDialog(f.container,440,240,!0);f.init()}catch(H){b.handleError(H)}else b.handleError({message:mxResources.get("invalidInput")})}]]);a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!1);a.init()});if(mxClient.IS_CHROMEAPP||isLocalStorage){this.put("language",new Menu(mxUtils.bind(this,function(a,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=a.addItem(e,null,mxUtils.bind(this,
|
|
|
|
|
function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);b.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&a.addCheckmark(f,Editor.checkmarkImage));return f});d("");a.addSeparator(c);for(var e in mxLanguageMap)d(e)})));var u=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=u.apply(this,arguments);if(null!=b){var c=this.get("language");if(null!=
|
|
|
|
|
c){c=b.addMenu("",c.funct);c.setAttribute("title",mxResources.get("language"));c.style.width="16px";c.style.paddingTop="2px";c.style.paddingLeft="4px";c.style.zIndex="1";c.style.position="absolute";c.style.display="block";c.style.cursor="pointer";c.style.right="17px";"atlas"==uiTheme?(c.style.top="6px",c.style.right="15px"):c.style.top="min"==uiTheme?"2px":"0px";if(mxClient.IS_VML)c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>';else{var d=document.createElement("div");d.style.backgroundImage=
|
|
|
|
|
"url("+Editor.globeImage+")";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="19px 19px";d.style.position="absolute";d.style.height="19px";d.style.width="19px";d.style.marginTop="2px";d.style.zIndex="1";c.appendChild(d);mxUtils.setOpacity(c,40);if("atlas"==uiTheme||"dark"==uiTheme)c.style.opacity="0.85",c.style.filter="invert(100%)"}document.body.appendChild(c)}}return b}}b.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",
|
|
|
|
|
intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];b.actions.addAction("runLayout",function(){var a=new TextareaDialog(b,"Run Layouts:",JSON.stringify(b.customLayoutConfig,null,2),function(a){if(0<a.length)try{var c=JSON.parse(a);b.executeLayoutList(c);b.customLayoutConfig=c}catch(D){b.handleError(D),null!=window.console&&console.error(D)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()});
|
|
|
|
|
var n=this.get("layout"),q=n.funct;n.funct=function(a,c){q.apply(this,arguments);a.addSeparator(c);a.addItem(mxResources.get("orgChart")+"...",null,function(){var a=null,c=20,d=20,e=!0,f=function(){b.loadingOrgChart=!1;b.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&null!=a&&e){var f=b.editor.graph,g=new mxOrgChartLayout(f,a,c,d),k=f.getDefaultParent();1<f.model.getChildCount(f.getSelectionCell())&&(k=f.getSelectionCell());g.execute(k);e=!1}},g=document.createElement("div"),k=document.createElement("div");
|
|
|
|
|
k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("orgChartType")+": ");g.appendChild(k);var l=document.createElement("select");l.style.width="200px";l.style.boxSizing="border-box";for(var k=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],m=0;m<k.length;m++){var n=
|
|
|
|
|
document.createElement("option");mxUtils.write(n,k[m]);n.value=m;2==m&&n.setAttribute("selected","selected");l.appendChild(n)}mxEvent.addListener(l,"change",function(){a=l.value});g.appendChild(l);k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");g.appendChild(k);var p=document.createElement("input");p.type="number";p.value=c;p.style.width="200px";p.style.boxSizing="border-box";g.appendChild(p);
|
|
|
|
|
mxEvent.addListener(p,"change",function(){c=p.value});k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");g.appendChild(k);var z=document.createElement("input");z.type="number";z.value=d;z.style.width="200px";z.style.boxSizing="border-box";g.appendChild(z);mxEvent.addListener(z,"change",function(){d=z.value});g=new CustomDialog(b,g,function(){null==a&&(a=2);"undefined"!==typeof mxOrgChartLayout||
|
|
|
|
|
b.loadingOrgChart||b.isOffline(!0)?f():b.spinner.spin(document.body,mxResources.get("loading"))&&(b.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart.min.js",f):mxscript("js/extensions.min.js",f))});b.showDialog(g.container,355,125,!0,!0)},c,null,f());a.addSeparator(c);b.menus.addMenuItem(a,"runLayout",c,null,null,mxResources.get("apply")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(a,c){if(!mxClient.IS_CHROMEAPP&&b.isOffline())this.addMenuItems(a,["about"],c);else{var d=
|
|
|
|
|
a.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),e.value="",EditorUi.logEvent({category:"SEARCH-HELP",
|
|
|
|
|
action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(e.value="")}));d.firstChild.nextSibling.appendChild(e);mxEvent.addGestureListeners(e,function(a){document.activeElement!=e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(a,"- keyboardShortcuts quickStart support - about".split(" "),c)}"1"==
|
|
|
|
|
urlParams.test&&(a.addSeparator(c),this.addSubmenu("testDevelop",a,c))})));"1"==urlParams.test&&(mxResources.parse("testDevelop=Develop"),mxResources.parse("showBoundingBox=Show bounding box"),mxResources.parse("createSidebarEntry=Create Sidebar Entry"),mxResources.parse("testCheckFile=Check File"),mxResources.parse("testDiff=Diff"),mxResources.parse("testInspect=Inspect"),mxResources.parse("testShowConsole=Show Console"),mxResources.parse("testXmlImageExport=XML Image Export"),mxResources.parse("testDownloadRtModel=Export RT model"),
|
|
|
|
|
mxResources.parse("testImportRtModel=Import RT model"),b.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!k.isSelectionEmpty()){var a=k.cloneCells(k.getSelectionCells()),c=k.getBoundingBoxFromGeometry(a),a=k.moveCells(a,-c.x,-c.y);b.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+c.width+", "+c.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(k.encodeCells(a)))+"'),")}})),b.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=
|
|
|
|
|
k.getGraphBounds(),b=k.view.translate,c=k.view.scale;k.insertVertex(k.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.height/c,"fillColor=none;strokeColor=red;")})),b.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var a=null!=b.pages&&null!=b.getCurrentFile()?b.getCurrentFile().getAnonymizedXmlForPages(b.pages):"",a=new TextareaDialog(b,"Paste Data:",a,function(a){if(0<a.length)try{var c=function(a){function b(a){if(null==n[a]){if(n[a]=!0,null!=e[a]){for(;0<e[a].length;){var d=
|
|
|
|
|
e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var l=d[k];if(null!=l.id&&0<l.id.length)if(null==a[l.id]){a[l.id]=l.id;var m=l.getAttribute("parent");null==m?null!=f?mxLog.debug(c+": Multiple roots: "+l.id):f=l.id:(null==e[m]&&(e[m]=[]),e[m].push(l.id))}else g[l.id]=l.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):
|
|
|
|
|
mxLog.debug(c+": Checked");var n={};null==f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",e)))};"<"!=a.charAt(0)&&(a=Graph.decompress(a),mxLog.debug("See console for uncompressed XML"),console.log("xml",a));var d=mxUtils.parseXml(a),e=b.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=b.getHashValueForPages(e);mxLog.debug("Checksum: ",f)}catch(I){mxLog.debug("Error: ",
|
|
|
|
|
I.message)}else mxLog.debug("No pages found for checksum");var g=d.getElementsByTagName("root");for(a=0;a<g.length;a++)c(g[a]);mxLog.show()}catch(I){b.handleError(I),null!=window.console&&console.error(I)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()})),b.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=b.pages){var a=new TextareaDialog(b,"Paste Data:","",function(a){if(0<a.length)try{console.log(JSON.stringify(b.diffPages(b.pages,
|
|
|
|
|
b.getPagesForNode(mxUtils.parseXml(a).documentElement)),null,2))}catch(C){b.handleError(C),null!=window.console&&console.error(C)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()}else b.alert("No pages")})),b.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(b,k.getModel())})),b.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=k.getGraphBounds(),c=k.view.scale,d=mxUtils.createXmlDocument(),
|
|
|
|
|
e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var f=0,g=d.save;d.save=function(){f++;g.apply(this,arguments)};var l=d.restore;d.restore=function(){f--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,f);m.apply(this,arguments);mxLog.debug("leaving shape",a,f)};a.drawState(k.getView().getState(k.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",
|
|
|
|
|
f)})),b.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==b.drive?b.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):b.drive.execute(mxUtils.bind(this,function(){var a=prompt("File ID","");if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+a+"/realtime?supportsAllDrives=true",null,"GET");c.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,
|
|
|
|
|
arguments);a.setRequestHeader("authorization","Bearer "+b.drive.token)};c.send(function(c){b.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?b.saveLocalFile(c.getText(),"json-"+a+".txt","text/plain"):b.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),b.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,
|
|
|
|
|
function(a,c){this.addMenuItems(a,"createSidebarEntry showBoundingBox - testCheckFile testDiff - testInspect - testXmlImageExport - testDownloadRtModel".split(" "),c);a.addItem(mxResources.get("testImportRtModel")+"...",null,function(){var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",mxUtils.bind(this,function(){if(null!=a.files){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{b.openLocalFile(mxUtils.getXml(b.drive.convertJsonToXml(JSON.parse(c.target.result).data)),
|
|
|
|
|
a.files[0].name,!0)}catch(F){b.handleError(F,mxResources.get("errorLoadingFile"))}});c.readAsText(a.files[0])}}));a.click()},c);this.addMenuItems(a,["-","testShowConsole"],c)}))));b.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!b.isOffline()?b.showDialog((new MoreShapesDialog(b,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):b.showDialog((new MoreShapesDialog(b,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});b.actions.put("createShape",
|
|
|
|
|
new Action(mxResources.get("shape")+"...",function(a){k.isEnabled()&&(a=new mxCell("",new mxGeometry(0,0,120,120),b.defaultCustomShapeStyle),a.vertex=!0,a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())})).isEnabled=f;b.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("create"),
|
|
|
|
|
"https://desk.draw.io/support/solutions/articles/16000042542",a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e,f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d=new EmbedDialog(b,a+"\n"+c,null,null,function(){var d=window.open(),e=d.document;if(null!=e){"CSS1Compat"===document.compatMode&&e.writeln("<!DOCTYPE html>");e.writeln("<html>");e.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');e.writeln("<body>");e.writeln(a);var f=mxClient.IS_IE||
|
|
|
|
|
mxClient.IS_EDGE||null!=document.documentMode;f&&e.writeln(c);e.writeln("</body>");e.writeln("</html>");e.close();if(!f){var g=d.document.createElement("div");g.marginLeft="26px";g.marginTop="26px";mxUtils.write(g,mxResources.get("updatingDocument"));f=d.document.createElement("img");f.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");f.style.marginLeft="6px";g.appendChild(f);d.document.body.insertBefore(g,d.document.body.firstChild);window.setTimeout(function(){var a=
|
|
|
|
|
document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];e.body.appendChild(a);g.parentNode.removeChild(g)},20)}}else b.handleError({message:mxResources.get("errorUpdatingPreview")})});b.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));b.actions.put("liveImage",new Action("Live image...",function(){var a=b.getCurrentFile();null!=a&&b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(c){b.spinner.stop();
|
|
|
|
|
null!=c?(c=new EmbedDialog(b,'<img src="'+(a.constructor!=DriveFile?c:"https://drive.google.com/uc?id="+a.getId())+'"/>'),b.showDialog(c.container,440,240,!0,!0),c.init()):b.handleError({message:mxResources.get("invalidPublicUrl")})})}));b.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){b.showEmbedImageDialog(function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.createEmbedImage(a,c,d,e,f,g,function(a){b.spinner.stop();a=new EmbedDialog(b,
|
|
|
|
|
a);b.showDialog(a.container,440,240,!0,!0);a.init()},function(a){b.spinner.stop();b.handleError(a)})},mxResources.get("image"),mxResources.get("retina"),b.isExportToCanvas())}));b.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showEmbedImageDialog(function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.createEmbedSvg(a,c,d,e,f,g,function(a){b.spinner.stop();a=new EmbedDialog(b,a);b.showDialog(a.container,440,240,!0,!0);a.init()},function(a){b.spinner.stop();
|
|
|
|
|
b.handleError(a)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));b.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var a=k.getGraphBounds();b.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((a.y+a.height-k.view.translate.y)/k.view.scale)+2,function(a,c,d,e,f,g,k,l){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(m){b.spinner.stop();
|
|
|
|
|
m=new EmbedDialog(b,'<iframe frameborder="0" style="width:'+k+";height:"+l+';" src="'+b.createLink(a,c,d,e,f,g,m)+'"></iframe>');b.showDialog(m.container,440,240,!0,!0);m.init()})},!0)}));b.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){b.showPublishLinkDialog(null,null,null,null,function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(k){b.spinner.stop();k=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,k));
|
|
|
|
|
b.showDialog(k.container,440,240,!0,!0);k.init()})})}));b.actions.addAction("microsoftOffice...",function(){b.openLink("https://office.draw.io")});b.actions.addAction("googleDocs...",function(){b.openLink("http://docsaddon.draw.io")});b.actions.addAction("googleSlides...",function(){b.openLink("https://slidesaddon.draw.io")});b.actions.addAction("googleSheets...",function(){b.openLink("https://sheetsaddon.draw.io")});b.actions.addAction("googleSites...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&
|
|
|
|
|
b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();a=new GoogleSitesDialog(b,a);b.showDialog(a.container,420,256,!0,!0);a.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)n=b.actions.addAction("scratchpad",function(){b.toggleScratchpad()}),n.setToggleAction(!0),n.setSelectedCallback(function(){return null!=b.scratchpad}),b.actions.addAction("plugins...",function(){b.showDialog((new PluginsDialog(b)).container,360,170,!0,!1)});n=b.actions.addAction("search",function(){var a=b.sidebar.isEntryVisible("search");
|
|
|
|
|
b.sidebar.showPalette("search",!a);isLocalStorage&&(mxSettings.settings.search=!a,mxSettings.save())});n.setToggleAction(!0);n.setSelectedCallback(function(){return b.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(b.actions.get("save").funct=function(a){k.isEditing()&&k.stopEditing();var c="0"!=urlParams.pages||null!=b.pages&&1<b.pages.length?b.getFileData(!0):mxUtils.getXml(b.editor.getGraphXml());if("json"==urlParams.proto){var d=b.createLoadMessage("save");d.xml=c;a&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||
|
|
|
|
|
window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(b.editor.modified=!1,b.editor.setStatus(""));a=b.getCurrentFile();null==a||a.constructor==LocalFile&&null==a.mode||b.saveFile()},b.actions.addAction("saveAndExit",function(){b.actions.get("save").funct(!0)}),b.actions.addAction("exit",function(){var a=function(){b.editor.modified=!1;var a="json"==urlParams.proto?JSON.stringify({event:"exit",modified:b.editor.modified}):"";(window.opener||window.parent).postMessage(a,
|
|
|
|
|
"*")};b.editor.modified?b.confirm(mxResources.get("allChangesLost"),null,a,mxResources.get("cancel"),mxResources.get("discardChanges")):a()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){b.isExportToCanvas()?(this.addMenuItems(a,["exportPng"],c),b.jpgSupported&&this.addMenuItems(a,["exportJpg"],c)):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(a,["exportPng","exportJpg"],c);this.addMenuItems(a,["exportSvg","-"],c);b.isOffline()||b.printPdfExport?this.addMenuItems(a,
|
|
|
|
|
["exportPdf"],c):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(a,["exportPdf"],c);mxClient.IS_IE||"undefined"===typeof VsdxExport&&b.isOffline()||this.addMenuItems(a,["exportVsdx"],c);this.addMenuItems(a,["-","exportHtml","exportXml","exportUrl"],c);b.isOffline()||(a.addSeparator(c),this.addMenuItem(a,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(a,c){function e(a){a.pickFile(function(c){b.spinner.spin(document.body,
|
|
|
|
|
mxResources.get("loading"))&&a.getFile(c,function(a){var c="data:image/"==a.getData().substring(0,11)?n(a.getTitle()):"text/xml";/\.svg$/i.test(a.getTitle())&&!b.editor.isDataSvg(a.getData())&&(a.setData(Editor.createSvgDataUri(a.getData())),c="image/svg+xml");f(a.getData(),c,a.getTitle())},function(a){b.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)},a==b.drive)},!0)}var f=mxUtils.bind(this,function(a,c,d){var e=k.view,f=k.getGraphBounds(),g=k.snap(Math.ceil(Math.max(0,f.x/e.scale-
|
|
|
|
|
e.translate.x)+4*k.gridSize)),l=k.snap(Math.ceil(Math.max(0,(f.y+f.height)/e.scale-e.translate.y)+4*k.gridSize));"data:image/"==a.substring(0,11)?b.loadImage(a,mxUtils.bind(this,function(e){var f=!0,m=mxUtils.bind(this,function(){b.resizeImage(e,a,mxUtils.bind(this,function(e,m,n){e=f?Math.min(1,Math.min(b.maxImageSize/m,b.maxImageSize/n)):1;b.importFile(a,c,g,l,Math.round(m*e),Math.round(n*e),d,function(a){b.spinner.stop();k.setSelectionCells(a);k.scrollCellToVisible(k.getSelectionCell())})}),f)});
|
|
|
|
|
a.length>b.resampleThreshold?b.confirmImageResize(function(a){f=a;m()}):m()}),mxUtils.bind(this,function(){b.handleError({message:mxResources.get("cannotOpenFile")})})):b.importFile(a,c,g,l,0,0,d,function(a){b.spinner.stop();k.setSelectionCells(a);k.scrollCellToVisible(k.getSelectionCell())})}),n=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)?b="image/gif":/\.pdf$/i.test(a)&&(b="application/pdf");return b});"undefined"!=
|
|
|
|
|
typeof google&&"undefined"!=typeof google.picker&&(null!=b.drive?a.addItem(mxResources.get("googleDrive")+"...",null,function(){e(b.drive)},c):l&&"function"===typeof window.DriveClient&&a.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=b.oneDrive?a.addItem(mxResources.get("oneDrive")+"...",null,function(){e(b.oneDrive)},c):g&&"function"===typeof window.OneDriveClient&&a.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+
|
|
|
|
|
"...)",null,function(){},c,null,!1);null!=b.dropbox?a.addItem(mxResources.get("dropbox")+"...",null,function(){e(b.dropbox)},c):d&&"function"===typeof window.DropboxClient&&a.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);null!=b.gitHub&&a.addItem(mxResources.get("github")+"...",null,function(){e(b.gitHub)},c);null!=b.gitLab&&a.addItem(mxResources.get("gitlab")+"...",null,function(){e(b.gitLab)},c);null!=b.trello?a.addItem(mxResources.get("trello")+
|
|
|
|
|
"...",null,function(){e(b.trello)},c):m&&"function"===typeof window.TrelloClient&&a.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&a.addItem(mxResources.get("browser")+"...",null,function(){b.importLocalFile(!1)},c);a.addItem(mxResources.get("device")+"...",null,function(){b.importLocalFile(!0)},c);b.isOffline()||(a.addSeparator(c),a.addItem(mxResources.get("url")+"...",null,function(){var a=
|
|
|
|
|
new FilenameDialog(b,"",mxResources.get("import"),function(a){if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(a)?"image/png":"text/xml";b.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(a),function(b){f(b,c,a)},function(){b.spinner.stop();b.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));b.showDialog(a.container,300,80,!0,!0);a.init()},c))}))).isEnabled=f;this.put("theme",new Menu(mxUtils.bind(this,
|
|
|
|
|
function(a,c){var d=mxSettings.getUi(),e=a.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&a.addCheckmark(e,Editor.checkmarkImage);a.addSeparator(c);e=a.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&a.addCheckmark(e,Editor.checkmarkImage);
|
|
|
|
|
e=a.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&a.addCheckmark(e,Editor.checkmarkImage);e=a.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&a.addCheckmark(e,Editor.checkmarkImage);e=a.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();
|
|
|
|
|
b.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&a.addCheckmark(e,Editor.checkmarkImage)})));n=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();if(null!=a){var c=null!=a.getTitle()?a.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&null!=a&&b!=a.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&
|
|
|
|
|
a.rename(b,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),a.constructor==DriveFile||a.constructor==StorageFile?mxResources.get("diagramName"):null,function(a){if(null!=a&&0<a.length)return!0;b.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,null,b.editor.fileExtensions);this.editorUi.showDialog(c.container,
|
|
|
|
|
340,90,!0,!0);c.init()}}));n.isEnabled=function(){return this.enabled&&f.apply(this,arguments)};n.visible="1"!=urlParams.embed;b.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var a=b.getCurrentFile();if(null!=a){var c=b.getCopyFilename(a);a.constructor==DriveFile?(c=new CreateDialog(b,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?b.spinner.spin(document.body,mxResources.get("saving"))&&a.saveAs(c,mxUtils.bind(this,function(c){a.desc=
|
|
|
|
|
c;a.save(!1,mxUtils.bind(this,function(){b.spinner.stop();a.setModified(!1);a.addAllSavedStatus()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),mxUtils.bind(this,function(a){b.handleError(a)})):b.createFile(c,b.getFileData(!0),null,d))}),mxUtils.bind(this,function(){b.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,b.editor.fileExtensions),b.showDialog(c.container,420,380,!0,!0),c.init()):b.editor.editAsNew(this.editorUi.getFileData(!0),
|
|
|
|
|
c)}}));b.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var a=b.getCurrentFile();if(a.getMode()==App.MODE_GOOGLE||a.getMode()==App.MODE_ONEDRIVE){var c=!1;if(a.getMode()==App.MODE_GOOGLE&&null!=a.desc.parents)for(var d=0;d<a.desc.parents.length;d++)if(a.desc.parents[d].isRoot){c=!0;break}b.pickFolder(a.getMode(),mxUtils.bind(this,function(c){b.spinner.spin(document.body,mxResources.get("moving"))&&a.move(c,mxUtils.bind(this,function(a){b.spinner.stop()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),
|
|
|
|
|
null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));b.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&a.share()}catch(B){b.handleError(B)}}));
|
|
|
|
|
this.put("embed",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||b.isOffline()||this.addMenuItems(a,["embedIframe"],c);"1"==urlParams.embed||b.isOffline()||this.addMenuItems(a,"- googleDocs googleSlides googleSheets - microsoftOffice".split(" "),c)})));
|
|
|
|
|
var v=function(a,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!b.isOffline())&&a.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e||"mermaid"==e){var a=new ParseDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);b.dialog.container.style.overflow="auto"}else a=new CreateGraphDialog(b,d,e),b.showDialog(a.container,620,420,!0,!1);a.init()}),c,null,f())},x=function(a,c,d,e){var f=new mxCell(a,new mxGeometry(0,0,c,d),e);f.vertex=!0;a=k.getCenterInsertPoint(k.getBoundingBoxFromGeometry([f],
|
|
|
|
|
!0));f.geometry.x=a.x;f.geometry.y=a.y;k.getModel().beginUpdate();try{f=k.addCell(f),k.fireEvent(new mxEventObject("cellsInserted","cells",[f]))}finally{k.getModel().endUpdate()}k.scrollCellToVisible(f);k.setSelectionCell(f);k.container.focus();k.editAfterInsert&&k.startEditing(f);window.setTimeout(function(){null!=b.hoverIcons&&b.hoverIcons.update(k.view.getState(f))},0);return f};b.actions.put("insertText",new Action(mxResources.get("text"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&
|
|
|
|
|
k.startEditingAtCell(x("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;b.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&x("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=f;b.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),
|
|
|
|
|
function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&x("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=f;b.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=f;var y=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(a,c){this.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - createShape insertFreehand - insertImage".split(" "),c);b.insertTemplateEnabled&&!b.isOffline()&&this.addMenuItems(a,["insertTemplate"],c);a.addSeparator(c);this.addSubmenu("insertLayout",a,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,c,mxResources.get("advanced"))})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){y(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));
|
|
|
|
|
b.actions.addAction("forkme",function(){b.openLink("https://github.com/jgraph/drawio")}).label="Fork me on GitHub...";b.actions.addAction("downloadDesktop...",function(){b.openLink("https://get.draw.io/")});n=b.actions.addAction("tags...",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(b,document.body.offsetWidth-380,230,300,120),this.tagsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.addListener("hide",
|
|
|
|
|
function(){b.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}));n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));n=b.actions.addAction("find...",mxUtils.bind(this,function(){null==this.findWindow?(this.findWindow=new FindWindow(b,document.body.offsetWidth-300,110,240,155),
|
|
|
|
|
this.findWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("find"))}),this.findWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));b.actions.put("exportVsdx",
|
|
|
|
|
new Action(mxResources.get("formatVsdx")+" (beta)...",function(){b.exportVisio()}));isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&b.actions.addAction("configuration...",function(){var a=localStorage.getItem(".configuration"),a=new TextareaDialog(b,mxResources.get("configuration")+":",null!=a?JSON.stringify(JSON.parse(a),null,2):"",function(a){if(null!=a)try{if(0<a.length){var c=JSON.parse(a);localStorage.setItem(".configuration",JSON.stringify(c))}else localStorage.removeItem(".configuration");
|
|
|
|
|
b.hideDialog();b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}},null,null,null,null,null,!0,null,null,"https://desk.draw.io/support/solutions/articles/16000058316",EditorUi.isElectronApp?null:[[mxResources.get("reset"),function(a,c){b.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(".configuration"),localStorage.removeItem(".drawio-config"),localStorage.removeItem(".mode"),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}})}],
|
|
|
|
|
[mxResources.get("link"),function(a,c){if(0<c.value.length)try{var d=JSON.parse(c.value),e=window.location.protocol+"//"+window.location.host+"/"+b.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(d)),f=new EmbedDialog(b,e);b.showDialog(f.container,440,240,!0);f.init()}catch(H){b.handleError(H)}else b.handleError({message:mxResources.get("invalidInput")})}]]);a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!1);a.init()});if(mxClient.IS_CHROMEAPP||
|
|
|
|
|
isLocalStorage){this.put("language",new Menu(mxUtils.bind(this,function(a,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=a.addItem(e,null,mxUtils.bind(this,function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);b.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&a.addCheckmark(f,Editor.checkmarkImage));
|
|
|
|
|
return f});d("");a.addSeparator(c);for(var e in mxLanguageMap)d(e)})));var u=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=u.apply(this,arguments);if(null!=b){var c=this.get("language");if(null!=c){c=b.addMenu("",c.funct);c.setAttribute("title",mxResources.get("language"));c.style.width="16px";c.style.paddingTop="2px";c.style.paddingLeft="4px";c.style.zIndex="1";c.style.position="absolute";c.style.display="block";c.style.cursor="pointer";c.style.right="17px";"atlas"==
|
|
|
|
|
uiTheme?(c.style.top="6px",c.style.right="15px"):c.style.top="min"==uiTheme?"2px":"0px";if(mxClient.IS_VML)c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>';else{var d=document.createElement("div");d.style.backgroundImage="url("+Editor.globeImage+")";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="19px 19px";d.style.position="absolute";d.style.height="19px";d.style.width="19px";d.style.marginTop="2px";d.style.zIndex="1";c.appendChild(d);
|
|
|
|
|
mxUtils.setOpacity(c,40);if("atlas"==uiTheme||"dark"==uiTheme)c.style.opacity="0.85",c.style.filter="invert(100%)"}document.body.appendChild(c)}}return b}}b.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];b.actions.addAction("runLayout",function(){var a=new TextareaDialog(b,"Run Layouts:",JSON.stringify(b.customLayoutConfig,null,2),function(a){if(0<a.length)try{var c=JSON.parse(a);
|
|
|
|
|
b.executeLayoutList(c);b.customLayoutConfig=c}catch(D){b.handleError(D),null!=window.console&&console.error(D)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()});var n=this.get("layout"),q=n.funct;n.funct=function(a,c){q.apply(this,arguments);a.addSeparator(c);a.addItem(mxResources.get("orgChart")+"...",null,function(){var a=null,c=20,d=20,e=!0,f=function(){b.loadingOrgChart=!1;b.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&
|
|
|
|
|
null!=a&&e){var f=b.editor.graph,g=new mxOrgChartLayout(f,a,c,d),k=f.getDefaultParent();1<f.model.getChildCount(f.getSelectionCell())&&(k=f.getSelectionCell());g.execute(k);e=!1}},g=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("orgChartType")+": ");g.appendChild(k);var l=document.createElement("select");l.style.width="200px";l.style.boxSizing="border-box";for(var k=[mxResources.get("linear"),
|
|
|
|
|
mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],m=0;m<k.length;m++){var n=document.createElement("option");mxUtils.write(n,k[m]);n.value=m;2==m&&n.setAttribute("selected","selected");l.appendChild(n)}mxEvent.addListener(l,"change",function(){a=l.value});g.appendChild(l);k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";
|
|
|
|
|
k.style.width="140px";mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");g.appendChild(k);var p=document.createElement("input");p.type="number";p.value=c;p.style.width="200px";p.style.boxSizing="border-box";g.appendChild(p);mxEvent.addListener(p,"change",function(){c=p.value});k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");g.appendChild(k);var z=document.createElement("input");
|
|
|
|
|
z.type="number";z.value=d;z.style.width="200px";z.style.boxSizing="border-box";g.appendChild(z);mxEvent.addListener(z,"change",function(){d=z.value});g=new CustomDialog(b,g,function(){null==a&&(a=2);"undefined"!==typeof mxOrgChartLayout||b.loadingOrgChart||b.isOffline(!0)?f():b.spinner.spin(document.body,mxResources.get("loading"))&&(b.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart.min.js",f):mxscript("js/extensions.min.js",f))});b.showDialog(g.container,355,125,!0,!0)},c,null,f());a.addSeparator(c);
|
|
|
|
|
b.menus.addMenuItem(a,"runLayout",c,null,null,mxResources.get("apply")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(a,c){if(!mxClient.IS_CHROMEAPP&&b.isOffline())this.addMenuItems(a,["about"],c);else{var d=a.addItem("Search:",null,null,c,null,null,!1);d.style.backgroundColor="dark"==uiTheme?"#505759":"whiteSmoke";d.style.cursor="default";var e=document.createElement("input");e.setAttribute("type","text");e.setAttribute("size","25");e.style.marginLeft="8px";mxEvent.addListener(e,"keydown",
|
|
|
|
|
mxUtils.bind(this,function(a){var b=mxUtils.trim(e.value);13==a.keyCode&&0<b.length?(this.editorUi.openLink("https://desk.draw.io/support/search/solutions?term="+encodeURIComponent(b)),e.value="",EditorUi.logEvent({category:"SEARCH-HELP",action:"search",label:b}),null!=this.editorUi.menubar&&window.setTimeout(mxUtils.bind(this,function(){this.editorUi.menubar.hideMenu()}),0)):27==a.keyCode&&(e.value="")}));d.firstChild.nextSibling.appendChild(e);mxEvent.addGestureListeners(e,function(a){document.activeElement!=
|
|
|
|
|
e&&e.focus();mxEvent.consume(a)},function(a){mxEvent.consume(a)},function(a){mxEvent.consume(a)});window.setTimeout(function(){e.focus()},0);this.addMenuItems(a,"- keyboardShortcuts quickStart support - forkme downloadDesktop - about".split(" "),c)}"1"==urlParams.test&&(a.addSeparator(c),this.addSubmenu("testDevelop",a,c))})));"1"==urlParams.test&&(mxResources.parse("testDevelop=Develop"),mxResources.parse("showBoundingBox=Show bounding box"),mxResources.parse("createSidebarEntry=Create Sidebar Entry"),
|
|
|
|
|
mxResources.parse("testCheckFile=Check File"),mxResources.parse("testDiff=Diff"),mxResources.parse("testInspect=Inspect"),mxResources.parse("testShowConsole=Show Console"),mxResources.parse("testXmlImageExport=XML Image Export"),mxResources.parse("testDownloadRtModel=Export RT model"),mxResources.parse("testImportRtModel=Import RT model"),b.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!k.isSelectionEmpty()){var a=k.cloneCells(k.getSelectionCells()),c=k.getBoundingBoxFromGeometry(a),
|
|
|
|
|
a=k.moveCells(a,-c.x,-c.y);b.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+c.width+", "+c.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(k.encodeCells(a)))+"'),")}})),b.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){var a=k.getGraphBounds(),b=k.view.translate,c=k.view.scale;k.insertVertex(k.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.height/c,"fillColor=none;strokeColor=red;")})),b.actions.addAction("testCheckFile",mxUtils.bind(this,
|
|
|
|
|
function(){var a=null!=b.pages&&null!=b.getCurrentFile()?b.getCurrentFile().getAnonymizedXmlForPages(b.pages):"",a=new TextareaDialog(b,"Paste Data:",a,function(a){if(0<a.length)try{var c=function(a){function b(a){if(null==n[a]){if(n[a]=!0,null!=e[a]){for(;0<e[a].length;){var d=e[a].pop();b(d)}delete e[a]}}else mxLog.debug(c+": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var l=d[k];if(null!=l.id&&0<l.id.length)if(null==a[l.id]){a[l.id]=l.id;
|
|
|
|
|
var m=l.getAttribute("parent");null==m?null!=f?mxLog.debug(c+": Multiple roots: "+l.id):f=l.id:(null==e[m]&&(e[m]=[]),e[m].push(l.id))}else g[l.id]=l.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null==f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",e)))};"<"!=a.charAt(0)&&
|
|
|
|
|
(a=Graph.decompress(a),mxLog.debug("See console for uncompressed XML"),console.log("xml",a));var d=mxUtils.parseXml(a),e=b.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=b.getHashValueForPages(e);mxLog.debug("Checksum: ",f)}catch(I){mxLog.debug("Error: ",I.message)}else mxLog.debug("No pages found for checksum");var g=d.getElementsByTagName("root");for(a=0;a<g.length;a++)c(g[a]);mxLog.show()}catch(I){b.handleError(I),null!=window.console&&console.error(I)}});a.textarea.style.width=
|
|
|
|
|
"600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()})),b.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=b.pages){var a=new TextareaDialog(b,"Paste Data:","",function(a){if(0<a.length)try{console.log(JSON.stringify(b.diffPages(b.pages,b.getPagesForNode(mxUtils.parseXml(a).documentElement)),null,2))}catch(C){b.handleError(C),null!=window.console&&console.error(C)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,
|
|
|
|
|
620,460,!0,!0);a.init()}else b.alert("No pages")})),b.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(b,k.getModel())})),b.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=k.getGraphBounds(),c=k.view.scale,d=mxUtils.createXmlDocument(),e=d.createElement("output");d.appendChild(e);d=new mxXmlCanvas2D(e);d.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));d.scale(1/c);var f=0,g=d.save;d.save=function(){f++;g.apply(this,arguments)};
|
|
|
|
|
var l=d.restore;d.restore=function(){f--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,f);m.apply(this,arguments);mxLog.debug("leaving shape",a,f)};a.drawState(k.getView().getState(k.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",f)})),b.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==b.drive?b.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):b.drive.execute(mxUtils.bind(this,
|
|
|
|
|
function(){var a=prompt("File ID","");if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+a+"/realtime?supportsAllDrives=true",null,"GET");c.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);a.setRequestHeader("authorization","Bearer "+b.drive.token)};c.send(function(c){b.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?b.saveLocalFile(c.getText(),"json-"+
|
|
|
|
|
a+".txt","text/plain"):b.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),b.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,"createSidebarEntry showBoundingBox - testCheckFile testDiff - testInspect - testXmlImageExport - testDownloadRtModel".split(" "),
|
|
|
|
|
c);a.addItem(mxResources.get("testImportRtModel")+"...",null,function(){var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",mxUtils.bind(this,function(){if(null!=a.files){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{b.openLocalFile(mxUtils.getXml(b.drive.convertJsonToXml(JSON.parse(c.target.result).data)),a.files[0].name,!0)}catch(F){b.handleError(F,mxResources.get("errorLoadingFile"))}});c.readAsText(a.files[0])}}));a.click()},c);
|
|
|
|
|
this.addMenuItems(a,["-","testShowConsole"],c)}))));b.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!b.isOffline()?b.showDialog((new MoreShapesDialog(b,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):b.showDialog((new MoreShapesDialog(b,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});b.actions.put("createShape",new Action(mxResources.get("shape")+"...",function(a){k.isEnabled()&&(a=new mxCell("",new mxGeometry(0,0,120,120),b.defaultCustomShapeStyle),
|
|
|
|
|
a.vertex=!0,a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())})).isEnabled=f;b.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e,
|
|
|
|
|
f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d=new EmbedDialog(b,a+"\n"+c,null,null,function(){var d=window.open(),e=d.document;if(null!=e){"CSS1Compat"===document.compatMode&&e.writeln("<!DOCTYPE html>");e.writeln("<html>");e.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');e.writeln("<body>");e.writeln(a);var f=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;f&&e.writeln(c);e.writeln("</body>");e.writeln("</html>");
|
|
|
|
|
e.close();if(!f){var g=d.document.createElement("div");g.marginLeft="26px";g.marginTop="26px";mxUtils.write(g,mxResources.get("updatingDocument"));f=d.document.createElement("img");f.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");f.style.marginLeft="6px";g.appendChild(f);d.document.body.insertBefore(g,d.document.body.firstChild);window.setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src=/<script.*?src="(.*?)"/.exec(c)[1];
|
|
|
|
|
e.body.appendChild(a);g.parentNode.removeChild(g)},20)}}else b.handleError({message:mxResources.get("errorUpdatingPreview")})});b.showDialog(d.container,440,240,!0,!0);d.init()}))})})}));b.actions.put("liveImage",new Action("Live image...",function(){var a=b.getCurrentFile();null!=a&&b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(c){b.spinner.stop();null!=c?(c=new EmbedDialog(b,'<img src="'+(a.constructor!=DriveFile?c:"https://drive.google.com/uc?id="+
|
|
|
|
|
a.getId())+'"/>'),b.showDialog(c.container,440,240,!0,!0),c.init()):b.handleError({message:mxResources.get("invalidPublicUrl")})})}));b.actions.put("embedImage",new Action(mxResources.get("image")+"...",function(){b.showEmbedImageDialog(function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.createEmbedImage(a,c,d,e,f,g,function(a){b.spinner.stop();a=new EmbedDialog(b,a);b.showDialog(a.container,440,240,!0,!0);a.init()},function(a){b.spinner.stop();b.handleError(a)})},mxResources.get("image"),
|
|
|
|
|
mxResources.get("retina"),b.isExportToCanvas())}));b.actions.put("embedSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showEmbedImageDialog(function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.createEmbedSvg(a,c,d,e,f,g,function(a){b.spinner.stop();a=new EmbedDialog(b,a);b.showDialog(a.container,440,240,!0,!0);a.init()},function(a){b.spinner.stop();b.handleError(a)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://desk.draw.io/support/solutions/articles/16000042548")}));
|
|
|
|
|
b.actions.put("embedIframe",new Action(mxResources.get("iframe")+"...",function(){var a=k.getGraphBounds();b.showPublishLinkDialog(mxResources.get("iframe"),null,"100%",Math.ceil((a.y+a.height-k.view.translate.y)/k.view.scale)+2,function(a,c,d,e,f,g,k,l){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(m){b.spinner.stop();m=new EmbedDialog(b,'<iframe frameborder="0" style="width:'+k+";height:"+l+';" src="'+b.createLink(a,c,d,e,f,g,m)+'"></iframe>');
|
|
|
|
|
b.showDialog(m.container,440,240,!0,!0);m.init()})},!0)}));b.actions.put("publishLink",new Action(mxResources.get("link")+"...",function(){b.showPublishLinkDialog(null,null,null,null,function(a,c,d,e,f,g){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(k){b.spinner.stop();k=new EmbedDialog(b,b.createLink(a,c,d,e,f,g,k));b.showDialog(k.container,440,240,!0,!0);k.init()})})}));b.actions.addAction("microsoftOffice...",function(){b.openLink("https://office.draw.io")});
|
|
|
|
|
b.actions.addAction("googleDocs...",function(){b.openLink("http://docsaddon.draw.io")});b.actions.addAction("googleSlides...",function(){b.openLink("https://slidesaddon.draw.io")});b.actions.addAction("googleSheets...",function(){b.openLink("https://sheetsaddon.draw.io")});b.actions.addAction("googleSites...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();a=new GoogleSitesDialog(b,a);b.showDialog(a.container,420,
|
|
|
|
|
256,!0,!0);a.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)n=b.actions.addAction("scratchpad",function(){b.toggleScratchpad()}),n.setToggleAction(!0),n.setSelectedCallback(function(){return null!=b.scratchpad}),b.actions.addAction("plugins...",function(){b.showDialog((new PluginsDialog(b)).container,360,170,!0,!1)});n=b.actions.addAction("search",function(){var a=b.sidebar.isEntryVisible("search");b.sidebar.showPalette("search",!a);isLocalStorage&&(mxSettings.settings.search=!a,mxSettings.save())});
|
|
|
|
|
n.setToggleAction(!0);n.setSelectedCallback(function(){return b.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(b.actions.get("save").funct=function(a){k.isEditing()&&k.stopEditing();var c="0"!=urlParams.pages||null!=b.pages&&1<b.pages.length?b.getFileData(!0):mxUtils.getXml(b.editor.getGraphXml());if("json"==urlParams.proto){var d=b.createLoadMessage("save");d.xml=c;a&&(d.exit=!0);c=JSON.stringify(d)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&
|
|
|
|
|
(b.editor.modified=!1,b.editor.setStatus(""));a=b.getCurrentFile();null==a||a.constructor==LocalFile&&null==a.mode||b.saveFile()},b.actions.addAction("saveAndExit",function(){b.actions.get("save").funct(!0)}),b.actions.addAction("exit",function(){var a=function(){b.editor.modified=!1;var a="json"==urlParams.proto?JSON.stringify({event:"exit",modified:b.editor.modified}):"";(window.opener||window.parent).postMessage(a,"*")};b.editor.modified?b.confirm(mxResources.get("allChangesLost"),null,a,mxResources.get("cancel"),
|
|
|
|
|
mxResources.get("discardChanges")):a()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){b.isExportToCanvas()?(this.addMenuItems(a,["exportPng"],c),b.jpgSupported&&this.addMenuItems(a,["exportJpg"],c)):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(a,["exportPng","exportJpg"],c);this.addMenuItems(a,["exportSvg","-"],c);b.isOffline()||b.printPdfExport?this.addMenuItems(a,["exportPdf"],c):b.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(a,
|
|
|
|
|
["exportPdf"],c);mxClient.IS_IE||"undefined"===typeof VsdxExport&&b.isOffline()||this.addMenuItems(a,["exportVsdx"],c);this.addMenuItems(a,["-","exportHtml","exportXml","exportUrl"],c);b.isOffline()||(a.addSeparator(c),this.addMenuItem(a,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(a,c){function e(a){a.pickFile(function(c){b.spinner.spin(document.body,mxResources.get("loading"))&&a.getFile(c,function(a){var c=
|
|
|
|
|
"data:image/"==a.getData().substring(0,11)?n(a.getTitle()):"text/xml";/\.svg$/i.test(a.getTitle())&&!b.editor.isDataSvg(a.getData())&&(a.setData(Editor.createSvgDataUri(a.getData())),c="image/svg+xml");f(a.getData(),c,a.getTitle())},function(a){b.handleError(a,null!=a?mxResources.get("errorLoadingFile"):null)},a==b.drive)},!0)}var f=mxUtils.bind(this,function(a,c,d){var e=k.view,f=k.getGraphBounds(),g=k.snap(Math.ceil(Math.max(0,f.x/e.scale-e.translate.x)+4*k.gridSize)),l=k.snap(Math.ceil(Math.max(0,
|
|
|
|
|
(f.y+f.height)/e.scale-e.translate.y)+4*k.gridSize));"data:image/"==a.substring(0,11)?b.loadImage(a,mxUtils.bind(this,function(e){var f=!0,m=mxUtils.bind(this,function(){b.resizeImage(e,a,mxUtils.bind(this,function(e,m,n){e=f?Math.min(1,Math.min(b.maxImageSize/m,b.maxImageSize/n)):1;b.importFile(a,c,g,l,Math.round(m*e),Math.round(n*e),d,function(a){b.spinner.stop();k.setSelectionCells(a);k.scrollCellToVisible(k.getSelectionCell())})}),f)});a.length>b.resampleThreshold?b.confirmImageResize(function(a){f=
|
|
|
|
|
a;m()}):m()}),mxUtils.bind(this,function(){b.handleError({message:mxResources.get("cannotOpenFile")})})):b.importFile(a,c,g,l,0,0,d,function(a){b.spinner.stop();k.setSelectionCells(a);k.scrollCellToVisible(k.getSelectionCell())})}),n=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)?b="image/gif":/\.pdf$/i.test(a)&&(b="application/pdf");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=
|
|
|
|
|
b.drive?a.addItem(mxResources.get("googleDrive")+"...",null,function(){e(b.drive)},c):l&&"function"===typeof window.DriveClient&&a.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=b.oneDrive?a.addItem(mxResources.get("oneDrive")+"...",null,function(){e(b.oneDrive)},c):g&&"function"===typeof window.OneDriveClient&&a.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=b.dropbox?
|
|
|
|
|
a.addItem(mxResources.get("dropbox")+"...",null,function(){e(b.dropbox)},c):d&&"function"===typeof window.DropboxClient&&a.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);null!=b.gitHub&&a.addItem(mxResources.get("github")+"...",null,function(){e(b.gitHub)},c);null!=b.gitLab&&a.addItem(mxResources.get("gitlab")+"...",null,function(){e(b.gitLab)},c);null!=b.trello?a.addItem(mxResources.get("trello")+"...",null,function(){e(b.trello)},
|
|
|
|
|
c):m&&"function"===typeof window.TrelloClient&&a.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&a.addItem(mxResources.get("browser")+"...",null,function(){b.importLocalFile(!1)},c);a.addItem(mxResources.get("device")+"...",null,function(){b.importLocalFile(!0)},c);b.isOffline()||(a.addSeparator(c),a.addItem(mxResources.get("url")+"...",null,function(){var a=new FilenameDialog(b,"",mxResources.get("import"),
|
|
|
|
|
function(a){if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(a)?"image/png":"text/xml";b.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(a),function(b){f(b,c,a)},function(){b.spinner.stop();b.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));b.showDialog(a.container,300,80,!0,!0);a.init()},c))}))).isEnabled=f;this.put("theme",new Menu(mxUtils.bind(this,function(a,c){var d=mxSettings.getUi(),
|
|
|
|
|
e=a.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&a.addCheckmark(e,Editor.checkmarkImage);a.addSeparator(c);e=a.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&a.addCheckmark(e,Editor.checkmarkImage);e=a.addItem(mxResources.get("minimal"),
|
|
|
|
|
null,function(){mxSettings.setUi("min");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&a.addCheckmark(e,Editor.checkmarkImage);e=a.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&a.addCheckmark(e,Editor.checkmarkImage);e=a.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();b.alert(mxResources.get("restartForChangeRequired"))},
|
|
|
|
|
c);"dark"==d&&a.addCheckmark(e,Editor.checkmarkImage)})));n=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();if(null!=a){var c=null!=a.getTitle()?a.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&null!=a&&b!=a.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&a.rename(b,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),
|
|
|
|
|
mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),a.constructor==DriveFile||a.constructor==StorageFile?mxResources.get("diagramName"):null,function(a){if(null!=a&&0<a.length)return!0;b.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,null,b.editor.fileExtensions);this.editorUi.showDialog(c.container,340,90,!0,!0);c.init()}}));n.isEnabled=function(){return this.enabled&&
|
|
|
|
|
f.apply(this,arguments)};n.visible="1"!=urlParams.embed;b.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var a=b.getCurrentFile();if(null!=a){var c=b.getCopyFilename(a);a.constructor==DriveFile?(c=new CreateDialog(b,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?b.spinner.spin(document.body,mxResources.get("saving"))&&a.saveAs(c,mxUtils.bind(this,function(c){a.desc=c;a.save(!1,mxUtils.bind(this,function(){b.spinner.stop();
|
|
|
|
|
a.setModified(!1);a.addAllSavedStatus()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),mxUtils.bind(this,function(a){b.handleError(a)})):b.createFile(c,b.getFileData(!0),null,d))}),mxUtils.bind(this,function(){b.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,b.editor.fileExtensions),b.showDialog(c.container,420,380,!0,!0),c.init()):b.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));b.actions.addAction("moveToFolder...",mxUtils.bind(this,
|
|
|
|
|
function(){var a=b.getCurrentFile();if(a.getMode()==App.MODE_GOOGLE||a.getMode()==App.MODE_ONEDRIVE){var c=!1;if(a.getMode()==App.MODE_GOOGLE&&null!=a.desc.parents)for(var d=0;d<a.desc.parents.length;d++)if(a.desc.parents[d].isRoot){c=!0;break}b.pickFolder(a.getMode(),mxUtils.bind(this,function(c){b.spinner.spin(document.body,mxResources.get("moving"))&&a.move(c,mxUtils.bind(this,function(a){b.spinner.stop()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,
|
|
|
|
|
function(a,b){this.addMenuItems(a,["publishLink"],b)})));b.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&a.share()}catch(B){b.handleError(B)}}));this.put("embed",new Menu(mxUtils.bind(this,
|
|
|
|
|
function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||b.isOffline()||this.addMenuItems(a,["embedIframe"],c);"1"==urlParams.embed||b.isOffline()||this.addMenuItems(a,"- googleDocs googleSlides googleSheets - microsoftOffice".split(" "),c)})));var v=function(a,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&
|
|
|
|
|
!b.isOffline())&&a.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e||"mermaid"==e){var a=new ParseDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);b.dialog.container.style.overflow="auto"}else a=new CreateGraphDialog(b,d,e),b.showDialog(a.container,620,420,!0,!1);a.init()}),c,null,f())},x=function(a,c,d,e){var f=new mxCell(a,new mxGeometry(0,0,c,d),e);f.vertex=!0;a=k.getCenterInsertPoint(k.getBoundingBoxFromGeometry([f],!0));f.geometry.x=a.x;f.geometry.y=
|
|
|
|
|
a.y;k.getModel().beginUpdate();try{f=k.addCell(f),k.fireEvent(new mxEventObject("cellsInserted","cells",[f]))}finally{k.getModel().endUpdate()}k.scrollCellToVisible(f);k.setSelectionCell(f);k.container.focus();k.editAfterInsert&&k.startEditing(f);window.setTimeout(function(){null!=b.hoverIcons&&b.hoverIcons.update(k.view.getState(f))},0);return f};b.actions.put("insertText",new Action(mxResources.get("text"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&k.startEditingAtCell(x("Text",
|
|
|
|
|
40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+"+Shift+X").isEnabled=f;b.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&x("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=f;b.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&
|
|
|
|
|
x("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=f;b.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(){k.isEnabled()&&!k.isCellLocked(k.getDefaultParent())&&x("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=f;var y=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(a,c){this.addMenuItems(a,
|
|
|
|
|
"insertRectangle insertEllipse insertRhombus - insertText insertLink - createShape insertFreehand - insertImage".split(" "),c);b.insertTemplateEnabled&&!b.isOffline()&&this.addMenuItems(a,["insertTemplate"],c);a.addSeparator(c);this.addSubmenu("insertLayout",a,c,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,c,mxResources.get("advanced"))})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){y(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));
|
|
|
|
|
this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){y(a,c,["fromText","plantUml","mermaid","-","formatSql"]);a.addItem(mxResources.get("csv")+"...",null,function(){b.showImportCsvDialog()},c,null,f())})));this.put("openRecent",new Menu(function(a,c){var d=b.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");a.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){b.loadFile(d.id)},
|
|
|
|
|
c)})(d[e]);a.addSeparator(c)}a.addItem(mxResources.get("reset"),null,function(){b.resetRecent()},c)}));this.put("openFrom",new Menu(function(a,c){null!=b.drive?a.addItem(mxResources.get("googleDrive")+"...",null,function(){b.pickFile(App.MODE_GOOGLE)},c):l&&"function"===typeof window.DriveClient&&a.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=b.oneDrive?a.addItem(mxResources.get("oneDrive")+"...",null,function(){b.pickFile(App.MODE_ONEDRIVE)},
|
|
|
|
|
c):g&&"function"===typeof window.OneDriveClient&&a.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=b.dropbox?a.addItem(mxResources.get("dropbox")+"...",null,function(){b.pickFile(App.MODE_DROPBOX)},c):d&&"function"===typeof window.DropboxClient&&a.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);null!=b.gitHub&&a.addItem(mxResources.get("github")+"...",null,function(){b.pickFile(App.MODE_GITHUB)},
|
|
|
|
@ -10833,43 +10834,43 @@ e=new EmbedDialog(this,this.getLinkForPage(a,b,e));this.showDialog(e.container,4
|
|
|
|
|
(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){a=b.previous;b.previous=b.name;b.name=a;return b};mxCodecRegistry.register(a)})();
|
|
|
|
|
(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),e="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,b,k){k.setAttribute("relatedPage",b.relatedPage.getId());null==b.index&&(k.setAttribute("name",b.relatedPage.getName()),null!=b.relatedPage.viewState&&k.setAttribute("viewState",JSON.stringify(b.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(e,
|
|
|
|
|
a)?b:void 0})),null!=b.relatedPage.root&&a.encodeCell(b.relatedPage.root,k));return k};a.beforeDecode=function(a,b,e){e.ui=a.ui;e.relatedPage=e.ui.getPageById(b.getAttribute("relatedPage"));if(null==e.relatedPage){var c=b.ownerDocument.createElement("diagram");c.setAttribute("id",b.getAttribute("relatedPage"));c.setAttribute("name",b.getAttribute("name"));e.relatedPage=new DiagramPage(c);c=b.getAttribute("viewState");null!=c&&(e.relatedPage.viewState=JSON.parse(c),b.removeAttribute("viewState"));
|
|
|
|
|
b=b.cloneNode(!0);c=b.firstChild;if(null!=c)for(e.relatedPage.root=a.decodeCell(c,!1),e=c.nextSibling,c.parentNode.removeChild(c),c=e;null!=c;){e=c.nextSibling;if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var k=c.getAttribute("id");null==a.lookup(k)&&a.decodeCell(c)}c.parentNode.removeChild(c);c=e}}return b};a.afterDecode=function(a,b,e){e.index=e.previousIndex;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.prototype.altShiftActions[68]="selectDescendants";var a=Graph.prototype.foldCells;Graph.prototype.foldCells=function(b,c,e,l,d){c=null!=c?c:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),b));this.stopEditing();this.model.beginUpdate();try{for(var f=e.slice(),k=[],n=0;n<e.length;n++){var p=this.getCurrentCellStyle(e[n]);"1"==mxUtils.getValue(p,"treeFolding","0")&&(this.traverse(e[n],!0,mxUtils.bind(this,function(a,b){null!=b&&k.push(b);a!=e[n]&&k.push(a);return a==
|
|
|
|
|
e[n]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[n],b))}for(n=0;n<k.length;n++)this.model.setVisible(k[n],!b);e=f;e=a.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function a(a){return v.isVertex(a)&&e(a)}function c(a){var b=!1;null!=a&&(b="1"==q.getCurrentCellStyle(a).treeMoving);
|
|
|
|
|
return b}function e(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),b="tree"==(null!=b?b.style:q.getCellStyle(a)).containerType);return b}function l(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function d(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==
|
|
|
|
|
a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function g(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),e=q.getIncomingEdges(a),f=q.cloneCells([e[0],a]);q.model.setTerminal(f[0],q.model.getTerminal(e[0],!0),!0);var g=d(a),k=c.geometry;g==mxConstants.DIRECTION_SOUTH||
|
|
|
|
|
g==mxConstants.DIRECTION_NORTH?f[1].geometry.x+=b?a.geometry.width+10:-f[1].geometry.width-10:f[1].geometry.y+=b?a.geometry.height+10:-f[1].geometry.height-10;q.view.currentRoot!=c&&(f[1].geometry.x-=k.x,f[1].geometry.y-=k.y);var l=q.view.getState(a),m=q.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-f[1].geometry.width-10)*m:n.y+=(b?a.geometry.height+10:-f[1].geometry.height-10)*m;var p=q.getOutgoingEdges(q.model.getTerminal(e[0],
|
|
|
|
|
!0));if(null!=p){for(var v=g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH,u=k=e=0;u<p.length;u++){var t=q.model.getTerminal(p[u],!1);if(g==d(t)){var z=q.view.getState(t);t!=a&&null!=z&&(v&&b!=z.getCenterX()<l.getCenterX()||!v&&b!=z.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,z)&&(e=10+Math.max(e,(Math.min(n.x+n.width,z.x+z.width)-Math.max(n.x,z.x))/m),k=10+Math.max(k,(Math.min(n.y+n.height,z.y+z.height)-Math.max(n.y,z.y))/m))}}v?k=0:e=0;for(u=0;u<p.length;u++)if(t=q.model.getTerminal(p[u],
|
|
|
|
|
!1),g==d(t)&&(z=q.view.getState(t),t!=a&&null!=z&&(v&&b!=z.getCenterX()<l.getCenterX()||!v&&b!=z.getCenterY()<l.getCenterY()))){var x=[];q.traverse(z.cell,!0,function(a,b){null!=b&&x.push(b);x.push(a);return!0});q.moveCells(x,(b?1:-1)*e,(b?1:-1)*k)}}}return q.addCells(f,c)}finally{q.model.endUpdate()}}function m(a){q.model.beginUpdate();try{var b=d(a),c=q.getIncomingEdges(a),e=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],e[1],!1);q.model.setTerminal(e[0],e[1],!0);q.model.setTerminal(e[0],a,!1);
|
|
|
|
|
var f=q.model.getParent(a),g=f.geometry,k=[];q.view.currentRoot!=f&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);q.traverse(a,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});var l=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,m=-m):b==mxConstants.DIRECTION_WEST?(l=-l,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);q.moveCells(k,l,m);return q.addCells(e,f)}finally{q.model.endUpdate()}}function n(a,b){q.model.beginUpdate();try{var c=
|
|
|
|
|
q.model.getParent(a),e=q.getIncomingEdges(a),f=d(a);0==e.length&&(e=[q.createEdge(c,null,"",null,null,q.createCurrentEdgeStyle())],f=b);var g=q.cloneCells([e[0],a]);q.model.setTerminal(g[0],a,!0);if(null==q.model.getTerminal(g[0],!1)){q.model.setTerminal(g[0],g[1],!1);var k=q.getCellStyle(g[1]).newEdgeStyle;if(null!=k)try{var l=JSON.parse(k),m;for(m in l)q.setCellStyles(m,l[m],[g[0]]),"edgeStyle"==m&&"elbowEdgeStyle"==l[m]&&q.setCellStyles("elbow",f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NOTH?
|
|
|
|
|
"vertical":"horizontal",[g[0]])}catch(P){}}var e=q.getOutgoingEdges(a),n=c.geometry,k=[];q.view.currentRoot==c&&(n=new mxRectangle);for(l=0;l<e.length;l++){var p=q.model.getTerminal(e[l],!1);null!=p&&k.push(p)}var v=q.view.getBounds(k),u=q.view.translate,t=q.view.scale;f==mxConstants.DIRECTION_SOUTH?(g[1].geometry.x=null==v?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(v.x+v.width)/t-u.x-n.x+10,g[1].geometry.y+=g[1].geometry.height-n.y+40):f==mxConstants.DIRECTION_NORTH?(g[1].geometry.x=
|
|
|
|
|
null==v?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(v.x+v.width)/t-u.x+-n.x+10,g[1].geometry.y-=g[1].geometry.height+n.y+40):(g[1].geometry.x=f==mxConstants.DIRECTION_WEST?g[1].geometry.x-(g[1].geometry.width+n.x+40):g[1].geometry.x+(g[1].geometry.width-n.x+40),g[1].geometry.y=null==v?a.geometry.y+(a.geometry.height-g[1].geometry.height)/2:(v.y+v.height)/t-u.y+-n.y+10);return q.addCells(g,c)}finally{q.model.endUpdate()}}function p(a,b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=
|
|
|
|
|
[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function t(a,b){var c=d(a),e=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==e&&c!=b?u.actions.get("selectParent").funct():
|
|
|
|
|
c==b?(e=q.getOutgoingEdges(a),null!=e&&0<e.length&&q.setSelectionCell(q.model.getTerminal(e[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(e=p(q.model.getTerminal(c[0],!0),e,a),c=q.view.getState(a),null!=c&&(c=mxUtils.indexOf(e,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=e.length-1&&q.setSelectionCell(e[c].cell)))))}var u=this,q=u.editor.graph,v=q.getModel(),x=u.menus.createPopupMenu;u.menus.createPopupMenu=function(b,c,d){x.apply(this,arguments);
|
|
|
|
|
if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);b.addSeparator();0<e.length&&(a(q.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));a(q.getSelectionCell())&&(b.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(b,["selectSiblings","selectParent"],null,d))}};u.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getOutgoingEdges(a);
|
|
|
|
|
if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",
|
|
|
|
|
function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+D");var y=q.removeCells;q.removeCells=function(b,c){c=null!=
|
|
|
|
|
c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];q.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=q.getIncomingEdges(b[f]),b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return y.apply(this,arguments)};u.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
|
|
|
|
|
d))};var A=q.duplicateCells;q.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=A.call(this,b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(b[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,
|
|
|
|
|
q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var z=q.moveCells;q.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(a(b[p])||q.model.isEdge(b[p])&&null==q.model.getTerminal(b[p],!0)){f=q.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var v=q.getIncomingEdges(b[0]);
|
|
|
|
|
if(0<v.length){var u=q.view.getState(q.model.getTerminal(v[0],!0));if(null!=u){var t=q.view.getState(m);null!=t&&(c=(t.getCenterX()-u.getCenterX())/q.view.scale,d=(t.getCenterY()-u.getCenterY())/q.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(p=0;p<l.length;p++)if(this.model.isEdge(l[p]))a(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(v=q.getIncomingEdges(b[p]),0<v.length))if(!e)a(m)&&0>mxUtils.indexOf(b,
|
|
|
|
|
this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==q.getIncomingEdges(l[p]).length){n=m;if(null==n||n==q.model.getParent(b[p]))n=q.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,q.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=u.sidebar){var B=u.sidebar.dropAndConnect;u.sidebar.dropAndConnect=function(b,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=B.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
|
|
|
|
|
null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:u.actions.get("selectChildren"),84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},D=u.onKeyDown;u.onKeyDown=function(b){try{if(q.isEnabled()&&!q.isEditing()&&a(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&
|
|
|
|
|
(9==b.which?c=mxEvent.isShiftDown(b)?m(q.getSelectionCell()):n(q.getSelectionCell()):13==b.which&&(c=g(q.getSelectionCell(),!mxEvent.isShiftDown(b))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(q.view.getState(q.getSelectionCell())),q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var d=C[b.keyCode];
|
|
|
|
|
null!=d&&(d.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(t(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(b))}}catch(J){u.handleError(J)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var E=q.connectVertex;q.connectVertex=
|
|
|
|
|
function(b,c,e,f,k,l,p){var v=q.getIncomingEdges(b);if(a(b)){var u=d(b),t=u==mxConstants.DIRECTION_EAST||u==mxConstants.DIRECTION_WEST,z=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return u==c||0==v.length?n(b,c):t==z?m(b):g(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return E.apply(this,arguments)};q.getSubtree=function(b){var d=[b];!c(b)&&!a(b)||l(b)||q.traverse(b,!0,function(a,b){null!=b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);
|
|
|
|
|
return!0});return d};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);(c(this.state.cell)||a(this.state.cell))&&!l(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",
|
|
|
|
|
this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;u.hoverIcons.reset();mxEvent.consume(a)})))};var H=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=
|
|
|
|
|
function(){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(a){I.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=a?"":"none")};var K=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=
|
|
|
|
|
function(a,b){K.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),e=this.graph;return a.concat([this.addEntry("tree container",function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=
|
|
|
|
|
!0;var b=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');b.vertex=!0;var c=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');c.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");
|
|
|
|
|
e.geometry.relative=!0;e.edge=!0;b.insertEdge(e,!0);c.insertEdge(e,!1);a.insert(e);a.insert(b);a.insert(c);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');c.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");e.geometry.relative=!0;e.edge=!0;
|
|
|
|
|
b.insertEdge(e,!0);c.insertEdge(e,!1);var k=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');k.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
|
|
|
|
n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);k.insertEdge(n,!1);var p=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');p.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
|
|
|
|
|
t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);p.insertEdge(t,!1);var u=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');u.vertex=!0;var q=new mxCell("",new mxGeometry(0,
|
|
|
|
|
0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");q.geometry.relative=!0;q.edge=!0;b.insertEdge(q,!0);u.insertEdge(q,!1);a.insert(e);a.insert(n);a.insert(t);a.insert(q);a.insert(b);a.insert(c);a.insert(k);a.insert(p);a.insert(u);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};treeFolding=1;treeMoving=1;');
|
|
|
|
|
a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
b=b.cloneNode(!0);c=b.firstChild;if(null!=c)for(e.relatedPage.root=a.decodeCell(c,!1),e=c.nextSibling,c.parentNode.removeChild(c),c=e;null!=c;){e=c.nextSibling;if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var k=c.getAttribute("id");null==a.lookup(k)&&a.decodeCell(c)}c.parentNode.removeChild(c);c=e}}return b};a.afterDecode=function(a,b,e){e.index=e.previousIndex;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.prototype.altShiftActions[68]="selectDescendants";var a=Graph.prototype.foldCells;Graph.prototype.foldCells=function(b,c,e,l,d){c=null!=c?c:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),b));this.stopEditing();this.model.beginUpdate();try{for(var f=e.slice(),k=0;k<e.length;k++)"1"==mxUtils.getValue(this.getCurrentCellStyle(e[k]),"treeFolding","0")&&this.foldTreeCell(b,e[k]);e=f;e=a.apply(this,arguments)}finally{this.model.endUpdate()}return e};Graph.prototype.foldTreeCell=
|
|
|
|
|
function(a,c){this.model.beginUpdate();try{var b=[];this.traverse(c,!0,mxUtils.bind(this,function(a,e){null!=e&&b.push(e);a!=c&&b.push(a);return a==c||!this.model.isCollapsed(a)}));this.model.setCollapsed(c,a);for(var e=0;e<b.length;e++)this.model.setVisible(b[e],!a)}finally{this.model.endUpdate()}};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function a(a){return v.isVertex(a)&&
|
|
|
|
|
e(a)}function c(a){var b=!1;null!=a&&(b="1"==q.getCurrentCellStyle(a).treeMoving);return b}function e(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),b="tree"==(null!=b?b.style:q.getCellStyle(a)).containerType);return b}function l(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function d(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.view.getState(b[0]),
|
|
|
|
|
null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function g(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),e=q.getIncomingEdges(a),f=q.cloneCells([e[0],a]);q.model.setTerminal(f[0],
|
|
|
|
|
q.model.getTerminal(e[0],!0),!0);var g=d(a),k=c.geometry;g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?f[1].geometry.x+=b?a.geometry.width+10:-f[1].geometry.width-10:f[1].geometry.y+=b?a.geometry.height+10:-f[1].geometry.height-10;q.view.currentRoot!=c&&(f[1].geometry.x-=k.x,f[1].geometry.y-=k.y);var l=q.view.getState(a),m=q.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-f[1].geometry.width-
|
|
|
|
|
10)*m:n.y+=(b?a.geometry.height+10:-f[1].geometry.height-10)*m;var p=q.getOutgoingEdges(q.model.getTerminal(e[0],!0));if(null!=p){for(var v=g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH,t=k=e=0;t<p.length;t++){var u=q.model.getTerminal(p[t],!1);if(g==d(u)){var z=q.view.getState(u);u!=a&&null!=z&&(v&&b!=z.getCenterX()<l.getCenterX()||!v&&b!=z.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,z)&&(e=10+Math.max(e,(Math.min(n.x+n.width,z.x+z.width)-Math.max(n.x,z.x))/m),k=10+Math.max(k,
|
|
|
|
|
(Math.min(n.y+n.height,z.y+z.height)-Math.max(n.y,z.y))/m))}}v?k=0:e=0;for(t=0;t<p.length;t++)if(u=q.model.getTerminal(p[t],!1),g==d(u)&&(z=q.view.getState(u),u!=a&&null!=z&&(v&&b!=z.getCenterX()<l.getCenterX()||!v&&b!=z.getCenterY()<l.getCenterY()))){var x=[];q.traverse(z.cell,!0,function(a,b){null!=b&&x.push(b);x.push(a);return!0});q.moveCells(x,(b?1:-1)*e,(b?1:-1)*k)}}}return q.addCells(f,c)}finally{q.model.endUpdate()}}function m(a){q.model.beginUpdate();try{var b=d(a),c=q.getIncomingEdges(a),
|
|
|
|
|
e=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],e[1],!1);q.model.setTerminal(e[0],e[1],!0);q.model.setTerminal(e[0],a,!1);var f=q.model.getParent(a),g=f.geometry,k=[];q.view.currentRoot!=f&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);q.traverse(a,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});var l=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,m=-m):b==mxConstants.DIRECTION_WEST?(l=-l,m=0):b==mxConstants.DIRECTION_EAST&&
|
|
|
|
|
(m=0);q.moveCells(k,l,m);return q.addCells(e,f)}finally{q.model.endUpdate()}}function n(a,b){q.model.beginUpdate();try{var c=q.model.getParent(a),e=q.getIncomingEdges(a),f=d(a);0==e.length&&(e=[q.createEdge(c,null,"",null,null,q.createCurrentEdgeStyle())],f=b);var g=q.cloneCells([e[0],a]);q.model.setTerminal(g[0],a,!0);if(null==q.model.getTerminal(g[0],!1)){q.model.setTerminal(g[0],g[1],!1);var k=q.getCellStyle(g[1]).newEdgeStyle;if(null!=k)try{var l=JSON.parse(k),m;for(m in l)q.setCellStyles(m,l[m],
|
|
|
|
|
[g[0]]),"edgeStyle"==m&&"elbowEdgeStyle"==l[m]&&q.setCellStyles("elbow",f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",[g[0]])}catch(P){}}var e=q.getOutgoingEdges(a),n=c.geometry,k=[];q.view.currentRoot==c&&(n=new mxRectangle);for(l=0;l<e.length;l++){var p=q.model.getTerminal(e[l],!1);null!=p&&k.push(p)}var v=q.view.getBounds(k),t=q.view.translate,u=q.view.scale;f==mxConstants.DIRECTION_SOUTH?(g[1].geometry.x=null==v?a.geometry.x+(a.geometry.width-g[1].geometry.width)/
|
|
|
|
|
2:(v.x+v.width)/u-t.x-n.x+10,g[1].geometry.y+=g[1].geometry.height-n.y+40):f==mxConstants.DIRECTION_NORTH?(g[1].geometry.x=null==v?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(v.x+v.width)/u-t.x+-n.x+10,g[1].geometry.y-=g[1].geometry.height+n.y+40):(g[1].geometry.x=f==mxConstants.DIRECTION_WEST?g[1].geometry.x-(g[1].geometry.width+n.x+40):g[1].geometry.x+(g[1].geometry.width-n.x+40),g[1].geometry.y=null==v?a.geometry.y+(a.geometry.height-g[1].geometry.height)/2:(v.y+v.height)/u-t.y+-n.y+
|
|
|
|
|
10);return q.addCells(g,c)}finally{q.model.endUpdate()}}function p(a,b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function t(a,b){var c=d(a),e=b==mxConstants.DIRECTION_EAST||
|
|
|
|
|
b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==e&&c!=b?u.actions.get("selectParent").funct():c==b?(e=q.getOutgoingEdges(a),null!=e&&0<e.length&&q.setSelectionCell(q.model.getTerminal(e[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(e=p(q.model.getTerminal(c[0],!0),e,a),c=q.view.getState(a),null!=c&&(c=mxUtils.indexOf(e,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=e.length-1&&q.setSelectionCell(e[c].cell)))))}
|
|
|
|
|
var u=this,q=u.editor.graph,v=q.getModel(),x=u.menus.createPopupMenu;u.menus.createPopupMenu=function(b,c,d){x.apply(this,arguments);if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);b.addSeparator();0<e.length&&(a(q.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));a(q.getSelectionCell())&&(b.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(b,["selectSiblings","selectParent"],null,d))}};
|
|
|
|
|
u.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");u.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=
|
|
|
|
|
[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");u.actions.addAction("selectParent",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");u.actions.addAction("selectDescendants",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,
|
|
|
|
|
c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+D");var y=q.removeCells;q.removeCells=function(b,c){c=null!=c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];q.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=q.getIncomingEdges(b[f]),
|
|
|
|
|
b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return y.apply(this,arguments)};u.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var A=q.duplicateCells;q.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=A.call(this,
|
|
|
|
|
b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(b[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var z=q.moveCells;q.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=0;p<b.length;p++)if(a(b[p])||
|
|
|
|
|
q.model.isEdge(b[p])&&null==q.model.getTerminal(b[p],!0)){f=q.model.getParent(b[p]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var v=q.getIncomingEdges(b[0]);if(0<v.length){var t=q.view.getState(q.model.getTerminal(v[0],!0));if(null!=t){var u=q.view.getState(m);null!=u&&(c=(u.getCenterX()-t.getCenterX())/q.view.scale,d=(u.getCenterY()-t.getCenterY())/q.view.scale)}}}}l=z.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(p=0;p<l.length;p++)if(this.model.isEdge(l[p]))a(m)&&
|
|
|
|
|
0>mxUtils.indexOf(l,this.model.getTerminal(l[p],!0))&&this.model.setTerminal(l[p],m,!0);else if(a(b[p])&&(v=q.getIncomingEdges(b[p]),0<v.length))if(!e)a(m)&&0>mxUtils.indexOf(b,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==q.getIncomingEdges(l[p]).length){n=m;if(null==n||n==q.model.getParent(b[p]))n=q.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,q.getDefaultParent(),n,l[p])}}finally{this.model.endUpdate()}return l};if(null!=u.sidebar){var B=u.sidebar.dropAndConnect;
|
|
|
|
|
u.sidebar.dropAndConnect=function(b,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=B.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:u.actions.get("selectChildren"),84:u.actions.get("selectSubtree"),80:u.actions.get("selectParent"),83:u.actions.get("selectSiblings")},D=
|
|
|
|
|
u.onKeyDown;u.onKeyDown=function(b){try{if(q.isEnabled()&&!q.isEditing()&&a(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&(9==b.which?c=mxEvent.isShiftDown(b)?m(q.getSelectionCell()):n(q.getSelectionCell()):13==b.which&&(c=g(q.getSelectionCell(),!mxEvent.isShiftDown(b))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=u.hoverIcons&&u.hoverIcons.update(q.view.getState(q.getSelectionCell())),
|
|
|
|
|
q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var d=C[b.keyCode];null!=d&&(d.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(t(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(t(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
|
|
|
|
|
mxEvent.consume(b))}}catch(J){u.handleError(J)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var E=q.connectVertex;q.connectVertex=function(b,c,e,f,k,l,p){var v=q.getIncomingEdges(b);if(a(b)){var t=d(b),u=t==mxConstants.DIRECTION_EAST||t==mxConstants.DIRECTION_WEST,z=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST;return t==c||0==v.length?n(b,c):u==z?m(b):g(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)}return E.apply(this,arguments)};q.getSubtree=function(b){var d=
|
|
|
|
|
[b];!c(b)&&!a(b)||l(b)||q.traverse(b,!0,function(a,b){null!=b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};var F=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){F.apply(this,arguments);(c(this.state.cell)||a(this.state.cell))&&!l(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position=
|
|
|
|
|
"absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;u.hoverIcons.reset();
|
|
|
|
|
mxEvent.consume(a)})))};var H=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(a){I.apply(this,arguments);null!=this.moveHandle&&
|
|
|
|
|
(this.moveHandle.style.display=a?"":"none")};var K=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){K.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),e=this.graph;return a.concat([this.addEntry("tree container",function(){var a=new mxCell("Tree Container",
|
|
|
|
|
new mxGeometry(0,0,400,320),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');b.vertex=!0;var c=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
|
|
|
|
|
c.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");e.geometry.relative=!0;e.edge=!0;b.insertEdge(e,!0);c.insertEdge(e,!1);a.insert(e);a.insert(b);a.insert(c);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");
|
|
|
|
|
a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
c.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");e.geometry.relative=!0;e.edge=!0;b.insertEdge(e,!0);c.insertEdge(e,!1);var k=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
k.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);k.insertEdge(n,!1);var p=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
p.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);p.insertEdge(t,!1);var u=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
u.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");q.geometry.relative=!0;q.edge=!0;b.insertEdge(q,!0);u.insertEdge(q,!1);a.insert(e);a.insert(n);a.insert(t);a.insert(q);a.insert(b);a.insert(c);a.insert(k);a.insert(p);a.insert(u);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var a=new mxCell("Central Idea",
|
|
|
|
|
new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};treeFolding=1;treeMoving=1;');a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');
|
|
|
|
|
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],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;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
|
|
|
|
|
a.vertex=!0;var b=new mxCell("Organization",new mxGeometry(80,40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');e.setAttributeForCell(b,"treeRoot","1");b.vertex=!0;var c=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
|
|
|
|
@ -10915,7 +10916,7 @@ b.menus.addMenuItems(a,["-","revisionHistory"],c)})));var d=this.get("exportAs")
|
|
|
|
|
b.menus.addSubmenu("theme",a,c);null!=f&&b.menus.addSubmenu("language",a,c);b.menus.addSubmenu("units",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","ruler"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);!b.isOfflineApp()&&isLocalStorage&&b.menus.addMenuItem(a,"plugins",c);a.addSeparator(c);b.menus.addMenuItem(a,"drawConfig",c);a.addSeparator(c)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,
|
|
|
|
|
function(a,c){b.menus.addMenuItems(a,"importText plantUml mermaid - formatSql importCsv - createShape editDiagram".split(" "),c)})));mxUtils.bind(this,function(){var a=this.get("insert"),c=a.funct;a.funct=function(a,d){c.apply(this,arguments);b.menus.addSubmenu("table",a,d);a.addSeparator(d);b.menus.addMenuItems(a,["-","toggleShapes"],d)}})();var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),k=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,
|
|
|
|
|
function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):k(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides ruler - connectionArrows connectionPoints -".split(" "),c);if("undefined"!==typeof MathJax){var d=b.menus.addMenuItem(a,"mathematicalTypesetting",
|
|
|
|
|
c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],c)})))};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function b(a,b,c){var d=l.menus.get(a),e=u.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),p);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight="6px";e.style.height=
|
|
|
|
|
c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],c)})))};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function b(a,b,c){var d=l.menus.get(a),e=t.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),p);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight="6px";e.style.height=
|
|
|
|
|
"30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));l.menus.menuCreated(d,e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.width="34px",e.innerHTML=""):b||(e.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",e.style.backgroundPosition="right 6px center",e.style.backgroundRepeat=
|
|
|
|
|
"no-repeat",e.style.paddingRight="22px");return e}function d(a,b,c,d,e,f){var g=document.createElement("a");g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";null!=l.statusContainer?n.insertBefore(g,l.statusContainer):n.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat=
|
|
|
|
|
"no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),g.style.cursor="pointer"):(g.setAttribute("disabled",
|
|
|
|
@ -10928,13 +10929,13 @@ a.funct,null,mxResources.get("redo")+" ("+a.shortcut+")",a,"data:image/svg+xml;b
|
|
|
|
|
f([d("",function(){m.popupMenuHandler.hideMenu();var a=m.view.scale,b=m.view.translate.x,c=m.view.translate.y;l.actions.get("resetView").funct();1E-5>Math.abs(a-m.view.scale)&&b==m.view.translate.x&&c==m.view.translate.y&&l.actions.get(m.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="),
|
|
|
|
|
640<=c?d("",a.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",a,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="):
|
|
|
|
|
null,640<=c?d("",e.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",e,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="):
|
|
|
|
|
null],60)}a=l.menus.get("language");null!=a&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=c?(null==O&&(e=u.addMenu("",a.funct),e.setAttribute("title",mxResources.get("language")),e.className="geToolbarButton",e.style.backgroundImage="url("+Editor.globeImage+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.position="absolute",e.style.height="24px",e.style.width="24px",e.style.zIndex="1",e.style.right="8px",e.style.cursor=
|
|
|
|
|
null],60)}a=l.menus.get("language");null!=a&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=c?(null==O&&(e=t.addMenu("",a.funct),e.setAttribute("title",mxResources.get("language")),e.className="geToolbarButton",e.style.backgroundImage="url("+Editor.globeImage+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.position="absolute",e.style.height="24px",e.style.width="24px",e.style.zIndex="1",e.style.right="8px",e.style.cursor=
|
|
|
|
|
"pointer",e.style.top="1"==urlParams.embed?"12px":"11px",n.appendChild(e),O=e),l.buttonContainer.style.paddingRight="34px"):(l.buttonContainer.style.paddingRight="4px",null!=O&&(O.parentNode.removeChild(O),O=null))}q.apply(this,arguments);var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";k.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(k);(1E3<=c||null!=urlParams.clibs||
|
|
|
|
|
null!=urlParams.libs)&&e(this,!0);1E3<=c&&a(this,!0);var l=this,m=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var n=document.createElement("div");n.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var p=null,u=new Menubar(l,n);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position=
|
|
|
|
|
"relative";l.statusContainer.style.maxWidth="";l.statusContainer.style.marginTop="7px";l.statusContainer.style.marginLeft="6px";l.statusContainer.style.color="gray";l.statusContainer.style.cursor="default";l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));var t=l.descriptorChanged;l.descriptorChanged=function(){t.apply(this,arguments);var a=l.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==
|
|
|
|
|
null!=urlParams.libs)&&e(this,!0);1E3<=c&&a(this,!0);var l=this,m=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var n=document.createElement("div");n.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var p=null,t=new Menubar(l,n);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position=
|
|
|
|
|
"relative";l.statusContainer.style.maxWidth="";l.statusContainer.style.marginTop="7px";l.statusContainer.style.marginLeft="6px";l.statusContainer.style.color="gray";l.statusContainer.style.cursor="default";l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));var u=l.descriptorChanged;l.descriptorChanged=function(){u.apply(this,arguments);var a=l.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==
|
|
|
|
|
b?b="gitHub":"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);n.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else n.removeAttribute("title")};l.setStatusText(l.editor.getStatus());n.appendChild(l.statusContainer);l.buttonContainer=document.createElement("div");l.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";n.appendChild(l.buttonContainer);l.menubarContainer=
|
|
|
|
|
l.buttonContainer;l.tabContainer=document.createElement("div");l.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;visibility:hidden;";var k=l.diagramContainer.parentNode,I=document.createElement("div");I.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";l.diagramContainer.style.top="47px";var K=
|
|
|
|
|
l.menus.get("viewZoom");if(null!=K){this.tabContainer.style.right="70px";var G=u.addMenu("100%",K.funct);G.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");G.style.whiteSpace="nowrap";G.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";G.style.backgroundPosition="right 6px center";G.style.backgroundRepeat="no-repeat";G.style.backgroundColor="#ffffff";G.style.paddingRight="10px";G.style.display="block";G.style.position="absolute";G.style.textDecoration="none";G.style.textDecoration=
|
|
|
|
|
l.menus.get("viewZoom");if(null!=K){this.tabContainer.style.right="70px";var G=t.addMenu("100%",K.funct);G.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");G.style.whiteSpace="nowrap";G.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";G.style.backgroundPosition="right 6px center";G.style.backgroundRepeat="no-repeat";G.style.backgroundColor="#ffffff";G.style.paddingRight="10px";G.style.display="block";G.style.position="absolute";G.style.textDecoration="none";G.style.textDecoration=
|
|
|
|
|
"none";G.style.right="0px";G.style.bottom="0px";G.style.overflow="hidden";G.style.visibility="hidden";G.style.textAlign="center";G.style.color="#000";G.style.fontSize="12px";G.style.color="#707070";G.style.width="59px";G.style.cursor="pointer";G.style.borderTop="1px solid lightgray";G.style.borderLeft="1px solid lightgray";G.style.height=parseInt(l.tabContainerHeight)-1+"px";G.style.lineHeight=parseInt(l.tabContainerHeight)+1+"px";I.appendChild(G);K=mxUtils.bind(this,function(){G.innerHTML=Math.round(100*
|
|
|
|
|
l.editor.graph.view.scale)+"%"});l.editor.graph.view.addListener(mxEvent.EVENT_SCALE,K);l.editor.addListener("resetGraphView",K);l.editor.addListener("pageSelected",K);var L=l.setGraphEnabled;l.setGraphEnabled=function(){L.apply(this,arguments);null!=this.tabContainer&&(G.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}I.appendChild(l.tabContainer);I.appendChild(n);I.appendChild(l.diagramContainer);
|
|
|
|
|
k.appendChild(I);l.updateTabContainer();var O=null;g();mxEvent.addListener(window,"resize",function(){g();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit()})}}};
|
|
|
|
|