Browse Source

10.8.8 release

Gaudenz Alder 6 years ago
parent
commit
879118351b

+ 22 - 0
ChangeLog

@@ -1,3 +1,25 @@
+03-JUL-2019: 10.8.8
+
+- Adds timer to check for unsaved changes
+- Fixes lightbox height for Confluence Cloud viewer
+
+02-JUL-2019: 10.8.7
+
+- Fixes PlantUML connect add attachment call
+
+02-JUL-2019: 10.8.6
+
+- Fixes ignored properties for child cells in CSV
+- Logs file idle states
+- Uses mxGraph 4.0.1
+
+02-JUL-2019: 10.8.5
+
+- Removed RPC calls in Confluence Connect
+- Adds support for digrams in Confluence Cloud comments
+- Fixes handling of move in rounded paths
+- Uses mxGraph 4.0.1 beta 11
+
 29-JUN-2019: 10.8.4
 29-JUN-2019: 10.8.4
 
 
 - No longer selects parent after delete of child
 - No longer selects parent after delete of child

+ 1 - 1
VERSION

@@ -1 +1 @@
-10.8.4
+10.8.8

File diff suppressed because it is too large
+ 59 - 59
etc/mxgraph/mxClient.js


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

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 CACHE MANIFEST
 
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 06/29/2019 01:59 PM
+# 07/03/2019 06:31 PM
 
 
 app.html
 app.html
 index.html?offline=1
 index.html?offline=1

File diff suppressed because it is too large
+ 590 - 584
src/main/webapp/js/app.min.js


+ 79 - 9
src/main/webapp/js/diagramly/App.js

@@ -27,22 +27,86 @@ App = function(editor, container, lightbox)
 			{
 			{
 				EditorUi.logEvent({category: 'DISCARD-SAVE-FILE-' + file.getHash() + '.' +
 				EditorUi.logEvent({category: 'DISCARD-SAVE-FILE-' + file.getHash() + '.' +
 					file.desc.headRevisionId + '.' + file.desc.modifiedDate + '-size_' + file.getSize(),
 					file.desc.headRevisionId + '.' + file.desc.modifiedDate + '-size_' + file.getSize(),
-					action: 'save_' + ((file.lastSaved != null) ?  Math.round((new Date().getTime() - file.lastSaved) / 1000) : 'never') +
-					'-autosave_' + (((this.editor.autosave) ? 'on' : 'off') +
-					'-open_' + ((file.opened != null) ? Math.round((new Date().getTime() - file.opened) / 1000) : 'never')),
-					label: (this.drive.user != null) ? this.drive.user.id : 'unknown-user'});
+					action: 'saved_' + ((file.lastSaved != null) ? Math.round((new Date().getTime() - file.lastSaved) / 1000) : 'never') +
+					'-opened_' + ((file.opened != null) ? Math.round((new Date().getTime() - file.opened) / 1000) : 'never') +
+					'-autosave_' + ((this.editor.autosave) ? 'on' : 'off') +
+					'-changelistener_' + ((file.changeListenerEnabled) ? 'on' : 'off') +
+					'-conflict_' + ((file.inConflictState) ? 'yes' : 'no') +
+					'-checksum_' + ((file.invalidChecksum) ? 'invalid' : 'valid') +
+					'-saving_' + ((file.savingFile) ? 'true' : 'false'),
+					label: ((this.drive.user != null) ? 'user_' + this.drive.user.id : 'unknown') +
+					((file.sync != null) ? ('-client_' + file.sync.clientId) : '-nosync')});
 			}
 			}
 			else if (file != null && file.isModified())
 			else if (file != null && file.isModified())
 			{
 			{
 				EditorUi.logEvent({category: 'DISCARD-SAVE-FILE-' + file.getHash() + '-size_' + file.getSize(),
 				EditorUi.logEvent({category: 'DISCARD-SAVE-FILE-' + file.getHash() + '-size_' + file.getSize(),
-					action: 'save_' + ((file.lastSaved != null) ?  Math.round((new Date().getTime() - file.lastSaved) / 1000) : 'never') +
-					'-autosave_' + (((this.editor.autosave) ? 'on' : 'off') +
-					'-open_' + ((file.opened != null) ? Math.round((new Date().getTime() - file.opened) / 1000) : 'never')),
-					label: 'nolabel'});
+					action: 'saved_' + ((file.lastSaved != null) ?  Math.round((new Date().getTime() - file.lastSaved) / 1000) : 'never') +
+					'-opened_' + ((file.opened != null) ? Math.round((new Date().getTime() - file.opened) / 1000) : 'never') +
+					'-autosave_' + ((this.editor.autosave) ? 'on' : 'off') +
+					'-changelistener_' + ((file.changeListenerEnabled) ? 'on' : 'off')});
 			}
 			}
 		});
 		});
 	}
 	}
 	
 	
+	var sanityCheck = mxUtils.bind(this, function()
+	{
+		var file = this.getCurrentFile();
+		
+		if (file != null && (file.isModified() && file.isAutosave()))
+		{
+			var delay = Date.now() - ((file.lastSaved != null) ? file.lastSaved.getTime() : file.opened);
+			
+			if (delay >  this.warnInterval && (file.lastWarned == null || Date.now() - file.lastWarned > this.warnInterval))
+			{
+				var msg = mxResources.get('ensureDataSaved');
+				
+				if (file.lastSaved != null)
+				{
+					var str = this.timeSince(new Date(file.lastSaved));
+				
+					// Only show if more than a minute ago
+					if (str != null)
+					{
+						msg = mxResources.get('lastSaved', [str]);
+					}
+				}
+				
+				EditorUi.logEvent({category: 'WARN-SAVE-FILE-' + file.getHash() + '-size_' + file.getSize(),
+					action: 'saved_' + ((file.lastSaved != null) ?  Math.round((new Date().getTime() - file.lastSaved) / 1000) : 'never') +
+					'-opened_' + ((file.opened != null) ? Math.round((new Date().getTime() - file.opened) / 1000) : 'never') +
+					'-delay_' + Math.round(delay / 1000) + '-autosave_' + ((this.editor.autosave) ? 'on' : 'off') +
+					'-changelistener_' + ((file.changeListenerEnabled) ? 'on' : 'off') +
+					'-conflict_' + ((file.inConflictState) ? 'yes' : 'no') +
+					'-checksum_' + ((file.invalidChecksum) ? 'invalid' : 'valid') +
+					'-saving_' + ((file.savingFile) ? 'true' : 'false')});
+				
+				this.showError(mxResources.get('unsavedChanges'), msg, mxResources.get('ignore'),
+					mxUtils.bind(this, function()
+					{
+						this.hideDialog();
+					}), null, mxResources.get('save'), mxUtils.bind(this, function()
+					{
+						this.actions.get((this.mode == null || !file.isEditable()) ?
+							'saveAs' : 'save').funct();
+					}), null, null, 360, 120, null, mxUtils.bind(this, function(cancel, isEsc)
+					{
+						window.setTimeout(sanityCheck, this.warnInterval);
+						file.lastWarned = Date.now();
+					}));
+			}
+			else
+			{
+				window.setTimeout(sanityCheck, this.warnInterval);
+			}
+		}
+		else
+		{
+			window.setTimeout(sanityCheck, this.warnInterval);
+		}
+	});
+	
+	window.setTimeout(sanityCheck, this.warnInterval);
+	
 	// Logs changes to autosave
 	// Logs changes to autosave
 	this.editor.addListener('autosaveChanged', mxUtils.bind(this, function()
 	this.editor.addListener('autosaveChanged', mxUtils.bind(this, function()
 	{
 	{
@@ -906,6 +970,12 @@ App.prototype.formatHideImage = (!mxClient.IS_SVG) ? IMAGE_PATH + '/format-hide.
  */
  */
 App.prototype.fullscreenImage = (!mxClient.IS_SVG) ? IMAGE_PATH + '/fullscreen.png' : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjgAAbGxAy4AEh5gNwBBGByoIBAIueBd12TUjqAAAAAElFTkSuQmCC';
 App.prototype.fullscreenImage = (!mxClient.IS_SVG) ? IMAGE_PATH + '/fullscreen.png' : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjgAAbGxAy4AEh5gNwBBGByoIBAIueBd12TUjqAAAAAElFTkSuQmCC';
 
 
+/**
+ * Interval to show dialog for unsaved data if autosave is on.
+ * Default is 300000 (5 minutes).
+ */
+App.prototype.warnInterval = 300000;
+
 /**
 /**
  * Overriden UI settings depending on mode.
  * Overriden UI settings depending on mode.
  */
  */
@@ -4115,7 +4185,7 @@ App.prototype.loadFile = function(id, sameWindow, file, success, force)
 						this.fileLoaded(file);
 						this.fileLoaded(file);
 						var currentFile = this.getCurrentFile();
 						var currentFile = this.getCurrentFile();
 						
 						
-						// Keeps ID event for converted files in chromeless mode for refresh to work
+						// Keeps ID even for converted files in chromeless mode for refresh to work
 						if (currentFile == null)
 						if (currentFile == null)
 						{
 						{
 							window.location.hash = '';
 							window.location.hash = '';

+ 19 - 49
src/main/webapp/js/diagramly/DrawioFile.js

@@ -95,15 +95,14 @@ DrawioFile.prototype.lastAutosave = null;
 DrawioFile.prototype.lastSaved = null;
 DrawioFile.prototype.lastSaved = null;
 
 
 /**
 /**
- * Stores the time stamp for the last autosave.
+ * Stores the time stamp for the last change.
  */
  */
-DrawioFile.prototype.lastWarned = null;
+DrawioFile.prototype.lastIdleReport = null;
 
 
 /**
 /**
- * Interval to show dialog for unsaved data with autosave.
- * Default is 600000 (10 minutes).
+ * Stores the time stamp for the last autosave.
  */
  */
-DrawioFile.prototype.warnInterval = 600000;
+DrawioFile.prototype.lastWarned = null;
 
 
 /**
 /**
  * Stores the time stamp when the file was opened.
  * Stores the time stamp when the file was opened.
@@ -512,15 +511,16 @@ DrawioFile.prototype.checksumError = function(error, patches, details, etag, fun
 			var uid = (user != null) ? user.id : 'unknown';
 			var uid = (user != null) ? user.id : 'unknown';
 			
 			
 			EditorUi.logError('Checksum Error in ' + functionName + ' ' + this.getId(),
 			EditorUi.logError('Checksum Error in ' + functionName + ' ' + this.getId(),
-				null, this.getMode() + '.' + this.getId(), uid + '.' +
-				((this.sync != null) ? this.sync.clientId : 'nosync'));
+				null, this.getMode() + '.' + this.getId(),
+				'user_' + uid + ((this.sync != null) ?
+				'-client_' + this.sync.clientId : '-nosync'));
 			
 			
 			// Logs checksum error for file
 			// Logs checksum error for file
 			try
 			try
 			{
 			{
 				EditorUi.logEvent({category: 'CHECKSUM-ERROR-SYNC-FILE-' + this.getHash(),
 				EditorUi.logEvent({category: 'CHECKSUM-ERROR-SYNC-FILE-' + this.getHash(),
-					action: functionName, label:  uid + '.' +
-					((this.sync != null) ? this.sync.clientId : 'nosync')});
+					action: functionName, label: 'user_' + uid + ((this.sync != null) ?
+					'-client_' + this.sync.clientId : '-nosync')});
 			}
 			}
 			catch (e)
 			catch (e)
 			{
 			{
@@ -549,7 +549,7 @@ DrawioFile.prototype.sendErrorReport = function(title, details, error, max)
 			this.ui.pages), 25000);
 			this.ui.pages), 25000);
 		var user = this.getCurrentUser();
 		var user = this.getCurrentUser();
 		var uid = (user != null) ? this.ui.hashValue(user.id) : 'unknown';
 		var uid = (user != null) ? this.ui.hashValue(user.id) : 'unknown';
-		var cid = (this.sync != null) ? this.sync.clientId : 'no sync';
+		var cid = (this.sync != null) ? '-client_' + this.sync.clientId : '-nosync';
 		var filename = this.getTitle();
 		var filename = this.getTitle();
 		var dot = filename.lastIndexOf('.');
 		var dot = filename.lastIndexOf('.');
 		var ext = 'xml';
 		var ext = 'xml';
@@ -566,7 +566,7 @@ DrawioFile.prototype.sendErrorReport = function(title, details, error, max)
 			'\nFile=' + this.ui.hashValue(this.getId()) + ' (' + this.getMode() + ')' +
 			'\nFile=' + this.ui.hashValue(this.getId()) + ' (' + this.getMode() + ')' +
 			((this.isModified()) ? ' modified' : '') +
 			((this.isModified()) ? ' modified' : '') +
 			'\nSize/Type=' + this.getSize() + ' (' + ext + ')' +
 			'\nSize/Type=' + this.getSize() + ' (' + ext + ')' +
-			'\nUser=' + uid + ' (' + cid + ')' +
+			'\nUser=' + uid + cid +
 			'\nPrefix=' + this.ui.editor.graph.model.prefix +
 			'\nPrefix=' + this.ui.editor.graph.model.prefix +
 			'\nSync=' + DrawioFile.SYNC +
 			'\nSync=' + DrawioFile.SYNC +
 			((this.sync != null) ? (((this.sync.enabled) ? ' enabled' : '') +
 			((this.sync != null) ? (((this.sync.enabled) ? ' enabled' : '') +
@@ -1210,6 +1210,14 @@ DrawioFile.prototype.getDescriptorSecret = function(desc)
 	return null;
 	return null;
 };
 };
 
 
+/**
+ * Installs the change listener.
+ */
+DrawioFile.prototype.getIdleTime = function()
+{
+	return null;
+};
+
 /**
 /**
  * Installs the change listener.
  * Installs the change listener.
  */
  */
@@ -1612,44 +1620,6 @@ DrawioFile.prototype.handleFileError = function(err, manual)
 					mxUtils.htmlEntities(mxResources.get('error')) +
 					mxUtils.htmlEntities(mxResources.get('error')) +
 					((msg != null) ? ' (' + mxUtils.htmlEntities(msg) + ')' : '') + '</div>');
 					((msg != null) ? ' (' + mxUtils.htmlEntities(msg) + ')' : '') + '</div>');
 			}
 			}
-			else if (this.isModified() && !manual && this.isAutosave())
-			{
-				if (this.lastWarned == null)
-				{
-					this.lastWarned = Date.now();
-				}
-				else if (Date.now() - this.lastWarned > this.warnInterval)
-				{
-					var msg = '';
-					
-					if (this.lastSaved != null)
-					{
-						var str = this.ui.timeSince(new Date(this.lastSaved));
-					
-						// Only show if more than a minute ago
-						if (str != null)
-						{
-							msg = mxResources.get('lastSaved', [str]);
-						}
-					}
-					
-					this.ui.showError(mxResources.get('unsavedChanges'), msg, mxResources.get('ignore'),
-						mxUtils.bind(this, function()
-						{
-							this.lastWarned = Date.now();
-							this.ui.hideDialog();
-							EditorUi.logEvent({category: 'IGNORE-WARN-SAVE-FILE-' + this.getHash() +
-								'-size-' + this.getSize(), action: 'ignore'});
-						}), null, mxResources.get('save'), mxUtils.bind(this, function()
-						{
-							this.lastWarned = Date.now();
-							this.ui.actions.get((this.ui.mode == null || !this.isEditable()) ?
-								'saveAs' : 'save').funct();
-							EditorUi.logEvent({category: 'SAVE-WARN-SAVE-FILE-' + this.getHash() +
-								'-size-' + this.getSize(), action: 'save'});
-						}), null, null, 360, 120);
-				}
-			}
 		}
 		}
 	}
 	}
 };
 };

+ 19 - 19
src/main/webapp/js/diagramly/DriveClient.js

@@ -1096,19 +1096,19 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 		{
 		{
 			if (!file.isConflict(e))
 			if (!file.isConflict(e))
 			{
 			{
-				var err = 'error-' + (file.getErrorMessage(e) || 'unknown');
+				var err = 'error_' + (file.getErrorMessage(e) || 'unknown');
 
 
 				if (e != null && e.error != null && e.error.code != null)
 				if (e != null && e.error != null && e.error.code != null)
 				{
 				{
-					err += '-code-' + e.error.code;
+					err += '-code_' + e.error.code;
 				}
 				}
 				
 				
 				EditorUi.logEvent({category: 'ERROR-SAVE-FILE-' + file.getHash() + '.' +
 				EditorUi.logEvent({category: 'ERROR-SAVE-FILE-' + file.getHash() + '.' +
-					file.desc.headRevisionId + '.' + file.desc.modifiedDate + '-size-' + file.getSize(),
-					action: err, label: ((this.user != null) ? this.user.id : 'unknown-user')  + '.' +
-					((file.sync != null) ? (file.sync.clientId + '-chan-' +
-						(file.sync.channelId || 'none')) : '-nosync') +
-					((this.ui.editor.autosave) ? '-autosave-on' : '-autosave-off')});
+					file.desc.headRevisionId + '-mod_' + file.desc.modifiedDate + '-size_' + file.getSize() +
+					((this.ui.editor.autosave) ? '-autosave_on' : '-autosave_off') +
+					'-changelistener_' + ((file.changeListenerEnabled) ? 'on' : 'off'),
+					action: err, label: ((this.user != null) ? 'user_' + this.user.id : 'unknown') +
+					((file.sync != null) ? ('-client_' + file.sync.clientId) : '-nosync')});
 			}
 			}
 		}
 		}
 		catch (ex)
 		catch (ex)
@@ -1130,7 +1130,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 				'\n\nBrowser=' + navigator.userAgent +
 				'\n\nBrowser=' + navigator.userAgent +
 				'\nFile=' + file.desc.id + '.' + file.desc.headRevisionId +
 				'\nFile=' + file.desc.id + '.' + file.desc.headRevisionId +
 				'\nUser=' + ((this.user != null) ? this.user.id : 'unknown') +
 				'\nUser=' + ((this.user != null) ? this.user.id : 'unknown') +
-				 	'.' + ((file.sync != null) ? file.sync.clientId : 'nosync') +
+				 	((file.sync != null) ? '-client_' + file.sync.clientId : '-nosync') +
 				'\nMessage=' + e.message +
 				'\nMessage=' + e.message +
 				'\n\nStack:\n' + e.stack);
 				'\n\nStack:\n' + e.stack);
 		}
 		}
@@ -1276,7 +1276,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 										new Date().toISOString() + ':' + '\n\nBrowser=' + navigator.userAgent +
 										new Date().toISOString() + ':' + '\n\nBrowser=' + navigator.userAgent +
 										'\nFile=' + file.desc.id + ' ' + file.desc.mimeType +
 										'\nFile=' + file.desc.id + ' ' + file.desc.mimeType +
 										'\nUser=' + ((this.user != null) ? this.user.id : 'unknown') +
 										'\nUser=' + ((this.user != null) ? this.user.id : 'unknown') +
-										 	'.' + ((file.sync != null) ? file.sync.clientId : 'nosync') +
+										 	((file.sync != null) ? '-client_' + file.sync.clientId : '-nosync') +
 										'\nErrors=' + temp + '\nOld=' + head0 + ' ' + mod0 + ' etag-hash=' +
 										'\nErrors=' + temp + '\nOld=' + head0 + ' ' + mod0 + ' etag-hash=' +
 										this.ui.hashValue(etag0) + '\nNew=' + resp.headRevisionId + ' ' +
 										this.ui.hashValue(etag0) + '\nNew=' + resp.headRevisionId + ' ' +
 										resp.modifiedDate + ' etag-hash=' + this.ui.hashValue(resp.etag))
 										resp.modifiedDate + ' etag-hash=' + this.ui.hashValue(resp.etag))
@@ -1319,10 +1319,10 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 									try
 									try
 									{
 									{
 										EditorUi.logEvent({category: file.convertedFrom + '-CONVERT-FILE-' + file.getHash(),
 										EditorUi.logEvent({category: file.convertedFrom + '-CONVERT-FILE-' + file.getHash(),
-											action: 'from-' + prevDesc.id + '.' + prevDesc.headRevisionId +
-											'-to-' + file.desc.id + '.' + file.desc.headRevisionId,
-											label: (this.user != null) ? this.user.id : 'unknown-user' +
-												'.' + ((file.sync != null) ? file.sync.clientId : 'nosync')});
+											action: 'from_' + prevDesc.id + '.' + prevDesc.headRevisionId +
+											'-to_' + file.desc.id + '.' + file.desc.headRevisionId,
+											label: (this.user != null) ? 'user_' + this.user.id : 'unknown' +
+											((file.sync != null) ? '-client_' + file.sync.clientId : 'nosync')});
 									}
 									}
 									catch (e)
 									catch (e)
 									{
 									{
@@ -1334,12 +1334,12 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
 								try
 								try
 								{
 								{
 									EditorUi.logEvent({category: 'SUCCESS-SAVE-FILE-' + file.getHash() +
 									EditorUi.logEvent({category: 'SUCCESS-SAVE-FILE-' + file.getHash() +
-										'.' + head0 + '.' + mod0, action: 'saved-' + resp.headRevisionId +
-										'.' + resp.modifiedDate + '-size-' + file.getSize(),
-										label: ((this.user != null) ? this.user.id : 'unknown-user') + '.' +
-										((file.sync != null) ? (file.sync.clientId + '-chan-' +
-										(file.sync.channelId || 'none')) : '-nosync') +
-										((this.ui.editor.autosave) ? '-autosave-on' : '-autosave-off')});
+										'.' + head0 + '-mod_' + mod0, action: 'saved-' + resp.headRevisionId +
+										'-mod_' + resp.modifiedDate + '-size_' + file.getSize() +
+										((this.ui.editor.autosave) ? '-autosave_on' : '-autosave_off') +
+										'-changelistener_' + ((file.changeListenerEnabled) ? 'on' : 'off'),
+										label: ((this.user != null) ? 'user_' + this.user.id : 'unknown') +
+										((file.sync != null) ? ('-client_' + file.sync.clientId) : '-nosync')});
 								}
 								}
 								catch (e)
 								catch (e)
 								{
 								{

+ 19 - 0
src/main/webapp/js/diagramly/DriveFile.js

@@ -22,6 +22,25 @@ DriveFile.prototype.saveDelay = 0;
  */
  */
 DriveFile.prototype.allChangesSavedKey = 'allChangesSavedInDrive';
 DriveFile.prototype.allChangesSavedKey = 'allChangesSavedInDrive';
 
 
+/**
+ * Installs the change listener.
+ */
+DriveFile.prototype.getIdleTime = function()
+{
+	if (this.lastSaved != null)
+	{
+		return new Date().getTime() - this.lastSaved.getTime();
+	}
+	else if (this.opened != null)
+	{
+		return new Date().getTime() - this.opened;
+	}
+	else
+	{
+		return null;
+	}
+};
+
 /**
 /**
  * Specifies if notify events should be ignored.
  * Specifies if notify events should be ignored.
  */
  */

+ 40 - 10
src/main/webapp/js/diagramly/EditorUi.js

@@ -1556,7 +1556,7 @@
 	 * @param {number} dx X-coordinate of the translation.
 	 * @param {number} dx X-coordinate of the translation.
 	 * @param {number} dy Y-coordinate of the translation.
 	 * @param {number} dy Y-coordinate of the translation.
 	 */
 	 */
-	EditorUi.prototype.downloadFile = function(format, nonCompressed, addShadow, ignoreSelection, currentPage, pageVisible, transparent)
+	EditorUi.prototype.downloadFile = function(format, nonCompressed, addShadow, ignoreSelection, currentPage, pageVisible, transparent, scale, border)
 	{
 	{
 		try
 		try
 		{
 		{
@@ -1657,7 +1657,7 @@
 							this.editor.graph.pageVisible = pageVisible;
 							this.editor.graph.pageVisible = pageVisible;
 						}
 						}
 						
 						
-						var req = this.createDownloadRequest(newTitle, format, ignoreSelection, base64, transparent, currentPage);
+						var req = this.createDownloadRequest(newTitle, format, ignoreSelection, base64, transparent, currentPage, scale, border);
 						this.editor.graph.pageVisible = prev;
 						this.editor.graph.pageVisible = prev;
 						
 						
 						return req;
 						return req;
@@ -1681,7 +1681,7 @@
 	 * @param {number} dx X-coordinate of the translation.
 	 * @param {number} dx X-coordinate of the translation.
 	 * @param {number} dy Y-coordinate of the translation.
 	 * @param {number} dy Y-coordinate of the translation.
 	 */
 	 */
-	EditorUi.prototype.createDownloadRequest = function(filename, format, ignoreSelection, base64, transparent, currentPage)
+	EditorUi.prototype.createDownloadRequest = function(filename, format, ignoreSelection, base64, transparent, currentPage, scale, border)
 	{
 	{
 		var bounds = this.editor.graph.getGraphBounds();
 		var bounds = this.editor.graph.getGraphBounds();
 		
 		
@@ -1738,7 +1738,9 @@
 			'&bg=' + ((bg != null) ? bg : mxConstants.NONE) +
 			'&bg=' + ((bg != null) ? bg : mxConstants.NONE) +
 			'&base64=' + base64 + '&embedXml=' + embed + '&xml=' +
 			'&base64=' + base64 + '&embedXml=' + embed + '&xml=' +
 			encodeURIComponent(data) + ((filename != null) ?
 			encodeURIComponent(data) + ((filename != null) ?
-			'&filename=' + encodeURIComponent(filename) : ''));
+			'&filename=' + encodeURIComponent(filename) : '') +
+			(scale != null? '&scale=' + scale : '') +
+			(border != null? '&border=' + border : ''));
 	};
 	};
 	
 	
 	/**
 	/**
@@ -5105,16 +5107,39 @@
 	/**
 	/**
 	 * 
 	 * 
 	 */
 	 */
-	EditorUi.prototype.showRemoteExportDialog = function(btnLabel, helpLink, callback, hideInclude)
+	EditorUi.prototype.showRemoteExportDialog = function(btnLabel, helpLink, callback, hideInclude, showZoomBorder)
 	{
 	{
 		var div = document.createElement('div');
 		var div = document.createElement('div');
 		div.style.whiteSpace = 'nowrap';
 		div.style.whiteSpace = 'nowrap';
 		
 		
 		var hd = document.createElement('h3');
 		var hd = document.createElement('h3');
 		mxUtils.write(hd, mxResources.get('image'));
 		mxUtils.write(hd, mxResources.get('image'));
-		hd.style.cssText = 'width:100%;text-align:center;margin-top:0px;margin-bottom:4px';
+		hd.style.cssText = 'width:100%;text-align:center;margin-top:0px;margin-bottom:' + (showZoomBorder? '10' : '4') +'px';
 		div.appendChild(hd);
 		div.appendChild(hd);
 
 
+		if (showZoomBorder)
+		{
+			mxUtils.write(div, mxResources.get('zoom') + ':');
+			var zoomInput = document.createElement('input');
+			zoomInput.setAttribute('type', 'text');
+			zoomInput.style.marginRight = '16px';
+			zoomInput.style.width = '60px';
+			zoomInput.style.marginLeft = '4px';
+			zoomInput.style.marginRight = '12px';
+			zoomInput.value = this.lastExportZoom || '100%';
+			div.appendChild(zoomInput);
+			
+			mxUtils.write(div, mxResources.get('borderWidth') + ':');
+			var borderInput = document.createElement('input');
+			borderInput.setAttribute('type', 'text');
+			borderInput.style.marginRight = '16px';
+			borderInput.style.width = '60px';
+			borderInput.style.marginLeft = '4px';
+			borderInput.value = this.lastExportBorder || '0';
+			div.appendChild(borderInput);
+			mxUtils.br(div);
+		}
+		
 		var selection = this.addCheckbox(div, mxResources.get('selectionOnly'), false,
 		var selection = this.addCheckbox(div, mxResources.get('selectionOnly'), false,
 			this.editor.graph.isSelectionEmpty());
 			this.editor.graph.isSelectionEmpty());
 		var include = (hideInclude) ? null : this.addCheckbox(div, mxResources.get('includeCopyOfMyDiagram'), true);
 		var include = (hideInclude) ? null : this.addCheckbox(div, mxResources.get('includeCopyOfMyDiagram'), true);
@@ -5130,10 +5155,13 @@
 		
 		
 		var dlg = new CustomDialog(this, div, mxUtils.bind(this, function()
 		var dlg = new CustomDialog(this, div, mxUtils.bind(this, function()
 		{
 		{
+			var scale = parseInt(zoomInput.value) / 100 || 1;
+			var border = parseInt(borderInput.value) || 0;
+			
 			callback(!selection.checked, (include != null) ? include.checked : false,
 			callback(!selection.checked, (include != null) ? include.checked : false,
-				(transparent != null) ? transparent.checked : false);
+				(transparent != null) ? transparent.checked : false, scale, border);
 		}), null, btnLabel, helpLink);
 		}), null, btnLabel, helpLink);
-		this.showDialog(dlg.container, 300, (hideInclude) ? 100 : 186, true, true);
+		this.showDialog(dlg.container, 300, (showZoomBorder? 25 : 0) + (hideInclude ? 125 : 210), true, true);
 	};
 	};
 	
 	
 	/**
 	/**
@@ -10844,6 +10872,7 @@
 		try
 		try
 		{
 		{
     		var lines = text.split('\n');
     		var lines = text.split('\n');
+    		var allCells = [];
     		var cells = [];
     		var cells = [];
     		var dups = {};
     		var dups = {};
     		
     		
@@ -11160,6 +11189,7 @@
 							{
 							{
 		    					var parent = (parentIndex != null) ? graph.model.getCell(
 		    					var parent = (parentIndex != null) ? graph.model.getCell(
 		    						namespace + values[parentIndex]) : null;
 		    						namespace + values[parentIndex]) : null;
+								allCells.push(cell);
 		    					
 		    					
 		    					if (parent != null)
 		    					if (parent != null)
 		    					{
 		    					{
@@ -11247,9 +11277,9 @@
 					// Removes ignored attributes after processing above
 					// Removes ignored attributes after processing above
 					if (ignore != null)
 					if (ignore != null)
 					{
 					{
-						for (var i = 0; i < cells.length; i++)
+						for (var i = 0; i < allCells.length; i++)
 						{
 						{
-							var cell = cells[i];
+							var cell = allCells[i];
 							
 							
 							for (var j = 0; j < ignore.length; j++)
 							for (var j = 0; j < ignore.length; j++)
 					    	{
 					    	{

+ 6 - 6
src/main/webapp/js/diagramly/Menus.js

@@ -540,10 +540,10 @@
 			}
 			}
 			else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
 			else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
 			{
 			{
-				editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable, transparent)
+				editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable, transparent, scale, border)
 				{
 				{
-					editorUi.downloadFile((editable) ? 'xmlpng' : 'png', null, null, ignoreSelection, null, null, transparent);
-				}));
+					editorUi.downloadFile((editable) ? 'xmlpng' : 'png', null, null, ignoreSelection, null, null, transparent, scale, border);
+				}), false, true);
 			}
 			}
 		}));
 		}));
 		
 		
@@ -567,10 +567,10 @@
 			}
 			}
 			else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
 			else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
 			{
 			{
-				editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable)
+				editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable, tranaparent, scale, border)
 				{
 				{
-					editorUi.downloadFile('jpeg', null, null, ignoreSelection);
-				}), true);
+					editorUi.downloadFile('jpeg', null, null, ignoreSelection, null, null, null, scale, border);
+				}), true, true);
 			}
 			}
 		}));
 		}));
 		
 		

+ 32 - 23
src/main/webapp/js/diagramly/OneDriveClient.js

@@ -812,33 +812,42 @@ OneDriveClient.prototype.saveFile = function(file, success, error, etag)
 			// Workaround for truncated files in OneDrive is to check if file size is correct
 			// Workaround for truncated files in OneDrive is to check if file size is correct
 			try
 			try
 			{
 			{
-				// Returns string length in bytes instead of chars
-				function lengthInUtf8Bytes(str)
+				// Returns string length in bytes instead of chars to check returned file size
+				function byteCount(str)
 				{
 				{
-					  // Matches only the 10.. bytes that are non-initial characters in a multi-byte sequence.
-					  var m = encodeURIComponent(str).match(/%[89ABab]/g);
-					  
-					  return str.length + (m ? m.length : 0);
-				}
+					try
+					{
+						return new Blob([str]).size
+					}
+					catch (e)
+					{
+						// ignore
+					}
+					
+					return null;
+				};
 				
 				
-				var exp = (typeof data === 'string') ? lengthInUtf8Bytes(data) : data.size;
-
-				if (resp != null && resp.size != exp)
+				if (typeof window.Blob !== 'undefined')
 				{
 				{
-					// Logs failed save
-					var user = this.getUser();
+					var exp = (typeof data === 'string') ? byteCount(data) : data.size;
 					
 					
-					EditorUi.sendReport('Critical: Truncated OneDrive File ' +
-						new Date().toISOString() + ':' + '\n\nBrowser=' + navigator.userAgent +
-						'\nFile=' + file.getId() + ' ' + file.meta.file.mimeType +
-						'\nUser=' + ((user != null) ? user.id : 'unknown') +
-						 	'.' + ((file.sync != null) ? file.sync.clientId : 'nosync') +
-						'\nExpected=' + exp + ' Actual=' + resp.size)
-					EditorUi.logError('Critical: Truncated OneDrive File ' + file.getId(),
-						null, 'expected_' + exp + '-actual_' + resp.size +
-						'-mime_' + file.meta.file.mimeType,
-						((user != null) ? user.id : 'unknown') + '.' +
-						((file.sync != null) ? file.sync.clientId : 'nosync'));
+					if (resp != null && exp != null && resp.size != exp)
+					{
+						// Logs failed save
+						var user = this.getUser();
+						
+						EditorUi.sendReport('Critical: Truncated OneDrive File ' +
+							new Date().toISOString() + ':' + '\n\nBrowser=' + navigator.userAgent +
+							'\nFile=' + file.getId() + '\nMime=' + file.meta.file.mimeType +
+							'\nUser=' + ((user != null) ? user.id : 'unknown') +
+							 	'.' + ((file.sync != null) ? file.sync.clientId : 'nosync') +
+							'\nExpected=' + exp + ' Actual=' + resp.size)
+						EditorUi.logError('Critical: Truncated OneDrive File ' + file.getId(),
+							null, 'expected_' + exp + '-actual_' + resp.size +
+							'-mime_' + file.meta.file.mimeType,
+							((user != null) ? user.id : 'unknown') + '.' +
+							((file.sync != null) ? file.sync.clientId : 'nosync'));
+					}
 				}
 				}
 			}
 			}
 			catch (e)
 			catch (e)

+ 65 - 31
src/main/webapp/js/diagramly/vsdx/mxVsdxCanvas2D.js

@@ -841,21 +841,26 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 			
 			
 			charSect.appendChild(charRow);
 			charSect.appendChild(charRow);
 			
 			
-//			var pRow = that.createElt("Row");
-//			pRow.setAttribute('IX', pIndex);
-//			
-//			var align = 1; //center is default
-//			
-//			switch(styleMap['align'])
-//			{
-//				case 'left': align = 0; break;
-//				case 'center': align = 1; break;
-//				case 'right': align = 2; break;
-//			}
+			var pRow = that.createElt("Row");
+			pRow.setAttribute('IX', pIndex);
 			
 			
-//			pRow.appendChild(that.createCellElem("HorzAlign", align));
+			var align = 1; //center is default
+			
+			switch(styleMap['align'])
+			{
+				case 'left': align = 0; break;
+				case 'center': align = 1; break;
+				case 'right': align = 2; break;
+				case 'start': align = 0; break; //TODO check right-to-left
+				case 'end': align = 2; break; //TODO check right-to-left
+				case 'justify': align = 0; break;
+				default:
+					align = 1;
+			}
+			
+			pRow.appendChild(that.createCellElem("HorzAlign", align));
 //			pRow.appendChild(that.createCellElem("SpLine", "-1.2"));
 //			pRow.appendChild(that.createCellElem("SpLine", "-1.2"));
-//			pSect.appendChild(pRow);
+			pSect.appendChild(pRow);
 			
 			
 //			var pp = that.createElt("pp");
 //			var pp = that.createElt("pp");
 //			pp.setAttribute('IX', pIndex++);
 //			pp.setAttribute('IX', pIndex++);
@@ -884,7 +889,9 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 						italic: pStyle['italic'] || (fontStyle & 2),
 						italic: pStyle['italic'] || (fontStyle & 2),
 						underline: pStyle['underline'] || (fontStyle & 4)
 						underline: pStyle['underline'] || (fontStyle & 4)
 					};
 					};
-					createTextRow(styleMap, charSect, pSect, text, ch[i].textContent);
+					
+					//VSDX doesn't have numbered list!
+					createTextRow(styleMap, charSect, pSect, text, (pStyle['OL']? pStyle['LiIndex'] + '. ' : '') + ch[i].textContent);
 				} 
 				} 
 				else if (ch[i].nodeType == 1) 
 				else if (ch[i].nodeType == 1) 
 				{ //element
 				{ //element
@@ -899,31 +906,58 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 						fontColor: rgb2hex(style.getPropertyValue('color')),
 						fontColor: rgb2hex(style.getPropertyValue('color')),
 						fontSize: parseFloat(style.getPropertyValue('font-size')),
 						fontSize: parseFloat(style.getPropertyValue('font-size')),
 						fontFamily: style.getPropertyValue('font-family').replace(/"/g, ''), //remove quotes
 						fontFamily: style.getPropertyValue('font-family').replace(/"/g, ''), //remove quotes
-						blockElem: style.getPropertyValue('display') == 'block' || nodeName == "BR" || nodeName == "LI"
+						blockElem: style.getPropertyValue('display') == 'block' || nodeName == "BR" || nodeName == "LI",
+						OL: pStyle['OL'],
+						LiIndex: pStyle['LiIndex']
 					};
 					};
 					
 					
-//					if (nodeName == "OL" || nodeName == "UL")
-//					{
-//						var pRow = that.createElt("Row");
-//						pRow.setAttribute('IX', pIndex);
-//						
-//						pRow.appendChild(that.createCellElem("HorzAlign", "0"));
-//						pRow.appendChild(that.createCellElem("Bullet", "1"));
-//						pSect.appendChild(pRow);
-//						
-//						var pp = that.createElt("pp");
-//						pp.setAttribute('IX', pIndex++);
-//						text.appendChild(pp);
-//					}
+					if (nodeName == "UL")
+					{
+						var pRow = that.createElt("Row");
+						pRow.setAttribute('IX', pIndex);
+						
+						pRow.appendChild(that.createCellElem("HorzAlign", "0"));
+						pRow.appendChild(that.createCellElem("Bullet", "1"));
+						pSect.appendChild(pRow);
+						
+						var pp = that.createElt("pp");
+						pp.setAttribute('IX', pIndex++);
+						text.appendChild(pp);
+					}
+					//VSDX doesn't have numbered list!
+					else if (nodeName == "OL")
+					{
+						styleMap['OL'] = true;
+					}
+					else if (nodeName == "LI")
+					{
+						styleMap['LiIndex'] = i + 1;
+					}
 					
 					
 					if (chLen > 0)
 					if (chLen > 0)
 					{
 					{
-						createTextRow(styleMap, charSect, pSect, text, ""); //to handle block elements if any
 						processNodeChildren(ch[i].childNodes, styleMap);
 						processNodeChildren(ch[i].childNodes, styleMap);
+						
+						//Close the UL by adding another pp with no Vullets
+						if (nodeName == "UL")
+						{
+							var pRow = that.createElt("Row");
+							pRow.setAttribute('IX', pIndex);
+							
+							pRow.appendChild(that.createCellElem("Bullet", "0"));
+							pSect.appendChild(pRow);
+							
+							var pp = that.createElt("pp");
+							pp.setAttribute('IX', pIndex++);
+							text.appendChild(pp);
+						}
+
+						createTextRow(styleMap, charSect, pSect, text, ""); //to handle block elements if any
 					}
 					}
 					else
 					else
 					{
 					{
-						createTextRow(styleMap, charSect, pSect, text, ch[i].textContent);
+						//VSDX doesn't have numbered list!
+						createTextRow(styleMap, charSect, pSect, text, (pStyle['OL']? pStyle['LiIndex'] + '. ' : '') + ch[i].textContent);
 					}
 					}
 				}
 				}
 			}
 			}
@@ -1038,7 +1072,7 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 		
 		
 		
 		
 		this.shape.appendChild(charSect);
 		this.shape.appendChild(charSect);
-//		this.shape.appendChild(pSect);
+		this.shape.appendChild(pSect);
 		this.shape.appendChild(text);
 		this.shape.appendChild(text);
 //		if (overflow != null)
 //		if (overflow != null)
 //		{
 //		{

File diff suppressed because it is too large
+ 305 - 304
src/main/webapp/js/extensions.min.js


+ 14 - 5
src/main/webapp/js/mxgraph/EditorUi.js

@@ -3431,14 +3431,23 @@ EditorUi.prototype.hideDialog = function(cancel, isEsc)
 		}
 		}
 		
 		
 		this.dialog = (this.dialogs.length > 0) ? this.dialogs[this.dialogs.length - 1] : null;
 		this.dialog = (this.dialogs.length > 0) ? this.dialogs[this.dialogs.length - 1] : null;
-
+		this.editor.fireEvent(new mxEventObject('hideDialog'));
+		
 		if (this.dialog == null && this.editor.graph.container.style.visibility != 'hidden')
 		if (this.dialog == null && this.editor.graph.container.style.visibility != 'hidden')
 		{
 		{
-			this.editor.graph.container.focus();
+			window.setTimeout(mxUtils.bind(this, function()
+			{
+				if (this.editor.graph.isEditing() && this.editor.graph.cellEditor.textarea != null)
+				{
+					this.editor.graph.cellEditor.textarea.focus();
+				}
+				else
+				{
+					mxUtils.clearSelection();
+					this.editor.graph.container.focus();
+				}
+			}), 0);
 		}
 		}
-		
-		mxUtils.clearSelection();
-		this.editor.fireEvent(new mxEventObject('hideDialog'));
 	}
 	}
 };
 };
 
 

File diff suppressed because it is too large
+ 619 - 617
src/main/webapp/js/viewer.min.js


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

@@ -1,5 +1,3 @@
-# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*
-# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE
 aboutDrawio=About draw.io
 aboutDrawio=About draw.io
 accessDenied=Access Denied
 accessDenied=Access Denied
 action=Action
 action=Action