Browse Source

13.1.4 release

David Benson [draw.io] 5 years ago
parent
commit
d46a85de8d
35 changed files with 6551 additions and 3186 deletions
  1. 8 0
      ChangeLog
  2. 1 1
      VERSION
  3. 81 78
      etc/mxgraph/mxClient.js
  4. 31 2
      etc/redirect-worker/redirect.js
  5. 1 1
      src/main/webapp/connect/att_common/att-editor.js
  6. 39 3
      src/main/webapp/connect/confluence/connectUtils-1-4-8.js
  7. 1 1
      src/main/webapp/connect/gdrive_common/editor.js
  8. 2 2
      src/main/webapp/connect/gdriveconnector/att-macroEditor.html
  9. 1 1
      src/main/webapp/connect/gdriveconnector/od-viewer.js
  10. 1 1
      src/main/webapp/connect/gdriveconnector/viewer.js
  11. 2 2
      src/main/webapp/connect/new_common/cac.js
  12. 1 1
      src/main/webapp/connect/onedrive_common/editor.js
  13. 1 1
      src/main/webapp/connect/remote_gdrive/editor.js
  14. 1 1
      src/main/webapp/connect/remote_onedrive/editor.js
  15. 1521 1512
      src/main/webapp/js/app.min.js
  16. 5 0
      src/main/webapp/js/diagramly/Dialogs.js
  17. 8 7
      src/main/webapp/js/diagramly/Editor.js
  18. 45 18
      src/main/webapp/js/diagramly/EditorUi.js
  19. 1 0
      src/main/webapp/js/diagramly/Init.js
  20. 44 54
      src/main/webapp/js/diagramly/Menus.js
  21. 7 3
      src/main/webapp/js/diagramly/TrelloFile.js
  22. 21 0
      src/main/webapp/js/diagramly/vsdx/importer.js
  23. 17 16
      src/main/webapp/js/extensions.min.js
  24. 3 22
      src/main/webapp/js/mxgraph/Actions.js
  25. 27 23
      src/main/webapp/js/mxgraph/Dialogs.js
  26. 537 265
      src/main/webapp/js/mxgraph/Graph.js
  27. 45 9
      src/main/webapp/js/mxgraph/Shapes.js
  28. 7 1
      src/main/webapp/js/mxgraph/Sidebar.js
  29. 1152 1141
      src/main/webapp/js/viewer.min.js
  30. 1867 0
      src/main/webapp/mxgraph/mxClient.js
  31. 5 5
      src/main/webapp/package.json
  32. 3 3
      src/main/webapp/plugins/cConf-1-4-8.js
  33. 9 9
      src/main/webapp/resources/dia_es.txt
  34. 1025 0
      src/main/webapp/resources/dia_eu.txt
  35. 31 3
      src/main/webapp/service-worker.js

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+27-MAY-2020: 13.1.4
+
+- Adds dark export option in dark mode
+- Adds Euskadi translations
+- Uses mxGraph 4.2.0 beta 4
+- Adds openLink JSON event
+- Adds %id% placeholder
+
 19-MAY-2020: 13.1.3
 
 - Adds merge JSON message

+ 1 - 1
VERSION

@@ -1 +1 @@
-13.1.3
+13.1.4

File diff suppressed because it is too large
+ 81 - 78
etc/mxgraph/mxClient.js


+ 31 - 2
etc/redirect-worker/redirect.js

@@ -37,6 +37,17 @@ async function handleRequest(request) {
 		  }
 		  else
 		  {
+			  if (path.startsWith('/label') || path.startsWith('/rest') || path.startsWith('/login.action'))
+			  {
+				  // blah
+			  }
+			  else
+			  {
+				  let msg = encodeURIComponent('redirect-worker-404-' + requestURL);
+				  let url = 'https://log.diagrams.net/' + msg;
+				  fetch(url);
+			  }
+
 			  let lastSlash = path.lastIndexOf('/');
 			  
 			  if (lastSlash >= 0)
@@ -50,8 +61,10 @@ async function handleRequest(request) {
 			  }
 		  }
 	  } while (!done)
+
+
   }
-  
+
   // If not in the map, return 404
   return new Response('NOT_FOUND', { status: 404 });
 }
@@ -135,7 +148,23 @@ const redirectMap = new Map([
 		['/features/training-material/', 'https://drawio-app.com/tutorials/'],
 		['/terms-conditions/', 'https://seibert-media.com/general-terms/'],
 		['/support/', 'https://github.com/jgraph/drawio/wiki/Getting-Support'],
-		['/', 'https://www.diagrams.net']
+		['/about-us/', 'https://www.diagrams.net/about.html'],
+		['/', 'https://drawio-app.com']
+	])],
+	['support', new Map([
+		['/label', 'https://127.0.0.1'],
+		['/rest', 'https://127.0.0.1'],
+		['/display/DFCS/draw.io+for+Confluence+Server', 'https://drawio-app.com'],
+		['/display/DO/Exporting+Files', 'https://desk.draw.io/a/solutions/articles/16000067785'],
+		['/display/DO/Online+Support', 'https://github.com/jgraph/drawio/wiki/Getting-Support'],
+		['/display/DO', 'https://github.com/jgraph/drawio/wiki/Getting-Support'],
+		['/display/DAFGD/draw.io+Add-on+for+Google+Docs', 'https://www.diagrams.net/blog/diagrams-google-docs.html'],
+		['/x/LYAk', 'https://seibert.biz/atlassianeula'],
+		['/display/DOB/2016/04/28/UML+State+Diagrams+with+draw.io', 'https://drawio-app.com/uml-state-diagrams-with-draw-io/'],
+		['/display/do/2015/01/08/gliffy+and+lucidchart+importing', 'https://desk.draw.io/support/solutions/articles/16000064013-mass-import-gliffy-diagrams-to-draw-io-in-confluence-server'],
+		['/display/DFCS/draw.io+for+Confluence+and+JIRA+support+terms+and+Service+Level+Agreement',
+		  'https://marketplace.atlassian.com/apps/1210933/draw-io-diagrams-for-confluence?hosting=server&tab=support'],
+		['/', 'https://github.com/jgraph/drawio/wiki/Getting-Support']
 	])],
 	['blog', new Map([
 		['/', 'https://www.diagrams.net/blog']

+ 1 - 1
src/main/webapp/connect/att_common/att-editor.js

@@ -466,7 +466,7 @@ function AttViewerEditor(onSubmit, getFileInfoFn, idSuffix, notStandalone, drawi
 	};
 	
 	//This function expects having the downloadUrl in the fileInfo
-	this.loadDarwioFile = function(fileInfo)
+	this.loadDrawioFile = function(fileInfo)
 	{
 		editedFile = fileInfo;
 		AC.$('#filename' + idSuffix).value = fileInfo.diagramDisplayName;

+ 39 - 3
src/main/webapp/connect/confluence/connectUtils-1-4-8.js

@@ -2713,6 +2713,29 @@ AC.getPageInfo = function(urlOnly, success, error)
 	});
 };
 
+AC.getContentProperty = function(contentId, propName, success, error)
+{
+	AP.request({
+		type: 'GET',
+		url: '/rest/api/content/' + contentId + '/property/' + encodeURIComponent(propName),
+		contentType: 'application/json;charset=UTF-8',
+		success: success,
+		error: error
+	});
+};
+
+AC.getConfPageEditorVer = function(pageId, callback)
+{
+	AC.getContentProperty(pageId, 'editor', function(resp)
+	{
+		resp = JSON.parse(resp);
+		callback(resp.value == 'v2'? 2 : 1);
+	}, function()
+	{
+		callback(1);// On error, assume the old editor
+	})
+};
+
 AC.gotoAnchor = function(anchor)
 {
 	AC.getPageInfo(false, function(info)
@@ -2729,9 +2752,22 @@ AC.gotoAnchor = function(anchor)
 				url = url.substring(0, hash);
 			}
 			
-			//When page title has a [ at the beginning, conf adds id- to anchor name
-			top.window.location = url + '#' + (info.title.indexOf('[') == 0? 'id-' : '') + 
-									encodeURI(info.title.replace(/\s/g, '') + '-' + anchor.replace(/\s/g, ''));
+			AC.getConfPageEditorVer(info.id, function(ver)
+			{
+				if (ver == 1)
+				{
+					//When page title has a [ at the beginning, conf adds id- to anchor name
+					url = url + '#' + (info.title.indexOf('[') == 0? 'id-' : '') + 
+											encodeURI(info.title.replace(/\s/g, '') + '-' + anchor.replace(/\s/g, ''));
+				}
+				else
+				{
+					url = url + '#' + encodeURIComponent(anchor.replace(/\s/g, '-'));
+				}
+				
+				top.window.location = url;
+			});
+			
 		}
 	}, function()
 	{

+ 1 - 1
src/main/webapp/connect/gdrive_common/editor.js

@@ -430,7 +430,7 @@ function GDriveEditor(onSubmit, getFileInfoFn, idSuffix, notStandalone, drawioOn
 		}
 	};
 	
-	this.loadDarwioFile = function(fileInfo)
+	this.loadDrawioFile = function(fileInfo)
 	{
 		GAC.$('#filename' + idSuffix).value = fileInfo.diagramDisplayName;
 		GAC.$('#autoSize' + idSuffix).checked = true;

+ 2 - 2
src/main/webapp/connect/gdriveconnector/att-macroEditor.html

@@ -80,7 +80,7 @@ body {
 <script type="text/javascript">
   	AttViewerEditor(function(selectedFile, selFileContent, editedFile, width, height, autoSize, isDrawio, aspect, onError)
 	{
-  		AC.getPageInfo(function(pageId, draftPage)
+  		AC.getCurPageId(function(pageId, draftPage)
  		{
 			if (selectedFile != null)
 			{
@@ -134,7 +134,7 @@ body {
 		});
 	}, function(callback, onError)
 	{
-		AC.getPageInfo(function(pageId, draftPage)
+		AC.getCurPageId(function(pageId, draftPage)
 	   	{
 			AP.confluence.getMacroData(function(fileInfo)
 			{

+ 1 - 1
src/main/webapp/connect/gdriveconnector/od-viewer.js

@@ -15,7 +15,7 @@
 	
 	script.onload = function()
 	{
-		AC.getPageInfo(function(pageId, draftPage)
+		AC.getCurPageId(function(pageId, draftPage)
 		{
 			confPageId = pageId;
 			isDraft = draftPage;

+ 1 - 1
src/main/webapp/connect/gdriveconnector/viewer.js

@@ -16,7 +16,7 @@
 	
 	script.onload = function()
 	{
-		GAC.getPageInfo(function(pageId, draftPage)
+		GAC.getCurPageId(function(pageId, draftPage)
 		{
 			confPageId = pageId;
 			isDraft = draftPage;

+ 2 - 2
src/main/webapp/connect/new_common/cac.js

@@ -92,7 +92,7 @@ CAC.htmlEntities = function(s, newline)
 	return s;
 };
 
-CAC.getPageInfo = function(callback)
+CAC.getCurPageId = function(callback)
 {
 	AP.navigator.getLocation(function (data)
     {
@@ -133,7 +133,7 @@ CAC.delOldCachedFiles = function(pageId, filename, timestamp)
 
 CAC.uploadAttachment = function(fileContent, filename, fileType, comment, success, error)
 {
-	CAC.getPageInfo(function(pageId, draftPage)
+	CAC.getCurPageId(function(pageId, draftPage)
 	{
 		var attFile = new Blob([fileContent], {type: fileType});
 		attFile.name = filename;

+ 1 - 1
src/main/webapp/connect/onedrive_common/editor.js

@@ -426,7 +426,7 @@ function OneDriveEditor(onSubmit, getFileInfoFn, idSuffix, notStandalone, drawio
 		}
 	};
 	
-	this.loadDarwioFile = function(fileInfo)
+	this.loadDrawioFile = function(fileInfo)
 	{
 		AC.$('#filename' + idSuffix).value = fileInfo.diagramDisplayName;
 		AC.$('#autoSize' + idSuffix).checked = true;

+ 1 - 1
src/main/webapp/connect/remote_gdrive/editor.js

@@ -32,7 +32,7 @@
 				break;
 			case 'loadFile':
 				editedFile = msg.fileInfo.sFileId;
-				editor.loadDarwioFile(msg.fileInfo);
+				editor.loadDrawioFile(msg.fileInfo);
 				break;
 			}
 		}

+ 1 - 1
src/main/webapp/connect/remote_onedrive/editor.js

@@ -33,7 +33,7 @@
 				break;
 			case 'loadFile':
 				editedFile = msg.fileInfo.sFileId;
-				editor.loadDarwioFile(msg.fileInfo);
+				editor.loadDrawioFile(msg.fileInfo);
 				break;
 			}
 		}

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


+ 5 - 0
src/main/webapp/js/diagramly/Dialogs.js

@@ -620,6 +620,11 @@ var SplashDialog = function(editorUi)
 		logo.src = IMAGE_PATH + '/osa_database.png';
 		service = mxResources.get('browser');
 	}
+	else if (editorUi.mode == App.MODE_TRELLO)
+	{
+		logo.src = IMAGE_PATH + '/trello-logo.svg';
+		service = mxResources.get('trello');
+	}
 	else
 	{
 		logo.src = IMAGE_PATH + '/osa_drive-harddisk.png';

+ 8 - 7
src/main/webapp/js/diagramly/Editor.js

@@ -1503,7 +1503,7 @@
 			url.substring(0, 23) === 'https://cdn.rawgit.com/' ||
 			url.substring(0, 19) === 'https://rawgit.com/' ||
 			/^https?:\/\/[^\/]*\.blob.core.windows.net\//.test(url) ||
-			/^https?:\/\/[^\/]*\.diagrams\.new\/proxy/.test(url) ||
+			/^https?:\/\/[^\/]*\.diagrams\.net\/proxy/.test(url) ||
 			/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(url) ||
 			/^https?:\/\/[^\/]*\.github\.io\//.test(url);
 	};
@@ -2157,7 +2157,8 @@
 	 *
 	 */
 	Editor.prototype.exportToCanvas = function(callback, width, imageCache, background, error, limitHeight,
-		ignoreSelection, scale, transparentBackground, addShadow, converter, graph, border, noCrop, grid)
+		ignoreSelection, scale, transparentBackground, addShadow, converter, graph, border, noCrop, grid,
+		keepTheme)
 	{
 		try
 		{
@@ -2181,11 +2182,11 @@
 			// Handles special case where background is null but transparent is false
 			if (bg == null && transparentBackground == false)
 			{
-				bg = '#ffffff';
+				bg = (keepTheme) ? this.graph.defaultPageBackgroundColor : '#ffffff';;
 			}
 			
-			this.convertImages(graph.getSvg(null, null, null, noCrop, null, ignoreSelection, null, null, null, addShadow),
-				mxUtils.bind(this, function(svgRoot)
+			this.convertImages(graph.getSvg(null, null, null, noCrop, null, ignoreSelection,
+				null, null, null, addShadow, null, keepTheme), mxUtils.bind(this, function(svgRoot)
 			{
 				try
 				{
@@ -4578,11 +4579,11 @@
 	var graphGetSvg = Graph.prototype.getSvg;
 	
 	Graph.prototype.getSvg = function(background, scale, border, nocrop, crisp,
-			ignoreSelection, showText, imgExport, linkTarget, hasShadow, incExtFonts)
+		ignoreSelection, showText, imgExport, linkTarget, hasShadow, incExtFonts, keepTheme)
 	{
 		var temp = null;
 		
-		if (this.themes != null && this.defaultThemeName == 'darkTheme')
+		if (!keepTheme && this.themes != null && this.defaultThemeName == 'darkTheme')
 		{
 			temp = this.stylesheet;
 			this.stylesheet = this.getDefaultStylesheet();

+ 45 - 18
src/main/webapp/js/diagramly/EditorUi.js

@@ -4678,7 +4678,7 @@
 	 *
 	 */
 	EditorUi.prototype.exportSvg = function(scale, transparentBackground, ignoreSelection, addShadow,
-		editable, embedImages, border, noCrop, currentPage, linkTarget)
+		editable, embedImages, border, noCrop, currentPage, linkTarget, keepTheme)
 	{
 		if (this.spinner.spin(document.body, mxResources.get('export')))
 		{
@@ -4696,14 +4696,14 @@
 				// Handles special case where background is null but transparent is false
 				if (bg == null && transparentBackground == false)
 				{
-					bg = '#ffffff';
+					bg = (keepTheme) ? this.editor.graph.defaultPageBackgroundColor : '#ffffff';
 				}
 				
 				// Sets or disables alternate text for foreignObjects. Disabling is needed
 				// because PhantomJS seems to ignore switch statements and paint all text.
 				var svgRoot = this.editor.graph.getSvg(bg, scale, border, noCrop, null,
 					ignoreSelection, null, null, (linkTarget == 'blank') ? '_blank' :
-					((linkTarget == 'self') ? '_top' : null), null, true);
+					((linkTarget == 'self') ? '_top' : null), null, true, keepTheme);
 				
 				if (addShadow)
 				{
@@ -5221,7 +5221,7 @@
 			var testLink = document.createElement('a');
 			testLink.style.paddingLeft = '12px';
 			testLink.style.color = 'gray';
-			testLink.setAttribute('href', 'javascript:void(0);');
+			testLink.style.cursor = 'pointer';
 			mxUtils.write(testLink, mxResources.get('share'));
 			radioSection.appendChild(testLink);
 			
@@ -5339,7 +5339,7 @@
 			testLink.style.paddingLeft = '12px';
 			testLink.style.color = 'gray';
 			testLink.style.fontSize = '11px';
-			testLink.setAttribute('href', 'javascript:void(0);');
+			testLink.style.cursor = 'pointer';
 			mxUtils.write(testLink, mxResources.get('check'));
 			hintSection.appendChild(testLink);
 			
@@ -5563,6 +5563,14 @@
 		var defaultTransparent = false; /*graph.background == mxConstants.NONE || graph.background == null*/; 
 		var transparent = this.addCheckbox(div, mxResources.get('transparentBackground'),
 			defaultTransparent, null, null, format != 'jpeg');
+		var keepTheme = null;
+		
+		if (uiTheme == 'dark')
+		{
+			keepTheme = this.addCheckbox(div, mxResources.get('dark'), true); 
+			height += 26;
+		}
+		
 		var selection = this.addCheckbox(div, mxResources.get('selectionOnly'),
 			false, graph.isSelectionEmpty());
 
@@ -5698,7 +5706,8 @@
 			
 			callback(zoomInput.value, transparent.checked, !selection.checked, shadow.checked,
 				include.checked, cb5.checked, borderInput.value, cb6.checked, !allPages.checked,
-				linkSelect.value, (grid != null? grid.checked : null));
+				linkSelect.value, (grid != null) ? grid.checked : null,
+				(keepTheme != null) ? keepTheme.checked : null);
 		}), null, btnLabel, helpLink);
 		this.showDialog(dlg.container, 340, height, true, true, null, null, null, null, true);
 		zoomInput.focus();
@@ -6340,7 +6349,8 @@
 	/**
 	 *
 	 */
-	EditorUi.prototype.exportImage = function(scale, transparentBackground, ignoreSelection, addShadow, editable, border, noCrop, currentPage, format, grid, dpi)
+	EditorUi.prototype.exportImage = function(scale, transparentBackground, ignoreSelection, addShadow,
+		editable, border, noCrop, currentPage, format, grid, dpi, keepTheme)
 	{
 		format = (format != null) ? format : 'png';
 		
@@ -6384,7 +6394,7 @@
 			   		this.spinner.stop();
 			   		this.handleError(e);
 			   	}), null, ignoreSelection, scale || 1, transparentBackground,
-			   		addShadow, null, null, border, noCrop, grid);
+			   		addShadow, null, null, border, noCrop, grid, keepTheme);
 			}
 			catch (e)
 			{
@@ -11396,6 +11406,19 @@
 		var parent = window.opener || window.parent;
 		var msg = (urlParams['proto'] == 'json') ? JSON.stringify({event: 'init'}) : (urlParams['ready'] || 'ready');
 		parent.postMessage(msg, '*');
+		
+		// Adds JSON event for opening links
+		if (urlParams['proto'] == 'json')
+		{
+			var graphOpenLink = this.editor.graph.openLink;
+			
+			this.editor.graph.openLink = function(href, target, allowOpener)
+			{
+				graphOpenLink.apply(this, arguments);
+				
+				parent.postMessage(JSON.stringify({event: 'openLink', href: href, target: target, allowOpener: allowOpener}), '*');
+			};
+		}
 	};
 	
 	/**
@@ -11418,15 +11441,18 @@
 			
 			if (urlParams['noSaveBtn'] == '1')
 			{
-				mxUtils.write(button, mxResources.get('saveAndExit'));
-				button.setAttribute('title', mxResources.get('saveAndExit'));
-				
-				mxEvent.addListener(button, 'click', mxUtils.bind(this, function()
+				if (urlParams['saveAndExit'] != '0')
 				{
-					this.actions.get('saveAndExit').funct();
-				}));
-				
-				div.appendChild(button);
+					mxUtils.write(button, mxResources.get('saveAndExit'));
+					button.setAttribute('title', mxResources.get('saveAndExit'));
+					
+					mxEvent.addListener(button, 'click', mxUtils.bind(this, function()
+					{
+						this.actions.get('saveAndExit').funct();
+					}));
+					
+					div.appendChild(button);
+				}
 			}
 			else
 			{
@@ -13577,11 +13603,12 @@
 	};
 	
 	EditorUi.prototype.exportToCanvas = function(callback, width, imageCache, background, error, limitHeight,
-			ignoreSelection, scale, transparentBackground, addShadow, converter, graph, border, noCrop, grid)
+			ignoreSelection, scale, transparentBackground, addShadow, converter, graph, border, noCrop, grid, keepTheme)
 	{
 		EditorUi.logEvent('SHOULD NOT BE CALLED: exportToCanvas');
 		return this.editor.exportToCanvas(callback, width, imageCache, background, error, limitHeight,
-				ignoreSelection, scale, transparentBackground, addShadow, converter, graph, border, noCrop, grid);	
+			ignoreSelection, scale, transparentBackground, addShadow, converter, graph, border,
+			noCrop, grid, keepTheme);	
 	};
 	
 	EditorUi.prototype.createImageUrlConverter = function()

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

@@ -104,6 +104,7 @@ window.mxLanguageMap = window.mxLanguageMap ||
 	'et' : 'Eesti',
 	'en' : 'English',
 	'es' : 'Español',
+	'eu' : 'Euskadi',
 	'fil' : 'Filipino',
 	'fr' : 'Français',
 	'gl' : 'Galego',

+ 44 - 54
src/main/webapp/js/diagramly/Menus.js

@@ -94,23 +94,6 @@
 			dlg.init();
 		});
 
-		editorUi.actions.put('exportSvg', new Action(mxResources.get('formatSvg') + '...', function()
-		{
-			editorUi.showExportDialog(mxResources.get('formatSvg'), true, mxResources.get('export'),
-				'https://support.draw.io/display/DO/Exporting+Files',
-				mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
-					editable, embedImages, border, cropImage, currentPage, linkTarget)
-				{
-					var val = parseInt(scale);
-					
-					if (!isNaN(val) && val > 0)
-					{
-					   	editorUi.exportSvg(val / 100, transparentBackground, ignoreSelection, addShadow,
-					   		editable, embedImages, border, !cropImage, currentPage, linkTarget);
-					}
-				}), true, null, 'svg');
-		}));
-		
 		editorUi.actions.put('insertTemplate', new Action(mxResources.get('template') + '...', function()
 		{
 			var dlg = new NewDialog(editorUi, null, false, function(xml)
@@ -654,21 +637,38 @@
 			}
 		}));
 		
+		editorUi.actions.put('exportSvg', new Action(mxResources.get('formatSvg') + '...', function()
+		{
+			editorUi.showExportDialog(mxResources.get('formatSvg'), true, mxResources.get('export'),
+				'https://desk.draw.io/support/solutions/articles/16000067785',
+				mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
+					editable, embedImages, border, cropImage, currentPage, linkTarget, grid, keepTheme)
+				{
+					var val = parseInt(scale);
+					
+					if (!isNaN(val) && val > 0)
+					{
+					   	editorUi.exportSvg(val / 100, transparentBackground, ignoreSelection, addShadow,
+					   		editable, embedImages, border, !cropImage, currentPage, linkTarget, keepTheme);
+					}
+				}), true, null, 'svg');
+		}));
+		
 		editorUi.actions.put('exportPng', new Action(mxResources.get('formatPng') + '...', function()
 		{
 			if (editorUi.isExportToCanvas())
 			{
 				editorUi.showExportDialog(mxResources.get('image'), false, mxResources.get('export'),
-					'https://support.draw.io/display/DO/Exporting+Files',
-					mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection,
-						addShadow, editable, embedImages, border, cropImage, currentPage, dummy, grid)
+					'https://desk.draw.io/support/solutions/articles/16000067785',
+					mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
+						editable, embedImages, border, cropImage, currentPage, dummy, grid, keepTheme)
 					{
 						var val = parseInt(scale);
 						
 						if (!isNaN(val) && val > 0)
 						{
-						   	editorUi.exportImage(val / 100, transparentBackground, ignoreSelection,
-						   		addShadow, editable, border, !cropImage, currentPage, null, grid);
+						   	editorUi.exportImage(val / 100, transparentBackground, ignoreSelection, addShadow,
+						   		editable, border, !cropImage, currentPage, null, grid, null, keepTheme);
 						}
 					}), true, true, 'png');
 			}
@@ -686,16 +686,16 @@
 			if (editorUi.isExportToCanvas())
 			{
 				editorUi.showExportDialog(mxResources.get('image'), false, mxResources.get('export'),
-					'https://support.draw.io/display/DO/Exporting+Files',
-					mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection,
-						addShadow, editable, embedImages, border, cropImage, currentPage, dummy, grid)
+					'https://desk.draw.io/support/solutions/articles/16000067785',
+					mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
+						editable, embedImages, border, cropImage, currentPage, dummy, grid, keepTheme)
 					{
 						var val = parseInt(scale);
 						
 						if (!isNaN(val) && val > 0)
 						{
-							editorUi.exportImage(val / 100, false, ignoreSelection,
-							   	addShadow, false, border, !cropImage, false, 'jpeg', grid);
+							editorUi.exportImage(val / 100, false, ignoreSelection, addShadow,
+								false, border, !cropImage, false, 'jpeg', grid, null, keepTheme);
 						}
 					}), true, false, 'jpeg');
 			}
@@ -729,11 +729,6 @@
 			}
 		}));
 		
-		editorUi.actions.addAction('userManual...', function()
-		{
-			editorUi.openLink('https://support.draw.io/display/DO/Draw.io+Online+User+Manual');
-		});
-
 		editorUi.actions.addAction('support...', function()
 		{
 			editorUi.openLink('https://github.com/jgraph/drawio/wiki/Getting-Support');
@@ -1291,7 +1286,7 @@
 				}, 0);
 				
 				this.addMenuItems(menu, ['-', 'keyboardShortcuts', 'quickStart',
-					'-', 'userManual', 'support', '-', 'about'], parent);
+					'support', '-', 'about'], parent);
 			}
 			
 			if (urlParams['test'] == '1')
@@ -2683,23 +2678,6 @@
 	    	return cell;
 		};
 		
-		editorUi.actions.put('exportSvg', new Action(mxResources.get('formatSvg') + '...', function()
-		{
-			editorUi.showExportDialog(mxResources.get('formatSvg'), true, mxResources.get('export'),
-				'https://support.draw.io/display/DO/Exporting+Files',
-				mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
-					editable, embedImages, border, cropImage, currentPage, linkTarget)
-				{
-					var val = parseInt(scale);
-					
-					if (!isNaN(val) && val > 0)
-					{
-					   	editorUi.exportSvg(val / 100, transparentBackground, ignoreSelection, addShadow,
-					   		editable, embedImages, border, !cropImage, currentPage, linkTarget);
-					}
-				}), true, null, 'svg');
-		}));
-		
 		editorUi.actions.put('insertText', new Action(mxResources.get('text'), function()
 		{
 			if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent()))
@@ -3367,7 +3345,7 @@
 					var tempDlg = new TemplatesDialog();
 					editorUi.showDialog(tempDlg.container, tempDlg.width, tempDlg.height, true, false, null, false, true);
 					tempDlg.init(editorUi, function(xml){console.log(xml)}, null,
-							null, null, "user", function(callback, username)
+							null, null, 'user', function(callback, username)
 					{
 						setTimeout(function(){
 							username? callback([
@@ -3432,11 +3410,23 @@
 					this.addMenuItems(menu, ['-', 'revisionHistory'], parent);
 				}
 				
-				this.addMenuItems(menu, ['-', 'pageSetup', 'print', '-', 'rename', urlParams['noSaveBtn'] == '1'? 'saveAndExit' : 'save'], parent);
+				this.addMenuItems(menu, ['-', 'pageSetup', 'print', '-', 'rename'], parent);
 				
-				if (urlParams['saveAndExit'] == '1' && urlParams['noSaveBtn'] != '1')
+				if (urlParams['noSaveBtn'] == '1')
 				{
-					this.addMenuItems(menu, ['saveAndExit'], parent);
+					if (urlParams['saveAndExit'] != '0')
+					{
+						this.addMenuItems(menu, ['saveAndExit'], parent);
+					}
+				}
+				else
+				{
+					this.addMenuItems(menu, ['save'], parent);
+					
+					if (urlParams['saveAndExit'] == '1')
+					{
+						this.addMenuItems(menu, ['saveAndExit'], parent);
+					}
 				}
 				
 				if (urlParams['noExitBtn'] != '1')

+ 7 - 3
src/main/webapp/js/diagramly/TrelloFile.js

@@ -85,10 +85,12 @@ TrelloFile.prototype.doSave = function(title, success, error)
 	// Forces update of data for new extensions
 	var prev = this.meta.name;
 	this.meta.name = title;
-	DrawioFile.prototype.save.apply(this, arguments);
-	this.meta.name = prev;
 	
-	this.saveFile(title, false, success, error);
+	DrawioFile.prototype.save.apply(this, [null, mxUtils.bind(this, function()
+	{
+		this.meta.name = prev;
+		this.saveFile(title, false, success, error);
+	}), error]);
 };
 
 /**
@@ -128,6 +130,8 @@ TrelloFile.prototype.saveFile = function(title, revision, success, error)
 			
 			this.ui.trello.saveFile(this, mxUtils.bind(this, function(meta)
 			{
+				console.log('here');
+				
 				this.savingFile = false;
 				this.isModified = prevModified;
 				this.meta = meta;

+ 21 - 0
src/main/webapp/js/diagramly/vsdx/importer.js

@@ -1409,6 +1409,27 @@ var com;
                             model.remove(removeChild);
                         }
                     }
+                    
+                    //Check for -ve width/height cells and correct it
+                    var geo = cell.geometry;
+                    
+                    if (geo != null)
+                	{
+                    	if (geo.height < 0)
+                		{
+                    		geo.height = Math.abs(geo.height);
+                    		geo.y -= geo.height;
+                    		cell.style += ';flipV=1;';
+                		}
+
+                    	if (geo.width < 0)
+                		{
+                    		geo.width = Math.abs(geo.width);
+                    		geo.x -= geo.width;
+                    		cell.style += ';flipH=1;';
+                		}
+                	}
+                    
                     if (childCount > 0) {
                         childCount = model.getChildCount(cell);
                     }

File diff suppressed because it is too large
+ 17 - 16
src/main/webapp/js/extensions.min.js


+ 3 - 22
src/main/webapp/js/mxgraph/Actions.js

@@ -203,30 +203,11 @@ Actions.prototype.init = function()
 	{
 		// Cancels interactive operations
 		graph.escape();
-		var cells = graph.getDeletableCells(graph.getSelectionCells());
+		var select = graph.deleteCells(graph.getDeletableCells(graph.getSelectionCells()), includeEdges);
 		
-		if (cells != null && cells.length > 0)
+		if (select != null)
 		{
-			var parents = (graph.selectParentAfterDelete) ? graph.model.getParents(cells) : null;
-			graph.removeCells(cells, includeEdges);
-			
-			// Selects parents for easier editing of groups
-			if (parents != null)
-			{
-				var select = [];
-				
-				for (var i = 0; i < parents.length; i++)
-				{
-					if (graph.model.contains(parents[i]) &&
-						(graph.model.isVertex(parents[i]) ||
-						graph.model.isEdge(parents[i])))
-					{
-						select.push(parents[i]);
-					}
-				}
-				
-				graph.setSelectionCells(select);
-			}
+			graph.setSelectionCells(select);
 		}
 	};
 	

+ 27 - 23
src/main/webapp/js/mxgraph/Dialogs.js

@@ -42,6 +42,30 @@ var ColorDialog = function(editorUi, color, apply, cancelFn)
 		document.body.appendChild(input);
 	}
 	
+	var applyFunction = (apply != null) ? apply : this.createApplyFunction();
+	
+	function doApply()
+	{
+		var color = input.value;
+		
+		// Blocks any non-alphabetic chars in colors
+		if (/(^#?[a-zA-Z0-9]*$)/.test(color))
+		{
+			if (color != 'none' && color.charAt(0) != '#')
+			{
+				color = '#' + color;
+			}
+
+			ColorDialog.addRecentColor((color != 'none') ? color.substring(1) : color, 12);
+			applyFunction(color);
+			editorUi.hideDialog();
+		}
+		else
+		{
+			editorUi.handleError({message: mxResources.get('invalidInput')});	
+		}
+	};
+	
 	this.init = function()
 	{
 		if (!mxClient.IS_TOUCH)
@@ -131,6 +155,8 @@ var ColorDialog = function(editorUi, color, apply, cancelFn)
 								picker.fromString(clr);
 							}
 						});
+						
+						mxEvent.addListener(td, 'dblclick', doApply);
 					}
 				})(presets[row * rowLength + i]);
 			}
@@ -199,29 +225,7 @@ var ColorDialog = function(editorUi, color, apply, cancelFn)
 		buttons.appendChild(cancelBtn);
 	}
 	
-	var applyFunction = (apply != null) ? apply : this.createApplyFunction();
-	
-	var applyBtn = mxUtils.button(mxResources.get('apply'), function()
-	{
-		var color = input.value;
-		
-		// Blocks any non-alphabetic chars in colors
-		if (/(^#?[a-zA-Z0-9]*$)/.test(color))
-		{
-			if (color != 'none' && color.charAt(0) != '#')
-			{
-				color = '#' + color;
-			}
-
-			ColorDialog.addRecentColor((color != 'none') ? color.substring(1) : color, 12);
-			applyFunction(color);
-			editorUi.hideDialog();
-		}
-		else
-		{
-			editorUi.handleError({message: mxResources.get('invalidInput')});	
-		}
-	});
+	var applyBtn = mxUtils.button(mxResources.get('apply'), doApply);
 	applyBtn.className = 'geBtn gePrimaryBtn';
 	buttons.appendChild(applyBtn);
 	

File diff suppressed because it is too large
+ 537 - 265
src/main/webapp/js/mxgraph/Graph.js


+ 45 - 9
src/main/webapp/js/mxgraph/Shapes.js

@@ -3050,16 +3050,21 @@
 	// Handlers are only added if mxVertexHandler is defined (ie. not in embedded graph)
 	if (typeof mxVertexHandler !== 'undefined')
 	{
-		function createHandle(state, keys, getPositionFn, setPositionFn, ignoreGrid, redrawEdges)
+		function createHandle(state, keys, getPositionFn, setPositionFn, ignoreGrid, redrawEdges, executeFn)
 		{
 			var handle = new mxHandle(state, null, mxVertexHandler.prototype.secondaryHandleImage);
 			
-			handle.execute = function()
+			handle.execute = function(me)
 			{
 				for (var i = 0; i < keys.length; i++)
 				{	
 					this.copyStyle(keys[i]);
 				}
+				
+				if (executeFn)
+				{
+					executeFn(me);
+				}
 			};
 			
 			handle.getPosition = getPositionFn;
@@ -3449,7 +3454,16 @@
 			},
 			'swimlane': function(state)
 			{
-				var handles = [createHandle(state, [mxConstants.STYLE_STARTSIZE], function(bounds)
+				var handles = [];
+				
+				if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED))
+				{
+					var size = parseFloat(mxUtils.getValue(state.style, mxConstants.STYLE_STARTSIZE, mxConstants.DEFAULT_STARTSIZE));
+					handles.push(createArcHandle(state, size / 2));
+				}
+				
+				// Start size handle must be last item in handles for hover to work in tables (see mouse event handler in Graph)
+				handles.push(createHandle(state, [mxConstants.STYLE_STARTSIZE], function(bounds)
 				{
 					var size = parseFloat(mxUtils.getValue(state.style, mxConstants.STYLE_STARTSIZE, mxConstants.DEFAULT_STARTSIZE));
 					
@@ -3467,13 +3481,35 @@
 						(mxUtils.getValue(this.state.style, mxConstants.STYLE_HORIZONTAL, 1) == 1) ?
 							Math.round(Math.max(0, Math.min(bounds.height, pt.y - bounds.y))) :
 							Math.round(Math.max(0, Math.min(bounds.width, pt.x - bounds.x)));
-				}, false)];
-				
-				if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED))
+				}, false, null, function(me)
 				{
-					var size = parseFloat(mxUtils.getValue(state.style, mxConstants.STYLE_STARTSIZE, mxConstants.DEFAULT_STARTSIZE));
-					handles.push(createArcHandle(state, size / 2));
-				}
+					if (mxEvent.isShiftDown(me.getEvent()))
+					{
+						var graph = state.view.graph;
+						
+						if (graph.isTableRow(state.cell) || graph.isTableCell(state.cell))
+						{
+							var dir = graph.getSwimlaneDirection(state.style);
+							var parent = graph.model.getParent(state.cell);
+							var cells = graph.model.getChildCells(parent, true);
+							var temp = []; 
+							
+							for (var i = 0; i < cells.length; i++)
+							{
+								// Finds siblings with the same direction and to set start size
+								if (cells[i] != state.cell && graph.isSwimlane(cells[i]) &&
+									graph.getSwimlaneDirection(graph.getCurrentCellStyle(
+									cells[i])) == dir)
+								{
+									temp.push(cells[i]);
+								}
+							}
+							
+							graph.setCellStyles(mxConstants.STYLE_STARTSIZE,
+								state.style[mxConstants.STYLE_STARTSIZE], temp);
+						}
+					}					
+				}));
 				
 				return handles;
 			},

+ 7 - 1
src/main/webapp/js/mxgraph/Sidebar.js

@@ -2126,9 +2126,15 @@ Sidebar.prototype.createDropHandler = function(cells, allowSplit, allowCellsInse
 						// Splits the target edge or inserts into target group
 						if (allowSplit && graph.isSplitTarget(target, cells, evt))
 						{
+							var s = graph.view.scale;
+							var tr = graph.view.translate;
+							var tx = (x + tr.x) * s;
+							var ty = (y + tr.y) * s;
+							
 							var clones = graph.cloneCells(cells);
 							graph.splitEdge(target, clones, null,
-								x - bounds.width / 2, y - bounds.height / 2);
+								x - bounds.width / 2, y - bounds.height / 2,
+								tx, ty);
 							select = clones;
 						}
 						else if (cells.length > 0)

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


File diff suppressed because it is too large
+ 1867 - 0
src/main/webapp/mxgraph/mxClient.js


+ 5 - 5
src/main/webapp/package.json

@@ -1,6 +1,6 @@
 {
   "name": "draw.io",
-  "version": "13.0.3",
+  "version": "13.1.4",
   "description": "diagrams.net desktop",
   "main": "electron.js",
   "scripts": {
@@ -23,15 +23,15 @@
   },
   "homepage": "https://github.com/jgraph/drawio",
   "dependencies": {
-    "commander": "^5.0.0",
-    "electron-log": "^4.1.1",
-    "electron-updater": "^4.2.5",
+    "commander": "^5.1.0",
+    "electron-log": "^4.2.0",
+    "electron-updater": "^4.3.1",
     "electron-progressbar": "^1.2.0",
     "electron-store": "^5.1.0",
     "compression": "^1.7.4",
     "crc": "^3.8.0"
   },
   "devDependencies": {
-    "electron": "^8.2.0"
+    "electron": "^9.0.0"
   }
 }

+ 3 - 3
src/main/webapp/plugins/cConf-1-4-8.js

@@ -485,7 +485,7 @@ Draw.loadPlugin(function(ui)
 			
 			if (anchor)
 			{
-				ui.remoteInvoke('getPageInfo', [false], null, function(info)
+				ui.remoteInvoke('getPageInfo', [true], null, function(info)
 				{
 					var url = info.url;
 					
@@ -499,8 +499,8 @@ Draw.loadPlugin(function(ui)
 							url = url.substring(0, hash);
 						}
 						
-						//When page title has a [ at the beginning, conf adds id- to anchor name
-						newWin.location = url + '#' + (info.title.indexOf('[') == 0? 'id-' : '') + encodeURI(info.title.replace(/\s/g, '') + '-' + anchor.replace(/\s/g, ''));
+						//We assume the new editor for simplicity
+						newWin.location = url + '#' + encodeURIComponent(anchor.replace(/\s/g, '-'));
 					}
 				}, function()
 				{

+ 9 - 9
src/main/webapp/resources/dia_es.txt

@@ -788,15 +788,15 @@ venndiagrams=Diagramas de Venn
 webEmailOrOther=Web, correo electrónico o cualquier otra dirección de internet
 webLink=Enlace web
 wireframes=Esquemas
-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=Propiedad
+value=Valor
+showMore=Mostrar más
+showLess=Mostrar menos
+myDiagrams=Mis diagramas
+allDiagrams=Todos los diagramas
+recentlyUsed=Usados recientemente
+listView=Vista de lista
+gridView=Vista de rejilla
 resultsFor=Results for '{1}'
 oneDriveCharsNotAllowed=The following characters are not allowed: ~ " # %  * : < > ? / \ { | }
 oneDriveInvalidDeviceName=The specified device name is invalid

File diff suppressed because it is too large
+ 1025 - 0
src/main/webapp/resources/dia_eu.txt


+ 31 - 3
src/main/webapp/service-worker.js

@@ -6,11 +6,11 @@ if (workbox)
 	workbox.precaching.precacheAndRoute([
   {
     "url": "js/app.min.js",
-    "revision": "1a26117d76b33a4b7a4698b254a12724"
+    "revision": "3d90d1d0f3bf400b5b41589e15c3ba7c"
   },
   {
     "url": "js/extensions.min.js",
-    "revision": "b6311ad55b3030c29977e2d8689eaa8e"
+    "revision": "ecd53ce33feef17a0ac6be648bfd056f"
   },
   {
     "url": "js/stencils.min.js",
@@ -118,7 +118,11 @@ if (workbox)
   },
   {
     "url": "resources/dia_es.txt",
-    "revision": "92862faa5d77c00ddcffb79caa524975"
+    "revision": "94be775c840c8f010f21727e37a91c3e"
+  },
+  {
+    "url": "resources/dia_eu.txt",
+    "revision": "467b2121c8e2313421f81335d8bcd646"
   },
   {
     "url": "resources/dia_ko.txt",
@@ -376,6 +380,30 @@ if (workbox)
     "url": "images/osa_database.png",
     "revision": "c350d9d9b95f37b6cfe798b40ede5fb0"
   },
+  {
+    "url": "images/google-drive-logo-white.svg",
+    "revision": "f329d8b1be7778515a85b93fc35d9f26"
+  },
+  {
+    "url": "images/dropbox-logo-white.svg",
+    "revision": "4ea8299ac3bc31a16f199ee3aec223bf"
+  },
+  {
+    "url": "images/onedrive-logo-white.svg",
+    "revision": "b3602fa0fc947009cff3f33a581cff4d"
+  },
+  {
+    "url": "images/github-logo-white.svg",
+    "revision": "537b1127b3ca0f95b45782d1304fb77a"
+  },
+  {
+    "url": "images/gitlab-logo-white.svg",
+    "revision": "5fede9ac2f394c716b8c23e3fddc3910"
+  },
+  {
+    "url": "images/trello-logo-white-orange.svg",
+    "revision": "e2a0a52ba3766682f138138d10a75eb5"
+  },
   {
     "url": "images/logo-confluence.png",
     "revision": "ed1e55d44ae5eba8f999aba2c93e8331"