Browse Source

8.4.7 release

David Benson 7 years ago
parent
commit
6fbaacfbbc

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+15-MAR-2018: 8.4.7
+
+- Improves Gliffy import
+
 13-MAR-2018: 8.4.6
 
 - Fixes adding of clones with new index

+ 1 - 1
VERSION

@@ -1 +1 @@
-8.4.6
+8.4.7

+ 7 - 1
src/main/java/com/mxgraph/io/gliffy/model/GliffyObject.java

@@ -392,7 +392,7 @@ public class GliffyObject implements PostDeserializable
 	@Override
 	public void postDeserialize()
 	{
-		if (isGroup()) 
+		if (isGroup() && hasChildren()) 
 		{
 			normalizeChildrenCoordinates();
 			adjustZOrder();			
@@ -406,6 +406,12 @@ public class GliffyObject implements PostDeserializable
 	 */
 	private void normalizeChildrenCoordinates()
 	{
+		//Sometimes, a group does not have children
+		if (!hasChildren())
+		{
+			return;
+		}
+		
 		//sorts the list to find the leftmost child and it's X
 		Comparator<GliffyObject> cx = new Comparator<GliffyObject>()
 		{

+ 1 - 1
src/main/webapp/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 03/13/2018 05:13 PM
+# 03/15/2018 03:18 PM
 
 app.html
 index.html?offline=1

+ 0 - 240
src/main/webapp/connect/confluence/connect-dev.json

@@ -1,240 +0,0 @@
-{
-    "name": "Draw.io gaudenz",
-    "description": "Draw.io add-on for Confluence",
-    "key": "com.mxgraph.confluence.plugins.diagramly",
-    "baseUrl": "https://0d961297.ngrok.io/",
-    "vendor": 
-    {
-        "name": "JGraph Ltd.",
-        "url": "https://www.jgraph.com"
-    },
-    "links": {
-        "documentation": "https://support.draw.io/display/DFCC/draw.io+for+Confluence+Cloud"
-    },
-    "version": "1.1.0",
-    "authentication": 
-    {
-        "type": "none"
-    },
-    "modules": 
-    {
-		"generalPages": [
-            {
-                "key": "lightbox",
-                "url": "/connect/confluence/viewer2.html?lightbox=1",
-                "name": {
-                    "value": "Lightbox"
-                }
-            }
-        ],
-        "adminPages": [
-            {
-                "key": "admin",
-                "url": "/connect/confluence/admin.html",
-                "name": {
-                    "value": "draw.io configuration"
-                }
-            }
-        ],
-        "dynamicContentMacros": 
-        [
-            {
-                "name": 
-                {
-                    "i18n": "drawioMacro",
-                    "value": "Draw.io Diagram"
-                },
-                "url": "/connect/confluence/viewer2.html?ceoId=${page.id}&diagramName=${diagramName}&revision=${revision}&width=${width}&height=${height}&tbstyle=${tbstyle}&lbox=${lbox}&zoom=${zoom}&links=${links}&owningPageId=${pageId}",
-                "width": "100%",
-                "description": 
-                {
-                    "i18n": "description",
-                    "value": "Inserts a new Draw.io Diagram"
-                }, "icon": 
-                {
-		          "width": 128,
-		          "height": 128,
-		          "url": "/images/drawlogo128.png"
-		        },
-		        "categories": [
-		          "visuals"
-		        ],
-		        "outputType": "block",
-		        "featured": true,
-                "key": "drawio",
-			    "parameters": 
-			    [
-				    {
-				      "identifier": "diagramName",
-				      "name": 
-				      {
-				        "value": "Diagram name (do not change)"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "autoSize",
-				      "name": 
-				      {
-				        "value": "automatic size"
-				      },
-				      "type": "boolean"
-				    },
-				    {
-				      "identifier": "PageId",
-				      "name": 
-				      {
-				        "value": "Parent page ID"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "baseUrl",
-				      "name": 
-				      {
-				        "value": "Confluence Base URL"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "width",
-				      "name": 
-				      {
-				        "value": "Diagram width"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "height",
-				      "name": 
-				      {
-				        "value": "Diagram Height"
-				      },
-				      "type": "string"
-				    }
-  				],
-  				"editor": {
-				    "url": "/connect/confluence/macroEditor.html?ceoId=${page.id}&diagramName=${diagramName}",
-				    "width": "100%",
-				    "height": "100%"
-				},
-				"imagePlaceholder": {
-				    "width": 500,
-				    "height": 300,
-				    "url": "/connectImage",
-				    "applyChrome": true
-				},
-				"renderModes": {
-		          "default": {
-		            "url": "/connectRender?pageId=${page.id}&diagramName=${diagramName}"
-		          }
-		        }
-            },
-            {
-                "name": 
-                {
-                    "i18n": "drawioMacro",
-                    "value": "Legacy draw.io macro"
-                },
-                "url": "/connect/confluence/viewer.html?ceoId=${page.id}&diagramName=${diagramName}&revision=${revision}&width=${width}&height=${height}",
-                "width": "100%",
-                "description": 
-                {
-                    "i18n": "description",
-                    "value": "Do not use"
-                }, "icon": 
-                {
-		          "width": 80,
-		          "height": 80,
-		          "url": "/images/stop-flat-icon-80.png"
-		        },
-		        "categories": [
-		          "visuals"
-		        ],
-		        "outputType": "block",
-		        "featured": false,
-                "key": "drawio-macro",
-			    "parameters": 
-			    [
-				    {
-				      "identifier": "diagramName",
-				      "name": 
-				      {
-				        "value": "Diagram name (do not change)"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "autoSize",
-				      "name": 
-				      {
-				        "value": "automatic size"
-				      },
-				      "type": "boolean"
-				    },
-				    {
-				      "identifier": "PageId",
-				      "name": 
-				      {
-				        "value": "Parent page ID"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "baseUrl",
-				      "name": 
-				      {
-				        "value": "Confluence Base URL"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "width",
-				      "name": 
-				      {
-				        "value": "Diagram width"
-				      },
-				      "type": "string"
-				    },
-				    {
-				      "identifier": "height",
-				      "name": 
-				      {
-				        "value": "Diagram Height"
-				      },
-				      "type": "string"
-				    }
-  				],
-  				"editor": {
-				    "url": "/connect/confluence/macroEditor.html?ceoId=${page.id}&diagramName=${diagramName}",
-				    "editTitle": {
-				      "value": "Edit MarkDown",
-				      "i18n": "macro.md.edit"
-				    },
-				    "insertTitle": {
-				      "value": "Insert New MarkDown",
-				      "i18n": "macro.md.insert"
-				    },
-				    "width": "100%",
-				    "height": "100%"
-				},
-				"imagePlaceholder": {
-				    "width": 500,
-				    "height": 300,
-				    "url": "/connectImage",
-				    "applyChrome": true
-				},
-				"renderModes": {
-		          "default": {
-		            "url": "/connectRender?pageId=${page.id}&diagramName=${diagramName}&revision=${revision}"
-		          }
-		        }
-            }
-        ]
-    },
-    "scopes": [
-    "read",
-    "write",
-    "delete"
-  	]
-}

+ 0 - 93
src/main/webapp/connect/jira/connect-dev.json

@@ -1,93 +0,0 @@
-{
-     "name": "Draw.io gaudenz",
-     "description": "Draw.io add-on for JIRA",
-     "key": "com.mxgraph.jira.plugins.drawio.gaudenz",
-     "baseUrl": "https://0d961297.ngrok.io/",
-     "vendor": {
-         "name": "JGraph Ltd.",
-         "url": "https://www.jgraph.com"
-     },
-     "authentication": 
-     {
-         "type": "none"
-     },
-     "version": "1.0.4",
-     "scopes": 
-     [
-     	"READ",
-     	"WRITE",
-     	"DELETE"
-	 ],
-     "modules": 
-     {
-      "generalPages": 
-      [
-      	{
-			"url":"/connect/jira/editor2.html?issueId=${issue.id}",
-			"key":"drawioEditor",
-			"name":
-			{
-				"value":"Draw.io Editor"
-			},
-			"location":"hidden"
-		},
-		{
-			"url":"/connect/jira/fullScreenViewer2.html?issueId=${issue.id}",
-			"key":"drawioFullScreenViewer",
-			"name":
-			{
-				"value":"Draw.io Full Screen Viewer"
-			},
-			"location":"hidden"
-		}
-      ],
-	  "webItems": [
-	    {
-	      "location": "operations-attachments",
-	      "weight": 50,
-	      "key": "drawioEditorBlank",
-	      "url": "/connect/jira/editor2.html?issueId=${issue.id}",
-	      "name": {
-	        "value": "Add Draw.io Diagram"
-	      },
-	      "target": 
-	      {
-			"type":"dialog",
-			"options": 
-			{
-				"width":"100%",
-				"height":"100%",
-				"chrome":false
-			}
-		  }
-	    }, 
-	    {
-       	   "key": "drawioEditorDialog",
-	        "name": 
-	        {
-	            "value": "Draw.io Editor"
-	        },
-	        "url": "/connect/jira/editor2.html?issueId=${issue.id}",
-	        "location": "none",
-	        "context": "addon"
-	    }
-	  ],
-	  "webPanels": 
-	  [
-      {
-        "url": "/connect/jira/viewerPanel2.html?issueId=${issue.id}",
-        "location": "atl.jira.view.issue.right.context",
-        "layout": 
-        {
-          "width": "300px"
-        },
-        "weight": 50,
-        "key": "drawioViewerPanel",
-        "name": 
-        {
-          "value": "Draw.io Diagrams"
-        }
-      }
-    ] 
-	}
- }

File diff suppressed because it is too large
+ 39 - 39
src/main/webapp/js/app.min.js


File diff suppressed because it is too large
+ 36 - 36
src/main/webapp/js/atlas-viewer.min.js


File diff suppressed because it is too large
+ 409 - 409
src/main/webapp/js/atlas.min.js


+ 10 - 2
src/main/webapp/js/diagramly/Dialogs.js

@@ -6936,9 +6936,17 @@ var PluginsDialog = function(editorUi)
 				
 				for (var i = 0; i < tokens.length; i++)
 				{
-					if (tokens[i].length > 0 && mxUtils.indexOf(plugins, tokens[i]) < 0)
+					var token = tokens[i];
+					var url = App.pluginRegistry[token];
+					
+					if (url != null)
+					{
+						token = url;
+					}
+					
+					if (token.length > 0 && mxUtils.indexOf(plugins, token) < 0)
 					{
-						plugins.push(tokens[i]);
+						plugins.push(token);
 					}
 				}
 				

+ 2 - 17
src/main/webapp/js/diagramly/ElectronApp.js

@@ -107,23 +107,8 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 				this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000032875');
 			}
 			
-			this.addMenuItems(menu, ['autosave', '-', 'createShape', 'editDiagram', '-'], parent);
-			
-			var item = this.addMenuItem(menu, 'plugins', parent);
-			
-			if (!editorUi.isOffline())
-			{
-				this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000056430');
-			}
-			
-			var item = this.addMenuItem(menu, 'tags', parent);
-			
-			if (!editorUi.isOffline())
-			{
-				this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000046966');
-			}
-
-			this.addMenuItems(menu, ['-', 'online'], parent);			
+			this.addMenuItems(menu, ['autosave', '-', 'createShape', 'editDiagram', '-',
+				'plugins', 'tags', '-', 'online'], parent);
 		})));
 	};
 	

File diff suppressed because it is too large
+ 37 - 37
src/main/webapp/js/embed-static.min.js


+ 5 - 5
src/main/webapp/js/mxgraph/Actions.js

@@ -25,7 +25,7 @@ Actions.prototype.init = function()
 	};
 
 	// File actions
-	this.addAction('new...', function() { graph.openLink(ui.getUrl()); });
+	this.addAction('new...', function() { window.open(ui.getUrl()); });
 	this.addAction('open...', function()
 	{
 		window.openNew = true;
@@ -291,14 +291,14 @@ Actions.prototype.init = function()
 			ui.showDialog(dlg.container, 320, 200, true, true);
 			dlg.init();
 		}
-	}, null, null, 'Alt+Shift+T');
+	});
 	this.addAction('openLink', function()
 	{
 		var link = graph.getLinkForCell(graph.getSelectionCell());
 		
 		if (link != null)
 		{
-			graph.openLink(link);
+			window.open(link);
 		}
 	});
 	this.addAction('editLink...', function()
@@ -316,7 +316,7 @@ Actions.prototype.init = function()
     				graph.setLinkForCell(cell, (link.length > 0) ? link : null);
 			});
 		}
-	}, null, null, 'Alt+Shift+L');
+	});
 	this.addAction('insertLink...', function()
 	{
 		if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
@@ -755,7 +755,7 @@ Actions.prototype.init = function()
 			ext = '_' + mxClient.language;
 		}
 		
-		graph.openLink(RESOURCES_PATH + '/help' + ext + '.html');
+		window.open(RESOURCES_PATH + '/help' + ext + '.html');
 	});
 	
 	var showingAbout = false;

+ 4 - 4
src/main/webapp/js/mxgraph/Dialogs.js

@@ -520,7 +520,7 @@ var FilenameDialog = function(editorUi, filename, buttonText, fn, label, validat
 	{
 		var helpBtn = mxUtils.button(mxResources.get('help'), function()
 		{
-			editorUi.editor.graph.openLink(helpLink);
+			window.open(helpLink);
 		});
 		
 		helpBtn.className = 'geBtn';	
@@ -780,7 +780,7 @@ var EditDiagramDialog = function(editorUi)
 			});
 			
 			window.openFile.setData(data, null);
-			editorUi.editor.graph.openLink(editorUi.getUrl());
+			window.open(editorUi.getUrl());
 		}
 		else if (select.value == 'replace')
 		{
@@ -1948,7 +1948,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
 	var tbarHeight = (!EditorUi.compactUi) ? '30px' : '26px';
 	
 	var listDiv = document.createElement('div')
-	listDiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? '#dcdcdc' : '#e5e5e5';
+	listDiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? '#a2a2a2' : '#e5e5e5';
 	listDiv.style.position = 'absolute';
 	listDiv.style.overflow = 'auto';
 	listDiv.style.left = '0px';
@@ -2457,7 +2457,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
 	});
 
 	this.window = new mxWindow(mxResources.get('layers'), div, x, y, w, h, true, true);
-	this.window.minimumSize = new mxRectangle(0, 0, 120, 120);
+	this.window.minimumSize = new mxRectangle(0, 0, 90, 90);
 	this.window.destroyOnClose = false;
 	this.window.setMaximizable(false);
 	this.window.setResizable(true);

+ 2 - 2
src/main/webapp/js/mxgraph/Editor.js

@@ -312,12 +312,12 @@ Editor.prototype.editAsNew = function(xml, title)
 				}));
 			}
 
-			this.editorWindow = this.graph.openLink(this.getEditBlankUrl(p +
+			this.editorWindow = window.open(this.getEditBlankUrl(p +
 				((p.length > 0) ? '&' : '?') + 'client=1'));
 		}
 		else
 		{
-			this.editorWindow = this.graph.openLink(this.getEditBlankUrl(p) +
+			this.editorWindow = window.open(this.getEditBlankUrl(p) +
 				'#R' + encodeURIComponent(xml));
 		}
 	}

+ 6 - 9
src/main/webapp/js/mxgraph/EditorUi.js

@@ -1321,6 +1321,8 @@ EditorUi.prototype.initClipboard = function()
  */
 EditorUi.prototype.initCanvas = function()
 {
+	var graph = this.editor.graph;
+
 	// Initial page layout view, scrollBuffer and timer-based scrolling
 	var graph = this.editor.graph;
 	graph.timerAutoScroll = true;
@@ -1715,7 +1717,7 @@ EditorUi.prototype.initCanvas = function()
 					}
 					else
 					{
-						graph.openLink(this.editor.editButtonLink, 'editWindow');
+						window.open(this.editor.editButtonLink, 'editWindow');
 					}
 					
 					mxEvent.consume(evt);
@@ -2007,7 +2009,8 @@ EditorUi.prototype.initCanvas = function()
 	{
 		// Ctrl+wheel (or pinch on touchpad) is a native browser zoom event is OS X
 		// LATER: Add support for zoom via pinch on trackpad for Chrome in OS X
-		if ((this.dialogs == null || this.dialogs.length == 0) && graph.isZoomWheelEvent(evt))
+		if ((mxEvent.isAltDown(evt) || (mxEvent.isControlDown(evt) && !mxClient.IS_MAC) ||
+			graph.panningHandler.isActive()) && (this.dialogs == null || this.dialogs.length == 0))
 		{
 			var source = mxEvent.getSource(evt);
 			
@@ -3005,10 +3008,6 @@ EditorUi.prototype.createDivs = function()
 	{
 		this.tabContainer = this.createTabContainer();
 	}
-	else
-	{
-		this.diagramContainer.style.border = 'none';
-	}
 };
 
 /**
@@ -3865,9 +3864,7 @@ EditorUi.prototype.createKeyHandler = function(editor)
 	// Alt+Shift+Keycode mapping to action
 	var altShiftActions = {67: this.actions.get('clearWaypoints'), // Alt+Shift+C
 						  65: this.actions.get('connectionArrows'), // Alt+Shift+A
-						  76: this.actions.get('editLink'), // Alt+Shift+L
-						  80: this.actions.get('connectionPoints'), // Alt+Shift+P
-						  84: this.actions.get('editTooltip') // Alt+Shift+T
+						  80: this.actions.get('connectionPoints') // Alt+Shift+P
 	};
 	
 	mxKeyHandler.prototype.getFunction = function(evt)

+ 3 - 2
src/main/webapp/js/mxgraph/Format.js

@@ -256,9 +256,8 @@ Format.prototype.isRoundedState = function(state)
 Format.prototype.isLineJumpState = function(state)
 {
 	var shape = mxUtils.getValue(state.style, mxConstants.STYLE_SHAPE, null);
-	var curved = mxUtils.getValue(state.style, mxConstants.STYLE_CURVED, false);
 	
-	return !curved && (shape == 'connector' || shape == 'filledEdge');
+	return shape == 'connector' || shape == 'filledEdge';
 };
 
 /**
@@ -889,6 +888,8 @@ BaseFormatPanel.prototype.createOption = function(label, isCheckedFn, setChecked
 			
 			apply(cb.checked);
 		}
+		
+		mxEvent.consume(evt);
 	});
 	
 	apply(value);

+ 186 - 226
src/main/webapp/js/mxgraph/Graph.js

@@ -621,15 +621,13 @@ Graph = function(container, model, renderHint, stylesheet, themes)
 			return mxEvent.isMouseEvent(me.getEvent());
 		};
 	
-		// Handles links if graph is read-only or cell is locked
+		// Enables links if graph is "disabled" (ie. read-only)
 		var click = this.click;
 		this.click = function(me)
 		{
-			var locked = me.state == null && me.sourceState != null && this.isCellLocked(me.sourceState.cell);
-			
-			if ((!this.isEnabled() || locked) && !me.isConsumed())
+			if (!this.isEnabled() && !me.isConsumed())
 			{
-				var cell = (locked) ? me.sourceState.cell : me.getCell();
+				var cell = me.getCell();
 				
 				if (cell != null)
 				{
@@ -637,14 +635,7 @@ Graph = function(container, model, renderHint, stylesheet, themes)
 					
 					if (link != null)
 					{
-						if (this.isPageLink(link))
-						{
-							this.pageLinkClicked(cell, link);
-						}
-						else
-						{
-							this.openLink(link);
-						}
+						window.open(link);
 					}
 				}
 			}
@@ -653,28 +644,13 @@ Graph = function(container, model, renderHint, stylesheet, themes)
 				return click.apply(this, arguments);
 			}
 		};
-
-		// Redirects tooltips for locked cells
-		this.tooltipHandler.getStateForEvent = function(me)
-		{
-			return me.sourceState;
-		};
-		
-		// Redirects cursor for locked cells
-		var getCursorForMouseEvent = this.getCursorForMouseEvent; 
-		this.getCursorForMouseEvent = function(me)
-		{
-			var locked = me.state == null && me.sourceState != null && this.isCellLocked(me.sourceState.cell);
-			
-			return this.getCursorForCell((locked) ? me.sourceState.cell : me.getCell());
-		};
 		
 		// Shows pointer cursor for clickable cells with links
 		// ie. if the graph is disabled and cells cannot be selected
 		var getCursorForCell = this.getCursorForCell;
 		this.getCursorForCell = function(cell)
 		{
-			if (!this.isEnabled() || this.isCellLocked(cell))
+			if (!this.isEnabled())
 			{
 				var link = this.getLinkForCell(cell);
 				
@@ -682,13 +658,11 @@ Graph = function(container, model, renderHint, stylesheet, themes)
 				{
 					return 'pointer';
 				}
-				else if (this.isCellLocked(cell))
-				{
-					return 'default';
-				}
 			}
-
-			return getCursorForCell.apply(this, arguments);
+			else
+			{
+				return getCursorForCell.apply(this, arguments);
+			}
 		};
 		
 		// Changes rubberband selection to be recursive
@@ -878,7 +852,7 @@ Graph = function(container, model, renderHint, stylesheet, themes)
 		{
 			me = graphUpdateMouseEvent.apply(this, arguments);
 			
-			if (me.state != null && this.isCellLocked(me.getCell()))
+			if (this.isCellLocked(me.getCell()))
 			{
 				me.state = null;
 			}
@@ -1095,77 +1069,53 @@ Graph.prototype.init = function(container)
 };
 
 /**
- * Installs automatic layout via styles
+ * Adds support for page links.
  */
-Graph.prototype.labelLinkClicked = function(state, elt, evt)
+Graph.prototype.isPageLink = function(href)
 {
-	var href = elt.getAttribute('href');
-	
-	if (href != null && !this.isPageLink(href) && (mxEvent.isLeftMouseButton(evt) &&
-		!mxEvent.isPopupTrigger(evt)) || mxEvent.isTouchEvent(evt))
-	{
-		if (!this.isEnabled() || this.isCellLocked(state.cell))
-		{
-			var target = this.isBlankLink(href) ? this.linkTarget : '_top';
-			this.openLink(this.getAbsoluteUrl(href), target);
-		}
-		
-		mxEvent.consume(evt);
-	}
+	return false;
 };
 
 /**
- * Returns the size of the page format scaled with the page size.
+ * Installs automatic layout via styles
  */
-Graph.prototype.openLink = function(href, target)
+Graph.prototype.labelLinkClicked = function(state, elt, evt)
 {
-	var result = window;
+	var href = elt.getAttribute('href');
 	
-	// Workaround for blocking in same iframe
-	if (target == '_self' && window != window.top)
-	{
-		window.location.href = href;
-	}
-	else
+	if (href != null && !this.isPageLink(href))
 	{
-		// Avoids page reload for anchors (workaround for IE but used everywhere)
-		if (href.substring(0, this.baseUrl.length) == this.baseUrl &&
-			href.charAt(this.baseUrl.length) == '#' &&
-			target == '_top' && window == window.top)
+		if (!this.isEnabled())
 		{
-			var hash = href.split('#')[1];
-
-			// Forces navigation if on same hash
-			if (window.location.hash == '#' + hash)
+			var target = state.view.graph.isBlankLink(href) ?
+				state.view.graph.linkTarget : '_top';
+			href = state.view.graph.getAbsoluteUrl(href);
+	
+			// Workaround for blocking in same iframe
+			if (target == '_self' && window != window.top)
 			{
-				window.location.hash = '';
+				window.location.href = href;
+			}
+			else
+			{
+				// Avoids page reload for anchors (workaround for IE but used everywhere)
+				if (href.substring(0, this.baseUrl.length) == this.baseUrl &&
+					href.charAt(this.baseUrl.length) == '#' &&
+					target == '_top' && window == window.top)
+				{
+					window.location.hash = href.split('#')[1];
+				}
+				else if ((mxEvent.isLeftMouseButton(evt) &&
+					!mxEvent.isPopupTrigger(evt)) ||
+			    		mxEvent.isTouchEvent(evt))
+				{
+					window.open(href, target);
+				}
 			}
-			
-			window.location.hash = hash;
-		}
-		else
-		{
-			result = window.open(href, target);
 		}
+		
+		mxEvent.consume(evt);
 	}
-	
-	return result;
-};
-
-/**
- * Adds support for page links.
- */
-Graph.prototype.isPageLink = function(href)
-{
-	return false;
-};
-
-/**
- * Adds support for page links.
- */
-Graph.prototype.pageLinkClicked = function(cell, href)
-{
-	this.fireEvent(new mxEventObject('pageLinkClicked', 'cell', cell, 'href', href));
 };
 
 /**
@@ -1361,17 +1311,6 @@ Graph.prototype.isReplacePlaceholders = function(cell)
 		cell.value.getAttribute('placeholders') == '1';
 };
 
-/**
- * Returns true if the given mouse wheel event should be used for zooming. This
- * is invoked if no dialogs are showing and returns true if Alt or Control
- * (except macOS) is pressed or if the panning handler is active.
- */
-Graph.prototype.isZoomWheelEvent = function(evt)
-{
-	return mxEvent.isAltDown(evt) || (mxEvent.isControlDown(evt) && !mxClient.IS_MAC) ||
-		(this.panningHandler != null && this.panningHandler.isActive());
-};
-
 /**
  * Adds Alt+click to select cells behind cells.
  */
@@ -3583,7 +3522,7 @@ HoverIcons.prototype.setCurrentState = function(state)
 						var state2 = this.validEdges[e];
 						var pts2 = state2.absolutePoints;
 						
-						if (pts2 != null && mxUtils.intersects(state, state2) && state2.style['noJump'] != '1')
+						if (pts2 != null && mxUtils.intersects(state, state2))
 						{
 							// Compares each segment of the edge with the current segment
 							for (var j = 0; j < pts2.length - 1; j++)
@@ -5256,157 +5195,178 @@ if (typeof mxVertexHandler != 'undefined')
 			    scrollTop: 0,
 			    updateCurrentState: function(me)
 			    {
-			    		var tmp = me.sourceState;
+			    	var tmp = graph.view.getState(me.getCell());
 					
 			      	if (tmp != this.currentState)
 			      	{
-				        	if (this.currentState != null)
-				        	{
-				          	this.clear();
-				        	}
-				        
-			        		this.currentState = tmp;
-				        
-				        	if (this.currentState != null)
-				        	{
-				          	this.activate(this.currentState);
-				        	}
+			        	if (this.currentState != null)
+			        	{
+			          		this.clear();
+			        	}
+			        
+		        		this.currentState = tmp;
+			        
+			        	if (this.currentState != null)
+			        	{
+			          		this.activate(this.currentState);
+			        	}
 			      	}
 			    },
 			    mouseDown: function(sender, me)
 			    {
-				    	this.startX = me.getGraphX();
-				    	this.startY = me.getGraphY();
-					    this.scrollLeft = graph.container.scrollLeft;
-					    this.scrollTop = graph.container.scrollTop;
-					    
-			    		if (this.currentLink == null && graph.container.style.overflow == 'auto')
-			    		{
-			    			graph.container.style.cursor = 'move';
-			    		}
-			    		
-			    		this.updateCurrentState(me);
+			    	this.startX = me.getGraphX();
+			    	this.startY = me.getGraphY();
+				    this.scrollLeft = graph.container.scrollLeft;
+				    this.scrollTop = graph.container.scrollTop;
+				    
+		    		if (this.currentLink == null && graph.container.style.overflow == 'auto')
+		    		{
+		    			graph.container.style.cursor = 'move';
+		    		}
+		    		
+		    		this.updateCurrentState(me);
 			    },
 			    mouseMove: function(sender, me)
 			    {
-				    	if (graph.isMouseDown)
-				    	{
-				    		if (this.currentLink != null)
-				    		{
-						    	var dx = Math.abs(this.startX - me.getGraphX());
-						    	var dy = Math.abs(this.startY - me.getGraphY());
-						    	
-						    	if (dx > tol || dy > tol)
-						    	{
-						    		this.clear();
-						    	}
-				    		}
-				    	}
-				    	else
-				    	{
-					    	// Checks for parent link
-					    	var linkNode = me.getSource();
+			    	if (graph.isMouseDown)
+			    	{
+			    		if (this.currentLink != null)
+			    		{
+					    	var dx = Math.abs(this.startX - me.getGraphX());
+					    	var dy = Math.abs(this.startY - me.getGraphY());
 					    	
-					    	while (linkNode != null && linkNode.nodeName.toLowerCase() != 'a')
+					    	if (dx > tol || dy > tol)
 					    	{
-					    		linkNode = linkNode.parentNode;
+					    		this.clear();
 					    	}
-					    	
-				    		if (linkNode != null)
-				    		{
-				    			this.clear();
-				    		}
-				    		else
-				    		{
-						    	if (this.currentState != null && (me.getState() == this.currentState || me.sourceState == null) &&
-						    		graph.intersects(this.currentState, me.getGraphX(), me.getGraphY()))
-						    	{
-					    			return;
-						    	}
-						    	
-						    	this.updateCurrentState(me);
-				    		}
-				    	}
-			    },
-			    mouseUp: function(sender, me)
-			    {
-				    	var source = me.getSource();
-				    	var evt = me.getEvent();
-				    	
+			    		}
+			    	}
+			    	else
+			    	{
 				    	// Checks for parent link
-				    	var linkNode = source;
+				    	var linkNode = me.getSource();
 				    	
 				    	while (linkNode != null && linkNode.nodeName.toLowerCase() != 'a')
 				    	{
 				    		linkNode = linkNode.parentNode;
 				    	}
 				    	
-				    	// Ignores clicks on links and collapse/expand icon
-				    	if (linkNode == null &&
-				    		(((Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
-				        	Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
-				    		(me.sourceState == null || !me.isSource(me.sourceState.control))) &&
-				    		((mxEvent.isLeftMouseButton(evt) &&
-						!mxEvent.isPopupTrigger(evt)) ||
-				    		mxEvent.isTouchEvent(evt))))
-				    	{
-					    	if (this.currentLink != null)
+			    		if (linkNode != null)
+			    		{
+			    			this.clear();
+			    		}
+			    		else
+			    		{
+					    	if (this.currentState != null && (me.getState() == this.currentState || me.getState() == null) &&
+					    		graph.intersects(this.currentState, me.getGraphX(), me.getGraphY()))
 					    	{
-					    		var blank = graph.isBlankLink(this.currentLink);
+				    			return;
+					    	}
+					    	
+					    	this.updateCurrentState(me);
+			    		}
+			    	}
+			    },
+			    mouseUp: function(sender, me)
+			    {
+			    	
+			    	var source = me.getSource();
+			    	var evt = me.getEvent();
+			    	
+			    	// Checks for parent link
+			    	var linkNode = source;
+			    	
+			    	while (linkNode != null && linkNode.nodeName.toLowerCase() != 'a')
+			    	{
+			    		linkNode = linkNode.parentNode;
+			    	}
+			    	
+			    	// Ignores clicks on links and collapse/expand icon
+			    	if (linkNode == null &&
+			    		(((Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
+			        	Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
+			    		(me.getState() == null || !me.isSource(me.getState().control))) &&
+			    		((mxEvent.isLeftMouseButton(evt) &&
+					!mxEvent.isPopupTrigger(evt)) ||
+			    		mxEvent.isTouchEvent(evt))))
+			    	{
+				    	if (this.currentLink != null) 
+				    	{
+				    		var blank = graph.isBlankLink(this.currentLink);
+				    		
+				    		if ((this.currentLink.substring(0, 5) === 'data:' ||
+				    			!blank) && beforeClick != null)
+				    		{
+			    				beforeClick(evt, this.currentLink);
+				    		}
+				    		
+				    		if (!mxEvent.isConsumed(evt))
+				    		{
+					    		var target = (blank) ? graph.linkTarget : '_top';
 					    		
-					    		if ((this.currentLink.substring(0, 5) === 'data:' ||
-					    			!blank) && beforeClick != null)
-					    		{
-				    				beforeClick(evt, this.currentLink);
-					    		}
+					    		// Workaround for blocking in same iframe
+							if (target == '_self' && window != window.top)
+							{
+								window.location.href = this.currentLink;
+							}
+							else
+							{
+								// Avoids page reload for anchors (workaround for IE but used everywhere)
+								if (this.currentLink.substring(0, graph.baseUrl.length) == graph.baseUrl &&
+									this.currentLink.charAt(graph.baseUrl.length) == '#' &&
+									target == '_top' && window == window.top)
+								{
+									window.location.hash = this.currentLink.split('#')[1];
+								}
+								else
+								{
+									window.open(this.currentLink, target);
+								}
+							}
 					    		
-					    		if (!mxEvent.isConsumed(evt))
-					    		{
-						    		var target = (blank) ? graph.linkTarget : '_top';
-						    		graph.openLink(this.currentLink, target);
-						    		me.consume();
-					    		}
-					    	}
-					    	else if (onClick != null && !me.isConsumed() &&
-				    			(Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
-				        		Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
-				        		(Math.abs(this.startX - me.getGraphX()) < tol &&
-				        		Math.abs(this.startY - me.getGraphY()) < tol))
-				        	{
-					    		onClick(me.getEvent());
+					    		me.consume();
 				    		}
 				    	}
-				    	
-				    	this.clear();
+				    	else if (onClick != null && !me.isConsumed() &&
+			    			(Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
+			        		Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
+			        		(Math.abs(this.startX - me.getGraphX()) < tol &&
+			        		Math.abs(this.startY - me.getGraphY()) < tol))
+			        	{
+				    		onClick(me.getEvent());
+			    		}
+			    	}
+			    	
+			    	this.clear();
 			    },
 			    activate: function(state)
 			    {
-				    	this.currentLink = graph.getAbsoluteUrl(graph.getLinkForCell(state.cell));
-	
-				    	if (this.currentLink != null)
-				    	{
-				    		graph.container.style.cursor = 'pointer';
-	
-				    		if (this.highlight != null)
-				    		{
-				    			this.highlight.highlight(state);
-				    		}
+			    	this.currentLink = graph.getAbsoluteUrl(graph.getLinkForCell(state.cell));
+
+			    	if (this.currentLink != null)
+			    	{
+			    		graph.container.style.cursor = 'pointer';
+
+			    		if (this.highlight != null)
+			    		{
+			    			this.highlight.highlight(state);
+			    		}
 				    }
 			    },
 			    clear: function()
 			    {
-				    	if (graph.container != null)
-				    	{
-				    		graph.container.style.cursor = cursor;
-				    	}
-				    	
-				    	this.currentState = null;
-				    	this.currentLink = null;
-				    	
-				    	if (this.highlight != null)
-				    	{
-				    		this.highlight.hide();
-				    	}
+			    	if (graph.container != null)
+			    	{
+			    		graph.container.style.cursor = cursor;
+			    	}
+			    	
+			    	this.currentState = null;
+			    	this.currentLink = null;
+			    	
+			    	if (this.highlight != null)
+			    	{
+			    		this.highlight.hide();
+			    	}
 			    }
 			};
 
@@ -5442,7 +5402,7 @@ if (typeof mxVertexHandler != 'undefined')
 				for (var i = 0; i < cells.length; i++)
 				{
 					var parent = model.getParent(cells[i]);
-					var child = this.moveCells([clones[i]], s, s, false)[0];
+					var child = this.moveCells([clones[i]], s, s, false, parent)[0]; 
 					select.push(child);
 					
 					if (append)
@@ -5451,7 +5411,7 @@ if (typeof mxVertexHandler != 'undefined')
 					}
 					else
 					{
-						// Maintains child index by inserting after clone in parent
+						// Maintains child index by inserting after cloned in parent
 						var index = parent.getIndex(cells[i]);
 						model.add(parent, clones[i], index + 1);
 					}

File diff suppressed because it is too large
+ 37 - 37
src/main/webapp/js/reader.min.js


File diff suppressed because it is too large
+ 36 - 36
src/main/webapp/js/viewer.min.js


+ 26 - 21
src/main/webapp/plugins/voice.js

@@ -410,29 +410,34 @@ Draw.loadPlugin(function(ui) {
 	
 	function getBestWord(str1, words, useLevenshteinDist)
 	{
+		if (words == null || words.length == 0)
+		{
+			return str1;
+		}
+		
 		useLevenshteinDist = (useLevenshteinDist != null) ? useLevenshteinDist : true;
 		
 	    var bestWord = words[0];
 	    var minDist = ((useLevenshteinDist) ? levenshteinDist(str1, bestWord) :
-	    	naiveHammingDistance(str1, bestWord));
+	    		naiveHammingDistance(str1, bestWord));
 	    
 	    for (var i = 1; i < words.length; i++)
 	    {
-	    	var tmp = ((useLevenshteinDist) ? levenshteinDist(str1, words[i]) :
-	    		((str1 == words[i]) ? 0 : naiveHammingDistance(str1, words[i])));
-	    	
-	    	if (tmp < minDist || (tmp == minDist &&
-	    		str1.length > bestWord.length &&
-	    		bestWord.length < words[i].length))
-	    	{
-	    		bestWord = words[i];
-	    		minDist = tmp;
-	    	}
-	    	
-	    	if (bestWord == str1)
-	    	{
-	    		break;
-	    	}
+		    	var tmp = ((useLevenshteinDist) ? levenshteinDist(str1, words[i]) :
+		    		((str1 == words[i]) ? 0 : naiveHammingDistance(str1, words[i])));
+		    	
+		    	if (tmp < minDist || (tmp == minDist &&
+		    		str1.length > bestWord.length &&
+		    		bestWord.length < words[i].length))
+		    	{
+		    		bestWord = words[i];
+		    		minDist = tmp;
+		    	}
+		    	
+		    	if (bestWord == str1)
+		    	{
+		    		break;
+		    	}
 	    }
 	    
 	    return bestWord;
@@ -1734,7 +1739,7 @@ Draw.loadPlugin(function(ui) {
 		    	{
 		    		shapeList = [];
 		    		
-		    		for (var tmp in mxCellRenderer.prototype.defaultShapes)
+		    		for (var tmp in mxCellRenderer.defaultShapes)
 		    		{
 		    			shapeList.push(tmp.toLowerCase());
 		    		}
@@ -1776,11 +1781,11 @@ Draw.loadPlugin(function(ui) {
 			    		App.say('No cell for {1}', [shape]);
 			    	}
 			    	else if (vertices.length == 0)
-					{
+				{
 			    		App.say('Connections ignored');
-					}
+				}
 			    	else
-					{
+				{
 				    	// LATER: Add perimeter style etc
 			    		graph.setCellStyles(mxConstants.STYLE_SHAPE, shapenameToken, vertices);
 			    		ui.fireEvent(new mxEventObject('styleChanged', 'keys', [mxConstants.STYLE_SHAPE],
@@ -1788,7 +1793,7 @@ Draw.loadPlugin(function(ui) {
 			    		
 			    		// Terminate
 			    		return true;
-					}
+				}
 		    	}
 				
 				// Lazy creation of cache for action names