David Benson vor 4 Jahren
Ursprung
Commit
7964a40d76
52 geänderte Dateien mit 2339 neuen und 2176 gelöschten Zeilen
  1. 0 2
      .github/workflows/build-release.yml
  2. 7 0
      ChangeLog
  3. 1 1
      VERSION
  4. 4 2
      src/main/java/com/mxgraph/online/AbsAuthServlet.java
  5. 1 1
      src/main/java/com/mxgraph/online/ConverterServlet.java
  6. 15 5
      src/main/java/com/mxgraph/online/DropboxAuthServlet.java
  7. 22 7
      src/main/java/com/mxgraph/online/GitHubAuthServlet.java
  8. 21 6
      src/main/java/com/mxgraph/online/GitlabAuthServlet.java
  9. 15 5
      src/main/java/com/mxgraph/online/GoogleAuthServlet.java
  10. 14 4
      src/main/java/com/mxgraph/online/MSGraphAuthServlet.java
  11. BIN
      src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.92.jar
  12. BIN
      src/main/webapp/WEB-INF/lib/javax.servlet-api-3.1.0.jar
  13. BIN
      src/main/webapp/WEB-INF/lib/pusher-http-java-1.1.0.jar
  14. 1 0
      src/main/webapp/WEB-INF/secrets/atlas_client_id
  15. 1 0
      src/main/webapp/WEB-INF/secrets/atlas_client_secret
  16. 1 0
      src/main/webapp/WEB-INF/secrets/cloud_convert_api_key
  17. 1 0
      src/main/webapp/WEB-INF/secrets/dropbox_client_id
  18. 1 0
      src/main/webapp/WEB-INF/secrets/dropbox_client_secret
  19. 0 0
      src/main/webapp/WEB-INF/secrets/github_auth_url
  20. 1 0
      src/main/webapp/WEB-INF/secrets/github_client_id
  21. 1 0
      src/main/webapp/WEB-INF/secrets/github_client_secret
  22. 0 0
      src/main/webapp/WEB-INF/secrets/gitlab_auth_url
  23. 1 0
      src/main/webapp/WEB-INF/secrets/gitlab_client_id
  24. 1 0
      src/main/webapp/WEB-INF/secrets/gitlab_client_secret
  25. 1 0
      src/main/webapp/WEB-INF/secrets/google_client_id
  26. 1 0
      src/main/webapp/WEB-INF/secrets/google_client_secret
  27. 1 0
      src/main/webapp/WEB-INF/secrets/iconfinder_client_id
  28. 1 0
      src/main/webapp/WEB-INF/secrets/iconfinder_client_secret
  29. 1 0
      src/main/webapp/WEB-INF/secrets/msgraph_client_id
  30. 1 0
      src/main/webapp/WEB-INF/secrets/msgraph_client_secret
  31. 1 0
      src/main/webapp/WEB-INF/secrets/old_github_client_secret
  32. 1 0
      src/main/webapp/WEB-INF/secrets/old_github_dev_client_secret
  33. 4 0
      src/main/webapp/WEB-INF/secrets/pusher.properties
  34. 13 2
      src/main/webapp/electron.js
  35. 731 730
      src/main/webapp/js/app.min.js
  36. 16 6
      src/main/webapp/js/diagramly/EditorUi.js
  37. 6 0
      src/main/webapp/js/diagramly/ElectronApp.js
  38. 44 24
      src/main/webapp/js/diagramly/Extensions.js
  39. 21 1
      src/main/webapp/js/diagramly/Menus.js
  40. 1 1
      src/main/webapp/js/diagramly/Minimal.js
  41. 655 654
      src/main/webapp/js/extensions.min.js
  42. 18 16
      src/main/webapp/js/grapheditor/Graph.js
  43. 3 1
      src/main/webapp/js/grapheditor/Shapes.js
  44. 344 343
      src/main/webapp/js/viewer-static.min.js
  45. 344 343
      src/main/webapp/js/viewer.min.js
  46. 1 1
      src/main/webapp/mxgraph/mxClient.js
  47. 1 1
      src/main/webapp/resources/dia_ar.txt
  48. 11 11
      src/main/webapp/resources/dia_cs.txt
  49. 3 3
      src/main/webapp/resources/dia_eu.txt
  50. 4 4
      src/main/webapp/resources/dia_it.txt
  51. 1 1
      src/main/webapp/service-worker.js
  52. 1 1
      src/main/webapp/service-worker.js.map

+ 0 - 2
.github/workflows/build-release.yml

@@ -2,8 +2,6 @@ name: Build & Release
 
 on:
   push:
-    paths:
-      - VERSION
       
 jobs:
   build:

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+23-DEC-2021: 16.1.0
+
+- Fixes inconsistent event cursors on table lines
+- Fixes default lanecolor for UML frame
+- [conf cloud] Reduces number of comments requests
+- Refactor structure of WEB-INF folder
+
 21-DEC-2021: 16.0.3
 
 - Adds Share and Comments in sketch File menu

+ 1 - 1
VERSION

@@ -1 +1 @@
-16.0.3
+16.1.0

+ 4 - 2
src/main/java/com/mxgraph/online/AbsAuthServlet.java

@@ -27,7 +27,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import com.google.appengine.api.memcache.MemcacheServiceException;
-import com.google.appengine.api.utils.SystemProperty;
 import com.google.gson.Gson;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
@@ -44,6 +43,9 @@ abstract public class AbsAuthServlet extends HttpServlet
 	private static final String TOKEN_COOKIE = "auth-token";
 	protected static final int STATE_COOKIE_AGE = 600; //10 min
 	protected static final int TOKEN_COOKIE_AGE = 31536000; //One year
+	public static boolean IS_GAE = (System.getProperty("com.google.appengine.runtime.version") == null) ? false : true;
+	public static String SECRETS_DIR_PATH = IS_GAE ? "/WEB-INF/secrets/" : "/WEB-INF/";
+
 	
 	
 	public static final SecureRandom random = new SecureRandom();
@@ -314,7 +316,7 @@ abstract public class AbsAuthServlet extends HttpServlet
 				response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
 			}
 			//Non GAE runtimes are excluded from state check. TODO Change GAE stub to return null from CacheFactory
-			else if (!"Non".equals(SystemProperty.environment.get()) && (stateToken == null || !stateToken.equals(cookieToken)))
+			else if (IS_GAE && (stateToken == null || !stateToken.equals(cookieToken)))
 			{
 				log.log(Level.WARNING, "AUTH-SERVLET: [" + request.getRemoteAddr() + "] STATE MISMATCH (state: " + stateToken + " != cookie: " + cookieToken + ")");
 				response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);

+ 1 - 1
src/main/java/com/mxgraph/online/ConverterServlet.java

@@ -36,7 +36,7 @@ public class ConverterServlet  extends HttpServlet
 	
 	private static final int MAX_DIM = 5000;
 	private static final double EMF_10thMM2PXL = 26.458;
-	private static final String API_KEY_FILE_PATH = "/WEB-INF/cloud_convert_api_key";
+	private static final String API_KEY_FILE_PATH = "/WEB-INF/cloud_convert_api_key"; // Not migrated to new pattern, since will not be used on diagrams.net
 	private static final String CONVERT_SERVICE_URL = "https://api.cloudconvert.com/convert";
 	private static final String CRLF = "\r\n";
 	private static final String TWO_HYPHENS = "--";

+ 15 - 5
src/main/java/com/mxgraph/online/DropboxAuthServlet.java

@@ -8,8 +8,8 @@ import java.io.IOException;
 @SuppressWarnings("serial")
 public class DropboxAuthServlet extends AbsAuthServlet
 {
-	public static String CLIENT_SECRET_FILE_PATH = "/WEB-INF/dropbox_client_secret";
-	public static String CLIENT_ID_FILE_PATH = "/WEB-INF/dropbox_client_id";
+	public static String CLIENT_SECRET_FILE_PATH = "dropbox_client_secret";
+	public static String CLIENT_ID_FILE_PATH = "dropbox_client_id";
 	
 	private static Config CONFIG = null;
 	
@@ -23,7 +23,7 @@ public class DropboxAuthServlet extends AbsAuthServlet
 			{
 				clientSerets = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_SECRET_FILE_PATH))
+								.getResourceAsStream(getSecretPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -35,7 +35,7 @@ public class DropboxAuthServlet extends AbsAuthServlet
 			{
 				clientIds = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_ID_FILE_PATH))
+								.getResourceAsStream(getIdPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -50,7 +50,17 @@ public class DropboxAuthServlet extends AbsAuthServlet
 		
 		return CONFIG;
 	}
-	
+
+	protected String getSecretPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_SECRET_FILE_PATH;
+	}
+
+	protected String getIdPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_ID_FILE_PATH;
+	}
+
 	public DropboxAuthServlet()
 	{
 		super();

+ 22 - 7
src/main/java/com/mxgraph/online/GitHubAuthServlet.java

@@ -8,9 +8,9 @@ import java.io.IOException;
 @SuppressWarnings("serial")
 public class GitHubAuthServlet extends AbsAuthServlet
 {
-	public static String CLIENT_SECRET_FILE_PATH = "/WEB-INF/github_client_secret";
-	public static String CLIENT_ID_FILE_PATH = "/WEB-INF/github_client_id";
-	public static String AUTH_SERVICE_URL_FILE_PATH = "/WEB-INF/github_auth_url";
+	public static String CLIENT_SECRET_FILE_PATH = "github_client_secret";
+	public static String CLIENT_ID_FILE_PATH = "github_client_id";
+	public static String AUTH_SERVICE_URL_FILE_PATH = "github_auth_url";
 	
 	private static Config CONFIG = null;
 	
@@ -24,7 +24,7 @@ public class GitHubAuthServlet extends AbsAuthServlet
 			{
 				clientSerets = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_SECRET_FILE_PATH))
+								.getResourceAsStream(getSecretPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -36,7 +36,7 @@ public class GitHubAuthServlet extends AbsAuthServlet
 			{
 				clientIds = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_ID_FILE_PATH))
+								.getResourceAsStream(getIdPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -50,7 +50,7 @@ public class GitHubAuthServlet extends AbsAuthServlet
 			{
 				CONFIG.AUTH_SERVICE_URL = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(AUTH_SERVICE_URL_FILE_PATH))
+								.getResourceAsStream(getServiceUrlPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -63,7 +63,22 @@ public class GitHubAuthServlet extends AbsAuthServlet
 		
 		return CONFIG;
 	}
-	
+
+	protected String getSecretPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_SECRET_FILE_PATH;
+	}
+
+	protected String getIdPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_ID_FILE_PATH;
+	}
+
+	protected String getServiceUrlPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + AUTH_SERVICE_URL_FILE_PATH;
+	}
+
 	public GitHubAuthServlet()
 	{
 		super();

+ 21 - 6
src/main/java/com/mxgraph/online/GitlabAuthServlet.java

@@ -8,9 +8,9 @@ import java.io.IOException;
 @SuppressWarnings("serial")
 public class GitlabAuthServlet extends AbsAuthServlet
 {
-	public static String CLIENT_SECRET_FILE_PATH = "/WEB-INF/gitlab_client_secret";
-	public static String CLIENT_ID_FILE_PATH = "/WEB-INF/gitlab_client_id";
-	public static String AUTH_SERVICE_URL_FILE_PATH = "/WEB-INF/gitlab_auth_url";
+	public static String CLIENT_SECRET_FILE_PATH = "gitlab_client_secret";
+	public static String CLIENT_ID_FILE_PATH = "gitlab_client_id";
+	public static String AUTH_SERVICE_URL_FILE_PATH = "gitlab_auth_url";
 	
 	private static Config CONFIG = null;
 	
@@ -24,7 +24,7 @@ public class GitlabAuthServlet extends AbsAuthServlet
 			{
 				clientSerets = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_SECRET_FILE_PATH))
+								.getResourceAsStream(getSecretPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -36,7 +36,7 @@ public class GitlabAuthServlet extends AbsAuthServlet
 			{
 				clientIds = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_ID_FILE_PATH))
+								.getResourceAsStream(getClientIdPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -50,7 +50,7 @@ public class GitlabAuthServlet extends AbsAuthServlet
 			{
 				CONFIG.AUTH_SERVICE_URL = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(AUTH_SERVICE_URL_FILE_PATH))
+								.getResourceAsStream(getServiceUrlPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -64,6 +64,21 @@ public class GitlabAuthServlet extends AbsAuthServlet
 		return CONFIG;
 	}
 	
+	protected String getSecretPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_SECRET_FILE_PATH;
+	}
+
+	protected String getClientIdPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_ID_FILE_PATH;
+	}
+
+	protected String getServiceUrlPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + AUTH_SERVICE_URL_FILE_PATH;
+	}
+
 	public GitlabAuthServlet()
 	{
 		super();

+ 15 - 5
src/main/java/com/mxgraph/online/GoogleAuthServlet.java

@@ -19,8 +19,8 @@ import com.google.gson.JsonElement;
 @SuppressWarnings("serial")
 public class GoogleAuthServlet extends AbsAuthServlet
 {
-	public static String CLIENT_SECRET_FILE_PATH = "/WEB-INF/google_client_secret";
-	public static String CLIENT_ID_FILE_PATH = "/WEB-INF/google_client_id";
+	public static String CLIENT_SECRET_FILE_PATH = "google_client_secret";
+	public static String CLIENT_ID_FILE_PATH = "google_client_id";
 	
 	private static Config CONFIG = null;
 	
@@ -34,7 +34,7 @@ public class GoogleAuthServlet extends AbsAuthServlet
 			{
 				clientSerets = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_SECRET_FILE_PATH))
+								.getResourceAsStream(getSecretPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -46,7 +46,7 @@ public class GoogleAuthServlet extends AbsAuthServlet
 			{
 				clientIds = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_ID_FILE_PATH))
+								.getResourceAsStream(getClientIdPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -61,7 +61,17 @@ public class GoogleAuthServlet extends AbsAuthServlet
 		
 		return CONFIG;
 	}
-	
+
+	protected String getSecretPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_SECRET_FILE_PATH;
+	}
+
+	protected String getClientIdPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_ID_FILE_PATH;
+	}
+
 	public GoogleAuthServlet()
 	{
 		super();

+ 14 - 4
src/main/java/com/mxgraph/online/MSGraphAuthServlet.java

@@ -8,8 +8,8 @@ import java.io.IOException;
 @SuppressWarnings("serial")
 public class MSGraphAuthServlet extends AbsAuthServlet
 {
-	public static String CLIENT_SECRET_FILE_PATH = "/WEB-INF/msgraph_client_secret";
-	public static String CLIENT_ID_FILE_PATH = "/WEB-INF/msgraph_client_id";
+	public static String CLIENT_SECRET_FILE_PATH = "msgraph_client_secret";
+	public static String CLIENT_ID_FILE_PATH = "msgraph_client_id";
 	
 	private static Config CONFIG = null;
 	
@@ -23,7 +23,7 @@ public class MSGraphAuthServlet extends AbsAuthServlet
 			{
 				clientSerets = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_SECRET_FILE_PATH))
+								.getResourceAsStream(getSecretPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -35,7 +35,7 @@ public class MSGraphAuthServlet extends AbsAuthServlet
 			{
 				clientIds = Utils
 						.readInputStream(getServletContext()
-								.getResourceAsStream(CLIENT_ID_FILE_PATH))
+								.getResourceAsStream(getIdPath()))
 						.replaceAll("\n", "");
 			}
 			catch (IOException e)
@@ -51,6 +51,16 @@ public class MSGraphAuthServlet extends AbsAuthServlet
 		return CONFIG;
 	}	
 
+	protected String getSecretPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_SECRET_FILE_PATH;
+	}
+
+	protected String getIdPath()
+	{
+		return AbsAuthServlet.SECRETS_DIR_PATH + CLIENT_ID_FILE_PATH;
+	}
+
 	public MSGraphAuthServlet() 
 	{
 		super();

BIN
src/main/webapp/WEB-INF/lib/appengine-api-1.0-sdk-1.9.92.jar


BIN
src/main/webapp/WEB-INF/lib/javax.servlet-api-3.1.0.jar


BIN
src/main/webapp/WEB-INF/lib/pusher-http-java-1.1.0.jar


+ 1 - 0
src/main/webapp/WEB-INF/secrets/atlas_client_id

@@ -0,0 +1 @@
+9KeGVvzyTGTf7SirRRfjvClOF7O7palj/:::/d59TBShpA0bBEEUCHNm2wIHGwj9WNdWl

+ 1 - 0
src/main/webapp/WEB-INF/secrets/atlas_client_secret

@@ -0,0 +1 @@
+cTj3hgfz640aiDqyET2TWEwx-zmQ46aFlObQkUgtDPcKV0n_33wrEc6QLX8csv7_/:::/_bM2FeXeCLL0oeiyaG8SHG8VQ5gFqptudXwI05WW06kn00GV9w0W4Q__cRlYoQK-

+ 1 - 0
src/main/webapp/WEB-INF/secrets/cloud_convert_api_key

@@ -0,0 +1 @@
+FTqrd43mhNIBDcM2ui2zOrZhvkebm7wha3U5OyAbyv2Q2cWMoDsH1h7tiVihFkLT

+ 1 - 0
src/main/webapp/WEB-INF/secrets/dropbox_client_id

@@ -0,0 +1 @@
+libwls2fa9szdji

+ 1 - 0
src/main/webapp/WEB-INF/secrets/dropbox_client_secret

@@ -0,0 +1 @@
+geznqz5ylfn2bs6

src/main/webapp/WEB-INF/github_auth_url → src/main/webapp/WEB-INF/secrets/github_auth_url


+ 1 - 0
src/main/webapp/WEB-INF/secrets/github_client_id

@@ -0,0 +1 @@
+4f88e2ec436d76c2ee6e/:::/23bc97120b9035515661/:::/Iv1.98d62f0431e40543/:::/Iv1.1218f5567fbc258a

+ 1 - 0
src/main/webapp/WEB-INF/secrets/github_client_secret

@@ -0,0 +1 @@
+28c554413feab0197ce6811b307bfabc280fce0f/:::/9e2e963a74bd42130a443081ff8441c1e8c5077e/:::/04154a64ffae857408ceaab91e830905e1ef7170/:::/933b28017e57d85b45dd127712de9b1f475bfdcb

src/main/webapp/WEB-INF/gitlab_auth_url → src/main/webapp/WEB-INF/secrets/gitlab_auth_url


+ 1 - 0
src/main/webapp/WEB-INF/secrets/gitlab_client_id

@@ -0,0 +1 @@
+c9b9d3fcdce2dec7abe3ab21ad8123d89ac272abb7d0883f08923043e80f3e36

+ 1 - 0
src/main/webapp/WEB-INF/secrets/gitlab_client_secret

@@ -0,0 +1 @@
+7ac6a0640bf2e622a68db8739bee012b310fcb6efd98d7a0b2c176869ad12831

+ 1 - 0
src/main/webapp/WEB-INF/secrets/google_client_id

@@ -0,0 +1 @@
+850530949725.apps.googleusercontent.com/:::/671128082532-jhphbq6d0e1gnsus9mn7vf8a6fjn10mp.apps.googleusercontent.com/:::/184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com

+ 1 - 0
src/main/webapp/WEB-INF/secrets/google_client_secret

@@ -0,0 +1 @@
+XtzCF2u3gSCKYr7GrKPrztID/:::/p3a9HEMaJN-OQFPo1cxi4Qxr/:::/jSvG60YtPyde__8vhy5NlQuE

+ 1 - 0
src/main/webapp/WEB-INF/secrets/iconfinder_client_id

@@ -0,0 +1 @@
+68HG47bBWRxn4hz9h59FqGmv1vT0WNv4ytVhX7eU7tzE7snQ3ARQUNZHGrincJzZ

+ 1 - 0
src/main/webapp/WEB-INF/secrets/iconfinder_client_secret

@@ -0,0 +1 @@
+PzEwBnRuQ7UPGGOy70gYu3MyxxdAlvLBqju2HDxt0OfRNZjfdUyfquPzJXSWIluK

+ 1 - 0
src/main/webapp/WEB-INF/secrets/msgraph_client_id

@@ -0,0 +1 @@
+45c10911-200f-4e27-a666-9e9fca147395/:::/aae1c620-4caf-41b3-9633-f6d0b6347dd9/:::/1afa9b7e-2533-4d86-83c0-c4d4678eca0e/:::/2e598409-107f-4b59-89ca-d7723c8e00a4/:::/b5ff67d6-3155-4fca-965a-59a3655c4476/:::/417a451a-a343-4788-b6c1-901e63182565

+ 1 - 0
src/main/webapp/WEB-INF/secrets/msgraph_client_secret

@@ -0,0 +1 @@
+soqneEMSQGP322-~!qyF71%/:::/pCXkg8bOQ_oN/v/lexxn-CH6BfcrcK99/:::/ye:A.XZ7lJ[ersdyLn5-kA497oAcVIAr/:::/cpSCY193#^?jrruaVOTV71:/:::/xV@@F8C-Hq/h8SL09qx]vyB?GxZ.8SZ3/:::/FGf7Q~izSDqfJ6YLcpu~QrpdxqiUfzvJeSz5g

+ 1 - 0
src/main/webapp/WEB-INF/secrets/old_github_client_secret

@@ -0,0 +1 @@
+49f05824e20a11b6a861dc0e3f99c39549c711ce

+ 1 - 0
src/main/webapp/WEB-INF/secrets/old_github_dev_client_secret

@@ -0,0 +1 @@
+9e2e963a74bd42130a443081ff8441c1e8c5077e

+ 4 - 0
src/main/webapp/WEB-INF/secrets/pusher.properties

@@ -0,0 +1,4 @@
+app_id=654360
+key=1e756b07a690c5bdb054
+secret=860f452fe477026ff01f
+cluster=eu

+ 13 - 2
src/main/webapp/electron.js

@@ -39,6 +39,8 @@ let cmdQPressed = false
 let firstWinLoaded = false
 let firstWinFilePath = null
 let isMac = process.platform === 'darwin'
+let enableSpellCheck = store.get('enableSpellCheck');
+enableSpellCheck = enableSpellCheck != null? enableSpellCheck : isMac;
 
 //Read config file
 var queryObj = {
@@ -55,7 +57,8 @@ var queryObj = {
 	'mode': 'device',
 	'export': 'https://convert.diagrams.net/node/export',
 	'disableUpdate': disableUpdate? 1 : 0,
-	'winCtrls': isMac? 0 : 1
+	'winCtrls': isMac? 0 : 1,
+	'enableSpellCheck': enableSpellCheck? 1 : 0
 };
 
 try
@@ -89,7 +92,7 @@ function createWindow (opt = {})
 			// preload: path.resolve('./preload.js'),
 			nodeIntegration: true,
 			nodeIntegrationInWorker: true,
-			spellcheck: isMac,
+			spellcheck: enableSpellCheck,
 			contextIsolation: false,
 			nativeWindowOpen: true
 		}
@@ -666,6 +669,14 @@ app.on('ready', e =>
 		loadFinished();
     });
 	
+	function toggleSpellCheck()
+	{
+		enableSpellCheck = !enableSpellCheck;
+		store.set('enableSpellCheck', enableSpellCheck);
+	};
+
+	ipcMain.on('toggleSpellCheck', toggleSpellCheck);
+
     let updateNoAvailAdded = false;
     
 	function checkForUpdatesFn() 

Datei-Diff unterdrückt, da er zu groß ist
+ 731 - 730
src/main/webapp/js/app.min.js


+ 16 - 6
src/main/webapp/js/diagramly/EditorUi.js

@@ -8866,22 +8866,32 @@
 	 * Filename is an optional parameter for blobs (that do not have a filename).
 	 */
 	EditorUi.prototype.parseFile = function(file, fn, filename)
+	{
+		var reader = new FileReader();
+
+        reader.onload = mxUtils.bind(this, function()
+		{
+			this.parseFileData(reader.result, fn, filename)
+        });
+
+        reader.readAsText(file);
+	};
+
+	//TODO Use this version of the function instead of creating a Blob then read it again
+	EditorUi.prototype.parseFileData = function(data, fn, filename)
 	{
 		filename = (filename != null) ? filename : file.name;
-		
-		var formData = new FormData();
-		formData.append('format', 'xml');
-		formData.append('upfile', file, filename);
 
 		var xhr = new XMLHttpRequest();
 		xhr.open('POST', OPEN_URL);
-		
+		xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+
 		xhr.onreadystatechange = function()
 		{
 			fn(xhr);
 		};
 		
-		xhr.send(formData);
+		xhr.send('format=xml&filename=' + encodeURIComponent(filename) + '&data=' + encodeURIComponent(data));
 		
 		try
 		{

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

@@ -1712,6 +1712,12 @@ mxStencilRegistry.allowEval = false;
 		ipcRenderer.send('checkForUpdates');
 	}
 	
+	App.prototype.toggleSpellCheck = function()
+	{
+		const ipcRenderer = require('electron').ipcRenderer;
+		ipcRenderer.send('toggleSpellCheck');
+	}
+	
 	var origUpdateHeader = App.prototype.updateHeader;
 	
 	App.prototype.updateHeader = function()

+ 44 - 24
src/main/webapp/js/diagramly/Extensions.js

@@ -4104,7 +4104,8 @@ LucidImporter = {};
 					str += 'color:' + color + ';';
 				}
 				
-				if (fontSize != null)
+				//Ignore zero font-size
+				if (fontSize)
 				{
 					str += 'font-size:' + fix1Digit(fontSize * scale) + 'px;';
 				}
@@ -4187,7 +4188,8 @@ LucidImporter = {};
 			openTags.push('span');
 			tagCount++;
 
-			str += 'font-size:' + (styles['s']? fix1Digit(styles['s'].v * scale) : defaultFontSize) + 'px;';
+			//Ignore zero font-size
+			str += 'font-size:' + (styles['s'] && styles['s'].v? fix1Digit(styles['s'].v * scale) : defaultFontSize) + 'px;';
 
 			if (styles['c'])
 			{
@@ -4804,7 +4806,7 @@ LucidImporter = {};
 				
 				if (currM.n == 's')
 				{
-					if (currM.v != null)
+					if (currM.v) //Ignore zero value also
 					{
 						isV = true;
 						
@@ -5717,7 +5719,11 @@ LucidImporter = {};
 					}
 					var isCurved = p.Shape == 'curve';
 					
-					if (p.Shape != 'diagonal')
+					if (isCurved)
+					{
+						cell.style += 'curved=1;';
+					}
+					else if (p.Shape != 'diagonal')
 					{
 						if (p.ElbowPoints != null && p.ElbowPoints.length > 0)
 						{
@@ -5730,19 +5736,10 @@ LucidImporter = {};
 									Math.round(p.ElbowPoints[i].y * scale + dy)));
 							}
 						}
-						else if (p.Shape == 'elbow')
+						else if (p.Shape == 'elbow' || (p.Endpoint1.Block != null && p.Endpoint2.Block != null))
 						{
 							cell.style += 'edgeStyle=orthogonalEdgeStyle;';
 						}
-						else if (p.Endpoint1.Block != null && p.Endpoint2.Block != null)
-						{
-							cell.style += 'edgeStyle=orthogonalEdgeStyle;';
-	
-							if (isCurved)
-							{
-								cell.style += 'curved=1;';
-							}
-						}
 					}
 					
 					if (p.LineJumps || LucidImporter.globalProps.LineJumps)
@@ -5790,9 +5787,38 @@ LucidImporter = {};
 						}
 					}
 
-					var waypoints = p.ElbowControlPoints != null && p.ElbowControlPoints.length > 0? p.ElbowControlPoints : 
-						(isCurved && p.BezierJoints != null && p.BezierJoints.length > 0? p.BezierJoints : p.Joints);
-					
+					var waypoints = p.ElbowControlPoints != null && p.ElbowControlPoints.length > 0? p.ElbowControlPoints : p.Joints;
+
+					if (isCurved && p.BezierJoints != null && p.BezierJoints.length > 0)
+					{
+						waypoints = [];
+
+						//Last point sometimes has incorrect x,y value!
+						var lpt = p.BezierJoints[p.BezierJoints.length - 1];
+						lpt.p.x = p.Endpoint2.x;
+						lpt.p.y = p.Endpoint2.y;
+
+						for (var i = 0; i < p.BezierJoints.length; i++)
+						{
+							var pt = p.BezierJoints[i];
+							//TODO This is best-effort approximation (close enouhh but not exact)
+							waypoints.push({x: pt.p.x + pt.nt.x * pt.lcps * .75, y: pt.p.y + pt.nt.y * pt.lcps * .75});
+							waypoints.push({x: pt.p.x + pt.nt.x * pt.rcps * .75, y: pt.p.y + pt.nt.y * pt.rcps * .75});
+						}
+
+						//remove first & last points
+						waypoints = waypoints.slice(1, waypoints.length - 1);
+					}
+					else if (isCurved) //Curved with the default waypoints
+					{
+						waypoints = [];
+						//TODO This is best-effort approximation (close enouhh but not exact)
+						waypoints.push({x: p.Endpoint1.x + (p.Endpoint1.LinkX < 0.1? -250 : (p.Endpoint1.LinkX > 0.9? 250 : 0) ), 
+										y: p.Endpoint1.y + (p.Endpoint1.LinkY < 0.1? -250 : (p.Endpoint1.LinkY > 0.9? 250 : 0) )});
+						waypoints.push({x: p.Endpoint2.x + (p.Endpoint2.LinkX < 0.1? -250 : (p.Endpoint2.LinkX > 0.9? 250 : 0) ), 
+										y: p.Endpoint2.y + (p.Endpoint2.LinkY < 0.1? -250 : (p.Endpoint2.LinkY > 0.9? 250 : 0) )});
+					}
+
 					if (waypoints != null)
 					{
 						cell.geometry.points = [];
@@ -5805,12 +5831,6 @@ LucidImporter = {};
 								Math.round(pt.x * scale + dx),
 								Math.round(pt.y * scale + dy)));
 						}
-						
-						if (waypoints == p.BezierJoints)
-						{
-							console.log('Curved edge case');
-							LucidImporter.hasUnknownShapes = true;
-						}
 					}
 					
 					// Inserts implicit or explicit control points for loops
@@ -6056,7 +6076,7 @@ LucidImporter = {};
 			
 			for (var i = 0; i < obj.Value.m.length; i++)
 			{
-				if (obj.Value.m[i].n == 's')
+				if (obj.Value.m[i].n == 's' && obj.Value.m[i].v) //Ignore zero value
 				{
 					size = fix1Digit(scale * parseFloat(obj.Value.m[i].v));
 				}

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

@@ -3688,6 +3688,21 @@
 			}
 		})));
 		
+		if (EditorUi.isElectronApp)
+		{
+			var enableSpellCheck = urlParams['enableSpellCheck'] == '1';
+
+			var spellCheckAction = editorUi.actions.addAction('spellCheck', function()
+			{
+				editorUi.toggleSpellCheck();
+				enableSpellCheck = !enableSpellCheck;
+				editorUi.alert(mxResources.get('restartForChangeRequired'));
+			});
+			
+			spellCheckAction.setToggleAction(true);
+			spellCheckAction.setSelectedCallback(function() { return enableSpellCheck; });
+		}
+
 		this.put('extras', new Menu(mxUtils.bind(this, function(menu, parent)
 		{
 			if (urlParams['noLangIcon'] == '1')
@@ -3711,7 +3726,12 @@
 					this.addLinkToItem(item, 'https://www.diagrams.net/doc/faq/math-typesetting');
 				}
 			}
-			
+	
+			if (EditorUi.isElectronApp)
+			{
+				this.addMenuItems(menu, ['spellCheck'], parent);	
+			}
+
 			this.addMenuItems(menu, ['copyConnect', 'collapseExpand', '-'], parent);
 			
 			if (urlParams['embed'] != '1' && (isLocalStorage || mxClient.IS_CHROMEAPP))

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

@@ -1135,7 +1135,7 @@ EditorUi.initMinimalTheme = function()
 			{
 				ui.menus.addMenuItems(menu, ['outline'], parent);
 			}
-			else if (file.constructor == DriveFile)
+			else if (file != null && file.constructor == DriveFile)
 			{
 				ui.menus.addMenuItems(menu, ['share'], parent);
 			}

Datei-Diff unterdrückt, da er zu groß ist
+ 655 - 654
src/main/webapp/js/extensions.min.js


+ 18 - 16
src/main/webapp/js/grapheditor/Graph.js

@@ -362,31 +362,33 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 				    		var box = new mxRectangle(me.getGraphX() - 1, me.getGraphY() - 1);
 							var tol = mxEvent.isTouchEvent(me.getEvent()) ?
 								mxShape.prototype.svgStrokeTolerance - 1 :
-								(mxShape.prototype.svgStrokeTolerance + 1) / 2;
+								(mxShape.prototype.svgStrokeTolerance + 2) / 2;
+							var t1 = tol + 2;
 			    			box.grow(tol);
 
-							// Ignores clicks on cell background to avoid delayed selection on
-							// merged cells when clicking on invisible dividers
+							// Ignores clicks inside cell to avoid delayed selection on
+							// merged cells when clicking on invisible part of dividers
 			    			if (this.isTableCell(state.cell) && !this.isCellSelected(state.cell) &&
-								(!mxUtils.contains(state, me.getGraphX() - tol, me.getGraphY() - tol) ||
-								!mxUtils.contains(state, me.getGraphX() - tol, me.getGraphY() + tol) ||
-								!mxUtils.contains(state, me.getGraphX() + tol, me.getGraphY() + tol) ||
-								!mxUtils.contains(state, me.getGraphX() + tol, me.getGraphY() - tol)))
+								(!mxUtils.contains(state, me.getGraphX() - t1, me.getGraphY() - t1) ||
+								!mxUtils.contains(state, me.getGraphX() - t1, me.getGraphY() + t1) ||
+								!mxUtils.contains(state, me.getGraphX() + t1, me.getGraphY() + t1) ||
+								!mxUtils.contains(state, me.getGraphX() + t1, me.getGraphY() - t1)))
 			    			{
 			    				var row = this.model.getParent(state.cell);
 			    				var table = this.model.getParent(row);
 			    				
 			    				if (!this.isCellSelected(table))
 			    				{
-									var geo = this.getCellGeometry(state.cell);
-									var g = (geo.alternateBounds != null) ? geo.alternateBounds : geo;
+									var b = tol * s;
+									var b2 = 2 * b;
 									
-				    				if ((mxUtils.intersects(box, new mxRectangle(state.x, state.y - 2, g.width * s, 3)) &&
-				    					this.model.getChildAt(table, 0) != row) || mxUtils.intersects(box, new mxRectangle(
-				    					state.x, state.y + g.height - 2, g.width, 3)) ||
-					    				(mxUtils.intersects(box, new mxRectangle(state.x - 2, state.y, 2, g.height * s)) &&
-					    				this.model.getChildAt(row, 0) != state.cell) || mxUtils.intersects(box, new mxRectangle(
-				    					state.x + g.width * s - 2, state.y, 2, g.height * s)))
+									// Ignores events on top line of top row and left line of left column
+				    				if ((this.model.getChildAt(table, 0) != row) && mxUtils.intersects(box,
+											new mxRectangle(state.x, state.y - b, state.width, b2)) ||
+										(this.model.getChildAt(row, 0) != state.cell) && mxUtils.intersects(box,
+											new mxRectangle(state.x - b, state.y, b2, state.height)) ||
+										mxUtils.intersects(box, new mxRectangle(state.x, state.y + state.height - b, state.width, b2)) ||
+										mxUtils.intersects(box, new mxRectangle(state.x + state.width - b, state.y, b2, state.height)))
 			    					{
 				    					var wasSelected = this.selectionCellsHandler.isHandled(table);
 										this.selectCellForEvent(table, me.getEvent());
@@ -657,7 +659,7 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 				    		else if (!mxEvent.isControlDown(me.getEvent()))
 				    		{
 								var tol = mxShape.prototype.svgStrokeTolerance / 2;
-				    			var box = new mxRectangle(me.getGraphX() - 1, me.getGraphY() - 1);
+				    			var box = new mxRectangle(me.getGraphX(), me.getGraphY());
 			    				box.grow(tol);
 	
 					    		if (this.isTableCell(state.cell))

+ 3 - 1
src/main/webapp/js/grapheditor/Shapes.js

@@ -5130,7 +5130,9 @@
 				
 				if (ss.style.shape == 'umlFrame')
 				{
-					result.push({title: mxResources.get('laneColor'), key: 'swimlaneFillColor', defaultValue: '#ffffff'});
+					result.push({title: mxResources.get('laneColor'),
+						key: 'swimlaneFillColor',
+						defaultValue: 'default'});
 				}
 				
 				return result;

Datei-Diff unterdrückt, da er zu groß ist
+ 344 - 343
src/main/webapp/js/viewer-static.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 344 - 343
src/main/webapp/js/viewer.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
src/main/webapp/mxgraph/mxClient.js


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

@@ -97,7 +97,7 @@ chatWindowTitle=‫دردشة‬
 chooseAnOption=‫اختر خيارا‬
 chromeApp=‫تطبيق Chrome‬
 collaborativeEditingNotice=‫ملاحظات مهمة عن مشاركة التعديل‬
-compare=‫قارن‬
+compare=‫يقارن‬
 compressed=‫مضغوط‬
 commitMessage=‫أكد علي تسجيل الرسالة‬
 configLinkWarn=‫هذة الوصلة تقوم بتغيرات علي draw.io . اضغط علي موافق لو كنت تثق فيمن ارسله اليك‬

+ 11 - 11
src/main/webapp/resources/dia_cs.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
-about=O aplikaci
+about=O verzi
 aboutDrawio=O aplikaci draw.io
 accessDenied=Přístup odepřen
 action=Akce
@@ -352,7 +352,7 @@ fullscreen=Přes celou obrazovku
 gap=Gap
 gcp=GCP
 general=Obecné
-getNotionChromeExtension=Get the Notion Chrome Extension
+getNotionChromeExtension=Získat rozšíření Notion pro prohlížeč Chrome
 github=GitHub
 gitlab=GitLab
 gliffy=Gliffy
@@ -597,7 +597,7 @@ project=Projekt
 priority=Priorita
 properties=Vlastnosti
 publish=Zveřejnit
-quickStart=Rychle spustit video
+quickStart=Rychlý videoúvod
 rack=Rozvaděč
 radial=Radiální
 radialTree=Radiální strom
@@ -729,7 +729,7 @@ templates=Šablony
 text=Text
 textAlignment=Zarovnání textu
 textOpacity=Průhlednost textu
-theme=Téma
+theme=Motiv vzhledu
 timeout=Překročen časový limit
 title=Nadpis
 to=až
@@ -1163,10 +1163,10 @@ owner=Vlastník
 repository=Repozitář
 branch=Větev
 meters=Metrů
-teamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)
-contactOwner=Contact Owner
-viewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.
-website=Website
-check4Updates=Check for updates
-attWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...
-confPartialPageList=We couldn't fetch all pages due to an error in Confluence. Continuing using {1} pages only.
+teamsNoEditingMsg=Funke editoru je k dispozici pouze v desktopovém prostředí (v aplikaci MS Teams nebo webovém prohlížeči)
+contactOwner=Kontaktovat vlastníka
+viewerOnlyMsg=Diagramy není možné upravovat na mobilní platformě, použijte klienta pro desktop nebo webový prohlížeč.
+website=Webové stránky
+check4Updates=Zjistit dostupnost případných aktualizací
+attWriteFailedRetry={1}: Zapsání přílohy se nezdařilo, opětovný pokus za {2} sekund…
+confPartialPageList=Nepodařilo se získat všechny stránky kvůli chybě v Confluence. Pokračuje se pouze se {1} stránkami.

+ 3 - 3
src/main/webapp/resources/dia_eu.txt

@@ -352,7 +352,7 @@ fullscreen=Pantaila osoa
 gap=Tartea
 gcp=GCP
 general=Orokorra
-getNotionChromeExtension=Get the Notion Chrome Extension
+getNotionChromeExtension=Eskuratu Notion Chrome gehigarria
 github=GitHub
 gitlab=GitLab
 gliffy=Gliffy
@@ -1168,5 +1168,5 @@ contactOwner=Contact Owner
 viewerOnlyMsg=Ezin dituzu diagramak editatu plataforma mugikorrean, mesedez erabili mahaigaineko bezeroa edo web arakatzailea.
 website=Webgunea
 check4Updates=Bilat eguneraketak
-attWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...
-confPartialPageList=We couldn't fetch all pages due to an error in Confluence. Continuing using {1} pages only.
+attWriteFailedRetry={1}: Eranskinaren idazketa huts egin du, berriro saiatuko da {2} segundo barru...
+confPartialPageList=Ezin izan ditugu orrialde guztiak eskuratu konfluentzia errore bat dela medio. {1} orrialde soilik erabiliko dira.

+ 4 - 4
src/main/webapp/resources/dia_it.txt

@@ -732,7 +732,7 @@ textOpacity=Opacità testo
 theme=Tema
 timeout=Timeout
 title=Titolo
-to=A
+to=a
 toBack=Sullo sfondo
 toFront=In primo piano
 tooLargeUseDownload=Troppo grande, scaricalo invece.
@@ -1159,14 +1159,14 @@ noDBs=Nessun database
 diagramEdited={1} diagram "{2}" edited
 confDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?
 confDraftTooBigErr=Draft size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration?
-owner=Owner
+owner=Proprietario
 repository=Repository
 branch=Branch
 meters=Meters
 teamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)
 contactOwner=Contact Owner
 viewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.
-website=Website
-check4Updates=Check for updates
+website=Sito web
+check4Updates=Controlla aggiornamenti
 attWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...
 confPartialPageList=We couldn't fetch all pages due to an error in Confluence. Continuing using {1} pages only.

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
src/main/webapp/service-worker.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
src/main/webapp/service-worker.js.map