Gaudenz Alder před 5 roky
rodič
revize
172846aba3
34 změnil soubory, kde provedl 3514 přidání a 3343 odebrání
  1. 21 7
      ChangeLog
  2. 1 1
      VERSION
  3. 115 112
      etc/mxgraph/mxClient.js
  4. 0 10
      src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java
  5. 1 1
      src/main/webapp/cache.manifest
  6. 1682 1674
      src/main/webapp/js/app.min.js
  7. 0 1
      src/main/webapp/js/croppie/croppie.min.css
  8. 62 29
      src/main/webapp/js/diagramly/App.js
  9. 1 3
      src/main/webapp/js/diagramly/Devel.js
  10. 13 7
      src/main/webapp/js/diagramly/DriveClient.js
  11. 6 0
      src/main/webapp/js/diagramly/Editor.js
  12. 56 39
      src/main/webapp/js/diagramly/EditorUi.js
  13. 1 1
      src/main/webapp/js/diagramly/Init.js
  14. 13 10
      src/main/webapp/js/diagramly/Minimal.js
  15. 3 2
      src/main/webapp/js/diagramly/OneDriveClient.js
  16. 10 0
      src/main/webapp/js/diagramly/Pages.js
  17. 151 32
      src/main/webapp/js/diagramly/vsdx/importer.js
  18. 504 501
      src/main/webapp/js/extensions.min.js
  19. 20 23
      src/main/webapp/js/mxgraph/Editor.js
  20. 28 38
      src/main/webapp/js/mxgraph/EditorUi.js
  21. 40 80
      src/main/webapp/js/mxgraph/Graph.js
  22. 2 2
      src/main/webapp/js/stencils.min.js
  23. 567 560
      src/main/webapp/js/viewer.min.js
  24. 3 2
      src/main/webapp/plugins/number.js
  25. 2 0
      src/main/webapp/resources/dia_am.txt
  26. 2 0
      src/main/webapp/resources/dia_ar.txt
  27. 8 8
      src/main/webapp/resources/dia_ca.txt
  28. 22 22
      src/main/webapp/resources/dia_et.txt
  29. 2 2
      src/main/webapp/resources/dia_ru.txt
  30. 168 168
      src/main/webapp/resources/dia_zh.txt
  31. 4 4
      src/main/webapp/service-worker.js
  32. 0 2
      src/main/webapp/stencils/cisco/misc.xml
  33. 0 2
      src/main/webapp/stencils/electrical/transistors.xml
  34. 6 0
      src/main/webapp/styles/grapheditor.css

+ 21 - 7
ChangeLog

@@ -1,36 +1,50 @@
-16-JAN-2019: 12.5.5
+25-JAN-2020: 12.5.7
+
+- Fixes access to OneDrive Sharepoint folders
+- Creates fewer revisions in Google Drive
+- Uses mxGraph 4.1.1 beta 1
+- Uses PlantUML 2019.7
+
+22-JAN-2020: 12.5.6
+
+- Fixes offline download for mobile Safari
+- Fixes newlines in custom shape editor
+- Uses mxGraph 4.1.0 pre 6
+- Adds movableLabel style
+
+16-JAN-2020: 12.5.5
 
 - Fixes inconsistent label wrapping
 - Uses mxGraph 4.1.0 pre 5
 
-15-JAN-2019: 12.5.4
+15-JAN-2020: 12.5.4
 
 - Adds PWA install prompt handler
 
-14-JAN-2019: 12.5.3
+14-JAN-2020: 12.5.3
 
 - Fixes line height in labels
 - Uses mxGraph 4.1.0 pre 4
 
-14-JAN-2019: 12.5.2
+14-JAN-2020: 12.5.2
 
 - Adds option to include XML in PDF
 - Replaces app cache with PWA
 - Uses mxGraph 4.1.0 pre 3
 
-09-JAN-2019: 12.5.1
+09-JAN-2020: 12.5.1
 
 - Fixes label offsets in viewer
 - Uses mxGraph 4.1.0 pre 2
 
-07-JAN-2019: 12.5.0
+07-JAN-2020: 12.5.0
 
 - Enables reflow in HTML output
 - Fixes text rendering issues
 - Uses mxGraph 4.1.0 pre 1
 - Adds Galician language
 
-06-JAN-2019: 12.4.9
+06-JAN-2020: 12.4.9
 
 - Adds support for multiple redirect URLs in token-based-auth 
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-12.5.5
+12.5.7

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 115 - 112
etc/mxgraph/mxClient.js


+ 0 - 10
src/main/java/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java

@@ -712,7 +712,6 @@ public class GliffyDiagramConverter
 					cell.setValue(fragmentText);
 					gliffyObject.children.remove(0);
 				}
-				setFontSizeBasedOnGlobal(style);
 			}
 			else if (gliffyObject.isLine())
 			{
@@ -1033,15 +1032,6 @@ public class GliffyDiagramConverter
 		return cell;
 	}
 
-	private void setFontSizeBasedOnGlobal(StringBuilder style)
-	{
-		if (gliffyDiagram.stage.getTextStyles() != null && gliffyDiagram.stage.getTextStyles().getGlobal() != null
-				&& gliffyDiagram.stage.getTextStyles().getGlobal().getSize() != null)
-		{
-			style.append("fontSize=" + gliffyDiagram.stage.getTextStyles().getGlobal().getSize() + ";");
-		}
-	}
-
 	/**
 	 * Rotate objects inside Group
 	 * 

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

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 01/16/2020 02:13 PM
+# 01/25/2020 09:34 AM
 
 app.html
 index.html?offline=1

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1682 - 1674
src/main/webapp/js/app.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
src/main/webapp/js/croppie/croppie.min.css


+ 62 - 29
src/main/webapp/js/diagramly/App.js

@@ -1227,7 +1227,7 @@ App.prototype.init = function()
 		}));
 	}
 	
-	var createFooter = mxUtils.bind(this, function(label, link, className, closeHandler, helpLink, clickHandler)
+	var createFooter = mxUtils.bind(this, function(label, link, className, closeHandler, helpLink, clickHandler, noBlank)
 	{
 		var footer = document.createElement('div');
 		footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
@@ -1241,7 +1241,7 @@ App.prototype.init = function()
 		mxUtils.setPrefixedStyle(footer.style, 'transition', 'all 1s ease');
 		footer.style.whiteSpace = 'nowrap';
 		footer.innerHTML = '<a href="' + ((link != null) ? link : 'javascript:void(0)') +
-			'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
+			'" ' + ((!noBlank) ? 'target="_blank" ' : '') + 'style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
 			icn + label + icn + '</a>' + ((helpLink != null) ? '<a href="' + helpLink +
 			'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>' : '');
 		
@@ -1258,13 +1258,21 @@ App.prototype.init = function()
 
 		if (closeHandler)
 		{
-			mxEvent.addListener(img, 'click', closeHandler);
+			mxEvent.addListener(img, 'click', mxUtils.bind(this, function(e)
+			{
+				closeHandler(e);
+				mxEvent.consume(e);
+			}));
 		}
 		
 		if (clickHandler != null)
 		{
 			footer.style.paddingRight = '40px';
-			mxEvent.addListener(footer, 'click', clickHandler);
+			
+			mxEvent.addListener(footer, 'click', mxUtils.bind(this, function(e)
+			{
+				clickHandler(e);
+			}));
 		}
 		
 		return footer;
@@ -1537,15 +1545,34 @@ App.prototype.init = function()
 			this.editor.addListener('fileLoaded', mxUtils.bind(this, function()
 			{
 				var file = this.getCurrentFile();
+				var mode = (file != null) ? file.getMode() : null;
 				
-				if (file.mode == App.MODE_DEVICE && (!isLocalStorage || mxSettings.settings == null ||
+				if ((mode == App.MODE_DEVICE || mode == App.MODE_BROWSER) && (!isLocalStorage || mxSettings.settings == null ||
 					mxSettings.settings.closeDesktopFooter == null) && !this.footerShowing && urlParams['open'] == null)
 				{
-					var footer = createFooter('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' +
-						IMAGE_PATH + '/logo.png' + '"><font size="3" style="color:#ffffff;">' +
-						mxUtils.htmlEntities(mxResources.get('downloadDesktop')) + '</font>',
-						'https://get.draw.io/', 'geStatusMessage geBtn gePrimaryBtn',
-						mxUtils.bind(this, function()
+					mxUtils.get('https://api.github.com/repos/jgraph/drawio-desktop/releases/latest', mxUtils.bind(this, function(req)
+					{
+						var rel = JSON.parse(req.getText());
+						var href = 'https://get.draw.io/';
+						
+						if (rel != null)
+						{
+							if (rel.tag_name != null && rel.name != null && rel.html_url != null)
+							{
+								if (mxClient.IS_MAC)
+								{
+									href = 'https://github.com/jgraph/drawio-desktop/releases/download/' +
+				        				rel.tag_name + '/draw.io-' + rel.name + '.dmg';
+								}
+								else if (mxClient.IS_WIN)
+								{
+									href = 'https://github.com/jgraph/drawio-desktop/releases/download/' +
+				        				rel.tag_name + '/draw.io-' + rel.name + '-windows-installer.exe';
+								}
+							}
+						}
+						
+						var closeHandler = mxUtils.bind(this, function()
 						{
 							footer.parentNode.removeChild(footer);
 							this.footerShowing = false;
@@ -1557,25 +1584,31 @@ App.prototype.init = function()
 								mxSettings.settings.closeDesktopFooter = Date.now();
 								mxSettings.save();
 							}
-						}));
-			
-					// Push to after splash dialog background
-					footer.style.zIndex = mxPopupMenu.prototype.zIndex;
-					footer.style.padding = '18px 50px 12px 30px';
-					footer.getElementsByTagName('img')[1].style.filter = 'invert(1)';
-					document.body.appendChild(footer);
-					this.footerShowing = true;
-					
-					window.setTimeout(mxUtils.bind(this, function()
-					{
-						mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)');
-					}), 500);
-					
-					window.setTimeout(mxUtils.bind(this, function()
-					{
-						mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
-						this.footerShowing = false;
-					}), 60000);
+						});
+						
+						var footer = createFooter('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' +
+							IMAGE_PATH + '/logo.png' + '"><font size="3" style="color:#ffffff;">' +
+							mxUtils.htmlEntities(mxResources.get('downloadDesktop')) + '</font>',
+							href, 'geStatusMessage geBtn gePrimaryBtn', closeHandler, null, closeHandler);
+						
+						// Push to after splash dialog background
+						footer.style.zIndex = mxPopupMenu.prototype.zIndex;
+						footer.style.padding = '18px 50px 12px 30px';
+						footer.getElementsByTagName('img')[1].style.filter = 'invert(1)';
+						document.body.appendChild(footer);
+						this.footerShowing = true;
+						
+						window.setTimeout(mxUtils.bind(this, function()
+						{
+							mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)');
+						}), 500);
+						
+						window.setTimeout(mxUtils.bind(this, function()
+						{
+							mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
+							this.footerShowing = false;
+						}), 60000);
+					}));
 				}
 	//			else if ((!isLocalStorage || mxSettings.settings == null ||
 	//				mxSettings.settings.closeRateFooter == null) &&

+ 1 - 3
src/main/webapp/js/diagramly/Devel.js

@@ -13,6 +13,7 @@ mxscript(drawDevUrl + 'js/deflate/pako.min.js');
 mxscript(drawDevUrl + 'js/deflate/base64.js');
 mxscript(drawDevUrl + 'js/jscolor/jscolor.js');
 mxscript(drawDevUrl + 'js/sanitizer/sanitizer.min.js');
+mxscript(drawDevUrl + 'js/croppie/croppie.min.js');
 
 // Uses grapheditor from devhost
 mxscript(geBasePath +'/Editor.js');
@@ -143,9 +144,6 @@ mxscript(drawDevUrl + 'js/jszip/jszip.min.js');
 //GraphMl Import
 mxscript(drawDevUrl + 'js/diagramly/graphml/mxGraphMlCodec.js');
 
-//Croppie
-mxscript(drawDevUrl + 'js/croppie/croppie.min.js');
-
 //Table Layout
 if (urlParams['tableLayout'] == '1')
 {

+ 13 - 7
src/main/webapp/js/diagramly/DriveClient.js

@@ -1186,6 +1186,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 {
 	try
 	{
+		var retryCount = 0;
 		file.saveLevel = 1;
 		
 		var error = mxUtils.bind(this, function(e)
@@ -1246,6 +1247,8 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 					'\nUser=' + ((this.user != null) ? this.user.id : 'nouser') +
 					 	((file.sync != null) ? '-client_' + file.sync.clientId : '-nosync') +
 					'\nSaveLevel=' + file.saveLevel +
+					'\nSaveAsPng=' + (this.ui.useCanvasForExport && /(\.png)$/i.test(file.getTitle())) +
+					'\nRetryCount=' + retryCount +
 					'\nMessage=' + e.message +
 					'\n\nStack:\n' + e.stack);
 			}
@@ -1359,6 +1362,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 						try
 						{
 							file.saveDelay = new Date().getTime() - t0;
+							file.saveLevel = 16;
 							
 							if (resp == null)
 							{
@@ -1371,6 +1375,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 								
 								if (delta <= 0 || etag0 == resp.etag || (revision && head0 == resp.headRevisionId))
 								{
+									file.saveLevel = 17;
 									var reasons = [];
 									
 									if (delta <= 0)
@@ -1486,7 +1491,6 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 							var etag = (!overwrite && file.constructor == DriveFile &&
 								(DrawioFile.SYNC == 'manual' || DrawioFile.SYNC == 'auto')) ?
 								file.getCurrentEtag() : null;
-							var retryCount = 0;
 							
 							var doExecuteSave = mxUtils.bind(this, function(realOverwrite)
 							{
@@ -1522,7 +1526,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 										if (acceptResponse)
 										{
 											file.saveLevel = 6;
-												
+											
 											try
 											{
 												if (!file.isConflict(err))
@@ -1538,7 +1542,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 													mxUtils.bind(this, function(resp)
 													{
 														file.saveLevel = 7;
-	
+														
 														try
 														{
 															// Stale etag detected, retry with delay
@@ -1551,7 +1555,6 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 																	var delay = retryCount * 2 * this.coolOff * jitter;
 																	window.setTimeout(executeSave, delay);
 																	
-																	
 																	if (urlParams['test'] == '1')
 																	{
 																		EditorUi.debug('DriveClient: Stale Etag Detected',
@@ -1627,10 +1630,12 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 								
 								if (realOverwrite)
 								{
+									file.saveLevel = 14;
 									doExecuteSave(realOverwrite);
 								}
 								else
 								{
+									file.saveLevel = 15;
 									var acceptResponse = true;
 									
 									// Allow for re-auth flow with 3x timeout
@@ -1898,7 +1903,8 @@ DriveClient.prototype.createUploadRequest = function(id, metadata, data, revisio
 
 	var reqObj = 
 	{
-		'fullUrl': 'https://content.googleapis.com/upload/drive/v2/files' + (id != null ? '/' + id : '') + '?uploadType=multipart&supportsTeamDrives=true&fields=' + this.allFields,
+		'fullUrl': 'https://content.googleapis.com/upload/drive/v2/files' + (id != null ? '/' + id : '') +
+			'?uploadType=multipart&supportsTeamDrives=true&fields=' + this.allFields,
 		'method': (id != null) ? 'PUT' : 'POST',
 		'headers': headers,
 		'params': delim + 'Content-Type: application/json\r\n\r\n' + JSON.stringify(metadata) + delim +
@@ -1908,12 +1914,12 @@ DriveClient.prototype.createUploadRequest = function(id, metadata, data, revisio
 	
 	if (!revision)
 	{
-		reqObj.url += '&newRevision=false';
+		reqObj.fullUrl += '&newRevision=false';
 	}
 	
 	if (pinned)
 	{
-		reqObj.url += '&pinned=true';
+		reqObj.fullUrl += '&pinned=true';
 	}
 	
 	return reqObj;

+ 6 - 0
src/main/webapp/js/diagramly/Editor.js

@@ -226,6 +226,12 @@
         {name: 'editable', dispName: 'Editable', type: 'bool', defVal: true},
         {name: 'backgroundOutline', dispName: 'Background Outline', type: 'bool', defVal: false},
         {name: 'movable', dispName: 'Movable', type: 'bool', defVal: true},
+        {name: 'movableLabel', dispName: 'Movable Label', type: 'bool', defVal: false, isVisible: function(state, format)
+        {
+    		var geo = (state.vertices.length > 0) ? format.editorUi.editor.graph.getCellGeometry(state.vertices[0]) : null;
+    		
+    		return geo != null && !geo.relative;
+        }},
         {name: 'resizable', dispName: 'Resizable', type: 'bool', defVal: true},
         {name: 'resizeWidth', dispName: 'Resize Width', type: 'bool', defVal: false},
         {name: 'resizeHeight', dispName: 'Resize Height', type: 'bool', defVal: false},

+ 56 - 39
src/main/webapp/js/diagramly/EditorUi.js

@@ -4054,17 +4054,25 @@
 				win.close();
 			}
 		}
-//		else if (mxClient.IS_IOS)
-//		{
-//			this.showTextDialog(filename + ':', data);
-//		}
+		else if (mxClient.IS_IOS && mxClient.IS_SF && this.isOffline())
+		{
+			// Workaround for "WebKitBlobResource error 1" in mobile Safari
+			if (!navigator.standalone && mimeType != null && mimeType.substring(0, 6) == 'image/')
+			{
+				this.openInNewWindow(data, mimeType, base64Encoded);
+			}
+			else
+			{
+				this.showTextDialog(filename + ':', data);
+			}
+		}
 		else
 		{
 			var a = document.createElement('a');
 			
-			// Workaround for mxXmlRequest.simulate no longer working in Safari/PaleMoon
-			// if this is used (ie PNG export broken after XML export in Safari/PaleMoon).
-			var useDownload = !mxClient.IS_SF && navigator.userAgent.indexOf("PaleMoon/") < 0 &&
+			// Workaround for mxXmlRequest.simulate no longer working in PaleMoon
+			// if this is used (ie PNG export broken after XML export in PaleMoon).
+			var useDownload = navigator.userAgent.indexOf("PaleMoon/") < 0 &&
 				typeof a.download !== 'undefined';
 			
 			// Workaround for Chromium 65 cross-domain anchor download issue
@@ -7025,6 +7033,7 @@
 				try
 				{
 					var doc = mxUtils.parseXml(xml);
+					var mapping = {};
 					
 					// Checks for mxfile with multiple pages
 					var node = this.editor.extractGraphModel(doc.documentElement, this.pages != null);
@@ -7032,20 +7041,25 @@
 					if (node != null && node.nodeName == 'mxfile' && this.pages != null)
 					{
 						var diagrams = node.getElementsByTagName('diagram');
-	
+
 						if (diagrams.length == 1)
 						{
 							node = Editor.parseDiagramNode(diagrams[0]);
+							
+							if (this.currentPage != null)
+							{
+								mapping[diagrams[0].getAttribute('id')] = this.currentPage.getId();
+							}
 						}
 						else if (diagrams.length > 1)
 						{
-							var mapping = {};
 							var pages = [];
 							var i0 = 0;
 							
 							// Adds first page to current page if current page is only page and empty
 							if (this.pages != null && this.pages.length == 1 && this.isDiagramEmpty())
 							{
+								mapping[diagrams[0].getAttribute('id')] = this.pages[0].getId();
 								node = Editor.parseDiagramNode(diagrams[0]);
 								crop = false;
 								i0 = 1;
@@ -7079,6 +7093,11 @@
 					if (node != null && node.nodeName === 'mxGraphModel')
 					{
 						cells = graph.importGraphModel(node, dx, dy, crop);
+						
+						for (var i = 0; i < cells.length; i++)
+						{
+							this.updatePageLinksForCell(mapping, cells[i]);
+						}
 					}
 				}
 				finally
@@ -7121,7 +7140,7 @@
 		var temp = document.createElement('div');
 		var graph = this.editor.graph;
 		var href = graph.getLinkForCell(cell);
-		
+
 		if (href != null)
 		{
 			graph.setLinkForCell(cell, this.updatePageLink(mapping, href));
@@ -9788,25 +9807,25 @@
 								{
 									if (graph.isEditing())
 									{
-									    	this.importFiles([item.getAsFile()], 0, 0, this.maxImageSize, function(data, mimeType, x, y, w, h)
-									    	{
-									    		// Inserts image into current text box
-									    		graph.insertImage(data, w, h);
-									    	}, function()
-									    	{
-									    		// No post processing
-									    	}, function(file)
-									    	{
-									    		// Handles only images
-									    		return file.type.substring(0, 6) == 'image/';
-									    	}, function(queue)
-									    	{
-									    		// Invokes elements of queue in order
-									    		for (var i = 0; i < queue.length; i++)
-									    		{
-									    			queue[i]();
-									    		}
-									    	});
+								    	this.importFiles([item.getAsFile()], 0, 0, this.maxImageSize, function(data, mimeType, x, y, w, h)
+								    	{
+								    		// Inserts image into current text box
+								    		graph.insertImage(data, w, h);
+								    	}, function()
+								    	{
+								    		// No post processing
+								    	}, function(file)
+								    	{
+								    		// Handles only images
+								    		return file.type.substring(0, 6) == 'image/';
+								    	}, function(queue)
+								    	{
+								    		// Invokes elements of queue in order
+								    		for (var i = 0; i < queue.length; i++)
+								    		{
+								    			queue[i]();
+								    		}
+								    	});
 									}
 									else
 									{
@@ -10166,8 +10185,6 @@
 			
 			this.addListener('gridColorChanged', mxUtils.bind(this, function(sender, evt)
 			{
-				console.log('gridColorChanged', this.editor.graph.view.gridColor);
-				
 				mxSettings.setGridColor(this.editor.graph.view.gridColor, uiTheme == 'dark');
 				mxSettings.save();
 			}));
@@ -10412,15 +10429,15 @@
 							{
 								this.hoverIcons.update(graph.view.getState(graph.getSelectionCell()));
 							}
+						}
 							
-							try
-							{
-								mxEvent.consume(evt);
-							}
-							catch (e)
-							{
-								// ignore event no longer exists in async handler in IE8-
-							}
+						try
+						{
+							mxEvent.consume(evt);
+						}
+						catch (e)
+						{
+							// ignore event no longer exists in async handler in IE8-
 						}
 					}
 					else if (!useEvent)

+ 1 - 1
src/main/webapp/js/diagramly/Init.js

@@ -17,7 +17,7 @@ window.isSvgBrowser = window.isSvgBrowser || (navigator.userAgent.indexOf('MSIE'
 
 // CUSTOM_PARAMETERS - URLs for save and export
 window.EXPORT_URL = window.EXPORT_URL || 'https://exp.draw.io/ImageExport4/export';
-window.PLANT_URL = window.PLANT_URL || 'https://exp-plant.draw.io/plantuml4';
+window.PLANT_URL = window.PLANT_URL || 'https://exp-plant.draw.io/plantuml-1-2019-7';
 window.DRAW_MATH_URL = window.DRAW_MATH_URL || 'https://www.draw.io/math';
 window.VSD_CONVERT_URL = window.VSD_CONVERT_URL || 'https://convert.draw.io/VsdConverter/api/converter';
 window.EMF_CONVERT_URL = window.EMF_CONVERT_URL || 'https://convert.draw.io/emf2png/convertEMF';

+ 13 - 10
src/main/webapp/js/diagramly/Minimal.js

@@ -20,7 +20,7 @@ EditorUi.initMinimalTheme = function()
        style.innerHTML = '* { -webkit-font-smoothing: antialiased; }' +
        	   'html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }' +
        	   'html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }' +
-       	   'table.mxWindow * { font-size:13px; }' +
+       	   'table.mxWindow * :not(svg *) { font-size:13px; }' +
            'html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }' +
            'html body button.geBtn:active { opacity: 0.6; }' +
            'html body a.geMenuItem { opacity: 0.75; cursor: pointer; user-select:none; }' +
@@ -563,6 +563,8 @@ EditorUi.initMinimalTheme = function()
             menu.addSeparator();
             this.addSubmenu('layout', menu);
             this.addSubmenu('view', menu, null, mxResources.get('options'));
+            menu.addSeparator();
+            this.addSubmenu('insert', menu);
             this.addMenuItems(menu, ['-', 'exitGroup'], null, evt);
         }
         else if (graph.isEnabled())
@@ -770,6 +772,15 @@ EditorUi.initMinimalTheme = function()
 			}
 			
 			ui.menus.addSubmenu('exportAs', menu, parent);
+			    
+            if (mxClient.IS_CHROMEAPP || EditorUi.isElectronApp)
+            {
+            	ui.menus.addMenuItems(menu, ['import'], parent);
+            }
+            else
+            {
+            	ui.menus.addSubmenu('importFrom', menu, parent);
+            }
 
 			ui.menus.addMenuItems(menu, ['-', 'outline', 'layers'], parent);
 			
@@ -899,15 +910,7 @@ EditorUi.initMinimalTheme = function()
 			{
 				insertMenuFunct.apply(this, arguments);
 				menu.addSeparator(parent);
-	            
-	            if (mxClient.IS_CHROMEAPP || EditorUi.isElectronApp)
-	            {
-	            	ui.menus.addMenuItems(menu, ['import'], parent);
-	            }
-	            else
-	            {
-	            	ui.menus.addSubmenu('importFrom', menu, parent);
-	            }
+				ui.menus.addMenuItems(menu, ['-', 'toggleShapes'], parent);
 			};
         }))();
 		

+ 3 - 2
src/main/webapp/js/diagramly/OneDriveClient.js

@@ -11,7 +11,7 @@ OneDriveClient = function(editorUi)
 	if (authInfo != null)
 	{
 		this.token = authInfo.access_token;
-		this.endpointHint = authInfo.endpointHint;
+		this.endpointHint = authInfo.endpointHint.replace('/Documents', '/_layouts/15/onedrive.aspx');
 		this.tokenExpiresOn = authInfo.expiresOn;
 		
 		var remainingTime = (this.tokenExpiresOn - Date.now()) / 1000;
@@ -345,7 +345,8 @@ OneDriveClient.prototype.getAccountTypeAndEndpoint = function(success, error)
 				
 				if (resp.webUrl.indexOf('.sharepoint.com') > 0) 
 			 	{
-					this.endpointHint = resp.webUrl;
+					//TODO Confirm this works with all sharepoint sites
+					this.endpointHint = resp.webUrl.replace('/Documents', '/_layouts/15/onedrive.aspx');
 				}
 				else
 				{

+ 10 - 0
src/main/webapp/js/diagramly/Pages.js

@@ -1649,6 +1649,16 @@ EditorUi.prototype.createPageMenu = function(page, label)
 		{
 			this.duplicatePage(page, mxResources.get('copyOf', [page.getName()]));
 		}), parent);
+		
+		if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && this.getServiceName() == 'draw.io')
+		{		
+			menu.addSeparator(parent);
+			
+			menu.addItem(mxResources.get('openInNewWindow'), null, mxUtils.bind(this, function()
+			{
+				this.editor.editAsNew(this.getFileData(true, null, null, null, true, true));
+			}), parent);
+		}
 	});
 };
 

+ 151 - 32
src/main/webapp/js/diagramly/vsdx/importer.js

@@ -1305,8 +1305,6 @@ var com;
                                     var master = array129[index128];
                                     {
                                         var shapeGraph = this_1.createMxGraph();
-                                        var shapeElem = master.getMasterShape().getShape();
-                                        var shape = new com.mxgraph.io.vsdx.VsdxShape(page, shapeElem, !page.isEdge(shapeElem), masterShapes, null, this_1.vsdxModel);
                                         
                                         var scale = 1;
                                         
@@ -1329,34 +1327,46 @@ var com;
                                         	 
                                         	 scale = pScaleV / dScaleV;
                                     	}
+
+                                        var hasCells = false;
                                         
-                                        var cell = null;
-                                        if (shape.isVertex()) {
-                                            /* clear */ this_1.edgeShapeMap.entries = [];
-                                            /* clear */ this_1.parentsMap.entries = [];
-                                            cell = this_1.addShape(shapeGraph, shape, shapeGraph.getDefaultParent(), 0, 1169);
-                                            {
-                                                var array131 = (function (m) { if (m.entries == null)
-                                                    m.entries = []; return m.entries; })(this_1.edgeShapeMap);
-                                                for (var index130 = 0; index130 < array131.length; index130++) {
-                                                    var edgeEntry = array131[index130];
-                                                    {
-                                                        var parent_1 = (function (m, k) { if (m.entries == null)
-                                                            m.entries = []; for (var i = 0; i < m.entries.length; i++)
-                                                            if (m.entries[i].key.equals != null && m.entries[i].key.equals(k) || m.entries[i].key === k) {
-                                                                return m.entries[i].value;
-                                                            } return null; })(this_1.parentsMap, edgeEntry.getKey());
-                                                        this_1.addUnconnectedEdge(shapeGraph, parent_1, edgeEntry.getValue(), 1169);
-                                                    }
-                                                }
-                                            }
-                                        }
-                                        else {
-                                            cell = this_1.addUnconnectedEdge(shapeGraph, null, shape, 1169);
+                                        for (var chI = 0; master.firstLevelShapes != null && chI < master.firstLevelShapes.length; chI++)
+                                        {
+	                                        var shapeElem = master.firstLevelShapes[chI].getShape();
+	                                        var shape = new com.mxgraph.io.vsdx.VsdxShape(page, shapeElem, !page.isEdge(shapeElem), masterShapes, null, this_1.vsdxModel);
+	
+	                                        var cell = null;
+	                                        if (shape.isVertex()) {
+	                                            /* clear */ this_1.edgeShapeMap.entries = [];
+	                                            /* clear */ this_1.parentsMap.entries = [];
+	                                            cell = this_1.addShape(shapeGraph, shape, shapeGraph.getDefaultParent(), 0, 1169);
+	                                            {
+	                                                var array131 = (function (m) { if (m.entries == null)
+	                                                    m.entries = []; return m.entries; })(this_1.edgeShapeMap);
+	                                                for (var index130 = 0; index130 < array131.length; index130++) {
+	                                                    var edgeEntry = array131[index130];
+	                                                    {
+	                                                        var parent_1 = (function (m, k) { if (m.entries == null)
+	                                                            m.entries = []; for (var i = 0; i < m.entries.length; i++)
+	                                                            if (m.entries[i].key.equals != null && m.entries[i].key.equals(k) || m.entries[i].key === k) {
+	                                                                return m.entries[i].value;
+	                                                            } return null; })(this_1.parentsMap, edgeEntry.getKey());
+	                                                        this_1.addUnconnectedEdge(shapeGraph, parent_1, edgeEntry.getValue(), 1169);
+	                                                    }
+	                                                }
+	                                            }
+	                                        }
+	                                        else {
+	                                            cell = this_1.addUnconnectedEdge(shapeGraph, null, shape, 1169);
+	                                        }
+	                                        
+	                                        hasCells |= (cell != null);
                                         }
-                                        if (cell != null) {
+                                        
+                                        if (hasCells) 
+                                        {
                                         	this_1.scaleGraph(shapeGraph, scale);
-                                            var geo_1 = this_1.normalizeGeo(cell);
+                                        	var size = this_1.normalizeGraph(shapeGraph);
                                             this_1.sanitiseGraph(shapeGraph);
                                             if (shapeGraph.getModel().getChildCount(shapeGraph.getDefaultParent()) === 0)
                                                 return "continue";
@@ -1365,9 +1375,9 @@ var com;
                                             var shapeXML_1 = _super.prototype.processPage.call(this_1, shapeGraph, null);
                                             /* append */ (function (sb) { return sb.str = sb.str.concat(shapeXML_1); })(shapes_1);
                                             /* append */ (function (sb) { return sb.str = sb.str.concat("\",\"w\":"); })(shapes_1);
-                                            /* append */ (function (sb) { return sb.str = sb.str.concat(geo_1.width); })(shapes_1);
+                                            /* append */ (function (sb) { return sb.str = sb.str.concat(size.width); })(shapes_1);
                                             /* append */ (function (sb) { return sb.str = sb.str.concat(",\"h\":"); })(shapes_1);
-                                            /* append */ (function (sb) { return sb.str = sb.str.concat(geo_1.height); })(shapes_1);
+                                            /* append */ (function (sb) { return sb.str = sb.str.concat(size.height); })(shapes_1);
                                             /* append */ (function (sb) { return sb.str = sb.str.concat(",\"title\":"); })(shapes_1);
                                             var shapeName_1 = master.getName();
                                             if (shapeName_1 == null)
@@ -1430,6 +1440,86 @@ var com;
                     }
                     return geo;
                 };
+                
+                mxVssxCodec.prototype.normalizeGraph = function (graph) 
+                {
+                	//Find minX/Y, maxX/Y
+                	var minX, minY, maxX, maxY;
+
+                	function getDimMinMax(pt)
+                	{
+                		if (pt != null)
+                		{
+                			if (minX == null)
+	            			{
+	                			minX = pt.x; minY = pt.y; maxX = pt.x + (pt.width || 0); maxY = pt.y + (pt.height || 0);
+	            			}
+	                		else
+                			{
+	                			minX = Math.min(pt.x, minX);
+	                			minY = Math.min(pt.y, minY);
+	                			maxX = Math.max(pt.x + (pt.width || 0), maxX);
+	                			maxY = Math.max(pt.y + (pt.height || 0), maxY);
+                			}
+                		}
+                	};
+                	
+                	for (var id in graph.model.cells)
+            		{
+                		var cell = graph.model.cells[id];
+                		var geo = cell.geometry;
+                		
+                		if (geo != null && cell.parent.id == 1)
+                		{
+                			if (cell.vertex)
+                			{
+                				getDimMinMax(geo);
+                			}
+                			else
+            				{
+                				getDimMinMax(geo.sourcePoint);
+							    getDimMinMax(geo.targetPoint);
+							    var points = geo.points;
+							    
+							    for (var i = 0; points != null && i < points.length; i++) 
+								{
+							        getDimMinMax(points[i]);   
+							    }
+            				}
+                		}
+            		}
+                	
+                	//Remove minX, minY from all geo and fix edges also
+                	var srcP = {x: minX, y: minY};
+                	
+                	for (var id in graph.model.cells)
+            		{
+                		var cell = graph.model.cells[id];
+                		var geo = cell.geometry;
+                		
+                		if (geo != null && cell.parent.id == 1)
+                		{
+	                		geo.x -= minX;
+	                		geo.y -= minY;
+                	
+	                		if (cell.isEdge())
+	            			{
+		                        this.transPoint(geo.sourcePoint, srcP);
+	                			this.transPoint(geo.targetPoint, srcP);
+		                        this.transPoint(geo.offset, srcP);
+		                        var points = geo.points;
+		                        
+	                            for (var i = 0; points != null && i < points.length; i++) 
+	                            {
+	                                this.transPoint(points[i], srcP);
+	                            }
+	            			}
+                		}
+            		}
+
+                	return {width: maxX - minX, height: maxY - minY}
+                };
+                
                 mxVssxCodec.prototype.transPoint = function (p, srcP) {
                     if (p != null) {
                         p.x = (p.x - srcP.x);
@@ -2700,7 +2790,13 @@ var com;
                      * @param {*} shapeElem
                      * @param {com.mxgraph.io.vsdx.mxVsdxModel} model
                      */
-                    mxVsdxMaster.prototype.processMasterShape = function (shapeElem, model) {
+                    mxVsdxMaster.prototype.processMasterShape = function (shapeElem, model, internal) 
+                    {
+                    	if (!internal) 
+                		{
+                    		this.firstLevelShapes = [];
+                		}
+                    	
                         var shapeChild = shapeElem.firstChild;
                         while ((shapeChild != null)) {
                             if ((shapeChild != null && (shapeChild.nodeType == 1)) && (function (o1, o2) { if (o1 && o1.equals) {
@@ -2722,13 +2818,36 @@ var com;
                                         var masterShape = new com.mxgraph.io.vsdx.Shape(shape, model);
                                         this.masterShape = (this.masterShape == null) ? masterShape : this.masterShape;
                                         /* put */ (this.childShapes[shapeId] = masterShape);
-                                        this.processMasterShape(shape, model);
+                                        
+                                        if (!internal) 
+                                		{
+                                    		this.firstLevelShapes.push(masterShape);
+                                		}
+                                        
+                                        this.processMasterShape(shape, model, true);
                                     }
                                     shapesChild = shapesChild.nextSibling;
                                 }
                                 ;
-                                break;
                             }
+                            else if (shapeChild != null && shapeChild.nodeType == 1 && shapeChild.nodeName == "Connects") 
+                            {
+                            	this.connects = {};
+                                var connectsChild = shapeChild.firstChild;
+                                
+                                while (connectsChild != null) 
+                                {
+                                    if (connectsChild != null && connectsChild.nodeType == 1 && connectsChild.nodeName == "Connect") 
+                                    {
+                                        var connectElem = connectsChild;
+                                        var connect = new com.mxgraph.io.vsdx.mxVsdxConnect(connectElem);
+                                        this.connects[connect.getFromSheet()] = connect;
+                                    }
+                                    
+                                    connectsChild = connectsChild.nextSibling;
+                                }
+                            }
+                            
                             shapeChild = shapeChild.nextSibling;
                         }
                         ;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 504 - 501
src/main/webapp/js/extensions.min.js


+ 20 - 23
src/main/webapp/js/mxgraph/Editor.js

@@ -342,33 +342,30 @@ Editor.prototype.editAsNew = function(xml, title)
 		p += ((p.length > 0) ? '&' : '?') + 'ui=' + urlParams['ui'];
 	}
 	
-	if (this.editorWindow != null && !this.editorWindow.closed)
+	if (typeof window.postMessage !== 'undefined' &&
+		(document.documentMode == null ||
+		document.documentMode >= 10))
 	{
-		this.editorWindow.focus();
-	}
-	else
-	{
-		if (typeof window.postMessage !== 'undefined' && (document.documentMode == null || document.documentMode >= 10))
+		var wnd = null;
+		
+		var l = mxUtils.bind(this, function(evt)
 		{
-			if (this.editorWindow == null)
+			if (evt.data == 'ready' && evt.source == wnd)
 			{
-				mxEvent.addListener(window, 'message', mxUtils.bind(this, function(evt)
-				{
-					if (evt.data == 'ready' && evt.source == this.editorWindow)
-					{
-						this.editorWindow.postMessage(xml, '*');
-					}
-				}));
+				mxEvent.removeListener(window, 'message', l);
+				wnd.postMessage(xml, '*');
 			}
-
-			this.editorWindow = this.graph.openLink(this.getEditBlankUrl(p +
-				((p.length > 0) ? '&' : '?') + 'client=1'), null, true);
-		}
-		else
-		{
-			this.editorWindow = this.graph.openLink(this.getEditBlankUrl(p) +
-				'#R' + encodeURIComponent(xml));
-		}
+		});
+			
+		mxEvent.addListener(window, 'message', l);
+		wnd = this.graph.openLink(this.getEditBlankUrl(
+			p + ((p.length > 0) ? '&' : '?') +
+			'client=1'), null, true);
+	}
+	else
+	{
+		this.graph.openLink(this.getEditBlankUrl(p) +
+			'#R' + encodeURIComponent(xml));
 	}
 };
 

+ 28 - 38
src/main/webapp/js/mxgraph/EditorUi.js

@@ -544,33 +544,23 @@ EditorUi = function(editor, container, lightbox)
 			model.beginUpdate();
 			try
 			{
-				// Applies only basic text styles
-				if (asText)
+				for (var i = 0; i < cells.length; i++)
 				{
-					var edge = model.isEdge(cell);
-					var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
-					var textStyles = ['fontSize', 'fontFamily', 'fontColor'];
-					
-					for (var j = 0; j < textStyles.length; j++)
+					var cell = cells[i];
+
+					var appliedStyles;
+
+					if (asText)
 					{
-						var value = current[textStyles[j]];
-						
-						if (value != null)
-						{
-							graph.setCellStyles(textStyles[j], value, cells);
-						}
+						// Applies only basic text styles
+						appliedStyles = ['fontSize', 'fontFamily', 'fontColor'];
 					}
-				}
-				else
-				{
-					for (var i = 0; i < cells.length; i++)
+					else
 					{
-						var cell = cells[i];
-	
 						// Removes styles defined in the cell style from the styles to be applied
 						var cellStyle = model.getStyle(cell);
 						var tokens = (cellStyle != null) ? cellStyle.split(';') : [];
-						var appliedStyles = styles.slice();
+						appliedStyles = styles.slice();
 						
 						for (var j = 0; j < tokens.length; j++)
 						{
@@ -607,29 +597,29 @@ EditorUi = function(editor, container, lightbox)
 					 			}
 					 		}
 						}
-		
-						// Applies the current style to the cell
-						var edge = model.isEdge(cell);
-						var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
-						var newStyle = model.getStyle(cell);
-						
-						for (var j = 0; j < appliedStyles.length; j++)
+					}
+					
+					// Applies the current style to the cell
+					var edge = model.isEdge(cell);
+					var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
+					var newStyle = model.getStyle(cell);
+					
+					for (var j = 0; j < appliedStyles.length; j++)
+					{
+						var key = appliedStyles[j];
+						var styleValue = current[key];
+	
+						if (styleValue != null && (key != 'shape' || edge))
 						{
-							var key = appliedStyles[j];
-							var styleValue = current[key];
-		
-							if (styleValue != null && (key != 'shape' || edge))
+							// Special case: Connect styles are not applied here but in the connection handler
+							if (!edge || mxUtils.indexOf(connectStyles, key) < 0)
 							{
-								// Special case: Connect styles are not applied here but in the connection handler
-								if (!edge || mxUtils.indexOf(connectStyles, key) < 0)
-								{
-									newStyle = mxUtils.setStyle(newStyle, key, styleValue);
-								}
+								newStyle = mxUtils.setStyle(newStyle, key, styleValue);
 							}
 						}
-						
-						model.setStyle(cell, newStyle);
 					}
+					
+					model.setStyle(cell, newStyle);
 				}
 			}
 			finally

+ 40 - 80
src/main/webapp/js/mxgraph/Graph.js

@@ -2360,22 +2360,20 @@ Graph.prototype.selectCellsForConnectVertex = function(cells, evt, hoverIcons)
 	if (cells.length == 2 && this.model.isVertex(cells[1]))
 	{
 		this.setSelectionCell(cells[1]);
+		this.scrollCellToVisible(cells[1]);
 		
 		if (hoverIcons != null)
 		{
-			// Adds hover icons to new target vertex for touch devices
+			// Adds hover icons for cloned vertex or hides icons
 			if (mxEvent.isTouchEvent(evt))
 			{
 				hoverIcons.update(hoverIcons.getState(this.view.getState(cells[1])));
 			}
 			else
 			{
-				// Hides hover icons after click with mouse
 				hoverIcons.reset();
 			}
 		}
-		
-		this.scrollCellToVisible(cells[1]);
 	}
 	else
 	{
@@ -2972,6 +2970,18 @@ Graph.prototype.isCellConnectable = function(cell)
 		mxGraph.prototype.isCellConnectable.apply(this, arguments);
 };
 
+/**
+ * Adds labelMovable style.
+ */
+Graph.prototype.isLabelMovable = function(cell)
+{
+	var state = this.view.getState(cell);
+	var style = (state != null) ? state.style : this.getCellStyle(cell);
+	
+	return (style != null && style['movableLabel'] != null) ? style['movableLabel'] != '0' :
+		mxGraph.prototype.isLabelMovable.apply(this, arguments);
+};
+
 /**
  * Function: selectAll
  * 
@@ -3761,31 +3771,8 @@ HoverIcons.prototype.click = function(state, dir, me)
 	}
 	else if (state != null)
 	{
-		var cells = this.graph.connectVertex(state.cell, dir, this.graph.defaultEdgeLength, evt);
-		this.graph.selectCellsForConnectVertex(cells, evt, this);
-		
-		// Selects only target vertex if one exists
-		if (cells.length == 2 && this.graph.model.isVertex(cells[1]))
-		{
-			this.graph.setSelectionCell(cells[1]);
-			
-			// Adds hover icons to new target vertex for touch devices
-			if (mxEvent.isTouchEvent(evt))
-			{
-				this.update(this.getState(this.graph.view.getState(cells[1])));
-			}
-			else
-			{
-				// Hides hover icons after click with mouse
-				this.reset();
-			}
-			
-			this.graph.scrollCellToVisible(cells[1]);
-		}
-		else
-		{
-			this.graph.setSelectionCells(cells);
-		}
+		this.graph.selectCellsForConnectVertex(this.graph.connectVertex(
+			state.cell, dir, this.graph.defaultEdgeLength, evt), evt, this);
 	}
 	
 	me.consume();
@@ -5018,17 +5005,6 @@ if (typeof mxVertexHandler != 'undefined')
 			return marker;
 		};
 
-		/**
-		 * Function: isCellLocked
-		 * 
-		 * Returns true if the given cell does not allow new connections to be created.
-		 * This implementation returns false.
-		 */
-		mxConnectionHandler.prototype.isCellEnabled = function(cell)
-		{
-			return !this.graph.isCellLocked(cell);
-		};
-
 		/**
 		 * 
 		 */
@@ -5861,28 +5837,25 @@ if (typeof mxVertexHandler != 'undefined')
 				{
 					var state = this.view.getState(parents[i]);
 					
-					if (state != null && (this.model.isEdge(state.cell) || this.model.isVertex(state.cell)) && this.isCellDeletable(state.cell))
+					if (state != null && (this.model.isEdge(state.cell) ||
+						this.model.isVertex(state.cell)) &&
+						this.isCellDeletable(state.cell) &&
+						this.isTransparentState(state))
 					{
-						var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
-						var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
+						var allChildren = true;
 						
-						if (stroke == mxConstants.NONE && fill == mxConstants.NONE)
+						for (var j = 0; j < this.model.getChildCount(state.cell) && allChildren; j++)
 						{
-							var allChildren = true;
-							
-							for (var j = 0; j < this.model.getChildCount(state.cell) && allChildren; j++)
-							{
-								if (!dict.get(this.model.getChildAt(state.cell, j)))
-								{
-									allChildren = false;
-								}
-							}
-							
-							if (allChildren)
+							if (!dict.get(this.model.getChildAt(state.cell, j)))
 							{
-								cells.push(state.cell);
+								allChildren = false;
 							}
 						}
+						
+						if (allChildren)
+						{
+							cells.push(state.cell);
+						}
 					}
 				}
 			}
@@ -5899,20 +5872,10 @@ if (typeof mxVertexHandler != 'undefined')
 			
 			for (var i = 0; i < cells.length; i++)
 			{
-				if (this.isCellDeletable(cells[i]))
+				if (this.isCellDeletable(cells[i]) && this.isTransparentState(
+					this.view.getState(cells[i])))
 				{
-					var state = this.view.getState(cells[i]);
-					
-					if (state != null)
-					{
-						var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
-						var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
-						
-						if (stroke == mxConstants.NONE && fill == mxConstants.NONE)
-						{
-							cellsToRemove.push(cells[i]);
-						}
-					}
+					cellsToRemove.push(cells[i]);
 				}
 			}
 			
@@ -5920,7 +5883,7 @@ if (typeof mxVertexHandler != 'undefined')
 			
 			mxGraph.prototype.removeCellsAfterUngroup.apply(this, arguments);
 		};
-		
+
 		/**
 		 * Sets the link for the given cell.
 		 */
@@ -6706,7 +6669,8 @@ if (typeof mxVertexHandler != 'undefined')
 				showText = (showText != null) ? showText : true;
 	
 				var bounds = (ignoreSelection || nocrop) ?
-						this.getGraphBounds() : this.getBoundingBox(this.getSelectionCells());
+					this.getGraphBounds() : this.getBoundingBox(
+					this.getSelectionCells());
 	
 				if (bounds == null)
 				{
@@ -6891,7 +6855,7 @@ if (typeof mxVertexHandler != 'undefined')
 	
 				imgExport.drawState(this.getView().getState(this.model.root), svgCanvas);
 				this.updateSvgLinks(root, linkTarget, true);
-			
+				
 				return root;
 			}
 			finally
@@ -7928,15 +7892,11 @@ if (typeof mxVertexHandler != 'undefined')
 			{
 				mxCellEditorApplyValue.apply(this, arguments);
 				
-				if (this.graph.isCellDeletable(state.cell) && this.graph.model.getChildCount(state.cell) == 0)
+				if (value == '' && this.graph.isCellDeletable(state.cell) &&
+					this.graph.model.getChildCount(state.cell) == 0 &&
+					this.graph.isTransparentState(state))
 				{
-					var stroke = mxUtils.getValue(state.style, mxConstants.STYLE_STROKECOLOR, mxConstants.NONE);
-					var fill = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, mxConstants.NONE);
-					
-					if (value == '' && stroke == mxConstants.NONE && fill == mxConstants.NONE)
-					{
-						this.graph.removeCells([state.cell], false);
-					}
+					this.graph.removeCells([state.cell], false);
 				}
 			}
 			finally

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 2
src/main/webapp/js/stencils.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 567 - 560
src/main/webapp/js/viewer.min.js


+ 3 - 2
src/main/webapp/plugins/number.js

@@ -28,6 +28,8 @@ Draw.loadPlugin(function(ui) {
 			this.numberCounter++;
 			this.redrawNumberShape(state);
 		}
+		
+		return state;
 	};
 	
 	graph.view.redrawNumberShape = function(state)
@@ -64,8 +66,7 @@ Draw.loadPlugin(function(ui) {
 				state.secondLabel.scale = scale;
 				state.secondLabel.bounds = bounds;
 				state.secondLabel.redraw();
-				console.log('redraw', state, this.numberCounter, value);
-			}	
+			}
 		}
 	};
 

+ 2 - 0
src/main/webapp/resources/dia_am.txt

@@ -400,6 +400,7 @@ insertRowBefore=Insert Row Above
 insertRowAfter=Insert Row After
 insertText=Insert Text
 inserting=Inserting
+installDrawio=Install draw.io
 invalidFilename=Diagram names must not contain the following characters: \ / | : ; { } < > & + ? = "
 invalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin">page</a>.
 invalidInput=Invalid input
@@ -634,6 +635,7 @@ saveDiagramFirst=Please save the diagram first
 saveDiagramsTo=Save diagrams to
 saveLibrary403=Insufficient permissions to edit this library
 saveLibrary500=There was an error while saving the library
+saveLibraryReadOnly=Could not save library while read-only mode is active
 saving=Saving
 scratchpad=Scratchpad
 scrollbars=Scrollbars

+ 2 - 0
src/main/webapp/resources/dia_ar.txt

@@ -400,6 +400,7 @@ insertRowBefore=‫إضافة سطر قبل‬
 insertRowAfter=‫إضافة سطر بعد‬
 insertText=‫إضافة نص‬
 inserting=‫إضافة‬
+installDrawio=Install draw.io
 invalidFilename=Diagram names must not contain the following characters: \ / | : ; { } < > & + ? = "
 invalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin">page</a>.
 invalidInput=Invalid input
@@ -634,6 +635,7 @@ saveDiagramFirst=Please save the diagram first
 saveDiagramsTo=‫حفظ المخططات إلى ‬
 saveLibrary403=Insufficient permissions to edit this library
 saveLibrary500=There was an error while saving the library
+saveLibraryReadOnly=Could not save library while read-only mode is active
 saving=‫جاري الحفظ‬
 scratchpad=Scratchpad
 scrollbars=‫أشرطة التمرير‬

+ 8 - 8
src/main/webapp/resources/dia_ca.txt

@@ -1,6 +1,6 @@
 # *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*
 # https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE
-aboutDrawio=Sobre draw.io
+aboutDrawio=Quant al draw.io
 accessDenied=Accés denegat
 action=Acció
 actualSize=Mida real
@@ -220,7 +220,7 @@ editText=Edita el text
 editTooltip=Edita els consells d'eines
 glass=Vidre
 googleImages=Google Imatges
-imageSearch=Buscador d'imatges
+imageSearch=Cerca d'imatges
 eip=EIP
 embed=Incrusta
 embedImages=Incrusta imatges
@@ -263,7 +263,7 @@ extras=Extres
 facebook=Facebook
 failedToSaveTryReconnect=Error en desar, intentant reconnectar
 featureRequest=Sol·licitud de funcions
-feedback=Opinió
+feedback=Comentaris
 feedbackSent=S'ha enviat la seva opinió correctament.
 floorplans=Plànols
 file=Fitxer
@@ -496,7 +496,7 @@ noPreview=No hi ha vista prèvia
 noResponse=El servidor no respon
 noResultsFor=No s'ha trobat cap resultat per {1}
 noRevisions=Sense revisions
-noSearchResults=La cerca no té resultats
+noSearchResults=La s'ha trobat cap resultat
 noPageContentOrNotSaved=No s'han trobat enllaços a la pàgina o encara no s'ha desat
 normal=Normal
 north=Nord
@@ -575,7 +575,7 @@ project=Projecta
 priority=Prioritat
 properties=Propietats
 publish=Publica
-quickStart=Inici ràpid vídeo
+quickStart=Vídeo d'inici ràpid
 rack=Rack
 radialTree=Arbre radial
 readOnly=Només lectura
@@ -636,11 +636,11 @@ saveDiagramsTo=Desa els diagrames a
 saveLibrary403=Permisos insuficients per editar aquesta biblioteca
 saveLibrary500=Hi ha hagut un error desant la biblioteca
 saveLibraryReadOnly=Could not save library while read-only mode is active
-saving=Desant
+saving=S'està desant
 scratchpad=Scratchpad
 scrollbars=Barres de desplaçament
-search=Cercar
-searchShapes=Cercar formes
+search=Cerca
+searchShapes=Cerca formes
 selectAll=Selecciona-ho tot
 selectionOnly=Selecciona només
 selectCard=Selecciona una targeta

+ 22 - 22
src/main/webapp/resources/dia_et.txt

@@ -5,7 +5,7 @@ accessDenied=Ligipääs keelatud
 action=Tegevus
 actualSize=Tegelik suurus
 add=Lisa
-addAccount=Add account
+addAccount=Lisa konto
 addedFile=Lisatud {1}
 addImages=Lisa pilte
 addImageUrl=Lisa pildi URL
@@ -53,7 +53,7 @@ attachments=Manused
 aws=AWS
 aws3d=AWS 3D
 azure=Azure
-back=Back
+back=Tagasi
 background=Taust
 backgroundColor=Taustavärv
 backgroundImage=Taustapilt
@@ -86,9 +86,9 @@ cannotOpenFile=Faili ei saa avada
 change=Muuda
 changeOrientation=Muuda suunda
 changeUser=Muuda kasutajat
-changeStorage=Change storage
+changeStorage=Muuda salvestuspaik
 changesNotSaved=Muudatused on salvestamata
-classDiagram=Class Diagram
+classDiagram=Klassidiagramm
 userJoined={1} liitus
 userLeft={1} lahkus
 chatWindowTitle=Chat
@@ -97,11 +97,11 @@ chromeApp=Chrome App
 collaborativeEditingNotice=Oluline teadaanne grupitöö muutmise jaoks
 compressed=Pakitud
 commitMessage=Kinnita sõnum
-configLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!
-configLinkConfirm=Click OK to configure and restart draw.io.
+configLinkWarn=See link seadistab draw.io. Vali OK vaid juhul kui usaldad isikut, kes sulle selle saatis !!
+configLinkConfirm=Vali OK et draw.io seadistada ja uuesti laadida.
 csv=CSV
 dark=Tume
-didYouMeanToExportToPdf=Did you mean to export to PDF?
+didYouMeanToExportToPdf=Kas soovisid PDFi eksportida?
 draftFound=Mustand {1} jaoks on leitud. Lae see töötluskeskkonda või tühista jätkamiseks.
 dragAndDropNotSupported=Piltidele puudub pukseerimise tugi. Kas sooviksid selle asemel importida?
 dropboxCharsNotAllowed=Järgnevad tähemärgid pole lubatud:  \ / : ? * " |
@@ -114,7 +114,7 @@ clearDefaultStyle=Tühjenda vaikestiil
 clearWaypoints=Tühjenda teepunktid
 clipart=Clipart
 close=Sulge
-closingFile=Closing file
+closingFile=Sulgeb faili
 collaborator=Osaleja
 collaborators=Osalejad
 collapse=Vähenda 
@@ -136,7 +136,7 @@ containsValidationErrors=Sisaldab valideerimisvigu
 copiedToClipboard=Kopeeritud lõikelauale
 copy=Kopeeri
 copyConnect=Kopeeri ühendamisel
-copyCreated=A copy of the file was created.
+copyCreated=Failist loodi koopia.
 copyOf=Koopia {1}
 copyOfDrawing=Joonise koopia
 copySize=Kopeeri suurus
@@ -271,10 +271,10 @@ fileChangedOverwriteDialog=Faili muudeti. Kirjutab muudatused üle?
 fileChangedSyncDialog=Faili on muudetud. Kas soovid need muudatused ühildada?
 fileChangedSync=Faili on muudetud. Kliki siin et muudatused ühildada.
 overwrite=Kirjuta üle
-synchronize=Synchronize
+synchronize=Sünkroniseeri
 filename=Faili nimi
 fileExists=Fail juba eksisteerib
-fileMovedToTrash=File was moved to trash
+fileMovedToTrash=Fail saadeti prügikasti
 fileNearlyFullSeeFaq=Fail peaaegu täis, palun vaata KKK-d
 fileNotFound=Faili ei leitud
 repositoryNotFound=Hoidlat ei leitud
@@ -328,7 +328,7 @@ formatVssx=VSSX
 formatXmlPlain=XML (tavaline)
 formatXml=XML
 forum=Diskussiooni-abifoorumid
-freehand=Freehand
+freehand=Vabakäega
 fromTemplate=Mallist
 fromTemplateUrl=Malli URList
 fromText=Tekstist
@@ -400,7 +400,7 @@ insertRowBefore=Sisesta rida ülespoole
 insertRowAfter=Sisesta rida allapoole
 insertText=Sisesta tekst
 inserting=Sisestamine
-installDrawio=Install draw.io
+installDrawio=Paigalda draw.io
 invalidFilename=Diagrammi nimed ei tohi sisaldada järgnevaid tähemärke:  \ / | : ; { } < > & + ? = "
 invalidLicenseSeeThisPage=Sinu litsents on kehtetu, palun vaata seda <a target="_blank" href="https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin">lehte</a>.
 invalidInput=Viga sisestamisel
@@ -582,7 +582,7 @@ readOnly=Ainult lugemiseks
 reconnecting=Taasühendamine
 recentlyUpdated=Hiljuti uuendatud
 recentlyViewed=Hiljuti vaadatud
-rectangle=Rectangle
+rectangle=Ristkülik
 redirectToNewApp=See fail on loodud või muudetud programmi uuemas versioonis. Sind suunatakse nüüd ümber.
 realtimeTimeout=Tundub, et oled teinud mõned muudatused offline'is. Vabandame, aga neid muudatusi ei saa salvestada.
 redo=Tee uuesti
@@ -631,7 +631,7 @@ saveAndExit=Salvesta ja välju
 saveAs=Salvesta kui
 saveAsXmlFile=Salvesta XML failina?
 saved=Salvestatud
-saveDiagramFirst=Please save the diagram first
+saveDiagramFirst=Palun salvesta enne diagramm
 saveDiagramsTo=Salvesta diagrammid...
 saveLibrary403=Puuduvad õigused selle raamatukogu muutmiseks
 saveLibrary500=Viga raamatukogu salvestamisel
@@ -786,7 +786,7 @@ myDiagrams=Minu diagrammid
 allDiagrams=Kõik diagrammid
 recentlyUsed=Viimati kasutatud
 listView=Nimekiri
-gridView=Grid view
+gridView=Ruudustiku vaade
 resultsFor=Tulemused {1} jaoks
 oneDriveCharsNotAllowed=Ebasobivad sümbolid:  ~ " # %  * : < > ? / \ { | }
 oneDriveInvalidDeviceName=Antud seadme nimi on vigane.
@@ -825,7 +825,7 @@ selectChildren=Select Children
 selectSiblings=Select Siblings
 selectParent=Select Parent
 selectDescendants=Select Descendants
-lastSaved=Last saved {1} ago
+lastSaved=Viimati salvestati {1} tagasi
 resolve=Resolve
 reopen=Re-open
 showResolved=Show Resolved
@@ -841,9 +841,9 @@ libraries=Libraries
 confAnchor=Confluence lehe ankur
 confTimeout=Ühendus aegus
 confSrvTakeTooLong=Serveri {1} vastamien võtab liiga kaua aega. 
-confCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page
+confCannotInsertNew=Ei saa sisestada draw.io diagrammi uuele Confluence lehele
 confSaveTry=Palun salvesta leht ja proovi uuesti.
-confCannotGetID=Unable to determine page ID
+confCannotGetID=Ei õnnestu määrata lehe ID
 confContactAdmin=Palun võta ühendust enda Confluence administraatoriga.
 readErr=Viga lugemisel
 editingErr=Viga muutmisel.
@@ -956,14 +956,14 @@ pickODFile=Vali OneDrive fail
 pickGDriveFile=Vali Google Drive fail
 pickDeviceFile=Vali fail seadmelt
 vsdNoConfig="vsdurl" is not configured
-ruler=Ruler
-units=Units
+ruler=Joonlaud
+units=Ühikud
 points=Points
 inches=Inches
 millimeters=Millimeters
 confEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.
 confDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session's modifications.
-macroNotFound=Macro Not Found
+macroNotFound=Makrot ei leitud
 confAInvalidPageIdsFormat=Incorrect Page IDs file format
 confACollectingCurPages=Collecting current pages
 confABuildingPagesMap=Building pages mapping

+ 2 - 2
src/main/webapp/resources/dia_ru.txt

@@ -757,7 +757,7 @@ width=Ширина
 wiki=Wiki
 wordWrap=Перенос по словам
 writingDirection=Направление текста
-yes=да
+yes=Да
 yourEmailAddress=Ваш e-mail адрес
 zoom=Масштаб
 zoomIn=Увеличить
@@ -780,7 +780,7 @@ webLink=Сетевая ссылка
 wireframes=Макеты интерфейсов (UI)
 property=Параметр
 value=Значение
-showMore=Раскрыть
+showMore=Больше вариантов
 showLess=Скрыть
 myDiagrams=Мои диаграммы
 allDiagrams=Все диаграммы

+ 168 - 168
src/main/webapp/resources/dia_zh.txt

@@ -1,18 +1,18 @@
 # *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*
 # https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE
-aboutDrawio=关于draw.io
-accessDenied=访问被拒
-action=Action
+aboutDrawio=关于 draw.io
+accessDenied=没有权限访问
+action=操作
 actualSize=实际尺寸
 add=添加
-addAccount=Add account
+addAccount=添加账户
 addedFile=已添加 {1}
 addImages=添加图片
-addImageUrl=添加图片链接
+addImageUrl=添加图片地址
 addLayer=添加图层
 addProperty=添加属性
 address=地址
-addToExistingDrawing=添加至当前的图
+addToExistingDrawing=添加至当前的图
 addWaypoint=添加航点
 adjustTo=调至
 advanced=高级
@@ -26,26 +26,26 @@ allTags=所有标签
 anchor=锚
 android=Android
 angle=角度
-arc=Arc
-areYouSure=您确定吗
+arc=弧形
+areYouSure=是否确定
 ensureDataSaved=关闭前请确保您的数据已保存。
 allChangesSaved=所有更改均已保存
-allChangesSavedInDrive=所有更改均保存至Google Drive中
+allChangesSavedInDrive=所有更改均保存至 Google Drive 
 allowPopups=允许弹出式窗口用以阻止此对话框
-allowRelativeUrl=Allow relative URL
+allowRelativeUrl=允许相对地址
 alreadyConnected=节点已连接
 apply=应用
 archiMate21=ArchiMate 2.1
 arrange=调整图形
 arrow=箭头
 arrows=箭头
-asNew=作为新图
+asNew=作为新图
 atlas=Atlas
 author=作者
 authorizationRequired=需要授权
-authorizeThisAppIn=在{1}里授权此应用软件
+authorizeThisAppIn=在 {1} 里授权此应用:
 authorize=授权
-authorizing=授权
+authorizing=正在授权
 automatic=自动
 autosave=自动保存
 autosize=自动调整
@@ -53,22 +53,22 @@ attachments=附件
 aws=AWS
 aws3d=AWS 3D
 azure=Azure
-back=Back
+back=后退
 background=背景
 backgroundColor=背景色
-backgroundImage=背景图
+backgroundImage=背景图
 basic=基本
-blankDrawing=空白图
+blankDrawing=空白
 blankDiagram=空白图表
 block=区块
-blockquote=块引用
+blockquote=区块引言
 blog=博客
 bold=粗体
 bootstrap=Bootstrap
-border=Border
+border=边框
 borderColor=边框颜色
 borderWidth=边框宽度
-bottom=
+bottom=
 bottomAlign=向下对齐
 bottomLeft=左下
 bottomRight=右下
@@ -79,55 +79,55 @@ business=商务
 busy=处理中
 cabinets=机箱
 cancel=取消
-center=居中
+center=水平居中
 cannotLoad=载入失败。请稍后重试。
 cannotLogin=登录失败。请稍后重试。
 cannotOpenFile=无法打开文件
 change=更改
 changeOrientation=改变方向
 changeUser=更改用户
-changeStorage=Change storage
+changeStorage=修改存储方式
 changesNotSaved=更改尚未保存
-classDiagram=Class Diagram
-userJoined={1}已加入
-userLeft={1}已离开
+classDiagram=类图
+userJoined={1} 已加入
+userLeft={1} 已离开
 chatWindowTitle=聊天
 chooseAnOption=请选择一项
-chromeApp=Chrome应用软件
+chromeApp=Chrome 应用
 collaborativeEditingNotice=Important Notice for Collaborative Editing
 compressed=已压缩
 commitMessage=提交信息
 configLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!
-configLinkConfirm=Click OK to configure and restart draw.io.
+configLinkConfirm=点击确定配置并重启 draw.io
 csv=CSV
 dark=Dark
-didYouMeanToExportToPdf=Did you mean to export to PDF?
-draftFound={1}的草图已找到。载入其进行编辑或丢弃以继续。
-dragAndDropNotSupported=暂不支持图片拖放功能。要选择导入选项吗
+didYouMeanToExportToPdf=是否要导出到 PDF?
+draftFound={1} 的草稿已经找到。将其加载到编辑器或将其丢弃以继续。
+dragAndDropNotSupported=暂不支持图片拖放功能。是否要使用导入
 dropboxCharsNotAllowed=系统不允许使用下列字符:\ / : ? * " |
 check=核查
-checksum=Checksum
+checksum=校验码
 circle=圆形
-cisco=思科
+cisco=Cisco
 classic=经典
 clearDefaultStyle=清除默认风格
 clearWaypoints=清除航点
 clipart=剪贴画
 close=关闭
-closingFile=Closing file
+closingFile=正在关闭文件
 collaborator=合作者
 collaborators=合作者
-collapse=收起
-collapseExpand=收起/展开
-collapse-expand=点击实现收起/展开\nShift-点击以移动周边图形 \nAlt-点击以保护组别尺寸
-collapsible=可收起
+collapse=折叠
+collapseExpand=折叠 / 展开
+collapse-expand=点击折叠 / 展开\nShift-点击以移动周边图形 \nAlt-点击以保护组别尺寸
+collapsible=可折叠
 comic=手绘
 comment=评论
-commentsNotes=评论/备注
-compress=Compress
+commentsNotes=评论 / 备注
+compress=压缩
 connect=连接
-connecting=连接
-connectWithDrive=连接Google Drive
+connecting=正在连接
+connectWithDrive=连接 Google Drive
 connection=连接
 connectionArrows=连接箭头
 connectionPoints=连接点
@@ -136,57 +136,57 @@ containsValidationErrors=包含验证错误
 copiedToClipboard=已复制到剪贴板
 copy=复制
 copyConnect=连接时复制
-copyCreated=A copy of the file was created.
-copyOf={1}的副本
-copyOfDrawing=图副本
-copySize=Copy Size
-copyStyle=复制风格
+copyCreated=已经创建文件的副本。
+copyOf={1} 的副本
+copyOfDrawing=图副本
+copySize=复制大小
+copyStyle=复制样式
 create=创建
 createNewDiagram=创建新图表
-createRevision=创建修订版
+createRevision=创建修订版
 createShape=创建图形
-crop=单页导出
+crop=导出单页
 curved=曲线
 custom=自定义
 current=当前
-currentPage=Current page
+currentPage=当前页
 cut=剪切
 dashed=虚线
 decideLater=稍后再决定
 default=默认值
 delete=删除
 deleteColumn=删除列
-deleteLibrary401=没有足够的许可权删除此图库
+deleteLibrary401=没有权删除此图库
 deleteLibrary404=未找到所选图库
 deleteLibrary500=删除图库时出错
 deleteLibraryConfirm=您即将永久删除此图库。您确定要这样操作吗?
 deleteRow=删除行
-description=说明
-device=电脑或手机设备
+description=描述
+device=设备
 diagram=图表
 diagramContent=图表内容
-diagramLocked=图表已加锁以避免进一步的数据丢失。
-diagramLockedBySince=The diagram is locked by {1} since {2} ago
+diagramLocked=图表已经锁定以避免进一步的数据丢失。
+diagramLockedBySince=图表已经在 {2} 之前被 {1} 锁定
 diagramName=图表名称
 diagramIsPublic=图表为公开状态
 diagramIsNotPublic=图表为未公开状态
-diamond=菱形
-diamondThin=菱形(细)
+diamond=方块
+diamondThin=方块(细)
 didYouKnow=您知道吗......
 direction=方向
 discard=丢弃
 discardChangesAndReconnect=取消更改并重新连接
-googleDriveMissingClickHere=找不到Google Drive?请点击这里!
+googleDriveMissingClickHere=找不到 Google Drive?请点击这里!
 discardChanges=取消更改
 disconnected=未连接
 distribute=等距分布
 done=完成
-dotted=点线风格
+dotted=点线
 doubleClickOrientation=双击以改变方向
 doubleClickTooltip=双击以插入文字
 doubleClickChangeProperty=双击以更改属性名
 download=下载
-downloadDesktop=Get draw.io Desktop
+downloadDesktop= 获取 draw.io 桌面版
 downloadAs=下载为
 clickHereToSave=点击此处保存。
 dpi=DPI
@@ -194,15 +194,15 @@ draftDiscarded=草稿已丢弃
 draftSaved=草稿已保存
 dragElementsHere=把元素拖至此处
 dragImagesHere=把图像或网络链接拖至此处
-dragUrlsHere=把URL地址拖至此处
+dragUrlsHere=将 URL 地址拖至此处
 draw.io=draw.io
-drawing=图纸{1}
-drawingEmpty=图空白
-drawingTooLarge=图过大
-drawioForWork=Draw.io支持GSuite
+drawing=绘图 {1}
+drawingEmpty=图空白
+drawingTooLarge=图过大
+drawioForWork=Draw.io for GSuite
 dropbox=Dropbox
 duplicate=复制
-duplicateIt=复制{1}
+duplicateIt=复制 {1}
 divider=分隔线
 dx=Dx
 dy=Dy
@@ -211,54 +211,54 @@ edit=编辑
 editData=编辑数据
 editDiagram=编辑图表
 editGeometry=编辑几何图形
-editImage=编辑图
-editImageUrl=编辑图片URL地址
+editImage=编辑图
+editImageUrl=编辑图片 URL 地址
 editLink=编辑链接
 editShape=编辑图形
 editStyle=编辑样式
 editText=编辑文字
 editTooltip=编辑提示
-glass=玻璃效果
-googleImages=Google图片
+glass=玻璃
+googleImages=Google 图片
 imageSearch=图片搜索
 eip=EIP
 embed=嵌入
 embedImages=嵌入图片
 mainEmbedNotice=将此粘贴至页面上
 electrical=电路
-ellipse=Ellipse
+ellipse=椭圆形
 embedNotice=将此一次性粘贴至本页页尾
 enterGroup=进入组进行编辑
 enterName=输入名称
 enterPropertyName=输入属性名
 enterValue=输入值
 entityRelation=实体关系
-entityRelationshipDiagram=Entity Relationship Diagram
+entityRelationshipDiagram=E-R图
 error=出错
 errorDeletingFile=删除文件出错
 errorLoadingFile=加载文件出错
-errorRenamingFile=文件更名出错
-errorRenamingFileNotFound=文件更名出错。找不到文件。
-errorRenamingFileForbidden=文件更名出错。没有足够的访问权限。
+errorRenamingFile=文件修改名称出错
+errorRenamingFileNotFound=文件修改名称出错。找不到文件。
+errorRenamingFileForbidden=文件修改名称出错。没有足够的访问权限。
 errorSavingDraft=保存草稿出错
 errorSavingFile=保存文件出错
-errorSavingFileUnknown=Google服务器授权出错。请刷新页面,然后重试。
+errorSavingFileUnknown=Google 服务器授权出错。请刷新页面,然后重试。
 errorSavingFileForbidden=保存文件时出错。没有足够的访问权限。
-errorSavingFileNameConflict=无法保存此图表。当前页面已经包含名为'{1}'的文件。
+errorSavingFileNameConflict=无法保存此图表。当前页面已经包含名为 '{1}' 的文件。
 errorSavingFileNotFound=保存文件时出错,文件未找到。
-errorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.
-errorSavingFileSessionTimeout=您的会话已经结束。请<a target='_blank'href='{1}'>{2}</a>,然后返回此标签以尝试再次保存。
+errorSavingFileReadOnlyMode=只读模式开启时无法保存图表。
+errorSavingFileSessionTimeout=您的会话已经结束。请 <a target='_blank'href='{1}'>{2}</a>,然后返回此标签以尝试再次保存。
 errorSendingFeedback=发送反馈出错。
 errorUpdatingPreview=更新预览出错。
 exit=退出
 exitGroup=退出编辑组
 expand=展开
 export=导出
-exporting=导出
+exporting=正在导出
 exportAs=导出为
 exportOptionsDisabled=已禁止导出
 exportOptionsDisabledDetails=所有者已禁止评论者及浏览者下载、打印或复制该文件。
-externalChanges=External Changes
+externalChanges=外部修改
 extras=其它
 facebook=Facebook
 failedToSaveTryReconnect=保存失败,正在尝试重新连接
@@ -267,15 +267,15 @@ feedback=反馈
 feedbackSent=反馈发送成功
 floorplans=平面图
 file=文件
-fileChangedOverwriteDialog=文件已更改。是否覆盖更改?
-fileChangedSyncDialog=The file has been modified. Do you want to synchronize those changes?
-fileChangedSync=The file has been modified. Click here to synchronize.
+fileChangedOverwriteDialog=文件已经被修改。是否保存文件并覆盖这些更改?
+fileChangedSyncDialog=文件已经被修改。是否要同步这些修改?
+fileChangedSync=文件已经被修改。点击这里进行同步。
 overwrite=覆盖
-synchronize=Synchronize
+synchronize=同步
 filename=文件名
 fileExists=文件已存在
-fileMovedToTrash=File was moved to trash
-fileNearlyFullSeeFaq=文件即将达到上限,请参阅常见问题一栏
+fileMovedToTrash=文件已经移到垃圾箱
+fileNearlyFullSeeFaq=文件即将达到上限,请参阅常见问题
 fileNotFound=未找到文件
 repositoryNotFound=未找到资源库
 fileNotFoundOrDenied=文件未找到。其不存在或您没有查阅权限。
@@ -285,7 +285,7 @@ fileOpenLocation=你想如何打开这些文件?
 filetypeHtml=.html causes file to save as HTML with redirect to cloud URL
 filetypePng=.png causes file to save as PNG with embedded data
 filetypeSvg=.svg causes file to save as SVG with embedded data
-fileWillBeSavedInAppFolder={1}将保存至应用软件文件夹
+fileWillBeSavedInAppFolder={1} 将保存至应用软件文件夹
 fill=填充
 fillColor=填充色
 filterCards=Filter Cards
@@ -300,7 +300,7 @@ fitToSheetsAcross=横向页面
 fitToBy=按
 fitToSheetsDown=纵向页面
 fitTwoPages=双页
-fitWindow=适应窗大小
+fitWindow=适应窗大小
 flip=翻转
 flipH=水平翻转
 flipV=垂直翻转
@@ -313,8 +313,8 @@ fontSize=字体大小
 forbidden=您没有该文件的访问权限
 format=格式
 formatPanel=格式面板
-formatted=格式化
-formattedText=格式化文本
+formatted=格式化
+formattedText=格式化文本
 formatPng=PNG
 formatGif=GIF
 formatJpg=JPEG
@@ -325,14 +325,14 @@ formatHtmlEmbedded=HTML
 formatSvgEmbedded=SVG(含XML)
 formatVsdx=VSDX
 formatVssx=VSSX
-formatXmlPlain=XML(普通
+formatXmlPlain=XML(文本文件
 formatXml=XML
-forum=讨论组/帮助论坛
-freehand=Freehand
+forum=讨论组 / 帮助论坛
+freehand=自由绘图
 fromTemplate=从模板
-fromTemplateUrl=从模板URL地址
+fromTemplateUrl=从模板 URL 地址
 fromText=从文本
-fromUrl=从URL地址
+fromUrl=从 URL 地址
 fromThisPage=从当前页
 fullscreen=全屏
 gap=Gap
@@ -357,28 +357,28 @@ gridColor=网格线颜色
 gridSize=网格大小
 group=组合
 guides=参考线
-hateApp=我讨厌draw.io
+hateApp=我讨厌 draw.io
 heading=标题
 height=高
 help=帮助
 helpTranslate=帮助我们翻译此应用
 hide=隐藏
-hideIt=隐藏{1}
+hideIt=隐藏 {1}
 hidden=已隐藏
 home=首页
 horizontal=水平
-horizontalFlow=水平流
-horizontalTree=水平树
+horizontalFlow=水平流
+horizontalTree=水平树
 howTranslate=按您的母语水平评判,该翻译如何?
 html=HTML
-htmlText=HTML文本
+htmlText=HTML 文本
 id=ID
 iframe=IFrame
 ignore=忽略
 image=图片
-imageUrl=图片URL地址
+imageUrl=图片 URL 地址
 images=图片
-imagePreviewError=无法预览图片。请检查URL地址。
+imagePreviewError=无法预览图片。请检查 URL 地址。
 imageTooBig=图片太大
 imgur=Imgur
 import=导入
@@ -400,13 +400,13 @@ insertRowBefore=上方插入行
 insertRowAfter=下方插入行
 insertText=插入文本
 inserting=正在插入
-installDrawio=Install draw.io
+installDrawio=安装 draw.io
 invalidFilename=图表名称不能包含以下特殊字符: \ / | : ; { } < > & + ? = "
 invalidLicenseSeeThisPage=您的许可无效,请参阅此<a target="_blank" href="https://support.draw.io/display/DFCS/Licensing+your+draw.io+plugin">页面</a>。
-invalidInput=Invalid input
+invalidInput=无效输入
 invalidName=无效名称
 invalidOrMissingFile=无效或丢失的文件
-invalidPublicUrl=无效的公开URL地址
+invalidPublicUrl=无效的公开 URL 地址
 isometric=等尺寸
 ios=iOS
 italic=斜体
@@ -440,18 +440,18 @@ leftAlign=左对齐
 leftToRight=右对齐
 libraryTooltip=将图形拖放至此或单击+以插入。双击进行编辑。
 lightbox=光箱特效
-line=线
+line=线
 lineend=线末端
-lineheight=线
+lineheight=
 linestart=线始端
 linewidth=线宽
-link=
-links=
+link=
+links=
 loading=加载中
-lockUnlock=锁/解锁
-loggedOut=登出
-logIn=登
-loveIt=我爱{1}
+lockUnlock=锁/ 解锁
+loggedOut=注销
+logIn=登
+loveIt=我爱 {1}
 lucidchart=Lucidchart
 maps=Maps
 mathematicalTypesetting=数学排版
@@ -462,7 +462,7 @@ microsoftExcel=Microsoft Excel
 microsoftPowerPoint=Microsoft PowerPoint
 microsoftWord=Microsoft Word
 middle=垂直居中
-minimal=Minimal
+minimal=最小化
 misc=杂项
 mockups=实体模型
 modificationDate=修改日期
@@ -473,12 +473,12 @@ moreShapes=更多图形
 move=移动
 moveToFolder=移动至文件夹
 moving=移动中
-moveSelectionTo=将所选移至{1}
+moveSelectionTo=将所选移至 {1}
 name=名称
 navigation=导航
-network=Network
+network=网络
 networking=网络
-new=新
+new=新
 newLibrary=新增图库
 nextPage=下一页
 no=没有
@@ -494,7 +494,7 @@ noOtherViewers=无其他查阅者
 noPlugins=无插件
 noPreview=无预览
 noResponse=服务器无响应
-noResultsFor=未找到'{1}'的相关结果
+noResultsFor=未找到 '{1}' 的相关结果
 noRevisions=无修订
 noSearchResults=查询无结果
 noPageContentOrNotSaved=此页面上找不到锚点,或尚未保存
@@ -506,7 +506,7 @@ notAvailable=不可用
 notAUtf8File=非 UTF-8 格式文件
 notConnected=未连接
 note=备注
-notUsingService=未使用{1}?
+notUsingService=未使用 {1}?
 numberedList=编号列表
 offline=离线
 ok=确定
@@ -555,11 +555,11 @@ permissionAnyone=任何人均可编辑
 permissionAuthor=只有本人可编辑
 pickFolder=选择文件夹
 pickLibraryDialogTitle=选择图库
-publicDiagramUrl=图表的公共URL地址
+publicDiagramUrl=图表的公共 URL 地址
 placeholders=占位符
 plantUml=PlantUML
 plugins=插件
-pluginUrl=插件URL地址
+pluginUrl=插件 URL 地址
 pluginWarning=本页面已要求载入以下插件:\n \n {1}\n \n 是否现在载入这些插件?\n \n 备注:确保在完全理解与此相关的安全问题的情况下再允许这些插件运行。\n
 plusTooltip=单击进行连接与复制(ctrl+单击进行复制,shift+单击进行连接)。拖拽进行连接(xtrl+拖拽进行复制)。
 portrait=竖向
@@ -582,26 +582,26 @@ readOnly=只读
 reconnecting=重新连接
 recentlyUpdated=最近更新
 recentlyViewed=最近阅览
-rectangle=Rectangle
+rectangle=矩形
 redirectToNewApp=该文件是在此应用软件的新版本中所创建或修改的。正在重新定向。
 realtimeTimeout=似乎您在离线状态下做过更改。对不起,这些更改不予保存。
 redo=重做
 refresh=刷新
 regularExpression=正则表达式
-relative=Relative
-relativeUrlNotAllowed=Relative URL not allowed
+relative=相对
+relativeUrlNotAllowed=不允许使用相对 URL 地址
 rememberMe=记住我
 rememberThisSetting=记住此设置
 removeFormat=清除格式
-removeFromGroup=移出组
-removeIt=删除{1}
+removeFromGroup=移出组
+removeIt=删除 {1}
 removeWaypoint=删除航点
 rename=重命名
 renamed=已重命名
-renameIt=重命名{1}
+renameIt=重命名 {1}
 renaming=正在重命名
 replace=替换
-replaceIt={1}已经存在了。要替换它吗?
+replaceIt={1} 已经存在了。确定要替换它吗?
 replaceExistingDrawing=替换当前图形
 required=必填
 reset=重置
@@ -611,14 +611,14 @@ resizeLargeImages=Do you want to resize large images to make the application run
 retina=Retina
 responsive=响应式
 restore=恢复
-restoring=恢复
-retryingIn={1}秒后重试
+restoring=正在恢复
+retryingIn={1} 秒后重试
 retryingLoad=载入失败,正在重试...
 retryingLogin=登录超时,正在重试...
 reverse=翻转
 revision=修订
 revisionHistory=修订历史
-rhombus=Rhombus
+rhombus=菱形
 right=右
 rightAlign=右对齐
 rightToLeft=由右至左
@@ -627,16 +627,16 @@ rotateTooltip=点选拖拽旋转,或点击选择90度
 rotation=旋转
 rounded=圆角
 save=保存
-saveAndExit=存并退出
+saveAndExit=存并退出
 saveAs=另存为
 saveAsXmlFile=另存为XML文件?
 saved=已保存
-saveDiagramFirst=Please save the diagram first
-saveDiagramsTo=把图表存至
+saveDiagramFirst=请先保存图表
+saveDiagramsTo=保存图表到
 saveLibrary403=没有足够的权限编辑此图库
 saveLibrary500=保存图库时出错
-saveLibraryReadOnly=Could not save library while read-only mode is active
-saving=保存
+saveLibraryReadOnly=只读模式开启时无法保存图库
+saving=正在保存
 scratchpad=便笺本
 scrollbars=滚动条
 search=搜索
@@ -649,13 +649,13 @@ selectFile=选择文件
 selectFolder=选择文件夹
 selectFont=选择字体
 selectNone=全不选
-selectTemplate=Select Template
+selectTemplate=选择模板
 selectVertices=选择顶点
 sendMessage=发送
-sendYourFeedbackToDrawIo=将您的反馈发送至draw.io
+sendYourFeedbackToDrawIo=将您的反馈发送至 draw.io
 serviceUnavailableOrBlocked=服务无法使用或已被屏蔽
 sessionExpired=会话已过期,请刷新浏览器窗口。
-sessionTimeoutOnSave=会话已超时,您的Google Drive的连接已断开。按OK键登录并保存。
+sessionTimeoutOnSave=会话已超时,您的 Google Drive 连接已断开。按确定键登录并保存。
 setAsDefaultStyle=设置为默认样式
 shadow=阴影
 shape=形状
@@ -667,7 +667,7 @@ show=显示
 showStartScreen=显示开始画面
 sidebarTooltip=单击以展开。将图形拖拽至图表中。Shift+单击以改变所选内容。Alt+单击以插入及连接。
 signs=标识
-signOut=登出
+signOut=注销
 simple=简单
 simpleArrow=简单箭头
 simpleViewer=Simple Viewer
@@ -680,22 +680,22 @@ space=空间
 spacing=间距
 specialLink=特殊链接
 standard=标准
-startDrawing=Start drawing
-stopDrawing=Stop drawing
+startDrawing=开始绘图
+stopDrawing=结束绘图
 starting=开启中
 straight=直线
-strikethrough=Strikethrough
+strikethrough=删除线
 strokeColor=线条颜色
 style=样式
 subscript=下标
 summary=概要
 superscript=上标
 support=支持
-swimlaneDiagram=Swimlane Diagram
+swimlaneDiagram=泳道图
 sysml=SysML
 tags=标签
 table=表格
-tables=Tables
+tables=表格
 takeOver=Take Over
 targetSpacing=目标间距
 template=模板
@@ -709,9 +709,9 @@ title=标题
 to=至
 toBack=移至最后
 toFront=移至最前
-toolbar=Toolbar
+toolbar=工具栏
 tooltips=提示
-top=
+top=
 topAlign=向上对齐
 topLeft=左上
 topRight=右上
@@ -725,12 +725,12 @@ type=类型
 twitter=Twitter
 uml=UML
 underline=下划线
-undo=取消操作
-ungroup=取消
+undo=撤销
+ungroup=取消组
 unsavedChanges=未保存的更改
 unsavedChangesClickHereToSave=修改未保存。点击此处保存。
 untitled=未命名
-untitledDiagram=未命名表
+untitledDiagram=未命名
 untitledLayer=未命名图层
 untitledLibrary=未命名图库
 unknownError=未知错误
@@ -739,13 +739,13 @@ updatingDocument=文件更新中。请稍候...
 updatingPreview=预览更新中。请稍候...
 updatingSelection=选择更新中。请稍候...
 upload=上传
-url=URL地址
+url=URL
 useOffline=Use Offline
 useRootFolder=Use root folder?
 userManual=用户手册
 vertical=垂直
 verticalFlow=垂直流
-verticalTree=垂直树
+verticalTree=垂直树
 view=查看
 viewerSettings=Viewer Settings
 viewUrl=用于查看的链接:{1}
@@ -775,26 +775,26 @@ nothingIsSelected=未选择
 other=其他
 softwaredesign=软件设计图
 venndiagrams=文氏图
-webEmailOrOther=网站、电邮或其他网络地址
+webEmailOrOther=网站、电或其他网络地址
 webLink=Web链接
 wireframes=线框图
-property=Property
-value=Value
-showMore=Show More
-showLess=Show Less
-myDiagrams=My Diagrams
-allDiagrams=All Diagrams
-recentlyUsed=Recently used
-listView=List view
-gridView=Grid view
+property=属性
+value=
+showMore=显示更多
+showLess=显示更少
+myDiagrams=我的图表
+allDiagrams=全部图表
+recentlyUsed=最近使用
+listView=列表视图
+gridView=网格视图
 resultsFor=Results for '{1}'
-oneDriveCharsNotAllowed=The following characters are not allowed: ~ " # %  * : < > ? / \ { | }
+oneDriveCharsNotAllowed=不允许下列字符: ~ " # %  * : < > ? / \ { | }
 oneDriveInvalidDeviceName=The specified device name is invalid
 officeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.
 officeSelectSingleDiag=Please select a single draw.io diagram only without other contents.
 officeSelectDiag=Please select a draw.io diagram.
 officeCannotFindDiagram=Cannot find a draw.io diagram in the selection
-noDiagrams=No diagrams found
+noDiagrams=没有找到图表
 authFailed=Authentication failed
 officeFailedAuthMsg=Unable to successfully authenticate user or authorize application.
 convertingDiagramFailed=Converting diagram failed
@@ -878,7 +878,7 @@ gliffyImport=Gliffy Import
 gliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.
 gliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.
 startImport=Start Import
-drawConfig=draw.io Configuration
+drawConfig=draw.io 配置
 customLib=Custom Libraries
 customTemp=Custom Templates
 pageIdsExp=Page IDs Export
@@ -956,11 +956,11 @@ pickODFile=Pick OneDrive File
 pickGDriveFile=Pick Google Drive File
 pickDeviceFile=Pick Device File
 vsdNoConfig="vsdurl" is not configured
-ruler=Ruler
-units=Units
+ruler=标尺
+units=单位
 points=Points
-inches=Inches
-millimeters=Millimeters
+inches=英寸
+millimeters=毫米
 confEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.
 confDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session's modifications.
 macroNotFound=Macro Not Found

+ 4 - 4
src/main/webapp/service-worker.js

@@ -6,7 +6,7 @@ if (workbox)
 	workbox.precaching.precacheAndRoute([
   {
     "url": "js/app.min.js",
-    "revision": "d996eeb6bf5eb7800a4f34849879ccfe"
+    "revision": "16711c059dd55b147d3591acdcb4f85d"
   },
   {
     "url": "index.html",
@@ -22,11 +22,11 @@ if (workbox)
   },
   {
     "url": "js/stencils.min.js",
-    "revision": "14ffe15bc8092749f917b927e4a1601a"
+    "revision": "68dc6ad0515af0278434da80458059bf"
   },
   {
     "url": "js/extensions.min.js",
-    "revision": "ee6f86acaeb0ebd635102442adc45380"
+    "revision": "25b5872708446c8f83ec4d7a8de3c915"
   },
   {
     "url": "js/diagramly/ElectronApp.js",
@@ -34,7 +34,7 @@ if (workbox)
   },
   {
     "url": "styles/grapheditor.css",
-    "revision": "36c4e00a4c9d48b8344fc6d8592672de"
+    "revision": "2f1b366eeffa3dae8b004b5e632a22e8"
   },
   {
     "url": "styles/atlas.css",

+ 0 - 2
src/main/webapp/stencils/cisco/misc.xml

@@ -3673,7 +3673,6 @@
 <close/>
 </path>
 <fill/>
-<restore/>
 <rect/>
 <stroke/>
 <strokecolor color="#ffffff"/>
@@ -3695,7 +3694,6 @@
 <close/>
 </path>
 <stroke/>
-<save/>
 <path>
 <move x="11.33" y="52.33"/>
 <curve x1="11.66" y1="52.33" x2="11.66" y2="52" x3="11.66" y3="52"/>

+ 0 - 2
src/main/webapp/stencils/electrical/transistors.xml

@@ -162,7 +162,6 @@
 			<constraint name="W" perimeter="0" x="0" y="0.5"/>
 		</connections>
 		<background>
-			<save/>
 			<path>
 				<move x="0" y="55"/>
 				<line x="41" y="55"/>
@@ -402,7 +401,6 @@
 			<constraint name="W" perimeter="0" x="0" y="0.5"/>
 		</connections>
 		<background>
-			<save/>
 			<path>
 				<move x="0" y="55"/>
 				<line x="41" y="55"/>

+ 6 - 0
src/main/webapp/styles/grapheditor.css

@@ -10,6 +10,12 @@
 .geEditor input, select, textarea, button {
        font-size: inherit;
 }
+.geEditor input {
+       border-width: 2px;
+}
+.geEditor select {
+       border-width: 1px;
+}
 .geEditor div.mxTooltip {
 	background: whiteSmoke;
 	border-color: lightGray;