Gaudenz Alder vor 6 Jahren
Ursprung
Commit
2d6ce4910c

+ 12 - 0
ChangeLog

@@ -1,3 +1,15 @@
+14-DEC-2018: 9.6.4
+
+- Uses mxGraph 3.9.12
+
+13-DEC-2018: 9.6.3
+
+- Uses mxGraph 3.9.11 beta 10
+
+12-DEC-2018: 9.6.2
+
+- Uses mxGraph 3.9.11 beta 9
+
 11-DEC-2018: 9.6.1
 
 - Adds source-/targetPerimeterSpacing to default style

+ 1 - 1
VERSION

@@ -1 +1 @@
-9.6.1
+9.6.4

Datei-Diff unterdrückt, da er zu groß ist
+ 7 - 6
etc/mxgraph/mxClient.js


+ 1 - 1
src/main/webapp/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 12/11/2018 02:35 PM
+# 12/14/2018 01:24 PM
 
 app.html
 index.html?offline=1

+ 1 - 106
src/main/webapp/index.html

@@ -410,112 +410,7 @@
 /**
  * Main
  */
-App.main(function(ui)
-{
-	// Instruments model.cloneCells
-	var lastReport = 0;
-	
-	// Checks the array for nulls and duplicates
-	ui.editor.graph.model.cloneCells = function(cells, includeChildren, mapping)
-	{
-		try
-		{
-			var rep = [];
-			var dups = 0;
-			var nils = 0;
-			var lookup = {};
-			
-			for (var i = 0; i < cells.length; i++)
-			{
-				if (cells[i] == null)
-				{
-					nils++;
-				}
-				else
-				{
-					var id = mxObjectIdentity.get(cells[i]);
-					
-					if (lookup[id] != null)
-					{
-						dups++;
-						
-						rep.push('Checking duplicate:', id, 'Equal:', lookup[id] == cells[i]);
-					}
-					else
-					{
-						lookup[id] = cells[i];
-					}
-				}
-			}
-			
-			if (nils > 0 || dups > 0)
-			{
-				var now = new Date().getTime();
-				
-				// Do not send too many reports
-				if (now - lastReport > 30000)
-				{
-					var codec = new mxCodec();
-					var model = new mxGraphModel();
-					var parent = model.getChildAt(model.getRoot(), 0);
-					
-					for (var i = 0; i < cells.length; i++)
-					{
-						model.add(parent, cells[i]);
-					}
-
-					var node = codec.encode(model);
-					
-					// To avoid NPE with an old version of app.min
-					if (ui.anonymizeNode != null)
-					{
-						ui.anonymizeNode(node);
-					}
-					else
-					{
-						// Get structural info for analysis
-						var nodes = node.getElementsByTagName('mxCell');
-					
-						for (var i = 0; i < nodes.length; i++)
-						{
-							nodes[i].removeAttribute('value');
-							nodes[i].removeAttribute('style');
-							
-							if (nodes[i].parentNode != null && nodes[i].parentNode.nodeName != 'root' &&
-								nodes[i].parentNode.parentNode != null)
-							{
-								nodes[i].setAttribute('id', nodes[i].parentNode.getAttribute('id'));
-								nodes[i].parentNode.parentNode.replaceChild(nodes[i], nodes[i].parentNode);
-							}
-						}
-						
-						var geos = node.getElementsByTagName('mxGeometry');
-						
-						while (geos.length > 0)
-						{
-							geos[0].parentNode.removeChild(geos[0]);
-						}
-					}
-					
-					ui.sendReport(dups + ' duplicates and ' +
-						nils + ' nulls in ' + cells.length + ':\n' +
-						new Error().stack + '\n\n' + 
-						mxUtils.getPrettyXml(node) + '\n' +
-						rep.join('\n') + '\n' +
-						'Agent: ' + navigator.userAgent);
-				}
-				
-				lastReport = now;
-			}
-		}
-		catch (e)
-		{
-			// ignore
-		}
-		
-		return mxGraphModel.prototype.cloneCells.apply(this, arguments);
-	};
-});
+App.main();
 </script>
 </body>
 </html>

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


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


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


+ 68 - 20
src/main/webapp/js/diagramly/DrawioFile.js

@@ -111,6 +111,29 @@ DrawioFile.prototype.inConflictState = false;
  */
 DrawioFile.prototype.invalidChecksum = false;
 
+/**
+ * Specifies if notify events should be ignored.
+ */
+DrawioFile.prototype.reportEnabled = true;
+
+/**
+ * Specifies if notify events should be ignored.
+ */
+DrawioFile.prototype.stats = {
+	reloads: 0, /* number of times the files was reloaded */
+	checksumErrors: 0, /* number of checksum errors in mergeFile */
+	mergeChecksumErrors: 0, /* number of checksum errors in merge */
+	bytesSent: 0, /* number of bytes send in messages */
+	bytesReceived: 0, /* number of bytes received in messages */
+	msgReceived: 0, /* number of messages received */
+	msgSent: 0, /* number of messages sent */
+	cacheHits: 0, /* number of times the cache returned patches */
+	cacheMiss: 0, /* number of times we have given up to read the cache */
+	conflicts: 0, /* number of write conflicts when saving a file */
+	timeouts: 0, /* number of time we have given up to retry after a write conflict */
+	joined: 0 /* number of join messages received */
+};
+
 /**
  * Specifies if notify events should be ignored.
  */
@@ -209,7 +232,8 @@ DrawioFile.prototype.mergeFile = function(file, success, error)
 		
 		if (checksum != current)
 		{
-			this.checksumError(error, 'mergeFile');
+			this.stats.checksumErrors++;
+			this.checksumError(error);
 		}
 		else
 		{
@@ -241,11 +265,11 @@ DrawioFile.prototype.mergeFile = function(file, success, error)
 			error(e);
 		}
 
-		// Reports errors during beta phase
+		// Beta test error reports
 		var user = this.getCurrentUser();
 		var uid = (user != null) ? this.ui.hashValue(user.id) : 'no user';
 
-		this.ui.sendReport('Error in mergeFile:\n' +
+		EditorUi.sendReport('Error in mergeFile:\n' +
 			new Date().toISOString() + '\n' +
 			'User=' + uid + '\n' +
 			'File=' + this.getId() + '\n' +
@@ -259,7 +283,7 @@ DrawioFile.prototype.mergeFile = function(file, success, error)
 /**
  * Adds the listener for automatically saving the diagram for local changes.
  */
-DrawioFile.prototype.checksumError = function(error, source)
+DrawioFile.prototype.checksumError = function(error)
 {
 	this.inConflictState = true;
 	this.invalidChecksum = true;
@@ -274,20 +298,6 @@ DrawioFile.prototype.checksumError = function(error, source)
 	{
 		error();
 	}
-	
-	// Reports checksum errors during beta phase
-	var user = this.getCurrentUser();
-	var uid = (user != null) ? this.ui.hashValue(user.id) : 'no user';
-
-	this.ui.sendReport('Checksum error in ' + source + ':\n' +
-		new Date().toISOString() + '\n' +
-		((this.sync != null) ? ('Client=' +
-			this.sync.clientId + '\n') : '') +
-		'User=' + uid + '\n' +
-		'File=' + this.getId() + '\n' +
-		'Mode=' + this.getMode() + '\n' +
-		'Size=' + this.getSize() + '\n' +
-		'Sync=' + DrawioFile.SYNC);
 };
 
 /**
@@ -305,6 +315,8 @@ DrawioFile.prototype.reloadFile = function(success, error)
 			var page = this.ui.currentPage;
 			var viewState = this.ui.editor.graph.getViewState();
 			var selection = this.ui.editor.graph.getSelectionCells();
+			this.reportEnabled = false;
+			this.stats.reloads++;
 			
 			this.ui.loadFile(this.getHash(), true, null, mxUtils.bind(this, function()
 			{
@@ -315,6 +327,14 @@ DrawioFile.prototype.reloadFile = function(success, error)
 					this.patch([this.backupPatch]);
 				}
 				
+				// Carry-over
+				var file = this.ui.getCurrentFile();
+				
+				if (file != null)
+				{
+					file.stats = this.stats;
+				}
+				
 				if (success != null)
 				{
 					success();
@@ -1338,7 +1358,7 @@ DrawioFile.prototype.fileChanged = function()
 /**
  * Invokes sync and updates shadow document.
  */
-DrawioFile.prototype.fileSaved = function(savedData, lastDesc)
+DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error)
 {
 	this.inConflictState = false;
 	
@@ -1346,12 +1366,17 @@ DrawioFile.prototype.fileSaved = function(savedData, lastDesc)
 	{
 		this.shadowData = savedData;
 		this.shadowPages = null;
+		
+		if (success != null)
+		{
+			success();
+		}
 	}
 	else
 	{
 		var savedPages = this.ui.getPagesForNode(
 			mxUtils.parseXml(savedData).documentElement);
-		this.sync.fileSaved(savedPages, lastDesc);
+		this.sync.fileSaved(savedPages, lastDesc, success, error);
 		this.shadowPages = savedPages;
 	}
 };
@@ -1531,6 +1556,29 @@ DrawioFile.prototype.removeListeners = function()
  */
 DrawioFile.prototype.destroy = function()
 {
+	// Beta test error reports
+	try
+	{
+		if (this.reportEnabled && DrawioFile.SYNC != 'none')
+		{
+			var user = this.getCurrentUser();
+			var uid = (user != null) ? this.ui.hashValue(user.id) : 'no user';
+			
+			EditorUi.sendReport('Sync Stats ' +
+				new Date().toISOString() + ':\n\n' +
+				'File=' + this.getId() + '\n' +
+				'User=' + uid + '\n' +
+				((this.sync != null) ? (this.sync.clientId + '\n') : '') +
+				'Size=' + this.getSize() + '\n' +
+				'Sync=' + DrawioFile.SYNC + '\n\n' +
+				'Stats=' + JSON.stringify(this.stats, null, 4));
+		}
+	}
+	catch (e)
+	{
+		// ignore
+	}
+
 	this.clearAutosave();
 	this.removeListeners();
 

+ 59 - 90
src/main/webapp/js/diagramly/DrawioFileSync.js

@@ -72,42 +72,7 @@ DrawioFileSync.prototype.maxCacheReadyRetries = 2;
 /**
  * Specifies if descriptor change events should be ignored.
  */
-DrawioFileSync.prototype.bytesSent = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.bytesReceived = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.msgReceived = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.msgSent = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.cacheHits = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.cacheMiss = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.conflicts = 0;
-
-/**
- * Specifies if descriptor change events should be ignored.
- */
-DrawioFileSync.prototype.timeouts = 0;
+DrawioFileSync.prototype.cacheReadyDelay = 400;
 
 /**
  * Adds all listeners.
@@ -145,8 +110,12 @@ DrawioFileSync.prototype.start = function()
 			{
 				this.channel = this.pusher.subscribe(this.channelId);
 				this.key = this.file.getChannelKey();
-				this.startTime = new Date();
 				this.updateOnlineState();
+
+				if (this.file.stats.start == null)
+				{
+					this.file.stats.start = new Date().toISOString();
+				}
 				
 				EditorUi.debug('Sync.start', [this]);
 				
@@ -324,11 +293,6 @@ DrawioFileSync.prototype.updateStatus = function()
 			}
 
 			var label = mxResources.get('lastChange', [str]);
-			var stats = (urlParams['test'] != '1') ? '' :
-				' (timeouts=' + this.timeouts + ' conflicts=' + this.conflicts +
-				' received=' + this.bytesReceived + ' sent=' + this.bytesSent +
-				' msgRecv=' + this.msgReceived + ' msgSent=' + this.msgSent +
-				' hits=' + this.cacheHits + ' miss=' + this.cacheMiss + ')';
 			
 			this.ui.editor.setStatus('<div style="display:inline-block;">' + mxUtils.htmlEntities(label)  + '</div>' +
 				((msg != null) ? ' (' + msg + ')' : '') +
@@ -344,7 +308,7 @@ DrawioFileSync.prototype.updateStatus = function()
 				{
 					links[0].style.cursor = 'pointer';
 					links[0].style.textDecoration = 'underline';
-					links[0].setAttribute('title', mxResources.get('revisionHistory') + stats);
+					links[0].setAttribute('title', mxResources.get('revisionHistory'));
 					
 					mxEvent.addListener(links[0], 'click', mxUtils.bind(this, function()
 					{
@@ -353,7 +317,7 @@ DrawioFileSync.prototype.updateStatus = function()
 				}
 				else
 				{
-					links[0].setAttribute('title', label + stats);
+					links[0].setAttribute('title', label);
 				}
 			}
 			
@@ -419,7 +383,7 @@ DrawioFileSync.prototype.installListeners = function()
 					'&msg=' + encodeURIComponent(this.objectToString(
 					this.createMessage(join))));
 				this.announced = true;
-				this.msgSent++;
+				this.file.stats.msgSent++;
 			}
 		});
 		
@@ -430,7 +394,7 @@ DrawioFileSync.prototype.installListeners = function()
     {
 		this.changeListener = mxUtils.bind(this, function(data)
 		{
-			this.msgReceived++;
+			this.file.stats.msgReceived++;
 
 			if (this.enabled && !this.file.inConflictState &&
 				!this.redirectDialogShowing)
@@ -491,7 +455,12 @@ DrawioFileSync.prototype.handleMessageData = function(data)
 	}
 	else if (data.a == 'join' || data.a == 'leave')
 	{
-		if (window.console && data.name != null)
+		if (data.a == 'join')
+		{
+			this.file.stats.joined++;
+		}
+		
+		if (data.name != null)
 		{
 			this.lastMessage = mxResources.get((data.a == 'join') ?
 				'userJoined' : 'userLeft', [data.name]);
@@ -634,7 +603,7 @@ DrawioFileSync.prototype.catchup = function(etag, secret, success, error, abort)
 					((secret != null) ? '&secret=' + encodeURIComponent(secret) : ''),
 					mxUtils.bind(this, function(req)
 				{
-					this.bytesReceived += req.getText().length;	
+					this.file.stats.bytesReceived += req.getText().length;	
 					
 					if (abort == null || !abort())
 					{
@@ -689,7 +658,7 @@ DrawioFileSync.prototype.catchup = function(etag, secret, success, error, abort)
 						{
 							if (temp.length > 0)
 							{
-								this.cacheHits++;
+								this.file.stats.cacheHits++;
 								this.merge(temp, checksum, etag, success, error);
 							}
 							// Retries if cache entry was not yet there
@@ -701,7 +670,7 @@ DrawioFileSync.prototype.catchup = function(etag, secret, success, error, abort)
 							}
 							else
 							{
-								this.cacheMiss++;
+								this.file.stats.cacheMiss++;
 								this.reload(success, error, abort);
 							}
 						}
@@ -784,7 +753,8 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
 		// Compares the checksum
 		if (checksum != null && checksum != current)
 		{
-			this.file.checksumError(error, 'merge');
+			this.file.stats.mergeChecksumErrors++;
+			this.file.checksumError(error);
 		}
 		else
 		{
@@ -814,11 +784,11 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
 			error(e);
 		}
 		
-		// Reports errors during beta phase
+		// Beta test error reports
 		var user = this.file.getCurrentUser();
 		var uid = (user != null) ? this.ui.hashValue(user.id) : 'no user';
 		
-		this.ui.sendReport('Error in merge:\n' +
+		EditorUi.sendReport('Error in merge:\n' +
 			new Date().toISOString() + '\n' +
 			'Client=' + this.clientId + '\n' +
 			'User=' + uid + '\n' +
@@ -848,8 +818,8 @@ DrawioFileSync.prototype.descriptorChanged = function(etag)
 		mxUtils.post(this.cacheUrl, this.getIdParameters() +
 			'&from=' + encodeURIComponent(etag) + '&to=' + encodeURIComponent(current) +
 			'&msg=' + encodeURIComponent(msg) + '&data=' + encodeURIComponent(data));
-		this.bytesSent += data.length;
-		this.msgSent++;
+		this.file.stats.bytesSent += data.length;
+		this.file.stats.msgSent++;
 	}
 	
 	this.updateStatus();
@@ -889,7 +859,7 @@ DrawioFileSync.prototype.stringToObject = function(data)
  * Invokes after a file was saved to add cache entry (which in turn notifies
  * collaborators).
  */
-DrawioFileSync.prototype.fileSaved = function(pages, lastDesc)
+DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
 {
 	this.lastModified = this.file.getLastModifiedDate();
 	this.resetUpdateStatusThread();
@@ -914,16 +884,38 @@ DrawioFileSync.prototype.fileSaved = function(pages, lastDesc)
 		mxUtils.post(this.cacheUrl, this.getIdParameters() +
 			'&from=' + encodeURIComponent(etag) + '&to=' + encodeURIComponent(current) +
 			'&msg=' + encodeURIComponent(msg) + ((secret != null) ? '&secret=' + encodeURIComponent(secret) : '') +
-			((data.length < this.maxCacheEntrySize) ? '&data=' + encodeURIComponent(data) : ''));
-		EditorUi.debug('Sync.fileSaved', [this], 'from', etag, 'to', current, data.length, 'bytes',
-			'diff', diff, 'checksum', checksum);
-		this.bytesSent += data.length;
-		this.msgSent++;
+			((data.length < this.maxCacheEntrySize) ? '&data=' + encodeURIComponent(data) : ''),
+			mxUtils.bind(this, function(req)
+			{
+				if (req.getStatus() >= 200 && req.getStatus() <= 299)
+				{
+					if (success != null)
+					{
+						success();
+					}
+				}
+				else if (error != null)
+				{
+					error({message: req.getStatus()});
+				}
+			}));
+		EditorUi.debug('Sync.fileSaved', [this], 'from', etag, 'to', current,
+			data.length, 'bytes', 'diff', diff, 'checksum', checksum);
+		this.file.stats.bytesSent += data.length;
+		this.file.stats.msgSent++;
 	}
-	else if (this.channelId == null)
+	else
 	{
-		// Checks channel ID and starts sync
-		this.start();
+		if (this.channelId == null)
+		{
+			// Checks channel ID and starts sync
+			this.start();
+		}
+		
+		if (success != null)
+		{
+			success();
+		}
 	}
 };
 
@@ -959,7 +951,7 @@ DrawioFileSync.prototype.fileConflict = function(desc, success, error)
 	
 	if (this.catchupRetryCount < this.maxCatchupRetries)
 	{
-		this.conflicts++;
+		this.file.stats.conflicts++;
 		
 		if (desc != null)
 		{
@@ -975,7 +967,7 @@ DrawioFileSync.prototype.fileConflict = function(desc, success, error)
 	else
 	{
 		this.catchupRetryCount = 0;
-		this.timeouts++;
+		this.file.stats.timeouts++;
 		
 		if (error != null)
 		{
@@ -1003,7 +995,7 @@ DrawioFileSync.prototype.destroy = function()
 		mxUtils.post(this.cacheUrl, this.getIdParameters() +
 			'&msg=' + encodeURIComponent(this.objectToString(
 			this.createMessage(leave))));
-		this.msgSent++;
+		this.file.stats.msgSent++;
 	}
 
 	if (this.changeListener != null && this.channel != null)
@@ -1047,27 +1039,4 @@ DrawioFileSync.prototype.destroy = function()
 		this.collaboratorsElement.parentNode.removeChild(this.collaboratorsElement);
 		this.collaboratorsElement = null;
 	}
-	
-	// Logs diffsync stats during beta phase
-	try
-	{	
-		if (!this.ui.isOffline())
-		{
-			var uptime = Math.round(((this.startTime != null) ? new Date() - this.startTime : 0) / 1000);
-			
-			EditorUi.logEvent({category: 'DiffSync-Stats', action: DrawioFile.SYNC,
-				label: 'id.' + this.file.getId() + '.mode.' + this.file.getMode() +
-				'.channel.' + this.channelId + '.size.' + this.file.getSize() +
-				'.timeouts.' + this.timeouts + '.conflicts.' + this.conflicts +
-				'.received.' + this.bytesReceived + '.sent.' + this.bytesSent +
-				'.msgRecv.' + this.msgReceived + '.msgSent.' + this.msgSent +
-				'.hits.' + this.cacheHits + '.miss.' + this.cacheMiss +
-				'.uptime.' + uptime + '.checksum.' +
-				this.file.invalidChecksum});
-		}
-	}
-	catch (e)
-	{
-		// ignore
-	}
 };

+ 9 - 8
src/main/webapp/js/diagramly/DriveFile.js

@@ -186,20 +186,21 @@ DriveFile.prototype.saveFile = function(title, revision, success, error, unloadi
 					{
 						this.lastAutosaveRevision = new Date().getTime();
 					}
-					
-					this.desc = resp;
-					this.contentChanged();
-					this.fileSaved(savedData, lastDesc);
-					
+
 					// Adaptive autosave delay
 					this.autosaveDelay = Math.min(6000,
 						Math.max(this.saveDelay + 500,
 						DrawioFile.prototype.autosaveDelay));
 
-					if (success != null)
+					this.desc = resp;
+					this.contentChanged();
+					this.fileSaved(savedData, lastDesc, mxUtils.bind(this, function()
 					{
-						success(resp);
-					}
+						if (success != null)
+						{
+							success(resp);
+						}
+					}), error);
 				}
 				else
 				{

+ 1 - 10
src/main/webapp/js/diagramly/Editor.js

@@ -3770,7 +3770,7 @@
 						var bg = null;
 						var bgImage = null;
 						
-						if (page.viewState == null && page.mapping == null)
+						if (page.viewState == null)
 						{
 							// Workaround to extract view state from XML node
 							// This changes the state of the page and parses
@@ -3788,15 +3788,6 @@
 							bg = page.viewState.background;
 							bgImage = page.viewState.backgroundImage;
 						}
-						else if (page.mapping != null && page.mapping.diagramMap != null)
-						{
-							// Default pageVisible in realtime is true
-							mathEnabled = page.mapping.diagramMap.get('mathEnabled') != '0';
-							bg = page.mapping.diagramMap.get('background');
-							
-							var temp = page.mapping.diagramMap.get('backgroundImage');
-							bgImage = (temp != null && temp.length > 0) ? JSON.parse(temp) : null;
-						}
 					
 						tempGraph.background = bg;
 						tempGraph.backgroundImage = (bgImage != null) ? new mxImage(bgImage.src, bgImage.width, bgImage.height) : null;

+ 27 - 27
src/main/webapp/js/diagramly/EditorUi.js

@@ -87,6 +87,33 @@
 		}
 	};
 
+	/**
+	 * Sending error reports.
+	 */
+	EditorUi.sendReport = function(data, maxLength)
+	{
+		try
+		{
+			if (EditorUi.enableLogging)
+			{
+				maxLength = (maxLength != null) ? maxLength : 3000000;
+
+				if (data.length > maxLength)
+				{
+					data = data.substring(0, maxLength) + '\n...[SHORTENED]'
+				}
+				
+				mxUtils.post('/email', 'version=' + encodeURIComponent(EditorUi.VERSION) +
+					'&url=' + encodeURIComponent(window.location.href) +
+					'&data=' + encodeURIComponent(data));
+			}
+		}
+		catch (e)
+		{
+			// ignore
+		}
+	};
+
 	/**
 	 * Adds the listener for automatically saving the diagram for local changes.
 	 */
@@ -2206,33 +2233,6 @@
 		// empty
 	};
 
-	/**
-	 * Debug output.
-	 */
-	EditorUi.prototype.sendReport = function(data, maxLength)
-	{
-		try
-		{
-			if (!this.isOffline())
-			{
-				maxLength = (maxLength != null) ? maxLength : 3000000;
-
-				if (data.length > maxLength)
-				{
-					data = data.substring(0, maxLength) + '\n...[SHORTENED]'
-				}
-				
-				mxUtils.post('/email', 'version=' + encodeURIComponent(EditorUi.VERSION) +
-					'&url=' + encodeURIComponent(window.location.href) +
-					'&data=' + encodeURIComponent(data));
-			}
-		}
-		catch (e)
-		{
-			// ignore
-		}
-	};
-
 	/**
 	 * Hook for subclassers.
 	 */

+ 6 - 5
src/main/webapp/js/diagramly/GitHubFile.js

@@ -238,12 +238,13 @@ GitHubFile.prototype.saveFile = function(title, revision, success, error, unload
 					this.meta.download_url = commit.content.download_url;
 					
 					this.contentChanged();
-					this.fileSaved(savedData, savedEtag);
-					
-					if (success != null)
+					this.fileSaved(savedData, savedEtag, mxUtils.bind(this, function()
 					{
-						success();
-					}
+						if (success != null)
+						{
+							success();
+						}
+					}), error);
 				}),
 				mxUtils.bind(this, function(err)
 				{

+ 6 - 5
src/main/webapp/js/diagramly/OneDriveFile.js

@@ -337,12 +337,13 @@ OneDriveFile.prototype.saveFile = function(title, revision, success, error, unlo
 					this.savingFile = false;
 					this.meta = meta;
 					this.contentChanged();
-					this.fileSaved(savedData, lastDesc);
-
-					if (success != null)
+					this.fileSaved(savedData, lastDesc, mxUtils.bind(this, function()
 					{
-						success();
-					}
+						if (success != null)
+						{
+							success();
+						}
+					}), error);
 				}),
 				mxUtils.bind(this, function(err, req)
 				{

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


+ 1 - 1
src/main/webapp/js/mxgraph/Editor.js

@@ -628,7 +628,7 @@ Editor.prototype.createUndoManager = function()
 		
 		for (var i = 0; i < cand.length; i++)
 		{
-			if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
+			if (graph.view.getState(cand[i]) != null)
 			{
 				cells.push(cand[i]);
 			}

+ 40 - 46
src/main/webapp/js/mxgraph/Graph.js

@@ -4812,7 +4812,7 @@ if (typeof mxVertexHandler != 'undefined')
 				dec.decode(node, this.getStylesheet());
 			}
 		};
-		
+
 		/**
 		 * 
 		 */
@@ -4821,68 +4821,62 @@ if (typeof mxVertexHandler != 'undefined')
 			dx = (dx != null) ? dx : 0;
 			dy = (dy != null) ? dy : 0;
 			
-			var cells = []
-			var model = new mxGraphModel();
 			var codec = new mxCodec(node.ownerDocument);
-			codec.decode(node, model);
+			var tempModel = new mxGraphModel();
+			codec.decode(node, tempModel);
+			var cells = []
 			
-			var childCount = model.getChildCount(model.getRoot());
-			var targetChildCount = this.model.getChildCount(this.model.getRoot());
+			// Clones cells to remove invalid edges
+			var layers = tempModel.getChildren(this.cloneCell(
+				tempModel.root, this.isCloneInvalidEdges()));
 			
-			// Merges into active layer if one layer is pasted
-			this.model.beginUpdate();
-			try
+			if (layers != null)
 			{
-				// Mapping for multiple calls to cloneCells with the same set of cells
-				var mapping = new Object();
-				
-				// Populates the mapping to fix lookups for forward refs from edges
-				// to cells in parents that are cloned later in the loop below
-// 				this.cloneCells([model.root], this.isCloneInvalidEdges(), mapping);
-
-				for (var i = 0; i < childCount; i++)
+				// Uses copy as layers are removed from array inside loop
+				layers = layers.slice();
+	
+				this.model.beginUpdate();
+				try
 				{
-					var parent = model.getChildAt(model.getRoot(), i);
-					
-					// Adds cells to existing layer if not locked
-					if (childCount == 1 && !this.isCellLocked(this.getDefaultParent()))
+					// Merges into unlocked current layer if one layer is pasted
+					if (layers.length == 1 && !this.isCellLocked(this.getDefaultParent()))
 					{
-						var children = model.getChildren(parent);
-						cells = cells.concat(this.importCells(children, dx, dy, this.getDefaultParent(), null, mapping));
+						cells = this.moveCells(tempModel.getChildren(layers[0]),
+							dx, dy, false, this.getDefaultParent());
 					}
 					else
 					{
-						// Delta is non cascading, needs separate move for layers
-						parent = this.importCells([parent], 0, 0, this.model.getRoot(), null, mapping)[0];
-						var children = this.model.getChildren(parent);
-						this.moveCells(children, dx, dy);
-						cells = cells.concat(children);
-					}
-				}
-				
-				if (crop)
-				{
-					if (this.isGridEnabled())
-					{
-						dx = this.snap(dx);
-						dy = this.snap(dy);
+						for (var i = 0; i < layers.length; i++)
+						{
+							cells = cells.concat(this.model.getChildren(this.moveCells(
+								[layers[i]], dx, dy, false, this.model.getRoot())[0]));
+						}
 					}
 					
-					var bounds = this.getBoundingBoxFromGeometry(cells, true);
-					
-					if (bounds != null)
+					if (crop)
 					{
-						this.moveCells(cells, dx - bounds.x, dy - bounds.y);
+						if (this.isGridEnabled())
+						{
+							dx = this.snap(dx);
+							dy = this.snap(dy);
+						}
+						
+						var bounds = this.getBoundingBoxFromGeometry(cells, true);
+						
+						if (bounds != null)
+						{
+							this.moveCells(cells, dx - bounds.x, dy - bounds.y);
+						}
 					}
 				}
-			}
-			finally
-			{
-				this.model.endUpdate();
+				finally
+				{
+					this.model.endUpdate();
+				}
 			}
 			
 			return cells;
-		}
+		};
 		
 		/**
 		 * Overrides method to provide connection constraints for shapes.

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


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