浏览代码

17.0.0 release

David Benson 3 年之前
父节点
当前提交
399a824c91

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+08-MAR-2022: 17.0.0
+
+- Enables real time collaborative editing
+
 08-MAR-2022: 16.6.8
 
 - [conf cloud] Fixes toolbar showing in page editor in FF

+ 1 - 1
VERSION

@@ -1 +1 @@
-16.6.8
+17.0.0

文件差异内容过多而无法显示
+ 882 - 881
src/main/webapp/js/app.min.js


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

@@ -12679,7 +12679,7 @@ var FilePropertiesDialog = function(editorUi)
 		var initialCollab = file.isRealtimeEnabled();
 
 		var collab = editorUi.drive.getCustomProperty(file.desc, 'collaboration');
-		var initialCollab = collab == 'enabled' || (collab != null && collab != 'disabled');
+		var initialCollab = collab != 'disabled';
 	
 		if (initialCollab)
 		{

+ 12 - 13
src/main/webapp/js/diagramly/DrawioFile.js

@@ -311,11 +311,12 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
 			if (!ignored)
 			{
 				// Creates a patch for backup if the checksum fails
-				this.backupPatch = (this.isModified() || this.ownPages != null) ?
-					this.ui.diffPages(shadow, this.ui.pages) : null;
+				this.backupPatch = (this.isModified()) ?
+					this.ui.diffPages(shadow,
+						this.ui.pages) : null;
 				var pending = (this.ownPages != null) ?
-					[this.ui.diffPages(shadow,
-						this.ownPages)] : null;
+					this.ui.diffPages(shadow,
+						this.ownPages) : null;
 				
 				// Patching previous shadow to verify checksum
 				var patchedDetails = {};
@@ -353,18 +354,16 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow)
 				}
 				else
 				{
-					// Patches the current document
-					this.patch(patches,
-						(this.ownPages == null &&
-						DrawioFile.LAST_WRITE_WINS) ?
-						this.backupPatch : null);
-
 					// Patches the own pages
 					if (this.sync != null)
 					{
-						this.sync.patchOwnPages(patches, pending,
-							[this.backupPatch], true);
+						this.sync.patchOwnPages(patches, [pending], true);
 					}
+
+					// Patches the current document
+					this.patch(patches,
+						(DrawioFile.LAST_WRITE_WINS) ?
+						this.backupPatch : null);
 				}
 			}
 		}
@@ -1227,7 +1226,7 @@ DrawioFile.prototype.isRealtimeSupported = function()
  */
 DrawioFile.prototype.isRealtimeEnabled = function()
 {
-	return urlParams['fast-sync'] == '1';
+	return urlParams['fast-sync'] != '0';
 };
 
 /**

+ 30 - 17
src/main/webapp/js/diagramly/DrawioFileSync.js

@@ -1089,7 +1089,7 @@ DrawioFileSync.prototype.checkConsistency = function()
 /**
  * Patches the own pages with the given changes and updates the snapshot.
  */
-DrawioFileSync.prototype.patchOwnPages = function(patches, pending, remotePending, local)
+DrawioFileSync.prototype.patchOwnPages = function(patches, pending, local)
 {
 	if (this.file.ownPages != null)
 	{
@@ -1097,11 +1097,6 @@ DrawioFileSync.prototype.patchOwnPages = function(patches, pending, remotePendin
 		{
 			if (this.file.ownPages != null)
 			{
-				if (remotePending != null)
-				{
-					this.file.patch(remotePending);
-				}
-				
 				var consensus = this.ui.diffPages(
 					this.file.ownPages,
 					this.ui.pages);
@@ -1146,8 +1141,7 @@ DrawioFileSync.prototype.patchOwnPages = function(patches, pending, remotePendin
 				if (urlParams['test'] == '1')
 				{
 					EditorUi.debug('Sync.patchOwnPages', [this], 'patches', patches,
-						'pending', pending, 'remotePending', remotePending,
-						'consensus', consensus, 'local', local);
+						'pending', pending, 'consensus', consensus, 'local', local);
 				}
 			}
 		}));
@@ -1172,13 +1166,13 @@ DrawioFileSync.prototype.merge = function(patches, checksum, desc, success, erro
 		if (!ignored)
 		{
 			// Creates a patch for backup if the checksum fails
-			this.file.backupPatch = (this.file.isModified() ||
-				this.file.ownPages != null) ?
+			this.file.backupPatch = (this.file.isModified() &&
+				this.file.ownPages == null) ?
 					this.ui.diffPages(this.file.shadowPages,
 						this.ui.pages) : null;
 			var pending = (this.file.ownPages != null) ?
-				[this.ui.diffPages(this.file.shadowPages,
-					this.file.ownPages)] : null;
+				this.ui.diffPages(this.file.shadowPages,
+					this.file.ownPages) : null;
 			
 			// Patches the shadow document
 			for (var i = 0; i < patches.length; i++)
@@ -1219,13 +1213,32 @@ DrawioFileSync.prototype.merge = function(patches, checksum, desc, success, erro
 			}
 			else
 			{
+				// Computes the remote pending changes
+				var remotePending = (this.file.ownPages != null) ?
+					this.ui.diffPages(this.file.ownPages,
+						this.ui.pages) : null;
+
+				// Patches the own pages
+				this.patchOwnPages(patches, [pending]);
+
 				// Patches the current document
-				this.patchOwnPages(patches, pending,
-					[this.file.backupPatch]);
 				this.file.patch(patches,
-					(this.file.ownPages == null &&
-					DrawioFile.LAST_WRITE_WINS) ?
-					this.file.backupPatch : null);
+					(DrawioFile.LAST_WRITE_WINS) ?
+					((pending != null) ? pending :
+					this.file.backupPatch) : null);
+
+				// Applies the remote pending changes to
+				// minimize flickering between states
+				if (remotePending != null && !mxUtils.isEmptyObject(remotePending))
+				{
+					this.file.patch([remotePending]);
+
+					if (urlParams['test'] == '1')
+					{
+						EditorUi.debug('Sync.merge', [this],
+							'remotePending', remotePending);
+					}
+				}
 
 				// Logs successull patch
 //				try

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

@@ -563,7 +563,9 @@ DriveFile.prototype.setRealtimeEnabled = function(value, success, error)
 			'contentType': 'application/json; charset=UTF-8',
 			'params': {
 				'key': 'collaboration',
-				'value': (value) ? 'enabled' : 'disabled'
+				'value': (value) ? 'enabled' :
+					((urlParams['fast-sync'] != '0') ?
+						'disabled' : '')
 			}
 		}, mxUtils.bind(this, function()
 		{

+ 17 - 0
src/main/webapp/js/diagramly/P2PCollab.js

@@ -188,6 +188,23 @@ function P2PCollab(ui, sync, channelId)
 
 		this.selectionChangeListener = function(sender, evt)
 		{
+			// Logging possible NPE in FF
+			if (evt == null)
+			{
+				try
+				{
+					EditorUi.logEvent({category: 'NPE-NULL-EVENT',
+						action: 'P2PCollab.selectionChangeListener'});
+				}
+				catch (e)
+				{
+					// ignore
+				}
+
+				return;
+			}
+			// End of debugging
+
 			var mapToIds = function(c)
 			{
 				return c.id;

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

@@ -519,6 +519,23 @@ EditorUi.prototype.initPages = function()
 		// Adds a graph model listener to update the view
 		this.editor.graph.model.addListener(mxEvent.CHANGE, mxUtils.bind(this, function(sender, evt)
 		{
+			// Logging possible NPE in FF
+			if (evt == null)
+			{
+				try
+				{
+					EditorUi.logEvent({category: 'NPE-NULL-EVENT',
+						action: 'EditorUi.initPages'});
+				}
+				catch (e)
+				{
+					// ignore
+				}
+
+				return;
+			}
+			// End of debugging
+
 			var edit = evt.getProperty('edit');
 			var changes = edit.changes;
 			

文件差异内容过多而无法显示
+ 1268 - 1267
src/main/webapp/js/integrate.min.js


文件差异内容过多而无法显示
+ 155 - 155
src/main/webapp/js/stencils.min.js


文件差异内容过多而无法显示
+ 74 - 73
src/main/webapp/js/viewer-static.min.js


文件差异内容过多而无法显示
+ 74 - 73
src/main/webapp/js/viewer.min.js


文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/mxgraph/mxClient.js


+ 12 - 12
src/main/webapp/plugins/random.js

@@ -34,18 +34,18 @@ Draw.loadPlugin(function(ui)
 					
 					if (ui.dialog != null)
 					{
-						console.log('randomLabel halted');
+						console.log('random.js: randomLabel halted');
 					}
 					else
 					{
 						if (counter++ < max && ui.dialog == null)
 						{
-							console.log('randomLabel', counter);
+							console.log('random.js: randomLabel', counter);
 							schedule();
 						}
 						else
 						{
-							console.log('randomLabel halted');
+							console.log('random.js: randomLabel halted');
 						}
 					}
 				}, delay * jitter);
@@ -96,7 +96,7 @@ Draw.loadPlugin(function(ui)
 						{
 							// permute children
 							var passes = Math.floor(Math.random() * numberA) + 1;
-							console.log(counter + " - swapping " + passes + " children from parent A to parent B");
+							console.log('random.js: ' + counter + " - swapping " + passes + " children from parent A to parent B");
 							
 							for (var i = 0; i < passes; i++)
 							{
@@ -111,7 +111,7 @@ Draw.loadPlugin(function(ui)
 							}
 
 							var passes = Math.floor(Math.random() * numberB) + 1;
-							console.log(counter + " - swapping " + passes + " children from parent B to parent A");
+							console.log('random.js: ' + counter + " - swapping " + passes + " children from parent B to parent A");
 							
 							for (var i = 0; i < passes; i++)
 							{
@@ -132,18 +132,18 @@ Draw.loadPlugin(function(ui)
 					
 					if (ui.dialog != null)
 					{
-						console.log('swapChildren halted');
+						console.log('random.js: swapChildren halted');
 					}
 					else
 					{
 						if (counter++ < max && ui.dialog == null)
 						{
-							console.log('swapChildren', counter);
+							console.log('random.js: swapChildren', counter + '/' + max);
 							schedule();
 						}
 						else
 						{
-							console.log('swapChildren halted');
+							console.log('random.js: swapChildren halted');
 						}
 					}
 				}, delay * jitter);
@@ -415,7 +415,7 @@ Draw.loadPlugin(function(ui)
 							var number = children.length;
 
 							var passes = Math.floor(Math.random() * number) + 1;
-							console.log(counter + " - reordering in " + passes + " passes");
+							console.log('random.js: ' + counter + " - reordering in " + passes + " passes");
 							
 							for (var i = 0; i < passes; i++)
 							{
@@ -431,18 +431,18 @@ Draw.loadPlugin(function(ui)
 					
 					if (ui.dialog != null)
 					{
-						console.log('reorderChildren halted');
+						console.log('random.js: reorderChildren halted');
 					}
 					else
 					{
 						if (counter++ < max && ui.dialog == null)
 						{
-							console.log('reorderChildren', counter);
+							console.log('random.js: reorderChildren', counter + '/' + max);
 							schedule();
 						}
 						else
 						{
-							console.log('reorderChildren halted');
+							console.log('random.js: reorderChildren halted');
 						}
 					}
 				}, delay * jitter);

文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/service-worker.js


文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/service-worker.js.map