David Benson [draw.io] vor 4 Jahren
Ursprung
Commit
878bf1c267

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+23-MAR-2021: 14.5.1
+
+- Fixes for Electron 12
+
 22-MAR-2021: 14.5.0
 
 - Improves Lucidchart import

+ 1 - 1
VERSION

@@ -1 +1 @@
-14.5.0
+14.5.1

+ 6 - 3
src/main/webapp/electron.js

@@ -77,7 +77,8 @@ function createWindow (opt = {})
 			nodeIntegration: true,
 			enableRemoteModule: true,
 			nodeIntegrationInWorker: true,
-			spellcheck: (os.platform() == "darwin" ? true : false)
+			spellcheck: (os.platform() == "darwin" ? true : false),
+			contextIsolation: false
 		}
 	}, opt)
 
@@ -271,7 +272,8 @@ app.on('ready', e =>
     	var dummyWin = new BrowserWindow({
 			show : false,
 			webPreferences: {
-				nodeIntegration: true
+				nodeIntegration: true,
+				contextIsolation: false
 			}
 		});
     	
@@ -1212,7 +1214,8 @@ function exportDiagram(event, args, directFinalize)
 		browser = new BrowserWindow({
 			webPreferences: {
 				backgroundThrottling: false,
-				nodeIntegration: true
+				nodeIntegration: true,
+				contextIsolation: false
 			},
 			show : false,
 			frame: false,

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


+ 53 - 19
src/main/webapp/js/diagramly/App.js

@@ -5742,31 +5742,65 @@ App.prototype.updateButtonContainer = function()
 
 App.prototype.fetchAndShowNotification = function(target)
 {
+	if (this.fetchingNotif)
+	{
+		return;	
+	}
+	
 	target = target || 'online';
+	var cachedNotifKey = '.notifCache';
+	var cachedNotif = null;
 	
-	mxUtils.get(NOTIFICATIONS_URL + '?target=' + target, mxUtils.bind(this, function(req)
+	var processNotif = mxUtils.bind(this, function(notifs)
 	{
-		if (req.getStatus() >= 200 && req.getStatus() <= 299)
+		notifs = notifs.filter(function(notif)
 		{
-		    var notifs = JSON.parse(req.getText());
-			
-			//Process and sort
-			var lsReadFlag = target + 'NotifReadTS';
-			var lastRead = parseInt(localStorage.getItem(lsReadFlag));
-			
-			for (var i = 0; i < notifs.length; i++)
+			return !notif.targets || notif.targets.indexOf(target) > -1;
+		});
+		
+		var lsReadFlag = target + 'NotifReadTS';
+		var lastRead = parseInt(localStorage.getItem(lsReadFlag));
+				
+		for (var i = 0; i < notifs.length; i++)
+		{
+			notifs[i].isNew = (!lastRead || notifs[i].timestamp > lastRead);
+		}
+		
+		this.showNotification(notifs, lsReadFlag);
+	});
+	
+	try
+	{
+		cachedNotif = JSON.parse(localStorage.getItem(cachedNotifKey));
+	}
+	catch(e) {} //Ignore
+	
+	if (cachedNotif == null || cachedNotif.ts + 24 * 60 * 60 * 1000 < Date.now()) //Cache for one day
+	{
+		this.fetchingNotif = true;
+		//Fetch all notifications and store them, then filter client-side
+		mxUtils.get(NOTIFICATIONS_URL, mxUtils.bind(this, function(req)
+		{
+			if (req.getStatus() >= 200 && req.getStatus() <= 299)
 			{
-				notifs[i].isNew = (!lastRead || notifs[i].timestamp > lastRead);
+			    var notifs = JSON.parse(req.getText());
+				
+				//Process and sort
+				notifs.sort(function(a, b)
+				{
+					return b.timestamp - a.timestamp;
+				});
+
+				localStorage.setItem(cachedNotifKey, JSON.stringify({ts: Date.now(), notifs: notifs}));
+				this.fetchingNotif = false;	
+				processNotif(notifs);
 			}
-			
-			notifs.sort(function(a, b)
-			{
-				return b.timestamp - a.timestamp;
-			});
-			
-			this.showNotification(notifs, lsReadFlag);
-		}
-	}));
+		}));
+	}
+	else
+	{
+		processNotif(cachedNotif.notifs);
+	}
 };
 
 App.prototype.showNotification = function(notifs, lsReadFlag)

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


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


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


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

@@ -1,6 +1,6 @@
 {
   "name": "draw.io",
-  "version": "14.1.3",
+  "version": "14.5.1",
   "description": "diagrams.net desktop",
   "main": "electron.js",
   "scripts": {
@@ -23,16 +23,16 @@
   },
   "homepage": "https://github.com/jgraph/drawio",
   "dependencies": {
-    "commander": "^7.0.0",
+    "commander": "^7.2.0",
     "compression": "^1.7.4",
     "crc": "^3.8.0",
-    "electron-log": "^4.3.0",
+    "electron-log": "^4.3.2",
     "electron-progressbar": "^2.0.0",
-    "electron-store": "^7.0.1",
-    "electron-updater": "^4.3.5",
+    "electron-store": "^7.0.2",
+    "electron-updater": "^4.3.8",
     "pdf-lib": "^1.16.0"
   },
   "devDependencies": {
-    "electron": "^11.2.2"
+    "electron": "^12.0.1"
   }
 }

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

@@ -6,7 +6,7 @@ if (workbox)
 	workbox.precaching.precacheAndRoute([
   {
     "url": "js/app.min.js",
-    "revision": "8b06e9a76adaba70459fa504b109d591"
+    "revision": "fa99c6885caf13e1eb4be667880731e4"
   },
   {
     "url": "js/extensions.min.js",
@@ -58,7 +58,7 @@ if (workbox)
   },
   {
     "url": "js/viewer-static.min.js",
-    "revision": "e0c4f222b16dd71611af0d7f7d090cb9"
+    "revision": "4487db351e47e1d27262fb6c88665fd9"
   },
   {
     "url": "connect/jira/editor-1-3-3.html",