浏览代码

6.1.0.1 release

Gaudenz Alder 8 年之前
父节点
当前提交
a8227cfe41

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+11-FEB-2017: 6.1.0.1
+
+- Fixes overwrite of GitHub files
+- Fixes default values in GitHub dialog
+- Fixes initial save for graphics formats
+
 11-FEB-2017: 6.1.0.0
 
 - Fixes HTML export

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.1.0.0
+6.1.0.1

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 02/11/2017 09:23 AM
+# 02/11/2017 11:43 AM
 
 /app.html
 /index.html?offline=1

文件差异内容过多而无法显示
+ 75 - 75
war/js/app.min.js


文件差异内容过多而无法显示
+ 420 - 420
war/js/atlas-viewer.min.js


文件差异内容过多而无法显示
+ 9 - 9
war/js/atlas.min.js


+ 11 - 4
war/js/diagramly/App.js

@@ -3051,10 +3051,16 @@ App.prototype.fileCreated = function(file, libs, replace, done)
 	// to save the file again since it needs the newly created file ID for redirecting in HTML
 	if (this.spinner.spin(document.body, mxResources.get('inserting')))
 	{
+		var redirect = window.location.protocol + '//' + window.location.hostname + url;
+		var prev = this.getFileData(true);
 		var data = file.getData();
-		file.setData(this.createFileData((data.length > 0) ?
-			this.editor.extractGraphModel(mxUtils.parseXml(data).documentElement, true) : null,
-			null, file, window.location.protocol + '//' + window.location.hostname + url));
+		
+		// Updates display to fetch graphical output for graphics file formats (eg. svg)
+		this.setFileData(data);
+		file.setData(this.createFileData(this.getXmlFileData(), null, file, redirect));
+
+		// Restores display for current diagram
+		this.setFileData(prev);
 		
 		var complete = mxUtils.bind(this, function()
 		{
@@ -3837,6 +3843,7 @@ App.prototype.exportFile = function(data, filename, mimeType, base64Encoded, mod
 	{
 		if (this.gitHub != null && this.spinner.spin(document.body, mxResources.get('saving')))
 		{
+			// Must insert file as library to force the file to be written
 			this.gitHub.insertFile(filename, data, mxUtils.bind(this, function()
 			{
 				this.spinner.stop();
@@ -3844,7 +3851,7 @@ App.prototype.exportFile = function(data, filename, mimeType, base64Encoded, mod
 			{
 				this.spinner.stop();
 				this.handleError(resp);
-			}), false, folderId, base64Encoded);
+			}), true, folderId, base64Encoded);
 		}
 	}
 };

+ 19 - 14
war/js/diagramly/EditorUi.js

@@ -3225,20 +3225,9 @@
 				
 				return input;
 			});
-			
-			var org = null;
-			var repo = null;
-			
-			var file = this.getCurrentFile();
-			
-			if (file != null && file.constructor == GitHubFile && file.meta.drawio != null)
-			{
-				org = file.meta.drawio.org;
-				repo = file.meta.drawio.repo;
-			}
-			
-			var orgInput = addRow(mxResources.get('organisation') + ':', 'org', org);
-			var repoInput = addRow(mxResources.get('repository') + ':', 'repo', repo);
+
+			var orgInput = addRow(mxResources.get('organisation') + ':', 'org');
+			var repoInput = addRow(mxResources.get('repository') + ':', 'repo');
 			var pathInput = addRow();
 			var refInput = addRow(mxResources.get('ref') + ':', 'master');
 			
@@ -3271,9 +3260,25 @@
 			});
 			
 			this.gitHubDialog = new CustomDialog(this, div, invokeFn);
+			var ui = this;
 			
 			this.gitHubDialog.init = function(thisFn, fPath, dPath)
 			{
+				var file = ui.getCurrentFile();
+				
+				if (file != null && file.constructor == GitHubFile)
+				{
+					if (orgInput.value == '')
+					{
+						orgInput.value = file.meta.org || '';
+					}
+					
+					if (repoInput.value == '')
+					{
+						repoInput.value = file.meta.repo || '';
+					}
+				}
+								
 				var td = pathInput.parentNode.previousSibling;
 				td.innerHTML = '';
 				mxUtils.write(td, mxResources.get((fPath) ? 'path' : 'folder'));

+ 7 - 6
war/js/diagramly/GitHubClient.js

@@ -344,7 +344,8 @@ GitHubClient.prototype.createGitHubFile = function(org, repo, ref, req, asLibrar
 {
 	var data = JSON.parse(req.getText());
 	var meta = {'org': org, 'repo': repo, 'ref': ref, 'name': data.name,
-		'path': data.path, 'sha': data.sha, 'download_url': data.download_url};
+		'path': data.path, 'sha': data.sha, 'html_url': data.html_url,
+		'download_url': data.download_url};
 	var content = data.content;
 	
 	if (data.encoding === 'base64')
@@ -403,8 +404,8 @@ GitHubClient.prototype.insertFile = function(filename, data, success, error, asL
 			// Does not insert file here as there is another writeFile implicit via fileCreated
 			if (!asLibrary)
 			{
-				success(new GitHubFile(this.ui, data, {'org': org, 'repo': repo,
-					'ref': ref, 'name': filename, 'path': path}));
+				success(new GitHubFile(this.ui, data, {'org': org, 'repo': repo, 'ref': ref,
+					'name': filename, 'path': path, 'sha': sha, isNew: true}));
 			}
 			else
 			{
@@ -532,7 +533,7 @@ GitHubClient.prototype.saveFile = function(file, success, error)
 	var ref = file.meta.ref;
 	var path = file.meta.path;
 	
-	this.showCommitDialog(file.meta.name, file.meta.sha == null, mxUtils.bind(this, function(message)
+	this.showCommitDialog(file.meta.name, file.meta.sha == null || file.meta.isNew, mxUtils.bind(this, function(message)
 	{
 		var data = (window.btoa) ? btoa(file.getData()) : Base64.encode(file.getData());
 		
@@ -540,8 +541,8 @@ GitHubClient.prototype.saveFile = function(file, success, error)
 		{
 			this.writeFile(org, repo, ref, path, message, data, sha, mxUtils.bind(this, function(req)
 			{
-				var data = JSON.parse(req.getText());
-				success(data.content.sha);
+				delete file.meta.isNew;
+				success(JSON.parse(req.getText()));
 			}), mxUtils.bind(this, function(err)
 			{
 				// Handles special conflict case where overwrite needs an update of the sha

+ 7 - 4
war/js/diagramly/GitHubFile.js

@@ -157,7 +157,7 @@ GitHubFile.prototype.saveFile = function(title, revision, success, error)
 			var modified = this.isModified();
 			this.setModified(false);
 			
-			this.ui.gitHub.saveFile(this, mxUtils.bind(this, function(sha)
+			this.ui.gitHub.saveFile(this, mxUtils.bind(this, function(commit)
 			{
 				this.savingFile = false;
 				this.isModified = prevModified;
@@ -167,8 +167,8 @@ GitHubFile.prototype.saveFile = function(title, revision, success, error)
 					success();
 				}
 				
-				// No sha means save was cancelled
-				if (sha == null)
+				// No commit means save was cancelled
+				if (commit == null)
 				{
 					this.setModified(modified || this.isModified());
 					
@@ -179,7 +179,10 @@ GitHubFile.prototype.saveFile = function(title, revision, success, error)
 				}
 				else
 				{
-					this.meta.sha = sha;
+					this.meta.sha = commit.content.sha;
+					this.meta.html_url = commit.content.html_url;
+					this.meta.download_url = commit.content.download_url;
+					
 					this.contentChanged();
 				}
 			}),

文件差异内容过多而无法显示
+ 1 - 1
war/js/embed-static.min.js


文件差异内容过多而无法显示
+ 1 - 1
war/js/reader.min.js


文件差异内容过多而无法显示
+ 418 - 418
war/js/viewer.min.js