Selaa lähdekoodia

10.0.17 release

Gaudenz Alder 6 vuotta sitten
vanhempi
commit
92044b9f5d

+ 10 - 0
ChangeLog

@@ -1,3 +1,13 @@
+03-JAN-2019: 10.0.17
+
+- Fixes sync for PNG files in desktop app
+- Fixes handling of auth error in Drive
+- Uses main app ID for Drive viewer
+- Fixes clipping in Google add-ons
+- Uses mxGraph 3.9.13 beta 2
+- Fixes redo button state
+- Removes debug output
+
 02-JAN-2019: 10.0.16
 
 - Handles shadow change during catchup

+ 1 - 1
VERSION

@@ -1 +1 @@
-10.0.16
+10.0.17

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 2
etc/mxgraph/mxClient.js


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

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 01/02/2019 11:59 AM
+# 01/03/2019 02:35 PM
 
 app.html
 index.html?offline=1

+ 11 - 9
src/main/webapp/export3.html

@@ -249,7 +249,7 @@
 					graph.getPageSize = function()
 					{
 						return new mxRectangle(0, 0, this.pageFormat.width * this.pageScale,
-								this.pageFormat.height * this.pageScale);
+							this.pageFormat.height * this.pageScale);
 					};
 					
 					graph.getPageLayout = function()
@@ -285,9 +285,9 @@
 						var page = this.graph.getPageSize();
 						
 						return new mxRectangle(this.scale * (this.translate.x + layout.x * page.width),
-								this.scale * (this.translate.y + layout.y * page.height),
-								this.scale * layout.width * page.width,
-								this.scale * layout.height * page.height);
+							this.scale * (this.translate.y + layout.y * page.height),
+							this.scale * layout.width * page.width,
+							this.scale * layout.height * page.height);
 					};
 				}
 	
@@ -300,13 +300,14 @@
 					{
 						var s = Math.min(data.w / b.width, data.h / b.height);
 						graph.view.scaleAndTranslate(s,
-							Math.floor(data.border / s - b.x),
-							Math.floor(data.border / s - b.y));
+							Math.floor(data.border / s - Math.floor(b.x)),
+							Math.floor(data.border / s - Math.floor(b.y)));
 					}
 					else
 					{
-						graph.view.scaleAndTranslate(data.scale, Math.floor(data.border - b.x),
-							Math.floor(data.border - b.y));
+						graph.view.scaleAndTranslate(data.scale,
+							Math.floor(data.border - Math.floor(b.x)),
+							Math.floor(data.border - Math.floor(b.y)));
 					}
 				}
 				else
@@ -354,7 +355,8 @@
 					x0 -= layout.x * pf.width;
 					y0 -= layout.y * pf.height;
 					
-					if (preview == null) {
+					if (preview == null)
+					{
 						preview = new mxPrintPreview(graph, scale, pf, border, x0, y0);
 						preview.printBackgroundImage = true;
 						preview.autoOrigin = autoOrigin;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 727 - 728
src/main/webapp/js/app.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 13 - 14
src/main/webapp/js/atlas-viewer.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 317 - 317
src/main/webapp/js/atlas.min.js


+ 16 - 4
src/main/webapp/js/diagramly/Dialogs.js

@@ -856,6 +856,11 @@ var ConfirmDialog = function(editorUi, message, okFn, cancelFn, okLabel, cancelL
 		btns.style.marginTop = '16px';
 	}
 
+	this.init = function()
+	{
+		okBtn.focus();
+	};
+	
 	this.container = div;
 };
 
@@ -3287,7 +3292,8 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
 	
 	mxEvent.addListener(nameInput, 'keypress', function(e)
 	{
-		if (e.keyCode == 13)
+		if (editorUi.dialog.container.firstChild == outer &&
+			e.keyCode == 13)
 		{
 			create();
 		}
@@ -4810,20 +4816,26 @@ var AboutDialog = function(editorUi)
 		img.style.height = '219px';
 		img.setAttribute('src', IMAGE_PATH + '/logo-flat.png');
 	}
-
+	
+	if (uiTheme == 'dark')
+	{
+		img.style.filter = 'grayscale(100%) invert(100%)';
+	}
+	
 	div.appendChild(img);
 	mxUtils.br(div);
 	
+	var clr = (uiTheme == 'dark') ? '#cccccc' : '#505050';
 	var v = document.createElement('small');
 	v.innerHTML = 'v ' + EditorUi.VERSION;
-	v.style.color = '#505050';
+	v.style.color = clr;
 	div.appendChild(v);
 	
 	mxUtils.br(div);
 	mxUtils.br(div);
 
 	var small = document.createElement('small');
-	small.style.color = '#505050';
+	small.style.color = clr;
 	small.innerHTML = '&copy; 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
 	div.appendChild(small);
 	

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

@@ -120,6 +120,7 @@ DrawioFile.prototype.reportEnabled = true;
  * Specifies if notify events should be ignored.
  */
 DrawioFile.prototype.stats = {
+	merges: 0, /* number of calls to merge */
 	joined: 0, /* number of join messages received */
 	reloads: 0, /* number of times the file was reloaded */
 	checksumErrors: 0, /* number of checksum errors */
@@ -413,7 +414,7 @@ DrawioFile.prototype.checksumError = function(error, patches, details)
 
 		var data = this.compressReportData(
 			this.getAnonymizedXmlForPages(
-			this.shadowPages));
+			this.shadowPages), 20000);
 		var json = this.compressReportData(
 			JSON.stringify(patches, null, 2));
 		
@@ -458,7 +459,7 @@ DrawioFile.prototype.sendErrorReport = function(title, details, error)
 		
 		EditorUi.sendReport(title + ' ' + new Date().toISOString() + ':' +
 			'\n\nBrowser=' + navigator.userAgent +
-			'\nFile=' + this.getId() + ' (' + this.getMode() + ')' +
+			'\nFile=' + this.ui.hashValue(this.getId()) + ' (' + this.getMode() + ')' +
 			((this.sync != null) ? ('\nClient=' + this.sync.clientId) : '') +
 			'\nUser=' + uid +
 			'\nExt=' + ext +
@@ -919,9 +920,6 @@ DrawioFile.prototype.open = function()
 		
 		// Updates shadow in case any page IDs have been updated
 		this.shadowData = mxUtils.getXml(this.ui.getXmlFileData());
-		this.stats.openTimestamp = new Date().toISOString();
-		this.stats.openShadowLength = (this.shadowData != null) ?
-			this.shadowData.length : 0;
 	}
 
 	this.installListeners();
@@ -982,7 +980,9 @@ DrawioFile.prototype.loadPatchDescriptor = function(success, error)
  */
 DrawioFile.prototype.startSync = function()
 {
-	if (DrawioFile.SYNC == 'auto' && urlParams['stealth'] != '1')
+	if ((DrawioFile.SYNC == 'auto' && urlParams['stealth'] != '1') &&
+		(urlParams['rt'] == '1' || !this.ui.editor.chromeless ||
+		this.ui.editor.editable))
 	{
 		this.sync = new DrawioFileSync(this);
 		this.sync.start();

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

@@ -864,6 +864,8 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
 
 		if (!this.file.ignorePatches(patches))
 		{
+			this.file.stats.merges++;
+			
 			// Patches the shadow document
 			for (var i = 0; i < patches.length; i++)
 			{
@@ -998,8 +1000,6 @@ DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
 	this.resetUpdateStatusThread();
 	this.catchupRetryCount = 0;
 	
-	console.log('fileSaved');
-	
 	if (this.isConnected() && !this.file.inConflictState && !this.redirectDialogShowing)
 	{
 		// Computes diff and checksum

+ 5 - 14
src/main/webapp/js/diagramly/DriveClient.js

@@ -13,19 +13,9 @@ DriveClient = function(editorUi)
 	
 	// New mime type for XML files
 	this.xmlMimeType = 'application/vnd.jgraph.mxfile';
-
-	if (this.ui.editor.isChromelessView() && urlParams['rt'] != '1')
-	{
-		// Workaround for Google Drive requiring the user to click on the file in the
-		// drive UI when not using this scope (user other scope with rt=1 URL param)
-		this.appId = '850530949725';
-		this.clientId = '850530949725.apps.googleusercontent.com';
-		this.scopes = ['https://www.googleapis.com/auth/drive.readonly', 'openid'];
-		
-		// Only used for writing files which is disabled in viewer app
-		this.mimeType = 'all_types_supported';
-	}
-	else if (this.ui.isDriveDomain())
+	
+	// Reading files now possible with no initial click in drive
+	if (this.ui.isDriveDomain())
 	{
 		this.appId = '671128082532';
 		this.clientId = '671128082532.apps.googleusercontent.com';
@@ -388,7 +378,8 @@ DriveClient.prototype.executeRequest = function(req, success, error)
 						(resp.error.code == 403 && reason != 'rateLimitExceeded')))
 					{
 						// Shows an error if we're authenticated but the server still doesn't allow it
-						if (resp.error.code == 403 && this.user != null)
+						if ((resp.error.code == 403 && this.user != null) ||
+							(resp.error.code == 401 && this.user != null && reason == 'authError'))
 						{
 							if (error != null)
 							{

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

@@ -3591,7 +3591,7 @@
 	{
 		var resume = (this.spinner != null && this.spinner.pause != null) ? this.spinner.pause() : function() {};
 		
-		this.showDialog(new ConfirmDialog(this, msg, function()
+		var dlg = new ConfirmDialog(this, msg, function()
 		{
 			resume();
 			
@@ -3607,7 +3607,9 @@
 			{
 				cancelFn();
 			}
-		}, okLabel, cancelLabel).container, 340, 90, true, false);	
+		}, okLabel, cancelLabel);
+		this.showDialog(dlg.container, 340, 90, true, false);
+		dlg.init();
 	};
 
 	/**
@@ -11310,7 +11312,7 @@
 		
 		// Updates undo history states
 		this.actions.get('undo').setEnabled(this.canUndo() && editable);
-		this.actions.get('redo').setEnabled(this.canUndo() && editable);
+		this.actions.get('redo').setEnabled(this.canRedo() && editable);
 	
 		// Disables menus
 		this.menus.get('edit').setEnabled(active);

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

@@ -693,6 +693,8 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 			{
 				var doSave = mxUtils.bind(this, function(data, enc)
 				{
+					var savedData = this.data;
+					
 					// Makes sure no changes get lost while the file is saved
 					var prevModified = this.isModified;
 					var modified = this.isModified();
@@ -736,7 +738,7 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 										var lastDesc = this.stat;
 										this.stat = stat2;
 										
-										this.fileSaved(data, lastDesc, mxUtils.bind(this, function()
+										this.fileSaved(savedData, lastDesc, mxUtils.bind(this, function()
 										{
 											this.contentChanged();
 											

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 4
src/main/webapp/js/embed-static.min.js


+ 4 - 3
src/main/webapp/js/mxgraph/Dialogs.js

@@ -1971,6 +1971,7 @@ var OutlineWindow = function(editorUi, x, y, w, h)
  */
 var LayersWindow = function(editorUi, x, y, w, h)
 {
+	console.log('dialog.bg', Dialog.backdropColor);
 	var graph = editorUi.editor.graph;
 	
 	var div = document.createElement('div');
@@ -1984,7 +1985,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
 	var tbarHeight = (!EditorUi.compactUi) ? '30px' : '26px';
 	
 	var listDiv = document.createElement('div')
-	listDiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? '#dcdcdc' : '#e5e5e5';
+	listDiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? '#dcdcdc' : Dialog.backdropColor;
 	listDiv.style.position = 'absolute';
 	listDiv.style.overflow = 'auto';
 	listDiv.style.left = '0px';
@@ -2223,7 +2224,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
 			ldiv.style.padding = '4px';
 			ldiv.style.height = '22px';
 			ldiv.style.display = 'block';
-			ldiv.style.backgroundColor = 'whiteSmoke';
+			ldiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? 'whiteSmoke' : Dialog.backdropColor;
 			ldiv.style.borderWidth = '0px 0px 1px 0px';
 			ldiv.style.borderColor = '#c3c3c3';
 			ldiv.style.borderStyle = 'solid';
@@ -2436,7 +2437,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
 
 			if (graph.getDefaultParent() == child)
 			{
-				ldiv.style.background = '#e6eff8';
+				ldiv.style.background =  (Dialog.backdropColor == 'white') ? '#e6eff8' : '#505759';
 				ldiv.style.fontWeight = (graph.isEnabled()) ? 'bold' : '';
 				selectionLayer = child;
 			}

+ 7 - 3
src/main/webapp/js/mxgraph/Graph.js

@@ -3749,10 +3749,14 @@ HoverIcons.prototype.getState = function(state)
 	if (state != null)
 	{
 		var cell = state.cell;
-
-		// Uses connectable parent vertex if child is not connectable
-		if (this.graph.getModel().isVertex(cell) && !this.graph.isCellConnectable(cell))
+		
+		if (!this.graph.getModel().contains(cell))
+		{
+			return null;
+		}
+		else if (this.graph.getModel().isVertex(cell) && !this.graph.isCellConnectable(cell))
 		{
+			// Uses connectable parent vertex if child is not connectable
 			var parent = this.graph.getModel().getParent(cell);
 			
 			if (this.graph.getModel().isVertex(parent) && this.graph.isCellConnectable(parent))

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

@@ -1081,7 +1081,7 @@ Sidebar.prototype.addMiscPalette = function(expand)
     		return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Shape Group');
 		}),
 	 	this.createVertexTemplateEntry('shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;', 120, 60, '', 'Partial Rectangle'),
-		this.createVertexTemplateEntry('shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;top=0;bottom=1;fillColor=none;routingCenterX=-0.5;', 120, 60, '', 'Partial Rectangle'),
+		this.createVertexTemplateEntry('shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;', 120, 60, '', 'Partial Rectangle'),
 		this.createEdgeTemplateEntry('edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;', 50, 50, '', 'Manual Line', null, lineTags + 'manual'),
 	 	this.createEdgeTemplateEntry('shape=filledEdge;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;', 60, 40, '', 'Filled Edge'),
 	 	this.createEdgeTemplateEntry('edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;', 50, 50, '', 'Horizontal Elbow', null, lineTags + 'elbow horizontal'),

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3 - 4
src/main/webapp/js/reader.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 13 - 14
src/main/webapp/js/viewer.min.js