David Benson 3 роки тому
батько
коміт
7764b250b3
78 змінених файлів з 5081 додано та 5111 видалено
  1. 4 0
      ChangeLog
  2. 1 1
      VERSION
  3. 2 0
      src/main/java/com/mxgraph/online/EmbedServlet2.java
  4. 0 169
      src/main/java/com/mxgraph/online/ExportProxyServlet.java
  5. 0 14
      src/main/webapp/WEB-INF/web.xml
  6. 23 5
      src/main/webapp/electron.js
  7. 1370 1368
      src/main/webapp/js/app.min.js
  8. 5 0
      src/main/webapp/js/diagramly/ElectronApp.js
  9. 12 1
      src/main/webapp/js/diagramly/Menus.js
  10. 16 20
      src/main/webapp/js/diagramly/Minimal.js
  11. 52 36
      src/main/webapp/js/diagramly/sidebar/Sidebar.js
  12. 68 34
      src/main/webapp/js/grapheditor/Graph.js
  13. 1422 1420
      src/main/webapp/js/integrate.min.js
  14. 1021 1020
      src/main/webapp/js/viewer-static.min.js
  15. 1021 1020
      src/main/webapp/js/viewer.min.js
  16. 1 1
      src/main/webapp/mxgraph/mxClient.js
  17. 1 0
      src/main/webapp/resources/dia.txt
  18. 1 0
      src/main/webapp/resources/dia_am.txt
  19. 1 0
      src/main/webapp/resources/dia_ar.txt
  20. 1 0
      src/main/webapp/resources/dia_bg.txt
  21. 1 0
      src/main/webapp/resources/dia_bn.txt
  22. 1 0
      src/main/webapp/resources/dia_bs.txt
  23. 1 0
      src/main/webapp/resources/dia_ca.txt
  24. 1 0
      src/main/webapp/resources/dia_cs.txt
  25. 1 0
      src/main/webapp/resources/dia_da.txt
  26. 1 0
      src/main/webapp/resources/dia_de.txt
  27. 1 0
      src/main/webapp/resources/dia_el.txt
  28. 1 0
      src/main/webapp/resources/dia_eo.txt
  29. 1 0
      src/main/webapp/resources/dia_es.txt
  30. 1 0
      src/main/webapp/resources/dia_et.txt
  31. 1 0
      src/main/webapp/resources/dia_eu.txt
  32. 1 0
      src/main/webapp/resources/dia_fa.txt
  33. 1 0
      src/main/webapp/resources/dia_fi.txt
  34. 1 0
      src/main/webapp/resources/dia_fil.txt
  35. 1 0
      src/main/webapp/resources/dia_fr.txt
  36. 1 0
      src/main/webapp/resources/dia_gl.txt
  37. 1 0
      src/main/webapp/resources/dia_gu.txt
  38. 1 0
      src/main/webapp/resources/dia_he.txt
  39. 1 0
      src/main/webapp/resources/dia_hi.txt
  40. 1 0
      src/main/webapp/resources/dia_hr.txt
  41. 1 0
      src/main/webapp/resources/dia_hu.txt
  42. 1 0
      src/main/webapp/resources/dia_i18n.txt
  43. 1 0
      src/main/webapp/resources/dia_id.txt
  44. 1 0
      src/main/webapp/resources/dia_it.txt
  45. 1 0
      src/main/webapp/resources/dia_ja.txt
  46. 1 0
      src/main/webapp/resources/dia_kn.txt
  47. 1 0
      src/main/webapp/resources/dia_ko.txt
  48. 1 0
      src/main/webapp/resources/dia_lt.txt
  49. 1 0
      src/main/webapp/resources/dia_lv.txt
  50. 1 0
      src/main/webapp/resources/dia_ml.txt
  51. 1 0
      src/main/webapp/resources/dia_mr.txt
  52. 1 0
      src/main/webapp/resources/dia_ms.txt
  53. 1 0
      src/main/webapp/resources/dia_my.txt
  54. 1 0
      src/main/webapp/resources/dia_nl.txt
  55. 1 0
      src/main/webapp/resources/dia_no.txt
  56. 1 0
      src/main/webapp/resources/dia_pl.txt
  57. 1 0
      src/main/webapp/resources/dia_pt-br.txt
  58. 1 0
      src/main/webapp/resources/dia_pt.txt
  59. 1 0
      src/main/webapp/resources/dia_ro.txt
  60. 1 0
      src/main/webapp/resources/dia_ru.txt
  61. 1 0
      src/main/webapp/resources/dia_si.txt
  62. 1 0
      src/main/webapp/resources/dia_sk.txt
  63. 1 0
      src/main/webapp/resources/dia_sl.txt
  64. 1 0
      src/main/webapp/resources/dia_sr.txt
  65. 1 0
      src/main/webapp/resources/dia_sv.txt
  66. 1 0
      src/main/webapp/resources/dia_sw.txt
  67. 1 0
      src/main/webapp/resources/dia_ta.txt
  68. 1 0
      src/main/webapp/resources/dia_te.txt
  69. 1 0
      src/main/webapp/resources/dia_th.txt
  70. 1 0
      src/main/webapp/resources/dia_tr.txt
  71. 1 0
      src/main/webapp/resources/dia_uk.txt
  72. 1 0
      src/main/webapp/resources/dia_vi.txt
  73. 1 0
      src/main/webapp/resources/dia_zh-tw.txt
  74. 1 0
      src/main/webapp/resources/dia_zh.txt
  75. 1 1
      src/main/webapp/service-worker.js
  76. 1 1
      src/main/webapp/service-worker.js.map
  77. 2 0
      src/main/webapp/workbox-50a29d49.js
  78. 1 0
      src/main/webapp/workbox-50a29d49.js.map

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+19-MAY-2022: 18.0.8
+
+- Deletes unused ExportProxyServlet
+
 17-MAY-2022: 18.0.7
 
 - Sets setInstanceFollowRedirects(false) in proxyservlet

+ 1 - 1
VERSION

@@ -1 +1 @@
-18.0.7
+18.0.8

+ 2 - 0
src/main/java/com/mxgraph/online/EmbedServlet2.java

@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PrintWriter;
+import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
 import java.text.DateFormat;
@@ -398,6 +399,7 @@ public class EmbedServlet2 extends HttpServlet
 						completed.add(urls[i]);
 						URL url = new URL(urls[i]);
 						URLConnection connection = url.openConnection();
+						((HttpURLConnection) connection).setInstanceFollowRedirects(false);
 						ByteArrayOutputStream stream = new ByteArrayOutputStream();
 						Utils.copy(connection.getInputStream(), stream);
 						setCachedUrls += "GraphViewer.cachedUrls['"

+ 0 - 169
src/main/java/com/mxgraph/online/ExportProxyServlet.java

@@ -1,169 +0,0 @@
-package com.mxgraph.online;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Servlet implementation ExportProxyServlet
- */
-@SuppressWarnings("serial")
-public class ExportProxyServlet extends HttpServlet
-{
-	private final String EXPORT_URL = "http://localhost:8000/";
-	
-	private final String[] supportedServices = {"EXPORT_URL", "PLANTUML_URL", "VSD_CONVERT_URL", "EMF_CONVERT_URL"};
-	
-	private void doRequest(String method, HttpServletRequest request,
-			HttpServletResponse response) throws ServletException, IOException
-	{
-		try
-		{
-			int serviceId = 0;
-			String proxyPath = "";
-			String queryString = "";
-			
-			try 
-			{
-				if (request.getQueryString() != null)
-				{
-					queryString = "?" + request.getQueryString(); 	
-				}
-				
-				if (request.getPathInfo() != null) // /{serviceId}/*
-				{
-					String[] pathParts = request.getPathInfo().split("/");
-	
-					if (pathParts.length > 1)
-					{
-						serviceId = Integer.parseInt(pathParts[1]);
-					}
-					
-					if (pathParts.length > 2)
-					{
-						proxyPath = String.join("/", Arrays.copyOfRange(pathParts, 2, pathParts.length));
-					}
-					
-					if (serviceId < 0 || serviceId > supportedServices.length)
-					{
-						serviceId = 0;
-					}
-				}
-			}
-			catch (Exception e) 
-			{
-				// Ignore and use 0
-			}
-			
-			String exportUrl = System.getenv(supportedServices[serviceId]);
-			
-			if (exportUrl == null)
-			{
-				exportUrl = EXPORT_URL;
-			}
-			
-			URL url = new URL(exportUrl + proxyPath + queryString);
-			HttpURLConnection con = (HttpURLConnection) url.openConnection();
-			
-			con.setRequestMethod(method);
-			
-			//Copy request headers to export server
-			Enumeration<String> headerNames = request.getHeaderNames();
-			 
-	        while (headerNames.hasMoreElements()) 
-	        {
-	            String headerName = headerNames.nextElement();
-	            Enumeration<String> headers = request.getHeaders(headerName);
-	            
-	            while (headers.hasMoreElements()) 
-	            {
-	                String headerValue = headers.nextElement();
-	                con.addRequestProperty(headerName, headerValue);
-	            }
-	        }
-	        
-	        if ("POST".equals(method))
-	        {
-				// Send post request
-				con.setDoOutput(true);
-				
-				OutputStream params = con.getOutputStream();
-				Utils.copy(request.getInputStream(), params);
-				params.flush();
-				params.close();
-	        }
-	        
-	        int responseCode = con.getResponseCode();
-			//Copy response code
-			response.setStatus(responseCode);
-			
-			//Copy response headers
-			Map<String, List<String>> map = con.getHeaderFields();
-			
-			for (Map.Entry<String, List<String>> entry : map.entrySet()) 
-			{
-				String key = entry.getKey();
-				
-				if (key != null)
-				{
-					for (String val : entry.getValue())
-					{	
-						
-						response.addHeader(entry.getKey(), val);
-					}
-				}
-			}
-			
-			//Copy response
-			OutputStream out = response.getOutputStream();
-			
-			//Error
-			if (responseCode >= 400)
-			{
-				Utils.copy(con.getErrorStream(), out);
-			}
-			else //Success
-			{
-				Utils.copy(con.getInputStream(), out);
-			}
-			
-			out.flush();
-			out.close();
-		}
-		catch (Exception e)
-		{
-			response.setStatus(
-					HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-			e.printStackTrace();
-		}
-	}
-
-	
-	/**
-	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
-	 */
-	protected void doGet(HttpServletRequest request,
-			HttpServletResponse response) throws ServletException, IOException
-	{
-		doRequest("GET", request, response);
-	}
-	
-	/**
-	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
-	 */
-	protected void doPost(HttpServletRequest request,
-	HttpServletResponse response) throws ServletException, IOException
-	{
-		doRequest("POST", request, response);
-	}
-}

+ 0 - 14
src/main/webapp/WEB-INF/web.xml

@@ -95,20 +95,6 @@
     <servlet-name>ConverterServlet</servlet-name>
     <url-pattern>/convert</url-pattern>
   </servlet-mapping>
-  <servlet>
-    <description/>
-    <display-name>ExportProxyServlet</display-name>
-    <servlet-name>ExportProxyServlet</servlet-name>
-    <servlet-class>com.mxgraph.online.ExportProxyServlet</servlet-class>
-  </servlet>
-  <servlet-mapping>
-    <servlet-name>ExportProxyServlet</servlet-name>
-    <url-pattern>/export</url-pattern>
-  </servlet-mapping>
-  <servlet-mapping>
-    <servlet-name>ExportProxyServlet</servlet-name>
-    <url-pattern>/service/*</url-pattern>
-  </servlet-mapping>
   <servlet>
     <description/>
     <display-name>GitlabAuthServlet</display-name>

+ 23 - 5
src/main/webapp/electron.js

@@ -38,6 +38,7 @@ const isMac = process.platform === 'darwin'
 const isWin = process.platform === 'win32'
 let enableSpellCheck = store.get('enableSpellCheck');
 enableSpellCheck = enableSpellCheck != null? enableSpellCheck : isMac;
+let enableStoreBkp = store.get('enableStoreBkp') != null? store.get('enableStoreBkp') : true;
 
 //Read config file
 var queryObj = {
@@ -55,7 +56,8 @@ var queryObj = {
 	'export': 'https://convert.diagrams.net/node/export',
 	'disableUpdate': disableUpdate? 1 : 0,
 	'winCtrls': isMac? 0 : 1,
-	'enableSpellCheck': enableSpellCheck? 1 : 0
+	'enableSpellCheck': enableSpellCheck? 1 : 0,
+	'enableStoreBkp': enableStoreBkp? 1 : 0
 };
 
 try
@@ -75,6 +77,9 @@ catch(e)
 	console.log('Error in urlParams.json file: ' + e.message);
 }
 
+// Trying sandboxing the renderer for more protection
+app.enableSandbox();
+
 function createWindow (opt = {})
 {
 	let lastWinSizeStr = store.get('lastWinSize');
@@ -93,7 +98,7 @@ function createWindow (opt = {})
 			preload: `${__dirname}/electron-preload.js`,
 			spellcheck: enableSpellCheck,
 			contextIsolation: true,
-			disableBlinkFeatures: 'Auxclick'
+			disableBlinkFeatures: 'Auxclick' // Is this needed?
 		}
 	}, opt)
 
@@ -300,7 +305,7 @@ app.on('ready', e =>
 			webPreferences: {
 				preload: `${__dirname}/electron-preload.js`,
 				contextIsolation: true,
-				disableBlinkFeatures: 'Auxclick'
+				disableBlinkFeatures: 'Auxclick' // Is this needed?
 			}
 		});
     	
@@ -687,6 +692,14 @@ app.on('ready', e =>
 
 	ipcMain.on('toggleSpellCheck', toggleSpellCheck);
 
+	function toggleStoreBkp()
+	{
+		enableStoreBkp = !enableStoreBkp;
+		store.set('enableStoreBkp', enableStoreBkp);
+	};
+
+	ipcMain.on('toggleStoreBkp', toggleStoreBkp);
+
     let updateNoAvailAdded = false;
     
 	function checkForUpdatesFn() 
@@ -880,6 +893,11 @@ app.on('web-contents-created', (event, contents) => {
 			return {action: 'deny'}
 		}
 	})
+
+	// Disable all webviews
+	contents.on('will-attach-webview', (event, webPreferences, params) => {
+		event.preventDefault()
+	})
 })
 
 autoUpdater.on('error', e => log.error('@error@\n', e))
@@ -1260,7 +1278,7 @@ function exportDiagram(event, args, directFinalize)
 				preload: `${__dirname}/electron-preload.js`,
 				backgroundThrottling: false,
 				contextIsolation: true,
-				disableBlinkFeatures: 'Auxclick'
+				disableBlinkFeatures: 'Auxclick' // Is this needed?
 			},
 			show : false,
 			frame: false,
@@ -1680,7 +1698,7 @@ async function saveFile(fileObject, data, origStat, overwrite, defEnc)
 	
 	async function doSaveFile(isNew)
 	{
-		if (!isNew)
+		if (enableStoreBkp && !isNew)
 		{
 			//Copy file to backup file (after conflict and stat is checked)
 			let bkpFh;

Різницю між файлами не показано, бо вона завелика
+ 1370 - 1368
src/main/webapp/js/app.min.js


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

@@ -1776,6 +1776,11 @@ mxStencilRegistry.allowEval = false;
 	{
 		electron.sendMessage('toggleSpellCheck');
 	}
+
+	App.prototype.toggleStoreBkp = function()
+	{
+		electron.sendMessage('toggleStoreBkp');
+	}
 	
 	App.prototype.openDevTools = function()
 	{

+ 12 - 1
src/main/webapp/js/diagramly/Menus.js

@@ -3834,6 +3834,17 @@
 			spellCheckAction.setToggleAction(true);
 			spellCheckAction.setSelectedCallback(function() { return enableSpellCheck; });
 
+			var enableStoreBkp = urlParams['enableStoreBkp'] == '1';
+
+			var storeBkpAction = editorUi.actions.addAction('autoBkp', function()
+			{
+				editorUi.toggleStoreBkp();
+				enableStoreBkp = !enableStoreBkp;
+			});
+			
+			storeBkpAction.setToggleAction(true);
+			storeBkpAction.setSelectedCallback(function() { return enableStoreBkp; });
+
 			editorUi.actions.addAction('openDevTools', function()
 			{
 				editorUi.openDevTools();
@@ -3866,7 +3877,7 @@
 	
 			if (EditorUi.isElectronApp)
 			{
-				this.addMenuItems(menu, ['spellCheck'], parent);	
+				this.addMenuItems(menu, ['spellCheck', 'autoBkp'], parent);	
 			}
 
 			this.addMenuItems(menu, ['copyConnect', 'collapseExpand', '-'], parent);

+ 16 - 20
src/main/webapp/js/diagramly/Minimal.js

@@ -1263,12 +1263,6 @@ EditorUi.initMinimalTheme = function()
 			{
 				menu.addSeparator(parent);
 
-				if (file.isRealtimeEnabled() && file.isRealtimeSupported())
-				{
-					this.addMenuItems(menu, ['showRemoteCursors',
-						'shareCursor'], parent);
-				}
-
 				if (file.constructor == DriveFile)
 				{
 					ui.menus.addMenuItems(menu, ['share'], parent);
@@ -1341,13 +1335,7 @@ EditorUi.initMinimalTheme = function()
 					menu.addSeparator(parent);
 
 					if (file != null)
-					{
-						if (file.isRealtimeEnabled() && file.isRealtimeSupported())
-						{
-							this.addMenuItems(menu, ['showRemoteCursors',
-								'shareCursor'], parent);
-						}
-									
+					{		
 						if (file.constructor == DriveFile)
 						{
 							ui.menus.addMenuItems(menu, ['share'], parent);
@@ -1551,13 +1539,21 @@ EditorUi.initMinimalTheme = function()
 				{
 					ui.menus.addMenuItem(menu, 'plugins', parent);
 				}
-	
-				menu.addSeparator(parent);
-				
-				if (ui.mode != App.MODE_ATLAS) 
-				{
-					this.addMenuItems(menu, ['fullscreen'], parent);
-				}	
+			}
+
+			var file = ui.getCurrentFile();
+			
+			if (file != null && file.isRealtimeEnabled() && file.isRealtimeSupported())
+			{
+				this.addMenuItems(menu, ['-', 'showRemoteCursors',
+					'shareCursor', '-'], parent);
+			}
+			
+			menu.addSeparator(parent);
+
+			if (urlParams['sketch'] != '1' && ui.mode != App.MODE_ATLAS) 
+			{
+				this.addMenuItems(menu, ['fullscreen'], parent);
 			}
 
 			if (urlParams['embedInline'] != '1' && Editor.isDarkMode() ||

+ 52 - 36
src/main/webapp/js/diagramly/sidebar/Sidebar.js

@@ -300,7 +300,8 @@
 		
 		if (elts != null)
 		{
-			var vis = (visible != null) ? ((visible) ? 'block' : 'none') : (elts[0].style.display == 'none') ? 'block' : 'none';
+			var vis = (visible != null) ? ((visible) ? 'block' : 'none') :
+				(elts[0].style.display == 'none') ? 'block' : 'none';
 			
 			for (var i = 0; i < elts.length; i++)
 			{
@@ -612,44 +613,59 @@
 			{
 				if (mxEvent.getSource(evt).nodeName == 'BUTTON')
 				{
-					var title2 = title.cloneNode(true);
-					title2.style.backgroundImage = '';
-					title2.style.textDecoration = 'none';
-					title2.style.fontWeight = 'bold';
-					title2.style.fontSize = '14px';
-					title2.style.color = 'rgb(80, 80, 80)';
-					title2.style.width = '456px';
-					title2.style.backgroundColor = '#ffffff';
-					title2.style.paddingLeft = '6px';
+					var svgs = content.getElementsByTagName('svg');
+					var w = 456;
+					var h = (Math.ceil(svgs.length / 6) + 1) * this.thumbHeight;
+					var root = Graph.createSvgNode(0, 0, w, h, '#ffffff');
 					
-					var btn2 = title2.getElementsByTagName('button')[0];
-					btn2.parentNode.removeChild(btn2);
-					
-					var clone = content.cloneNode(true);
-					clone.style.backgroundColor = '#ffffff';
-					clone.style.borderColor = 'transparent';
-					clone.style.width = '456px';
-	
-					var parser = new DOMParser();
-					var doc = parser.parseFromString('<body style="background:#ffffff;font-family:Helvetica,Arial;">' +
-							title2.outerHTML + clone.outerHTML + '</body>', 'text/html');
-					
-					this.editorUi.editor.convertImages(doc.documentElement, mxUtils.bind(this, function(body)
+					// Adds title
+					var canvas = new mxSvgCanvas2D(root);
+					canvas.setFontFamily(mxConstants.DEFAULT_FONTFAMILY);
+					canvas.setFontStyle(mxConstants.FONT_BOLD);
+					canvas.setFontColor('rgb(80, 80, 80)');
+					canvas.setFontSize(14);
+
+					// Extracts title text
+					var children = title.childNodes;
+
+					for (var i = 0; i < children.length; i++)
 					{
-						var html = '<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" ' +
-							'href="https://www.draw.io/styles/grapheditor.css"></head>' +
-							mxUtils.getXml(body) + '</html>';
-		
-						clone.style.position = 'absolute';
-						window.document.body.appendChild(clone);
-						var h = clone.clientHeight + 18;
-						clone.parentNode.removeChild(clone);
-						
-						this.editorUi.confirm('Image data created', mxUtils.bind(this, function()
+						if (children[i].nodeType == mxConstants.NODETYPE_TEXT)
 						{
-				    		new mxXmlRequest(EXPORT_URL, 'w=456&h=' + h + '&html=' + encodeURIComponent(
-				    			Graph.compress(html))).simulate(document, '_blank');
-						}), null, mxResources.get('save'), mxResources.get('cancel'));
+							canvas.plainText(6, 0, 0, 0, mxUtils.getTextContent(children[i]));
+
+							break;
+						}
+					}
+
+					for (var i = 0; i < svgs.length; i++)
+					{
+						var svg = svgs[i];
+						var clone = svg.cloneNode(true);
+						clone.removeAttribute('style');
+						clone.setAttribute('width', this.thumbWidth);
+						clone.setAttribute('height', this.thumbHeight);
+						clone.setAttribute('x', 12 + mxUtils.mod(i, 6) * 68);
+						clone.setAttribute('y', 24 + Math.floor(i / 6) * 68);
+						root.appendChild(clone);
+					}
+
+					this.editorUi.editor.convertImages(root, mxUtils.bind(this, function(body)
+					{
+						var canvas = document.createElement('canvas');
+						canvas.width = w;
+						canvas.height = h;
+					
+						var img = document.createElement('img');
+						img.onload = mxUtils.bind(this, function()
+						{
+							var ctx = canvas.getContext('2d');
+							ctx.drawImage(img, 0, 0)
+							this.editorUi.saveCanvas(canvas, null, 'png');
+						});
+
+						var xml = Graph.xmlDeclaration + '\n' + Graph.svgDoctype + '\n' + mxUtils.getXml(root);
+						img.src = Editor.createSvgDataUri(xml);
 					}));
 					
 					return;

+ 68 - 34
src/main/webapp/js/grapheditor/Graph.js

@@ -1381,6 +1381,70 @@ Graph.createSvgImage = function(w, h, data, coordWidth, coordHeight)
 
     return new mxImage('data:image/svg+xml;base64,' + ((window.btoa) ? btoa(tmp) : Base64.encode(tmp, true)), w, h)
 };
+ 
+/**
+ * Helper function for creating an SVG node.
+ */
+Graph.createSvgNode = function(x, y, w, h, background)
+{
+	var svgDoc = mxUtils.createXmlDocument();
+	var root = (svgDoc.createElementNS != null) ?
+		svgDoc.createElementNS(mxConstants.NS_SVG, 'svg') :
+		svgDoc.createElement('svg');
+	
+	if (background != null)
+	{
+		if (root.style != null)
+		{
+			root.style.backgroundColor = background;
+		}
+		else
+		{
+			root.setAttribute('style', 'background-color:' + background);
+		}
+	}
+	
+	if (svgDoc.createElementNS == null)
+	{
+		root.setAttribute('xmlns', mxConstants.NS_SVG);
+		root.setAttribute('xmlns:xlink', mxConstants.NS_XLINK);
+	}
+	else
+	{
+		// KNOWN: Ignored in IE9-11, adds namespace for each image element instead. No workaround.
+		root.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xlink', mxConstants.NS_XLINK);
+	}
+
+	root.setAttribute('version', '1.1');
+	root.setAttribute('width', w + 'px');
+	root.setAttribute('height', h + 'px');
+	root.setAttribute('viewBox', x + ' ' + y + ' ' + w + ' ' + h);
+	svgDoc.appendChild(root);
+
+	return root;
+};
+ 
+/**
+ * Helper function for creating an SVG node.
+ */
+Graph.htmlToPng = function(html, w, h, fn)
+{
+	var canvas = document.createElement('canvas');
+	canvas.width = w;
+	canvas.height = h;
+
+	var img = document.createElement('img');
+	img.onload = mxUtils.bind(this, function()
+	{
+		var ctx = canvas.getContext('2d');
+		ctx.drawImage(img, 0, 0)
+
+		fn(canvas.toDataURL());
+	});
+
+	img.src = 'data:image/svg+xml,' + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">' +
+		'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml"><style>em{color:red;}</style><em>I</em> lick <span>cheese</span></div></foreignObject></svg>');
+};
 
 /**
  * Removes all illegal control characters with ASCII code <32 except TAB, LF
@@ -10081,45 +10145,15 @@ if (typeof mxVertexHandler !== 'undefined')
 				}
 	
 				// Prepares SVG document that holds the output
-				var svgDoc = mxUtils.createXmlDocument();
-				var root = (svgDoc.createElementNS != null) ?
-			    	svgDoc.createElementNS(mxConstants.NS_SVG, 'svg') : svgDoc.createElement('svg');
-			    
-				if (background != null)
-				{
-					if (root.style != null)
-					{
-						root.style.backgroundColor = background;
-					}
-					else
-					{
-						root.setAttribute('style', 'background-color:' + background);
-					}
-				}
-			    
-				if (svgDoc.createElementNS == null)
-				{
-			    	root.setAttribute('xmlns', mxConstants.NS_SVG);
-			    	root.setAttribute('xmlns:xlink', mxConstants.NS_XLINK);
-				}
-				else
-				{
-					// KNOWN: Ignored in IE9-11, adds namespace for each image element instead. No workaround.
-					root.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xlink', mxConstants.NS_XLINK);
-				}
-
 				var s = scale / vs;
 				var w = Math.max(1, Math.ceil(bounds.width * s) + 2 * border) +
 					((hasShadow && border == 0) ? 5 : 0);
 				var h = Math.max(1, Math.ceil(bounds.height * s) + 2 * border) +
 					((hasShadow && border == 0) ? 5 : 0);
-				
-				root.setAttribute('version', '1.1');
-				root.setAttribute('width', w + 'px');
-				root.setAttribute('height', h + 'px');
-				root.setAttribute('viewBox', ((crisp) ? '-0.5 -0.5' : '0 0') + ' ' + w + ' ' + h);
-				svgDoc.appendChild(root);
-			
+				var tmp = (crisp) ? -0.5 : 0;
+				var root = Graph.createSvgNode(tmp, tmp, w, h, background);
+				var svgDoc = root.ownerDocument;
+
 			    // Renders graph. Offset will be multiplied with state's scale when painting state.
 				// TextOffset only seems to affect FF output but used everywhere for consistency.
 				var group = (svgDoc.createElementNS != null) ?

Різницю між файлами не показано, бо вона завелика
+ 1422 - 1420
src/main/webapp/js/integrate.min.js


Різницю між файлами не показано, бо вона завелика
+ 1021 - 1020
src/main/webapp/js/viewer-static.min.js


Різницю між файлами не показано, бо вона завелика
+ 1021 - 1020
src/main/webapp/js/viewer.min.js


Різницю між файлами не показано, бо вона завелика
+ 1 - 1
src/main/webapp/mxgraph/mxClient.js


+ 1 - 0
src/main/webapp/resources/dia.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

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

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

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

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_bg.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_bn.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_bs.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ca.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_cs.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_da.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_de.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_el.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_eo.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_es.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_et.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_eu.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_fa.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_fi.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_fil.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_fr.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_gl.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_gu.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_he.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_hi.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_hr.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_hu.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_i18n.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=confAFileCleanFailed
 confACleanOnly=confACleanOnly
 brush=brush
 openDevTools=openDevTools
+autoBkp=autoBkp

+ 1 - 0
src/main/webapp/resources/dia_id.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_it.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ja.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_kn.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ko.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=임시 저장 다이어그램 "{1}" 삭제를 실패하였
 confACleanOnly=임시 저장된 다이어그램만 삭제
 brush=브러시
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_lt.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_lv.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ml.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_mr.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ms.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_my.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_nl.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Oude versies opschonen van diagram concept "{1}" mislukt
 confACleanOnly=Alleen diagram concepten opschonen
 brush=Kwast
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_no.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_pl.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_pt-br.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_pt.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ro.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ru.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_si.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_sk.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_sl.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_sr.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_sv.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_sw.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_ta.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_te.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_th.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_tr.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_uk.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Чищення старих версій чернеток 
 confACleanOnly=Чистити тільки чернетки діаграм
 brush=Пензлик
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_vi.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_zh-tw.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=筆刷
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

+ 1 - 0
src/main/webapp/resources/dia_zh.txt

@@ -1197,3 +1197,4 @@ confAFileCleanFailed=Cleaning diagram draft "{1}" failed
 confACleanOnly=Clean Diagram Drafts Only
 brush=Brush
 openDevTools=Open Developer Tools
+autoBkp=Automatic Backup

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
src/main/webapp/service-worker.js


Різницю між файлами не показано, бо вона завелика
+ 1 - 1
src/main/webapp/service-worker.js.map


Різницю між файлами не показано, бо вона завелика
+ 2 - 0
src/main/webapp/workbox-50a29d49.js


Різницю між файлами не показано, бо вона завелика
+ 1 - 0
src/main/webapp/workbox-50a29d49.js.map