ソースを参照

9.5.5 release

Former-commit-id: 55d983c600b04367188ad06a9ed0fd8b1c23f16c
Gaudenz Alder 6 年 前
コミット
2edc3d1607

+ 6 - 1
ChangeLog

@@ -1,6 +1,11 @@
+03-DEC-2018: 9.5.5
+
+- Adds unsaved status for new files in Desktop
+- Fixes minor CSS issues
+
 03-DEC-2018: 9.5.4
 
-- Fixes possible NPE in Desktop app
+- Fixes possible NPE in Desktop
 
 03-DEC-2018: 9.5.3
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-9.5.4
+9.5.5

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

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 12/03/2018 07:26 PM
+# 12/03/2018 10:08 PM
 
 app.html
 index.html?offline=1

ファイルの差分が大きいため隠しています
+ 435 - 434
src/main/webapp/js/app.min.js


ファイルの差分が大きいため隠しています
+ 127 - 126
src/main/webapp/js/atlas-viewer.min.js


ファイルの差分が大きいため隠しています
+ 140 - 139
src/main/webapp/js/atlas.min.js


+ 2 - 0
src/main/webapp/js/diagramly/App.js

@@ -4530,6 +4530,8 @@ App.prototype.descriptorChanged = function()
 			}
 		}
 	}
+	
+	this.updateUi();
 };
 
 /**

+ 2 - 2
src/main/webapp/js/diagramly/DrawioFile.js

@@ -318,7 +318,7 @@ DrawioFile.prototype.reloadFile = function(success)
 	{
 		this.ui.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function()
 		{
-			this.handleFileError();
+			this.handleFileSuccess(DrawioFile.SYNC == 'manual');
 		}), fn, mxResources.get('cancel'), mxResources.get('discardChanges'));
 	}
 	else
@@ -1315,7 +1315,7 @@ DrawioFile.prototype.fileChanged = function()
 	else if ((!this.isAutosaveOptional() || !this.ui.editor.autosave) &&
 		!this.inConflictState)
 	{
-		this.handleFileError();
+		this.addUnsavedStatus();
 	}
 };
 

+ 12 - 2
src/main/webapp/js/diagramly/DriveClient.js

@@ -566,8 +566,18 @@ DriveClient.prototype.updateUser = function(success, error, remember)
     	// Requests more information about the user (email address is sometimes not in info)
     	this.executeRequest(gapi.client.drive.about.get(), mxUtils.bind(this, function(resp)
     	{
-    		this.setUser(new DrawioUser(info.id, resp.user.emailAddress, resp.user.displayName,
-    				(resp.user.picture != null) ? resp.user.picture.url : null, info.locale));
+    		var email = mxResources.get('notAvailable');
+    		var name = email;
+    		var pic = null;
+    		
+    		if (resp != null && resp.user != null)
+    		{
+    			email = resp.user.emailAddress;
+    			name = resp.user.displayName;
+    			pic = (resp.user.picture != null) ? resp.user.picture.url : null;
+    		}
+    		
+    		this.setUser(new DrawioUser(info.id, email, name, pic, info.locale));
         	this.setUserId(info.id, remember);
 
     		if (success != null)

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

@@ -1337,7 +1337,7 @@
 	                }
 	            });
 	            
-	            option.style.paddingTop = '0px';
+	            option.style.paddingTop = '5px';
 	            div.appendChild(option);
 	            
 	            var help = ui.menus.createHelpLink('https://desk.draw.io/support/solutions/articles/16000032875');

+ 5 - 2
src/main/webapp/js/diagramly/EditorUi.js

@@ -927,7 +927,10 @@
 				
 				if (forceReload)
 				{
-					currentFile.reloadFile();
+					currentFile.reloadFile(mxUtils.bind(this, function()
+					{
+						currentFile.handleFileSuccess(DrawioFile.SYNC == 'manual');
+					}));
 				}
 				else
 				{
@@ -4111,7 +4114,7 @@
 		cb.style.marginRight = '8px';
 		cb.style.marginTop = '16px';
 		cb.setAttribute('type', asRadio? 'radio' : 'checkbox');
-		var id = 'cb' + Math.random();
+		var id = 'geCheckbox-' + Editor.guid();
 		cb.id = id;
 		
 		if (radioGroupName != null)

+ 74 - 44
src/main/webapp/js/diagramly/ElectronApp.js

@@ -540,12 +540,22 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 
 	LocalFile.prototype.getLatestVersion = function(success, error)
 	{
-		this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
+		if (this.fileObject == null)
 		{
-			var file = new LocalFile(this, data, '');
-			file.stat = stat;
-			success(file);
-		}), error, this.fileObject.path);
+			if (error != null)
+			{
+				error({message: mxResources.get('fileNotFound')});
+			}
+		}
+		else
+		{
+			this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
+			{
+				var file = new LocalFile(this, data, '');
+				file.stat = stat;
+				success(file);
+			}), error, this.fileObject.path);
+		}
 	};
 	
 	// Call save as for copy
@@ -570,54 +580,61 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 	
 	LocalFile.prototype.reloadFile = function(success)
 	{
-		this.ui.spinner.stop();
-		
-		var fn = mxUtils.bind(this, function()
+		if (this.fileObject == null)
+		{
+			this.ui.handleError({message: mxResources.get('fileNotFound')});
+		}
+		else
 		{
-			this.setModified(false);
-			var page = this.ui.currentPage;
-			var viewState = this.ui.editor.graph.getViewState();
-			var selection = this.ui.editor.graph.getSelectionCells();
+			this.ui.spinner.stop();
 			
-			if (this.ui.spinner.spin(document.body, mxResources.get('loading')))
+			var fn = mxUtils.bind(this, function()
 			{
-				this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
+				this.setModified(false);
+				var page = this.ui.currentPage;
+				var viewState = this.ui.editor.graph.getViewState();
+				var selection = this.ui.editor.graph.getSelectionCells();
+				
+				if (this.ui.spinner.spin(document.body, mxResources.get('loading')))
 				{
-					this.ui.spinner.stop();
-					
-					var file = new LocalFile(this.ui, data, '');
-					file.fileObject = fileEntry;
-					file.stat = stat;
-					
-					this.ui.fileLoaded(file);
-					this.ui.restoreViewState(page, viewState, selection);
-	
-					if (this.backupPatch != null)
+					this.ui.readGraphFile(mxUtils.bind(this, function(fileEntry, data, stat)
 					{
-						this.patch([this.backupPatch]);
-					}
-					
-					if (success != null)
+						this.ui.spinner.stop();
+						
+						var file = new LocalFile(this.ui, data, '');
+						file.fileObject = fileEntry;
+						file.stat = stat;
+						
+						this.ui.fileLoaded(file);
+						this.ui.restoreViewState(page, viewState, selection);
+		
+						if (this.backupPatch != null)
+						{
+							this.patch([this.backupPatch]);
+						}
+						
+						if (success != null)
+						{
+							success();
+						}
+					}), mxUtils.bind(this, function(err)
 					{
-						success();
-					}
-				}), mxUtils.bind(this, function(err)
+						this.ui.handleFileError(err);
+					}), this.fileObject.path);
+				}
+			});
+	
+			if (this.isModified() && this.backupPatch == null)
+			{
+				this.ui.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function()
 				{
-					this.ui.handleFileError(err);
-				}), this.fileObject.path);
+					this.handleFileSuccess(DrawioFile.SYNC == 'manual');
+				}), fn, mxResources.get('cancel'), mxResources.get('discardChanges'));
 			}
-		});
-
-		if (this.isModified() && this.backupPatch == null)
-		{
-			this.ui.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function()
+			else
 			{
-				this.handleFileError();
-			}), fn, mxResources.get('cancel'), mxResources.get('discardChanges'));
-		}
-		else
-		{
-			fn();
+				fn();
+			}
 		}
 	};
 
@@ -936,6 +953,19 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 		}
 	};
 	
+	
+	/**
+	 * Updates action states depending on the selection.
+	 */
+	var editorUiUpdateActionStates = EditorUi.prototype.updateActionStates;
+	EditorUi.prototype.updateActionStates = function()
+	{
+		editorUiUpdateActionStates.apply(this, arguments);
+
+		var file = this.getCurrentFile();
+		this.actions.get('synchronize').setEnabled(file != null && file.fileObject != null);
+	};
+	
 	EditorUi.prototype.saveLocalFile = function(data, filename, mimeType, base64Encoded, format, allowBrowser)
 	{
 		this.saveData(filename, format, data, mimeType, base64Encoded);

+ 7 - 5
src/main/webapp/js/diagramly/Minimal.js

@@ -18,17 +18,19 @@ EditorUi.initMinimalTheme = function()
        var style = document.createElement('style')
        style.type = 'text/css';
        style.innerHTML = '* { -webkit-font-smoothing: antialiased; }' +
-       	   'html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0;}' +
+       	   'html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }' +
+       	   'html body table.mxWindow td.mxWindowPane div.mxWindowPane * { font-size:9pt; }' +
            'html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }' +
            'html body button.geBtn:active { opacity: 0.6; }' +
-           '.geDialog input, .geToolbarContainer input, .mxWindow input {padding:2px !important;display:inline-block !important; }' +
+           'html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }' +
            'div.geDialog { border-radius: 5px; }' +
            'html body div.geDialog button.geBigButton { color: #fff !important; }' +
            '.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }' +
            'html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }' +
-           'html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-color: rgb(216, 216, 216); }' +
+           'html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }' +
+           'html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }' +
+           'html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }' +
            'div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }' +
-           'div.diagramContainer button.geBtn:hover, .mxWindow button.geBtn:hover, .geDialog button.geBtn:hover { box-shadow: none; border-color: rgb(216, 216, 216); }' +
            'div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }' +
            'html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }' +
            'html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }' +
@@ -118,7 +120,7 @@ EditorUi.initMinimalTheme = function()
 	    {
 	        ui.formatWindow = new WrapperWindow(ui, mxResources.get('format'),
 	           Math.max(20, ui.diagramContainer.clientWidth - 240 - 12), 56,
-	           240, Math.min(550, graph.container.clientHeight - 10), function(container)
+	           240, Math.min(560, graph.container.clientHeight - 10), function(container)
 	        {
 	            var format = ui.createFormat(container);
 	            format.init();

ファイルの差分が大きいため隠しています
+ 1 - 1
src/main/webapp/js/embed-static.min.js


+ 13 - 6
src/main/webapp/js/mxgraph/Format.js

@@ -363,6 +363,7 @@ Format.prototype.refresh = function()
 	label.style.paddingTop = '8px';
 	label.style.height = (mxClient.IS_QUIRKS) ? '34px' : '25px';
 	label.style.width = '100%';
+	label.style.cursor = 'pointer';
 	this.container.appendChild(div);
 	
 	if (graph.isSelectionEmpty())
@@ -450,6 +451,10 @@ Format.prototype.refresh = function()
 			});
 			
 			mxEvent.addListener(elt, 'click', clickHandler);
+			mxEvent.addListener(elt, 'mousedown', function(evt)
+			{
+				mxEvent.consume(evt);
+			});
 			
 			if (index == ((containsLabel) ? this.labelIndex : this.currentIndex))
 			{
@@ -3565,7 +3570,7 @@ TextFormatPanel.prototype.addFont = function(container)
 						
 						function getRelativeLineHeight(fontSize, css, elt)
 						{
-							if (css != null)
+							if (elt.style != null && css != null)
 							{
 								var lineHeight = css.lineHeight
 								
@@ -3585,9 +3590,11 @@ TextFormatPanel.prototype.addFont = function(container)
 							}
 						};
 						
-						function getAbsoluteFontSize(fontSize)
+						function getAbsoluteFontSize(css)
 						{
-							if (fontSize.substring(fontSize.length - 2) == 'px')
+							var fontSize = (css != null) ? css.fontSize : null;
+								
+							if (fontSize != null && fontSize.substring(fontSize.length - 2) == 'px')
 							{
 								return parseFloat(fontSize);
 							}
@@ -3595,10 +3602,10 @@ TextFormatPanel.prototype.addFont = function(container)
 							{
 								return mxConstants.DEFAULT_FONTSIZE;
 							}
-						}
+						};
 						
 						var css = mxUtils.getCurrentStyle(node);
-						var fontSize = getAbsoluteFontSize(css.fontSize);
+						var fontSize = getAbsoluteFontSize(css);
 						var lineHeight = getRelativeLineHeight(fontSize, css, node);
 
 						// Finds common font size
@@ -3614,7 +3621,7 @@ TextFormatPanel.prototype.addFont = function(container)
 								if (selection.containsNode(elts[i], true))
 								{
 									temp = mxUtils.getCurrentStyle(elts[i]);
-									fontSize = Math.max(getAbsoluteFontSize(temp.fontSize), fontSize);
+									fontSize = Math.max(getAbsoluteFontSize(temp), fontSize);
 									var lh = getRelativeLineHeight(fontSize, temp, elts[i]);
 									
 									if (lh != lineHeight || isNaN(lh))

ファイルの差分が大きいため隠しています
+ 1 - 1
src/main/webapp/js/reader.min.js


ファイルの差分が大きいため隠しています
+ 127 - 126
src/main/webapp/js/viewer.min.js