10.0.35 release
This commit is contained in:
parent
2efe1bb346
commit
0a0fba3a05
14 changed files with 1177 additions and 1137 deletions
|
@ -1,3 +1,8 @@
|
|||
13-JAN-2019: 10.0.35
|
||||
|
||||
- Fixes device option in splash
|
||||
- Adds Insert Template
|
||||
|
||||
12-JAN-2019: 10.0.34
|
||||
|
||||
- Fixes save dialog icon CSS flow
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
10.0.34
|
||||
10.0.35
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 01/12/2019 08:41 PM
|
||||
# 01/13/2019 10:31 AM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
632
src/main/webapp/js/app.min.js
vendored
632
src/main/webapp/js/app.min.js
vendored
|
@ -3059,46 +3059,46 @@ a);b.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);b.toggleCellStyles(mxConsta
|
|||
null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){b.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){b.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){b.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){b.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("group",function(){1==b.getSelectionCount()?b.setCellStyles("container","1"):b.setSelectionCell(b.groupCells(null,
|
||||
0))},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){1==b.getSelectionCount()&&0==b.getModel().getChildCount(b.getSelectionCell())?b.setCellStyles("container","0"):b.setSelectionCells(b.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){b.removeCellsFromParent()});this.addAction("edit",function(){b.isEnabled()&&b.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=b.getSelectionCell()||b.getModel().getRoot();
|
||||
c.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=c.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),d="";if(mxUtils.isNode(b.value)){var e=b.value.getAttribute("tooltip");null!=e&&(d=e)}d=new TextareaDialog(c,mxResources.get("editTooltip")+":",d,function(c){a.setTooltipForCell(b,c)});c.showDialog(d.container,320,200,!0,!0);d.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=b.getLinkForCell(b.getSelectionCell());
|
||||
null!=a&&b.openLink(a)});this.addAction("editLink...",function(){var a=c.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),d=a.getLinkForCell(b)||"";c.showLinkDialog(d,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(b,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.addAction("insertLink...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&c.showLinkDialog("",mxResources.get("insert"),function(a,c){a=mxUtils.trim(a);if(0<a.length){var d=
|
||||
null,e=b.getLinkTitle(a);null!=c&&0<c.length&&(d=c[0].iconUrl,e=c[0].name||c[0].type,e=e.charAt(0).toUpperCase()+e.substring(1),30<e.length&&(e=e.substring(0,30)+"..."));var g=b.getFreeInsertPoint(),d=new mxCell(e,new mxGeometry(g.x,g.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=d?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+d:"spacing=10;"));d.vertex=!0;b.setLinkForCell(d,a);b.cellSizeUpdated(d,!0);b.getModel().beginUpdate();try{d=b.addCell(d),
|
||||
b.fireEvent(new mxEventObject("cellsInserted","cells",[d]))}finally{b.getModel().endUpdate()}b.setSelectionCell(d);b.scrollCellToVisible(b.getSelectionCell())}})}).isEnabled=f;this.addAction("link...",mxUtils.bind(this,function(){var a=c.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var b=a.getSelectedElement(),d=a.getParentByName(b,"A",a.cellEditor.textarea),e="";if(null==d&&null!=b&&null!=b.getElementsByTagName)for(var f=b.getElementsByTagName("a"),h=0;h<f.length&&null==d;h++)f[h].textContent==
|
||||
b.textContent&&(a.selectNode(f[h]),d=f[h]);null!=d&&"A"==d.nodeName&&(e=d.getAttribute("href")||"");var u=a.cellEditor.saveSelection();c.showLinkDialog(e,mxResources.get("apply"),mxUtils.bind(this,function(b){a.cellEditor.restoreSelection(u);null!=b&&a.insertLink(b)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=f;this.addAction("autosize",function(){var a=b.getSelectionCells();if(null!=a){b.getModel().beginUpdate();try{for(var c=0;c<a.length;c++){var d=
|
||||
a[c];if(b.getModel().getChildCount(d))b.updateGroupBounds([d],20);else{var e=b.view.getState(d),f=b.getCellGeometry(d);b.getModel().isVertex(d)&&null!=e&&null!=e.text&&null!=f&&b.isWrapping(d)?(f=f.clone(),f.height=e.text.boundingBox.height/b.view.scale,b.getModel().setGeometry(d,f)):b.updateCellSize(d)}}}finally{b.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=b.getView().getState(b.getSelectionCell());if(null!=a){var d="1";b.stopEditing();
|
||||
b.getModel().beginUpdate();try{if("1"==a.style.html){var d=null,e=b.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(e=e.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=e;e=mxUtils.extractTextWithWhitespace(f.childNodes);b.cellLabelChanged(a.cell,e)}else e=mxUtils.htmlEntities(b.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(e=e.replace(/\n/g,"<br/>")),b.cellLabelChanged(a.cell,b.sanitizeHtml(e));
|
||||
b.setCellStyles("html",d);c.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=d?d:"0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=b.getView().getState(b.getSelectionCell()),c="wrap";b.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(c=null);b.setCellStyles(mxConstants.STYLE_WHITE_SPACE,c)});this.addAction("rotation",function(){var a="0",d=b.getView().getState(b.getSelectionCell());
|
||||
null!=d&&(a=d.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(c,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&b.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");c.showDialog(a.container,375,80,!0,!0);a.init()});this.addAction("resetView",function(){b.zoomTo(1);c.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){b.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");
|
||||
this.addAction("zoomOut",function(a){b.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){b.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){b.pageVisible||this.get("pageView").funct();var a=b.pageFormat,c=b.pageScale;b.zoomTo(Math.floor(20*Math.min((b.container.clientWidth-10)/a.width/c,(b.container.clientHeight-10)/a.height/c))/20);mxUtils.hasScrollbars(b.container)&&(a=b.getPagePadding(),b.container.scrollTop=
|
||||
a.y*b.view.scale-1,b.container.scrollLeft=Math.min(a.x*b.view.scale,(b.container.scrollWidth-b.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){b.pageVisible||this.get("pageView").funct();var a=b.pageFormat,c=b.pageScale;b.zoomTo(Math.floor(20*Math.min((b.container.clientWidth-10)/(2*a.width)/c,(b.container.clientHeight-10)/a.height/c))/20);mxUtils.hasScrollbars(b.container)&&(a=b.getPagePadding(),b.container.scrollTop=Math.min(a.y,
|
||||
(b.container.scrollHeight-b.container.clientHeight)/2),b.container.scrollLeft=Math.min(a.x,(b.container.scrollWidth-b.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){b.pageVisible||this.get("pageView").funct();b.zoomTo(Math.floor(20*(b.container.clientWidth-10)/b.pageFormat.width/b.pageScale)/20);if(mxUtils.hasScrollbars(b.container)){var a=b.getPagePadding();b.container.scrollLeft=Math.min(a.x*b.view.scale,(b.container.scrollWidth-
|
||||
b.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*b.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,
|
||||
parseInt(100*b.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&c.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var e=null,e=this.addAction("grid",function(){b.setGridEnabled(!b.isGridEnabled());c.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");e.setToggleAction(!0);e.setSelectedCallback(function(){return b.isGridEnabled()});e.setEnabled(!1);
|
||||
e=this.addAction("guides",function(){b.graphHandler.guidesEnabled=!b.graphHandler.guidesEnabled;c.fireEvent(new mxEventObject("guidesEnabledChanged"))});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.graphHandler.guidesEnabled});e.setEnabled(!1);e=this.addAction("tooltips",function(){b.tooltipHandler.setEnabled(!b.tooltipHandler.isEnabled())});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.tooltipHandler.isEnabled()});e=this.addAction("collapseExpand",function(){var a=
|
||||
new ChangePageSetup(c);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!b.foldingEnabled;b.model.execute(a)});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.foldingEnabled});e.isEnabled=f;e=this.addAction("scrollbars",function(){c.setScrollbars(!c.hasScrollbars())});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.scrollbars});e=this.addAction("pageView",mxUtils.bind(this,function(){c.setPageVisible(!b.pageVisible)}));e.setToggleAction(!0);e.setSelectedCallback(function(){return b.pageVisible});
|
||||
e=this.addAction("connectionArrows",function(){b.connectionArrowsEnabled=!b.connectionArrowsEnabled;c.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");e.setToggleAction(!0);e.setSelectedCallback(function(){return b.connectionArrowsEnabled});e=this.addAction("connectionPoints",function(){b.setConnectable(!b.connectionHandler.isEnabled());c.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");e.setToggleAction(!0);e.setSelectedCallback(function(){return b.connectionHandler.isEnabled()});
|
||||
e=this.addAction("copyConnect",function(){b.connectionHandler.setCreateTarget(!b.connectionHandler.isCreateTarget());c.fireEvent(new mxEventObject("copyConnectChanged"))});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.connectionHandler.isCreateTarget()});e.isEnabled=f;e=this.addAction("autosave",function(){c.editor.setAutosave(!c.editor.autosave)});e.setToggleAction(!0);e.setSelectedCallback(function(){return c.editor.autosave});e.isEnabled=f;e.visible=!1;this.addAction("help",function(){var a=
|
||||
"";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);b.openLink(RESOURCES_PATH+"/help"+a+".html")});var h=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){h||(c.showDialog((new AboutDialog(c)).container,320,280,!0,!0,function(){h=!1}),h=!0)},null,null,"F1"));e=mxUtils.bind(this,function(a,c,d,e){return this.addAction(a,function(){if(null!=d&&b.cellEditor.isContentEditing())d();else{b.stopEditing(!1);b.getModel().beginUpdate();try{b.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,
|
||||
c),(c&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&b.replaceElement(a)}):(c&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&b.replaceElement(a)}):(c&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.updateLabelElements(b.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&
|
||||
b.replaceElement(a)})}finally{b.getModel().endUpdate()}}},null,null,e)});e("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");e("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");e("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){c.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});
|
||||
this.addAction("strokeColor...",function(){c.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){c.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){c.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});this.addAction("backgroundColor...",function(){c.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){c.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});
|
||||
this.addAction("vertical",function(){c.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){c.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_DASHED,null),b.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});
|
||||
this.addAction("dashed",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_DASHED,"1"),b.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("dotted",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_DASHED,"1"),b.setCellStyles(mxConstants.STYLE_DASH_PATTERN,
|
||||
"1 4"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("sharp",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),b.setCellStyles(mxConstants.STYLE_CURVED,"0"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});
|
||||
this.addAction("rounded",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),b.setCellStyles(mxConstants.STYLE_CURVED,"0"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!b.isSelectionEmpty()&&b.isEnabled()){b.getModel().beginUpdate();try{var a=b.getSelectionCells(),d=b.view.getState(a[0]),
|
||||
e=null!=d?d.style:b.getCellStyle(a[0]),f="1"==mxUtils.getValue(e,mxConstants.STYLE_ROUNDED,"0")?"0":"1";b.setCellStyles(mxConstants.STYLE_ROUNDED,f);b.setCellStyles(mxConstants.STYLE_CURVED,null);c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}}});this.addAction("curved",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),b.setCellStyles(mxConstants.STYLE_CURVED,
|
||||
"1"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("collapsible",function(){var a=b.view.getState(b.getSelectionCell()),d="1";null!=a&&null!=b.getFoldingImage(a)&&(d="0");b.setCellStyles("collapsible",d);c.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[d],"cells",b.getSelectionCells()))});this.addAction("editStyle...",
|
||||
mxUtils.bind(this,function(){var a=b.getSelectionCells();if(null!=a&&0<a.length){var c=b.getModel(),c=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",c.getStyle(a[0])||"",function(c){null!=c&&b.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(c.container,420,300,!0,!0);c.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){b.isEnabled()&&!b.isSelectionEmpty()&&c.setDefaultStyle(b.getSelectionCell())},null,null,Editor.ctrlKey+
|
||||
"+Shift+D");this.addAction("clearDefaultStyle",function(){b.isEnabled()&&c.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=b.getSelectionCell();if(null!=a&&b.getModel().isEdge(a)){var c=d.graph.selectionCellsHandler.getHandler(a);if(c instanceof mxEdgeHandler){for(var e=b.view.translate,f=b.view.scale,h=e.x,e=e.y,a=b.getModel().getParent(a),n=b.getCellGeometry(a);b.getModel().isVertex(a)&&null!=n;)h+=n.x,e+=n.y,a=b.getModel().getParent(a),n=
|
||||
b.getCellGeometry(a);h=Math.round(b.snap(b.popupMenuHandler.triggerX/f-h));f=Math.round(b.snap(b.popupMenuHandler.triggerY/f-e));c.addPointAt(c.state,h,f)}}});this.addAction("removeWaypoint",function(){var a=c.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=b.getSelectionCells();if(null!=a){a=b.addAllEdges(a);b.getModel().beginUpdate();try{for(var c=0;c<a.length;c++){var d=a[c];if(b.getModel().isEdge(d)){var e=
|
||||
b.getCellGeometry(d);null!=e&&(e=e.clone(),e.points=null,b.getModel().setGeometry(d,e))}}}finally{b.getModel().endUpdate()}}},null,null,"Alt+Shift+C");e=this.addAction("subscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");e=this.addAction("superscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",
|
||||
function(){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",d=b.getView().getState(b.getSelectionCell()),e="";null!=d&&(e=d.style[mxConstants.STYLE_IMAGE]||e);var f=b.cellEditor.saveSelection();c.showImageDialog(a,e,function(a,c,d){if(b.cellEditor.isContentEditing())b.cellEditor.restoreSelection(f),b.insertImage(a,c,d);else{var e=b.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;b.getModel().beginUpdate();
|
||||
try{if(0==e.length){var h=b.getFreeInsertPoint(),g=e=[b.insertVertex(b.getDefaultParent(),null,"",h.x,h.y,c,d,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];b.fireEvent(new mxEventObject("cellsInserted","cells",g))}b.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var k=b.view.getState(e[0]),l=null!=k?k.style:b.getCellStyle(e[0]);"image"!=l[mxConstants.STYLE_SHAPE]&&"label"!=l[mxConstants.STYLE_SHAPE]?b.setCellStyles(mxConstants.STYLE_SHAPE,"image",
|
||||
e):0==a.length&&b.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==b.getSelectionCount()&&null!=c&&null!=d){var m=e[0],n=b.getModel().getGeometry(m);null!=n&&(n=n.clone(),n.width=c,n.height=d,b.getModel().setGeometry(m,n))}}finally{b.getModel().endUpdate()}null!=g&&(b.setSelectionCells(g),b.scrollCellToVisible(g[0]))}}},b.cellEditor.isContentEditing(),!b.cellEditor.isContentEditing())}}).isEnabled=f;this.addAction("insertImage...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&
|
||||
(b.clearSelection(),c.actions.get("image").funct())}).isEnabled=f;e=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(c,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){c.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("layers"))):
|
||||
this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));e=this.addAction("formatPanel",mxUtils.bind(this,function(){c.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return 0<c.formatWidth}));e=this.addAction("outline",
|
||||
mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(c,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){c.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,
|
||||
null,Editor.ctrlKey+"+Shift+O");e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,c,d,b,f){var e;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),e=mxResources.get(a)+"..."):e=mxResources.get(a);return this.put(a,new Action(e,c,d,b,f))};Actions.prototype.put=function(a,c){return this.actions[a]=c};Actions.prototype.get=function(a){return this.actions[a]};
|
||||
function Action(a,c,d,b,f){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(c);this.enabled=null!=d?d:!0;this.iconCls=b;this.shortcut=f;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(";");
|
||||
null!=a&&b.openLink(a)});this.addAction("editLink...",function(){var a=c.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var b=a.getSelectionCell(),d=a.getLinkForCell(b)||"";c.showLinkDialog(d,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(b,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(b.clearSelection(),c.actions.get("image").funct())})).isEnabled=
|
||||
f;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&c.showLinkDialog("",mxResources.get("insert"),function(a,c){a=mxUtils.trim(a);if(0<a.length){var d=null,e=b.getLinkTitle(a);null!=c&&0<c.length&&(d=c[0].iconUrl,e=c[0].name||c[0].type,e=e.charAt(0).toUpperCase()+e.substring(1),30<e.length&&(e=e.substring(0,30)+"..."));var g=b.getFreeInsertPoint(),d=new mxCell(e,new mxGeometry(g.x,g.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+
|
||||
(null!=d?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+d:"spacing=10;"));d.vertex=!0;b.setLinkForCell(d,a);b.cellSizeUpdated(d,!0);b.getModel().beginUpdate();try{d=b.addCell(d),b.fireEvent(new mxEventObject("cellsInserted","cells",[d]))}finally{b.getModel().endUpdate()}b.setSelectionCell(d);b.scrollCellToVisible(b.getSelectionCell())}})})).isEnabled=f;this.addAction("link...",mxUtils.bind(this,function(){var a=c.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var b=
|
||||
a.getSelectedElement(),d=a.getParentByName(b,"A",a.cellEditor.textarea),e="";if(null==d&&null!=b&&null!=b.getElementsByTagName)for(var f=b.getElementsByTagName("a"),h=0;h<f.length&&null==d;h++)f[h].textContent==b.textContent&&(a.selectNode(f[h]),d=f[h]);null!=d&&"A"==d.nodeName&&(e=d.getAttribute("href")||"");var u=a.cellEditor.saveSelection();c.showLinkDialog(e,mxResources.get("apply"),mxUtils.bind(this,function(b){a.cellEditor.restoreSelection(u);null!=b&&a.insertLink(b)}))}else a.isSelectionEmpty()?
|
||||
this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=f;this.addAction("autosize",function(){var a=b.getSelectionCells();if(null!=a){b.getModel().beginUpdate();try{for(var c=0;c<a.length;c++){var d=a[c];if(b.getModel().getChildCount(d))b.updateGroupBounds([d],20);else{var e=b.view.getState(d),f=b.getCellGeometry(d);b.getModel().isVertex(d)&&null!=e&&null!=e.text&&null!=f&&b.isWrapping(d)?(f=f.clone(),f.height=e.text.boundingBox.height/b.view.scale,b.getModel().setGeometry(d,f)):
|
||||
b.updateCellSize(d)}}}finally{b.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=b.getView().getState(b.getSelectionCell());if(null!=a){var d="1";b.stopEditing();b.getModel().beginUpdate();try{if("1"==a.style.html){var d=null,e=b.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(e=e.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=e;e=mxUtils.extractTextWithWhitespace(f.childNodes);
|
||||
b.cellLabelChanged(a.cell,e)}else e=mxUtils.htmlEntities(b.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(e=e.replace(/\n/g,"<br/>")),b.cellLabelChanged(a.cell,b.sanitizeHtml(e));b.setCellStyles("html",d);c.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=d?d:"0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=b.getView().getState(b.getSelectionCell()),c="wrap";b.stopEditing();
|
||||
null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(c=null);b.setCellStyles(mxConstants.STYLE_WHITE_SPACE,c)});this.addAction("rotation",function(){var a="0",d=b.getView().getState(b.getSelectionCell());null!=d&&(a=d.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(c,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&b.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");c.showDialog(a.container,375,80,!0,!0);
|
||||
a.init()});this.addAction("resetView",function(){b.zoomTo(1);c.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){b.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(a){b.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){b.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){b.pageVisible||this.get("pageView").funct();
|
||||
var a=b.pageFormat,c=b.pageScale;b.zoomTo(Math.floor(20*Math.min((b.container.clientWidth-10)/a.width/c,(b.container.clientHeight-10)/a.height/c))/20);mxUtils.hasScrollbars(b.container)&&(a=b.getPagePadding(),b.container.scrollTop=a.y*b.view.scale-1,b.container.scrollLeft=Math.min(a.x*b.view.scale,(b.container.scrollWidth-b.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){b.pageVisible||this.get("pageView").funct();var a=b.pageFormat,
|
||||
c=b.pageScale;b.zoomTo(Math.floor(20*Math.min((b.container.clientWidth-10)/(2*a.width)/c,(b.container.clientHeight-10)/a.height/c))/20);mxUtils.hasScrollbars(b.container)&&(a=b.getPagePadding(),b.container.scrollTop=Math.min(a.y,(b.container.scrollHeight-b.container.clientHeight)/2),b.container.scrollLeft=Math.min(a.x,(b.container.scrollWidth-b.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){b.pageVisible||this.get("pageView").funct();
|
||||
b.zoomTo(Math.floor(20*(b.container.clientWidth-10)/b.pageFormat.width/b.pageScale)/20);if(mxUtils.hasScrollbars(b.container)){var a=b.getPagePadding();b.container.scrollLeft=Math.min(a.x*b.view.scale,(b.container.scrollWidth-b.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*b.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&
|
||||
0<a&&b.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*b.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&c.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var e=null,e=this.addAction("grid",
|
||||
function(){b.setGridEnabled(!b.isGridEnabled());c.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");e.setToggleAction(!0);e.setSelectedCallback(function(){return b.isGridEnabled()});e.setEnabled(!1);e=this.addAction("guides",function(){b.graphHandler.guidesEnabled=!b.graphHandler.guidesEnabled;c.fireEvent(new mxEventObject("guidesEnabledChanged"))});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.graphHandler.guidesEnabled});e.setEnabled(!1);
|
||||
e=this.addAction("tooltips",function(){b.tooltipHandler.setEnabled(!b.tooltipHandler.isEnabled())});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.tooltipHandler.isEnabled()});e=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(c);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!b.foldingEnabled;b.model.execute(a)});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.foldingEnabled});e.isEnabled=f;e=this.addAction("scrollbars",function(){c.setScrollbars(!c.hasScrollbars())});
|
||||
e.setToggleAction(!0);e.setSelectedCallback(function(){return b.scrollbars});e=this.addAction("pageView",mxUtils.bind(this,function(){c.setPageVisible(!b.pageVisible)}));e.setToggleAction(!0);e.setSelectedCallback(function(){return b.pageVisible});e=this.addAction("connectionArrows",function(){b.connectionArrowsEnabled=!b.connectionArrowsEnabled;c.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");e.setToggleAction(!0);e.setSelectedCallback(function(){return b.connectionArrowsEnabled});
|
||||
e=this.addAction("connectionPoints",function(){b.setConnectable(!b.connectionHandler.isEnabled());c.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");e.setToggleAction(!0);e.setSelectedCallback(function(){return b.connectionHandler.isEnabled()});e=this.addAction("copyConnect",function(){b.connectionHandler.setCreateTarget(!b.connectionHandler.isCreateTarget());c.fireEvent(new mxEventObject("copyConnectChanged"))});e.setToggleAction(!0);e.setSelectedCallback(function(){return b.connectionHandler.isCreateTarget()});
|
||||
e.isEnabled=f;e=this.addAction("autosave",function(){c.editor.setAutosave(!c.editor.autosave)});e.setToggleAction(!0);e.setSelectedCallback(function(){return c.editor.autosave});e.isEnabled=f;e.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);b.openLink(RESOURCES_PATH+"/help"+a+".html")});var h=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){h||(c.showDialog((new AboutDialog(c)).container,
|
||||
320,280,!0,!0,function(){h=!1}),h=!0)},null,null,"F1"));e=mxUtils.bind(this,function(a,c,d,e){return this.addAction(a,function(){if(null!=d&&b.cellEditor.isContentEditing())d();else{b.stopEditing(!1);b.getModel().beginUpdate();try{b.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,c),(c&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&b.replaceElement(a)}):(c&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
|
||||
b.updateLabelElements(b.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&b.replaceElement(a)}):(c&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.updateLabelElements(b.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&b.replaceElement(a)})}finally{b.getModel().endUpdate()}}},null,null,e)});e("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");e("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",
|
||||
!1,null)},Editor.ctrlKey+"+I");e("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){c.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){c.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){c.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){c.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});
|
||||
this.addAction("backgroundColor...",function(){c.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){c.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){c.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){c.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_DASHED,
|
||||
null),b.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("dashed",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_DASHED,"1"),b.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
|
||||
mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("dotted",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_DASHED,"1"),b.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("sharp",
|
||||
function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),b.setCellStyles(mxConstants.STYLE_CURVED,"0"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("rounded",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),b.setCellStyles(mxConstants.STYLE_CURVED,"0"),c.fireEvent(new mxEventObject("styleChanged",
|
||||
"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!b.isSelectionEmpty()&&b.isEnabled()){b.getModel().beginUpdate();try{var a=b.getSelectionCells(),d=b.view.getState(a[0]),e=null!=d?d.style:b.getCellStyle(a[0]),f="1"==mxUtils.getValue(e,mxConstants.STYLE_ROUNDED,"0")?"0":"1";b.setCellStyles(mxConstants.STYLE_ROUNDED,f);b.setCellStyles(mxConstants.STYLE_CURVED,
|
||||
null);c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}}});this.addAction("curved",function(){b.getModel().beginUpdate();try{b.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),b.setCellStyles(mxConstants.STYLE_CURVED,"1"),c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",b.getSelectionCells()))}finally{b.getModel().endUpdate()}});
|
||||
this.addAction("collapsible",function(){var a=b.view.getState(b.getSelectionCell()),d="1";null!=a&&null!=b.getFoldingImage(a)&&(d="0");b.setCellStyles("collapsible",d);c.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[d],"cells",b.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=b.getSelectionCells();if(null!=a&&0<a.length){var c=b.getModel(),c=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",c.getStyle(a[0])||"",
|
||||
function(c){null!=c&&b.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(c.container,420,300,!0,!0);c.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){b.isEnabled()&&!b.isSelectionEmpty()&&c.setDefaultStyle(b.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){b.isEnabled()&&c.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=b.getSelectionCell();
|
||||
if(null!=a&&b.getModel().isEdge(a)){var c=d.graph.selectionCellsHandler.getHandler(a);if(c instanceof mxEdgeHandler){for(var e=b.view.translate,f=b.view.scale,h=e.x,e=e.y,a=b.getModel().getParent(a),n=b.getCellGeometry(a);b.getModel().isVertex(a)&&null!=n;)h+=n.x,e+=n.y,a=b.getModel().getParent(a),n=b.getCellGeometry(a);h=Math.round(b.snap(b.popupMenuHandler.triggerX/f-h));f=Math.round(b.snap(b.popupMenuHandler.triggerY/f-e));c.addPointAt(c.state,h,f)}}});this.addAction("removeWaypoint",function(){var a=
|
||||
c.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=b.getSelectionCells();if(null!=a){a=b.addAllEdges(a);b.getModel().beginUpdate();try{for(var c=0;c<a.length;c++){var d=a[c];if(b.getModel().isEdge(d)){var e=b.getCellGeometry(d);null!=e&&(e=e.clone(),e.points=null,b.getModel().setGeometry(d,e))}}}finally{b.getModel().endUpdate()}}},null,null,"Alt+Shift+C");e=this.addAction("subscript",mxUtils.bind(this,
|
||||
function(){b.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");e=this.addAction("superscript",mxUtils.bind(this,function(){b.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",d=b.getView().getState(b.getSelectionCell()),e="";null!=
|
||||
d&&(e=d.style[mxConstants.STYLE_IMAGE]||e);var f=b.cellEditor.saveSelection();c.showImageDialog(a,e,function(a,c,d){if(b.cellEditor.isContentEditing())b.cellEditor.restoreSelection(f),b.insertImage(a,c,d);else{var e=b.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;b.getModel().beginUpdate();try{if(0==e.length){var h=b.getFreeInsertPoint(),g=e=[b.insertVertex(b.getDefaultParent(),null,"",h.x,h.y,c,d,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
|
||||
b.fireEvent(new mxEventObject("cellsInserted","cells",g))}b.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var k=b.view.getState(e[0]),l=null!=k?k.style:b.getCellStyle(e[0]);"image"!=l[mxConstants.STYLE_SHAPE]&&"label"!=l[mxConstants.STYLE_SHAPE]?b.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&b.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==b.getSelectionCount()&&null!=c&&null!=d){var m=e[0],n=b.getModel().getGeometry(m);null!=n&&(n=n.clone(),n.width=c,n.height=d,
|
||||
b.getModel().setGeometry(m,n))}}finally{b.getModel().endUpdate()}null!=g&&(b.setSelectionCells(g),b.scrollCellToVisible(g[0]))}}},b.cellEditor.isContentEditing(),!b.cellEditor.isContentEditing())}}).isEnabled=f;e=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(c,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){c.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
|
||||
function(){c.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));e=this.addAction("formatPanel",mxUtils.bind(this,function(){c.toggleFormatPanel()}),null,null,Editor.ctrlKey+
|
||||
"+Shift+P");e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return 0<c.formatWidth}));e=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(c,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){c.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
|
||||
c.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");e.setToggleAction(!0);e.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};
|
||||
Actions.prototype.addAction=function(a,c,d,b,f){var e;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),e=mxResources.get(a)+"..."):e=mxResources.get(a);return this.put(a,new Action(e,c,d,b,f))};Actions.prototype.put=function(a,c){return this.actions[a]=c};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,c,d,b,f){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(c);this.enabled=null!=d?d:!0;this.iconCls=b;this.shortcut=f;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.init=function(){var a=this.editorUi.editor.graph,c=mxUtils.bind(a,a.isEnabled);this.customFonts=[];this.customFontSizes=[];this.put("fontFamily",new Menu(mxUtils.bind(this,function(c,b){for(var d=mxUtils.bind(this,function(d){this.styleChange(c,d,[mxConstants.STYLE_FONTFAMILY],[d],null,b,function(){document.execCommand("fontname",!1,d)},function(){a.updateLabelElements(a.getSelectionCells(),function(b){b.removeAttribute("face");b.style.fontFamily=null;"PRE"==b.nodeName&&a.replaceElement(b,
|
||||
"div")})}).firstChild.nextSibling.style.fontFamily=d}),e=0;e<this.defaultFonts.length;e++)d(this.defaultFonts[e]);c.addSeparator(b);if(0<this.customFonts.length){for(e=0;e<this.customFonts.length;e++)d(this.customFonts[e]);c.addSeparator(b);c.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[]}),b);c.addSeparator(b)}this.promptChange(c,mxResources.get("custom")+"...","",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,b,!0,mxUtils.bind(this,function(a){this.customFonts.push(a)}))})));
|
||||
this.put("formatBlock",new Menu(mxUtils.bind(this,function(c,b){function d(d,f){return c.addItem(d,null,mxUtils.bind(this,function(){null!=a.cellEditor.textarea&&(a.cellEditor.textarea.focus(),document.execCommand("formatBlock",!1,"<"+f+">"))}),b)}d(mxResources.get("normal"),"p");d("","h1").firstChild.nextSibling.innerHTML='<h1 style="margin:0px;">'+mxResources.get("heading")+" 1</h1>";d("","h2").firstChild.nextSibling.innerHTML='<h2 style="margin:0px;">'+mxResources.get("heading")+" 2</h2>";d("",
|
||||
|
@ -7460,29 +7460,29 @@ StorageFile.prototype.saveFile=function(a,c,b,d){if(this.isEditable()){var e=mxU
|
|||
StorageFile.prototype.open=function(){DrawioFile.prototype.open.apply(this,arguments);this.saveFile(this.getTitle())};StorageFile.prototype.getLatestVersion=function(a,c){this.ui.getLocalData(this.title,mxUtils.bind(this,function(b){a(new StorageFile(this.ui,b,this.title))}))};StorageFile.prototype.destroy=function(){DrawioFile.prototype.destroy.apply(this,arguments);null!=this.storageListener&&(mxEvent.removeListener(window,"storage",this.storageListener),this.storageListener=null)};StorageLibrary=function(a,c,b){StorageFile.call(this,a,c,b)};mxUtils.extend(StorageLibrary,StorageFile);StorageLibrary.prototype.isAutosave=function(){return!0};StorageLibrary.prototype.saveAs=function(a,c,b){this.saveFile(a,!1,c,b)};StorageLibrary.prototype.getHash=function(){return"L"+encodeURIComponent(this.title)};StorageLibrary.prototype.getTitle=function(){return".scratchpad"==this.title?mxResources.get("scratchpad"):this.title};
|
||||
StorageLibrary.prototype.isRenamable=function(a,c,b){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};UrlLibrary=function(a,c,b){StorageFile.call(this,a,c,b);a=b;c=a.lastIndexOf("/");0<=c&&(a=a.substring(c+1));this.fname=a};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(a,c,b){return!1};UrlLibrary.prototype.saveAs=function(a,c,b){};UrlLibrary.prototype.open=function(){};/*
|
||||
mxClient.IS_IOS || */
|
||||
var StorageDialog=function(a,c,b){function d(d,e,u,g,p,q){function E(){mxEvent.addListener(v,"click",null!=q?q:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,f.checked);c()})):(a.setMode(u,f.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}var v=document.createElement("a");v.style.overflow="hidden";v.style.display=
|
||||
var StorageDialog=function(a,c,b){function d(d,e,u,g,p,q){function D(){mxEvent.addListener(v,"click",null!=q?q:function(){u!=App.MODE_GOOGLE||a.isDriveDomain()?u==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(u,f.checked);c()})):(a.setMode(u,f.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}var v=document.createElement("a");v.style.overflow="hidden";v.style.display=
|
||||
mxClient.IS_QUIRKS?"inline":"inline-block";v.className="geBaseButton";v.style.boxSizing="border-box";v.style.fontSize="11px";v.style.position="relative";v.style.margin="4px";v.style.padding="8px 10px 12px 10px";v.style.width="88px";v.style.height="100px";v.style.whiteSpace="nowrap";v.setAttribute("title",e);mxClient.IS_QUIRKS&&(v.style.cssFloat="left",v.style.zoom="1");var w=document.createElement("div");w.style.textOverflow="ellipsis";w.style.overflow="hidden";if(null!=d){var t=document.createElement("img");
|
||||
t.setAttribute("src",d);t.setAttribute("border","0");t.setAttribute("align","absmiddle");t.style.width="60px";t.style.height="60px";t.style.paddingBottom="6px";v.appendChild(t)}else w.style.paddingTop="5px",w.style.whiteSpace="normal",mxClient.IS_IOS?(v.style.padding="0px 10px 20px 10px",v.style.top="6px"):mxClient.IS_FF&&(w.style.paddingTop="0px",w.style.marginTop="-2px");v.appendChild(w);mxUtils.write(w,e);if(null!=p)for(d=0;d<p.length;d++)mxUtils.br(w),mxUtils.write(w,p[d]);if(null!=g&&null==a[g]){t.style.visibility=
|
||||
"hidden";mxUtils.setOpacity(w,10);var k=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});k.spin(v);var C=window.setTimeout(function(){null==a[g]&&(k.stop(),v.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(C),mxUtils.setOpacity(w,100),t.style.visibility="",k.stop(),E(),"drive"==g&&null!=m.parentNode&&m.parentNode.removeChild(m))}))}else E();
|
||||
"hidden";mxUtils.setOpacity(w,10);var k=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});k.spin(v);var E=window.setTimeout(function(){null==a[g]&&(k.stop(),v.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(E),mxUtils.setOpacity(w,100),t.style.visibility="",k.stop(),D(),"drive"==g&&null!=m.parentNode&&m.parentNode.removeChild(m))}))}else D();
|
||||
n.appendChild(v);++h>=b&&(mxUtils.br(n),h=0)}b=null!=b?b:2;var e=document.createElement("div");e.style.textAlign="center";e.style.whiteSpace="nowrap";e.style.paddingTop="0px";e.style.paddingBottom="20px";var g=a.addLanguageMenu(e,!0);null!=g&&(g.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1<a.getServiceCount()){g=document.createElement("a");g.setAttribute("href","https://about.draw.io/support/");g.setAttribute("title",mxResources.get("help"));g.setAttribute("target","_blank");g.style.position=
|
||||
"absolute";g.style.textDecoration="none";g.style.cursor="pointer";g.style.fontSize="12px";g.style.bottom="28px";g.style.left="26px";g.style.color="gray";var k=document.createElement("img");mxUtils.setOpacity(k,50);k.style.height="16px";k.style.width="16px";k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";g.appendChild(k);mxUtils.write(g,mxResources.get("help"));e.appendChild(g)}var l=document.createElement("div");l.style.position=
|
||||
"absolute";l.style.cursor="pointer";l.style.fontSize="12px";l.style.bottom="28px";l.style.color="gray";mxUtils.write(l,mxResources.get("decideLater"));a.isOfflineApp()?l.style.right="20px":(mxUtils.setPrefixedStyle(l.style,"transform","translate(-50%,0)"),l.style.left="50%");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)l.style.marginLeft=-Math.round(l.clientWidth/2)+"px"};e.appendChild(l);mxEvent.addListener(l,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;
|
||||
a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});var n=document.createElement("div");mxClient.IS_QUIRKS&&(n.style.whiteSpace="nowrap",n.style.cssFloat="left");n.style.border="1px solid #d3d3d3";n.style.borderWidth="1px 0px 1px 0px";n.style.padding="12px 0px 12px 0px";var f=document.createElement("input");f.setAttribute("type","checkbox");f.setAttribute("checked","checked");f.defaultChecked=!0;var h=0,m=document.createElement("p"),g=document.createElement("p");
|
||||
g.style.fontSize="16pt";g.style.padding="0px";g.style.paddingTop="4px";g.style.paddingBottom="16px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("saveDiagramsTo")+":");e.appendChild(g);"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");"device"==urlParams.storage&&
|
||||
d(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);e.appendChild(n);g=document.createElement("p");g.style.marginTop="12px";g.style.marginBottom="6px";g.appendChild(f);k=document.createElement("span");k.style.color="gray";k.style.fontSize="12px";mxUtils.write(k," "+mxResources.get("rememberThisSetting"));g.appendChild(k);mxUtils.br(g);
|
||||
var p=a.getRecent();if(null!=p&&0<p.length){var q=document.createElement("select");q.style.marginTop="8px";q.style.width="140px";var t=document.createElement("option");t.setAttribute("value","");t.setAttribute("selected","selected");t.style.textAlign="center";mxUtils.write(t,mxResources.get("openRecent")+"...");q.appendChild(t);for(t=0;t<p.length;t++)(function(a){var b=a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",
|
||||
a.id);mxUtils.write(c,a.title+" ("+mxResources.get(b)+")");q.appendChild(c)})(p[t]);g.appendChild(q);mxEvent.addListener(q,"change",function(b){""!=q.value&&a.loadFile(q.value)})}else g.style.marginTop="20px",n.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(p=document.createElement("div"),p.style.cursor="pointer",p.style.padding="18px 0px 6px 0px",p.style.fontSize="12px",p.style.color="gray",mxUtils.write(p,mxResources.get("import")+": "+mxResources.get("gliffy")+
|
||||
", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(p,"click",function(){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(){null!=b.files&&(a.hideDialog(),a.openFiles(b.files,!0))});b.click()}),g.appendChild(p),n.style.paddingBottom="4px");n.appendChild(g);mxEvent.addListener(k,"click",function(a){f.checked=!f.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&
|
||||
"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(m.style.padding="8px",m.style.fontSize="9pt",m.style.marginTop="-14px",m.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",e.appendChild(m))},
|
||||
5E3);this.container=e},SplashDialog=function(a){var c=document.createElement("div");c.style.textAlign="center";a.addLanguageMenu(c,!0);var b=null,b=a.getServiceCount();if(!a.isOffline()&&1<b){b=document.createElement("a");b.setAttribute("href","https://about.draw.io/support/");b.setAttribute("title",mxResources.get("help"));b.setAttribute("target","_blank");b.style.position="absolute";b.style.fontSize="12px";b.style.textDecoration="none";b.style.cursor="pointer";b.style.bottom="22px";b.style.left=
|
||||
"26px";b.style.color="gray";var d=document.createElement("img");mxUtils.setOpacity(d,50);d.style.height="16px";d.style.width="16px";d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);d.style.marginRight="2px";b.appendChild(d);mxUtils.write(b,mxResources.get("help"));c.appendChild(b)}b=document.createElement("p");b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";d=document.createElement("img");
|
||||
d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.width="40px";d.style.height="40px";d.style.marginRight="12px";d.style.paddingBottom="4px";var e="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",e=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",e=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",e=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+
|
||||
"/github-logo.svg",e=mxResources.get("github")):a.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",e=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",e=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",e=mxResources.get("device"));var g=document.createElement("div");g.style.margin="4px 0px 0px 0px";var k=document.createElement("button");k.className="geBigButton";k.style.overflow="hidden";k.style.width="340px";mxClient.IS_CHROMEAPP||
|
||||
EditorUi.isElectronApp?(g.style.padding="42px 0px 56px 0px",k.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,e),c.appendChild(b),g.style.border="1px solid #d3d3d3",g.style.borderWidth="1px 0px 1px 0px",g.style.padding="18px 0px 24px 0px",k.style.marginBottom="8px");mxClient.IS_QUIRKS&&(g.style.whiteSpace="nowrap",g.style.cssFloat="left");mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("createNewDiagram"));mxEvent.addListener(k,"click",function(){a.hideDialog();
|
||||
a.actions.get("new").funct()});g.appendChild(k);mxUtils.br(g);k=document.createElement("button");k.className="geBigButton";k.style.marginBottom="22px";k.style.overflow="hidden";k.style.width="340px";mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("openExistingDiagram"));mxEvent.addListener(k,"click",function(){a.actions.get("open").funct()});g.appendChild(k);b="undefined";a.mode==App.MODE_GOOGLE?b=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?b=mxResources.get("dropbox"):
|
||||
a.mode==App.MODE_ONEDRIVE?b=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?b=mxResources.get("github"):a.mode==App.MODE_TRELLO?b=mxResources.get("trello"):a.mode==App.MODE_DEVICE?b=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(b=mxResources.get("browser"));mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(e=function(b){k.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="inline-block";c.style.marginTop="6px";mxUtils.write(c,
|
||||
mxResources.get("signOut"));k.style.marginBottom="16px";g.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});g.appendChild(c)},d=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=d?(k.style.marginBottom="24px",e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="inline-block",e.style.marginTop="6px",mxUtils.write(e,mxResources.get("changeUser")+" ("+d.displayName+")"),
|
||||
k.style.marginBottom="16px",g.style.paddingBottom="18px",mxEvent.addListener(e,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),g.appendChild(e)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?e(function(){a.oneDrive.logout()}):
|
||||
g.style.fontSize="16pt";g.style.padding="0px";g.style.paddingTop="4px";g.style.paddingBottom="16px";g.style.margin="0px";g.style.color="gray";mxUtils.write(g,mxResources.get("saveDiagramsTo")+":");e.appendChild(g);"function"===typeof window.DriveClient&&d(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&d(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");d(IMAGE_PATH+"/osa_drive-harddisk.png",
|
||||
mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||d(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);e.appendChild(n);g=document.createElement("p");g.style.marginTop="12px";g.style.marginBottom="6px";g.appendChild(f);k=document.createElement("span");k.style.color="gray";k.style.fontSize="12px";mxUtils.write(k," "+mxResources.get("rememberThisSetting"));g.appendChild(k);mxUtils.br(g);var p=a.getRecent();if(null!=p&&
|
||||
0<p.length){var q=document.createElement("select");q.style.marginTop="8px";q.style.width="140px";var t=document.createElement("option");t.setAttribute("value","");t.setAttribute("selected","selected");t.style.textAlign="center";mxUtils.write(t,mxResources.get("openRecent")+"...");q.appendChild(t);for(t=0;t<p.length;t++)(function(a){var b=a.mode;b==App.MODE_GOOGLE?b="googleDrive":b==App.MODE_ONEDRIVE&&(b="oneDrive");var c=document.createElement("option");c.setAttribute("value",a.id);mxUtils.write(c,
|
||||
a.title+" ("+mxResources.get(b)+")");q.appendChild(c)})(p[t]);g.appendChild(q);mxEvent.addListener(q,"change",function(b){""!=q.value&&a.loadFile(q.value)})}else g.style.marginTop="20px",n.style.padding="30px 0px 26px 0px";!Graph.fileSupport||mxClient.IS_IE||mxClient.IS_IE11||(p=document.createElement("div"),p.style.cursor="pointer",p.style.padding="18px 0px 6px 0px",p.style.fontSize="12px",p.style.color="gray",mxUtils.write(p,mxResources.get("import")+": "+mxResources.get("gliffy")+", "+mxResources.get("formatVssx")+
|
||||
", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(p,"click",function(){var b=document.createElement("input");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(){null!=b.files&&(a.hideDialog(),a.openFiles(b.files,!0))});b.click()}),g.appendChild(p),n.style.paddingBottom="4px");n.appendChild(g);mxEvent.addListener(k,"click",function(a){f.checked=!f.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==
|
||||
document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&(m.style.padding="8px",m.style.fontSize="9pt",m.style.marginTop="-14px",m.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://plus.google.com/u/0/+DrawIo1/posts/1HTrfsb5wDN" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",e.appendChild(m))},5E3);this.container=
|
||||
e},SplashDialog=function(a){var c=document.createElement("div");c.style.textAlign="center";a.addLanguageMenu(c,!0);var b=null,b=a.getServiceCount();if(!a.isOffline()&&1<b){b=document.createElement("a");b.setAttribute("href","https://about.draw.io/support/");b.setAttribute("title",mxResources.get("help"));b.setAttribute("target","_blank");b.style.position="absolute";b.style.fontSize="12px";b.style.textDecoration="none";b.style.cursor="pointer";b.style.bottom="22px";b.style.left="26px";b.style.color=
|
||||
"gray";var d=document.createElement("img");mxUtils.setOpacity(d,50);d.style.height="16px";d.style.width="16px";d.setAttribute("border","0");d.setAttribute("valign","bottom");d.setAttribute("src",Editor.helpImage);d.style.marginRight="2px";b.appendChild(d);mxUtils.write(b,mxResources.get("help"));c.appendChild(b)}b=document.createElement("p");b.style.fontSize="16pt";b.style.padding="0px";b.style.paddingTop="2px";b.style.margin="0px";b.style.color="gray";d=document.createElement("img");d.setAttribute("border",
|
||||
"0");d.setAttribute("align","absmiddle");d.style.width="40px";d.style.height="40px";d.style.marginRight="12px";d.style.paddingBottom="4px";var e="";a.mode==App.MODE_GOOGLE?(d.src=IMAGE_PATH+"/google-drive-logo.svg",e=mxResources.get("googleDrive")):a.mode==App.MODE_DROPBOX?(d.src=IMAGE_PATH+"/dropbox-logo.svg",e=mxResources.get("dropbox")):a.mode==App.MODE_ONEDRIVE?(d.src=IMAGE_PATH+"/onedrive-logo.svg",e=mxResources.get("oneDrive")):a.mode==App.MODE_GITHUB?(d.src=IMAGE_PATH+"/github-logo.svg",e=
|
||||
mxResources.get("github")):a.mode==App.MODE_TRELLO?(d.src=IMAGE_PATH+"/trello-logo.svg",e=mxResources.get("trello")):a.mode==App.MODE_BROWSER?(d.src=IMAGE_PATH+"/osa_database.png",e=mxResources.get("browser")):(d.src=IMAGE_PATH+"/osa_drive-harddisk.png",e=mxResources.get("device"));var g=document.createElement("div");g.style.margin="4px 0px 0px 0px";var k=document.createElement("button");k.className="geBigButton";k.style.overflow="hidden";k.style.width="340px";mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?
|
||||
(g.style.padding="42px 0px 56px 0px",k.style.marginBottom="12px"):(b.appendChild(d),mxUtils.write(b,e),c.appendChild(b),g.style.border="1px solid #d3d3d3",g.style.borderWidth="1px 0px 1px 0px",g.style.padding="18px 0px 24px 0px",k.style.marginBottom="8px");mxClient.IS_QUIRKS&&(g.style.whiteSpace="nowrap",g.style.cssFloat="left");mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("createNewDiagram"));mxEvent.addListener(k,"click",function(){a.hideDialog();a.actions.get("new").funct()});
|
||||
g.appendChild(k);mxUtils.br(g);k=document.createElement("button");k.className="geBigButton";k.style.marginBottom="22px";k.style.overflow="hidden";k.style.width="340px";mxClient.IS_QUIRKS&&(k.style.width="340px");mxUtils.write(k,mxResources.get("openExistingDiagram"));mxEvent.addListener(k,"click",function(){a.actions.get("open").funct()});g.appendChild(k);b="undefined";a.mode==App.MODE_GOOGLE?b=mxResources.get("googleDrive"):a.mode==App.MODE_DROPBOX?b=mxResources.get("dropbox"):a.mode==App.MODE_ONEDRIVE?
|
||||
b=mxResources.get("oneDrive"):a.mode==App.MODE_GITHUB?b=mxResources.get("github"):a.mode==App.MODE_TRELLO?b=mxResources.get("trello"):a.mode==App.MODE_DEVICE?b=mxResources.get("device"):a.mode==App.MODE_BROWSER&&(b=mxResources.get("browser"));mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(e=function(b){k.style.marginBottom="24px";var c=document.createElement("a");c.setAttribute("href","javascript:void(0)");c.style.display="inline-block";c.style.marginTop="6px";mxUtils.write(c,mxResources.get("signOut"));
|
||||
k.style.marginBottom="16px";g.style.paddingBottom="18px";mxEvent.addListener(c,"click",function(){a.confirm(mxResources.get("areYouSure"),function(){b()})});g.appendChild(c)},d=null!=a.drive?a.drive.getUser():null,a.mode==App.MODE_GOOGLE&&null!=d?(k.style.marginBottom="24px",e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="inline-block",e.style.marginTop="6px",mxUtils.write(e,mxResources.get("changeUser")+" ("+d.displayName+")"),k.style.marginBottom="16px",
|
||||
g.style.paddingBottom="18px",mxEvent.addListener(e,"click",function(){a.hideDialog();a.drive.clearUserId();a.drive.setUser(null);gapi.auth.signOut();a.setMode(App.MODE_GOOGLE);a.hideDialog();a.showSplash();a.drive.authorize(!1,mxUtils.bind(this,mxUtils.bind(this,function(){a.hideDialog();a.showSplash()})),mxUtils.bind(this,function(b){a.handleError(b,null,function(){a.hideDialog();a.showSplash()})}))}),g.appendChild(e)):a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?e(function(){a.oneDrive.logout()}):
|
||||
a.mode==App.MODE_GITHUB&&null!=a.gitHub?e(function(){a.gitHub.logout();a.openLink("https://www.github.com/logout")}):a.mode==App.MODE_TRELLO&&null!=a.trello?a.trello.isAuthorized()&&e(function(){a.trello.logout()}):a.mode==App.MODE_DROPBOX&&null!=a.dropbox&&e(function(){a.dropbox.logout();a.openLink("https://www.dropbox.com/logout")}),mxUtils.br(g),e=document.createElement("a"),e.setAttribute("href","javascript:void(0)"),e.style.display="inline-block",e.style.marginTop="8px",mxUtils.write(e,mxResources.get("notUsingService",
|
||||
[b])),mxEvent.addListener(e,"click",function(){a.hideDialog(!1);a.setMode(null);a.clearMode();a.showSplash(!0)}),g.appendChild(e));c.appendChild(g);this.container=c},ConfirmDialog=function(a,c,b,d,e,g,k,l,n){var f=document.createElement("div");f.style.textAlign="center";var h=document.createElement("div");h.style.padding="6px";h.style.overflow="auto";h.style.maxHeight="44px";mxClient.IS_QUIRKS&&(h.style.height="60px");mxUtils.write(h,c);f.appendChild(h);h=document.createElement("div");h.style.textAlign=
|
||||
"center";h.style.whiteSpace="nowrap";var m=document.createElement("input");m.setAttribute("type","checkbox");g=mxUtils.button(g||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(m.checked)});g.className="geBtn";null!=l&&(g.innerHTML=l+"<br>"+g.innerHTML,g.style.paddingBottom="8px",g.style.paddingTop="8px",g.style.height="auto",g.style.width="40%");a.editor.cancelFirst&&h.appendChild(g);var p=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b(m.checked)});h.appendChild(p);
|
||||
|
@ -7496,15 +7496,15 @@ window.open().document;d.writeln("<html><head><title>"+encodeURIComponent(mxReso
|
|||
"46px";h.className="geBtn";g.appendChild(h)}7168>c.length&&(h=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(l.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),f=document.createElement("img"),f.setAttribute("src",Editor.tweetImage),f.setAttribute("width","18"),f.setAttribute("height","18"),f.setAttribute("border","0"),f.style.marginBottom=
|
||||
"5px",h.appendChild(f),h.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),h.style.verticalAlign="bottom",h.style.paddingTop="4px",h.style.minWidth="46px",h.className="geBtn",g.appendChild(h))}f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.appendChild(f);h=mxUtils.button(mxResources.get("copy"),function(){l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?l.select():document.execCommand("selectAll",!1,
|
||||
null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>c.length?mxClient.IS_SF||null!=document.documentMode?f.className="geBtn gePrimaryBtn":(g.appendChild(h),h.className="geBtn gePrimaryBtn",f.className="geBtn"):(g.appendChild(n),f.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(g);this.container=d};EmbedDialog.showPreviewOption=!0;
|
||||
var GoogleSitesDialog=function(a,c){function b(){var a=null!=z&&null!=z.getTitle()?z.getTitle():this.defaultFilename;if(C.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<y.length&&(b+="&s="+y);""!=q.value&&"0"!=q.value&&(b+="&border="+q.value);""!=m.value&&(b+="&height="+m.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(E.checked?"1":"0");
|
||||
var GoogleSitesDialog=function(a,c){function b(){var a=null!=z&&null!=z.getTitle()?z.getTitle():this.defaultFilename;if(E.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<y.length&&(b+="&s="+y);""!=q.value&&"0"!=q.value&&(b+="&border="+q.value);""!=m.value&&(b+="&height="+m.value);b+="&pan="+(t.checked?"1":"0");b+="&zoom="+(v.checked?"1":"0");b+="&fit="+(D.checked?"1":"0");
|
||||
b+="&resize="+(w.checked?"1":"0");b+="&x0="+Number(h.value);b+="&y0="+n;e.mathEnabled&&(b+="&math=1");u.checked?b+="&edit=_blank":x.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));f.value=b}else z.constructor==DriveFile||z.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=z.getHash().substring(1),b=z.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!=
|
||||
a&&(b+="&title="+encodeURIComponent(a)),""!=m.value&&(a=parseInt(m.value)+parseInt(h.value),b+="&height="+a),f.value=b):f.value=""}var d=document.createElement("div"),e=a.editor.graph,g=e.getGraphBounds(),k=e.view.scale,l=Math.floor(g.x/k-e.view.translate.x),n=Math.floor(g.y/k-e.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var f=document.createElement("input");f.setAttribute("type","text");f.style.marginBottom="8px";f.style.marginTop="2px";f.style.width="410px";
|
||||
d.appendChild(f);mxUtils.br(d);this.init=function(){f.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?f.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var h=document.createElement("input");h.setAttribute("type","text");h.setAttribute("size","4");h.style.marginRight="16px";h.style.marginLeft="4px";h.value=l;d.appendChild(h);mxUtils.write(d,mxResources.get("height")+":");var m=document.createElement("input");m.setAttribute("type",
|
||||
"text");m.setAttribute("size","4");m.style.marginLeft="4px";m.value=Math.ceil(g.height/k);d.appendChild(m);mxUtils.br(d);g=document.createElement("hr");g.setAttribute("size","1");g.style.marginBottom="16px";g.style.marginTop="16px";d.appendChild(g);mxUtils.write(d,mxResources.get("publicDiagramUrl")+":");mxUtils.br(d);var p=document.createElement("input");p.setAttribute("type","text");p.setAttribute("size","28");p.style.marginBottom="8px";p.style.marginTop="2px";p.style.width="410px";p.value=c||"";
|
||||
d.appendChild(p);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","3");q.style.marginBottom="8px";q.style.marginLeft="4px";q.value="0";d.appendChild(q);mxUtils.br(d);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";d.appendChild(t);mxUtils.write(d,mxResources.get("pan")+" ");var v=document.createElement("input");
|
||||
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";d.appendChild(v);mxUtils.write(d,mxResources.get("zoom")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";x.setAttribute("title",window.location.href);d.appendChild(x);mxUtils.write(d,mxResources.get("edit")+" ");var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginLeft="8px";d.appendChild(u);mxUtils.write(d,
|
||||
mxResources.get("asNew")+" ");mxUtils.br(d);var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="16px";d.appendChild(w);mxUtils.write(d,mxResources.get("resize")+" ");var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginLeft="8px";d.appendChild(E);mxUtils.write(d,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft=
|
||||
"8px";d.appendChild(C);mxUtils.write(d,mxResources.get("embed")+" ");var y=a.getBasenames().join(";"),z=a.getCurrentFile();mxEvent.addListener(t,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(w,"change",b);mxEvent.addListener(E,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(m,"change",b);mxEvent.addListener(h,"change",b);mxEvent.addListener(q,"change",b);mxEvent.addListener(p,"change",b);b();
|
||||
mxResources.get("asNew")+" ");mxUtils.br(d);var w=document.createElement("input");w.setAttribute("type","checkbox");w.setAttribute("checked","checked");w.defaultChecked=!0;w.style.marginLeft="16px";d.appendChild(w);mxUtils.write(d,mxResources.get("resize")+" ");var D=document.createElement("input");D.setAttribute("type","checkbox");D.style.marginLeft="8px";d.appendChild(D);mxUtils.write(d,mxResources.get("fit")+" ");var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginLeft=
|
||||
"8px";d.appendChild(E);mxUtils.write(d,mxResources.get("embed")+" ");var y=a.getBasenames().join(";"),z=a.getCurrentFile();mxEvent.addListener(t,"change",b);mxEvent.addListener(v,"change",b);mxEvent.addListener(w,"change",b);mxEvent.addListener(D,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(E,"change",b);mxEvent.addListener(m,"change",b);mxEvent.addListener(h,"change",b);mxEvent.addListener(q,"change",b);mxEvent.addListener(p,"change",b);b();
|
||||
mxEvent.addListener(f,"click",function(){f.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?f.select():document.execCommand("selectAll",!1,null)});g=document.createElement("div");g.style.paddingTop="12px";g.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";g.appendChild(k);d.appendChild(g);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign=
|
||||
"right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var g=new Graph(c);g.setCellsCloneable(!0);g.setPanning(!0);g.setAllowDanglingEdges(!1);g.connectionHandler.select=!1;g.view.setTranslate(20,20);g.border=20;g.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";g.cellRenderer.installCellOverlayListeners=
|
||||
function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};g.getAllConnectionConstraints=function(){return null};g.connectionHandler.marker.highlight.keepOnTop=
|
||||
|
@ -7529,46 +7529,46 @@ c||"plantUmlTxt"==c){var f="plantUmlTxt"==c?PLANT_URL+"/txt/":"plantUmlPng"==c?P
|
|||
d(c4&63)},e=new XMLHttpRequest;e.open("GET",f+function(a){r="";for(l=0;l<a.length;l+=3)r=l+2==a.length?r+m(a.charCodeAt(l),a.charCodeAt(l+1),0):l+1==a.length?r+m(a.charCodeAt(l),0,0):r+m(a.charCodeAt(l),a.charCodeAt(l+1),a.charCodeAt(l+2));return r}(h.bytesToString(pako.deflateRaw(unescape(encodeURIComponent(b))))),!0);"plantUmlTxt"!=c&&(e.responseType="blob");e.onload=function(f){if(200<=this.status&&300>this.status)if("plantUmlTxt"==c)a.spinner.stop(),h.setSelectionCell(a.insertAsPreText(this.response,
|
||||
g.x,g.y)),h.scrollCellToVisible(h.getSelectionCell());else{var d=new FileReader;d.readAsDataURL(this.response);d.onloadend=function(c){var f=new Image;f.onload=function(){a.spinner.stop();var c=f.width,m=f.height;if(0==c&&0==m){var u=d.result,e=u.indexOf(","),u=decodeURIComponent(escape(atob(u.substring(e+1)))),u=mxUtils.parseXml(u).getElementsByTagName("svg");0<u.length&&(c=parseFloat(u[0].getAttribute("width")),m=parseFloat(u[0].getAttribute("height")))}h.getModel().beginUpdate();try{cell=h.insertVertex(null,
|
||||
null,b,g.x,g.y,c,m,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(d.result)+";")}finally{h.getModel().endUpdate()}h.setSelectionCell(cell);h.scrollCellToVisible(h.getSelectionCell())};f.src=d.result};d.onerror=function(b){a.handleError(b)}}else a.spinner.stop(),a.handleError(f)};e.onerror=function(b){a.handleError(b)};e.send()}}else if("table"==c){for(var p=null,q=[],k=0,l=0;l<f.length;l++)if(e=mxUtils.trim(f[l]),"create table"==e.substring(0,12).toLowerCase())e=
|
||||
mxUtils.trim(e.substring(12)),"("==e.charAt(e.length-1)&&(e=e.substring(0,e.lastIndexOf(" "))),p=new mxCell(e,new mxGeometry(k,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),p.vertex=!0,q.push(p),e=a.editor.graph.getPreferredSizeForCell(B),null!=e&&(p.geometry.width=e.width+10);else if(null!=p&&")"==e.charAt(0))k+=p.geometry.width+
|
||||
40,p=null;else if("("!=e&&null!=p&&(e=e.substring(0,","==e.charAt(e.length-1)?e.length-1:e.length),"primary key"!=e.substring(0,11).toLowerCase())){var n=e.toLowerCase().indexOf("primary key"),e=e.replace(/primary key/i,""),B=new mxCell(e,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");B.vertex=
|
||||
!0;e=sb.cloneCell(B,0<n?"PK":"");e.connectable=!1;e.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";e.geometry.width=30;e.geometry.height=26;B.insert(e);e=a.editor.graph.getPreferredSizeForCell(B);null!=e&&p.geometry.width<e.width+10&&(p.geometry.width=Math.min(220,e.width+10));p.insert(B);p.geometry.height+=26}0<q.length&&(h=a.editor.graph,f=h.view,
|
||||
mxUtils.trim(e.substring(12)),"("==e.charAt(e.length-1)&&(e=e.substring(0,e.lastIndexOf(" "))),p=new mxCell(e,new mxGeometry(k,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"),p.vertex=!0,q.push(p),e=a.editor.graph.getPreferredSizeForCell(A),null!=e&&(p.geometry.width=e.width+10);else if(null!=p&&")"==e.charAt(0))k+=p.geometry.width+
|
||||
40,p=null;else if("("!=e&&null!=p&&(e=e.substring(0,","==e.charAt(e.length-1)?e.length-1:e.length),"primary key"!=e.substring(0,11).toLowerCase())){var n=e.toLowerCase().indexOf("primary key"),e=e.replace(/primary key/i,""),A=new mxCell(e,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");A.vertex=
|
||||
!0;e=sb.cloneCell(A,0<n?"PK":"");e.connectable=!1;e.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";e.geometry.width=30;e.geometry.height=26;A.insert(e);e=a.editor.graph.getPreferredSizeForCell(A);null!=e&&p.geometry.width<e.width+10&&(p.geometry.width=Math.min(220,e.width+10));p.insert(A);p.geometry.height+=26}0<q.length&&(h=a.editor.graph,f=h.view,
|
||||
e=h.getGraphBounds(),h.setSelectionCells(h.importCells(q,Math.ceil(Math.max(0,e.x/f.scale-f.translate.x)+4*h.gridSize),Math.ceil(Math.max(0,(e.y+e.height)/f.scale-f.translate.y)+4*h.gridSize))),h.scrollCellToVisible(h.getSelectionCell()))}else if("list"==c){if(0<f.length){h=a.editor.graph;p=new mxCell(f[0],new mxGeometry(0,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;");
|
||||
p.vertex=!0;e=h.getPreferredSizeForCell(p);null!=e&&p.geometry.width<e.width+10&&(p.geometry.width=e.width+10);B=[p];if(1<f.length)for(l=1;l<f.length;l++)"--"==f[l]?(e=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),e.vertex=!0,p.geometry.height+=e.geometry.height,p.insert(e),B.push(e)):0<f[l].length&&";"!=f[l].charAt(0)&&(k=new mxCell(f[l],
|
||||
new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),k.vertex=!0,e=h.getPreferredSizeForCell(k),null!=e&&k.geometry.width<e.width&&(k.geometry.width=e.width),p.geometry.width=Math.max(p.geometry.width,k.geometry.width),p.geometry.height+=k.geometry.height,p.insert(k),B.push(k));h.getModel().beginUpdate();try{p=h.importCells([p],g.x,g.y)[0],h.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[p].concat(p.children)))}finally{h.getModel().endUpdate()}h.setSelectionCell(p);h.scrollCellToVisible(h.getSelectionCell())}}else{for(var B=function(a){var b=F[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,F[a]=b,q.push(b));return b},F={},q=[],l=0;l<f.length;l++)if(";"!=f[l].charAt(0)){var I=f[l].split("->");if(2<=I.length){var n=B(I[0]),A=B(I[I.length-1]),I=new mxCell(2<I.length?I[1]:"",new mxGeometry);I.edge=!0;n.insertEdge(I,!0);A.insertEdge(I,
|
||||
p.vertex=!0;e=h.getPreferredSizeForCell(p);null!=e&&p.geometry.width<e.width+10&&(p.geometry.width=e.width+10);A=[p];if(1<f.length)for(l=1;l<f.length;l++)"--"==f[l]?(e=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),e.vertex=!0,p.geometry.height+=e.geometry.height,p.insert(e),A.push(e)):0<f[l].length&&";"!=f[l].charAt(0)&&(k=new mxCell(f[l],
|
||||
new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),k.vertex=!0,e=h.getPreferredSizeForCell(k),null!=e&&k.geometry.width<e.width&&(k.geometry.width=e.width),p.geometry.width=Math.max(p.geometry.width,k.geometry.width),p.geometry.height+=k.geometry.height,p.insert(k),A.push(k));h.getModel().beginUpdate();try{p=h.importCells([p],g.x,g.y)[0],h.fireEvent(new mxEventObject("cellsInserted",
|
||||
"cells",[p].concat(p.children)))}finally{h.getModel().endUpdate()}h.setSelectionCell(p);h.scrollCellToVisible(h.getSelectionCell())}}else{for(var A=function(a){var b=G[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,G[a]=b,q.push(b));return b},G={},q=[],l=0;l<f.length;l++)if(";"!=f[l].charAt(0)){var I=f[l].split("->");if(2<=I.length){var n=A(I[0]),B=A(I[I.length-1]),I=new mxCell(2<I.length?I[1]:"",new mxGeometry);I.edge=!0;n.insertEdge(I,!0);B.insertEdge(I,
|
||||
!1);q.push(I)}}if(0<q.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);h=new Graph(f);h.getModel().beginUpdate();try{q=h.importCells(q);for(l=0;l<q.length;l++)h.getModel().isVertex(q[l])&&(e=h.getPreferredSizeForCell(q[l]),q[l].geometry.width=Math.max(q[l].geometry.width,e.width),q[l].geometry.height=Math.max(q[l].geometry.height,e.height));p=new mxFastOrganicLayout(h);p.disableEdgeStyle=!1;p.forceConstant=120;p.execute(h.getDefaultParent());k=new mxParallelEdgeLayout(h);
|
||||
k.spacing=20;k.execute(h.getDefaultParent())}finally{h.getModel().endUpdate()}h.clearCellOverlays();B=[];a.editor.graph.getModel().beginUpdate();try{B=a.editor.graph.importCells(h.getModel().getChildren(h.getDefaultParent()),g.x,g.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",B))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(B);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());h.destroy();f.parentNode.removeChild(f)}}}function e(){return"list"==
|
||||
k.spacing=20;k.execute(h.getDefaultParent())}finally{h.getModel().endUpdate()}h.clearCellOverlays();A=[];a.editor.graph.getModel().beginUpdate();try{A=a.editor.graph.importCells(h.getModel().getChildren(h.getDefaultParent()),g.x,g.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",A))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(A);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());h.destroy();f.parentNode.removeChild(f)}}}function e(){return"list"==
|
||||
l.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean":"table"==l.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==l.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":
|
||||
"plantUmlSvg"==l.value||"plantUmlTxt"==l.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var g=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height=
|
||||
"354px";k.style.marginBottom="16px";var l=document.createElement("select");"formatSql"==b&&(l.style.display="none");var n=document.createElement("option");n.setAttribute("value","list");mxUtils.write(n,mxResources.get("list"));"plantUml"!=b&&l.appendChild(n);null!=b&&"fromText"!=b||n.setAttribute("selected","selected");n=document.createElement("option");n.setAttribute("value","table");mxUtils.write(n,mxResources.get("formatSql"));"formatSql"==b&&(l.appendChild(n),n.setAttribute("selected","selected"));
|
||||
n=document.createElement("option");n.setAttribute("value","diagram");mxUtils.write(n,mxResources.get("diagram"));"plantUml"!=b&&l.appendChild(n);n=document.createElement("option");n.setAttribute("value","plantUmlSvg");mxUtils.write(n,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==b&&n.setAttribute("selected","selected");var f=document.createElement("option");f.setAttribute("value","plantUmlPng");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+
|
||||
")");var h=document.createElement("option");h.setAttribute("value","plantUmlTxt");mxUtils.write(h,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(l.appendChild(n),l.appendChild(f),l.appendChild(h));var m=e();k.value=m;c.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();
|
||||
a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var b=new FileReader;b.onload=function(a){k.value=a.target.result};b.readAsText(a)}},!1));c.appendChild(l);mxEvent.addListener(l,"change",function(){var a=e();if(0==k.value.length||k.value==m)m=a,k.value=m});b=mxUtils.button(mxResources.get("close"),function(){k.value==m?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("insert"),
|
||||
function(){a.hideDialog();d(k.value,l.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,e,g,k,l,n,f,h,m,p,q,t){function v(){var a=!0;if(null!=P)for(;B<P.length&&(a||0!=mxUtils.mod(B,30));)a=P[B++],w(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview),a=!1}function x(){if(Z)b||a.hideDialog(),q(Z,Y,H.value);else if(d)b||a.hideDialog(),d(Q,H.value);else{var c=H.value;
|
||||
null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,Q,null!=T&&0<T.length?T:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function u(a,b,c,f,h){null!=S&&(S.style.backgroundColor="transparent",S.style.border="1px solid transparent");F.removeAttribute("disabled");Q=b;T=c;S=a;Z=f;Y=h;S.style.backgroundColor=l;S.style.border=n}function w(b,c,f,h,d,m,e,g,p){var q=document.createElement("div");q.className="geTemplate";
|
||||
q.style.height=R+"px";q.style.width=L+"px";null!=h&&0<h.length&&q.setAttribute("title",h);if(null!=m)q.style.backgroundImage="url("+m+")",q.style.backgroundSize="contain",q.style.backgroundPosition="center center",q.style.backgroundRepeat="no-repeat",mxEvent.addListener(q,"click",function(a){u(q,null,null,b,e)}),mxEvent.addListener(q,"dblclick",function(a){x()});else if(null!=b&&0<b.length){f=p||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";q.style.backgroundImage="url("+f+")";q.style.backgroundPosition=
|
||||
"center center";q.style.backgroundRepeat="no-repeat";var E=!1;mxEvent.addListener(q,"click",function(f){F.setAttribute("disabled","disabled");q.style.backgroundColor="transparent";q.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;mxUtils.get(f,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(u(q,a.getText(),c),E&&x())}))});mxEvent.addListener(q,"dblclick",function(a){E=!0})}else q.innerHTML=
|
||||
'<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",d&&u(q),null!=g?mxEvent.addListener(q,"click",g):(mxEvent.addListener(q,"click",function(a){u(q)}),mxEvent.addListener(q,"dblclick",function(a){x()}));N.appendChild(q)}function E(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(v(),mxEvent.consume(a))});var a=null,b;for(b in U){var c=document.createElement("div"),h=mxResources.get(b),
|
||||
function(){a.hideDialog();d(k.value,l.value)});c.appendChild(n);n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(b);this.container=c},NewDialog=function(a,c,b,d,e,g,k,l,n,f,h,m,p,q,t,v){function x(){var a=!0;if(null!=P)for(;G<P.length&&(a||0!=mxUtils.mod(G,30));)a=P[G++],D(a.url,a.libs,a.title,a.tooltip?a.tooltip:a.title,a.select,a.imgUrl,a.info,a.onClick,a.preview),a=!1}function u(){if(Z)b||a.hideDialog(),q(Z,Y,A.value);else if(d)b||a.hideDialog(),d(Q,A.value);else{var c=A.value;
|
||||
null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.createFile(c,Q,null!=T&&0<T.length?T:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function w(a,b,c,f,h){null!=S&&(S.style.backgroundColor="transparent",S.style.border="1px solid transparent");I.removeAttribute("disabled");Q=b;T=c;S=a;Z=f;Y=h;S.style.backgroundColor=l;S.style.border=n}function D(b,c,f,h,d,m,e,g,p){var q=document.createElement("div");q.className="geTemplate";
|
||||
q.style.height=R+"px";q.style.width=L+"px";null!=h&&0<h.length&&q.setAttribute("title",h);if(null!=m)q.style.backgroundImage="url("+m+")",q.style.backgroundSize="contain",q.style.backgroundPosition="center center",q.style.backgroundRepeat="no-repeat",mxEvent.addListener(q,"click",function(a){w(q,null,null,b,e)}),mxEvent.addListener(q,"dblclick",function(a){u()});else if(null!=b&&0<b.length){f=p||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";q.style.backgroundImage="url("+f+")";q.style.backgroundPosition=
|
||||
"center center";q.style.backgroundRepeat="no-repeat";var D=!1;mxEvent.addListener(q,"click",function(f){I.setAttribute("disabled","disabled");q.style.backgroundColor="transparent";q.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;mxUtils.get(f,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(w(q,a.getText(),c),D&&u())}))});mxEvent.addListener(q,"dblclick",function(a){D=!0})}else q.innerHTML=
|
||||
'<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",d&&w(q),null!=g?mxEvent.addListener(q,"click",g):(mxEvent.addListener(q,"click",function(a){w(q)}),mxEvent.addListener(q,"dblclick",function(a){u()}));N.appendChild(q)}function E(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(x(),mxEvent.consume(a))});var a=null,b;for(b in U){var c=document.createElement("div"),h=mxResources.get(b),
|
||||
d=U[b];null==h&&(h=b.substring(0,1).toUpperCase()+b.substring(1));18<h.length&&(h=h.substring(0,18)+"…");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";c.setAttribute("title",h+" ("+d.length+")");mxUtils.write(c,c.getAttribute("title"));null!=f&&(c.style.padding=f);X.appendChild(c);null==a&&(a=c,a.style.backgroundColor=k);(function(b,f){mxEvent.addListener(c,"click",function(){a!=f&&(a.style.backgroundColor=
|
||||
"",a=f,a.style.backgroundColor=k,N.scrollTop=0,N.innerHTML="",B=0,P=U[b],A=null,v())})})(b,c)}v()}b=null!=b?b:!0;e=null!=e?e:!1;k=null!=k?k:"#ebf2f9";l=null!=l?l:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";h=null!=h?h:EditorUi.templateFile;var C=document.createElement("div");C.style.height="100%";var y=document.createElement("div");y.style.whiteSpace="nowrap";y.style.height="46px";b&&C.appendChild(y);var z=document.createElement("img");z.setAttribute("border","0");z.setAttribute("align","absmiddle");
|
||||
z.style.width="40px";z.style.height="40px";z.style.marginRight="10px";z.style.paddingBottom="4px";z.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&y.appendChild(z);
|
||||
b&&mxUtils.write(y,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");z=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?z=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?z=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?z=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?z=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(z=a.trello.extension);var H=document.createElement("input");
|
||||
H.setAttribute("value",a.defaultFilename+z);H.style.marginRight="20px";H.style.marginLeft="10px";H.style.width=c?"220px":"430px";this.init=function(){b&&(H.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?H.select():document.execCommand("selectAll",!1,null))};b&&y.appendChild(H);var y=!1,B=0,F=mxUtils.button(mxResources.get("create"),function(){F.setAttribute("disabled","disabled");x();F.removeAttribute("disabled")});F.className="geBtn gePrimaryBtn";if(m||p){var I=
|
||||
[],A=null,D=function(a){F.setAttribute("disabled","disabled");for(var b=0;b<I.length;b++)I[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},y=!0,z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="30px";C.appendChild(z);var G=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){X.style.display="";N.style.left="160px";D(0);N.scrollTop=0;N.innerHTML="";B=0;A!=P&&(P=A,v(),A=null)});I.push(G);z.appendChild(G);var M=function(a){X.style.display="none";N.style.left=
|
||||
"30px";D(a?-1:1);null==A&&(A=P);N.scrollTop=0;N.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(N);B=0;var c=function(a,c){b.stop();P=a;c?N.innerHTML=c:0==a.length?N.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(N.innerHTML="",v())};a?p(K.value,c):m(c)};m&&(G=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){M()}),z.appendChild(G),I.push(G));if(p){G=
|
||||
document.createElement("span");G.style.marginLeft="10px";G.innerHTML=mxResources.get("search")+":";z.appendChild(G);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(a){13==a.keyCode&&M(!0)});z.appendChild(K);G=mxUtils.button(mxResources.get("search"),function(){M(!0)});G.className="geBtn";z.appendChild(G)}D(0)}var T=null,Q=null,S=null,Z=null,Y=null,N=document.createElement("div");N.style.border=
|
||||
"1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";y=(b?72:40)+(y?30:0);N.style.top=y+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var X=document.createElement("div");X.style.cssText="position:absolute;left:30px;width:128px;top:"+y+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var R=140,L=140,U={},O=1;U.basic=[{title:"blankDiagram",select:!0}];var P=U.basic;if(!c){C.appendChild(X);
|
||||
C.appendChild(N);var V=!1;/^https?:\/\//.test(h)&&!a.isCorsEnabledForUrl(h)&&(h=PROXY_URL+"?url="+encodeURIComponent(h));mxUtils.get(h,function(a){if(!V){V=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=U[c];null==b&&(O++,b=[],U[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),
|
||||
preview:a.getAttribute("preview")})}}a=a.nextSibling}E()}})}mxEvent.addListener(H,"keypress",function(b){a.dialog.container.firstChild==C&&13==b.keyCode&&x()});h=document.createElement("div");h.style.marginTop=c?"4px":"16px";h.style.textAlign="right";h.style.position="absolute";h.style.left="40px";h.style.bottom="24px";h.style.right="40px";y=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g();a.hideDialog(!0)});y.className="geBtn";!a.editor.cancelFirst||e&&null==g||h.appendChild(y);c||
|
||||
a.isOffline()||!b||null!=d||e||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",h.appendChild(z));c||"1"==urlParams.embed||e||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(H.value)+"&create="+encodeURIComponent(b)),
|
||||
null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),c.className="geBtn",h.appendChild(c));Graph.fileSupport&&t&&(t=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",h.appendChild(t));h.appendChild(F);
|
||||
a.editor.cancelFirst||null!=d||e&&null==g||h.appendChild(y);C.appendChild(h);this.container=C},CreateDialog=function(a,c,b,d,e,g,k,l,n,f,h,m,p,q,t){function v(b,f,h,d){function u(){mxEvent.addListener(e,"click",function(){var b=h;if(k){var f=w.value,d=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>d){var b=null!=b?b:y.value,m="";b==App.MODE_GOOGLE?m=a.drive.extension:b==App.MODE_GITHUB?m=a.gitHub.extension:b==App.MODE_TRELLO?m=a.trello.extension:b==App.MODE_DROPBOX?m=a.dropbox.extension:b==App.MODE_ONEDRIVE?
|
||||
"",a=f,a.style.backgroundColor=k,N.scrollTop=0,N.innerHTML="",G=0,P=U[b],C=null,x())})})(b,c)}x()}b=null!=b?b:!0;e=null!=e?e:!1;k=null!=k?k:"#ebf2f9";l=null!=l?l:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";h=null!=h?h:EditorUi.templateFile;var y=document.createElement("div");y.style.height="100%";var z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="46px";b&&y.appendChild(z);var F=document.createElement("img");F.setAttribute("border","0");F.setAttribute("align","absmiddle");
|
||||
F.style.width="40px";F.style.height="40px";F.style.marginRight="10px";F.style.paddingBottom="4px";F.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&z.appendChild(F);
|
||||
b&&mxUtils.write(z,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");F=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?F=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?F=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?F=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?F=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(F=a.trello.extension);var A=document.createElement("input");
|
||||
A.setAttribute("value",a.defaultFilename+F);A.style.marginRight="20px";A.style.marginLeft="10px";A.style.width=c?"220px":"430px";this.init=function(){b&&(A.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",!1,null))};b&&z.appendChild(A);var z=!1,G=0,I=mxUtils.button(v||mxResources.get("create"),function(){I.setAttribute("disabled","disabled");u();I.removeAttribute("disabled")});I.className="geBtn gePrimaryBtn";if(m||p){var B=
|
||||
[],C=null,H=function(a){I.setAttribute("disabled","disabled");for(var b=0;b<B.length;b++)B[b].className=b==a?"geBtn gePrimaryBtn":"geBtn"},z=!0;v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";y.appendChild(v);F=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){X.style.display="";N.style.left="160px";H(0);N.scrollTop=0;N.innerHTML="";G=0;C!=P&&(P=C,x(),C=null)});B.push(F);v.appendChild(F);var M=function(a){X.style.display="none";N.style.left=
|
||||
"30px";H(a?-1:1);null==C&&(C=P);N.scrollTop=0;N.innerHTML="";var b=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});b.spin(N);G=0;var c=function(a,c){b.stop();P=a;c?N.innerHTML=c:0==a.length?N.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):(N.innerHTML="",x())};a?p(K.value,c):m(c)};m&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){M()}),v.appendChild(F),B.push(F));if(p){F=
|
||||
document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxResources.get("search")+":";v.appendChild(F);var K=document.createElement("input");K.style.marginRight="10px";K.style.marginLeft="10px";K.style.width="220px";mxEvent.addListener(K,"keypress",function(a){13==a.keyCode&&M(!0)});v.appendChild(K);F=mxUtils.button(mxResources.get("search"),function(){M(!0)});F.className="geBtn";v.appendChild(F)}H(0)}var T=null,Q=null,S=null,Z=null,Y=null,N=document.createElement("div");N.style.border=
|
||||
"1px solid #d3d3d3";N.style.position="absolute";N.style.left="160px";N.style.right="34px";z=(b?72:40)+(z?30:0);N.style.top=z+"px";N.style.bottom="68px";N.style.margin="6px 0 0 -1px";N.style.padding="6px";N.style.overflow="auto";var X=document.createElement("div");X.style.cssText="position:absolute;left:30px;width:128px;top:"+z+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var R=140,L=140,U={},O=1;U.basic=[{title:"blankDiagram",select:!0}];var P=U.basic;if(!c){y.appendChild(X);
|
||||
y.appendChild(N);var V=!1;/^https?:\/\//.test(h)&&!a.isCorsEnabledForUrl(h)&&(h=PROXY_URL+"?url="+encodeURIComponent(h));mxUtils.get(h,function(a){if(!V){V=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=a.getAttribute("section");null==c&&(c=b.indexOf("/"),c=b.substring(0,c));b=U[c];null==b&&(O++,b=[],U[c]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),
|
||||
preview:a.getAttribute("preview")})}}a=a.nextSibling}E()}})}mxEvent.addListener(A,"keypress",function(b){a.dialog.container.firstChild==y&&13==b.keyCode&&u()});h=document.createElement("div");h.style.marginTop=c?"4px":"16px";h.style.textAlign="right";h.style.position="absolute";h.style.left="40px";h.style.bottom="24px";h.style.right="40px";z=mxUtils.button(mxResources.get("cancel"),function(){null!=g&&g();a.hideDialog(!0)});z.className="geBtn";!a.editor.cancelFirst||e&&null==g||h.appendChild(z);c||
|
||||
a.isOffline()||!b||null!=d||e||(v=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),v.className="geBtn",h.appendChild(v));c||"1"==urlParams.embed||e||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(A.value)+"&create="+encodeURIComponent(b)),
|
||||
null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}),c.className="geBtn",h.appendChild(c));Graph.fileSupport&&t&&(t=mxUtils.button(mxResources.get("import"),function(){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0)});b.click()}),t.className="geBtn",h.appendChild(t));h.appendChild(I);
|
||||
a.editor.cancelFirst||null!=d||e&&null==g||h.appendChild(z);y.appendChild(h);this.container=y},CreateDialog=function(a,c,b,d,e,g,k,l,n,f,h,m,p,q,t){function v(b,f,h,d){function u(){mxEvent.addListener(e,"click",function(){var b=h;if(k){var f=w.value,d=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>d){var b=null!=b?b:y.value,m="";b==App.MODE_GOOGLE?m=a.drive.extension:b==App.MODE_GITHUB?m=a.gitHub.extension:b==App.MODE_TRELLO?m=a.trello.extension:b==App.MODE_DROPBOX?m=a.dropbox.extension:b==App.MODE_ONEDRIVE?
|
||||
m=a.oneDrive.extension:b==App.MODE_DEVICE&&(m=".xml");0<=d&&(f=f.substring(0,d));w.value=f+m}}x(h)})}var e=document.createElement("a");e.style.overflow="hidden";var g=document.createElement("img");g.src=b;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.className="geBaseButton";e.style.position="relative";e.style.margin="4px";e.style.padding="8px 8px 10px 8px";
|
||||
e.style.whiteSpace="nowrap";e.appendChild(g);mxClient.IS_QUIRKS&&(e.style.cssFloat="left",e.style.zoom="1");e.style.color="gray";e.style.fontSize="11px";var p=document.createElement("div");e.appendChild(p);mxUtils.write(p,f);if(null!=d&&null==a[d]){g.style.visibility="hidden";mxUtils.setOpacity(p,10);var q=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});q.spin(e);var t=window.setTimeout(function(){null==a[d]&&(q.stop(),
|
||||
e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[d]&&(window.clearTimeout(t),mxUtils.setOpacity(p,100),g.style.visibility="",q.stop(),u())}))}else u();E.appendChild(e);++C==m&&(mxUtils.br(E),C=0)}function x(c){var f=w.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}k=null!=k?k:!0;l=null!=l?l:!0;m=null!=m?m:4;g=document.createElement("div");null==d&&a.addLanguageMenu(g);var u=document.createElement("h2");mxUtils.write(u,e||mxResources.get("create"));
|
||||
e.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[d]&&(window.clearTimeout(t),mxUtils.setOpacity(p,100),g.style.visibility="",q.stop(),u())}))}else u();D.appendChild(e);++E==m&&(mxUtils.br(D),E=0)}function x(c){var f=w.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}k=null!=k?k:!0;l=null!=l?l:!0;m=null!=m?m:4;g=document.createElement("div");null==d&&a.addLanguageMenu(g);var u=document.createElement("h2");mxUtils.write(u,e||mxResources.get("create"));
|
||||
u.style.marginTop="0px";u.style.marginBottom="24px";g.appendChild(u);mxUtils.write(g,mxResources.get("filename")+":");var w=document.createElement("input");w.setAttribute("value",c);w.style.width="280px";w.style.marginLeft="10px";w.style.marginBottom="20px";this.init=function(){w.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?w.select():document.execCommand("selectAll",!1,null)};g.appendChild(w);null!=p&&null!=q&&"image/"==q.substring(0,6)&&(w.style.width="160px",
|
||||
e=null,"image/svg+xml"==q&&mxClient.IS_SVG?(e=document.createElement("div"),e.innerHTML=mxUtils.trim(p),p=e.getElementsByTagName("svg")[0],q=parseInt(p.getAttribute("width")),t=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+q+" "+t),p.setAttribute("width","120px"),p.setAttribute("height","80px")):(e=document.createElement("img"),e.setAttribute("src","data:"+q+(t?";base64,":";utf8,")+p)),e.style.position="absolute",e.style.top="70px",e.style.right="100px",e.style.maxWidth="120px",
|
||||
e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),g.appendChild(e),n&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){x("_blank")})));mxUtils.br(g);var E=document.createElement("div");E.style.textAlign="center";var C=0;E.style.marginTop="6px";g.appendChild(E);var y=document.createElement("select");y.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),
|
||||
e.style.maxHeight="80px",mxUtils.setPrefixedStyle(e.style,"transform","translate(50%,-50%)"),g.appendChild(e),n&&Editor.popupsAllowed&&(e.style.cursor="pointer",mxEvent.addListener(e,"click",function(){x("_blank")})));mxUtils.br(g);var D=document.createElement("div");D.style.textAlign="center";var E=0;D.style.marginTop="6px";g.appendChild(D);var y=document.createElement("select");y.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),
|
||||
p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),y.appendChild(p),v(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(p,mxResources.get("oneDrive")),y.appendChild(p),a.mode==App.MODE_ONEDRIVE&&p.setAttribute("selected","selected"),v(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),
|
||||
App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(p,mxResources.get("dropbox")),y.appendChild(p),a.mode==App.MODE_DROPBOX&&p.setAttribute("selected","selected"),v(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITHUB),mxUtils.write(p,mxResources.get("github")),y.appendChild(p),
|
||||
v(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.trello&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_TRELLO),mxUtils.write(p,mxResources.get("trello")),y.appendChild(p),v(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(p=document.createElement("option"),p.setAttribute("value",App.MODE_DEVICE),mxUtils.write(p,mxResources.get("device")),
|
||||
|
@ -7614,23 +7614,23 @@ c.appendChild(n);b=document.createElement("div");b.style.marginTop="26px";b.styl
|
|||
var RevisionDialog=function(a,c,b){var d=document.createElement("div"),e=document.createElement("h3");e.style.marginTop="0px";mxUtils.write(e,mxResources.get("revisionHistory"));d.appendChild(e);var g=document.createElement("div");g.style.position="absolute";g.style.overflow="auto";g.style.width="170px";g.style.height="378px";d.appendChild(g);var k=document.createElement("div");k.style.position="absolute";k.style.border="1px solid lightGray";k.style.left="199px";k.style.width="470px";k.style.height=
|
||||
"376px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);d.appendChild(k);var l=new Graph(k);l.setTooltips(!1);l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;var n=0,f=null,h=0,m=l.getGlobalVariable;l.getGlobalVariable=function(a){return"page"==a&&null!=f&&null!=f[h]?f[h].getAttribute("name"):"pagenumber"==a?h+1:m.apply(this,arguments)};l.getLinkForCell=function(){return null};
|
||||
Editor.MathJaxRender&&l.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(l.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),q=a.getCurrentFile(),t=null,v=null,x=null,u=null,w=mxUtils.button("",function(){null!=x&&l.zoomIn()});w.className="geSprite geSprite-zoomin";w.setAttribute("title",
|
||||
mxResources.get("zoomIn"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var E=mxUtils.button("",function(){null!=x&&l.zoomOut()});E.className="geSprite geSprite-zoomout";E.setAttribute("title",mxResources.get("zoomOut"));E.style.outline="none";E.style.border="none";E.style.margin="2px";E.setAttribute("disabled","disabled");mxUtils.setOpacity(E,20);var C=mxUtils.button("",function(){null!=x&&(l.maxFitScale=8,l.fit(8),
|
||||
l.center())});C.className="geSprite geSprite-fit";C.setAttribute("title",mxResources.get("fit"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var y=mxUtils.button("",function(){null!=x&&(l.zoomActual(),l.center())});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");
|
||||
mxUtils.setOpacity(y,20);var z=document.createElement("div");z.style.position="absolute";z.style.textAlign="right";z.style.color="gray";z.style.marginTop="10px";z.style.backgroundColor="transparent";z.style.top="440px";z.style.right="32px";z.style.maxWidth="380px";z.style.cursor="default";var H=mxUtils.button(mxResources.get("download"),function(){if(null!=x){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(x.documentElement);a.isLocalFileSave()?
|
||||
a.saveLocalFile(c,b,"text/xml"):(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});H.className="geBtn";H.setAttribute("disabled","disabled");var B=mxUtils.button(mxResources.get("restore"),function(){null!=x&&null!=u&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(u):a.spinner.spin(document.body,mxResources.get("restoring"))&&
|
||||
q.save(!0,function(b){a.spinner.stop();a.replaceFileData(u);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});B.className="geBtn";B.setAttribute("disabled","disabled");var F=document.createElement("select");F.setAttribute("disabled","disabled");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";var I=null;mxEvent.addListener(F,
|
||||
"change",function(a){null!=I&&(I(a),mxEvent.consume(a))});var A=mxUtils.button(mxResources.get("open"),function(){null!=x&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(x.documentElement)),a.openLink(a.getUrl(),null,!0))});A.className="geBtn";A.setAttribute("disabled","disabled");null!=b&&(A.style.display="none");var D=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl(F.selectedIndex))});D.className="geBtn gePrimaryBtn";
|
||||
D.setAttribute("disabled","disabled");null!=b&&(D.style.display="none",B.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var G=document.createElement("div");G.className="geToolbarContainer";G.style.backgroundColor="transparent";G.style.padding="2px";G.style.border="none";G.style.left="199px";G.style.top="442px";var M=null;if(null!=c&&0<c.length){k.style.cursor="move";var K=document.createElement("table");
|
||||
mxResources.get("zoomIn"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var D=mxUtils.button("",function(){null!=x&&l.zoomOut()});D.className="geSprite geSprite-zoomout";D.setAttribute("title",mxResources.get("zoomOut"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var E=mxUtils.button("",function(){null!=x&&(l.maxFitScale=8,l.fit(8),
|
||||
l.center())});E.className="geSprite geSprite-fit";E.setAttribute("title",mxResources.get("fit"));E.style.outline="none";E.style.border="none";E.style.margin="2px";E.setAttribute("disabled","disabled");mxUtils.setOpacity(E,20);var y=mxUtils.button("",function(){null!=x&&(l.zoomActual(),l.center())});y.className="geSprite geSprite-actualsize";y.setAttribute("title",mxResources.get("actualSize"));y.style.outline="none";y.style.border="none";y.style.margin="2px";y.setAttribute("disabled","disabled");
|
||||
mxUtils.setOpacity(y,20);var z=document.createElement("div");z.style.position="absolute";z.style.textAlign="right";z.style.color="gray";z.style.marginTop="10px";z.style.backgroundColor="transparent";z.style.top="440px";z.style.right="32px";z.style.maxWidth="380px";z.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=x){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(x.documentElement);a.isLocalFileSave()?
|
||||
a.saveLocalFile(c,b,"text/xml"):(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var A=mxUtils.button(mxResources.get("restore"),function(){null!=x&&null!=u&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(u):a.spinner.spin(document.body,mxResources.get("restoring"))&&
|
||||
q.save(!0,function(b){a.spinner.stop();a.replaceFileData(u);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});A.className="geBtn";A.setAttribute("disabled","disabled");var G=document.createElement("select");G.setAttribute("disabled","disabled");G.style.maxWidth="80px";G.style.position="relative";G.style.top="-2px";G.style.verticalAlign="bottom";G.style.marginRight="6px";G.style.display="none";var I=null;mxEvent.addListener(G,
|
||||
"change",function(a){null!=I&&(I(a),mxEvent.consume(a))});var B=mxUtils.button(mxResources.get("open"),function(){null!=x&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(x.documentElement)),a.openLink(a.getUrl(),null,!0))});B.className="geBtn";B.setAttribute("disabled","disabled");null!=b&&(B.style.display="none");var C=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl(G.selectedIndex))});C.className="geBtn gePrimaryBtn";
|
||||
C.setAttribute("disabled","disabled");null!=b&&(C.style.display="none",A.className="geBtn gePrimaryBtn");e=document.createElement("div");e.style.position="absolute";e.style.top="482px";e.style.width="640px";e.style.textAlign="right";var H=document.createElement("div");H.className="geToolbarContainer";H.style.backgroundColor="transparent";H.style.padding="2px";H.style.border="none";H.style.left="199px";H.style.top="442px";var M=null;if(null!=c&&0<c.length){k.style.cursor="move";var K=document.createElement("table");
|
||||
K.style.border="1px solid lightGray";K.style.borderCollapse="collapse";K.style.borderSpacing="0px";K.style.width="100%";var T=document.createElement("tbody"),Q=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var S=c.length-1;0<=S;S--){var Z=function(b){var d=new Date(b.modifiedDate),m=null;if(0<=d.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),g=a.editor.extractGraphModel(e.documentElement,!0);if(null!=g){var t=function(b){null!=
|
||||
b&&(b=v(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};F.style.display="none";F.innerHTML="";x=e;u=c;f=parseSelectFunction=null;h=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");f=[];for(c=0;c<e.length;c++)f.push(e[c]);
|
||||
h=Math.min(n,f.length-1);0<f.length&&t(f[h]);if(1<f.length)for(F.removeAttribute("disabled"),F.style.display="",c=0;c<f.length;c++)e=document.createElement("option"),mxUtils.write(e,f[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==h&&e.setAttribute("selected","selected"),F.appendChild(e);I=function(){h=n=parseInt(F.value);t(f[n])}}else v(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");z.innerHTML="";mxUtils.write(z,(null!=
|
||||
c?c+" ":"")+d.toLocaleDateString()+" "+d.toLocaleTimeString());z.setAttribute("title",m.getAttribute("title"));w.removeAttribute("disabled");E.removeAttribute("disabled");C.removeAttribute("disabled");y.removeAttribute("disabled");null!=q&&q.isRestricted()||(a.editor.graph.isEnabled()&&B.removeAttribute("disabled"),H.removeAttribute("disabled"),D.removeAttribute("disabled"),A.removeAttribute("disabled"));mxUtils.setOpacity(w,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(C,60);mxUtils.setOpacity(y,
|
||||
60)}else F.style.display="none",F.innerHTML="",z.innerHTML="",mxUtils.write(z,mxResources.get("errorLoadingFile"))},m=document.createElement("tr");m.style.borderBottom="1px solid lightGray";m.style.fontSize="12px";m.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):d.toDateString()===Q?mxUtils.write(g,d.toLocaleTimeString()):mxUtils.write(g,d.toLocaleDateString()+" "+d.toLocaleTimeString());
|
||||
m.appendChild(g);m.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(m,"click",function(a){v!=b&&(p.stop(),null!=t&&(t.style.backgroundColor=""),v=b,t=m,t.style.backgroundColor="#ebf2f9",u=x=null,z.removeAttribute("title"),z.innerHTML=mxResources.get("loading")+"...",k.style.backgroundColor="#ffffff",l.getModel().clear(),B.setAttribute("disabled","disabled"),
|
||||
H.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(w,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(C,20),mxUtils.setOpacity(y,20),p.spin(k),b.getXml(function(a){v==b&&e(a)},function(a){p.stop();F.style.display="none";F.innerHTML=
|
||||
"";z.innerHTML="";mxUtils.write(z,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(m,"dblclick",function(a){D.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);T.appendChild(m)}return m}(c[S]);null!=Z&&S==c.length-1&&(M=Z)}K.appendChild(T);g.appendChild(K)}else null==q||null==a.drive&&q.constructor==window.DriveFile||null==a.dropbox&&q.constructor==window.DropboxFile?(k.style.display=
|
||||
"none",G.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(k.style.display="none",G.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";G.appendChild(F);G.appendChild(w);G.appendChild(E);G.appendChild(y);G.appendChild(C);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(H),e.appendChild(A),e.appendChild(B),e.appendChild(D)):(e.appendChild(H),
|
||||
e.appendChild(A),e.appendChild(B),e.appendChild(D),e.appendChild(g));d.appendChild(e);d.appendChild(G);d.appendChild(z);this.container=d},DraftDialog=function(a,c,b,d,e,g,k,l){var n=document.createElement("div"),f=document.createElement("div");f.style.marginTop="0px";f.style.whiteSpace="nowrap";f.style.overflow="auto";mxUtils.write(f,c);n.appendChild(f);var h=document.createElement("div");h.style.position="absolute";h.style.border="1px solid lightGray";h.style.marginTop="10px";h.style.width="640px";
|
||||
b&&(b=v(mxUtils.parseXml(a.editor.graph.decompress(mxUtils.getTextContent(b))).documentElement));return b},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,l.getModel());l.maxFitScale=1;l.fit(8);l.center();return a};G.style.display="none";G.innerHTML="";x=e;u=c;f=parseSelectFunction=null;h=0;if("mxfile"==g.nodeName){e=g.getElementsByTagName("diagram");f=[];for(c=0;c<e.length;c++)f.push(e[c]);
|
||||
h=Math.min(n,f.length-1);0<f.length&&t(f[h]);if(1<f.length)for(G.removeAttribute("disabled"),G.style.display="",c=0;c<f.length;c++)e=document.createElement("option"),mxUtils.write(e,f[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==h&&e.setAttribute("selected","selected"),G.appendChild(e);I=function(){h=n=parseInt(G.value);t(f[n])}}else v(g);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"...");z.innerHTML="";mxUtils.write(z,(null!=
|
||||
c?c+" ":"")+d.toLocaleDateString()+" "+d.toLocaleTimeString());z.setAttribute("title",m.getAttribute("title"));w.removeAttribute("disabled");D.removeAttribute("disabled");E.removeAttribute("disabled");y.removeAttribute("disabled");null!=q&&q.isRestricted()||(a.editor.graph.isEnabled()&&A.removeAttribute("disabled"),F.removeAttribute("disabled"),C.removeAttribute("disabled"),B.removeAttribute("disabled"));mxUtils.setOpacity(w,60);mxUtils.setOpacity(D,60);mxUtils.setOpacity(E,60);mxUtils.setOpacity(y,
|
||||
60)}else G.style.display="none",G.innerHTML="",z.innerHTML="",mxUtils.write(z,mxResources.get("errorLoadingFile"))},m=document.createElement("tr");m.style.borderBottom="1px solid lightGray";m.style.fontSize="12px";m.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):d.toDateString()===Q?mxUtils.write(g,d.toLocaleTimeString()):mxUtils.write(g,d.toLocaleDateString()+" "+d.toLocaleTimeString());
|
||||
m.appendChild(g);m.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString()+" "+a.formatFileSize(parseInt(b.fileSize))+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(m,"click",function(a){v!=b&&(p.stop(),null!=t&&(t.style.backgroundColor=""),v=b,t=m,t.style.backgroundColor="#ebf2f9",u=x=null,z.removeAttribute("title"),z.innerHTML=mxResources.get("loading")+"...",k.style.backgroundColor="#ffffff",l.getModel().clear(),A.setAttribute("disabled","disabled"),
|
||||
F.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),D.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),mxUtils.setOpacity(w,20),mxUtils.setOpacity(D,20),mxUtils.setOpacity(E,20),mxUtils.setOpacity(y,20),p.spin(k),b.getXml(function(a){v==b&&e(a)},function(a){p.stop();G.style.display="none";G.innerHTML=
|
||||
"";z.innerHTML="";mxUtils.write(z,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(m,"dblclick",function(a){C.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);T.appendChild(m)}return m}(c[S]);null!=Z&&S==c.length-1&&(M=Z)}K.appendChild(T);g.appendChild(K)}else null==q||null==a.drive&&q.constructor==window.DriveFile||null==a.dropbox&&q.constructor==window.DropboxFile?(k.style.display=
|
||||
"none",H.style.display="none",mxUtils.write(g,mxResources.get("notAvailable"))):(k.style.display="none",H.style.display="none",mxUtils.write(g,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};g=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.className="geBtn";H.appendChild(G);H.appendChild(w);H.appendChild(D);H.appendChild(y);H.appendChild(E);a.editor.cancelFirst?(e.appendChild(g),e.appendChild(F),e.appendChild(B),e.appendChild(A),e.appendChild(C)):(e.appendChild(F),
|
||||
e.appendChild(B),e.appendChild(A),e.appendChild(C),e.appendChild(g));d.appendChild(e);d.appendChild(H);d.appendChild(z);this.container=d},DraftDialog=function(a,c,b,d,e,g,k,l){var n=document.createElement("div"),f=document.createElement("div");f.style.marginTop="0px";f.style.whiteSpace="nowrap";f.style.overflow="auto";mxUtils.write(f,c);n.appendChild(f);var h=document.createElement("div");h.style.position="absolute";h.style.border="1px solid lightGray";h.style.marginTop="10px";h.style.width="640px";
|
||||
h.style.top="46px";h.style.bottom="74px";h.style.overflow="hidden";mxEvent.disableContextMenu(h);n.appendChild(h);var m=new Graph(h);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;c=mxUtils.parseXml(b);var p=a.editor.extractGraphModel(c.documentElement,!0),q=0,t=null,v=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=t&&null!=t[q]?t[q].getAttribute("name"):
|
||||
"pagenumber"==a?q+1:v.apply(this,arguments)};m.getLinkForCell=function(){return null};c=mxUtils.button("",function(){m.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);b=mxUtils.button("",function(){m.zoomOut()});b.className="geSprite geSprite-zoomout";b.setAttribute("title",mxResources.get("zoomOut"));b.style.outline="none";b.style.border="none";b.style.margin=
|
||||
"2px";mxUtils.setOpacity(b,60);f=mxUtils.button("",function(){m.maxFitScale=8;m.fit(8);m.center()});f.className="geSprite geSprite-fit";f.setAttribute("title",mxResources.get("fit"));f.style.outline="none";f.style.border="none";f.style.margin="2px";mxUtils.setOpacity(f,60);var x=mxUtils.button("",function(){m.zoomActual();m.center()});x.className="geSprite geSprite-actualsize";x.setAttribute("title",mxResources.get("actualSize"));x.style.outline="none";x.style.border="none";x.style.margin="2px";mxUtils.setOpacity(x,
|
||||
|
@ -7662,8 +7662,8 @@ null!=p&&(p.style.backgroundColor="");p=c;p.style.backgroundColor="dark"==uiThem
|
|||
b.style.paddingRight="16px";b.style.color="gray";b.style.left="0px";b.style.right="0px";b.style.bottom="0px";b.style.height="60px";b.style.lineHeight="52px";mxClient.IS_QUIRKS&&(b.style.width=n.style.width,b.style.paddingTop="12px");var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)n=document.createElement("span"),n.style.paddingRight="20px",n.appendChild(v),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),v.checked=!0,v.defaultChecked=
|
||||
!0,mxEvent.addListener(n,"click",function(a){mxEvent.getSource(a)!=v&&(v.checked=!v.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(n.style.position="relative",n.style.top="-6px"),b.appendChild(n);n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var b=[],c=0;c<q.length;c++){var f=q[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(b.join(";"),v.checked,!0)});c.className=
|
||||
"geBtn gePrimaryBtn"}else{var x=document.createElement("table"),n=document.createElement("tbody");d.style.height="100%";d.style.overflow="auto";l=document.createElement("tr");x.style.width="100%";c=document.createElement("td");var e=document.createElement("td"),k=document.createElement("td"),u=mxUtils.bind(this,function(b,c,f){var h=document.createElement("input");h.type="checkbox";x.appendChild(h);h.checked=a.sidebar.isEntryVisible(f);var d=document.createElement("span");mxUtils.write(d,c);c=document.createElement("div");
|
||||
c.style.display="block";c.appendChild(h);c.appendChild(d);mxEvent.addListener(d,"click",function(a){h.checked=!h.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return h.checked?f:null}});l.appendChild(c);l.appendChild(e);l.appendChild(k);n.appendChild(l);x.appendChild(n);for(var q=[],w=0,g=0;g<b.length;g++)for(n=0;n<b[g].entries.length;n++)w++;for(var E=[c,e,k],C=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];q.push(u(E[Math.floor(C/(w/3))],
|
||||
c.title,c.id));C++}})(b[g]);d.appendChild(x);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=!0,b.appendChild(v),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),mxEvent.addListener(n,"click",function(a){v.checked=!v.checked;mxEvent.consume(a)}));d.appendChild(b);n=mxUtils.button(mxResources.get("cancel"),
|
||||
c.style.display="block";c.appendChild(h);c.appendChild(d);mxEvent.addListener(d,"click",function(a){h.checked=!h.checked;mxEvent.consume(a)});b.appendChild(c);return function(){return h.checked?f:null}});l.appendChild(c);l.appendChild(e);l.appendChild(k);n.appendChild(l);x.appendChild(n);for(var q=[],w=0,g=0;g<b.length;g++)for(n=0;n<b[g].entries.length;n++)w++;for(var D=[c,e,k],E=0,g=0;g<b.length;g++)(function(a){for(var b=0;b<a.entries.length;b++){var c=a.entries[b];q.push(u(D[Math.floor(E/(w/3))],
|
||||
c.title,c.id));E++}})(b[g]);d.appendChild(x);b=document.createElement("div");b.style.marginTop="18px";b.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type","checkbox"),v.checked=!0,v.defaultChecked=!0,b.appendChild(v),n=document.createElement("span"),mxUtils.write(n," "+mxResources.get("rememberThisSetting")),b.appendChild(n),mxEvent.addListener(n,"click",function(a){v.checked=!v.checked;mxEvent.consume(a)}));d.appendChild(b);n=mxUtils.button(mxResources.get("cancel"),
|
||||
function(){a.hideDialog()});n.className="geBtn";c=mxUtils.button(mxResources.get("apply"),function(){for(var b=["search"],c=0;c<q.length;c++){var f=q[c].apply(this,arguments);null!=f&&b.push(f)}a.sidebar.showEntries(0<b.length?b.join(";"):"",v.checked);a.hideDialog()});c.className="geBtn gePrimaryBtn";b=document.createElement("div");b.style.marginTop="26px";b.style.textAlign="right"}a.editor.cancelFirst?(b.appendChild(n),b.appendChild(c)):(b.appendChild(c),b.appendChild(n));d.appendChild(b);this.container=
|
||||
d},PluginsDialog=function(a){function c(){if(0==e.length)d.innerHTML=mxResources.get("noPlugins");else{d.innerHTML="";for(var b=0;b<e.length;b++){var f=document.createElement("span");f.style.whiteSpace="nowrap";var g=document.createElement("span");g.className="geSprite geSprite-delete";g.style.position="relative";g.style.cursor="pointer";g.style.top="5px";g.style.marginRight="4px";g.style.display="inline-block";f.appendChild(g);mxUtils.write(f,e[b]);d.appendChild(f);mxUtils.br(d);mxEvent.addListener(g,
|
||||
"click",function(b){return function(){a.confirm(window.parent.mxResources.get("delete")+' "'+e[b]+'"?',function(){e.splice(b,1);c()})}}(b))}}}var b=document.createElement("div"),d=document.createElement("div");d.style.height="120px";d.style.overflow="auto";var e=mxSettings.getPlugins().slice();b.appendChild(d);c();var g=mxUtils.button(mxResources.get("add"),function(){var b="",f=urlParams.p;if(null!=f&&0<f.length){for(var d=f.split(";"),f=0;f<d.length;f++){var g=App.pluginRegistry[d[f]];null!=g&&
|
||||
|
@ -7684,32 +7684,32 @@ document.createElement("input");x.setAttribute("type","text");x.style.width="100
|
|||
f.appendChild(u);l.appendChild(n);l.appendChild(f);k.appendChild(l);g.appendChild(k);e.appendChild(g);d=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});d.className="geBtn";var w=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();try{for(var f=0;f<c.length;f++){var d=b.getCellGeometry(c[f]);null!=d&&(d=d.clone(),b.isCellMovable(c[f])&&(d.relative=h.checked,0<mxUtils.trim(m.value).length&&(d.x=Number(m.value)),0<mxUtils.trim(p.value).length&&
|
||||
(d.y=Number(p.value)),0<mxUtils.trim(q.value).length&&(null==d.offset&&(d.offset=new mxPoint),d.offset.x=Number(q.value)),0<mxUtils.trim(t.value).length&&(null==d.offset&&(d.offset=new mxPoint),d.offset.y=Number(t.value))),b.isCellResizable(c[f])&&(0<mxUtils.trim(v.value).length&&(d.width=Number(v.value)),0<mxUtils.trim(x.value).length&&(d.height=Number(x.value))),b.getModel().setGeometry(c[f],d));0<mxUtils.trim(u.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(u.value),[c[f]])}}finally{b.getModel().endUpdate()}});
|
||||
w.className="geBtn gePrimaryBtn";mxEvent.addListener(e,"keypress",function(a){13==a.keyCode&&w.click()});g=document.createElement("div");g.style.marginTop="20px";g.style.textAlign="right";a.editor.cancelFirst?(g.appendChild(d),g.appendChild(w)):(g.appendChild(w),g.appendChild(d));e.appendChild(g);this.container=e},LibraryDialog=function(a,c,b,d,e,g){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=q;)a=a.parentNode;var b=null;if(null!=a)for(var c=q.firstChild,
|
||||
b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function l(b,c,f,d,m,e,g,u,p){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==v[b]){var n=function(){G.innerHTML="";G.style.cursor="pointer";G.style.whiteSpace="nowrap";G.style.textOverflow="ellipsis";mxUtils.write(G,null!=K.title&&0<K.title.length?K.title:mxResources.get("untitled"));G.style.color=null==K.title||0==K.title.length?"#d0d0d0":""};q.style.backgroundImage="";t.style.display="none";var y=m,z=e;if(m>a.maxImageSize||e>
|
||||
a.maxImageSize){var A=Math.min(1,Math.min(a.maxImageSize/Math.max(1,m)),a.maxImageSize/Math.max(1,e));m*=A;e*=A}y>z?(z=Math.round(100*z/y),y=100):(y=Math.round(100*y/z),z=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var F=document.createElement("img");F.setAttribute("src",E.convert(b));
|
||||
F.style.width=y+"px";F.style.height=z+"px";F.style.margin="10px";F.style.paddingBottom=Math.floor((100-z)/2)+"px";F.style.paddingLeft=Math.floor((100-y)/2)+"px";H.appendChild(F)}else if(null!=g){var D=a.stringToCells(a.editor.graph.decompress(g.xml));0<D.length&&(a.sidebar.createThumb(D,100,100,H,null,!0,!1),H.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",H.firstChild.style.cursor="")}var B=document.createElement("img");B.setAttribute("src",Editor.closeImage);B.setAttribute("border",
|
||||
"0");B.setAttribute("title",mxResources.get("delete"));B.setAttribute("align","top");B.style.paddingTop="4px";B.style.position="absolute";B.style.marginLeft="-12px";B.style.zIndex="1";B.style.cursor="pointer";mxEvent.addListener(B,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(B,"click",function(f){v[b]=null;for(var d=0;d<h.length;d++)if(null!=h[d].data&&h[d].data==b||null!=h[d].xml&&null!=c&&h[d].xml==c.xml){h.splice(d,1);break}H.parentNode.removeChild(a);0==h.length&&
|
||||
(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(f)});mxEvent.addListener(B,"dblclick",function(a){mxEvent.consume(a)})})(H,b,g);H.appendChild(B);H.style.marginBottom="30px";var G=document.createElement("div");G.style.position="absolute";G.style.boxSizing="border-box";G.style.bottom="-18px";G.style.left="10px";G.style.right="10px";G.style.backgroundColor="#ffffff";G.style.overflow="hidden";G.style.textAlign="center";var K=null;null!=b?(K={data:b,
|
||||
w:m,h:e,title:p},null!=u&&(K.aspect=u),v[b]=F,h.push(K)):null!=g&&(g.aspect="fixed",h.push(g),K=g);mxEvent.addListener(G,"keydown",function(a){13==a.keyCode&&null!=w&&(w(),w=null,mxEvent.consume(a))});n();H.appendChild(G);mxEvent.addListener(G,"mousedown",function(a){"true"!=G.getAttribute("contentEditable")&&mxEvent.consume(a)});D=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,K.title||"",mxResources.get("ok"),
|
||||
function(a){null!=a&&(K.title=a,n())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=G.getAttribute("contentEditable")){null!=w&&(w(),w=null);if(null==K.title||0==K.title.length)G.innerHTML="";G.style.textOverflow="";G.style.whiteSpace="";G.style.cursor="text";G.style.color="";G.setAttribute("contentEditable","true");G.focus();document.execCommand("selectAll",!1,null);w=function(){G.removeAttribute("contentEditable");G.style.cursor=
|
||||
"pointer";K.title=G.innerHTML;n()};mxEvent.consume(b)}};mxEvent.addListener(G,"click",D);mxEvent.addListener(H,"dblclick",D);q.appendChild(H);mxEvent.addListener(H,"dragstart",function(a){null==b&&null!=g&&(B.style.visibility="hidden",G.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.xml);x=k(a);mxClient.IS_GC&&(H.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(H.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(H,30);B.style.visibility=
|
||||
"";G.style.visibility=""},0)});mxEvent.addListener(H,"dragend",function(a){"hidden"==B.style.visibility&&(B.style.visibility="",G.style.visibility="");x=null;mxUtils.setOpacity(H,100);mxUtils.setPrefixedStyle(H.style,"transform",null)})}else C||(C=!0,a.handleError({message:mxResources.get("fileExists")}));else{m=!1;try{if(a.spinner.stop(),y=mxUtils.parseXml(b),"mxlibrary"==y.documentElement.nodeName){z=JSON.parse(mxUtils.getTextContent(y.documentElement));if(null!=z&&0<z.length)for(var M=0;M<z.length;M++)null!=
|
||||
z[M].xml?l(null,null,0,0,0,0,z[M]):l(z[M].data,null,0,0,z[M].w,z[M].h,null,"fixed",z[M].title);m=!0}else if("mxfile"==y.documentElement.nodeName){for(var I=y.documentElement.getElementsByTagName("diagram"),M=0;M<I.length;M++){var z=mxUtils.getTextContent(I[M]),D=a.stringToCells(a.editor.graph.decompress(z)),V=a.editor.graph.getBoundingBoxFromGeometry(D);l(null,null,0,0,0,0,{xml:z,w:V.width,h:V.height})}m=!0}}catch(ba){}m||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}
|
||||
function n(a){a.dataTransfer.dropEffect=null!=x?"move":"copy";a.stopPropagation();a.preventDefault()}function f(b){b.stopPropagation();b.preventDefault();C=!1;u=k(b);if(null!=x)null!=u&&u<q.children.length?(h.splice(u>x?u-1:u,0,h.splice(x,1)[0]),q.insertBefore(q.children[x],q.children[u])):(h.push(h.splice(x,1)[0]),q.appendChild(q.children[x]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,y(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=
|
||||
b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function l(b,c,f,d,m,e,u,g,p){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=u||null==v[b]){var n=function(){H.innerHTML="";H.style.cursor="pointer";H.style.whiteSpace="nowrap";H.style.textOverflow="ellipsis";mxUtils.write(H,null!=K.title&&0<K.title.length?K.title:mxResources.get("untitled"));H.style.color=null==K.title||0==K.title.length?"#d0d0d0":""};q.style.backgroundImage="";t.style.display="none";var y=m,z=e;if(m>a.maxImageSize||e>
|
||||
a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,m)),a.maxImageSize/Math.max(1,e));m*=B;e*=B}y>z?(z=Math.round(100*z/y),y=100):(y=Math.round(100*y/z),z=100);var F=document.createElement("div");F.setAttribute("draggable","true");F.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";F.style.position="relative";F.style.cursor="move";mxUtils.setPrefixedStyle(F.style,"transition","transform .1s ease-in-out");if(null!=b){var G=document.createElement("img");G.setAttribute("src",D.convert(b));
|
||||
G.style.width=y+"px";G.style.height=z+"px";G.style.margin="10px";G.style.paddingBottom=Math.floor((100-z)/2)+"px";G.style.paddingLeft=Math.floor((100-y)/2)+"px";F.appendChild(G)}else if(null!=u){var C=a.stringToCells(a.editor.graph.decompress(u.xml));0<C.length&&(a.sidebar.createThumb(C,100,100,F,null,!0,!1),F.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",F.firstChild.style.cursor="")}var A=document.createElement("img");A.setAttribute("src",Editor.closeImage);A.setAttribute("border",
|
||||
"0");A.setAttribute("title",mxResources.get("delete"));A.setAttribute("align","top");A.style.paddingTop="4px";A.style.position="absolute";A.style.marginLeft="-12px";A.style.zIndex="1";A.style.cursor="pointer";mxEvent.addListener(A,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(A,"click",function(f){v[b]=null;for(var d=0;d<h.length;d++)if(null!=h[d].data&&h[d].data==b||null!=h[d].xml&&null!=c&&h[d].xml==c.xml){h.splice(d,1);break}F.parentNode.removeChild(a);0==h.length&&
|
||||
(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(f)});mxEvent.addListener(A,"dblclick",function(a){mxEvent.consume(a)})})(F,b,u);F.appendChild(A);F.style.marginBottom="30px";var H=document.createElement("div");H.style.position="absolute";H.style.boxSizing="border-box";H.style.bottom="-18px";H.style.left="10px";H.style.right="10px";H.style.backgroundColor="#ffffff";H.style.overflow="hidden";H.style.textAlign="center";var K=null;null!=b?(K={data:b,
|
||||
w:m,h:e,title:p},null!=g&&(K.aspect=g),v[b]=G,h.push(K)):null!=u&&(u.aspect="fixed",h.push(u),K=u);mxEvent.addListener(H,"keydown",function(a){13==a.keyCode&&null!=w&&(w(),w=null,mxEvent.consume(a))});n();F.appendChild(H);mxEvent.addListener(H,"mousedown",function(a){"true"!=H.getAttribute("contentEditable")&&mxEvent.consume(a)});C=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,K.title||"",mxResources.get("ok"),
|
||||
function(a){null!=a&&(K.title=a,n())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!=H.getAttribute("contentEditable")){null!=w&&(w(),w=null);if(null==K.title||0==K.title.length)H.innerHTML="";H.style.textOverflow="";H.style.whiteSpace="";H.style.cursor="text";H.style.color="";H.setAttribute("contentEditable","true");H.focus();document.execCommand("selectAll",!1,null);w=function(){H.removeAttribute("contentEditable");H.style.cursor=
|
||||
"pointer";K.title=H.innerHTML;n()};mxEvent.consume(b)}};mxEvent.addListener(H,"click",C);mxEvent.addListener(F,"dblclick",C);q.appendChild(F);mxEvent.addListener(F,"dragstart",function(a){null==b&&null!=u&&(A.style.visibility="hidden",H.style.visibility="hidden");mxClient.IS_FF&&null!=u.xml&&a.dataTransfer.setData("Text",u.xml);x=k(a);mxClient.IS_GC&&(F.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(F.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(F,30);A.style.visibility=
|
||||
"";H.style.visibility=""},0)});mxEvent.addListener(F,"dragend",function(a){"hidden"==A.style.visibility&&(A.style.visibility="",H.style.visibility="");x=null;mxUtils.setOpacity(F,100);mxUtils.setPrefixedStyle(F.style,"transform",null)})}else E||(E=!0,a.handleError({message:mxResources.get("fileExists")}));else{m=!1;try{if(a.spinner.stop(),y=mxUtils.parseXml(b),"mxlibrary"==y.documentElement.nodeName){z=JSON.parse(mxUtils.getTextContent(y.documentElement));if(null!=z&&0<z.length)for(var M=0;M<z.length;M++)null!=
|
||||
z[M].xml?l(null,null,0,0,0,0,z[M]):l(z[M].data,null,0,0,z[M].w,z[M].h,null,"fixed",z[M].title);m=!0}else if("mxfile"==y.documentElement.nodeName){for(var I=y.documentElement.getElementsByTagName("diagram"),M=0;M<I.length;M++){var z=mxUtils.getTextContent(I[M]),C=a.stringToCells(a.editor.graph.decompress(z)),V=a.editor.graph.getBoundingBoxFromGeometry(C);l(null,null,0,0,0,0,{xml:z,w:V.width,h:V.height})}m=!0}}catch(ba){}m||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){}return null}
|
||||
function n(a){a.dataTransfer.dropEffect=null!=x?"move":"copy";a.stopPropagation();a.preventDefault()}function f(b){b.stopPropagation();b.preventDefault();E=!1;u=k(b);if(null!=x)null!=u&&u<q.children.length?(h.splice(u>x?u-1:u,0,h.splice(x,1)[0]),q.insertBefore(q.children[x],q.children[u])):(h.push(h.splice(x,1)[0]),q.appendChild(q.children[x]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,y(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=
|
||||
decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){l(c,null,0,0,a.width,a.height);q.scrollTop=q.scrollHeight})}b.stopPropagation();b.preventDefault()}var h=[];b=document.createElement("div");b.style.height="100%";var m=document.createElement("div");m.style.whiteSpace="nowrap";m.style.height="40px";b.appendChild(m);mxUtils.write(m,mxResources.get("filename")+
|
||||
":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft="10px";p.style.width="500px";null==e||e.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==e||e.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};m.appendChild(p);var q=document.createElement("div");q.style.borderWidth=
|
||||
"1px 0px 1px 0px";q.style.borderColor="#d3d3d3";q.style.borderStyle="solid";q.style.marginTop="6px";q.style.overflow="auto";q.style.height="340px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";0==h.length&&Graph.fileSupport&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";
|
||||
mxUtils.write(t,mxResources.get("dragImagesHere"));b.appendChild(t);var v={},x=null,u=null,w=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=w&&(w(),w=null,mxEvent.consume(a))};mxEvent.addListener(q,"mousedown",c);mxEvent.addListener(q,"pointerdown",c);mxEvent.addListener(q,"touchstart",c);var E=new mxUrlConverter,C=!1;if(null!=d)for(c=0;c<d.length;c++)m=d[c],l(m.data,null,0,0,m.w,m.h,m,m.aspect,m.title);mxEvent.addListener(q,"dragleave",function(a){t.style.cursor=
|
||||
"";for(var b=mxEvent.getSource(a);null!=b;){if(b==q||b==t){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var y=function(b){return function(c,f,d,h,m,e,g,u,p){null!=p&&(/(\.vsdx)($|\?)/i.test(p.name)||/(\.vssx)($|\?)/i.test(p.name))?a.importVisio(p,mxUtils.bind(this,function(c){a.spinner.stop();l(c,f,d,h,m,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," "))})):null!=p&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,p.name)?
|
||||
a.parseFile(p,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(l(c.responseText,f,d,h,m,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight))})):(l(c,f,d,h,m,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight)}};mxEvent.addListener(q,"dragover",n);mxEvent.addListener(q,"drop",f);mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,
|
||||
mxUtils.write(t,mxResources.get("dragImagesHere"));b.appendChild(t);var v={},x=null,u=null,w=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=w&&(w(),w=null,mxEvent.consume(a))};mxEvent.addListener(q,"mousedown",c);mxEvent.addListener(q,"pointerdown",c);mxEvent.addListener(q,"touchstart",c);var D=new mxUrlConverter,E=!1;if(null!=d)for(c=0;c<d.length;c++)m=d[c],l(m.data,null,0,0,m.w,m.h,m,m.aspect,m.title);mxEvent.addListener(q,"dragleave",function(a){t.style.cursor=
|
||||
"";for(var b=mxEvent.getSource(a);null!=b;){if(b==q||b==t){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var y=function(b){return function(c,f,d,h,m,e,u,g,p){null!=p&&(/(\.vsdx)($|\?)/i.test(p.name)||/(\.vssx)($|\?)/i.test(p.name))?a.importVisio(p,mxUtils.bind(this,function(c){a.spinner.stop();l(c,f,d,h,m,e,u,"fixed",mxEvent.isAltDown(b)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," "))})):null!=p&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,p.name)?
|
||||
a.parseFile(p,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(l(c.responseText,f,d,h,m,e,u,"fixed",mxEvent.isAltDown(b)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight))})):(l(c,f,d,h,m,e,u,"fixed",mxEvent.isAltDown(b)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight)}};mxEvent.addListener(q,"dragover",n);mxEvent.addListener(q,"drop",f);mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,
|
||||
"drop",f);b.appendChild(q);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);m=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(h),c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,
|
||||
"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});m.setAttribute("id","btnDownload");m.className="geBtn";d.appendChild(m);var z=document.createElement("input");z.setAttribute("multiple","multiple");z.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(z,"change",function(b){C=!1;a.importFiles(z.files,0,0,a.maxImageSize,function(a,c,f,d,h,m,e,g,u){y(b)(a,c,f,d,h,m,e,g,u);z.value=""});q.scrollTop=q.scrollHeight}),m=mxUtils.button(mxResources.get("import"),
|
||||
function(){null!=w&&(w(),w=null);z.click()}),m.setAttribute("id","btnAddImage"),m.className="geBtn",d.appendChild(m));m=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=w&&(w(),w=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){C=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}l(a,null,0,0,b,c);q.scrollTop=q.scrollHeight}})});m.setAttribute("id","btnAddImageUrl");m.className="geBtn";
|
||||
"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});m.setAttribute("id","btnDownload");m.className="geBtn";d.appendChild(m);var z=document.createElement("input");z.setAttribute("multiple","multiple");z.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(z,"change",function(b){E=!1;a.importFiles(z.files,0,0,a.maxImageSize,function(a,c,f,d,h,m,e,u,g){y(b)(a,c,f,d,h,m,e,u,g);z.value=""});q.scrollTop=q.scrollHeight}),m=mxUtils.button(mxResources.get("import"),
|
||||
function(){null!=w&&(w(),w=null);z.click()}),m.setAttribute("id","btnAddImage"),m.className="geBtn",d.appendChild(m));m=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=w&&(w(),w=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){E=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}l(a,null,0,0,b,c);q.scrollTop=q.scrollHeight}})});m.setAttribute("id","btnAddImageUrl");m.className="geBtn";
|
||||
d.appendChild(m);this.saveBtnClickHandler=function(b,c,f,d){a.saveLibrary(b,c,f,d)};m=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=w&&(w(),w=null);this.saveBtnClickHandler(p.value,h,e,g)}));m.setAttribute("id","btnSave");m.className="geBtn gePrimaryBtn";d.appendChild(m);a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,e){d=null!=d?d:300;e=null!=e?e:120;var g,k,l=document.createElement("table"),n=document.createElement("tbody");
|
||||
l.style.cellPadding="4px";g=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,b);g.appendChild(k);n.appendChild(g);g=document.createElement("tr");k=document.createElement("td");var f=document.createElement("textarea");f.style.outline="none";f.style.resize="none";f.style.width=d-200+"px";f.style.height=e+"px";this.textarea=f;this.init=function(){f.focus();f.scrollTop=0};k.appendChild(f);g.appendChild(k);k=document.createElement("td");
|
||||
b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=e+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);k.appendChild(b);var h=new Graph(b);h.setEnabled(!1);var m=a.editor.graph.cloneCell(c);h.addCells([m]);b=h.view.getState(m);var p="";null!=b.shape&&null!=b.shape.stencil&&(p=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(f,p||"");b=h.getGraphBounds();
|
||||
e=Math.min(160/b.width,(e-40)/b.height);h.view.scaleAndTranslate(e,20/e-b.x,20/e-b.y);g.appendChild(k);n.appendChild(g);g=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.paddingTop="2px";k.style.whiteSpace="nowrap";k.setAttribute("align","right");e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&k.appendChild(e);a.isOffline()||(b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
|
||||
b.className="geBtn",k.appendChild(b));var q=function(b,c,d){var h=f.value,m=mxUtils.parseXml(h),h=mxUtils.getPrettyXml(m.documentElement),m=m.documentElement.getElementsByTagName("parsererror");if(null!=m&&0<m.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(d&&a.hideDialog(),m=!b.model.contains(c),!d||m||h!=p){h=a.editor.graph.compress(h);b.getModel().beginUpdate();try{if(m){var e=a.editor.graph.getInsertPoint();c.geometry.x=e.x;
|
||||
c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+h+")",[c])}catch(C){throw C;}finally{b.getModel().endUpdate()}m&&b.setSelectionCell(c)}};b=mxUtils.button(mxResources.get("preview"),function(){q(h,m,!1)});b.className="geBtn";k.appendChild(b);b=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";k.appendChild(b);a.editor.cancelFirst||k.appendChild(e);g.appendChild(k);n.appendChild(g);l.appendChild(n);this.container=
|
||||
c.geometry.y=e.y;b.addCell(c)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+h+")",[c])}catch(E){throw E;}finally{b.getModel().endUpdate()}m&&b.setSelectionCell(c)}};b=mxUtils.button(mxResources.get("preview"),function(){q(h,m,!1)});b.className="geBtn";k.appendChild(b);b=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";k.appendChild(b);a.editor.cancelFirst||k.appendChild(e);g.appendChild(k);n.appendChild(g);l.appendChild(n);this.container=
|
||||
l},CustomDialog=function(a,c,b,d,e,g,k,l){var n=document.createElement("div");n.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=k&&c.appendChild(k);k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d()});k.className="geBtn";l&&(k.style.display="none");a.editor.cancelFirst&&c.appendChild(k);a.isOffline()||null==g||(l=mxUtils.button(mxResources.get("help"),function(){a.openLink(g)}),l.className="geBtn",c.appendChild(l));
|
||||
e=mxUtils.button(e||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(e);e.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(k);n.appendChild(c);this.cancelBtn=k;this.okButton=e;this.container=n},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+
|
||||
mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+mxResources.get("showAll",null,"+ Show all")+
|
||||
|
@ -7717,26 +7717,26 @@ mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLi
|
|||
mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">🛈 '+
|
||||
mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg";
|
||||
var a=window.innerWidth,b=window.innerHeight,d=987,e=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<e&&(e=Math.max(.9*b,300),c.style.height=e+"px");this.width=d;this.height=e;this.container=c};
|
||||
TemplatesDialog.prototype.init=function(a,c,b,d,e,g,k,l,n,f){function h(){null!=B&&(B.style.fontWeight="normal",B.style.textDecoration="none",B=null)}function m(a,b,c,f,d,h,m){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";y.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(m?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");y.querySelector("."+b).src="/images/"+c+"-sel.svg";y.querySelector("."+d).src="/images/"+
|
||||
TemplatesDialog.prototype.init=function(a,c,b,d,e,g,k,l,n,f){function h(){null!=A&&(A.style.fontWeight="normal",A.style.textDecoration="none",A=null)}function m(a,b,c,f,d,h,m){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";y.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(m?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");y.querySelector("."+b).src="/images/"+c+"-sel.svg";y.querySelector("."+d).src="/images/"+
|
||||
h+".svg";return!0}function p(a){function b(a){Y.removeChild(f);y.removeChild(c);Y.scrollTop=h}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";y.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var d=document.createElement("img");d.src=a;f.appendChild(d);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
|
||||
a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var h=Y.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);Y.appendChild(f);Y.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function q(a,b,c){if(null!=F){for(var f=F.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}F.className=f.join(" ")}null!=a?(F=a,F.className+=" "+b,I=c,L.className="geTempDlgCreateBtn"):(I=F=null,L.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
|
||||
a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var h=Y.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);Y.appendChild(f);Y.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function q(a,b,c){if(null!=G){for(var f=G.className.split(" "),d=0;d<f.length;d++)if(-1<f[d].indexOf("Active")){f.splice(d,1);break}G.className=f.join(" ")}null!=a?(G=a,G.className+=" "+b,I=c,L.className="geTempDlgCreateBtn"):(I=G=null,L.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
|
||||
function t(b){if(null!=I){var d=I;I=null;L.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";d.isExternal?(1==b?f(d.url,d,"nameInput.value"):n(d.url,d,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+d.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function v(a){a=a?"":"none";for(var b=y.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display=
|
||||
a}function x(a,b,c){function f(){L.innerHTML=b?mxResources.get("create"):mxResources.get("copy");v(!b)}Q.innerHTML="";q();M=a;var d=null;if(c){d=document.createElement("table");d.className="geTempDlgDiagramsListGrid";var h=document.createElement("tr"),m=document.createElement("th");m.style.width="50%";m.innerHTML=mxResources.get("diagram",null,"Diagram");h.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=mxResources.get("changedBy",null,"Changed By");h.appendChild(m);
|
||||
m=document.createElement("th");m.style.width="25%";m.innerHTML=mxResources.get("lastModifiedOn",null,"Last modified on");h.appendChild(m);d.appendChild(h);Q.appendChild(d)}for(h=0;h<a.length;h++){a[h].isExternal=!b;var e=a[h].url,m=mxUtils.htmlEntities(a[h].title),g=a[h].tooltip||a[h].title,u=a[h].imgUrl,k=mxUtils.htmlEntities(a[h].changedBy||""),E=mxUtils.htmlEntities(a[h].lastModifiedOn||"");u||(u=TEMPLATE_PATH+"/"+e.substring(0,e.length-4)+".png");e=c?50:15;null!=m&&m.length>e&&(m=m.substring(0,
|
||||
e)+"…");if(c){var w=document.createElement("tr"),u=document.createElement("td"),l=document.createElement("img");l.src="/images/icon-search.svg";l.className="geTempDlgDiagramListPreviewBtn";l.setAttribute("title",mxResources.get("preview"));u.appendChild(l);g=document.createElement("span");g.className="geTempDlgDiagramTitle";g.innerHTML=m;u.appendChild(g);w.appendChild(u);u=document.createElement("td");u.innerHTML=k;w.appendChild(u);u=document.createElement("td");u.innerHTML=E;w.appendChild(u);
|
||||
d.appendChild(w);null==F&&(f(),q(w,"geTempDlgDiagramsListGridActive",a[h]));(function(a,b){mxEvent.addListener(w,"click",function(){F!=b&&(f(),q(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(w,"dblclick",t);mxEvent.addListener(l,"click",function(){p(a)})})(a[h],w)}else{var C=document.createElement("div");C.className="geTempDlgDiagramTile";C.setAttribute("title",g);null==F&&(f(),q(C,"geTempDlgDiagramTileActive",a[h]));k=document.createElement("div");k.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";
|
||||
var n=document.createElement("img");n.style.display="none";(function(a,b){n.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};n.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(n,k);n.src=u;k.appendChild(n);C.appendChild(k);k=document.createElement("div");k.className="geTempDlgDiagramTileLbl";k.innerHTML=null!=m?m:"";C.appendChild(k);l=document.createElement("img");l.src="/images/icon-search.svg";l.className="geTempDlgDiagramPreviewBtn";
|
||||
l.setAttribute("title",mxResources.get("preview"));C.appendChild(l);(function(a,b){mxEvent.addListener(C,"click",function(){F!=b&&(f(),q(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(C,"dblclick",t);mxEvent.addListener(l,"click",function(){p(a)})})(a[h],C);Q.appendChild(C)}}}function u(a,b){R.innerHTML="";q();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory=!0;var h=document.createElement("div"),m=mxResources.get(d.title);null==m&&(m=d.title.substring(0,1).toUpperCase()+
|
||||
d.title.substring(1));h.className="geTempDlgNewDiagramCatItem";h.setAttribute("title",m);m=mxUtils.htmlEntities(m);15<m.length&&(m=m.substring(0,15)+"…");null==F&&(L.innerHTML=mxResources.get("create"),v(),q(h,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var g=document.createElement("img");g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);h.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";
|
||||
e.innerHTML=m;h.appendChild(e);R.appendChild(h);(function(a,b){mxEvent.addListener(h,"click",function(){F!=b&&(L.innerHTML=mxResources.get("create"),v(),q(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(h,"dblclick",t)})(d,h)}T.style.display=5>a.length?"none":""}function w(a){var b=y.querySelector(".geTemplatesList"),c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),h=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";
|
||||
f.setAttribute("title",d+" ("+h.length+")");d=mxUtils.htmlEntities(d);15<d.length&&(d=d.substring(0,15)+"…");f.innerHTML=d+" ("+h.length+")";b.appendChild(f);(function(b,c,d){mxEvent.addListener(f,"click",function(){B!=d&&(null!=B?(B.style.fontWeight="normal",B.style.textDecoration="none"):(X.style.display="none",N.style.minHeight="100%"),B=d,B.style.fontWeight="bold",B.style.textDecoration="underline",Y.scrollTop=0,z&&(H=!0),S.innerHTML=c,Z.style.display="none",x(a[b],!0))})})(c,d,f)}}function E(a){k&&
|
||||
(Y.scrollTop=0,Q.innerHTML="",U.spin(Q),H=!1,z=!0,S.innerHTML=mxResources.get("recentDiag",null,"Recent Diagrams"),K=null,k(ca,a?null:g))}function C(a){h();Y.scrollTop=0;Q.innerHTML="";U.spin(Q);H=!1;z=!0;W=null;S.innerHTML=mxResources.get("searchResults",null,"Search Results")+' "'+mxUtils.htmlEntities(a)+'"';l(a,ca,D?null:g);K=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";e=null!=e?e:NEW_DIAGRAM_CATS_PATH+"/index.xml";var y=this.container,z=!1,H=!1,B=null,F=null,I=null,A=!1,D=!0,G=!1,M=[],K,T=y.querySelector(".geTempDlgShowAllBtn"),
|
||||
m=document.createElement("th");m.style.width="25%";m.innerHTML=mxResources.get("lastModifiedOn",null,"Last modified on");h.appendChild(m);d.appendChild(h);Q.appendChild(d)}for(h=0;h<a.length;h++){a[h].isExternal=!b;var e=a[h].url,m=mxUtils.htmlEntities(a[h].title),u=a[h].tooltip||a[h].title,g=a[h].imgUrl,k=mxUtils.htmlEntities(a[h].changedBy||""),D=mxUtils.htmlEntities(a[h].lastModifiedOn||"");g||(g=TEMPLATE_PATH+"/"+e.substring(0,e.length-4)+".png");e=c?50:15;null!=m&&m.length>e&&(m=m.substring(0,
|
||||
e)+"…");if(c){var w=document.createElement("tr"),g=document.createElement("td"),l=document.createElement("img");l.src="/images/icon-search.svg";l.className="geTempDlgDiagramListPreviewBtn";l.setAttribute("title",mxResources.get("preview"));g.appendChild(l);u=document.createElement("span");u.className="geTempDlgDiagramTitle";u.innerHTML=m;g.appendChild(u);w.appendChild(g);g=document.createElement("td");g.innerHTML=k;w.appendChild(g);g=document.createElement("td");g.innerHTML=D;w.appendChild(g);
|
||||
d.appendChild(w);null==G&&(f(),q(w,"geTempDlgDiagramsListGridActive",a[h]));(function(a,b){mxEvent.addListener(w,"click",function(){G!=b&&(f(),q(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(w,"dblclick",t);mxEvent.addListener(l,"click",function(){p(a)})})(a[h],w)}else{var E=document.createElement("div");E.className="geTempDlgDiagramTile";E.setAttribute("title",u);null==G&&(f(),q(E,"geTempDlgDiagramTileActive",a[h]));k=document.createElement("div");k.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";
|
||||
var n=document.createElement("img");n.style.display="none";(function(a,b){n.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};n.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(n,k);n.src=g;k.appendChild(n);E.appendChild(k);k=document.createElement("div");k.className="geTempDlgDiagramTileLbl";k.innerHTML=null!=m?m:"";E.appendChild(k);l=document.createElement("img");l.src="/images/icon-search.svg";l.className="geTempDlgDiagramPreviewBtn";
|
||||
l.setAttribute("title",mxResources.get("preview"));E.appendChild(l);(function(a,b){mxEvent.addListener(E,"click",function(){G!=b&&(f(),q(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(E,"dblclick",t);mxEvent.addListener(l,"click",function(){p(a)})})(a[h],E);Q.appendChild(E)}}}function u(a,b){R.innerHTML="";q();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var d=a[f];d.isCategory=!0;var h=document.createElement("div"),m=mxResources.get(d.title);null==m&&(m=d.title.substring(0,1).toUpperCase()+
|
||||
d.title.substring(1));h.className="geTempDlgNewDiagramCatItem";h.setAttribute("title",m);m=mxUtils.htmlEntities(m);15<m.length&&(m=m.substring(0,15)+"…");null==G&&(L.innerHTML=mxResources.get("create"),v(),q(h,"geTempDlgNewDiagramCatItemActive",d));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var u=document.createElement("img");u.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(u);h.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";
|
||||
e.innerHTML=m;h.appendChild(e);R.appendChild(h);(function(a,b){mxEvent.addListener(h,"click",function(){G!=b&&(L.innerHTML=mxResources.get("create"),v(),q(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(h,"dblclick",t)})(d,h)}T.style.display=5>a.length?"none":""}function w(a){var b=y.querySelector(".geTemplatesList"),c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),h=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";
|
||||
f.setAttribute("title",d+" ("+h.length+")");d=mxUtils.htmlEntities(d);15<d.length&&(d=d.substring(0,15)+"…");f.innerHTML=d+" ("+h.length+")";b.appendChild(f);(function(b,c,d){mxEvent.addListener(f,"click",function(){A!=d&&(null!=A?(A.style.fontWeight="normal",A.style.textDecoration="none"):(X.style.display="none",N.style.minHeight="100%"),A=d,A.style.fontWeight="bold",A.style.textDecoration="underline",Y.scrollTop=0,z&&(F=!0),S.innerHTML=c,Z.style.display="none",x(a[b],!0))})})(c,d,f)}}function D(a){k&&
|
||||
(Y.scrollTop=0,Q.innerHTML="",U.spin(Q),F=!1,z=!0,S.innerHTML=mxResources.get("recentDiag",null,"Recent Diagrams"),K=null,k(ca,a?null:g))}function E(a){h();Y.scrollTop=0;Q.innerHTML="";U.spin(Q);F=!1;z=!0;W=null;S.innerHTML=mxResources.get("searchResults",null,"Search Results")+' "'+mxUtils.htmlEntities(a)+'"';l(a,ca,C?null:g);K=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";e=null!=e?e:NEW_DIAGRAM_CATS_PATH+"/index.xml";var y=this.container,z=!1,F=!1,A=null,G=null,I=null,B=!1,C=!0,H=!1,M=[],K,T=y.querySelector(".geTempDlgShowAllBtn"),
|
||||
Q=y.querySelector(".geTempDlgDiagramsTiles"),S=y.querySelector(".geTempDlgDiagramsListTitle"),Z=y.querySelector(".geTempDlgDiagramsListBtns"),Y=y.querySelector(".geTempDlgContent"),N=y.querySelector(".geTempDlgDiagramsList"),X=y.querySelector(".geTempDlgNewDiagramCat"),R=y.querySelector(".geTempDlgNewDiagramCatList"),L=y.querySelector(".geTempDlgCreateBtn"),U=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(y.querySelector(".geTempDlgNewDiagramlbl"),
|
||||
"click",function(){h();X.style.display="";N.style.minHeight="calc(100% - 280px)";E(D)});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){m(this,"geTempDlgAllDiagramsBtnImg","all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(D=!0,null==K?E(D):C(K))});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){m(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg",
|
||||
"all-diagrams",!0)&&(D=!1,null==K?E(D):C(K))});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){m(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg","tiles",!1)&&(G=!0,x(M,!1,G))});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){m(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(G=!1,x(M,!1,G))});mxEvent.addListener(T,"click",function(){A?(X.style.height="280px",
|
||||
R.style.height="190px",T.innerHTML=mxResources.get("showAll",null,"+ Show all"),u(ba)):(X.style.height="440px",R.style.height="355px",T.innerHTML=mxResources.get("showLess",null,"- Show less"),u(ba,!0));A=!A});var O=!1,P=!1,V={},ba=[],J=1;mxUtils.get(d,function(a){if(!O){O=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=V[b];null==c&&(J++,c=[],V[b]=c);c.push({url:a.getAttribute("url"),
|
||||
libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=a.nextSibling}w(V)}});mxUtils.get(e,function(a){if(!P){P=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ba.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;u(ba)}});var ca=function(a,b){Z.style.display="";U.stop();z=!1;H?H=!1:b?Q.innerHTML=
|
||||
b:0==a.length?Q.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):x(a,!1,G)};E(D);var W=null;l&&mxEvent.addListener(y.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=W&&clearTimeout(W);13==a.keyCode?C(b.value):W=setTimeout(function(){C(b.value)},500)});mxEvent.addListener(L,"click",t);mxEvent.addListener(y.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(y.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=
|
||||
"click",function(){h();X.style.display="";N.style.minHeight="calc(100% - 280px)";D(C)});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){m(this,"geTempDlgAllDiagramsBtnImg","all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(C=!0,null==K?D(C):E(K))});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){m(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg",
|
||||
"all-diagrams",!0)&&(C=!1,null==K?D(C):E(K))});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){m(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg","tiles",!1)&&(H=!0,x(M,!1,H))});mxEvent.addListener(y.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){m(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(H=!1,x(M,!1,H))});mxEvent.addListener(T,"click",function(){B?(X.style.height="280px",
|
||||
R.style.height="190px",T.innerHTML=mxResources.get("showAll",null,"+ Show all"),u(ba)):(X.style.height="440px",R.style.height="355px",T.innerHTML=mxResources.get("showLess",null,"- Show less"),u(ba,!0));B=!B});var O=!1,P=!1,V={},ba=[],J=1;mxUtils.get(d,function(a){if(!O){O=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=V[b];null==c&&(J++,c=[],V[b]=c);c.push({url:a.getAttribute("url"),
|
||||
libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=a.nextSibling}w(V)}});mxUtils.get(e,function(a){if(!P){P=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ba.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),title:a.getAttribute("title")}),a=a.nextSibling;u(ba)}});var ca=function(a,b){Z.style.display="";U.stop();z=!1;F?F=!1:b?Q.innerHTML=
|
||||
b:0==a.length?Q.innerHTML=mxResources.get("noDiagrams",null,"No Diagrams Found"):x(a,!1,H)};D(C);var W=null;l&&mxEvent.addListener(y.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=W&&clearTimeout(W);13==a.keyCode?E(b.value):W=setTimeout(function(){E(b.value)},500)});mxEvent.addListener(L,"click",t);mxEvent.addListener(y.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(y.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=
|
||||
b&&b();a.hideDialog(!0)})};(function(){Editor.prototype.appName="draw.io";Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
|
||||
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
|
||||
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
|
||||
|
@ -7804,23 +7804,23 @@ stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"
|
|||
font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[null,{fill:mxConstants.NONE,stroke:"#36393d"},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[null,{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",
|
||||
gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",
|
||||
stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,b,c){if(null!=b){var f=function(a){if(null!=a)if(c)for(var f=0;f<a.length;f++)b[a[f].name]=a[f];else for(var d in b){for(var h=!1,f=0;f<a.length;f++)if(a[f].name==d&&a[f].type==b[d].type){h=!0;break}h||delete b[d]}},d=this.editorUi.editor.graph.view.getState(a);null!=d&&null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=
|
||||
d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(B){}}};var h=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));
|
||||
d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(A){}}};var h=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));
|
||||
h.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,f=a.edges,d=0;d<c.length;d++)this.findCommonProperties(c[d],b,0==d);for(d=0;d<f.length;d++)this.findCommonProperties(f[d],b,0==c.length&&0==d);0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var m=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var b=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,
|
||||
function(a){this.editorUi.actions.get("copyStyle").funct()}));b.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";b.style.marginRight="2px";a.appendChild(b);b=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));b.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");
|
||||
b.style.marginBottom="2px";b.style.width="100px";a.appendChild(b);mxUtils.br(a);return m.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function f(a,b,c,f){q.getModel().beginUpdate();try{var d=[],h=[];if(null!=c.index){for(var m=[],e=c.parentRow.nextSibling;e&&e.getAttribute("data-pName")==a;)m.push(e.getAttribute("data-pValue")),e=e.nextSibling;c.index<m.length?null!=f?m.splice(f,1):m[c.index]=b:m.push(b);null!=c.size&&m.length>
|
||||
c.size&&(m=m.slice(0,c.size));b=m.join(",");null!=c.countProperty&&(q.setCellStyles(c.countProperty,m.length,q.getSelectionCells()),d.push(c.countProperty),h.push(m.length))}q.setCellStyles(a,b,q.getSelectionCells());d.push(a);h.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var g=c.dependentPropsDefVal[a],u=c.dependentPropsVals[a];if(u.length>b)u=u.slice(0,b);else for(var k=u.length;k<b;k++)u.push(g);u=u.join(",");q.setCellStyles(c.dependentProps[a],u,q.getSelectionCells());
|
||||
d.push(c.dependentProps[a]);h.push(u)}p.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",h,"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),h=mxUtils.getOffset(b,!0);c.style.position="absolute";c.style.left=h.x-d.x+"px";c.style.top=h.y-d.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:0)+"px";c.style.zIndex=5}function h(a,b,c){var d=document.createElement("div");d.style.width="32px";d.style.height=
|
||||
c.size&&(m=m.slice(0,c.size));b=m.join(",");null!=c.countProperty&&(q.setCellStyles(c.countProperty,m.length,q.getSelectionCells()),d.push(c.countProperty),h.push(m.length))}q.setCellStyles(a,b,q.getSelectionCells());d.push(a);h.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var u=c.dependentPropsDefVal[a],g=c.dependentPropsVals[a];if(g.length>b)g=g.slice(0,b);else for(var k=g.length;k<b;k++)g.push(u);g=g.join(",");q.setCellStyles(c.dependentProps[a],g,q.getSelectionCells());
|
||||
d.push(c.dependentProps[a]);h.push(g)}p.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",h,"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),h=mxUtils.getOffset(b,!0);c.style.position="absolute";c.style.left=h.x-d.x+"px";c.style.top=h.y-d.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:0)+"px";c.style.zIndex=5}function h(a,b,c){var d=document.createElement("div");d.style.width="32px";d.style.height=
|
||||
"4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(p,function(h){this.editorUi.pickColor(b,function(b){d.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+"')":b;f(a,b,c)});mxEvent.consume(h)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function m(a,b,c,d,h,m,e){null!=b&&(b=b.split(","),k.push({name:a,
|
||||
values:b,type:c,defVal:d,countProperty:h,parentRow:m,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(p,function(b){for(var g=m,p=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,p++;else break;var q={type:c,parentRow:m,index:p,isDeletable:!0,defVal:d,countProperty:h},p=u(a,"",q,0==p%2,e);f(a,d,q);g.parentNode.insertBefore(p,g.nextSibling);mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}
|
||||
function e(a,b,c,f,d,h,m){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var g=0;g<d;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";k.push({name:a,values:e,type:c,defVal:f,parentRow:h,flipBkg:m,size:d})}return document.createElement("div")}function g(a,b,c){var d=document.createElement("input");d.type="checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});return d}function u(b,c,u,q,k){var v=u.dispName,t=u.type,w=document.createElement("tr");w.className="gePropRow"+
|
||||
(k?"Dark":"")+(q?"Alt":"")+" gePropNonHeaderRow";w.setAttribute("data-pName",b);w.setAttribute("data-pValue",c);q=!1;null!=u.index&&(w.setAttribute("data-index",u.index),v=(null!=v?v:"")+"["+u.index+"]",q=!0);var l=document.createElement("td");l.className="gePropRowCell";l.innerHTML=mxUtils.htmlEntities(mxResources.get(v,null,v));q&&(l.style.textAlign="right");w.appendChild(l);l=document.createElement("td");l.className="gePropRowCell";if("color"==t)l.appendChild(h(b,c,u));else if("bool"==t||"boolean"==
|
||||
t)l.appendChild(g(b,c,u));else if("enum"==t){var n=u.enumList;for(k=0;k<n.length;k++)if(v=n[k],v.val==c){l.innerHTML=mxUtils.htmlEntities(mxResources.get(v.dispName,null,v.dispName));break}mxEvent.addListener(l,"click",mxUtils.bind(p,function(){var h=document.createElement("select");d(l,h);for(var m=0;m<n.length;m++){var e=n[m],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));h.appendChild(g)}h.value=
|
||||
c;a.appendChild(h);mxEvent.addListener(h,"change",function(){var a=mxUtils.htmlEntities(h.value);f(b,a,u)});h.focus();mxEvent.addListener(h,"blur",function(){a.removeChild(h)})}))}else"dynamicArr"==t?l.appendChild(m(b,c,u.subType,u.subDefVal,u.countProperty,w,k)):"staticArr"==t?l.appendChild(e(b,c,u.subType,u.subDefVal,u.size,w,k)):(l.innerHTML=c,mxEvent.addListener(l,"click",mxUtils.bind(p,function(){function h(){var a=m.value,a=0==a.length&&"string"!=t?0:a;u.allowAuto&&("auto"==a.trim().toLowerCase()?
|
||||
(a="auto",t="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=u.min&&a<u.min?a=u.min:null!=u.max&&a>u.max&&(a=u.max);a=mxUtils.htmlEntities(("int"==t?parseInt(a):a)+"");f(b,a,u)}var m=document.createElement("input");d(l,m,!0);m.value=c;m.className="gePropEditor";"int"!=t&&"float"!=t||u.allowAuto||(m.type="number",m.step="int"==t?"1":"any",null!=u.min&&(m.min=parseFloat(u.min)),null!=u.max&&(m.max=parseFloat(u.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&h()});
|
||||
m.focus();mxEvent.addListener(m,"blur",function(){h()})})));u.isDeletable&&(k=mxUtils.button("-",mxUtils.bind(p,function(a){f(b,"",u,u.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",l.appendChild(k));w.appendChild(l);return w}var p=this,q=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var t=document.createElement("table");t.style.whiteSpace="nowrap";t.style.width="100%";var v=document.createElement("tr");
|
||||
values:b,type:c,defVal:d,countProperty:h,parentRow:m,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(p,function(b){for(var u=m,p=0;null!=u.nextSibling;)if(u.nextSibling.getAttribute("data-pName")==a)u=u.nextSibling,p++;else break;var q={type:c,parentRow:m,index:p,isDeletable:!0,defVal:d,countProperty:h},p=g(a,"",q,0==p%2,e);f(a,d,q);u.parentNode.insertBefore(p,u.nextSibling);mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}
|
||||
function e(a,b,c,f,d,h,m){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var u=0;u<d;u++)e[u]=null!=b[u]?b[u]:null!=f?f:"";k.push({name:a,values:e,type:c,defVal:f,parentRow:h,flipBkg:m,size:d})}return document.createElement("div")}function u(a,b,c){var d=document.createElement("input");d.type="checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});return d}function g(b,c,g,q,k){var v=g.dispName,t=g.type,w=document.createElement("tr");w.className="gePropRow"+
|
||||
(k?"Dark":"")+(q?"Alt":"")+" gePropNonHeaderRow";w.setAttribute("data-pName",b);w.setAttribute("data-pValue",c);q=!1;null!=g.index&&(w.setAttribute("data-index",g.index),v=(null!=v?v:"")+"["+g.index+"]",q=!0);var l=document.createElement("td");l.className="gePropRowCell";l.innerHTML=mxUtils.htmlEntities(mxResources.get(v,null,v));q&&(l.style.textAlign="right");w.appendChild(l);l=document.createElement("td");l.className="gePropRowCell";if("color"==t)l.appendChild(h(b,c,g));else if("bool"==t||"boolean"==
|
||||
t)l.appendChild(u(b,c,g));else if("enum"==t){var n=g.enumList;for(k=0;k<n.length;k++)if(v=n[k],v.val==c){l.innerHTML=mxUtils.htmlEntities(mxResources.get(v.dispName,null,v.dispName));break}mxEvent.addListener(l,"click",mxUtils.bind(p,function(){var h=document.createElement("select");d(l,h);for(var m=0;m<n.length;m++){var e=n[m],u=document.createElement("option");u.value=mxUtils.htmlEntities(e.val);u.innerHTML=mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));h.appendChild(u)}h.value=
|
||||
c;a.appendChild(h);mxEvent.addListener(h,"change",function(){var a=mxUtils.htmlEntities(h.value);f(b,a,g)});h.focus();mxEvent.addListener(h,"blur",function(){a.removeChild(h)})}))}else"dynamicArr"==t?l.appendChild(m(b,c,g.subType,g.subDefVal,g.countProperty,w,k)):"staticArr"==t?l.appendChild(e(b,c,g.subType,g.subDefVal,g.size,w,k)):(l.innerHTML=c,mxEvent.addListener(l,"click",mxUtils.bind(p,function(){function h(){var a=m.value,a=0==a.length&&"string"!=t?0:a;g.allowAuto&&("auto"==a.trim().toLowerCase()?
|
||||
(a="auto",t="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=g.min&&a<g.min?a=g.min:null!=g.max&&a>g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==t?parseInt(a):a)+"");f(b,a,g)}var m=document.createElement("input");d(l,m,!0);m.value=c;m.className="gePropEditor";"int"!=t&&"float"!=t||g.allowAuto||(m.type="number",m.step="int"==t?"1":"any",null!=g.min&&(m.min=parseFloat(g.min)),null!=g.max&&(m.max=parseFloat(g.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&h()});
|
||||
m.focus();mxEvent.addListener(m,"blur",function(){h()})})));g.isDeletable&&(k=mxUtils.button("-",mxUtils.bind(p,function(a){f(b,"",g,g.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",l.appendChild(k));w.appendChild(l);return w}var p=this,q=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var t=document.createElement("table");t.style.whiteSpace="nowrap";t.style.width="100%";var v=document.createElement("tr");
|
||||
v.className="gePropHeader";var w=document.createElement("th");w.className="gePropHeaderCell";var l=document.createElement("img");l.src=Sidebar.prototype.expandedImage;w.appendChild(l);mxUtils.write(w,mxResources.get("property"));v.style.cursor="pointer";var n=function(){var b=t.querySelectorAll(".gePropNonHeaderRow"),c;if(p.editorUi.propertiesCollapsed){l.src=Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var d=a.childNodes[f],h=d.nodeName.toUpperCase();"INPUT"!=
|
||||
h&&"SELECT"!=h||a.removeChild(d)}catch(fa){}}else l.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(v,"click",function(){p.editorUi.propertiesCollapsed=!p.editorUi.propertiesCollapsed;n()});v.appendChild(w);w=document.createElement("th");w.className="gePropHeaderCell";w.innerHTML=mxResources.get("value");v.appendChild(w);t.appendChild(v);var E=!1,C=!1,x;for(x in b)if(v=b[x],"function"!=typeof v.isVisible||v.isVisible(c)){var y=null!=c.style[x]?
|
||||
mxUtils.htmlEntities(c.style[x]+""):v.defVal;if("separator"==v.type)C=!C;else{if("staticArr"==v.type)v.size=parseInt(c.style[v.sizeProperty]||b[v.sizeProperty].defVal)||0;else if(null!=v.dependentProps){for(var U=v.dependentProps,O=[],P=[],w=0;w<U.length;w++){var V=c.style[U[w]];P.push(b[U[w]].subDefVal);O.push(null!=V?V.split(","):[])}v.dependentPropsDefVal=P;v.dependentPropsVals=O}t.appendChild(u(x,y,v,E,C));E=!E}}for(w=0;w<k.length;w++)for(v=k[w],b=v.parentRow,c=0;c<v.values.length;c++)x=u(v.name,
|
||||
h&&"SELECT"!=h||a.removeChild(d)}catch(fa){}}else l.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(v,"click",function(){p.editorUi.propertiesCollapsed=!p.editorUi.propertiesCollapsed;n()});v.appendChild(w);w=document.createElement("th");w.className="gePropHeaderCell";w.innerHTML=mxResources.get("value");v.appendChild(w);t.appendChild(v);var D=!1,E=!1,x;for(x in b)if(v=b[x],"function"!=typeof v.isVisible||v.isVisible(c)){var y=null!=c.style[x]?
|
||||
mxUtils.htmlEntities(c.style[x]+""):v.defVal;if("separator"==v.type)E=!E;else{if("staticArr"==v.type)v.size=parseInt(c.style[v.sizeProperty]||b[v.sizeProperty].defVal)||0;else if(null!=v.dependentProps){for(var U=v.dependentProps,O=[],P=[],w=0;w<U.length;w++){var V=c.style[U[w]];P.push(b[U[w]].subDefVal);O.push(null!=V?V.split(","):[])}v.dependentPropsDefVal=P;v.dependentPropsVals=O}t.appendChild(g(x,y,v,D,E));D=!D}}for(w=0;w<k.length;w++)for(v=k[w],b=v.parentRow,c=0;c<v.values.length;c++)x=g(v.name,
|
||||
v.values[c],{type:v.type,parentRow:v.parentRow,isDeletable:v.isDeletable,index:c,defVal:v.defVal,countProperty:v.countProperty,size:v.size},0==c%2,v.flipBkg),b.parentNode.insertBefore(x,b.nextSibling),b=x;a.appendChild(t);n();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var d=f.getModel().getStyle(c[b]),m=0;m<h.length;m++)d=mxUtils.removeStylename(d,
|
||||
h[m]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,null)),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,
|
||||
a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,
|
||||
|
@ -7862,8 +7862,8 @@ mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3
|
|||
PrintDialog.prototype.create=function(a,b){function c(){v.value=Math.max(1,Math.min(e,Math.max(parseInt(v.value),parseInt(k.value))));k.value=Math.max(1,Math.min(e,Math.min(parseInt(v.value),parseInt(k.value))))}function f(b){function c(b,c,d){var h=b.getGraphBounds(),m=0,e=0,u=W.get(),g=1/b.pageScale,p=n.checked;if(p)var g=parseInt(J.value),q=parseInt(ca.value),g=Math.min(u.height*q/(h.height/b.view.scale),u.width*g/(h.width/b.view.scale));else g=parseInt(l.value)/(100*b.pageScale),isNaN(g)&&(f=
|
||||
1/b.pageScale,l.value="100 %");u=mxRectangle.fromRectangle(u);u.width=Math.ceil(u.width*f);u.height=Math.ceil(u.height*f);g*=f;!p&&b.pageVisible?(h=b.getPageLayout(),m-=h.x*u.width,e-=h.y*u.height):p=!0;if(null==c){c=PrintDialog.createPrintPreview(b,g,u,0,m,e,p);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var k=c.writeHead;c.writeHead=function(b){k.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),
|
||||
b.writeln("</style>"))};if("undefined"!==typeof MathJax){var t=c.renderPage;c.renderPage=function(a,b,c,f,d,h){var m=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=t.apply(this,arguments);mxClient.NO_FO=m;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,d,!0)}else{u=b.background;if(null==u||""==u||u==mxConstants.NONE)u="#ffffff";c.backgroundColor=u;c.autoOrigin=
|
||||
p;c.appendGraph(b,g,m,e,d,!0)}return c}var f=parseInt(da.value)/100;isNaN(f)&&(f=1,da.value="100 %");var f=.75*f,h=k.value,m=v.value,e=!p.checked,u=null;e&&(e=h==g&&m==g);if(!e&&null!=a.pages&&a.pages.length){var q=0,e=a.pages.length-1;p.checked||(q=parseInt(h)-1,e=parseInt(m)-1);for(var t=q;t<=e;t++){var w=a.pages[t],h=w==a.currentPage?d:null;if(null==h){var h=a.createTemporaryGraph(d.getStylesheet()),m=!0,q=!1,x=null,E=null;null==w.viewState&&null==w.root&&a.updatePageRoot(w);null!=w.viewState&&
|
||||
(m=w.viewState.pageVisible,q=w.viewState.mathEnabled,x=w.viewState.background,E=w.viewState.backgroundImage);h.background=x;h.backgroundImage=null!=E?new mxImage(E.src,E.width,E.height):null;h.pageVisible=m;h.mathEnabled=q;var C=h.getGlobalVariable;h.getGlobalVariable=function(a){return"page"==a?w.getName():"pagenumber"==a?t+1:C.apply(this,arguments)};document.body.appendChild(h.container);a.updatePageRoot(w);h.model.setRoot(w.root)}u=c(h,u,t!=e);h!=d&&h.container.parentNode.removeChild(h.container)}}else u=
|
||||
p;c.appendGraph(b,g,m,e,d,!0)}return c}var f=parseInt(da.value)/100;isNaN(f)&&(f=1,da.value="100 %");var f=.75*f,h=k.value,m=v.value,e=!p.checked,u=null;e&&(e=h==g&&m==g);if(!e&&null!=a.pages&&a.pages.length){var q=0,e=a.pages.length-1;p.checked||(q=parseInt(h)-1,e=parseInt(m)-1);for(var t=q;t<=e;t++){var w=a.pages[t],h=w==a.currentPage?d:null;if(null==h){var h=a.createTemporaryGraph(d.getStylesheet()),m=!0,q=!1,x=null,D=null;null==w.viewState&&null==w.root&&a.updatePageRoot(w);null!=w.viewState&&
|
||||
(m=w.viewState.pageVisible,q=w.viewState.mathEnabled,x=w.viewState.background,D=w.viewState.backgroundImage);h.background=x;h.backgroundImage=null!=D?new mxImage(D.src,D.width,D.height):null;h.pageVisible=m;h.mathEnabled=q;var E=h.getGlobalVariable;h.getGlobalVariable=function(a){return"page"==a?w.getName():"pagenumber"==a?t+1:E.apply(this,arguments)};document.body.appendChild(h.container);a.updatePageRoot(w);h.model.setRoot(w.root)}u=c(h,u,t!=e);h!=d&&h.container.parentNode.removeChild(h.container)}}else u=
|
||||
c(d);u.mathEnabled&&(e=u.wnd.document,e.writeln('<script type="text/x-mathjax-config">'),e.writeln("MathJax.Hub.Config({"),e.writeln("showMathMenu: false,"),e.writeln('messageStyle: "none",'),e.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),e.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),e.writeln('"HTML-CSS": {'),e.writeln("imageFont: null"),e.writeln("},"),e.writeln("TeX: {"),e.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),
|
||||
e.writeln("},"),e.writeln("tex2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("},"),e.writeln("asciimath2jax: {"),e.writeln('\tignoreClass: "geDisableMathJax"'),e.writeln("}"),e.writeln("});"),b&&(e.writeln("MathJax.Hub.Queue(function () {"),e.writeln("window.print();"),e.writeln("});")),e.writeln("\x3c/script>"),e.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>'));u.closeDocument();!u.mathEnabled&&b&&PrintDialog.printPreview(u)}
|
||||
var d=a.editor.graph,h=document.createElement("div"),m=document.createElement("h3");m.style.width="100%";m.style.textAlign="center";m.style.marginTop="0px";mxUtils.write(m,b||mxResources.get("print"));h.appendChild(m);var e=1,g=1,u=document.createElement("div");u.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","all");p.setAttribute("type","radio");
|
||||
|
@ -7871,8 +7871,8 @@ p.setAttribute("name","pages-printdialog");u.appendChild(p);m=document.createEle
|
|||
"number");k.setAttribute("min","1");k.style.width="50px";u.appendChild(k);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));u.appendChild(m);var v=k.cloneNode(!0);u.appendChild(v);mxEvent.addListener(k,"focus",function(){q.checked=!0});mxEvent.addListener(v,"focus",function(){q.checked=!0});mxEvent.addListener(k,"change",c);mxEvent.addListener(v,"change",c);if(null!=a.pages&&(e=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){g=m+
|
||||
1;k.value=g;v.value=g;break}k.setAttribute("max",e);v.setAttribute("max",e);1<e&&h.appendChild(u);var t=document.createElement("div");t.style.marginBottom="10px";var w=document.createElement("input");w.style.marginRight="8px";w.setAttribute("value","adjust");w.setAttribute("type","radio");w.setAttribute("name","printZoom");t.appendChild(w);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));t.appendChild(m);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;";
|
||||
l.setAttribute("value","100 %");l.style.width="50px";t.appendChild(l);mxEvent.addListener(l,"focus",function(){w.checked=!0});h.appendChild(t);var u=u.cloneNode(!1),n=w.cloneNode(!0);n.setAttribute("value","fit");w.setAttribute("checked","checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(n);u.appendChild(m);t=document.createElement("table");t.style.display="inline-block";var x=document.createElement("tbody"),
|
||||
E=document.createElement("tr"),C=E.cloneNode(!0),L=document.createElement("td"),U=L.cloneNode(!0),O=L.cloneNode(!0),P=L.cloneNode(!0),V=L.cloneNode(!0),ba=L.cloneNode(!0);L.style.textAlign="right";P.style.textAlign="right";mxUtils.write(L,mxResources.get("fitTo"));var J=document.createElement("input");J.style.cssText="margin:0 8px 0 8px;";J.setAttribute("value","1");J.setAttribute("min","1");J.setAttribute("type","number");J.style.width="40px";U.appendChild(J);m=document.createElement("span");mxUtils.write(m,
|
||||
mxResources.get("fitToSheetsAcross"));O.appendChild(m);mxUtils.write(P,mxResources.get("fitToBy"));var ca=J.cloneNode(!0);V.appendChild(ca);mxEvent.addListener(J,"focus",function(){n.checked=!0});mxEvent.addListener(ca,"focus",function(){n.checked=!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));ba.appendChild(m);E.appendChild(L);E.appendChild(U);E.appendChild(O);C.appendChild(P);C.appendChild(V);C.appendChild(ba);x.appendChild(E);x.appendChild(C);t.appendChild(x);
|
||||
D=document.createElement("tr"),E=D.cloneNode(!0),L=document.createElement("td"),U=L.cloneNode(!0),O=L.cloneNode(!0),P=L.cloneNode(!0),V=L.cloneNode(!0),ba=L.cloneNode(!0);L.style.textAlign="right";P.style.textAlign="right";mxUtils.write(L,mxResources.get("fitTo"));var J=document.createElement("input");J.style.cssText="margin:0 8px 0 8px;";J.setAttribute("value","1");J.setAttribute("min","1");J.setAttribute("type","number");J.style.width="40px";U.appendChild(J);m=document.createElement("span");mxUtils.write(m,
|
||||
mxResources.get("fitToSheetsAcross"));O.appendChild(m);mxUtils.write(P,mxResources.get("fitToBy"));var ca=J.cloneNode(!0);V.appendChild(ca);mxEvent.addListener(J,"focus",function(){n.checked=!0});mxEvent.addListener(ca,"focus",function(){n.checked=!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));ba.appendChild(m);D.appendChild(L);D.appendChild(U);D.appendChild(O);E.appendChild(P);E.appendChild(V);E.appendChild(ba);x.appendChild(D);x.appendChild(E);t.appendChild(x);
|
||||
u.appendChild(t);h.appendChild(u);u=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));u.appendChild(m);m=document.createElement("div");m.style.marginBottom="12px";var W=PageSetupDialog.addPageFormatPanel(m,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);u.appendChild(m);m=document.createElement("span");mxUtils.write(m,mxResources.get("pageScale"));u.appendChild(m);
|
||||
var da=document.createElement("input");da.style.cssText="margin:0 8px 0 8px;";da.setAttribute("value","100 %");da.style.width="60px";u.appendChild(da);h.appendChild(u);m=document.createElement("div");m.style.cssText="text-align:right;margin:48px 0 0 0;";u=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});u.className="geBtn";a.editor.cancelFirst&&m.appendChild(u);a.isOffline()||(t=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),
|
||||
t.className="geBtn",m.appendChild(t));PrintDialog.previewEnabled&&(t=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),t.className="geBtn",m.appendChild(t));t=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});t.className="geBtn gePrimaryBtn";m.appendChild(t);a.editor.cancelFirst||m.appendChild(u);h.appendChild(m);this.container=h};var w=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==
|
||||
|
@ -7881,25 +7881,25 @@ this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnab
|
|||
var ErrorDialog=function(a,c,b,d,e,g,k,l,n,f,h){n=null!=n?n:!0;var m=document.createElement("div");m.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="16px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";mxUtils.write(p,c);m.appendChild(p)}c=document.createElement("div");c.style.padding="6px";c.innerHTML=b;m.appendChild(c);b=document.createElement("div");
|
||||
b.style.marginTop="16px";b.style.textAlign="center";null!=g&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=f&&(f=mxUtils.button(f,function(){null!=h&&h()}),f.className="geBtn",b.appendChild(f));var q=mxUtils.button(d,function(){n&&a.hideDialog();null!=e&&e()});q.className="geBtn";b.appendChild(q);null!=k&&(d=mxUtils.button(k,function(){n&&a.hideDialog();null!=l&&l()}),d.className="geBtn gePrimaryBtn",
|
||||
b.appendChild(d));this.init=function(){q.focus()};m.appendChild(b);this.container=m};
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.0.34";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.0.35";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==
|
||||
a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",h=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=h+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+
|
||||
":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+encodeURIComponent(e.stack):"")}}catch(x){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(m){}};EditorUi.sendReport=function(a,
|
||||
b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(m){}};EditorUi.debug=function(){if(null!=window.console&&"1"==urlParams.test){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);console.log.apply(console,
|
||||
a)}};EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,
|
||||
10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=
|
||||
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(q){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=
|
||||
a&&6<a.length}catch(t){}};c.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(q){}try{b=document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==d.match("image/jpeg")}catch(q){}})();
|
||||
EditorUi.prototype.openLink=function(a,b,c){return this.editor.graph.openLink(a,b,c)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);null!=c&&c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();
|
||||
this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var f=new Spinner({lines:12,
|
||||
length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),d=f.spin;f.spin=function(c,h){var m=!1;this.active||(d.call(this,c),this.active=!0,null!=h&&(m=document.createElement("div"),m.style.position="absolute",m.style.whiteSpace="nowrap",m.style.background="#4B4243",m.style.color="white",m.style.fontFamily="Helvetica, Arial",m.style.fontSize="9pt",m.style.padding="6px",m.style.paddingLeft="10px",m.style.paddingRight=
|
||||
"10px",m.style.zIndex=2E9,m.style.left=Math.max(0,a)+"px",m.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(m.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(m.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=h.substring(h.length-3,h.length)&&(h+="..."),m.innerHTML=h,c.appendChild(m),f.status=m,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(m.style.left=Math.round(Math.max(0,
|
||||
a-m.offsetWidth/2))+"px",m.style.top=Math.round(Math.max(0,b+70-m.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,h)}));this.stop();return a}),m=!0);return m};var h=f.stop;f.stop=function(){h.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=h;h+=b;return a.substring(c,
|
||||
h)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var h=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=d(a);var m=f(a,4);if(null!=b&&b(h-8,m,c))break;value=f(a,c);f(a,4);if("IEND"==m)break}while(c)}};EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);
|
||||
return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(p){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("<mxfile ");if(0<=f){var d=b.lastIndexOf("</mxfile>");d>f&&(c=b.substring(f,d+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),g=this.editor.extractGraphModel(e.documentElement,
|
||||
null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}catch(v){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length));a=this.editor.graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=
|
||||
a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,f=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<f.length||1==f.length&&f[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=f.length-1;0<=d;d--){var e=this.updatePageRoot(new DiagramPage(f[d]));null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[d+1]));b.model.execute(new ChangePage(this,
|
||||
e,0==d?e:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),b.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=c)for(d=0;d<c.length;d++)b.model.execute(new ChangePage(this,
|
||||
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(q){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,0,0);var a=b.toDataURL("image/png");
|
||||
EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(t){}};c.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(q){}try{b=document.createElement("canvas");b.width=b.height=1;var d=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=
|
||||
null!==d.match("image/jpeg")}catch(q){}})();EditorUi.prototype.openLink=function(a,b,c){return this.editor.graph.openLink(a,b,c)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);null!=c&&c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();
|
||||
this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=
|
||||
c?c:24;var f=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),d=f.spin;f.spin=function(c,h){var m=!1;this.active||(d.call(this,c),this.active=!0,null!=h&&(m=document.createElement("div"),m.style.position="absolute",m.style.whiteSpace="nowrap",m.style.background="#4B4243",m.style.color="white",m.style.fontFamily="Helvetica, Arial",m.style.fontSize="9pt",m.style.padding="6px",
|
||||
m.style.paddingLeft="10px",m.style.paddingRight="10px",m.style.zIndex=2E9,m.style.left=Math.max(0,a)+"px",m.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(m.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(m.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=h.substring(h.length-3,h.length)&&(h+="..."),m.innerHTML=h,c.appendChild(m),f.status=m,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&
|
||||
(m.style.left=Math.round(Math.max(0,a-m.offsetWidth/2))+"px",m.style.top=Math.round(Math.max(0,b+70-m.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,h)}));this.stop();return a}),m=!0);return m};var h=f.stop;f.stop=function(){h.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,
|
||||
c){function f(a,b){var c=h;h+=b;return a.substring(c,h)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var h=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=d(a);var m=f(a,4);if(null!=b&&b(h-8,m,c))break;value=f(a,c);f(a,4);if("IEND"==m)break}while(c)}};EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),
|
||||
c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(p){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("<mxfile ");if(0<=f){var d=b.lastIndexOf("</mxfile>");d>f&&(c=b.substring(f,d+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),
|
||||
g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}catch(v){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length));a=this.editor.graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:
|
||||
null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,f=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<f.length||1==f.length&&f[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=f.length-1;0<=d;d--){var e=this.updatePageRoot(new DiagramPage(f[d]));null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[d+1]));
|
||||
b.model.execute(new ChangePage(this,e,0==d?e:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),b.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=c)for(d=0;d<c.length;d++)b.model.execute(new ChangePage(this,
|
||||
c[d],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,e,g,k,l,u,w){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;u=null!=u?u:!0;var f,h=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":h=f=d;if(null==a)return"";var m=a;if("mxfile"!=m.nodeName.toLowerCase()){var p=b.zapGremlins(mxUtils.getXml(a)),m=b.compress(p);if(b.decompress(m)!=p)return p;p=a.ownerDocument.createElement("diagram");p.setAttribute("id",Editor.guid());mxUtils.setTextContent(p,
|
||||
m);m=a.ownerDocument.createElement("mxfile");m.appendChild(p)}w?(m=m.cloneNode(!0),m.removeAttribute("userAgent"),m.removeAttribute("version"),m.removeAttribute("editor"),m.removeAttribute("type")):(m.removeAttribute("userAgent"),m.removeAttribute("version"),m.removeAttribute("editor"),m.removeAttribute("type"),m.setAttribute("modified",(new Date).toISOString()),m.setAttribute("host",window.location.hostname),m.setAttribute("agent",navigator.userAgent),m.setAttribute("version",EditorUi.VERSION),m.setAttribute("etag",
|
||||
Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&m.setAttribute("type",a));a=mxUtils.getXml(m);if(!g&&!e&&(k||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(m),b,null!=c?c.getTitle():null,f,h);else if(g||!e&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,l,u,h);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);
|
||||
|
@ -7922,16 +7922,16 @@ Error(a);b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(nu
|
|||
1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var b=this.getCurrentFile(),
|
||||
b=null!=b&&null!=b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||/(\.html)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.png)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(b=b+"-"+this.currentPage.getName());return b};EditorUi.prototype.downloadFile=function(a,b,c,d,e,g,k){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=
|
||||
this.getBaseFilename(!e),h=f+"."+a;if("xml"==a){var m='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(h,a,m,"text/xml")}else if("html"==a)m=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(h,a,m,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?h=f+".png":"jpeg"==a&&(h=f+".jpg"),this.saveRequest(h,a,mxUtils.bind(this,
|
||||
function(b,c){try{var f=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var h=this.createDownloadRequest(b,a,d,c,k,e);this.editor.graph.pageVisible=f;return h}catch(A){this.handleError(A)}}));else{var p=null,q=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var t=this.editor.graph.background;
|
||||
if(k||t==mxConstants.NONE)t=null;var v=this.editor.graph.getSvg(t,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(v);this.convertImages(v,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();q('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else h=f+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();q(a)}),d)}}catch(H){this.handleError(H)}};
|
||||
function(b,c){try{var f=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var h=this.createDownloadRequest(b,a,d,c,k,e);this.editor.graph.pageVisible=f;return h}catch(B){this.handleError(B)}}));else{var p=null,q=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(h,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(p)}))});if("svg"==a){var t=this.editor.graph.background;
|
||||
if(k||t==mxConstants.NONE)t=null;var v=this.editor.graph.getSvg(t,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(v);this.convertImages(v,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();q('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else h=f+".svg",p=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();q(a)}),d)}}catch(F){this.handleError(F)}};
|
||||
EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e,g){var f=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var h="",m="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";"pdf"==b&&0==g&&(m="&allPages=1");if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){h="&from="+g;break}g=this.editor.graph.background;
|
||||
"png"==b&&e&&(g=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+h+m+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var f=window.location.hash,d=mxUtils.bind(this,function(c){var d=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<d.length&&(d+="\n"),d+=c);c=new LocalFile(this,"csv"!=a.format&&
|
||||
0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return f};this.fileLoaded(c);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var h=null!=a.interval?parseInt(a.interval):6E4,e=null,m=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(m,h)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();m()}));g();m()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var h=a.url;/^https?:\/\//.test(h)&&
|
||||
!this.isCorsEnabledForUrl(h)&&(h=PROXY_URL+"?url="+encodeURIComponent(h));this.loadUrl(h,mxUtils.bind(this,function(a){d(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else d("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||d.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){f.alert(a.tooltip)});return b}var c=null,f=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=
|
||||
a&&"updates"==a.nodeName)){var d=this.editor.graph,e=d.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var k=e.getCell(a.getAttribute("id"));if(null!=k){try{var u=a.getAttribute("value");if(null!=u){var w=mxUtils.parseXml(u).documentElement;if(null!=w)if("1"==w.getAttribute("replace-value"))e.setValue(k,w);else for(var l=w.attributes,n=0;n<l.length;n++)d.setAttributeForCell(k,l[n].nodeName,0<l[n].nodeValue.length?l[n].nodeValue:null)}}catch(D){null!=
|
||||
window.console&&console.log("Error in value for "+k.id+": "+D)}try{var y=a.getAttribute("style");null!=y&&d.model.setStyle(k,y)}catch(D){null!=window.console&&console.log("Error in style for "+k.id+": "+D)}try{var z=a.getAttribute("icon");if(null!=z){var H=0<z.length?JSON.parse(z):null;null!=H&&H.append||d.removeCellOverlays(k);null!=H&&d.addCellOverlay(k,b(H))}}catch(D){null!=window.console&&console.log("Error in icon for "+k.id+": "+D)}try{var B=a.getAttribute("geometry");if(null!=B){var B=JSON.parse(B),
|
||||
F=d.getCellGeometry(k);if(null!=F){F=F.clone();for(key in B){var I=parseFloat(B[key]);"dx"==key?F.x+=I:"dy"==key?F.y+=I:"dw"==key?F.width+=I:"dh"==key?F.height+=I:F[key]=parseFloat(B[key])}d.model.setGeometry(k,F)}}}catch(D){null!=window.console&&console.log("Error in icon for "+k.id+": "+D)}}}else if("model"==a.nodeName){for(var A=a.firstChild;null!=A&&A.nodeType!=mxConstants.NODETYPE_ELEMENT;)A=A.nextSibling;null!=A&&(new mxCodec(a.firstChild)).decode(A,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&
|
||||
a&&"updates"==a.nodeName)){var d=this.editor.graph,e=d.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var k=e.getCell(a.getAttribute("id"));if(null!=k){try{var u=a.getAttribute("value");if(null!=u){var w=mxUtils.parseXml(u).documentElement;if(null!=w)if("1"==w.getAttribute("replace-value"))e.setValue(k,w);else for(var l=w.attributes,n=0;n<l.length;n++)d.setAttributeForCell(k,l[n].nodeName,0<l[n].nodeValue.length?l[n].nodeValue:null)}}catch(C){null!=
|
||||
window.console&&console.log("Error in value for "+k.id+": "+C)}try{var y=a.getAttribute("style");null!=y&&d.model.setStyle(k,y)}catch(C){null!=window.console&&console.log("Error in style for "+k.id+": "+C)}try{var z=a.getAttribute("icon");if(null!=z){var F=0<z.length?JSON.parse(z):null;null!=F&&F.append||d.removeCellOverlays(k);null!=F&&d.addCellOverlay(k,b(F))}}catch(C){null!=window.console&&console.log("Error in icon for "+k.id+": "+C)}try{var A=a.getAttribute("geometry");if(null!=A){var A=JSON.parse(A),
|
||||
G=d.getCellGeometry(k);if(null!=G){G=G.clone();for(key in A){var I=parseFloat(A[key]);"dx"==key?G.x+=I:"dy"==key?G.y+=I:"dw"==key?G.width+=I:"dh"==key?G.height+=I:G[key]=parseFloat(A[key])}d.model.setGeometry(k,G)}}}catch(C){null!=window.console&&console.log("Error in icon for "+k.id+": "+C)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&
|
||||
(d.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,
|
||||
f="",d=c.lastIndexOf(".");0<=d&&(f=c.substring(d),c=c.substring(0,d));if(b)var h=new Date,d=h.getFullYear(),e=h.getMonth()+1,g=h.getDate(),u=h.getHours(),k=h.getMinutes(),h=h.getSeconds(),c=c+(" "+(d+"-"+e+"-"+g+"-"+u+"-"+k+"-"+h));return c=mxResources.get("copyOf",[c])+f};EditorUi.prototype.fileLoaded=function(a){var b=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var c=!1;this.hideDialog();null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();
|
||||
this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");
|
||||
|
@ -7952,19 +7952,19 @@ function(b,c){0==b.length&&a.isEditable()?(null==f&&(f=document.createElement("d
|
|||
mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);
|
||||
c=null!=c&&0<c.length?c:a.getTitle();var m=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){h(b,a)}));this.repositionLibrary(d);var g=m.parentNode.previousSibling;c=g.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&g.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var k=document.createElement("div");k.style.position="absolute";k.style.right="0px";k.style.top="0px";k.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(k.style.backgroundColor=
|
||||
"inherit");g.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("valign","absmiddle");l.setAttribute("border","0");l.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)k.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),
|
||||
null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var y=this.editor.graph,z=null,H=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),m,b,a,a.getMode());mxEvent.consume(c)}),B=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=z&&null!=z.parentNode&&z.parentNode.removeChild(z),z=l.cloneNode(!1),z.setAttribute("src",Editor.spinImage),z.setAttribute("title",mxResources.get("saving")),z.style.cursor="default",
|
||||
null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var y=this.editor.graph,z=null,F=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),m,b,a,a.getMode());mxEvent.consume(c)}),A=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=z&&null!=z.parentNode&&z.parentNode.removeChild(z),z=l.cloneNode(!1),z.setAttribute("src",Editor.spinImage),z.setAttribute("title",mxResources.get("saving")),z.style.cursor="default",
|
||||
z.style.marginRight="2px",z.style.marginTop="-2px",k.insertBefore(z,k.firstChild),g.style.paddingRight=18*k.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=z&&null!=z.parentNode&&(z.parentNode.removeChild(z),g.style.paddingRight=18*k.childNodes.length+"px")})):null==n&&(n=l.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),k.insertBefore(n,k.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,
|
||||
function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(g.style.paddingRight=18*k.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),g.style.paddingRight=18*k.childNodes.length+"px")}),F=mxUtils.bind(this,function(a,c,d,h){a=y.cloneCells(mxUtils.sortCells(y.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var g=y.getCellGeometry(a[e]);null!=g&&g.translate(-c.x,-c.y)}m.appendChild(this.sidebar.createVertexTemplateFromCells(a,
|
||||
c.width,c.height,h||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=h&&(a.title=h);b.push(a);B(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),I=mxUtils.bind(this,function(a){if(y.isSelectionEmpty())y.getRubberband().isActive()?(y.getRubberband().execute(a),y.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=
|
||||
y.getSelectionCells(),c=y.view.getBounds(b),d=y.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=y.view.translate.x;c.y-=y.view.translate.y;F(b,c)}mxEvent.consume(a)});m.style.border="3px solid transparent";mxEvent.addGestureListeners(m,function(){},mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":m.style.border="3px dotted rgb(254, 137, 12)",
|
||||
function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(g.style.paddingRight=18*k.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),g.style.paddingRight=18*k.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,c,d,h){a=y.cloneCells(mxUtils.sortCells(y.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var g=y.getCellGeometry(a[e]);null!=g&&g.translate(-c.x,-c.y)}m.appendChild(this.sidebar.createVertexTemplateFromCells(a,
|
||||
c.width,c.height,h||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=h&&(a.title=h);b.push(a);A(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),I=mxUtils.bind(this,function(a){if(y.isSelectionEmpty())y.getRubberband().isActive()?(y.getRubberband().execute(a),y.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=
|
||||
y.getSelectionCells(),c=y.view.getBounds(b),d=y.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=y.view.translate.x;c.y-=y.view.translate.y;G(b,c)}mxEvent.consume(a)});m.style.border="3px solid transparent";mxEvent.addGestureListeners(m,function(){},mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":m.style.border="3px dotted rgb(254, 137, 12)",
|
||||
m.style.cursor="copy",y.panningManager.stop(),y.autoScroll=!1,null!=y.graphHandler.guide&&y.graphHandler.guide.setVisible(!1),null!=y.graphHandler.hint&&(y.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.panningManager&&null!=y.graphHandler&&(m.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),m.style.cursor="default",this.sidebar.showTooltips=!0,y.panningManager.stop(),y.graphHandler.reset(),
|
||||
y.isMouseDown=!1,y.autoScroll=!0,I(a),mxEvent.consume(a))}));mxEvent.addListener(m,"mouseleave",mxUtils.bind(this,function(a){y.isMouseDown&&null!=y.graphHandler.shape&&(y.graphHandler.shape.node.style.visibility="visible",m.style.border="3px solid transparent",m.style.cursor="",y.autoScroll=!0,null!=y.graphHandler.guide&&y.graphHandler.guide.setVisible(!0),null!=y.graphHandler.hint&&(y.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&
|
||||
(mxEvent.addListener(m,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":m.style.border="3px dotted rgb(254, 137, 12)";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.border="3px solid transparent";m.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,
|
||||
0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,g,u,k,p,l,q){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,u,k),c)],c[0].vertex=!0,F(c,new mxRectangle(0,0,u,k),a,mxEvent.isAltDown(a)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var w=!1,v=mxUtils.bind(this,function(c,
|
||||
d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(e.documentElement));h(g,m);b=b.concat(g);B(a);this.spinner.stop();w=!0}catch(J){}else if("mxfile"==e.documentElement.nodeName)try{for(var u=e.documentElement.getElementsByTagName("diagram"),e=0;e<u.length;e++){var g=mxUtils.getTextContent(u[e]),k=this.stringToCells(this.editor.graph.decompress(g)),p=this.editor.graph.getBoundingBoxFromGeometry(k);F(k,new mxRectangle(0,
|
||||
0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,g,u,k,p,l,q){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,u,k),c)],c[0].vertex=!0,G(c,new mxRectangle(0,0,u,k),a,mxEvent.isAltDown(a)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var w=!1,v=mxUtils.bind(this,function(c,
|
||||
d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(e.documentElement));h(g,m);b=b.concat(g);A(a);this.spinner.stop();w=!0}catch(J){}else if("mxfile"==e.documentElement.nodeName)try{for(var u=e.documentElement.getElementsByTagName("diagram"),e=0;e<u.length;e++){var g=mxUtils.getTextContent(u[e]),k=this.stringToCells(this.editor.graph.decompress(g)),p=this.editor.graph.getBoundingBoxFromGeometry(k);G(k,new mxRectangle(0,
|
||||
0,p.width,p.height),a)}w=!0}catch(J){null!=window.console&&console.log("error in drop handler:",J)}}w||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=q&&null!=p&&(/(\.v(dx|sdx?))($|\?)/i.test(p)||/(\.vs(x|sx?))($|\?)/i.test(p))?this.importVisio(q,function(a){v(a,"text/xml")},null,p):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,p)&&null!=q?this.parseFile(q,
|
||||
mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?v(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):v(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(m.style.border="3px solid transparent",m.style.cursor="");a.stopPropagation();a.preventDefault()}));
|
||||
l=l.cloneNode(!1);l.setAttribute("src",Editor.editImage);l.setAttribute("title",mxResources.get("edit"));k.insertBefore(l,k.firstChild);mxEvent.addListener(l,"click",H);mxEvent.addListener(m,"dblclick",function(a){mxEvent.getSource(a)==m&&H(a)});c=l.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",I);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),
|
||||
l=l.cloneNode(!1);l.setAttribute("src",Editor.editImage);l.setAttribute("title",mxResources.get("edit"));k.insertBefore(l,k.firstChild);mxEvent.addListener(l,"click",F);mxEvent.addListener(m,"dblclick",function(a){mxEvent.getSource(a)==m&&F(a)});c=l.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",I);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),
|
||||
c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),k.insertBefore(c,k.firstChild))}g.appendChild(k);g.style.paddingRight=18*k.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),
|
||||
h="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(h+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(h+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(this.editor.graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=
|
||||
0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground=
|
||||
|
@ -7977,7 +7977,7 @@ this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};Edit
|
|||
mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,d){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var h=mxResources.get("ok"),
|
||||
m=null;b=null!=b?b:mxResources.get("error");if(null!=e)if(null!=e.retry&&(h=mxResources.get("cancel"),m=function(){f();e.retry()}),404==e.code||404==e.status||403==e.code){a=403==e.code?null!=e.message?mxUtils.htmlEntities(e.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var g=window.location.hash;null!=g&&"#G"==g.substring(0,2)&&(g=g.substring(2),a+='<br><a href="https://drive.google.com/open?id='+g+'" target="_blank">'+
|
||||
mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else null!=e.message?a=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error?a=mxUtils.htmlEntities(e.response.error):"undefined"!==window.App&&(e.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY&&(a=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,a,h,c,m,null,null,null,null,null,null,null,d?c:null)}else null!=c&&c()};EditorUi.prototype.showError=
|
||||
function(a,b,c,d,e,g,k,l,u,w,n,C,y){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,k,C,l,u);this.showDialog(a.container,w||340,n||(null!=b&&120<b.length?180:150),!0,!1,y);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e,g){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,
|
||||
function(a,b,c,d,e,g,k,l,u,w,n,E,y){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,k,E,l,u);this.showDialog(a.container,w||340,n||(null!=b&&120<b.length?180:150),!0,!1,y);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e,g){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,
|
||||
a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},d,e);this.showDialog(a.container,340,90,!0,g);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};
|
||||
EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=
|
||||
function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",
|
||||
|
@ -7985,7 +7985,7 @@ function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof
|
|||
if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),h=65==(g?parseInt(g[2],10):!1)?!1:h;if(h||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));h?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(u){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=
|
||||
function(a,b,c,d,e,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),e=Array(f),h=0;h<f;++h){for(var g=1024*h,u=Math.min(g+1024,d),k=Array(u-g),l=0;g<u;++l,++g)k[l]=c[g].charCodeAt(0);e[h]=new Uint8Array(k)}return new Blob(e,{type:b})};
|
||||
EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,k){g=null!=g?g:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||
|
||||
"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(C){this.handleError(C)}}))}catch(E){this.handleError(E)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||
|
||||
"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(E){this.handleError(E)}}))}catch(D){this.handleError(D)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||
|
||||
11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null==d&&mxUtils.popup(a,!0)};var c=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=
|
||||
function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var c=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",c);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)c.apply(this);else{this.exportDialog=document.createElement("div");var d=b.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");
|
||||
this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+
|
||||
|
@ -8006,31 +8006,31 @@ getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(
|
|||
"frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",h=null,h=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();h.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";h.style.marginLeft="4px";h.style.height="22px";h.style.width="22px";h.style.position="relative";h.style.top=mxClient.IS_IE||
|
||||
mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";h.className="geColorBtn";a.appendChild(h);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,k,l){var f=this.getCurrentFile(),h=[];d&&(h.push("lightbox=1"),"auto"!=a&&h.push("target="+a),null!=b&&b!=mxConstants.NONE&&h.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&h.push("edit="+encodeURIComponent(e)),g&&
|
||||
h.push("layers=1"),this.editor.graph.foldingEnabled&&h.push("nav=1"));c&&(a=this.getSelectedPageIndex(),0<a&&h.push("page="+a));a=!0;null!=k?c="#U"+encodeURIComponent(k):(f=this.getCurrentFile(),l||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):this.editor.graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+f.getHash(),a=!1));a&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&h.push("title="+
|
||||
encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,g,k,l,u,n,E){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);u||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];
|
||||
encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?"https://www.draw.io/":"https://"+window.location.host+"/")+(0<h.length?"?"+h.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,g,k,l,u,n,D){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);u||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];
|
||||
k&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);l&&c.push("layers");0<c.length&&(u&&c.push("lightbox"),f.toolbar=c.join(" "));null!=n&&0<n.length&&(f.edit=n);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!k);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';
|
||||
a=null!=a?"&fetch="+encodeURIComponent(a):"";E(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("html"));
|
||||
a=null!=a?"&fetch="+encodeURIComponent(a):"";D(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":"https://www.draw.io/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":"https://www.draw.io/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("html"));
|
||||
e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(e);var h=document.createElement("div");h.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value","copy");h.appendChild(e);
|
||||
var m=document.createElement("span");mxUtils.write(m,mxResources.get("includeCopyOfMyDiagram"));h.appendChild(m);mxUtils.br(h);h.appendChild(g);m=document.createElement("span");mxUtils.write(m,mxResources.get("publicDiagramUrl"));h.appendChild(m);var k=this.getCurrentFile();null==c&&null!=k&&k.constructor==window.DriveFile&&(m=document.createElement("a"),m.style.paddingLeft="12px",m.style.color="gray",m.setAttribute("href","javascript:void(0);"),mxUtils.write(m,mxResources.get("share")),h.appendChild(m),
|
||||
mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));e.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(h);var l=this.addLinkSection(f),p=this.addCheckbox(f,mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=
|
||||
"100%";f.appendChild(n);var z=this.addCheckbox(f,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,H=H=this.addCheckbox(f,mxResources.get("allPages"),h,!h),B=this.addCheckbox(f,mxResources.get("layers"),!0),F=this.addCheckbox(f,mxResources.get("lightbox"),!0),I=this.addEditButton(f,F),A=I.getEditInput();A.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?A.removeAttribute("disabled"):A.setAttribute("disabled","disabled");A.checked&&F.checked?I.getEditSelect().removeAttribute("disabled"):
|
||||
I.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,p.checked,n.value,l.getTarget(),l.getColor(),z.checked,H.checked,B.checked,F.checked,I.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,a||mxResources.get("link"));h.style.cssText=
|
||||
"100%";f.appendChild(n);var z=this.addCheckbox(f,mxResources.get("fit"),!0),h=null!=this.pages&&1<this.pages.length,F=F=this.addCheckbox(f,mxResources.get("allPages"),h,!h),A=this.addCheckbox(f,mxResources.get("layers"),!0),G=this.addCheckbox(f,mxResources.get("lightbox"),!0),I=this.addEditButton(f,G),B=I.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&G.checked?I.getEditSelect().removeAttribute("disabled"):
|
||||
I.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,p.checked,n.value,l.getTarget(),l.getColor(),z.checked,F.checked,A.checked,G.checked,I.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var h=document.createElement("h3");mxUtils.write(h,a||mxResources.get("link"));h.style.cssText=
|
||||
"width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(h);var m=this.getCurrentFile(),h="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=m&&m.constructor==window.DriveFile&&!b){a=80;var h="https://desk.draw.io/support/solutions/articles/16000039384",k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var l=document.createElement("div");l.style.whiteSpace=
|
||||
"normal";mxUtils.write(l,mxResources.get("linkAccountRequired"));k.appendChild(l);l=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(m.getId())}));l.style.marginTop="12px";l.className="geBtn";k.appendChild(l);f.appendChild(k);l=document.createElement("a");l.style.paddingLeft="12px";l.style.color="gray";l.style.fontSize="11px";l.setAttribute("href","javascript:void(0);");mxUtils.write(l,mxResources.get("check"));k.appendChild(l);mxEvent.addListener(l,
|
||||
"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var p=null,n=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),p=document.createElement("input"),p.setAttribute("type",
|
||||
"text"),p.style.marginRight="16px",p.style.width="50px",p.style.marginLeft="6px",p.style.marginRight="16px",p.style.marginBottom="10px",p.value="100%",f.appendChild(p),mxUtils.write(f,mxResources.get("height")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.width="50px",n.style.marginLeft="6px",n.style.marginBottom="10px",n.value=d+"px",f.appendChild(n),mxUtils.br(f);var q=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==m||m.constructor!=
|
||||
window.DriveFile||b)t=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var B=this.addCheckbox(f,mxResources.get("lightbox"),!0),F=this.addEditButton(f,B),I=F.getEditInput(),A=this.addCheckbox(f,mxResources.get("layers"),!0);A.style.marginLeft=I.style.marginLeft;A.style.marginBottom="16px";A.style.marginTop="8px";mxEvent.addListener(B,"change",function(){B.checked?(A.removeAttribute("disabled"),I.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"));
|
||||
I.checked&&B.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(q.getTarget(),q.getColor(),null==t?!0:t.checked,B.checked,F.getLink(),A.checked,null!=p?p.value:null,null!=n?n.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,254+a,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",
|
||||
window.DriveFile||b)t=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var A=this.addCheckbox(f,mxResources.get("lightbox"),!0),G=this.addEditButton(f,A),I=G.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),!0);B.style.marginLeft=I.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(A,"change",function(){A.checked?(B.removeAttribute("disabled"),I.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"));
|
||||
I.checked&&A.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(q.getTarget(),q.getColor(),null==t?!0:t.checked,A.checked,G.getLink(),B.checked,null!=p?p.value:null,null!=n?n.value:null)}),null,mxResources.get("create"),h);this.showDialog(b.container,340,254+a,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",
|
||||
!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(e);var h=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),!0),e=this.editor.graph,
|
||||
m=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=m&&(m.style.marginBottom="16px");a=new CustomDialog(this,f,mxUtils.bind(this,function(){c(!h.checked,null!=g?g.checked:!1,null!=m?m.checked:!1)}),null,a,b);this.showDialog(a.container,300,d?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,d,e,g,k,l){k=null!=k?k:!0;var f=document.createElement("div");f.style.whiteSpace="nowrap";var h=this.editor.graph,m="jpeg"==
|
||||
l?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";f.appendChild(p);mxUtils.write(f,mxResources.get("zoom")+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";f.appendChild(n);mxUtils.write(f,mxResources.get("borderWidth")+":");var q=document.createElement("input");
|
||||
q.setAttribute("type","text");q.style.marginRight="16px";q.style.width="60px";q.style.marginLeft="4px";q.value=this.lastExportBorder||"0";f.appendChild(q);mxUtils.br(f);var v=this.addCheckbox(f,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=l),t=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,h.isSelectionEmpty()),x=document.createElement("input");x.style.marginTop="16px";x.style.marginRight="8px";x.style.marginLeft="24px";x.setAttribute("disabled","disabled");x.setAttribute("type",
|
||||
"checkbox");g&&(f.appendChild(x),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),m+=26,mxEvent.addListener(t,"change",function(){t.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var I=this.addCheckbox(f,mxResources.get("shadow"),h.shadowVisible),A=document.createElement("input");A.style.marginTop="16px";A.style.marginRight="8px";A.setAttribute("type","checkbox");!this.isOffline()&&
|
||||
this.canvasSupported||A.setAttribute("disabled","disabled");b&&(f.appendChild(A),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),m+=26);var D=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=l),G=null!=this.pages&&1<this.pages.length,M=this.addCheckbox(f,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=l);M.style.marginLeft="24px";M.style.marginBottom="16px";G||(M.style.display="none");mxEvent.addListener(D,"change",function(){D.checked&&G?M.removeAttribute("disabled"):
|
||||
M.setAttribute("disabled","disabled")});k&&G||M.setAttribute("disabled","disabled");var K=document.createElement("select");K.style.maxWidth="260px";K.style.marginLeft="8px";K.style.marginRight="10px";K.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));K.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));K.appendChild(a);a=document.createElement("option");
|
||||
a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));K.appendChild(a);"svg"==l&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(K),mxUtils.br(f),mxUtils.br(f),m+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=n.value;e(n.value,v.checked,!t.checked,I.checked,D.checked,A.checked,q.value,x.checked,!M.checked,K.value)}),null,c,d);this.showDialog(c.container,340,m,!0,!0);n.focus();mxClient.IS_GC||
|
||||
"checkbox");g&&(f.appendChild(x),mxUtils.write(f,mxResources.get("crop")),mxUtils.br(f),m+=26,mxEvent.addListener(t,"change",function(){t.checked?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}));h.isSelectionEmpty()||(x.setAttribute("checked","checked"),x.defaultChecked=!0);var I=this.addCheckbox(f,mxResources.get("shadow"),h.shadowVisible),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&
|
||||
this.canvasSupported||B.setAttribute("disabled","disabled");b&&(f.appendChild(B),mxUtils.write(f,mxResources.get("embedImages")),mxUtils.br(f),m+=26);var C=this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),k,null,null,"jpeg"!=l),H=null!=this.pages&&1<this.pages.length,M=this.addCheckbox(f,H?mxResources.get("allPages"):"",H,!H,null,"jpeg"!=l);M.style.marginLeft="24px";M.style.marginBottom="16px";H||(M.style.display="none");mxEvent.addListener(C,"change",function(){C.checked&&H?M.removeAttribute("disabled"):
|
||||
M.setAttribute("disabled","disabled")});k&&H||M.setAttribute("disabled","disabled");var K=document.createElement("select");K.style.maxWidth="260px";K.style.marginLeft="8px";K.style.marginRight="10px";K.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));K.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));K.appendChild(a);a=document.createElement("option");
|
||||
a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));K.appendChild(a);"svg"==l&&(mxUtils.write(f,mxResources.get("links")+":"),f.appendChild(K),mxUtils.br(f),mxUtils.br(f),m+=26);c=new CustomDialog(this,f,mxUtils.bind(this,function(){this.lastExportBorder=q.value;this.lastExportZoom=n.value;e(n.value,v.checked,!t.checked,I.checked,C.checked,B.checked,q.value,x.checked,!M.checked,K.value)}),null,c,d);this.showDialog(c.container,340,m,!0,!0);n.focus();mxClient.IS_GC||
|
||||
mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,d,e){var f=document.createElement("div");f.style.whiteSpace="nowrap";var h=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(g)}var m=this.addCheckbox(f,mxResources.get("fit"),!0),k=this.addCheckbox(f,mxResources.get("shadow"),
|
||||
h.shadowVisible&&d,!d),l=this.addCheckbox(f,c),p=this.addCheckbox(f,mxResources.get("lightbox"),!0),n=this.addEditButton(f,p),q=n.getEditInput(),H=1<h.model.getChildCount(h.model.getRoot()),B=this.addCheckbox(f,mxResources.get("layers"),H,!H);B.style.marginLeft=q.style.marginLeft;B.style.marginBottom="12px";B.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(H&&B.removeAttribute("disabled"),q.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),q.setAttribute("disabled",
|
||||
"disabled"));q.checked&&p.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){a(m.checked,k.checked,l.checked,p.checked,n.getLink(),B.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,g,k,l){function f(b){var f=" ",m="";d&&(f=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
|
||||
h.shadowVisible&&d,!d),l=this.addCheckbox(f,c),p=this.addCheckbox(f,mxResources.get("lightbox"),!0),n=this.addEditButton(f,p),q=n.getEditInput(),F=1<h.model.getChildCount(h.model.getRoot()),A=this.addCheckbox(f,mxResources.get("layers"),F,!F);A.style.marginLeft=q.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(F&&A.removeAttribute("disabled"),q.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),q.setAttribute("disabled",
|
||||
"disabled"));q.checked&&p.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){a(m.checked,k.checked,l.checked,p.checked,n.getLink(),A.checked)}),null,mxResources.get("embed"),e);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,d,e,g,k,l){function f(b){var f=" ",m="";d&&(f=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
|
||||
(e?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");var u="";c&&(u=' width="'+Math.round(h.width)+'" height="'+Math.round(h.height)+'"');k('<img src="'+b+'"'+u+(""!=m?' style="'+m+'"':"")+f+"/>")}var h=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=d?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");f(a)}),null,null,null,mxUtils.bind(this,function(a){l({message:mxResources.get("unknownError")})}),
|
||||
null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),h.width*h.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var m="";c&&(m="&w="+Math.round(2*h.width)+"&h="+Math.round(2*h.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(d?"1":"0")+m+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?f("data:image/png;base64,"+p.getText()):l({message:mxResources.get("unknownError")})}))}else l({message:mxResources.get("drawingTooLarge")})};
|
||||
EditorUi.prototype.createEmbedSvg=function(a,b,c,d,e,g,k){var f=this.editor.graph.getSvg(),h=f.getElementsByTagName("a");if(null!=h)for(var m=0;m<h.length;m++){var l=h[m].getAttribute("href");null!=l&&"#"==l.charAt(0)&&"_blank"==h[m].getAttribute("target")&&h[m].removeAttribute("target")}d&&f.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(f);if(c){var p=" ",n="";d&&(p="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('https://www.draw.io/?client=1&lightbox=1"+
|
||||
|
@ -8042,13 +8042,13 @@ this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(t){}f
|
|||
e=d.getGlobalVariable,h=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?h.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(h.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0));var e=c.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(this.editor.graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(w){null!=
|
||||
b&&b(w)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,g,k){k=b.background;k==mxConstants.NONE&&(k=null);b=b.getSvg(k,null,null,null,null,g);null!=a&&b.setAttribute("content",a);null!=c&&b.setAttribute("resource",c);if(null!=e)this.convertImages(b,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
|
||||
mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(b)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,k,l,u){u=null!=u?u:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();
|
||||
try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,u)}catch(C){"Invalid image"==C.message?this.downloadFile(u):this.handleError(C)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,k)}catch(E){this.spinner.stop(),this.handleError(E)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
|
||||
try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,l):null,u)}catch(E){"Invalid image"==E.message?this.downloadFile(u):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,k)}catch(D){this.spinner.stop(),this.handleError(D)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
|
||||
"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,f={},e=mxUtils.bind(this,function(){if(0==d){for(var e=[c[0]],g=1;g<c.length;g++){var h=c[g].indexOf(")");e.push('url("');e.push(f[b(c[g].substring(0,h))]);e.push('"'+c[g].substring(h))}this.editor.resolvedFontCss=e.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var k=c[g].indexOf(")"),u=null,l=c[g].indexOf("format(",k);0<l&&(u=b(c[g].substring(l+7,c[g].indexOf(")",l))));mxUtils.bind(this,function(a){if(null==
|
||||
f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==u||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==u||"embedded-opentype"==u||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==u||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==u||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==u||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==u||/(\.sfnt)($|\?)/i.test(a))b="application/font-sfnt";var c=
|
||||
a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,k)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,k,l,u,n,E,C,y,z){g=null!=g?g:!0;C=null!=C?C:this.editor.graph;y=null!=y?y:0;var f=u?null:C.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==u&&
|
||||
(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(C.getSvg(f,null,null,z,null,null!=k?k:!0,null,null,null,n),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var h=document.createElement("canvas"),m=parseInt(c.getAttribute("width")),u=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=g?Math.min(1,Math.min(3*b/(4*u),b/m)):b/m);m=Math.ceil(l*m)+2*y;u=Math.ceil(l*u)+2*y;h.setAttribute("width",m);h.setAttribute("height",u);var k=h.getContext("2d");
|
||||
null!=f&&(k.beginPath(),k.rect(0,0,m,u),k.fillStyle=f,k.fill());k.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){k.drawImage(d,y/l,y/l);a(h)},0):(k.drawImage(d,y/l,y/l),a(h))}catch(K){null!=e&&e(K)}});d.onerror=function(a){null!=e&&e(a)};try{n&&this.editor.graph.addSvgShadow(c,c);var h=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(C,
|
||||
c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(h)}catch(A){null!=e&&e(A)}}),c,E)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=
|
||||
a;/^https?:\/\//.test(c)&&!this.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,k)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,k,l,u,n,D,E,y,z){g=null!=g?g:!0;E=null!=E?E:this.editor.graph;y=null!=y?y:0;var f=u?null:E.background;f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==u&&
|
||||
(f=this.editor.graph.defaultPageBackgroundColor);this.convertImages(E.getSvg(f,null,null,z,null,null!=k?k:!0,null,null,null,n),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var h=document.createElement("canvas"),m=parseInt(c.getAttribute("width")),u=parseInt(c.getAttribute("height"));l=null!=l?l:1;null!=b&&(l=g?Math.min(1,Math.min(3*b/(4*u),b/m)):b/m);m=Math.ceil(l*m)+2*y;u=Math.ceil(l*u)+2*y;h.setAttribute("width",m);h.setAttribute("height",u);var k=h.getContext("2d");
|
||||
null!=f&&(k.beginPath(),k.rect(0,0,m,u),k.fillStyle=f,k.fill());k.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){k.drawImage(d,y/l,y/l);a(h)},0):(k.drawImage(d,y/l,y/l),a(h))}catch(K){null!=e&&e(K)}});d.onerror=function(a){null!=e&&e(a)};try{n&&this.editor.graph.addSvgShadow(c,c);var h=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,
|
||||
c,!0,mxUtils.bind(this,function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(h)}catch(B){null!=e&&e(B)}}),c,D)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=
|
||||
d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,e=c||{};c=mxUtils.bind(this,function(c,g){for(var h=a.getElementsByTagName(c),m=0;m<h.length;m++)mxUtils.bind(this,function(c){var h=d.convert(c.getAttribute(g));if(null!=h&&"data:"!=h.substring(0,5)){var m=e[h];null==m?(f++,this.convertImageToDataUri(h,function(d){null!=d&&(e[h]=d,c.setAttribute(g,
|
||||
d));f--;0==f&&b(a)})):c.setAttribute(g,m)}else null!=h&&c.setAttribute(g,h)})(h[m])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g){try{var f=d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);e=null!=e?e:!0;var h=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText();if(f){if((9==document.documentMode||10==document.documentMode)&&
|
||||
"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),e=0;e<a.length;e++)d[e]=String.fromCharCode(a[e]);d=d.join("")}g=null!=g?g:"data:image/png;base64,";d=g+this.base64Encode(d)}b(d)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},f,this.timeout,function(){e&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:h})})});h()}catch(u){null!=c&&c(u)}};EditorUi.prototype.isCorsEnabledForUrl=
|
||||
|
@ -8062,54 +8062,54 @@ d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.pro
|
|||
function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(q){c(q)}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline()?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,
|
||||
f=null;d.getModel().beginUpdate();try{f=d.insertVertex(null,null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=center;verticalAlign=middle;"),d.updateCellSize(f,!0)}finally{d.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,c,d,e,g,k){g=null!=g?g:!0;k=null!=k?k:!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()&&(e||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var f=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var h=this.extractGraphModelFromPng(a),m=this.importXml(h,b,c,g,!0);if(0<m.length)return m}if("data:image/svg+xml;"==a.substring(0,19))try{if(h=null,"data:image/svg+xml;base64,"==a.substring(0,
|
||||
26)?(h=a.substring(a.indexOf(",")+1),h=window.atob&&!mxClient.IS_SF?atob(h):Base64.decode(h,!0)):h=decodeURIComponent(a.substring(a.indexOf(",")+1)),m=this.importXml(h,b,c,g,!0),0<m.length)return m}catch(E){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
||||
26)?(h=a.substring(a.indexOf(",")+1),h=window.atob&&!mxClient.IS_SF?atob(h):Base64.decode(h,!0)):h=decodeURIComponent(a.substring(a.indexOf(",")+1)),m=this.importXml(h,b,c,g,!0),0<m.length)return m}catch(D){}this.loadImage(a,mxUtils.bind(this,function(d){if("data:"==a.substring(0,5))this.resizeImage(d,a,mxUtils.bind(this,function(a,d,e){f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),d,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
||||
this.convertDataUri(a)+";"))}),k,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/d.width,this.maxImageSize/d.height)),g=Math.round(d.width*e);d=Math.round(d.height*e);f.setSelectionCell(f.insertVertex(null,null,"",f.snap(b),f.snap(c),g,d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),
|
||||
null,a,f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.updateCellSize(e),f.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{f.getModel().endUpdate()}f.setSelectionCell(e)}))}else{a=this.editor.graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,g);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,g))}),mxUtils.bind(this,function(a){this.handleError(a)}));
|
||||
else{f=this.editor.graph;e=null;f.getModel().beginUpdate();try{e=f.insertVertex(f.getDefaultParent(),null,"",f.snap(b),f.snap(c),1,1,"text;"+(d?"html=1;":"")),f.fireEvent(new mxEventObject("textInserted","cells",[e])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),e.value=a,f.updateCellSize(e),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(e.value)&&
|
||||
f.setLinkForCell(e,e.value),e.geometry.width+=f.gridSize,e.geometry.height+=f.gridSize}finally{f.getModel().endUpdate()}return[e]}}return[]};EditorUi.prototype.formatFileSize=function(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)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&
|
||||
this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var c=new Blob([a],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(a){this.importXml(a)}),
|
||||
null,b)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,c,d,e,g,k,l,u,n,E){n=null!=n?n:!0;var f=!1,h=null,m=mxUtils.bind(this,function(a){var b=
|
||||
null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,k)):b=this.importXml(a,c,d,n);null!=l&&l(b)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=E?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(h=this.importXml(b,c,d,n),u=!0)),u||(h=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),n&&h.isGridEnabled()&&(c=h.snap(c),d=h.snap(d)),h=[h.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
||||
null,b)}else this.editor.graph.setSelectionCells(this.importXml(a))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,c,d,e,g,k,l,u,n,D){n=null!=n?n:!0;var f=!1,h=null,m=mxUtils.bind(this,function(a){var b=
|
||||
null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,k)):b=this.importXml(a,c,d,n);null!=l&&l(b)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=D?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(h=this.importXml(b,c,d,n),u=!0)),u||(h=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),n&&h.isGridEnabled()&&(c=h.snap(c),d=h.snap(d)),h=[h.insertVertex(null,null,"",c,d,e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
|
||||
a+";")])):/(\.*<graphml )/.test(a)?(f=!0,this.importGraphML(a,m)):null!=u&&null!=k&&(/(\.v(dx|sdx?))($|\?)/i.test(k)||/(\.vs(x|sx?))($|\?)/i.test(k))?(f=!0,this.importVisio(u,m)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,k)?(f=!0,this.parseFile(null!=u?u:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=l&&l(null))}),k)):/(\.v(sd|dx))($|\?)/i.test(k)||/(\.vs(s|x))($|\?)/i.test(k)||
|
||||
(h=this.insertTextAt(this.validateFileData(a),c,d,!0,null,n));f||null==l||l(h);return h};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,g;c<d;){f=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);b+="==";break}e=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);
|
||||
b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);b+=
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,k,l,u,n,E,C){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;n=null!=n?n:this.maxImageBytes;var f=null!=b&&null!=c,h=!0,m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=E||this.resampleThreshold,w=0;w<a.length;w++)if("image/"==a[w].type.substring(0,6)&&a[w].size>p){m=!0;break}var q=mxUtils.bind(this,function(){var m=this.editor.graph,u=m.gridSize;
|
||||
e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,h,m,k){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,d,e,g,h,m,k,f,C)});g=null!=g?g:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,w=p,q=[],v=mxUtils.bind(this,function(a,b){q[a]=b;if(0==--w){this.spinner.stop();if(null!=l)l(q);else{var c=[];m.getModel().beginUpdate();
|
||||
try{for(var d=0;d<q.length;d++){var f=q[d]();null!=f&&(c=c.concat(f))}}finally{m.getModel().endUpdate()}}g(c)}}),t=0;t<p;t++)mxUtils.bind(this,function(f){var g=a[f],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==k||k(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var l=a.target.result,p=l.indexOf(","),w=decodeURIComponent(escape(atob(l.substring(p+1)))),q=mxUtils.parseXml(w),w=q.getElementsByTagName("svg");if(0<w.length){var w=w[0],t=C?null:w.getAttribute("content");
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,k,l,u,n,D,E){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;n=null!=n?n:this.maxImageBytes;var f=null!=b&&null!=c,h=!0,m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=D||this.resampleThreshold,w=0;w<a.length;w++)if("image/"==a[w].type.substring(0,6)&&a[w].size>p){m=!0;break}var q=mxUtils.bind(this,function(){var m=this.editor.graph,u=m.gridSize;
|
||||
e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,g,h,m,k){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,h)),null):this.importFile(a,b,c,d,e,g,h,m,k,f,E)});g=null!=g?g:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var p=a.length,w=p,q=[],v=mxUtils.bind(this,function(a,b){q[a]=b;if(0==--w){this.spinner.stop();if(null!=l)l(q);else{var c=[];m.getModel().beginUpdate();
|
||||
try{for(var d=0;d<q.length;d++){var f=q[d]();null!=f&&(c=c.concat(f))}}finally{m.getModel().endUpdate()}}g(c)}}),t=0;t<p;t++)mxUtils.bind(this,function(f){var g=a[f],l=new FileReader;l.onload=mxUtils.bind(this,function(a){if(null==k||k(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var l=a.target.result,p=l.indexOf(","),w=decodeURIComponent(escape(atob(l.substring(p+1)))),q=mxUtils.parseXml(w),w=q.getElementsByTagName("svg");if(0<w.length){var w=w[0],t=E?null:w.getAttribute("content");
|
||||
null!=t&&"<"!=t.charAt(0)&&"%"!=t.charAt(0)&&(t=unescape(window.atob?atob(t):Base64.decode(t,!0)));null!=t&&"%"==t.charAt(0)&&(t=decodeURIComponent(t));null==t||"<mxfile "!==t.substring(0,8)&&"<mxGraphModel "!==t.substring(0,14)?v(f,mxUtils.bind(this,function(){try{if(l.substring(0,p+1),null!=q){var a=q.getElementsByTagName("svg");if(0<a.length){var h=a[0],k=parseFloat(h.getAttribute("width")),n=parseFloat(h.getAttribute("height")),w=h.getAttribute("viewBox");if(null==w||0==w.length)h.setAttribute("viewBox",
|
||||
"0 0 "+k+" "+n);else if(isNaN(k)||isNaN(n)){var t=w.split(" ");3<t.length&&(k=parseFloat(t[2]),n=parseFloat(t[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var v=Math.min(1,Math.min(d/Math.max(1,k)),d/Math.max(1,n)),C=e(l,g.type,b+f*u,c+f*u,Math.max(1,Math.round(k*v)),Math.max(1,Math.round(n*v)),g.name);if(isNaN(k)||isNaN(n)){var y=new Image;y.onload=mxUtils.bind(this,function(){k=Math.max(1,y.width);n=Math.max(1,y.height);C[0].geometry.width=k;C[0].geometry.height=n;h.setAttribute("viewBox","0 0 "+
|
||||
k+" "+n);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));m.setCellStyles("image",l,[C[0]])});y.src=this.createSvgDataUri(mxUtils.getXml(h))}return C}}}catch(ma){}return null})):v(f,mxUtils.bind(this,function(){return e(t,"text/xml",b+f*u,c+f*u,0,0,g.name)}))}else v(f,mxUtils.bind(this,function(){return null}))}else{w=!1;if("image/png"==g.type){var y=C?null:this.extractGraphModelFromPng(a.target.result);if(null!=y&&0<y.length){var x=
|
||||
"0 0 "+k+" "+n);else if(isNaN(k)||isNaN(n)){var t=w.split(" ");3<t.length&&(k=parseFloat(t[2]),n=parseFloat(t[3]))}l=this.createSvgDataUri(mxUtils.getXml(h));var v=Math.min(1,Math.min(d/Math.max(1,k)),d/Math.max(1,n)),E=e(l,g.type,b+f*u,c+f*u,Math.max(1,Math.round(k*v)),Math.max(1,Math.round(n*v)),g.name);if(isNaN(k)||isNaN(n)){var D=new Image;D.onload=mxUtils.bind(this,function(){k=Math.max(1,D.width);n=Math.max(1,D.height);E[0].geometry.width=k;E[0].geometry.height=n;h.setAttribute("viewBox","0 0 "+
|
||||
k+" "+n);l=this.createSvgDataUri(mxUtils.getXml(h));var a=l.indexOf(";");0<a&&(l=l.substring(0,a)+l.substring(l.indexOf(",",a+1)));m.setCellStyles("image",l,[E[0]])});D.src=this.createSvgDataUri(mxUtils.getXml(h))}return E}}}catch(ma){}return null})):v(f,mxUtils.bind(this,function(){return e(t,"text/xml",b+f*u,c+f*u,0,0,g.name)}))}else v(f,mxUtils.bind(this,function(){return null}))}else{w=!1;if("image/png"==g.type){var y=E?null:this.extractGraphModelFromPng(a.target.result);if(null!=y&&0<y.length){var x=
|
||||
new Image;x.src=a.target.result;v(f,mxUtils.bind(this,function(){return e(y,"text/xml",b+f*u,c+f*u,x.width,x.height,g.name)}));w=!0}}w||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(m){this.resizeImage(m,a.target.result,
|
||||
mxUtils.bind(this,function(m,k,l){v(f,mxUtils.bind(this,function(){if(null!=m&&m.length<n){var p=h&&this.isResampleImage(a.target.result,E)?Math.min(1,Math.min(d/k,d/l)):1;return e(m,g.type,b+f*u,c+f*u,Math.round(k*p),Math.round(l*p),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),h,d,E)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*u,c+f*u,240,160,g.name,function(a){v(f,
|
||||
mxUtils.bind(this,function(m,k,l){v(f,mxUtils.bind(this,function(){if(null!=m&&m.length<n){var p=h&&this.isResampleImage(a.target.result,D)?Math.min(1,Math.min(d/k,d/l)):1;return e(m,g.type,b+f*u,c+f*u,Math.round(k*p),Math.round(l*p),g.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),h,d,D)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*u,c+f*u,240,160,g.name,function(a){v(f,
|
||||
function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*u,c+f*u,240,160,g.name,function(a){v(f,function(){return a})},g):"image"==g.type.substring(0,5)?l.readAsDataURL(g):l.readAsText(g)})(t)});m?this.confirmImageResize(function(a){h=a;q()},u):q()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?
|
||||
mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
|
||||
mxClient.IS_CHROMEAPP?220:200,!0,!0):f(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),h=Math.max(1,a.height);
|
||||
if(d&&this.isResampleImage(b,g))try{var m=Math.max(f/e,h/e);if(1<m){var k=Math.round(f/m),l=Math.round(h/m),n=document.createElement("canvas");n.width=k;n.height=l;n.getContext("2d").drawImage(a,0,0,k,l);var p=n.toDataURL();if(p.length<b.length){var q=document.createElement("canvas");q.width=k;q.height=l;var t=q.toDataURL();p!==t&&(b=p,f=k,h=l)}}}catch(B){}c(b,f,h)};EditorUi.prototype.crcTable=[];for(var b=0;256>b;b++)for(var d=b,e=0;8>e;e++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[b]=
|
||||
if(d&&this.isResampleImage(b,g))try{var m=Math.max(f/e,h/e);if(1<m){var k=Math.round(f/m),l=Math.round(h/m),n=document.createElement("canvas");n.width=k;n.height=l;n.getContext("2d").drawImage(a,0,0,k,l);var p=n.toDataURL();if(p.length<b.length){var q=document.createElement("canvas");q.width=k;q.height=l;var t=q.toDataURL();p!==t&&(b=p,f=k,h=l)}}}catch(A){}c(b,f,h)};EditorUi.prototype.crcTable=[];for(var b=0;256>b;b++)for(var d=b,e=0;8>e;e++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[b]=
|
||||
d;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b[c+f])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<
|
||||
16)+(a.charCodeAt(0)<<24)}function h(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,k);do{var m=g(a);if("IDAT"==f(a,4)){e=a.substring(0,k-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,
|
||||
b,0,4);d=this.updateCRC(d,c,0,c.length);e+=h(c.length)+b+c+h(d^4294967295);e+=a.substring(k-8,a.length);break}e+=a.substring(k-8,k-4+m);f(a,m);f(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,f){a=d.substring(a+8,a+8+f);"zTXt"==c?(f=a.indexOf(String.fromCharCode(0)),
|
||||
"mxGraphModel"==a.substring(0,f)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(f+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(q){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=
|
||||
c);d.src=a};var g=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),c=!0}catch(A){a.handleError(A)}return c};var c=this.clearDefaultStyle;this.clearDefaultStyle=function(){c.apply(this,
|
||||
c);d.src=a};var g=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),c=!0}catch(B){a.handleError(B)}return c};var c=this.clearDefaultStyle;this.clearDefaultStyle=function(){c.apply(this,
|
||||
arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var c=0;c<a.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};
|
||||
var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null!=c&&b.isCustomLink(c)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&b.customLinkClicked(c)&&mxEvent.consume(a);null!=f&&f(a,c)};e.call(this,a,c,d)};g.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,
|
||||
360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:k.apply(this,arguments)};var l=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var e=c.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))l.apply(this,
|
||||
arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var n=this.actions.get("print");n.setEnabled(!mxClient.IS_IOS||!navigator.standalone);n.visible=n.isEnabled();if(!this.editor.chromeless||this.editor.editable){var u=function(){window.setTimeout(function(){w.innerHTML=" ";
|
||||
w.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||
|
||||
b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,e=0;e<c.types.length;e++)if("text/"===c.types[e].substring(0,5)){d=!0;break}if(!d){var f=c.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,
|
||||
6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(Q){}}),!1);var w=document.createElement("div");w.style.position="absolute";w.style.whiteSpace="nowrap";w.style.overflow="hidden";w.style.display="block";w.contentEditable=!0;mxUtils.setOpacity(w,0);w.style.width="1px";w.style.height="1px";w.innerHTML=" ";var E=!1;this.keyHandler.bindControlKey(88,null);
|
||||
this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||E||(w.style.left=b.container.scrollLeft+10+"px",w.style.top=b.container.scrollTop+10+"px",b.container.appendChild(w),
|
||||
E=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){w.focus();document.execCommand("selectAll",!1,null)},0):(w.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!E||224!=c&&17!=c&&91!=c||(E=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),w.parentNode.removeChild(w),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(w,
|
||||
"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(w),u())}));mxEvent.addListener(w,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(w,!0),u())}));mxEvent.addListener(w,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(w.innerHTML=" ",w.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,w);w.innerHTML=" "}),0))}),!0);var C=this.isSelectionAllowed;this.isSelectionAllowed=
|
||||
function(a){return mxEvent.getSource(a)==w?!0:C.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),
|
||||
6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var h=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],h.x,h.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(Q){}}),!1);var w=document.createElement("div");w.style.position="absolute";w.style.whiteSpace="nowrap";w.style.overflow="hidden";w.style.display="block";w.contentEditable=!0;mxUtils.setOpacity(w,0);w.style.width="1px";w.style.height="1px";w.innerHTML=" ";var D=!1;this.keyHandler.bindControlKey(88,null);
|
||||
this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||D||(w.style.left=b.container.scrollLeft+10+"px",w.style.top=b.container.scrollTop+10+"px",b.container.appendChild(w),
|
||||
D=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){w.focus();document.execCommand("selectAll",!1,null)},0):(w.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!D||224!=c&&17!=c&&91!=c||(D=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),w.parentNode.removeChild(w),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(w,
|
||||
"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(w),u())}));mxEvent.addListener(w,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(w,!0),u())}));mxEvent.addListener(w,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(w.innerHTML=" ",w.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,w);w.innerHTML=" "}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=
|
||||
function(a){return mxEvent.getSource(a)==w?!0:E.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),
|
||||
mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=
|
||||
0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,Math.min(e/Math.max(1,d)),e/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=
|
||||
mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){n=document.createElement("div");n.style.position="absolute";n.style.top="95px";n.style.left="250px";n.style.width="2000px";n.style.height="30px";n.style.background=
|
||||
"whiteSmoke";document.body.appendChild(n);var y=document.createElement("div");y.style.position="absolute";y.style.top="125px";y.style.left="220px";y.style.width="30px";y.style.height="1000px";y.style.background="whiteSmoke";document.body.appendChild(y);var z=document.createElement("div");z.style.position="absolute";z.style.top="95px";z.style.left="220px";z.style.width="30px";z.style.height="30px";z.style.background="whiteSmoke";document.body.appendChild(z);this.vRuler=new mxRuler(this.editor.graph,
|
||||
y,!0);this.hRuler=new mxRuler(this.editor.graph,n,!1)}if("1"==urlParams.styledev){n=document.getElementById("geFooter");null!=n&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,
|
||||
function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var H=this.isSelectionAllowed;
|
||||
this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:H.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var B=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=B&&(B.parentNode.removeChild(B),B=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==
|
||||
B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=B&&(B.parentNode.removeChild(B),B=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale,f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,
|
||||
function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),n.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var F=this.isSelectionAllowed;
|
||||
this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:F.apply(this,arguments)}}n=document.getElementById("geInfo");null!=n&&n.parentNode.removeChild(n);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var A=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=A&&(A.parentNode.removeChild(A),A=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==
|
||||
A&&(!mxClient.IS_IE||10<document.documentMode)&&(A=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=A&&(A.parentNode.removeChild(A),A=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,e=b.view.scale,f=c.x/e-d.x,g=c.y/e-d.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,
|
||||
f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var h=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=k;var m=null,d=c.getElementsByTagName("img");
|
||||
null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var u=!0,l=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,f,g,!0,m,null,u))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){u=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,
|
||||
function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
|
||||
|
@ -8129,7 +8129,7 @@ this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(ne
|
|||
null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var f=document.documentElement;d=(e.clientWidth||f.clientWidth)-3;e=Math.max(e.clientHeight||0,f.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;f=document.createElement("div");f.style.zIndex=mxPopupMenu.prototype.zIndex+2;f.style.border="3px dotted rgb(254, 137, 12)";f.style.pointerEvents="none";f.style.position="absolute";
|
||||
f.style.top=b+"px";f.style.left=c+"px";f.style.width=Math.max(0,d-3)+"px";f.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(f):document.body.appendChild(f);return f};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,
|
||||
c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==
|
||||
a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(e)||/(\.vs(x|sx?))($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();
|
||||
a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,e,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(e)||/(\.vs(x|sx?))($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();
|
||||
f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.convertLucidChart(d,
|
||||
mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,e,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(w){this.handleError(w,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,
|
||||
9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,e,b)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=
|
||||
|
@ -8142,47 +8142,47 @@ function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(
|
|||
this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,
|
||||
bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,f=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,f);mxEvent.addListener(window,
|
||||
"message",mxUtils.bind(this,function(f){if(f.source==(window.opener||window.parent)){var h=f.data,k=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=this.editor.graph.decompress(a)))}catch(M){}return a});
|
||||
if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(G){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();k=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&
|
||||
if("json"==urlParams.proto){try{h=JSON.parse(h)}catch(H){h=null}if(null==h)return;if("dialog"==h.action){this.showError(null!=h.titleKey?mxResources.get(h.titleKey):h.title,null!=h.messageKey?mxResources.get(h.messageKey):h.message,null!=h.buttonKey?mxResources.get(h.buttonKey):h.button);null!=h.modified&&(this.editor.modified=h.modified);return}if("prompt"==h.action){this.spinner.stop();k=new FilenameDialog(this,h.defaultValue||"",null!=h.okKey?mxResources.get(h.okKey):null,function(a){null!=a&&
|
||||
g.postMessage(JSON.stringify({event:"prompt",value:a,message:h}),"*")},null!=h.titleKey?mxResources.get(h.titleKey):h.title);this.showDialog(k.container,300,80,!0,!1);k.init();return}if("draft"==h.action){var m=k(h.xml);this.spinner.stop();k=new DraftDialog(this,mxResources.get("draftFound",[h.name||this.defaultFilename]),m,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:h}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",
|
||||
result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(G){g.postMessage(JSON.stringify({event:"draft",error:G.toString(),message:h}),"*")}return}if("template"==
|
||||
result:"discard",message:h}),"*")}),h.editKey?mxResources.get(h.editKey):null,h.discardKey?mxResources.get(h.discardKey):null,h.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:h}),"*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(H){g.postMessage(JSON.stringify({event:"draft",error:H.toString(),message:h}),"*")}return}if("template"==
|
||||
h.action){this.spinner.stop();k=1==h.enableRecent;m=1==h.enableSearch;k=new NewDialog(this,!1,null!=h.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=h.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.recentReadyCallback=a;g.postMessage(JSON.stringify({event:"recentDocs"}),
|
||||
"*")}):null,m?mxUtils.bind(this,function(a,b){this.searchReadyCallback=b;g.postMessage(JSON.stringify({event:"searchDocs",searchStr:a}),"*")}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("searchDocsList"==h.action)this.searchReadyCallback(h.list,h.errorMsg);else if("recentDocsList"==h.action)this.recentReadyCallback(h.list,
|
||||
h.errorMsg);else{if("textContent"==h.action){this.editor.graph.setEnabled(!1);var l=this.editor.graph,k="";if(null!=this.pages)for(m=0;m<this.pages.length;m++){var n=l;this.currentPage!=this.pages[m]&&(n=this.createTemporaryGraph(l.getStylesheet()),n.model.setRoot(this.pages[m].root));k+=this.pages[m].getName()+" "+n.getIndexableText()+" "}else k=l.getIndexableText();this.editor.graph.setEnabled(!0);g.postMessage(JSON.stringify({event:"textContent",data:k,message:h}),"*");return}if("status"==h.action){null!=
|
||||
h.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(h.messageKey))):null!=h.message&&this.editor.setStatus(mxUtils.htmlEntities(h.message));null!=h.modified&&(this.editor.modified=h.modified);return}if("spinner"==h.action){var p=null!=h.messageKey?mxResources.get(h.messageKey):h.message;null==h.show||h.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==h.action){if("png"==h.format||"xmlpng"==h.format){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,
|
||||
null!=h.spinKey?mxResources.get(h.spinKey):h.spin)){var v=null!=h.xml?h.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var l=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=h.format;b.message=h;b.data=a;b.xml=encodeURIComponent(v);g.postMessage(JSON.stringify(b),"*")}),q=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==h.format&&(a=this.writeGraphModelToPng(a,"zTXt",
|
||||
"mxGraphModel",atob(this.editor.graph.compress(v))));l!=this.editor.graph&&l.container.parentNode.removeChild(l.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var l=this.createTemporaryGraph(l.getStylesheet()),x=l.getGlobalVariable,A=this.pages[0];l.getGlobalVariable=function(a){return"page"==a?A.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(l.container);l.model.setRoot(A.root)}this.exportToCanvas(mxUtils.bind(this,
|
||||
"mxGraphModel",atob(this.editor.graph.compress(v))));l!=this.editor.graph&&l.container.parentNode.removeChild(l.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var l=this.createTemporaryGraph(l.getStylesheet()),x=l.getGlobalVariable,B=this.pages[0];l.getGlobalVariable=function(a){return"page"==a?B.getName():"pagenumber"==a?1:x.apply(this,arguments)};document.body.appendChild(l.container);l.model.setRoot(B.root)}this.exportToCanvas(mxUtils.bind(this,
|
||||
function(a){q(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){q(null)}),null,null,null,null,null,null,l)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==h.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(v)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):q(null)}),mxUtils.bind(this,function(){q(null)}))}}else{null!=h.xml&&0<h.xml.length&&this.setFileData(h.xml);p=this.createLoadMessage("export");
|
||||
if("html2"==h.format||"html"==h.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),p.xml=mxUtils.getXml(k),p.data=this.getFileData(null,null,!0,null,null,null,k),p.format=h.format;else if("html"==h.format)v=this.editor.getGraphXml(),p.data=this.getHtml(v,this.editor.graph),p.xml=mxUtils.getXml(v),p.format=h.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);p.xml=this.getFileData(!0);p.format="svg";
|
||||
if(h.embedImages||null==h.embedImages){if(null==h.spin&&null==h.spinKey||this.spinner.spin(document.body,null!=h.spinKey?mxResources.get(h.spinKey):h.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==h.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
|
||||
this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(p),"*")}));return}k="xmlsvg"==h.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));p.data=this.createSvgDataUri(k)}g.postMessage(JSON.stringify(p),"*")}return}if("load"==h.action)d=1==h.autosave,this.hideDialog(),null!=h.modified&&null==urlParams.modified&&(urlParams.modified=h.modified),null!=h.saveAndExit&&null==urlParams.saveAndExit&&
|
||||
(urlParams.saveAndExit=h.saveAndExit),null!=h.title&&null!=this.buttonContainer&&(m=document.createElement("span"),mxUtils.write(m,h.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(m),this.embedFilenameSpan=
|
||||
m),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):h.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}var D=mxUtils.bind(this,function(f,h){c=!0;try{a(f,h)}catch(T){this.handleError(T)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var k=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=k();d&&null==b&&(b=mxUtils.bind(this,
|
||||
m),h=null!=h.xmlpng?this.extractGraphModelFromPng(h.xmlpng):h.xml;else{g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(h)}),"*");return}}}var C=mxUtils.bind(this,function(f,h){c=!0;try{a(f,h)}catch(T){this.handleError(T)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var k=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=k();d&&null==b&&(b=mxUtils.bind(this,
|
||||
function(a,b){var d=k();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",
|
||||
b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=h&&"function"===typeof h.substring&&"data:application/vnd.visio;base64,"==h.substring(0,34)?(k="0M8R4KGxGuE"==h.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(h.substring(h.indexOf(",")+
|
||||
1)),function(a){D(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),k)):null!=h&&"function"===typeof h.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(h,"")?this.parseFile(new Blob([h],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&D(a.responseText,f)}),""):null!=h&&"function"===typeof h.substring&&this.isLucidChartData(h)?this.convertLucidChart(h,
|
||||
mxUtils.bind(this,function(a){D(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(h=k(h),D(h,f))}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom=
|
||||
1)),function(a){C(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),k)):null!=h&&"function"===typeof h.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(h,"")?this.parseFile(new Blob([h],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&C(a.responseText,f)}),""):null!=h&&"function"===typeof h.substring&&this.isLucidChartData(h)?this.convertLucidChart(h,
|
||||
mxUtils.bind(this,function(a){C(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(h=k(h),C(h,f))}}));var g=window.opener||window.parent,f="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(f,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom=
|
||||
"2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",
|
||||
mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,
|
||||
"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,
|
||||
640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,h=null,k=null,l="",n="auto",C="auto",y=null,z=null,H=40,B=40,F=100,I=0,A=this.editor.graph;A.getGraphBounds();for(var D=function(){null!=b?b(ea):(A.setSelectionCells(ea),A.scrollCellToVisible(A.getSelectionCell()))},G=A.getFreeInsertPoint(),M=G.x,K=G.y,G=K,T=null,Q="auto",k=null,S=[],Z=null,Y=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<
|
||||
c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var X=a.indexOf(":");if(0<X){var R=mxUtils.trim(a.substring(1,X)),L=mxUtils.trim(a.substring(X+1));"label"==R?T=A.sanitizeHtml(L):"style"==R?f=L:"parentstyle"==R?g=L:"identity"==R&&0<L.length&&"-"!=L?h=L:"parent"==R&&0<L.length&&"-"!=L?k=L:"namespace"==R&&0<L.length&&"-"!=L?l=L:"width"==R?n=L:"height"==R?C=L:"left"==R&&0<L.length?y=L:"top"==R&&0<L.length?
|
||||
z=L:"ignore"==R?Y=L.split(","):"connect"==R?S.push(JSON.parse(L)):"link"==R?Z=L:"padding"==R?I=parseFloat(L):"edgespacing"==R?H=parseFloat(L):"nodespacing"==R?B=parseFloat(L):"levelspacing"==R?F=parseFloat(L):"layout"==R&&(Q=L)}}}var U=this.editor.csvToArray(c[N]),R=X=null;if(null!=h||null!=k)for(var O=0;O<U.length;O++)h==U[O]&&(X=O),k==U[O]&&(R=O);null==T&&(T="%"+U[0]+"%");if(null!=S)for(var P=0;P<S.length;P++)null==e[S[P].to]&&(e[S[P].to]={});A.model.beginUpdate();try{for(O=N+1;O<c.length;O++){var V=
|
||||
this.editor.csvToArray(c[O]);if(null==V){var ba=40<c[O].length?c[O].substring(0,40)+"...":c[O];throw Error(O+" ("+ba+") "+mxResources.get("containsValidationErrors"));}if(V.length==U.length){var J=null,ca=null!=X?l+V[X]:null;null!=ca&&(J=A.model.getCell(ca));null==J&&(J=new mxCell(T,new mxGeometry(M,G,0,0),f||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=ca);for(var W=0;W<V.length;W++)A.setAttributeForCell(J,U[W],V[W]);A.setAttributeForCell(J,"placeholders","1");J.style=A.replacePlaceholders(J,J.style);
|
||||
for(P=0;P<S.length;P++)e[S[P].to][J.getAttribute(S[P].to)]=J;null!=Z&&"link"!=Z&&(A.setLinkForCell(J,J.getAttribute(Z)),A.setAttributeForCell(J,Z,null));A.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var da=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=y&&null!=J.getAttribute(y)&&(J.geometry.x=M+parseFloat(J.getAttribute(y))),null!=z&&null!=J.getAttribute(z)&&(J.geometry.y=K+parseFloat(J.getAttribute(z))),"@"==n.charAt(0)&&null!=J.getAttribute(n.substring(1))?J.geometry.width=
|
||||
parseFloat(J.getAttribute(n.substring(1))):J.geometry.width="auto"==n?da.width+I:parseFloat(n),"@"==C.charAt(0)&&null!=J.getAttribute(C.substring(1))?J.geometry.height=parseFloat(J.getAttribute(C.substring(1))):J.geometry.height="auto"==C?da.height+I:parseFloat(C),G+=J.geometry.height+B);k=null!=R?A.model.getCell(l+V[R]):null;null!=k?(k.style=A.replacePlaceholders(k,g),A.addCell(J,k)):d.push(A.addCell(J))}}for(var fa=d.slice(),ea=d.slice(),P=0;P<S.length;P++)for(var aa=S[P],O=0;O<d.length;O++){var J=
|
||||
d[O],na=J.getAttribute(aa.from);if(null!=na){A.setAttributeForCell(J,aa.from,null);for(var ma=na.split(","),W=0;W<ma.length;W++){var ga=e[aa.to][ma[W]];null!=ga&&(T=aa.label,null!=aa.fromlabel&&(T=(J.getAttribute(aa.fromlabel)||"")+(T||"")),null!=aa.tolabel&&(T=(T||"")+(ga.getAttribute(aa.tolabel)||"")),ea.push(A.insertEdge(null,null,T||"",aa.invert?ga:J,aa.invert?J:ga,aa.style||A.createCurrentEdgeStyle())),mxUtils.remove(aa.invert?J:ga,fa))}}}if(null!=Y)for(O=0;O<d.length;O++)for(J=d[O],W=0;W<Y.length;W++)A.setAttributeForCell(J,
|
||||
mxUtils.trim(Y[W]),null);var ja=new mxParallelEdgeLayout(A);ja.spacing=H;var oa=function(){ja.execute(A.getDefaultParent());for(var a=0;a<d.length;a++){var b=A.getCellGeometry(d[a]);b.x=Math.round(A.snap(b.x));b.y=Math.round(A.snap(b.y));"auto"==n&&(b.width=Math.round(A.snap(b.width)));"auto"==C&&(b.height=Math.round(A.snap(b.height)))}};if("circle"==Q){var ka=new mxCircleLayout(A);ka.resetEdges=!1;var pa=ka.isVertexIgnored;ka.isVertexIgnored=function(a){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,
|
||||
a)};this.executeLayout(function(){ka.execute(A.getDefaultParent());oa()},!0,D);D=null}else if("horizontaltree"==Q||"verticaltree"==Q||"auto"==Q&&ea.length==2*d.length-1&&1==fa.length){A.view.validate();var la=new mxCompactTreeLayout(A,"horizontaltree"==Q);la.levelDistance=B;la.edgeRouting=!1;la.resetEdges=!1;this.executeLayout(function(){la.execute(A.getDefaultParent(),0<fa.length?fa[0]:null)},!0,D);D=null}else if("horizontalflow"==Q||"verticalflow"==Q||"auto"==Q&&1==fa.length){A.view.validate();
|
||||
var ha=new mxHierarchicalLayout(A,"horizontalflow"==Q?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=B;ha.parallelEdgeSpacing=H;ha.interRankCellSpacing=F;ha.disableEdgeStyle=!1;this.executeLayout(function(){ha.execute(A.getDefaultParent(),ea);A.moveCells(ea,M,K)},!0,D);D=null}else if("organic"==Q||"auto"==Q&&ea.length>d.length){A.view.validate();var ia=new mxFastOrganicLayout(A);ia.forceConstant=3*B;ia.resetEdges=!1;var qa=ia.isVertexIgnored;ia.isVertexIgnored=function(a){return qa.apply(this,
|
||||
arguments)||0>mxUtils.indexOf(d,a)};ja=new mxParallelEdgeLayout(A);ja.spacing=H;this.executeLayout(function(){ia.execute(A.getDefaultParent());oa()},!0,D);D=null}this.hideDialog()}finally{A.model.endUpdate()}null!=D&&D()}}catch(ra){this.handleError(ra)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=
|
||||
640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,h=null,k=null,l="",n="auto",E="auto",y=null,z=null,F=40,A=40,G=100,I=0,B=this.editor.graph;B.getGraphBounds();for(var C=function(){null!=b?b(ea):(B.setSelectionCells(ea),B.scrollCellToVisible(B.getSelectionCell()))},H=B.getFreeInsertPoint(),M=H.x,K=H.y,H=K,T=null,Q="auto",k=null,S=[],Z=null,Y=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<
|
||||
c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var X=a.indexOf(":");if(0<X){var R=mxUtils.trim(a.substring(1,X)),L=mxUtils.trim(a.substring(X+1));"label"==R?T=B.sanitizeHtml(L):"style"==R?f=L:"parentstyle"==R?g=L:"identity"==R&&0<L.length&&"-"!=L?h=L:"parent"==R&&0<L.length&&"-"!=L?k=L:"namespace"==R&&0<L.length&&"-"!=L?l=L:"width"==R?n=L:"height"==R?E=L:"left"==R&&0<L.length?y=L:"top"==R&&0<L.length?
|
||||
z=L:"ignore"==R?Y=L.split(","):"connect"==R?S.push(JSON.parse(L)):"link"==R?Z=L:"padding"==R?I=parseFloat(L):"edgespacing"==R?F=parseFloat(L):"nodespacing"==R?A=parseFloat(L):"levelspacing"==R?G=parseFloat(L):"layout"==R&&(Q=L)}}}var U=this.editor.csvToArray(c[N]),R=X=null;if(null!=h||null!=k)for(var O=0;O<U.length;O++)h==U[O]&&(X=O),k==U[O]&&(R=O);null==T&&(T="%"+U[0]+"%");if(null!=S)for(var P=0;P<S.length;P++)null==e[S[P].to]&&(e[S[P].to]={});B.model.beginUpdate();try{for(O=N+1;O<c.length;O++){var V=
|
||||
this.editor.csvToArray(c[O]);if(null==V){var ba=40<c[O].length?c[O].substring(0,40)+"...":c[O];throw Error(O+" ("+ba+") "+mxResources.get("containsValidationErrors"));}if(V.length==U.length){var J=null,ca=null!=X?l+V[X]:null;null!=ca&&(J=B.model.getCell(ca));null==J&&(J=new mxCell(T,new mxGeometry(M,H,0,0),f||"whiteSpace=wrap;html=1;"),J.vertex=!0,J.id=ca);for(var W=0;W<V.length;W++)B.setAttributeForCell(J,U[W],V[W]);B.setAttributeForCell(J,"placeholders","1");J.style=B.replacePlaceholders(J,J.style);
|
||||
for(P=0;P<S.length;P++)e[S[P].to][J.getAttribute(S[P].to)]=J;null!=Z&&"link"!=Z&&(B.setLinkForCell(J,J.getAttribute(Z)),B.setAttributeForCell(J,Z,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var da=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=y&&null!=J.getAttribute(y)&&(J.geometry.x=M+parseFloat(J.getAttribute(y))),null!=z&&null!=J.getAttribute(z)&&(J.geometry.y=K+parseFloat(J.getAttribute(z))),"@"==n.charAt(0)&&null!=J.getAttribute(n.substring(1))?J.geometry.width=
|
||||
parseFloat(J.getAttribute(n.substring(1))):J.geometry.width="auto"==n?da.width+I:parseFloat(n),"@"==E.charAt(0)&&null!=J.getAttribute(E.substring(1))?J.geometry.height=parseFloat(J.getAttribute(E.substring(1))):J.geometry.height="auto"==E?da.height+I:parseFloat(E),H+=J.geometry.height+A);k=null!=R?B.model.getCell(l+V[R]):null;null!=k?(k.style=B.replacePlaceholders(k,g),B.addCell(J,k)):d.push(B.addCell(J))}}for(var fa=d.slice(),ea=d.slice(),P=0;P<S.length;P++)for(var aa=S[P],O=0;O<d.length;O++){var J=
|
||||
d[O],na=J.getAttribute(aa.from);if(null!=na){B.setAttributeForCell(J,aa.from,null);for(var ma=na.split(","),W=0;W<ma.length;W++){var ga=e[aa.to][ma[W]];null!=ga&&(T=aa.label,null!=aa.fromlabel&&(T=(J.getAttribute(aa.fromlabel)||"")+(T||"")),null!=aa.tolabel&&(T=(T||"")+(ga.getAttribute(aa.tolabel)||"")),ea.push(B.insertEdge(null,null,T||"",aa.invert?ga:J,aa.invert?J:ga,aa.style||B.createCurrentEdgeStyle())),mxUtils.remove(aa.invert?J:ga,fa))}}}if(null!=Y)for(O=0;O<d.length;O++)for(J=d[O],W=0;W<Y.length;W++)B.setAttributeForCell(J,
|
||||
mxUtils.trim(Y[W]),null);var ja=new mxParallelEdgeLayout(B);ja.spacing=F;var oa=function(){ja.execute(B.getDefaultParent());for(var a=0;a<d.length;a++){var b=B.getCellGeometry(d[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==n&&(b.width=Math.round(B.snap(b.width)));"auto"==E&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==Q){var ka=new mxCircleLayout(B);ka.resetEdges=!1;var pa=ka.isVertexIgnored;ka.isVertexIgnored=function(a){return pa.apply(this,arguments)||0>mxUtils.indexOf(d,
|
||||
a)};this.executeLayout(function(){ka.execute(B.getDefaultParent());oa()},!0,C);C=null}else if("horizontaltree"==Q||"verticaltree"==Q||"auto"==Q&&ea.length==2*d.length-1&&1==fa.length){B.view.validate();var la=new mxCompactTreeLayout(B,"horizontaltree"==Q);la.levelDistance=A;la.edgeRouting=!1;la.resetEdges=!1;this.executeLayout(function(){la.execute(B.getDefaultParent(),0<fa.length?fa[0]:null)},!0,C);C=null}else if("horizontalflow"==Q||"verticalflow"==Q||"auto"==Q&&1==fa.length){B.view.validate();
|
||||
var ha=new mxHierarchicalLayout(B,"horizontalflow"==Q?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);ha.intraCellSpacing=A;ha.parallelEdgeSpacing=F;ha.interRankCellSpacing=G;ha.disableEdgeStyle=!1;this.executeLayout(function(){ha.execute(B.getDefaultParent(),ea);B.moveCells(ea,M,K)},!0,C);C=null}else if("organic"==Q||"auto"==Q&&ea.length>d.length){B.view.validate();var ia=new mxFastOrganicLayout(B);ia.forceConstant=3*A;ia.resetEdges=!1;var qa=ia.isVertexIgnored;ia.isVertexIgnored=function(a){return qa.apply(this,
|
||||
arguments)||0>mxUtils.indexOf(d,a)};ja=new mxParallelEdgeLayout(B);ja.spacing=F;this.executeLayout(function(){ia.execute(B.getDefaultParent());oa()},!0,C);C=null}this.hideDialog()}finally{B.model.endUpdate()}null!=C&&C()}}catch(ra){this.handleError(ra)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=
|
||||
window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,
|
||||
!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var 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,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||
|
||||
c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;c++;return c};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);
|
||||
c++;c++;return c};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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var d=applicationCache;if(null!=d&&null==
|
||||
this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var d=window.applicationCache,e=null,b=mxUtils.bind(this,function(){var a=d.status,b;a==d.CHECKING&&(a=d.DOWNLOADING);switch(a){case d.UNCACHED:b="";break;case d.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case d.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
|
@ -8347,7 +8347,7 @@ DriveClient.prototype.saveFile=function(a,c,b,d,e,g,k,l){if(a.isEditable()){var
|
|||
a.getChannelKey()&&l.push({key:"key",value:Editor.guid(32)}),l.push({key:"secret",value:Editor.guid(32)}));h||(null!=e||g||(e=this.placeholderThumbnail,f=this.placeholderMimeType),null!=e&&null!=f&&(q.thumbnail={image:e,mimeType:f}));var u=mxUtils.bind(this,function(){a.saveDelay=(new Date).getTime()-n;b.apply(this,arguments);null!=m&&(this.executeRequest(gapi.client.drive.revisions.get({fileId:m.id,revisionId:m.headRevisionId,supportsTeamDrives:!0}),mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=
|
||||
!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:m.id,revisionId:m.headRevisionId,resource:a}))}))),EditorUi.logEvent({category:"RT-CONVERT-"+a.convertedFrom,action:"from-"+m.id+"."+m.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId+"-",label:null!=this.user?this.user.id:"unknown-user"}))}),w=mxUtils.bind(this,function(b,e){null!=l&&(q.properties=l);var f=k||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),g=0,h=mxUtils.bind(this,
|
||||
function(k){var m=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),q,b,c||k||m,e,k?null:f,p),u,mxUtils.bind(this,function(b){a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){if(null!=c&&c.etag==f)if(g<this.maxRetries)g++,window.setTimeout(h,2*g*this.coolOff*(1+.1*(Math.random()-
|
||||
.5)));else{h(!0);try{EditorUi.sendReport("Warning: Stale Etag Overwrite "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(a.getId())+"\nUser="+(null!=this.user?this.ui.hashValue(this.user.id):"unknown")),EditorUi.logError("Warning: Stale Etag Overwrite",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(D){}}else null!=d&&d(b,c)}),mxUtils.bind(this,function(){null!=d&&d(b)})):d(b)}))});h(!1)});this.ui.useCanvasForExport&&
|
||||
.5)));else{h(!0);try{EditorUi.sendReport("Warning: Stale Etag Overwrite "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(a.getId())+"\nUser="+(null!=this.user?this.ui.hashValue(this.user.id):"unknown")),EditorUi.logError("Warning: Stale Etag Overwrite",null,a.desc.id+"."+a.desc.headRevisionId,null!=this.user?this.user.id:"unknown")}catch(C){}}else null!=d&&d(b,c)}),mxUtils.bind(this,function(){null!=d&&d(b)})):d(b)}))});h(!1)});this.ui.useCanvasForExport&&
|
||||
/(\.png)$/i.test(a.getTitle())?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){w(a,!0)}),d,this.ui.getCurrentFile()!=a?a.getData():null):w(a.getData(),!1)}),h=mxUtils.bind(this,function(){!g&&a.constructor!=DriveLibrary&&this.enableThumbnails&&"0"!=urlParams.thumb&&this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(q){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,
|
||||
"_");f(b,"image/png")}))||f(null,null,a.constructor!=DriveLibrary)});e||!c?h():this.verifyMimeType(a.getId(),h,!0)}else this.ui.editor.graph.reset(),null!=d&&d({message:mxResources.get("readOnly")})};
|
||||
DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(b||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!=
|
||||
|
@ -8681,18 +8681,19 @@ var c=document.createElement("img");mxUtils.setOpacity(c,50);c.style.height="16p
|
|||
var c=Menus.prototype.init;Menus.prototype.init=function(){c.apply(this,arguments);var a=this.editorUi,d=a.editor.graph,e=mxUtils.bind(d,d.isEnabled),g=("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode),k=("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode),l=("www.draw.io"==
|
||||
window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"legacy.draw.io"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode),n=("1"!=urlParams.embed&&"0"!=urlParams.tr||"1"==urlParams.embed&&"1"==urlParams.tr)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode);
|
||||
mxClient.IS_SVG||a.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,
|
||||
function(b,c,d,e,f,g,h,k,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,h,!k,l,m)}),!0,null,"svg")}));a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatXml"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(e);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),
|
||||
!1,d.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?"compressed":"allPages"),!0);g.style.marginBottom="16px";mxEvent.addListener(f,"change",function(){f.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",c?!g.checked:null,null,!f.checked,c?null:!g.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+
|
||||
"...",function(){a.showPublishLinkDialog(mxResources.get("url"),!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,h,k,l,m){a.createHtml(b,
|
||||
c,d,e,f,g,h,k,l,m,mxUtils.bind(this,function(b,c){var d=a.getBaseFilename(h),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,
|
||||
mxResources.get("formatPdf"))).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{var b=null==a.pages||1>=a.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatPdf"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(e);var e=function(){g!=this&&this.checked?k.removeAttribute("disabled"):(k.setAttribute("disabled","disabled"),k.checked=!1)},f=146;
|
||||
if(a.pdfPageExport&&!b){var g=a.addRadiobox(c,"pages",mxResources.get("allPages"),!0),f=a.addRadiobox(c,"pages",mxResources.get("currentPage",null,"Current Page"),!1),h=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),k=a.addCheckbox(c,mxResources.get("crop"),!1,!0);mxEvent.addListener(g,"change",e);mxEvent.addListener(f,"change",e);mxEvent.addListener(h,"change",e);f=205}else h=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),k=a.addCheckbox(c,
|
||||
mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport),a.pdfPageExport||mxEvent.addListener(h,"change",e);c=new CustomDialog(a,c,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!h.checked,b?!0:!g.checked,!k.checked)}),null,mxResources.get("export"));a.showDialog(c.container,300,f,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){function b(){a.fileLoaded(null)}var c=a.getCurrentFile();null!=c&&c.isModified()?a.confirm(mxResources.get("allChangesLost"),
|
||||
null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();if(1==d.getSelectionCount()){var b=d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();null!=b&&b.isRevisionHistorySupported()?
|
||||
a.spinner.spin(document.body,mxResources.get("loading"))&&b.getRevisions(mxUtils.bind(this,function(b){a.spinner.stop();b=new RevisionDialog(a,b);a.showDialog(b.container,640,480,!0,!0);b.init()}),mxUtils.bind(this,function(b){a.handleError(b)})):a.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");var f=a.actions.addAction("synchronize",function(){a.synchronizeCurrentFile("none"==
|
||||
DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(f.label=mxResources.get("refresh"));a.actions.addAction("upload...",function(){var b=a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b),null,!0))});"undefined"!==typeof MathJax&&(f=a.actions.addAction("mathematicalTypesetting",
|
||||
function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)}),f.setToggleAction(!0),f.setSelectedCallback(function(){return a.isMathEnabled()}),f.isEnabled=e);if(isLocalStorage||mxClient.IS_CHROMEAPP)f=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),f.setToggleAction(!0),f.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var h=
|
||||
a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});h.setToggleAction(!0);h.setSelectedCallback(function(){return h.isEnabled()&&a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=d.getSelectionCells(),c=[],e=0;e<b.length;e++)d.getModel().isVertex(b[e])&&c.push(b[e]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,200,250,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var m="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing arcSize".split(" ");
|
||||
function(b,c,d,e,f,g,h,k,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,h,!k,l,m)}),!0,null,"svg")}));a.actions.put("insertTemplate",new Action(mxResources.get("template")+"...",function(){var b=new NewDialog(a,null,!1,function(b){a.hideDialog();null!=b&&(d.setSelectionCells(a.importXml(b)),d.scrollCellToVisible(d.getSelectionCell()))},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));a.showDialog(b.container,620,440,!0,!0)}));a.actions.put("exportXml",
|
||||
new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatXml"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(e);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?"compressed":"allPages"),!0);g.style.marginBottom="16px";
|
||||
mxEvent.addListener(f,"change",function(){f.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",c?!g.checked:null,null,!f.checked,c?null:!g.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+"...",function(){a.showPublishLinkDialog(mxResources.get("url"),!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,
|
||||
a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,g,h,k,l,m){a.createHtml(b,c,d,e,f,g,h,k,l,m,mxUtils.bind(this,function(b,c){var d=a.getBaseFilename(h),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+
|
||||
mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,mxResources.get("formatPdf"))).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{var b=null==a.pages||1>=a.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";
|
||||
var e=document.createElement("h3");mxUtils.write(e,mxResources.get("formatPdf"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(e);var e=function(){g!=this&&this.checked?k.removeAttribute("disabled"):(k.setAttribute("disabled","disabled"),k.checked=!1)},f=146;if(a.pdfPageExport&&!b){var g=a.addRadiobox(c,"pages",mxResources.get("allPages"),!0),f=a.addRadiobox(c,"pages",mxResources.get("currentPage",null,"Current Page"),!1),h=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),
|
||||
!1,d.isSelectionEmpty()),k=a.addCheckbox(c,mxResources.get("crop"),!1,!0);mxEvent.addListener(g,"change",e);mxEvent.addListener(f,"change",e);mxEvent.addListener(h,"change",e);f=205}else h=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,d.isSelectionEmpty()),k=a.addCheckbox(c,mxResources.get("crop"),!d.pageVisible||!a.pdfPageExport,!a.pdfPageExport),a.pdfPageExport||mxEvent.addListener(h,"change",e);c=new CustomDialog(a,c,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!h.checked,
|
||||
b?!0:!g.checked,!k.checked)}),null,mxResources.get("export"));a.showDialog(c.container,300,f,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){function b(){a.fileLoaded(null)}var c=a.getCurrentFile();null!=c&&c.isModified()?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()});a.actions.addAction("editShape...",mxUtils.bind(this,function(){d.getSelectionCells();if(1==d.getSelectionCount()){var b=
|
||||
d.getSelectionCell(),c=d.view.getState(b);null!=c&&null!=c.shape&&null!=c.shape.stencil&&(b=new EditShapeDialog(a,b,mxResources.get("editShape")+":",630,400),a.showDialog(b.container,640,480,!0,!1),b.init())}}));a.actions.addAction("revisionHistory...",function(){var b=a.getCurrentFile();null!=b&&b.isRevisionHistorySupported()?a.spinner.spin(document.body,mxResources.get("loading"))&&b.getRevisions(mxUtils.bind(this,function(b){a.spinner.stop();b=new RevisionDialog(a,b);a.showDialog(b.container,640,
|
||||
480,!0,!0);b.init()}),mxUtils.bind(this,function(b){a.handleError(b)})):a.showError(mxResources.get("error"),mxResources.get("notAvailable"),mxResources.get("ok"))});a.actions.addAction("createRevision",function(){a.actions.get("save").funct()},null,null,Editor.ctrlKey+"+S");var f=a.actions.addAction("synchronize",function(){a.synchronizeCurrentFile("none"==DrawioFile.SYNC)},null,null,"Alt+Shift+S");"none"==DrawioFile.SYNC&&(f.label=mxResources.get("refresh"));a.actions.addAction("upload...",function(){var b=
|
||||
a.getCurrentFile();null!=b&&(window.drawdata=a.getFileData(),b=null!=b.getTitle()?b.getTitle():a.defaultFilename,a.openLink(window.location.protocol+"//"+window.location.host+"/?create=drawdata&"+(a.mode==App.MODE_DROPBOX?"mode=dropbox&":"")+"title="+encodeURIComponent(b),null,!0))});"undefined"!==typeof MathJax&&(f=a.actions.addAction("mathematicalTypesetting",function(){var b=new ChangePageSetup(a);b.ignoreColor=!0;b.ignoreImage=!0;b.mathEnabled=!a.isMathEnabled();d.model.execute(b)}),f.setToggleAction(!0),
|
||||
f.setSelectedCallback(function(){return a.isMathEnabled()}),f.isEnabled=e);if(isLocalStorage||mxClient.IS_CHROMEAPP)f=a.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),f.setToggleAction(!0),f.setSelectedCallback(function(){return mxSettings.getShowStartScreen()});var h=a.actions.addAction("autosave",function(){a.editor.setAutosave(!a.editor.autosave)});h.setToggleAction(!0);h.setSelectedCallback(function(){return h.isEnabled()&&
|
||||
a.editor.autosave});a.actions.addAction("editGeometry...",function(){for(var b=d.getSelectionCells(),c=[],e=0;e<b.length;e++)d.getModel().isVertex(b[e])&&c.push(b[e]);0<c.length&&(b=new EditGeometryDialog(a,c),a.showDialog(b.container,200,250,!0,!0),b.init())},null,null,Editor.ctrlKey+"+Shift+M");var m="rounded shadow dashed dashPattern fontFamily fontSize fontColor fontStyle align verticalAlign strokeColor strokeWidth fillColor gradientColor swimlaneFillColor textOpacity gradientDirection glass labelBackgroundColor labelBorderColor opacity spacing spacingTop spacingLeft spacingBottom spacingRight endFill endArrow endSize targetPerimeterSpacing startFill startArrow startSize sourcePerimeterSpacing arcSize".split(" ");
|
||||
a.actions.addAction("copyStyle",function(){var b=d.view.getState(d.getSelectionCell());if(d.isEnabled()&&null!=b){a.copiedStyle=mxUtils.clone(b.style);for(var b=d.getModel().getStyle(b.cell),b=null!=b?b.split(";"):[],c=0;c<b.length;c++){var e=b[c],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f),e=e.substring(f+1);null==a.copiedStyle[g]&&"none"==e&&(a.copiedStyle[g]="none")}}}},null,null,Editor.ctrlKey+"+Shift+C");a.actions.addAction("pasteStyle",function(){if(d.isEnabled()&&!d.isSelectionEmpty()&&
|
||||
null!=a.copiedStyle){d.getModel().beginUpdate();try{for(var b=d.getSelectionCells(),c=0;c<b.length;c++)for(var e=d.view.getState(b[c]),f=0;f<m.length;f++){var g=m[f],h=a.copiedStyle[g];e.style[g]!=h&&d.setCellStyles(g,h,[b[c]])}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+V");a.actions.put("pageBackgroundImage",new Action(mxResources.get("backgroundImage")+"...",function(){if(!a.isOffline()){var b=new BackgroundImageDialog(a,function(b){a.setBackgroundImage(b)});a.showDialog(b.container,
|
||||
320,170,!0,!0);b.init()}}));a.actions.put("exportPng",new Action(mxResources.get("formatPng")+"...",function(){a.isExportToCanvas()?a.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l){b=parseInt(b);!isNaN(b)&&0<b&&a.exportImage(b/100,c,d,e,f,h,!k,l)}),!0,!1,"png"):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||a.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,
|
||||
|
@ -8713,8 +8714,8 @@ mxUtils.bind(this,function(){a.vRuler.setUnit(mxRuler.prototype.INCHES);a.hRuler
|
|||
function(){a.vRuler.setUnit(mxRuler.prototype.PIXELS);a.hRuler.setUnit(mxRuler.prototype.PIXELS);a.vRuler.drawRuler(!0);a.hRuler.drawRuler(!0)})),this.addMenuItems(b,["-","rulerInch","rulerCM","rulerPixel"],c))})));"1"==urlParams.test&&(mxResources.parse("testDevelop=Develop"),mxResources.parse("showBoundingBox=Show bounding box"),mxResources.parse("createSidebarEntry=Create Sidebar Entry"),mxResources.parse("testChecksum=Checksum"),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"),a.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){d.isSelectionEmpty()||a.showTextDialog("Create Sidebar Entry","sb.createVertexTemplateFromData('"+d.compress(mxUtils.getXml(d.encodeCells(d.getSelectionCells())))+"', width, height, 'Title');")})),a.actions.addAction("showBoundingBox",
|
||||
mxUtils.bind(this,function(){var a=d.getGraphBounds(),b=d.view.translate,c=d.view.scale;d.insertVertex(d.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.height/c,"fillColor=none;strokeColor=red;")})),a.actions.addAction("testChecksum",mxUtils.bind(this,function(){var b=null!=a.pages&&null!=a.getCurrentFile()?a.getCurrentFile().getAnonymizedXmlForPages(a.pages):"",b=new TextareaDialog(a,"Paste Data:",b,function(b){if(0<b.length)try{var c=a.getPagesForNode(mxUtils.parseXml(b).documentElement,
|
||||
"mxGraphModel"),d=a.getHashValueForPages(c);console.log("checksum",c,d)}catch(y){a.handleError(y),console.error(y)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()})),a.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=a.pages){var b=new TextareaDialog(a,"Paste Data:","",function(b){if(0<b.length)try{console.log(JSON.stringify(a.diffPages(a.pages,a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null,2))}catch(E){a.handleError(E),
|
||||
console.error(E)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-
|
||||
"mxGraphModel"),d=a.getHashValueForPages(c);console.log("checksum",c,d)}catch(y){a.handleError(y),console.error(y)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()})),a.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=a.pages){var b=new TextareaDialog(a,"Paste Data:","",function(b){if(0<b.length)try{console.log(JSON.stringify(a.diffPages(a.pages,a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null,2))}catch(D){a.handleError(D),
|
||||
console.error(D)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f);e.translate(Math.floor((1-
|
||||
b.x)/c),Math.floor((1-b.y)/c));e.scale(1/c);var g=0,h=e.save;e.save=function(){g++;h.apply(this,arguments)};var k=e.restore;e.restore=function(){g--;k.apply(this,arguments)};var l=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);l.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(d.getView().getState(d.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),a.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==
|
||||
a.drive?a.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):a.drive.execute(mxUtils.bind(this,function(){var b=prompt("File ID","");if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b+"/realtime?supportsTeamDrives=true",null,"GET");c.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);var b=gapi.auth.getToken().access_token;a.setRequestHeader("authorization",
|
||||
"Bearer "+b)};c.send(function(c){a.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?a.saveLocalFile(c.getText(),"json-"+b+".txt","text/plain"):a.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),a.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(b,c){this.addMenuItems(b,"createSidebarEntry showBoundingBox - testChecksum testDiff - testInspect - testXmlImageExport - testDownloadRtModel".split(" "),
|
||||
|
@ -8732,14 +8733,14 @@ mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spi
|
|||
function(){var b=a.sidebar.isEntryVisible("search");a.sidebar.showPalette("search",!b);isLocalStorage&&(mxSettings.settings.search=!b,mxSettings.save())});f.setToggleAction(!0);f.setSelectedCallback(function(){return a.sidebar.isEntryVisible("search")});"1"==urlParams.embed&&(a.actions.get("save").funct=function(b){d.isEditing()&&d.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");
|
||||
e.xml=c;b&&(e.exit=!0);c=JSON.stringify(e)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,
|
||||
"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,
|
||||
["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(function(b,c){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,
|
||||
["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,
|
||||
mxResources.get("loading"))&&b.getFile(c,function(b){var c=h(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");f(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var f=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),h=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),k=d.snap(Math.ceil(Math.max(0,
|
||||
(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,l=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,l,m){f=g?Math.min(1,Math.min(a.maxImageSize/l,a.maxImageSize/m)):1;a.importFile(b,c,h,k,Math.round(l*f),Math.round(m*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=
|
||||
a;l()}):l()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,h,k,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),h=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+
|
||||
"...",null,function(){e(a.drive)},c):g&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+
|
||||
"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+
|
||||
"...",null,function(){a.importLocalFile(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){f(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==
|
||||
c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))})).isEnabled=e;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");
|
||||
c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}))).isEnabled=e;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");
|
||||
mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,
|
||||
Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,Editor.checkmarkImage)})));f=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,
|
||||
function(a){null!=a&&0<a.length&&null!=b&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));
|
||||
|
@ -8748,33 +8749,33 @@ b.saveAs(c,mxUtils.bind(this,function(c){b.desc=c;b.save(!1,mxUtils.bind(this,fu
|
|||
c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();b.getMode()!=App.MODE_GOOGLE&&b.getMode()!=App.MODE_ONEDRIVE||a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}))}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",
|
||||
new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){var a=this.editorUi.getCurrentFile();null!=a&&this.editorUi.drive.showPermissions(a.getId())}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){"1"==urlParams.test&&this.addMenuItems(b,["liveImage",
|
||||
"-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);a.isOffline()||this.addMenuItems(b,["-","googleDocs","googleSlides","googleSites"],c)})));var t=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow=
|
||||
"auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},v=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.addAction("insertText",
|
||||
function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(v("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=e;a.actions.addAction("insertRectangle",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",120,60,"whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+K").isEnabled=e;a.actions.addAction("insertEllipse",function(){d.isEnabled()&&
|
||||
!d.isCellLocked(d.getDefaultParent())&&v("",80,80,"ellipse;whiteSpace=wrap;html=1;")},null,null,Editor.ctrlKey+"+Shift+K").isEnabled=e;a.actions.addAction("insertRhombus",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",80,80,"rhombus;whiteSpace=wrap;html=1;")}).isEnabled=e;var x=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):t(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,
|
||||
"insertText insertRectangle - insertEllipse insertRhombus - insertLink insertImage".split(" "),c);b.addSeparator(c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);x(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){x(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));
|
||||
this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},
|
||||
c):g&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+
|
||||
"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},
|
||||
c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));
|
||||
a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):g&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
|
||||
"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,
|
||||
function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+
|
||||
"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):g&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},
|
||||
c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,
|
||||
function(){a.pickLibrary(App.MODE_TRELLO)},c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,
|
||||
"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(H){a.handleError(H,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();
|
||||
a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,
|
||||
(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,
|
||||
"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&
|
||||
this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&isLocalStorage&&this.addMenuItem(b,"plugins",c);b.addSeparator(c);this.addMenuItem(b,"tags",c);b.addSeparator(c);"1"==urlParams.newTempDlg&&(a.actions.addAction("templates",function(){var b=new TemplatesDialog;a.showDialog(b.container,b.width,b.height,!0,!1,null,!1,
|
||||
!0);b.init(a,function(a){console.log(a)},null,null,null,"user",function(a,b){setTimeout(function(){b?a([{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"},{url:"123",title:"Test 4"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"}]):
|
||||
a([{url:"123",title:"Test 4",imgUrl:"https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"},{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"}]);console.log(b)},1E3)},function(a,
|
||||
b,c){setTimeout(function(){b(c?[{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"},{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"}]:[{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"},{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"}])},2E3)},null)}),this.addMenuItem(b,"templates",
|
||||
c))})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();
|
||||
if(null!=d&&d.constructor==DriveFile){d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c);this.addMenuItems(b,["save","-","share"],c);var e=this.addMenuItem(b,"synchronize",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947");b.addSeparator(c)}else this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,
|
||||
["new","-","rename","makeCopy","moveToFolder"],c):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||(b.addSeparator(c),e=this.addMenuItem(b,"synchronize",c),a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947")),this.addMenuItems(b,["-","save","saveAs"],c),this.addMenuItems(b,["-","rename"],c),a.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,
|
||||
["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null!=d&&d.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||
|
||||
this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
|
||||
"auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},v=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.put("exportSvg",
|
||||
new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,h,k,l,m){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,h,!k,l,m)}),!0,null,"svg")}));a.actions.put("insertText",new Action(mxResources.get("text"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(v("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=e;a.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=e;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=e;a.actions.put("insertRhombus",
|
||||
new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&v("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=e;var x=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):t(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&
|
||||
!a.isOffline()&&this.addMenuItems(b,["insertTemplate","-"],c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);x(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){x(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=
|
||||
a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):g&&b.addItem(mxResources.get("googleDrive")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);
|
||||
null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+
|
||||
"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,
|
||||
80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):g&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,
|
||||
null,null,null,App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,
|
||||
null,App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,
|
||||
null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):g&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):l&&b.addItem(mxResources.get("oneDrive")+
|
||||
" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):k&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},
|
||||
c):n&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=
|
||||
b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(F){a.handleError(F,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},
|
||||
mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline",
|
||||
"layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),
|
||||
c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);
|
||||
"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&isLocalStorage&&this.addMenuItem(b,"plugins",c);b.addSeparator(c);this.addMenuItem(b,"tags",c);b.addSeparator(c);"1"==urlParams.newTempDlg&&(a.actions.addAction("templates",function(){var b=new TemplatesDialog;a.showDialog(b.container,b.width,b.height,!0,!1,null,!1,!0);b.init(a,function(a){console.log(a)},null,null,null,"user",function(a,b){setTimeout(function(){b?a([{url:"123",
|
||||
title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"},{url:"123",title:"Test 4"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"}]):a([{url:"123",title:"Test 4",imgUrl:"https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg"},{url:"123",
|
||||
title:"Test 5"},{url:"123",title:"Test 6"},{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"}]);console.log(b)},1E3)},function(a,b,c){setTimeout(function(){b(c?[{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",
|
||||
title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"},{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"}]:[{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"},{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"}])},2E3)},null)}),this.addMenuItem(b,"templates",c))})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",
|
||||
b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();if(null!=d&&d.constructor==DriveFile){d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],
|
||||
c);this.addMenuItems(b,["save","-","share"],c);var e=this.addMenuItem(b,"synchronize",c);a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947");b.addSeparator(c)}else this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==
|
||||
d||d.constructor==LocalFile||(b.addSeparator(c),e=this.addMenuItem(b,"synchronize",c),a.isOffline()&&!mxClient.IS_CHROMEAPP||this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947")),this.addMenuItems(b,["-","save","saveAs"],c),this.addMenuItems(b,["-","rename"],c),a.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));
|
||||
b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null!=d&&d.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
|
||||
function RenamePage(a,c,b){this.ui=a;this.page=c;this.previous=this.name=b}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,c,b){this.ui=a;this.oldIndex=c;this.newIndex=b}
|
||||
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(a,c,b){this.ui=a;this.previousPage=this.page=c;this.neverShown=!0;null!=c&&(this.neverShown=null==c.viewState,this.ui.updatePageRoot(c),null!=b&&(c.viewState=b,this.neverShown=!1))}
|
||||
SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,c=this.ui.editor,b=c.graph,d=c.graph.compress(b.zapGremlins(mxUtils.getXml(c.getGraphXml(!0))));mxUtils.setTextContent(a.node,d);a.viewState=b.getViewState();a.root=b.model.root;null!=a.model&&a.model.rootChanged(a.root);b.view.clear(a.root,!0);b.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;b.model.rootChanged(a.root);
|
||||
|
@ -8835,7 +8836,7 @@ b?b.style:t.getCellStyle(a)).containerType);return b}function d(a){var b=!1;null
|
|||
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 n(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=t.cloneCells([d[0],a]);t.model.setTerminal(e[0],t.model.getTerminal(d[0],!0),!0);var f=l(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-
|
||||
10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var h=t.view.getState(a),k=t.view.scale;if(null!=h){var m=mxRectangle.fromRectangle(h);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*k:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*k;var n=t.getOutgoingEdges(t.model.getTerminal(d[0],!0));if(null!=n){for(var p=f==mxConstants.DIRECTION_SOUTH||
|
||||
f==mxConstants.DIRECTION_NORTH,v=g=d=0;v<n.length;v++){var q=t.model.getTerminal(n[v],!1);if(f==l(q)){var u=t.view.getState(q);q!=a&&null!=u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY())&&mxUtils.intersects(m,u)&&(d=10+Math.max(d,(Math.min(m.x+m.width,u.x+u.width)-Math.max(m.x,u.x))/k),g=10+Math.max(g,(Math.min(m.y+m.height,u.y+u.height)-Math.max(m.y,u.y))/k))}}p?g=0:d=0;for(v=0;v<n.length;v++)if(q=t.model.getTerminal(n[v],!1),f==l(q)&&(u=t.view.getState(q),q!=a&&null!=
|
||||
u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY()))){var A=[];t.traverse(u.cell,!0,function(a,b){null!=b&&A.push(b);A.push(a);return!0});t.moveCells(A,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=l(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=
|
||||
u&&(p&&b!=u.getCenterX()<h.getCenterX()||!p&&b!=u.getCenterY()<h.getCenterY()))){var B=[];t.traverse(u.cell,!0,function(a,b){null!=b&&B.push(b);B.push(a);return!0});t.moveCells(B,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=l(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1);var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=
|
||||
e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var h=a.geometry.width+40,k=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?h=0:b==mxConstants.DIRECTION_NORTH?(h=0,k=-40):b==mxConstants.DIRECTION_WEST?(h=-40,k=0):b==mxConstants.DIRECTION_EAST&&(k=0);t.moveCells(g,h,k);return t.addCells(d,e)}finally{t.model.endUpdate()}}function h(a){t.model.beginUpdate();try{var b=t.model.getParent(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],
|
||||
a]);t.model.setTerminal(d[0],a,!0);var c=t.getOutgoingEdges(a),e=b.geometry,f=[];t.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var h=t.model.getTerminal(c[g],!1);null!=h&&f.push(h)}var k=t.view.getBounds(f),m=l(a),n=t.view.translate,p=t.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x-e.x+10,d[1].geometry.y+=a.geometry.height-e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=
|
||||
null==k?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(k.x+k.width)/p-n.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height-e.y+40):(d[1].geometry.x=m==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width-e.x+40):d[1].geometry.x+(a.geometry.width-e.x+40),d[1].geometry.y=null==k?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(k.y+k.height)/p-n.y+-e.y+10);return t.addCells(d,b)}finally{t.model.endUpdate()}}function m(a,b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=
|
||||
|
@ -8846,16 +8847,16 @@ this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};q.actions.addAc
|
|||
(a=t.getOutgoingEdges(t.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+S");q.actions.addAction("selectParent",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);null!=a&&0<a.length&&t.setSelectionCell(t.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");q.actions.addAction("selectDescendants",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=
|
||||
t.getSelectionCell(),b=[];t.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});t.setSelectionCells(b)}},null,null,"Alt+Shift+D");var u=t.removeCells;t.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];v.isEdge(g)&&c(g)&&(e.push(g),g=v.getTerminal(g,!1));b(g)?(t.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=t.getIncomingEdges(a[f]),
|
||||
a=a.concat(g)):e.push(a[f])}a=e;return u.apply(this,arguments)};q.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var w=t.duplicateCells;t.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var h=w.call(this,a,c);if(h.length==
|
||||
a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=t.getIncomingEdges(h[e]),g=t.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var l=this.cloneCell(g[0]);this.addEdge(l,t.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var E=t.moveCells;t.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=
|
||||
0;p<a.length;p++)if(b(a[p])||t.model.isEdge(a[p])&&null==t.model.getTerminal(a[p],!0)){f=t.model.getParent(a[p]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var v=t.getIncomingEdges(a[0]);if(0<v.length){var q=t.view.getState(t.model.getTerminal(v[0],!0));if(null!=q){var u=t.view.getState(l);null!=u&&(c=(u.getCenterX()-q.getCenterX())/t.view.scale,d=(u.getCenterY()-q.getCenterY())/t.view.scale)}}}}k=E.apply(this,arguments);if(null!=k&&null!=a&&k.length==a.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))b(l)&&
|
||||
0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],l,!0);else if(b(a[p])&&(v=t.getIncomingEdges(a[p]),0<v.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],l,!0);else if(0==t.getIncomingEdges(k[p]).length){m=l;if(null==m||m==t.model.getParent(a[p]))m=t.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,t.getDefaultParent(),m,k[p])}}finally{this.model.endUpdate()}return k};if(null!=q.sidebar){var C=q.sidebar.dropAndConnect;
|
||||
q.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=C.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=t.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var y={88:q.actions.get("selectChildren"),84:q.actions.get("selectSubtree"),80:q.actions.get("selectParent"),83:q.actions.get("selectSiblings")},z=
|
||||
a.length)for(e=0;e<a.length;e++)if(b(a[e])){var k=t.getIncomingEdges(h[e]),g=t.getIncomingEdges(a[e]);if(0==k.length&&0<g.length){var l=this.cloneCell(g[0]);this.addEdge(l,t.getDefaultParent(),this.model.getTerminal(g[0],!0),h[e])}}}finally{this.model.endUpdate()}return h};var D=t.moveCells;t.moveCells=function(a,c,d,e,f,g,h){var k=null;this.model.beginUpdate();try{var l=f,m=this.view.getState(f),n=null!=m?m.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var p=
|
||||
0;p<a.length;p++)if(b(a[p])||t.model.isEdge(a[p])&&null==t.model.getTerminal(a[p],!0)){f=t.model.getParent(a[p]);break}if(null!=l&&f!=l&&null!=this.view.getState(a[0])){var v=t.getIncomingEdges(a[0]);if(0<v.length){var q=t.view.getState(t.model.getTerminal(v[0],!0));if(null!=q){var u=t.view.getState(l);null!=u&&(c=(u.getCenterX()-q.getCenterX())/t.view.scale,d=(u.getCenterY()-q.getCenterY())/t.view.scale)}}}}k=D.apply(this,arguments);if(null!=k&&null!=a&&k.length==a.length)for(p=0;p<k.length;p++)if(this.model.isEdge(k[p]))b(l)&&
|
||||
0>mxUtils.indexOf(k,this.model.getTerminal(k[p],!0))&&this.model.setTerminal(k[p],l,!0);else if(b(a[p])&&(v=t.getIncomingEdges(a[p]),0<v.length))if(!e)b(l)&&0>mxUtils.indexOf(a,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],l,!0);else if(0==t.getIncomingEdges(k[p]).length){m=l;if(null==m||m==t.model.getParent(a[p]))m=t.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,t.getDefaultParent(),m,k[p])}}finally{this.model.endUpdate()}return k};if(null!=q.sidebar){var E=q.sidebar.dropAndConnect;
|
||||
q.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=E.apply(this,arguments),b(a))for(var h=0;h<g.length;h++)if(f.isEdge(g[h])&&null==f.getTerminal(g[h],!0)){f.setTerminal(g[h],a,!0);var k=t.getCellGeometry(g[h]);k.points=null;null!=k.getTerminalPoint(!0)&&k.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var y={88:q.actions.get("selectChildren"),84:q.actions.get("selectSubtree"),80:q.actions.get("selectParent"),83:q.actions.get("selectSiblings")},z=
|
||||
q.onKeyDown;q.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&&b(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?f(t.getSelectionCell()):h(t.getSelectionCell()):13==a.which&&(c=n(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=q.hoverIcons&&q.hoverIcons.update(t.view.getState(t.getSelectionCell())),
|
||||
t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=y[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(p(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(p(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),
|
||||
mxEvent.consume(a))}}catch(M){console.log("error",M)}mxEvent.isConsumed(a)||z.apply(this,arguments)};var H=t.connectVertex;t.connectVertex=function(a,c,d,e,g,k){var m=t.getIncomingEdges(a);return b(a)&&0<m.length?(d=l(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?h(a):e==g?f(a):n(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):H.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var c=[a];b(a)&&
|
||||
!d(a)&&t.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var B=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){B.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width=
|
||||
mxEvent.consume(a))}}catch(M){console.log("error",M)}mxEvent.isConsumed(a)||z.apply(this,arguments)};var F=t.connectVertex;t.connectVertex=function(a,c,d,e,g,k){var m=t.getIncomingEdges(a);return b(a)&&0<m.length?(d=l(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?h(a):e==g?f(a):n(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):F.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var c=[a];b(a)&&
|
||||
!d(a)&&t.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var A=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){A.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width=
|
||||
"18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);
|
||||
this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var F=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){F.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.destroy;
|
||||
this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var G=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.destroy;
|
||||
mxVertexHandler.prototype.destroy=function(a,b){I.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.graph;return a.concat([this.addEntry("tree container",function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");
|
||||
a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic",function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,
|
||||
40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;");
|
||||
|
@ -8891,22 +8892,21 @@ document.createElement("div");a.style.display="inline-block";a.style.position="r
|
|||
function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geMenuItem gePrimaryBtn",b.style.fontSize="14px",b.style.marginLeft="6px",b.style.padding="6px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");
|
||||
mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geMenuItem";b.style.fontSize="14px";b.style.marginLeft="6px";b.style.padding="6px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);
|
||||
a.y+=40;return a};var h=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,c){var d=this.editorUi.editor.graph;a.smartSeparators=!0;h.apply(this,arguments);mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==d.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,
|
||||
c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("insert",a),this.addSubmenu("layout",a),a.addSeparator(),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-",
|
||||
"exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var m=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=
|
||||
null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),
|
||||
this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);m.apply(this,arguments)};var p=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){p.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=
|
||||
function(){};var q=Menus.prototype.init;Menus.prototype.init=function(){q.apply(this,arguments);var b=this.editorUi,d=b.editor.graph;b.actions.get("insertText").label=mxResources.get("text");b.actions.get("insertText").label=mxResources.get("text");b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("insertRectangle").label=mxResources.get("rectangle");b.actions.get("insertEllipse").label=mxResources.get("ellipse");b.actions.get("insertRhombus").label=mxResources.get("rhombus");
|
||||
b.actions.get("insertImage").label=mxResources.get("image")+"...";b.actions.get("insertLink").label=mxResources.get("link")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label=mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,
|
||||
"change",function(){null!=a.files&&b.importFiles(a.files,null,null,b.maxImageSize)});a.click()}));b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();b.showImportCsvDialog()}));b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,
|
||||
"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){c(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",
|
||||
new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(b.menus.addMenuItems(a,["new","open","-"],c),EditorUi.isElectronApp&&b.menus.addMenuItems(a,["synchronize","-"],c),b.menus.addMenuItems(a,["save","saveAs","-"],c)):"1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):
|
||||
(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),isLocalStorage&&this.addSubmenu("openRecent",a,c),a.addSeparator(c),null!=d&&d.constructor==DriveFile&&b.menus.addMenuItems(a,["share"],c),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||b.menus.addMenuItems(a,["synchronize"],c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);b.menus.addMenuItems(a,"- outline layers - find tags".split(" "),c);mxClient.IS_IOS&&
|
||||
navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],c):(b.menus.addMenuItems(a,["save","saveAs","-","rename"],c),b.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&
|
||||
this.addMenuItems(a,["upload"],c):b.menus.addMenuItems(a,["makeCopy"],c));b.menus.addMenuItems(a,["-","autosave"],c);null!=d&&d.isRevisionHistorySupported()&&b.menus.addMenuItems(a,["-","revisionHistory"],c)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){e.funct(a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c)})));var f=this.get("language");this.put("extras",
|
||||
new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=f&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);!b.isOfflineApp()&&isLocalStorage&&(a.addSeparator(c),b.menus.addMenuItem(a,"plugins",c));a.addSeparator(c)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,
|
||||
function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,["import"],
|
||||
c):b.menus.addSubmenu("importFrom",a,c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c);a.addSeparator(c);a.addItem(mxResources.get("more")+"...",null,b.actions.get("toggleShapes").funct,c)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),h=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):h(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 - 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,
|
||||
c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("view",a,null,mxResources.get("options")),this.addSubmenu("layout",a),this.addMenuItems(a,["-","exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,
|
||||
["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var m=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),
|
||||
this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=
|
||||
null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);m.apply(this,arguments)};var p=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){p.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var q=Menus.prototype.init;
|
||||
Menus.prototype.init=function(){q.apply(this,arguments);var b=this.editorUi,d=b.editor.graph;b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label=mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type",
|
||||
"file");mxEvent.addListener(a,"change",function(){null!=a.files&&b.importFiles(a.files,null,null,b.maxImageSize)});a.click()}));b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();b.showImportCsvDialog()}));b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+
|
||||
"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){c(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,
|
||||
620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(b.menus.addMenuItems(a,["new","open","-"],c),EditorUi.isElectronApp&&b.menus.addMenuItems(a,["synchronize","-"],c),b.menus.addMenuItems(a,["save","saveAs","-"],c)):"1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,
|
||||
["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),isLocalStorage&&this.addSubmenu("openRecent",a,c),a.addSeparator(c),null!=d&&d.constructor==DriveFile&&b.menus.addMenuItems(a,["share"],c),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||b.menus.addMenuItems(a,["synchronize"],c),a.addSeparator(c),b.menus.addSubmenu("save",a,c));b.menus.addSubmenu("exportAs",a,c);b.menus.addMenuItems(a,"- outline layers - find tags".split(" "),
|
||||
c);mxClient.IS_IOS&&navigator.standalone||b.menus.addMenuItems(a,["-","print","-"],c);b.menus.addSubmenu("help",a,c);"1"==urlParams.embed?b.menus.addMenuItems(a,["-","exit"],c):b.menus.addMenuItems(a,["-","close"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],c):(b.menus.addMenuItems(a,["save","saveAs","-","rename"],c),b.isOfflineApp()?navigator.onLine&&
|
||||
"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],c):b.menus.addMenuItems(a,["makeCopy"],c));b.menus.addMenuItems(a,["-","autosave"],c);null!=d&&d.isRevisionHistorySupported()&&b.menus.addMenuItems(a,["-","revisionHistory"],c)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,c){e.funct(a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c)})));var f=this.get("language");
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=f&&b.menus.addSubmenu("language",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);!b.isOfflineApp()&&isLocalStorage&&(a.addSeparator(c),b.menus.addMenuItem(a,"plugins",c));a.addSeparator(c)})));this.put("insertAdvanced",
|
||||
new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),c)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);b.insertTemplateEnabled&&!b.isOffline()&&b.menus.addMenuItems(a,
|
||||
["insertTemplate"],c);a.addSeparator(c);b.menus.addSubmenu("insertLayout",a,c);b.menus.addSubmenu("insertAdvanced",a,c);a.addSeparator(c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?b.menus.addMenuItems(a,["import"],c):b.menus.addSubmenu("importFrom",a,c)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),h=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):h(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 - 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 t=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=g.menus.get(a),e=m.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),l);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));g.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 c(a,b,c,d,e,f){var h=document.createElement("a");
|
||||
h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top="0px";null!=g.statusContainer?k.insertBefore(h,g.statusContainer):k.appendChild(h);null!=f?(h.style.backgroundImage="url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,
|
||||
|
@ -8925,17 +8925,17 @@ null],60)}e=g.menus.get("language");null!=e&&!mxClient.IS_CHROMEAPP&&!EditorUi.i
|
|||
mxResources.get("untitledLibrary");var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var l=null,m=new Menubar(g,k);g.statusContainer=g.createStatusContainer();g.statusContainer.style.position="relative";g.statusContainer.style.maxWidth="";g.statusContainer.style.marginTop="7px";g.statusContainer.style.marginLeft="6px";g.statusContainer.style.color=
|
||||
"gray";g.statusContainer.style.cursor="default";g.editor.addListener("statusChanged",mxUtils.bind(this,function(){g.setStatusText(g.editor.getStatus())}));var n=g.descriptorChanged;g.descriptorChanged=function(){n.apply(this,arguments);var a=g.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);k.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else k.removeAttribute("title")};
|
||||
g.setStatusText(g.editor.getStatus());k.appendChild(g.statusContainer);g.buttonContainer=document.createElement("div");g.buttonContainer.style.cssText="position:absolute;right:40px;top:12px;white-space:nowrap;";k.appendChild(g.buttonContainer);g.menubarContainer=g.buttonContainer;g.tabContainer=document.createElement("div");g.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 f=g.diagramContainer.parentNode,p=document.createElement("div");p.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";g.diagramContainer.style.top="47px";var q=g.menus.get("viewZoom");if(null!=q){this.tabContainer.style.right="70px";var D=m.addMenu("100%",q.funct);D.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");D.style.whiteSpace="nowrap";D.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";D.style.backgroundPosition="right 6px center";
|
||||
D.style.backgroundRepeat="no-repeat";D.style.backgroundColor="#ffffff";D.style.paddingRight="10px";D.style.display="block";D.style.position="absolute";D.style.textDecoration="none";D.style.textDecoration="none";D.style.right="0px";D.style.bottom="0px";D.style.overflow="hidden";D.style.visibility="hidden";D.style.textAlign="center";D.style.color="#000";D.style.fontSize="12px";D.style.color="#707070";D.style.width="59px";D.style.borderTop="1px solid lightgray";D.style.borderLeft="1px solid lightgray";
|
||||
D.style.height=parseInt(g.tabContainer.style.height)-1+"px";D.style.lineHeight=parseInt(g.tabContainer.style.height)+1+"px";p.appendChild(D);q=mxUtils.bind(this,function(){D.innerHTML=Math.round(100*g.editor.graph.view.scale)+"%"});g.editor.graph.view.addListener(mxEvent.EVENT_SCALE,q);g.editor.addListener("resetGraphView",q);g.editor.addListener("pageSelected",q);var G=g.setGraphEnabled;g.setGraphEnabled=function(){G.apply(this,arguments);null!=this.tabContainer&&(D.style.visibility=this.tabContainer.style.visibility,
|
||||
var f=g.diagramContainer.parentNode,p=document.createElement("div");p.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";g.diagramContainer.style.top="47px";var q=g.menus.get("viewZoom");if(null!=q){this.tabContainer.style.right="70px";var C=m.addMenu("100%",q.funct);C.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");C.style.whiteSpace="nowrap";C.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";C.style.backgroundPosition="right 6px center";
|
||||
C.style.backgroundRepeat="no-repeat";C.style.backgroundColor="#ffffff";C.style.paddingRight="10px";C.style.display="block";C.style.position="absolute";C.style.textDecoration="none";C.style.textDecoration="none";C.style.right="0px";C.style.bottom="0px";C.style.overflow="hidden";C.style.visibility="hidden";C.style.textAlign="center";C.style.color="#000";C.style.fontSize="12px";C.style.color="#707070";C.style.width="59px";C.style.borderTop="1px solid lightgray";C.style.borderLeft="1px solid lightgray";
|
||||
C.style.height=parseInt(g.tabContainer.style.height)-1+"px";C.style.lineHeight=parseInt(g.tabContainer.style.height)+1+"px";p.appendChild(C);q=mxUtils.bind(this,function(){C.innerHTML=Math.round(100*g.editor.graph.view.scale)+"%"});g.editor.graph.view.addListener(mxEvent.EVENT_SCALE,q);g.editor.addListener("resetGraphView",q);g.editor.addListener("pageSelected",q);var H=g.setGraphEnabled;g.setGraphEnabled=function(){H.apply(this,arguments);null!=this.tabContainer&&(C.style.visibility=this.tabContainer.style.visibility,
|
||||
this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?"30px":"0px")}}p.appendChild(g.tabContainer);p.appendChild(k);p.appendChild(g.diagramContainer);f.appendChild(p);g.updateTabContainer();var M=null;e();mxEvent.addListener(window,"resize",function(){e();null!=g.sidebarWindow&&g.sidebarWindow.window.fit();null!=g.formatWindow&&g.formatWindow.window.fit();null!=g.actions.outlineWindow&&g.actions.outlineWindow.window.fit();null!=g.actions.layersWindow&&g.actions.layersWindow.window.fit();
|
||||
null!=g.menus.tagsWindow&&g.menus.tagsWindow.window.fit();null!=g.menus.findWindow&&g.menus.findWindow.window.fit()})}}};(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,g,k){var d=c.y,e=c.x,f=!1,h=!1;if(null!=this.states&&null!=b&&null!=c){var m=this,p=new mxCellState,q=this.graph.getView().scale,t=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+e;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var v=[],x=[],u=0;u<this.states.length;u++){var w=this.states[u];w instanceof mxCellState&&(k||!this.graph.isCellSelected(w.cell))&&((p.x>=w.x&&p.x<=w.x+w.width||w.x>=p.x&&w.x<=p.x+p.width)&&(p.y>
|
||||
w.y+w.height+4||p.y+p.height+4<w.y)?v.push(w):(p.y>=w.y&&p.y<=w.y+w.height||w.y>=p.y&&w.y<=p.y+p.height)&&(p.x>w.x+w.width+4||p.x+p.width+4<w.x)&&x.push(w))}var E=0,C=0,y=w=0,z=0,H=0,B=0,F=0,I=5*q;if(1<v.length){v.push(p);v.sort(function(a,b){return a.y-b.y});var A=!1,u=p==v[0],q=p==v[v.length-1];if(!u&&!q)for(u=1;u<v.length-1;u++)if(p==v[u]){q=v[u-1];u=v[u+1];w=C=y=(u.y-q.y-q.height-p.height)/2;break}for(u=0;u<v.length-1;u++){var q=v[u],D=v[u+1],G=p==q||p==D,D=D.y-q.y-q.height,A=A|p==q;if(0==C&&
|
||||
0==E)C=D,E=1;else if(Math.abs(C-D)<=(G||1==u&&A?t:0))E+=1;else if(1<E&&A){v=v.slice(0,u+1);break}else if(3<=v.length-u&&!A)E=0,w=C=0!=y?y:0,v.splice(0,0==u?1:u),u=-1;else break;0!=w||G||(C=w=D)}3==v.length&&v[1]==p&&(w=0)}if(1<x.length){x.push(p);x.sort(function(a,b){return a.x-b.x});A=!1;u=p==x[0];q=p==x[x.length-1];if(!u&&!q)for(u=1;u<x.length-1;u++)if(p==x[u]){q=x[u-1];u=x[u+1];B=H=F=(u.x-q.x-q.width-p.width)/2;break}for(u=0;u<x.length-1;u++){q=x[u];D=x[u+1];G=p==q||p==D;D=D.x-q.x-q.width;A|=p==
|
||||
q;if(0==H&&0==z)H=D,z=1;else if(Math.abs(H-D)<=(G||1==u&&A?t:0))z+=1;else if(1<z&&A){x=x.slice(0,u+1);break}else if(3<=x.length-u&&!A)z=0,B=H=0!=F?F:0,x.splice(0,0==u?1:u),u=-1;else break;0!=B||G||(H=B=D)}3==x.length&&x[1]==p&&(B=0)}t=function(a,b,c,d){var e=[],f;d?(d=I,f=0):(d=0,f=I);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
|
||||
mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(m.graph.getView().getOverlayPane());return a};H=function(a,b){if(a&&null!=m.guidesArrHor)for(var c=0;c<m.guidesArrHor.length;c++)m.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=m.guidesArrVer)for(c=0;c<m.guidesArrVer.length;c++)m.guidesArrVer[c].node.style.visibility="hidden"};if(1<z&&z==x.length-1){z=[];F=m.guidesArrHor;f=[];e=0;u=x[0]==p?1:0;A=x[u].y+x[u].height;if(0<B)for(u=0;u<x.length-1;u++)q=
|
||||
x[u],D=x[u+1],p==q?(e=D.x-q.width-B,f.push(new mxPoint(e+q.width+I,A)),f.push(new mxPoint(D.x-I,A))):p==D?(f.push(new mxPoint(q.x+q.width+I,A)),e=q.x+q.width+B,f.push(new mxPoint(e-I,A))):(f.push(new mxPoint(q.x+q.width+I,A)),f.push(new mxPoint(D.x-I,A)));else q=x[0],u=x[2],e=q.x+q.width+(u.x-q.x-q.width-p.width)/2,f.push(new mxPoint(q.x+q.width+I,A)),f.push(new mxPoint(e-I,A)),f.push(new mxPoint(e+p.width+I,A)),f.push(new mxPoint(u.x-I,A));for(u=0;u<f.length;u+=2)x=f[u],B=f[u+1],x=t(x,B,null!=F?
|
||||
F[u/2]:null),x.node.style.visibility="visible",x.redraw(),z.push(x);for(u=f.length/2;null!=F&&u<F.length;u++)F[u].destroy();m.guidesArrHor=z;e-=b.x;f=!0}else H(!0);if(1<E&&E==v.length-1){z=[];F=m.guidesArrVer;h=[];d=0;u=v[0]==p?1:0;E=v[u].x+v[u].width;if(0<w)for(u=0;u<v.length-1;u++)q=v[u],D=v[u+1],p==q?(d=D.y-q.height-w,h.push(new mxPoint(E,d+q.height+I)),h.push(new mxPoint(E,D.y-I))):p==D?(h.push(new mxPoint(E,q.y+q.height+I)),d=q.y+q.height+w,h.push(new mxPoint(E,d-I))):(h.push(new mxPoint(E,q.y+
|
||||
q.height+I)),h.push(new mxPoint(E,D.y-I)));else q=v[0],u=v[2],d=q.y+q.height+(u.y-q.y-q.height-p.height)/2,h.push(new mxPoint(E,q.y+q.height+I)),h.push(new mxPoint(E,d-I)),h.push(new mxPoint(E,d+p.height+I)),h.push(new mxPoint(E,u.y-I));for(u=0;u<h.length;u+=2)x=h[u],B=h[u+1],x=t(x,B,null!=F?F[u/2]:null,!0),x.node.style.visibility="visible",x.redraw(),z.push(x);for(u=h.length/2;null!=F&&u<F.length;u++)F[u].destroy();m.guidesArrVer=z;d-=b.y;h=!0}else H(!1,!0)}if(f||h)return p=new mxPoint(e,d),v=a.call(this,
|
||||
b,p,g,k),f&&!h?p.y=v.y:h&&!f&&(p.x=v.x),v.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),v.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;H(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!=
|
||||
w.y+w.height+4||p.y+p.height+4<w.y)?v.push(w):(p.y>=w.y&&p.y<=w.y+w.height||w.y>=p.y&&w.y<=p.y+p.height)&&(p.x>w.x+w.width+4||p.x+p.width+4<w.x)&&x.push(w))}var D=0,E=0,y=w=0,z=0,F=0,A=0,G=0,I=5*q;if(1<v.length){v.push(p);v.sort(function(a,b){return a.y-b.y});var B=!1,u=p==v[0],q=p==v[v.length-1];if(!u&&!q)for(u=1;u<v.length-1;u++)if(p==v[u]){q=v[u-1];u=v[u+1];w=E=y=(u.y-q.y-q.height-p.height)/2;break}for(u=0;u<v.length-1;u++){var q=v[u],C=v[u+1],H=p==q||p==C,C=C.y-q.y-q.height,B=B|p==q;if(0==E&&
|
||||
0==D)E=C,D=1;else if(Math.abs(E-C)<=(H||1==u&&B?t:0))D+=1;else if(1<D&&B){v=v.slice(0,u+1);break}else if(3<=v.length-u&&!B)D=0,w=E=0!=y?y:0,v.splice(0,0==u?1:u),u=-1;else break;0!=w||H||(E=w=C)}3==v.length&&v[1]==p&&(w=0)}if(1<x.length){x.push(p);x.sort(function(a,b){return a.x-b.x});B=!1;u=p==x[0];q=p==x[x.length-1];if(!u&&!q)for(u=1;u<x.length-1;u++)if(p==x[u]){q=x[u-1];u=x[u+1];A=F=G=(u.x-q.x-q.width-p.width)/2;break}for(u=0;u<x.length-1;u++){q=x[u];C=x[u+1];H=p==q||p==C;C=C.x-q.x-q.width;B|=p==
|
||||
q;if(0==F&&0==z)F=C,z=1;else if(Math.abs(F-C)<=(H||1==u&&B?t:0))z+=1;else if(1<z&&B){x=x.slice(0,u+1);break}else if(3<=x.length-u&&!B)z=0,A=F=0!=G?G:0,x.splice(0,0==u?1:u),u=-1;else break;0!=A||H||(F=A=C)}3==x.length&&x[1]==p&&(A=0)}t=function(a,b,c,d){var e=[],f;d?(d=I,f=0):(d=0,f=I);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
|
||||
mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(m.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=m.guidesArrHor)for(var c=0;c<m.guidesArrHor.length;c++)m.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=m.guidesArrVer)for(c=0;c<m.guidesArrVer.length;c++)m.guidesArrVer[c].node.style.visibility="hidden"};if(1<z&&z==x.length-1){z=[];G=m.guidesArrHor;f=[];e=0;u=x[0]==p?1:0;B=x[u].y+x[u].height;if(0<A)for(u=0;u<x.length-1;u++)q=
|
||||
x[u],C=x[u+1],p==q?(e=C.x-q.width-A,f.push(new mxPoint(e+q.width+I,B)),f.push(new mxPoint(C.x-I,B))):p==C?(f.push(new mxPoint(q.x+q.width+I,B)),e=q.x+q.width+A,f.push(new mxPoint(e-I,B))):(f.push(new mxPoint(q.x+q.width+I,B)),f.push(new mxPoint(C.x-I,B)));else q=x[0],u=x[2],e=q.x+q.width+(u.x-q.x-q.width-p.width)/2,f.push(new mxPoint(q.x+q.width+I,B)),f.push(new mxPoint(e-I,B)),f.push(new mxPoint(e+p.width+I,B)),f.push(new mxPoint(u.x-I,B));for(u=0;u<f.length;u+=2)x=f[u],A=f[u+1],x=t(x,A,null!=G?
|
||||
G[u/2]:null),x.node.style.visibility="visible",x.redraw(),z.push(x);for(u=f.length/2;null!=G&&u<G.length;u++)G[u].destroy();m.guidesArrHor=z;e-=b.x;f=!0}else F(!0);if(1<D&&D==v.length-1){z=[];G=m.guidesArrVer;h=[];d=0;u=v[0]==p?1:0;D=v[u].x+v[u].width;if(0<w)for(u=0;u<v.length-1;u++)q=v[u],C=v[u+1],p==q?(d=C.y-q.height-w,h.push(new mxPoint(D,d+q.height+I)),h.push(new mxPoint(D,C.y-I))):p==C?(h.push(new mxPoint(D,q.y+q.height+I)),d=q.y+q.height+w,h.push(new mxPoint(D,d-I))):(h.push(new mxPoint(D,q.y+
|
||||
q.height+I)),h.push(new mxPoint(D,C.y-I)));else q=v[0],u=v[2],d=q.y+q.height+(u.y-q.y-q.height-p.height)/2,h.push(new mxPoint(D,q.y+q.height+I)),h.push(new mxPoint(D,d-I)),h.push(new mxPoint(D,d+p.height+I)),h.push(new mxPoint(D,u.y-I));for(u=0;u<h.length;u+=2)x=h[u],A=h[u+1],x=t(x,A,null!=G?G[u/2]:null,!0),x.node.style.visibility="visible",x.redraw(),z.push(x);for(u=h.length/2;null!=G&&u<G.length;u++)G[u].destroy();m.guidesArrVer=z;d-=b.y;h=!0}else F(!1,!0)}if(f||h)return p=new mxPoint(e,d),v=a.call(this,
|
||||
b,p,g,k),f&&!h?p.y=v.y:h&&!f&&(p.x=v.x),v.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),v.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;F(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!=
|
||||
d)for(k=0;k<d.length;k++)d[k].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var g=0;g<a.length;g++)a[g].destroy();this.guidesArrVer=null}if(null!=c){for(g=0;g<c.length;g++)c[g].destroy();this.guidesArrHor=null}}})();
|
||||
|
|
141
src/main/webapp/js/atlas-viewer.min.js
vendored
141
src/main/webapp/js/atlas-viewer.min.js
vendored
|
@ -2605,46 +2605,46 @@ a);d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);d.toggleCellStyles(mxConsta
|
|||
null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){d.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){d.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){d.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){d.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("group",function(){1==d.getSelectionCount()?d.setCellStyles("container","1"):d.setSelectionCell(d.groupCells(null,
|
||||
0))},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){1==d.getSelectionCount()&&0==d.getModel().getChildCount(d.getSelectionCell())?d.setCellStyles("container","0"):d.setSelectionCells(d.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){d.removeCellsFromParent()});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();
|
||||
b.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c="";if(mxUtils.isNode(d.value)){var f=d.value.getAttribute("tooltip");null!=f&&(c=f)}c=new TextareaDialog(b,mxResources.get("editTooltip")+":",c,function(c){a.setTooltipForCell(d,c)});b.showDialog(c.container,320,200,!0,!0);c.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());
|
||||
null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c=a.getLinkForCell(d)||"";b.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.addAction("insertLink...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var c=
|
||||
null,f=d.getLinkTitle(a);null!=b&&0<b.length&&(c=b[0].iconUrl,f=b[0].name||b[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));var e=d.getFreeInsertPoint(),c=new mxCell(f,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:"spacing=10;"));c.vertex=!0;d.setLinkForCell(c,a);d.cellSizeUpdated(c,!0);d.getModel().beginUpdate();try{c=d.addCell(c),
|
||||
d.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{d.getModel().endUpdate()}d.setSelectionCell(c);d.scrollCellToVisible(d.getSelectionCell())}})}).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getSelectedElement(),c=a.getParentByName(d,"A",a.cellEditor.textarea),f="";if(null==c&&null!=d&&null!=d.getElementsByTagName)for(var e=d.getElementsByTagName("a"),m=0;m<e.length&&null==c;m++)e[m].textContent==
|
||||
d.textContent&&(a.selectNode(e[m]),c=e[m]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var r=a.cellEditor.saveSelection();b.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(r);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=
|
||||
a[b];if(d.getModel().getChildCount(c))d.updateGroupBounds([c],20);else{var f=d.view.getState(c),e=d.getCellGeometry(c);d.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&d.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(c,e)):d.updateCellSize(c)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();
|
||||
d.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,c=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=c;c=mxUtils.extractTextWithWhitespace(f.childNodes);d.cellLabelChanged(a.cell,c)}else c=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(c));
|
||||
d.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=d.getView().getState(d.getSelectionCell());
|
||||
null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);a.init()});this.addAction("resetView",function(){d.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");
|
||||
this.addAction("zoomOut",function(a){d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){d.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/a.width/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=
|
||||
a.y*d.view.scale-1,d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,
|
||||
(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-
|
||||
d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,
|
||||
parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var l=null,l=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.isGridEnabled()});l.setEnabled(!1);
|
||||
l=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});l.setEnabled(!1);l=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});l=this.addAction("collapseExpand",function(){var a=
|
||||
new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.foldingEnabled});l.isEnabled=k;l=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.scrollbars});l=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return d.pageVisible});
|
||||
l=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionArrowsEnabled});l=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});
|
||||
l=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});l.isEnabled=k;l=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.autosave});l.isEnabled=k;l.visible=!1;this.addAction("help",function(){var a=
|
||||
"";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));l=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){if(null!=c&&d.cellEditor.isContentEditing())c();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,
|
||||
b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&
|
||||
d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,f)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});
|
||||
this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});
|
||||
this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
|
||||
this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,
|
||||
"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("sharp",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
|
||||
this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),e=d.view.getState(a[0]),
|
||||
c=null!=e?e.style:d.getCellStyle(a[0]),f="1"==mxUtils.getValue(c,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,f);d.setCellStyles(mxConstants.STYLE_CURVED,null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,
|
||||
"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",
|
||||
mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+
|
||||
"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,g=c.x,c=c.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=m;)g+=m.x,c+=m.y,a=d.getModel().getParent(a),m=
|
||||
d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g));f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=
|
||||
d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",
|
||||
function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;d.getModel().beginUpdate();
|
||||
try{if(0==e.length){var m=d.getFreeInsertPoint(),g=e=[d.insertVertex(d.getDefaultParent(),null,"",m.x,m.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var r=d.view.getState(e[0]),k=null!=r?r.style:d.getCellStyle(e[0]);"image"!=k[mxConstants.STYLE_SHAPE]&&"label"!=k[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",
|
||||
e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&null!=c&&null!=b){var x=e[0],u=d.getModel().getGeometry(x);null!=u&&(u=u.clone(),u.width=c,u.height=b,d.getModel().setGeometry(x,u))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&
|
||||
(d.clearSelection(),b.actions.get("image").funct())}).isEnabled=k;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):
|
||||
this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));l=this.addAction("outline",
|
||||
mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,
|
||||
null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
|
||||
function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;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()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||""};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;
|
||||
null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c=a.getLinkForCell(d)||"";b.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())})).isEnabled=
|
||||
k;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var c=null,f=d.getLinkTitle(a);null!=b&&0<b.length&&(c=b[0].iconUrl,f=b[0].name||b[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));var e=d.getFreeInsertPoint(),c=new mxCell(f,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+
|
||||
(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:"spacing=10;"));c.vertex=!0;d.setLinkForCell(c,a);d.cellSizeUpdated(c,!0);d.getModel().beginUpdate();try{c=d.addCell(c),d.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{d.getModel().endUpdate()}d.setSelectionCell(c);d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=
|
||||
a.getSelectedElement(),c=a.getParentByName(d,"A",a.cellEditor.textarea),f="";if(null==c&&null!=d&&null!=d.getElementsByTagName)for(var e=d.getElementsByTagName("a"),m=0;m<e.length&&null==c;m++)e[m].textContent==d.textContent&&(a.selectNode(e[m]),c=e[m]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var r=a.cellEditor.saveSelection();b.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(r);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?
|
||||
this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().getChildCount(c))d.updateGroupBounds([c],20);else{var f=d.view.getState(c),e=d.getCellGeometry(c);d.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&d.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(c,e)):
|
||||
d.updateCellSize(c)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,c=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=c;c=mxUtils.extractTextWithWhitespace(f.childNodes);
|
||||
d.cellLabelChanged(a.cell,c)}else c=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(c));d.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();
|
||||
null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=d.getView().getState(d.getSelectionCell());null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);
|
||||
a.init()});this.addAction("resetView",function(){d.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(a){d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){d.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();
|
||||
var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/a.width/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=a.y*d.view.scale-1,d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,
|
||||
b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();
|
||||
d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&
|
||||
0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var l=null,l=this.addAction("grid",
|
||||
function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.isGridEnabled()});l.setEnabled(!1);l=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});l.setEnabled(!1);
|
||||
l=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});l=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.foldingEnabled});l.isEnabled=k;l=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});
|
||||
l.setToggleAction(!0);l.setSelectedCallback(function(){return d.scrollbars});l=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return d.pageVisible});l=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionArrowsEnabled});
|
||||
l=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});l=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});
|
||||
l.isEnabled=k;l=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.autosave});l.isEnabled=k;l.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,
|
||||
320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));l=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){if(null!=c&&d.cellEditor.isContentEditing())c();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
|
||||
d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,f)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",
|
||||
!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});
|
||||
this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,
|
||||
null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
|
||||
mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("sharp",
|
||||
function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged",
|
||||
"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),e=d.view.getState(a[0]),c=null!=e?e.style:d.getCellStyle(a[0]),f="1"==mxUtils.getValue(c,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,f);d.setCellStyles(mxConstants.STYLE_CURVED,
|
||||
null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
|
||||
this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",
|
||||
function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();
|
||||
if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,g=c.x,c=c.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=m;)g+=m.x,c+=m.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g));f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=
|
||||
b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,
|
||||
function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=
|
||||
e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;d.getModel().beginUpdate();try{if(0==e.length){var m=d.getFreeInsertPoint(),g=e=[d.insertVertex(d.getDefaultParent(),null,"",m.x,m.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
|
||||
d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var r=d.view.getState(e[0]),k=null!=r?r.style:d.getCellStyle(e[0]);"image"!=k[mxConstants.STYLE_SHAPE]&&"label"!=k[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&null!=c&&null!=b){var x=e[0],u=d.getModel().getGeometry(x);null!=u&&(u=u.clone(),u.width=c,u.height=b,
|
||||
d.getModel().setGeometry(x,u))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
|
||||
function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+
|
||||
"+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));l=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
|
||||
b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};
|
||||
Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;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()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||""};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;
|
||||
DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.reportEnabled=!0;
|
||||
DrawioFile.prototype.stats={joined:0,merged:0,reload:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0,conflicts:0,timeouts:0};DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};
|
||||
DrawioFile.prototype.updateFile=function(a,b,e,d){this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=e&&e()||(null!=k?this.mergeFile(k,a,b,d):this.reloadFile(a,b))}catch(l){null!=b&&b(l)}}),b)};
|
||||
|
@ -2855,18 +2855,18 @@ b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableL
|
|||
a)}};EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,
|
||||
10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=
|
||||
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(r){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=
|
||||
a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(r){}})();
|
||||
EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);null!=d&&d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();
|
||||
this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,
|
||||
length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight=
|
||||
"10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=e.substring(e.length-3,e.length)&&(e+="..."),g.innerHTML=e,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,
|
||||
a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,
|
||||
e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);
|
||||
return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(m){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var r=mxUtils.parseXml(c),h=this.editor.extractGraphModel(r.documentElement,
|
||||
null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=h?mxUtils.getXml(h):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=this.editor.graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=
|
||||
a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,
|
||||
h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,
|
||||
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(r){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");
|
||||
EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=
|
||||
null!==e.match("image/jpeg")}catch(r){}})();EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);null!=d&&d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();
|
||||
this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=
|
||||
d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",
|
||||
g.style.paddingLeft="10px",g.style.paddingRight="10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=e.substring(e.length-3,e.length)&&(e+="..."),g.innerHTML=e,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&
|
||||
(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,
|
||||
d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),
|
||||
b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(m){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var r=mxUtils.parseXml(c),
|
||||
h=this.editor.extractGraphModel(r.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=h?mxUtils.getXml(h):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=this.editor.graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:
|
||||
null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));
|
||||
c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,
|
||||
b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,r,h,n,k,v,l){b=null!=b?b:this.editor.graph;r=null!=r?r:!1;v=null!=v?v:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var m=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(m);if(b.decompress(g)!=m)return m;m=a.ownerDocument.createElement("diagram");m.setAttribute("id",Editor.guid());mxUtils.setTextContent(m,
|
||||
g);g=a.ownerDocument.createElement("mxfile");g.appendChild(m)}l?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type"),g.setAttribute("modified",(new Date).toISOString()),g.setAttribute("host",window.location.hostname),g.setAttribute("agent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("etag",
|
||||
Editor.guid()),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!h&&!r&&(n||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(h||!r&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,k,v,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);
|
||||
|
@ -2894,7 +2894,7 @@ if(n||l==mxConstants.NONE)l=null;var p=this.editor.graph.getSvg(l,null,null,null
|
|||
EditorUi.prototype.createDownloadRequest=function(a,b,d,e,r,h){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==h?!1:"xmlpng"!=b);var f="",g="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";"pdf"==b&&0==h&&(g="&allPages=1");if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(h=0;h<this.pages.length;h++)if(this.pages[h]==this.currentPage){f="&from="+h;break}h=this.editor.graph.background;
|
||||
"png"==b&&r&&(h=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+f+g+"&bg="+(null!=h?h:mxConstants.NONE)+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,f=mxUtils.bind(this,function(d){var f=null!=a.data?a.data:"";null!=d&&0<d.length&&(0<f.length&&(f+="\n"),f+=d);d=new LocalFile(this,"csv"!=a.format&&
|
||||
0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);d.getHash=function(){return c};this.fileLoaded(d);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,h=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),n()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),n=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(h,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){n();h()}));n();h()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&
|
||||
mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),m()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),m=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(h,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){m();h()}));m();h()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&
|
||||
!this.isCorsEnabledForUrl(e)&&(e=PROXY_URL+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=
|
||||
a&&"updates"==a.nodeName)){var e=this.editor.graph,h=e.getModel();h.beginUpdate();var n=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var k=h.getCell(a.getAttribute("id"));if(null!=k){try{var v=a.getAttribute("value");if(null!=v){var l=mxUtils.parseXml(v).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))h.setValue(k,l);else for(var p=l.attributes,u=0;u<p.length;u++)e.setAttributeForCell(k,p[u].nodeName,0<p[u].nodeValue.length?p[u].nodeValue:null)}}catch(A){null!=
|
||||
window.console&&console.log("Error in value for "+k.id+": "+A)}try{var z=a.getAttribute("style");null!=z&&e.model.setStyle(k,z)}catch(A){null!=window.console&&console.log("Error in style for "+k.id+": "+A)}try{var q=a.getAttribute("icon");if(null!=q){var t=0<q.length?JSON.parse(q):null;null!=t&&t.append||e.removeCellOverlays(k);null!=t&&e.addCellOverlay(k,c(t))}}catch(A){null!=window.console&&console.log("Error in icon for "+k.id+": "+A)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),
|
||||
|
@ -3148,8 +3148,8 @@ window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a
|
|||
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 h=b.init;b.init=function(){h.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,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||
|
||||
c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;c++;return c};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);
|
||||
this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));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);
|
||||
c++;c++;return c};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);
|
||||
this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==
|
||||
this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
|
@ -3279,22 +3279,21 @@ document.createElement("div");a.style.display="inline-block";a.style.position="r
|
|||
function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geMenuItem gePrimaryBtn",b.style.fontSize="14px",b.style.marginLeft="6px",b.style.padding="6px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");
|
||||
mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geMenuItem";b.style.fontSize="14px";b.style.marginLeft="6px";b.style.padding="6px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);
|
||||
a.y+=40;return a};var f=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,c){var d=this.editorUi.editor.graph;a.smartSeparators=!0;f.apply(this,arguments);mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==d.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,
|
||||
c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("insert",a),this.addSubmenu("layout",a),a.addSeparator(),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-",
|
||||
"exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var g=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=
|
||||
null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),
|
||||
this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);g.apply(this,arguments)};var m=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){m.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=
|
||||
function(){};var r=Menus.prototype.init;Menus.prototype.init=function(){r.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("insertText").label=mxResources.get("text");c.actions.get("insertText").label=mxResources.get("text");c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("insertRectangle").label=mxResources.get("rectangle");c.actions.get("insertEllipse").label=mxResources.get("ellipse");c.actions.get("insertRhombus").label=mxResources.get("rhombus");
|
||||
c.actions.get("insertImage").label=mxResources.get("image")+"...";c.actions.get("insertLink").label=mxResources.get("link")+"...";c.actions.get("createShape").label=mxResources.get("shape")+"...";c.actions.get("outline").label=mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,
|
||||
"change",function(){null!=a.files&&c.importFiles(a.files,null,null,c.maxImageSize)});a.click()}));c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(c,
|
||||
"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",
|
||||
new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(c.menus.addMenuItems(a,["new","open","-"],b),EditorUi.isElectronApp&&c.menus.addMenuItems(a,["synchronize","-"],b),c.menus.addMenuItems(a,["save","saveAs","-"],b)):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):
|
||||
(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),isLocalStorage&&this.addSubmenu("openRecent",a,b),a.addSeparator(b),null!=d&&d.constructor==DriveFile&&c.menus.addMenuItems(a,["share"],b),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||c.menus.addMenuItems(a,["synchronize"],b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);c.menus.addMenuItems(a,"- outline layers - find tags".split(" "),b);mxClient.IS_IOS&&
|
||||
navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&
|
||||
this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-","autosave"],b);null!=d&&d.isRevisionHistorySupported()&&c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){e.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var f=this.get("language");this.put("extras",
|
||||
new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=f&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b));a.addSeparator(b)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,
|
||||
function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],
|
||||
b):c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b);a.addSeparator(b);a.addItem(mxResources.get("more")+"...",null,c.actions.get("toggleShapes").funct,b)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),h=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),
|
||||
b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):h(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,
|
||||
c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("view",a,null,mxResources.get("options")),this.addSubmenu("layout",a),this.addMenuItems(a,["-","exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,
|
||||
["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var g=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),
|
||||
this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=
|
||||
null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);g.apply(this,arguments)};var m=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){m.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var r=Menus.prototype.init;
|
||||
Menus.prototype.init=function(){r.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("createShape").label=mxResources.get("shape")+"...";c.actions.get("outline").label=mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type",
|
||||
"file");mxEvent.addListener(a,"change",function(){null!=a.files&&c.importFiles(a.files,null,null,c.maxImageSize)});a.click()}));c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+
|
||||
"...",function(){var a=new ParseDialog(c,"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,
|
||||
620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(c.menus.addMenuItems(a,["new","open","-"],b),EditorUi.isElectronApp&&c.menus.addMenuItems(a,["synchronize","-"],b),c.menus.addMenuItems(a,["save","saveAs","-"],b)):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,
|
||||
["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),isLocalStorage&&this.addSubmenu("openRecent",a,b),a.addSeparator(b),null!=d&&d.constructor==DriveFile&&c.menus.addMenuItems(a,["share"],b),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||c.menus.addMenuItems(a,["synchronize"],b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);c.menus.addMenuItems(a,"- outline layers - find tags".split(" "),
|
||||
b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&
|
||||
"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-","autosave"],b);null!=d&&d.isRevisionHistorySupported()&&c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){e.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var f=this.get("language");
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=f&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b));a.addSeparator(b)})));this.put("insertAdvanced",
|
||||
new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.insertTemplateEnabled&&!c.isOffline()&&c.menus.addMenuItems(a,
|
||||
["insertTemplate"],b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b);a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),h=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,
|
||||
!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):h(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,
|
||||
["copyConnect","collapseExpand","-","pageScale"],b)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=g.menus.get(a),e=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),m);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));g.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 b(a,b,c,d,e,f){var h=document.createElement("a");
|
||||
h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top="0px";null!=g.statusContainer?l.insertBefore(h,g.statusContainer):l.appendChild(h);null!=f?(h.style.backgroundImage="url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,
|
||||
|
|
1250
src/main/webapp/js/atlas.min.js
vendored
1250
src/main/webapp/js/atlas.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -285,10 +285,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
|
|||
addLogo(IMAGE_PATH + '/onedrive-logo.svg', mxResources.get('oneDrive'), App.MODE_ONEDRIVE, 'oneDrive');
|
||||
}
|
||||
|
||||
if (/*!mxClient.IS_IOS || */urlParams['storage'] == 'device')
|
||||
{
|
||||
addLogo(IMAGE_PATH + '/osa_drive-harddisk.png', mxResources.get('device'), App.MODE_DEVICE);
|
||||
}
|
||||
|
||||
if (isLocalStorage && (urlParams['browser'] == '1' || urlParams['offline'] == '1'))
|
||||
{
|
||||
|
@ -2657,7 +2654,7 @@ var ParseDialog = function(editorUi, title, defaultType)
|
|||
*/
|
||||
var NewDialog = function(editorUi, compact, showName, callback, createOnly, cancelCallback,
|
||||
leftHighlight, rightHighlight, rightHighlightBorder, itemPadding, templateFile,
|
||||
recentDocsCallback, searchDocsCallback, openExtDocCallback, showImport)
|
||||
recentDocsCallback, searchDocsCallback, openExtDocCallback, showImport, createButtonLabel)
|
||||
{
|
||||
showName = (showName != null) ? showName : true;
|
||||
createOnly = (createOnly != null) ? createOnly : false;
|
||||
|
@ -2799,7 +2796,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
|
|||
}
|
||||
};
|
||||
|
||||
var createButton = mxUtils.button(mxResources.get('create'), function()
|
||||
var createButton = mxUtils.button(createButtonLabel || mxResources.get('create'), function()
|
||||
{
|
||||
createButton.setAttribute('disabled', 'disabled');
|
||||
create();
|
||||
|
|
|
@ -252,6 +252,11 @@
|
|||
*/
|
||||
EditorUi.prototype.formatEnabled = urlParams['format'] != '0';
|
||||
|
||||
/**
|
||||
* Whether template action should be shown in insert menu.
|
||||
*/
|
||||
EditorUi.prototype.insertTemplateEnabled = true;
|
||||
|
||||
/**
|
||||
* Restores app defaults for UI
|
||||
*/
|
||||
|
@ -11338,12 +11343,11 @@
|
|||
serviceCount++
|
||||
}
|
||||
|
||||
if (allowBrowser && isLocalStorage && (urlParams['browser'] == '1' || mxClient.IS_IOS))
|
||||
if (allowBrowser && isLocalStorage && urlParams['browser'] == '1')
|
||||
{
|
||||
serviceCount++
|
||||
}
|
||||
|
||||
//if (!mxClient.IS_IOS)
|
||||
else
|
||||
{
|
||||
serviceCount++
|
||||
}
|
||||
|
|
|
@ -112,6 +112,23 @@
|
|||
}), true, null, 'svg');
|
||||
}));
|
||||
|
||||
editorUi.actions.put('insertTemplate', new Action(mxResources.get('template') + '...', function()
|
||||
{
|
||||
var dlg = new NewDialog(editorUi, null, false, function(xml)
|
||||
{
|
||||
editorUi.hideDialog();
|
||||
|
||||
if (xml != null)
|
||||
{
|
||||
graph.setSelectionCells(editorUi.importXml(xml));
|
||||
graph.scrollCellToVisible(graph.getSelectionCell());
|
||||
}
|
||||
}, null, null, null, null, null, null, null, null, null, null,
|
||||
false, mxResources.get('insert'));
|
||||
|
||||
editorUi.showDialog(dlg.container, 620, 440, true, true);
|
||||
}));
|
||||
|
||||
editorUi.actions.put('exportXml', new Action(mxResources.get('formatXml') + '...', function()
|
||||
{
|
||||
var div = document.createElement('div');
|
||||
|
@ -1562,7 +1579,7 @@
|
|||
}
|
||||
})));
|
||||
|
||||
this.put('importFrom', new Menu(function(menu, parent)
|
||||
this.put('importFrom', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
{
|
||||
var doImportFile = mxUtils.bind(this, function(data, mime, filename)
|
||||
{
|
||||
|
@ -1787,7 +1804,7 @@
|
|||
dlg.init();
|
||||
}, parent);
|
||||
}
|
||||
})).isEnabled = isGraphEnabled;
|
||||
}))).isEnabled = isGraphEnabled;
|
||||
|
||||
this.put('theme', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
{
|
||||
|
@ -2090,38 +2107,56 @@
|
|||
return cell;
|
||||
};
|
||||
|
||||
editorUi.actions.addAction('insertText', function()
|
||||
|
||||
editorUi.actions.put('exportSvg', new Action(mxResources.get('formatSvg') + '...', function()
|
||||
{
|
||||
editorUi.showExportDialog(mxResources.get('formatSvg'), true, mxResources.get('export'),
|
||||
'https://support.draw.io/display/DO/Exporting+Files',
|
||||
mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
|
||||
editable, embedImages, border, cropImage, currentPage, linkTarget)
|
||||
{
|
||||
var val = parseInt(scale);
|
||||
|
||||
if (!isNaN(val) && val > 0)
|
||||
{
|
||||
editorUi.exportSvg(val / 100, transparentBackground, ignoreSelection, addShadow,
|
||||
editable, embedImages, border, !cropImage, currentPage, linkTarget);
|
||||
}
|
||||
}), true, null, 'svg');
|
||||
}));
|
||||
|
||||
editorUi.actions.put('insertText', new Action(mxResources.get('text'), function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
graph.startEditingAtCell(insertVertex('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 = isGraphEnabled;
|
||||
}), null, null, Editor.ctrlKey + '+Shift+X').isEnabled = isGraphEnabled;
|
||||
|
||||
editorUi.actions.addAction('insertRectangle', function()
|
||||
editorUi.actions.put('insertRectangle', new Action(mxResources.get('rectangle'), function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
insertVertex('', 120, 60, 'whiteSpace=wrap;html=1;');
|
||||
}
|
||||
}, null, null, Editor.ctrlKey + '+K').isEnabled = isGraphEnabled;
|
||||
}), null, null, Editor.ctrlKey + '+K').isEnabled = isGraphEnabled;
|
||||
|
||||
editorUi.actions.addAction('insertEllipse', function()
|
||||
editorUi.actions.put('insertEllipse', new Action(mxResources.get('ellipse'), function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
insertVertex('', 80, 80, 'ellipse;whiteSpace=wrap;html=1;');
|
||||
}
|
||||
}, null, null, Editor.ctrlKey + '+Shift+K').isEnabled = isGraphEnabled;
|
||||
}), null, null, Editor.ctrlKey + '+Shift+K').isEnabled = isGraphEnabled;
|
||||
|
||||
editorUi.actions.addAction('insertRhombus', function()
|
||||
editorUi.actions.put('insertRhombus', new Action(mxResources.get('rhombus'), function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
insertVertex('', 80, 80, 'rhombus;whiteSpace=wrap;html=1;');
|
||||
}
|
||||
}).isEnabled = isGraphEnabled;
|
||||
})).isEnabled = isGraphEnabled;
|
||||
|
||||
var addInsertMenuItems = mxUtils.bind(this, function(menu, parent, methods)
|
||||
{
|
||||
|
@ -2140,8 +2175,14 @@
|
|||
|
||||
this.put('insert', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
{
|
||||
this.addMenuItems(menu, ['insertText', 'insertRectangle', '-', 'insertEllipse', 'insertRhombus', '-', 'insertLink', 'insertImage'], parent);
|
||||
menu.addSeparator(parent);
|
||||
this.addMenuItems(menu, ['insertRectangle', 'insertEllipse', 'insertRhombus', '-',
|
||||
'insertText', 'insertLink', '-', 'insertImage'], parent);
|
||||
|
||||
if (editorUi.insertTemplateEnabled && !editorUi.isOffline())
|
||||
{
|
||||
this.addMenuItems(menu, ['insertTemplate', '-'], parent);
|
||||
}
|
||||
|
||||
this.addSubmenu('insertLayout', menu, parent, mxResources.get('layout'));
|
||||
menu.addSeparator(parent);
|
||||
addInsertMenuItems(menu, parent, ['fromText', 'plantUml', '-', 'formatSql']);
|
||||
|
|
|
@ -537,10 +537,8 @@ EditorUi.initMinimalTheme = function()
|
|||
menu.addSeparator();
|
||||
this.addMenuItems(menu, ['editData'], null, evt);
|
||||
menu.addSeparator();
|
||||
this.addSubmenu('insert', menu);
|
||||
this.addSubmenu('layout', menu);
|
||||
menu.addSeparator();
|
||||
this.addSubmenu('view', menu, null, mxResources.get('options'));
|
||||
this.addSubmenu('layout', menu);
|
||||
this.addMenuItems(menu, ['-', 'exitGroup'], null, evt);
|
||||
}
|
||||
else if (graph.isEnabled())
|
||||
|
@ -650,14 +648,7 @@ EditorUi.initMinimalTheme = function()
|
|||
var ui = this.editorUi;
|
||||
var graph = ui.editor.graph;
|
||||
|
||||
ui.actions.get('insertText').label = mxResources.get('text');
|
||||
ui.actions.get('insertText').label = mxResources.get('text');
|
||||
ui.actions.get('editDiagram').label = mxResources.get('formatXml') + '...';
|
||||
ui.actions.get('insertRectangle').label = mxResources.get('rectangle');
|
||||
ui.actions.get('insertEllipse').label = mxResources.get('ellipse');
|
||||
ui.actions.get('insertRhombus').label = mxResources.get('rhombus');
|
||||
ui.actions.get('insertImage').label = mxResources.get('image') + '...';
|
||||
ui.actions.get('insertLink').label = mxResources.get('link') + '...';
|
||||
ui.actions.get('createShape').label = mxResources.get('shape') + '...';
|
||||
ui.actions.get('outline').label = mxResources.get('outline') + '...';
|
||||
ui.actions.get('layers').label = mxResources.get('layers') + '...';
|
||||
|
@ -887,8 +878,18 @@ EditorUi.initMinimalTheme = function()
|
|||
|
||||
this.put('insert', new Menu(mxUtils.bind(this, function(menu, parent)
|
||||
{
|
||||
ui.menus.addMenuItems(menu, ['insertRectangle', 'insertEllipse', 'insertRhombus', '-', 'insertText',
|
||||
'insertLink', '-', 'insertImage'], parent);
|
||||
ui.menus.addMenuItems(menu, ['insertRectangle', 'insertEllipse', 'insertRhombus', '-',
|
||||
'insertText', 'insertLink', '-', 'insertImage'], parent);
|
||||
|
||||
if (ui.insertTemplateEnabled && !ui.isOffline())
|
||||
{
|
||||
ui.menus.addMenuItems(menu, ['insertTemplate'], parent);
|
||||
}
|
||||
|
||||
menu.addSeparator(parent);
|
||||
ui.menus.addSubmenu('insertLayout', menu, parent);
|
||||
ui.menus.addSubmenu('insertAdvanced', menu, parent);
|
||||
menu.addSeparator(parent);
|
||||
|
||||
if (mxClient.IS_CHROMEAPP || EditorUi.isElectronApp)
|
||||
{
|
||||
|
@ -898,12 +899,6 @@ EditorUi.initMinimalTheme = function()
|
|||
{
|
||||
ui.menus.addSubmenu('importFrom', menu, parent);
|
||||
}
|
||||
|
||||
menu.addSeparator(parent);
|
||||
ui.menus.addSubmenu('insertLayout', menu, parent);
|
||||
ui.menus.addSubmenu('insertAdvanced', menu, parent);
|
||||
menu.addSeparator(parent);
|
||||
menu.addItem(mxResources.get('more') + '...', null, ui.actions.get('toggleShapes').funct, parent);
|
||||
})));
|
||||
|
||||
var methods = ['horizontalFlow', 'verticalFlow', '-', 'horizontalTree', 'verticalTree',
|
||||
|
|
2
src/main/webapp/js/embed-static.min.js
vendored
2
src/main/webapp/js/embed-static.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.34",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.35",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
|
@ -360,7 +360,15 @@ Actions.prototype.init = function()
|
|||
});
|
||||
}
|
||||
}, null, null, 'Alt+Shift+L');
|
||||
this.addAction('insertLink...', function()
|
||||
this.put('insertImage', new Action(mxResources.get('image') + '...', function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
graph.clearSelection();
|
||||
ui.actions.get('image').funct();
|
||||
}
|
||||
})).isEnabled = isGraphEnabled;
|
||||
this.put('insertLink', new Action(mxResources.get('link') + '...', function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
|
@ -411,7 +419,7 @@ Actions.prototype.init = function()
|
|||
}
|
||||
});
|
||||
}
|
||||
}).isEnabled = isGraphEnabled;
|
||||
})).isEnabled = isGraphEnabled;
|
||||
this.addAction('link...', mxUtils.bind(this, function()
|
||||
{
|
||||
var graph = ui.editor.graph;
|
||||
|
@ -1239,14 +1247,6 @@ Actions.prototype.init = function()
|
|||
}, graph.cellEditor.isContentEditing(), !graph.cellEditor.isContentEditing());
|
||||
}
|
||||
}).isEnabled = isGraphEnabled;
|
||||
this.addAction('insertImage...', function()
|
||||
{
|
||||
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
|
||||
{
|
||||
graph.clearSelection();
|
||||
ui.actions.get('image').funct();
|
||||
}
|
||||
}).isEnabled = isGraphEnabled;
|
||||
action = this.addAction('layers', mxUtils.bind(this, function()
|
||||
{
|
||||
if (this.layersWindow == null)
|
||||
|
|
2
src/main/webapp/js/reader.min.js
vendored
2
src/main/webapp/js/reader.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.34",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.35",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
141
src/main/webapp/js/viewer.min.js
vendored
141
src/main/webapp/js/viewer.min.js
vendored
|
@ -2605,46 +2605,46 @@ a);d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);d.toggleCellStyles(mxConsta
|
|||
null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){d.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){d.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){d.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){d.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("group",function(){1==d.getSelectionCount()?d.setCellStyles("container","1"):d.setSelectionCell(d.groupCells(null,
|
||||
0))},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){1==d.getSelectionCount()&&0==d.getModel().getChildCount(d.getSelectionCell())?d.setCellStyles("container","0"):d.setSelectionCells(d.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){d.removeCellsFromParent()});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();
|
||||
b.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c="";if(mxUtils.isNode(d.value)){var f=d.value.getAttribute("tooltip");null!=f&&(c=f)}c=new TextareaDialog(b,mxResources.get("editTooltip")+":",c,function(c){a.setTooltipForCell(d,c)});b.showDialog(c.container,320,200,!0,!0);c.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());
|
||||
null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c=a.getLinkForCell(d)||"";b.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.addAction("insertLink...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var c=
|
||||
null,f=d.getLinkTitle(a);null!=b&&0<b.length&&(c=b[0].iconUrl,f=b[0].name||b[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));var e=d.getFreeInsertPoint(),c=new mxCell(f,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:"spacing=10;"));c.vertex=!0;d.setLinkForCell(c,a);d.cellSizeUpdated(c,!0);d.getModel().beginUpdate();try{c=d.addCell(c),
|
||||
d.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{d.getModel().endUpdate()}d.setSelectionCell(c);d.scrollCellToVisible(d.getSelectionCell())}})}).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getSelectedElement(),c=a.getParentByName(d,"A",a.cellEditor.textarea),f="";if(null==c&&null!=d&&null!=d.getElementsByTagName)for(var e=d.getElementsByTagName("a"),m=0;m<e.length&&null==c;m++)e[m].textContent==
|
||||
d.textContent&&(a.selectNode(e[m]),c=e[m]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var r=a.cellEditor.saveSelection();b.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(r);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=
|
||||
a[b];if(d.getModel().getChildCount(c))d.updateGroupBounds([c],20);else{var f=d.view.getState(c),e=d.getCellGeometry(c);d.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&d.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(c,e)):d.updateCellSize(c)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();
|
||||
d.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,c=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=c;c=mxUtils.extractTextWithWhitespace(f.childNodes);d.cellLabelChanged(a.cell,c)}else c=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(c));
|
||||
d.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=d.getView().getState(d.getSelectionCell());
|
||||
null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);a.init()});this.addAction("resetView",function(){d.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");
|
||||
this.addAction("zoomOut",function(a){d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){d.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/a.width/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=
|
||||
a.y*d.view.scale-1,d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,
|
||||
(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-
|
||||
d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,
|
||||
parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var l=null,l=this.addAction("grid",function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.isGridEnabled()});l.setEnabled(!1);
|
||||
l=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});l.setEnabled(!1);l=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});l=this.addAction("collapseExpand",function(){var a=
|
||||
new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.foldingEnabled});l.isEnabled=k;l=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.scrollbars});l=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return d.pageVisible});
|
||||
l=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionArrowsEnabled});l=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});
|
||||
l=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});l.isEnabled=k;l=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.autosave});l.isEnabled=k;l.visible=!1;this.addAction("help",function(){var a=
|
||||
"";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));l=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){if(null!=c&&d.cellEditor.isContentEditing())c();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,
|
||||
b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&
|
||||
d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,f)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});
|
||||
this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});
|
||||
this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
|
||||
this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,
|
||||
"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("sharp",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
|
||||
this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),e=d.view.getState(a[0]),
|
||||
c=null!=e?e.style:d.getCellStyle(a[0]),f="1"==mxUtils.getValue(c,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,f);d.setCellStyles(mxConstants.STYLE_CURVED,null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,
|
||||
"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",
|
||||
mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+
|
||||
"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,g=c.x,c=c.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=m;)g+=m.x,c+=m.y,a=d.getModel().getParent(a),m=
|
||||
d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g));f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=
|
||||
d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",
|
||||
function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;d.getModel().beginUpdate();
|
||||
try{if(0==e.length){var m=d.getFreeInsertPoint(),g=e=[d.insertVertex(d.getDefaultParent(),null,"",m.x,m.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var r=d.view.getState(e[0]),k=null!=r?r.style:d.getCellStyle(e[0]);"image"!=k[mxConstants.STYLE_SHAPE]&&"label"!=k[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",
|
||||
e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&null!=c&&null!=b){var x=e[0],u=d.getModel().getGeometry(x);null!=u&&(u=u.clone(),u.width=c,u.height=b,d.getModel().setGeometry(x,u))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;this.addAction("insertImage...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&
|
||||
(d.clearSelection(),b.actions.get("image").funct())}).isEnabled=k;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):
|
||||
this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));l=this.addAction("outline",
|
||||
mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,
|
||||
null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
|
||||
function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;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()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||""};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;
|
||||
null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),c=a.getLinkForCell(d)||"";b.showLinkDialog(c,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())})).isEnabled=
|
||||
k;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var c=null,f=d.getLinkTitle(a);null!=b&&0<b.length&&(c=b[0].iconUrl,f=b[0].name||b[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));var e=d.getFreeInsertPoint(),c=new mxCell(f,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+
|
||||
(null!=c?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+c:"spacing=10;"));c.vertex=!0;d.setLinkForCell(c,a);d.cellSizeUpdated(c,!0);d.getModel().beginUpdate();try{c=d.addCell(c),d.fireEvent(new mxEventObject("cellsInserted","cells",[c]))}finally{d.getModel().endUpdate()}d.setSelectionCell(c);d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=
|
||||
a.getSelectedElement(),c=a.getParentByName(d,"A",a.cellEditor.textarea),f="";if(null==c&&null!=d&&null!=d.getElementsByTagName)for(var e=d.getElementsByTagName("a"),m=0;m<e.length&&null==c;m++)e[m].textContent==d.textContent&&(a.selectNode(e[m]),c=e[m]);null!=c&&"A"==c.nodeName&&(f=c.getAttribute("href")||"");var r=a.cellEditor.saveSelection();b.showLinkDialog(f,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(r);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?
|
||||
this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().getChildCount(c))d.updateGroupBounds([c],20);else{var f=d.view.getState(c),e=d.getCellGeometry(c);d.getModel().isVertex(c)&&null!=f&&null!=f.text&&null!=e&&d.isWrapping(c)?(e=e.clone(),e.height=f.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(c,e)):
|
||||
d.updateCellSize(c)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,c=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var f=document.createElement("div");f.innerHTML=c;c=mxUtils.extractTextWithWhitespace(f.childNodes);
|
||||
d.cellLabelChanged(a.cell,c)}else c=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(c));d.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();
|
||||
null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=d.getView().getState(d.getSelectionCell());null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);
|
||||
a.init()});this.addAction("resetView",function(){d.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(a){d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){d.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();
|
||||
var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/a.width/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=a.y*d.view.scale-1,d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,
|
||||
b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();
|
||||
d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&
|
||||
0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var l=null,l=this.addAction("grid",
|
||||
function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.isGridEnabled()});l.setEnabled(!1);l=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});l.setEnabled(!1);
|
||||
l=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});l=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.foldingEnabled});l.isEnabled=k;l=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});
|
||||
l.setToggleAction(!0);l.setSelectedCallback(function(){return d.scrollbars});l=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));l.setToggleAction(!0);l.setSelectedCallback(function(){return d.pageVisible});l=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionArrowsEnabled});
|
||||
l=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});l=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});l.setToggleAction(!0);l.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});
|
||||
l.isEnabled=k;l=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});l.setToggleAction(!0);l.setSelectedCallback(function(){return b.editor.autosave});l.isEnabled=k;l.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var p=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){p||(b.showDialog((new AboutDialog(b)).container,
|
||||
320,280,!0,!0,function(){p=!1}),p=!0)},null,null,"F1"));l=mxUtils.bind(this,function(a,b,c,f){return this.addAction(a,function(){if(null!=c&&d.cellEditor.isContentEditing())c();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
|
||||
d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,f)});l("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");l("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",
|
||||
!1,null)},Editor.ctrlKey+"+I");l("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});
|
||||
this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,
|
||||
null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
|
||||
mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("sharp",
|
||||
function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged",
|
||||
"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),e=d.view.getState(a[0]),c=null!=e?e.style:d.getCellStyle(a[0]),f="1"==mxUtils.getValue(c,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,f);d.setCellStyles(mxConstants.STYLE_CURVED,
|
||||
null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[f,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
|
||||
this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",
|
||||
function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();
|
||||
if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var c=d.view.translate,f=d.view.scale,g=c.x,c=c.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=m;)g+=m.x,c+=m.y,a=d.getModel().getParent(a),m=d.getCellGeometry(a);g=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g));f=Math.round(d.snap(d.popupMenuHandler.triggerY/f-c));b.addPointAt(b.state,g,f)}}});this.addAction("removeWaypoint",function(){var a=
|
||||
b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var c=a[b];if(d.getModel().isEdge(c)){var f=d.getCellGeometry(c);null!=f&&(f=f.clone(),f.points=null,d.getModel().setGeometry(c,f))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,
|
||||
function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),c="";null!=
|
||||
e&&(c=e.style[mxConstants.STYLE_IMAGE]||c);var f=d.cellEditor.saveSelection();b.showImageDialog(a,c,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(f),d.insertImage(a,c,b);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var g=null;d.getModel().beginUpdate();try{if(0==e.length){var m=d.getFreeInsertPoint(),g=e=[d.insertVertex(d.getDefaultParent(),null,"",m.x,m.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
|
||||
d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var r=d.view.getState(e[0]),k=null!=r?r.style:d.getCellStyle(e[0]);"image"!=k[mxConstants.STYLE_SHAPE]&&"label"!=k[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&null!=c&&null!=b){var x=e[0],u=d.getModel().getGeometry(x);null!=u&&(u=u.clone(),u.width=c,u.height=b,
|
||||
d.getModel().setGeometry(x,u))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;l=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
|
||||
function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));l=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+
|
||||
"+Shift+P");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));l=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
|
||||
b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};
|
||||
Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;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()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||""};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;
|
||||
DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.reportEnabled=!0;
|
||||
DrawioFile.prototype.stats={joined:0,merged:0,reload:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0,conflicts:0,timeouts:0};DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};
|
||||
DrawioFile.prototype.updateFile=function(a,b,e,d){this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=e&&e()||(null!=k?this.mergeFile(k,a,b,d):this.reloadFile(a,b))}catch(l){null!=b&&b(l)}}),b)};
|
||||
|
@ -2855,18 +2855,18 @@ b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableL
|
|||
a)}};EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";
|
||||
EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,
|
||||
10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=
|
||||
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(r){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=
|
||||
a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(r){}})();
|
||||
EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);null!=d&&d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();
|
||||
this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,
|
||||
length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight=
|
||||
"10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=e.substring(e.length-3,e.length)&&(e+="..."),g.innerHTML=e,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,
|
||||
a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,
|
||||
e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);
|
||||
return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(m){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var r=mxUtils.parseXml(c),h=this.editor.extractGraphModel(r.documentElement,
|
||||
null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=h?mxUtils.getXml(h):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=this.editor.graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=
|
||||
a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,
|
||||
h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,
|
||||
!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(r){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,0,0);var a=b.toDataURL("image/png");
|
||||
EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(h){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}try{b=document.createElement("canvas");b.width=b.height=1;var e=b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=
|
||||
null!==e.match("image/jpeg")}catch(r){}})();EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);null!=d&&d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();
|
||||
this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=
|
||||
d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",
|
||||
g.style.paddingLeft="10px",g.style.paddingRight="10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=e.substring(e.length-3,e.length)&&(e+="..."),g.innerHTML=e,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&
|
||||
(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,
|
||||
d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),
|
||||
b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(m){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var e=c.lastIndexOf("</mxfile>");e>d&&(b=c.substring(d,e+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var r=mxUtils.parseXml(c),
|
||||
h=this.editor.extractGraphModel(r.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=h?mxUtils.getXml(h):""}catch(n){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=this.editor.graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:
|
||||
null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var h=this.updatePageRoot(new DiagramPage(d[e]));null==h.getName()&&h.setName(mxResources.get("pageWithNumber",[e+1]));
|
||||
c.model.execute(new ChangePage(this,h,0==e?h:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,
|
||||
b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,r,h,n,k,v,l){b=null!=b?b:this.editor.graph;r=null!=r?r:!1;v=null!=v?v:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var m=b.zapGremlins(mxUtils.getXml(a)),g=b.compress(m);if(b.decompress(g)!=m)return m;m=a.ownerDocument.createElement("diagram");m.setAttribute("id",Editor.guid());mxUtils.setTextContent(m,
|
||||
g);g=a.ownerDocument.createElement("mxfile");g.appendChild(m)}l?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type"),g.setAttribute("modified",(new Date).toISOString()),g.setAttribute("host",window.location.hostname),g.setAttribute("agent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("etag",
|
||||
Editor.guid()),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!h&&!r&&(n||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(h||!r&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,k,v,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);
|
||||
|
@ -2894,7 +2894,7 @@ if(n||l==mxConstants.NONE)l=null;var p=this.editor.graph.getSvg(l,null,null,null
|
|||
EditorUi.prototype.createDownloadRequest=function(a,b,d,e,r,h){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==h?!1:"xmlpng"!=b);var f="",g="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";"pdf"==b&&0==h&&(g="&allPages=1");if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&null!=this.currentPage))for(h=0;h<this.pages.length;h++)if(this.pages[h]==this.currentPage){f="&from="+h;break}h=this.editor.graph.background;
|
||||
"png"==b&&r&&(h=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+f+g+"&bg="+(null!=h?h:mxConstants.NONE)+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,f=mxUtils.bind(this,function(d){var f=null!=a.data?a.data:"";null!=d&&0<d.length&&(0<f.length&&(f+="\n"),f+=d);d=new LocalFile(this,"csv"!=a.format&&
|
||||
0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);d.getHash=function(){return c};this.fileLoaded(d);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,h=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),n()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),n=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(h,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){n();h()}));n();h()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&
|
||||
mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),m()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),m=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(h,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){m();h()}));m();h()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&
|
||||
!this.isCorsEnabledForUrl(e)&&(e=PROXY_URL+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=
|
||||
a&&"updates"==a.nodeName)){var e=this.editor.graph,h=e.getModel();h.beginUpdate();var n=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var k=h.getCell(a.getAttribute("id"));if(null!=k){try{var v=a.getAttribute("value");if(null!=v){var l=mxUtils.parseXml(v).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))h.setValue(k,l);else for(var p=l.attributes,u=0;u<p.length;u++)e.setAttributeForCell(k,p[u].nodeName,0<p[u].nodeValue.length?p[u].nodeValue:null)}}catch(A){null!=
|
||||
window.console&&console.log("Error in value for "+k.id+": "+A)}try{var z=a.getAttribute("style");null!=z&&e.model.setStyle(k,z)}catch(A){null!=window.console&&console.log("Error in style for "+k.id+": "+A)}try{var q=a.getAttribute("icon");if(null!=q){var t=0<q.length?JSON.parse(q):null;null!=t&&t.append||e.removeCellOverlays(k);null!=t&&e.addCellOverlay(k,c(t))}}catch(A){null!=window.console&&console.log("Error in icon for "+k.id+": "+A)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),
|
||||
|
@ -3148,8 +3148,8 @@ window.location.search;return b};EditorUi.prototype.getUrl=function(a){a=null!=a
|
|||
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 h=b.init;b.init=function(){h.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,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||
|
||||
c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;c++;return c};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);
|
||||
this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));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);
|
||||
c++;c++;return c};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 d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);
|
||||
this.menus.get("embed").setEnabled(!d);d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));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&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==
|
||||
this.offlineStatus){this.offlineStatus=document.createElement("div");this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);
|
||||
mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+
|
||||
|
@ -3279,22 +3279,21 @@ document.createElement("div");a.style.display="inline-block";a.style.position="r
|
|||
function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geMenuItem gePrimaryBtn",b.style.fontSize="14px",b.style.marginLeft="6px",b.style.padding="6px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");
|
||||
mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geMenuItem";b.style.fontSize="14px";b.style.marginLeft="6px";b.style.padding="6px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);
|
||||
a.y+=40;return a};var f=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,c){var d=this.editorUi.editor.graph;a.smartSeparators=!0;f.apply(this,arguments);mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==d.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,
|
||||
c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("insert",a),this.addSubmenu("layout",a),a.addSeparator(),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-",
|
||||
"exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var g=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=
|
||||
null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),
|
||||
this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);g.apply(this,arguments)};var m=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){m.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=
|
||||
function(){};var r=Menus.prototype.init;Menus.prototype.init=function(){r.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("insertText").label=mxResources.get("text");c.actions.get("insertText").label=mxResources.get("text");c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("insertRectangle").label=mxResources.get("rectangle");c.actions.get("insertEllipse").label=mxResources.get("ellipse");c.actions.get("insertRhombus").label=mxResources.get("rhombus");
|
||||
c.actions.get("insertImage").label=mxResources.get("image")+"...";c.actions.get("insertLink").label=mxResources.get("link")+"...";c.actions.get("createShape").label=mxResources.get("shape")+"...";c.actions.get("outline").label=mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,
|
||||
"change",function(){null!=a.files&&c.importFiles(a.files,null,null,c.maxImageSize)});a.click()}));c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(c,
|
||||
"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",
|
||||
new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(c.menus.addMenuItems(a,["new","open","-"],b),EditorUi.isElectronApp&&c.menus.addMenuItems(a,["synchronize","-"],b),c.menus.addMenuItems(a,["save","saveAs","-"],b)):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):
|
||||
(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),isLocalStorage&&this.addSubmenu("openRecent",a,b),a.addSeparator(b),null!=d&&d.constructor==DriveFile&&c.menus.addMenuItems(a,["share"],b),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||c.menus.addMenuItems(a,["synchronize"],b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);c.menus.addMenuItems(a,"- outline layers - find tags".split(" "),b);mxClient.IS_IOS&&
|
||||
navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&
|
||||
this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-","autosave"],b);null!=d&&d.isRevisionHistorySupported()&&c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){e.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var f=this.get("language");this.put("extras",
|
||||
new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=f&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b));a.addSeparator(b)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,
|
||||
function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],
|
||||
b):c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b);a.addSeparator(b);a.addItem(mxResources.get("more")+"...",null,c.actions.get("toggleShapes").funct,b)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),h=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),
|
||||
b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):h(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,
|
||||
c),d.isCellFoldable(d.getSelectionCell())&&this.addMenuItems(a,d.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):d.isSelectionEmpty()&&d.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,c),a.addSeparator(),this.addSubmenu("view",a,null,mxResources.get("options")),this.addSubmenu("layout",a),this.addMenuItems(a,["-","exitGroup"],null,c)):d.isEnabled()&&this.addMenuItems(a,
|
||||
["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var g=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),
|
||||
this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=
|
||||
null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);g.apply(this,arguments)};var m=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){m.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var r=Menus.prototype.init;
|
||||
Menus.prototype.init=function(){r.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("createShape").label=mxResources.get("shape")+"...";c.actions.get("outline").label=mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importFile",new Action("File...",function(){d.popupMenuHandler.hideMenu();var a=document.createElement("input");a.setAttribute("type",
|
||||
"file");mxEvent.addListener(a,"change",function(){null!=a.files&&c.importFiles(a.files,null,null,c.maxImageSize)});a.click()}));c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+
|
||||
"...",function(){var a=new ParseDialog(c,"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,
|
||||
620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(c.menus.addMenuItems(a,["new","open","-"],b),EditorUi.isElectronApp&&c.menus.addMenuItems(a,["synchronize","-"],b),c.menus.addMenuItems(a,["save","saveAs","-"],b)):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,
|
||||
["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),isLocalStorage&&this.addSubmenu("openRecent",a,b),a.addSeparator(b),null!=d&&d.constructor==DriveFile&&c.menus.addMenuItems(a,["share"],b),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||c.menus.addMenuItems(a,["synchronize"],b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);c.menus.addMenuItems(a,"- outline layers - find tags".split(" "),
|
||||
b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["save","makeCopy","-","rename","moveToFolder"],b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&
|
||||
"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-","autosave"],b);null!=d&&d.isRevisionHistorySupported()&&c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var e=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){e.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var f=this.get("language");
|
||||
this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=f&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b));a.addSeparator(b)})));this.put("insertAdvanced",
|
||||
new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.insertTemplateEnabled&&!c.isOffline()&&c.menus.addMenuItems(a,
|
||||
["insertTemplate"],b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b);a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b)})));var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),h=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,
|
||||
!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):h(a,b,mxResources.get(g[c])+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,
|
||||
["copyConnect","collapseExpand","-","pageScale"],b)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=g.menus.get(a),e=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),m);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));g.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 b(a,b,c,d,e,f){var h=document.createElement("a");
|
||||
h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top="0px";null!=g.statusContainer?l.insertBefore(h,g.statusContainer):l.appendChild(h);null!=f?(h.style.backgroundImage="url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,
|
||||
|
|
Loading…
Reference in a new issue