完成drawio升级

This commit is contained in:
kuaifan 2023-02-13 10:01:48 +08:00
parent 472ece692d
commit 8b4244d237
3 changed files with 54 additions and 70 deletions

View File

@ -1,24 +1,3 @@
# Change
## js/diagramly/ElectronApp.js
- 隐藏文件中的无用菜单
## js/app.min.js
- 隐藏帮助菜单
- 取消未保存关闭窗口提示
- `EmbedFile.prototype.getTitle=...``EmbedFile.prototype.getTitle=function(){return this.desc.title||(urlParams.title?decodeURIComponent(urlParams.title):"")}`
- `c.insertTemplateEnabled&&!c.isOffline()&&this.addMenuItems(b,["insertTemplate"],d)``c.insertTemplateEnabled&&this.addMenuItems(b,["insertTemplate"],d)`
- `390:270``390:285`
- `!this.editorUi.isOffline()&&d.length<=c/4?(f=b-Math.ceil((e-c/4)/c),mxUtils.get(ICONSEARCH_PATH``d.length<=c/4?(f=b-Math.ceil((e-c/4)/c),mxUtils.get(ICONSEARCH_PATH`
## index.html
- 隐藏加载中的提示
- 加入
```js
window.EXPORT_URL = window.location.origin + "/drawio/export/";
window.DRAWIO_LIGHTBOX_URL = window.location.origin + "/drawio/webapp";
setInterval(function() {window.ICONSEARCH_PATH = window.location.origin + "/drawio/iconsearch";}, 1000)
```
diff https://github.com/jgraph/drawio/tree/1a858166fb4f1330cf23e58941e3fbec1dcd16f8

View File

@ -17,6 +17,10 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#d89000">
<script type="text/javascript">
window.EXPORT_URL = window.location.origin + "/drawio/export/";
window.DRAWIO_LIGHTBOX_URL = window.location.origin + "/drawio/webapp";
setInterval(function() {window.ICONSEARCH_PATH = window.location.origin + "/drawio/iconsearch";}, 1000)
/**
* URL Parameters and protocol description are here:
*
@ -374,6 +378,7 @@
color:#606060;
}
.geBlock {
display: none;
z-index:-3;
margin:100px;
margin-top:40px;

View File

@ -2235,7 +2235,7 @@ null!=G.deltaY&&40>Math.abs(G.deltaY)&&Math.round(G.deltaY)!=G.deltaY?ha=1+Math.
EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(b){this.actions.get("print").funct();mxEvent.consume(b)}),Editor.printImage,mxResources.get("print"))};EditorUi.prototype.isPagesEnabled=function(){return this.editor.editable||"1"!=urlParams["hide-pages"]};EditorUi.prototype.createTemporaryGraph=function(a){return Graph.createOffscreenGraph(a)};EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};
EditorUi.prototype.toggleFormatPanel=function(a){a=null!=a?a:0==this.formatWidth;null!=this.format&&(this.formatWidth=a?240:0,this.formatContainer.style.width=this.formatWidth+"px",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};EditorUi.prototype.isFormatPanelVisible=function(){return 0<this.formatWidth};
EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,f=60;null!=b&&(f=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(f,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
EditorUi.prototype.isSelectionAllowed=function(a){return"SELECT"==mxEvent.getSource(a).nodeName||"INPUT"==mxEvent.getSource(a).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(a))};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};
EditorUi.prototype.isSelectionAllowed=function(a){return"SELECT"==mxEvent.getSource(a).nodeName||"INPUT"==mxEvent.getSource(a).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(a))};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};
EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var f=mxUtils.parseXml(a);this.editor.setGraphXml(f.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=b&&(this.editor.setFilename(b),this.updateDocumentTitle())}catch(e){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+e.message)}}))}catch(a){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPopupMenu=function(a,b,f,e){this.editor.graph.popupMenuHandler.hideMenu();var g=new mxPopupMenu(a);g.div.className+=" geMenubarMenu";g.smartSeparators=!0;g.showDisabled=!0;g.autoExpand=!0;g.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(g,arguments);g.destroy()});g.popup(b,f,null,e);this.setCurrentMenu(g)};
EditorUi.prototype.setCurrentMenu=function(a,b){this.currentMenuElt=b;this.currentMenu=a;this.hideShapePicker()};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null};EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};EditorUi.prototype.updateDocumentTitle=function(){var a=this.editor.getOrCreateFilename();null!=this.editor.appName&&(a+=" - "+this.editor.appName);document.title=a};
@ -3583,7 +3583,7 @@ n=this.addAction("format",mxUtils.bind(this,function(){e.toggleFormatPanel()}),n
this.outlineWindow.window.addListener("hide",function(){e.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),e.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var m=
d.getSelectionCell();if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&null!=m){var r=new ConnectionPointsDialog(e,m);e.showDialog(r.container,350,450,!0,!1,function(){r.destroy()});r.init()}},null,null,"Alt+Shift+Q").isEnabled=h};Actions.prototype.addAction=function(a,b,f,e,g){if("..."==a.substring(a.length-3)){a=a.substring(0,a.length-3);var d=mxResources.get(a)+"..."}else d=mxResources.get(a);return this.put(a,new Action(d,b,f,e,g))};
Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,f,e,g){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=f?f:!0;this.iconCls=e;this.shortcut=g;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};
Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};Menus=function(a){this.editorUi=a;this.menus={};this.init();mxClient.IS_SVG||((new Image).src=this.checkmarkImage)};Menus.prototype.defaultFont="Helvetica";Menus.prototype.defaultFontSize="12";Menus.prototype.defaultMenuItems="file edit view arrange extras help".split(" ");Menus.prototype.defaultFonts="Helvetica;Verdana;Times New Roman;Garamond;Comic Sans MS;Courier New;Georgia;Lucida Console;Tahoma".split(";");Menus.prototype.autoPopup=!0;
Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};Menus=function(a){this.editorUi=a;this.menus={};this.init();mxClient.IS_SVG||((new Image).src=this.checkmarkImage)};Menus.prototype.defaultFont="Helvetica";Menus.prototype.defaultFontSize="12";Menus.prototype.defaultMenuItems="file edit view arrange extras".split(" ");Menus.prototype.defaultFonts="Helvetica;Verdana;Times New Roman;Garamond;Comic Sans MS;Courier New;Georgia;Lucida Console;Tahoma".split(";");Menus.prototype.autoPopup=!0;
Menus.prototype.init=function(){var a=this.editorUi,b=a.editor.graph,f=mxUtils.bind(b,b.isEnabled);this.customFonts=[];this.customFontSizes=[];this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,g){for(var d=mxUtils.bind(this,function(n){this.styleChange(e,n,[mxConstants.STYLE_FONTFAMILY],[n],null,g,function(){document.execCommand("fontname",!1,n);a.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY],"values",[n],"cells",[b.cellEditor.getEditingCell()]))},function(){b.updateLabelElements(b.getSelectionCells(),
function(u){u.removeAttribute("face");u.style.fontFamily=null;"PRE"==u.nodeName&&b.replaceElement(u,"div")})}).firstChild.nextSibling.style.fontFamily=n}),h=0;h<this.defaultFonts.length;h++)d(this.defaultFonts[h]);e.addSeparator(g);if(0<this.customFonts.length){for(h=0;h<this.customFonts.length;h++)d(this.customFonts[h]);e.addSeparator(g);e.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[];this.editorUi.fireEvent(new mxEventObject("customFontsChanged"))}),g);e.addSeparator(g)}this.promptChange(e,
mxResources.get("custom")+"...","",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,g,!0,mxUtils.bind(this,function(n){0>mxUtils.indexOf(this.customFonts,n)&&(this.customFonts.push(n),this.editorUi.fireEvent(new mxEventObject("customFontsChanged")))}))})));this.put("formatBlock",new Menu(mxUtils.bind(this,function(e,g){function d(h,n){return e.addItem(h,null,mxUtils.bind(this,function(){null!=b.cellEditor.textarea&&(b.cellEditor.textarea.focus(),document.execCommand("formatBlock",!1,"<"+
@ -3847,7 +3847,7 @@ this.addCumulusPalette();this.addCitrixPalette();this.addGCP2Palette();this.addG
this.addFluidPowerPalette();this.addGMDLPalette();this.addPidPalette(p,l);this.addThreatModelingPalette();this.addWebIconsPalette();this.addWebLogosPalette();this.addSignsPalette(m,l);this.showEntries();null!=this.createdSearchIndex&&console.log("searchFileData",Graph.compress(JSON.stringify(this.createdSearchIndex)))};if("1"==urlParams.createindex){var e=Sidebar.prototype.addStencilPalette;Sidebar.prototype.addStencilPalette=function(k,l,m,n,p,r,t,v,u,w){e.apply(this,arguments);t=null!=t?t:1;mxStencilRegistry.loadStencilSet(m,
mxUtils.bind(this,function(q,x,y,z,A){if(null!=this.createdSearchIndex&&null==p||0>mxUtils.indexOf(p,x))q={style:"shape="+q+x+n,w:Math.round(z*t),h:Math.round(A*t)},x=null!=v?v[x]:null,null!=x&&(q.tags=x),null!=w&&(q.id=w,q.lib=k),this.createdSearchIndex.push(q)}),!0)}}Sidebar.prototype.extractIconsFromResponse=function(k,l){for(var m=0;m<k.icons.length;m++){for(var n=k.icons[m].raster_sizes,p=n.length-1;0<p&&128<n[p].size;)p--;var r=n[p].size;n=n[p].formats[0].preview_url;null!=r&&null!=n&&mxUtils.bind(this,
function(t,v){l.push(mxUtils.bind(this,function(){return this.createVertexTemplate("shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image="+v,t,t,"")}))})(r,n)}};var f=Sidebar.prototype.searchEntries;Sidebar.prototype.searchEntries=function(k,l,m,n,p){var r=n;null!=this.searchIndexData&&(this.addSearchIndex(JSON.parse(Graph.decompress(this.searchIndexData))),this.searchIndexData=null);null!=ICONSEARCH_PATH&&(n=mxUtils.bind(this,
function(t,v,u,w){!this.editorUi.isOffline()&&t.length<=l/4?(u=m-Math.ceil((v-l/4)/l),mxUtils.get(ICONSEARCH_PATH+"?q="+encodeURIComponent(k)+"&p="+u+"&c="+l,mxUtils.bind(this,function(q){try{if(200<=q.getStatus()&&299>=q.getStatus()&&null!=q.getText()&&0<q.getText().length)try{var x=JSON.parse(q.getText());null==x||null==x.icons?(r(t,v,!1,w),this.editorUi.handleError(x)):(this.extractIconsFromResponse(x,t),r(t,(m-1)*l+t.length,x.icons.length==l,w))}catch(y){r(t,v,!1,w),this.editorUi.handleError(y)}else r(t,
function(t,v,u,w){t.length<=l/4?(u=m-Math.ceil((v-l/4)/l),mxUtils.get(ICONSEARCH_PATH+"?q="+encodeURIComponent(k)+"&p="+u+"&c="+l,mxUtils.bind(this,function(q){try{if(200<=q.getStatus()&&299>=q.getStatus()&&null!=q.getText()&&0<q.getText().length)try{var x=JSON.parse(q.getText());null==x||null==x.icons?(r(t,v,!1,w),this.editorUi.handleError(x)):(this.extractIconsFromResponse(x,t),r(t,(m-1)*l+t.length,x.icons.length==l,w))}catch(y){r(t,v,!1,w),this.editorUi.handleError(y)}else r(t,
v,!1,w)}catch(y){r(t,v,!1,w),this.editorUi.handleError(y)}},function(){r(t,v,!1,w)}))):r(t,v,u||!this.editorUi.isOffline(),w)}));f.apply(this,arguments)};var g=Sidebar.prototype.getTooltipOffset;Sidebar.prototype.getTooltipOffset=function(k,l){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){if(mxUtils.isAncestorNode(this.editorUi.sketchPickerMenuElt,k)){var m=mxUtils.getOffset(k);"simple"==Editor.currentTheme?(m.x+=(k.offsetWidth-l.width)/2-14,m.y=k.parentNode.offsetHeight-
2):(m.x=k.parentNode.offsetLeft+k.parentNode.offsetWidth+2,m.y+=(k.offsetHeight-l.height)/2);return new mxPoint(Math.max(0,m.x),Math.max(0,m.y))}if(null!=this.editorUi.sidebarWindow)return m=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div),m.x+=this.editorUi.sidebarWindow.window.div.offsetWidth+2,m.y+=k.offsetTop+(k.offsetHeight-l.height)/2,null!=k.offsetParent&&(m.y-=k.offsetParent.scrollTop),new mxPoint(Math.max(0,m.x),Math.max(0,m.y))}return g.apply(this,arguments)};var h=Sidebar.prototype.itemClicked;
Sidebar.prototype.itemClicked=function(k,l,m){var n=this.editorUi.editor.graph,p=!1;if(null!=k&&1==n.getSelectionCount()&&n.getModel().isVertex(k[0])){var r=n.cloneCell(k[0]);if(n.getModel().isEdge(n.getSelectionCell())&&null==n.getModel().getTerminal(n.getSelectionCell(),!1)&&n.getModel().isVertex(r)){n.getModel().beginUpdate();try{var t=n.view.getState(n.getSelectionCell());if(null!=t){var v=n.view.translate,u=n.view.scale,w=t.absolutePoints[t.absolutePoints.length-1];r.geometry.x=w.x/u-v.x-r.geometry.width/
@ -10903,7 +10903,7 @@ StorageFile.listLocalStorageFiles=function(b){for(var f=[],g=0;g<localStorage.le
StorageFile.migrate=function(b){var f=StorageFile.listLocalStorageFiles();f.push({title:".scratchpad",type:"L"});var g=b.transaction(["files","filesInfo"],"readwrite");b=g.objectStore("files");g=g.objectStore("filesInfo");for(var c=0;c<f.length;c++){var m=f[c],n=localStorage.getItem(m.title);b.add({title:m.title,data:n});g.add(m)}};
StorageFile.listFiles=function(b,f,g,c){b.getDatabaseItems(function(m){var n=[];if(null!=m)for(var v=0;v<m.length;v++)"."==m[v].title.charAt(0)||null!=f&&m[v].type!=f||n.push(m[v]);g(n)},function(){null==b.database?g(StorageFile.listLocalStorageFiles(f)):null!=c&&c()},"filesInfo")};StorageFile.deleteFile=function(b,f,g,c){b.removeDatabaseItem([f,f],g,function(){null==b.database?(localStorage.removeItem(f),g()):null!=c&&c()},["files","filesInfo"])};StorageLibrary=function(b,f,g){StorageFile.call(this,b,f,g)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.type="L";StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(b,f,g){this.saveFile(b,!1,f,g)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
StorageLibrary.prototype.isRenamable=function(b,f,g){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,f,g){DrawioFile.call(this,b,f);this.title=g;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(b,f,g){RemoteFile.call(this,b,f,g.title);this.libObj=g};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(b,f,g){};
RemoteLibrary.prototype.saveAs=function(b,f,g){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,f,g){StorageFile.call(this,b,f,g);b=g;f=b.lastIndexOf("/");0<=f&&(b=b.substring(f+1));this.fname=b};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(b,f,g){return!1};UrlLibrary.prototype.saveAs=function(b,f,g){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,f,g){DrawioFile.call(this,b,f);this.desc=g||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getTitle=function(){return this.desc.title||""};/*
RemoteLibrary.prototype.saveAs=function(b,f,g){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,f,g){StorageFile.call(this,b,f,g);b=g;f=b.lastIndexOf("/");0<=f&&(b=b.substring(f+1));this.fname=b};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(b,f,g){return!1};UrlLibrary.prototype.saveAs=function(b,f,g){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,f,g){DrawioFile.call(this,b,f);this.desc=g||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getTitle=function(){return this.desc.title||(urlParams.title?decodeURIComponent(urlParams.title):"")};/*
mxClient.IS_IOS || */
var StorageDialog=function(b,f,g){function c(M,I,d,k,p,t){function u(){mxEvent.addListener(y,"click",null!=t?t:function(){d==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(d,!0);f()})):d==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(d,!0);f()}),function(x){b.spinner.stop();b.handleError(x)}):
(b.setMode(d,!0),f())})}z++;++v>g&&(mxUtils.br(F),v=1);var y=document.createElement("a");y.style.overflow="hidden";y.style.display="inline-block";y.className="geBaseButton";y.style.boxSizing="border-box";y.style.fontSize="11px";y.style.position="relative";y.style.margin="4px";y.style.marginTop="8px";y.style.marginBottom="0px";y.style.padding="8px 10px 8px 10px";y.style.width="88px";y.style.height="100px";y.style.whiteSpace="nowrap";y.setAttribute("title",I);var D=document.createElement("div");D.style.textOverflow=
@ -12964,8 +12964,8 @@ function(l){m.isEnabled()&&!m.isCellLocked(m.getDefaultParent())&&y("",140,160,"
function(l){m.isEnabled()&&!m.isCellLocked(m.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;",null==l||mxEvent.isControlDown(l)||mxEvent.isMetaDown(l)||!m.isMouseInsertPoint()?null:m.getInsertPoint())},null,null,"F")).isEnabled=n;c.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(l){m.isEnabled()&&!m.isCellLocked(m.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;",null==l||mxEvent.isControlDown(l)||mxEvent.isMetaDown(l)||!m.isMouseInsertPoint()?
null:m.getInsertPoint())},null,null,"R")).isEnabled=n;c.actions.put("insertEdge",new Action(mxResources.get("line"),function(l){if(m.isEnabled()&&!m.isCellLocked(m.getDefaultParent())){var x=m.defaultEdgeLength;l=null==l||mxEvent.isControlDown(l)||mxEvent.isMetaDown(l)||!m.isMouseInsertPoint()?null:m.getInsertPoint();null==l&&(l=m.getCenterInsertPoint(m.getBoundingBoxFromGeometry([C],!0)));var C=new mxCell("",new mxGeometry(0,0,x,0),"edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;");C.geometry.setTerminalPoint(l,
!0);C.geometry.setTerminalPoint(new mxPoint(l.x+C.geometry.width,l.y),!1);C.geometry.points=[];C.geometry.relative=!0;C.edge=!0;u(C)}},null,null,"C")).isEnabled=n;E=c.actions.put("toggleShapes",new Action(mxResources.get("shapes"),function(){null!=c.sidebarWindow?c.sidebarWindow.window.setVisible(!c.sidebarWindow.window.isVisible()):c.toggleShapesPanel(!c.isShapesPanelVisible())},null,null,Editor.ctrlKey+"+Shift+K"));E.setToggleAction(!0);E.setSelectedCallback(mxUtils.bind(this,function(){return null!=
c.sidebarWindow&&c.sidebarWindow.window.isVisible()||null==c.sidebarWindow&&0<c.hsplitPosition}));c.addInsertMenuItems=mxUtils.bind(this,function(l,x,C){for(var G=0;G<C.length;G++)"-"==C[G]?l.addSeparator(x):c.addInsertItem(l,x,mxResources.get(C[G])+"...",C[G])});this.put("insert",new Menu(mxUtils.bind(this,function(l,x){"sketch"==Editor.currentTheme?(c.menus.addMenuItems(l,["toggleShapes"],x),c.menus.addSubmenu("table",l,x),l.addSeparator(x),c.insertTemplateEnabled&&!c.isOffline()&&c.menus.addMenuItems(l,
["insertTemplate"],x),c.menus.addMenuItems(l,["insertImage","insertLink","-"],x),c.menus.addSubmenu("insertAdvanced",l,x,mxResources.get("advanced")),c.menus.addSubmenu("layout",l,x)):(this.addMenuItems(l,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - createShape insertFreehand - insertImage".split(" "),x),c.insertTemplateEnabled&&!c.isOffline()&&this.addMenuItems(l,["insertTemplate"],x),l.addSeparator(x),"min"==uiTheme||"simple"==Editor.currentTheme?
c.sidebarWindow&&c.sidebarWindow.window.isVisible()||null==c.sidebarWindow&&0<c.hsplitPosition}));c.addInsertMenuItems=mxUtils.bind(this,function(l,x,C){for(var G=0;G<C.length;G++)"-"==C[G]?l.addSeparator(x):c.addInsertItem(l,x,mxResources.get(C[G])+"...",C[G])});this.put("insert",new Menu(mxUtils.bind(this,function(l,x){"sketch"==Editor.currentTheme?(c.menus.addMenuItems(l,["toggleShapes"],x),c.menus.addSubmenu("table",l,x),l.addSeparator(x),c.insertTemplateEnabled&&c.menus.addMenuItems(l,
["insertTemplate"],x),c.menus.addMenuItems(l,["insertImage","insertLink","-"],x),c.menus.addSubmenu("insertAdvanced",l,x,mxResources.get("advanced")),c.menus.addSubmenu("layout",l,x)):(this.addMenuItems(l,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - createShape insertFreehand - insertImage".split(" "),x),c.insertTemplateEnabled&&this.addMenuItems(l,["insertTemplate"],x),l.addSeparator(x),"min"==uiTheme||"simple"==Editor.currentTheme?
(this.addSubmenu("table",l,x),this.addSubmenu("layout",l,x)):this.addSubmenu("insertLayout",l,x,mxResources.get("layout")),this.addSubmenu("insertAdvanced",l,x,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(l,x){c.menus.addInsertTableCellItem(l,x)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(l,x){c.addInsertMenuItems(l,x,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("insertAdvanced",
new Menu(mxUtils.bind(this,function(l,x){c.addInsertMenuItems(l,x,["fromText","plantUml","mermaid","-","formatSql"]);l.addItem(mxResources.get("csv")+"...",null,function(){m.popupMenuHandler.hideMenu();c.showImportCsvDialog()},x,null,n());"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(l,["-","createShape","editDiagram"],x)})));this.put("openRecent",new Menu(function(l,x){var C=c.getRecent();if(null!=C){for(var G=0;G<C.length;G++)(function(K){var O=K.mode;O==App.MODE_GOOGLE?
O="googleDrive":O==App.MODE_ONEDRIVE&&(O="oneDrive");l.addItem(K.title+" ("+mxResources.get(O)+")",null,function(){c.loadFile(K.id)},x)})(C[G]);l.addSeparator(x)}l.addItem(mxResources.get("reset"),null,function(){c.resetRecent()},x)}));this.put("openFrom",new Menu(function(l,x){null!=c.drive?l.addItem(mxResources.get("googleDrive")+"...",null,function(){c.pickFile(App.MODE_GOOGLE)},x):v&&"function"===typeof window.DriveClient&&l.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+