Explorar o código

7.2.1 release

Former-commit-id: 267e9e76f72a34fc6f96ab2a58e52e352e521654
Gaudenz Alder %!s(int64=8) %!d(string=hai) anos
pai
achega
f917c66385

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+23-AUG-2017: 7.2.1
+
+- Adds support for Trello attachments
+
 23-AUG-2017: 7.2.0
 
 - Adds support for line jumps (beta)

+ 1 - 1
VERSION

@@ -1 +1 @@
-7.2.0
+7.2.1

+ 3 - 0
etc/build/build.xml

@@ -311,6 +311,9 @@
 				<file name="GitHubFile.js" />
 				<file name="GitHubLibrary.js" />
 				<file name="GitHubClient.js" />
+				<file name="TrelloFile.js" />
+				<file name="TrelloLibrary.js" />
+				<file name="TrelloClient.js" />
 				<file name="ChatWindow.js" />
 			</sources>
 			

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 08/23/2017 11:22 AM
+# 08/23/2017 04:35 PM
 
 app.html
 index.html?offline=1

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5 - 25
war/images/trello-logo-white.svg


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 32
war/images/trello-logo.svg


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 127 - 109
war/js/app.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 302 - 302
war/js/atlas-viewer.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 370 - 371
war/js/atlas.min.js


+ 3 - 2
war/js/diagramly/App.js

@@ -2581,7 +2581,7 @@ App.prototype.showSplash = function(force)
 	}
 	else if (this.mode == null || force)
 	{
-		var rowLimit = (serviceCount <= 4) ? 2 : (serviceCount > 6 ? 4 : 3);
+		var rowLimit = (serviceCount <= 4) ? 2 : 3;
 		
 		var dlg = new StorageDialog(this, mxUtils.bind(this, function()
 		{
@@ -2589,7 +2589,8 @@ App.prototype.showSplash = function(force)
 			showSecondDialog();
 		}), rowLimit);
 		
-		this.showDialog(dlg.container, (rowLimit < 3) ? 260 : ((rowLimit < 4) ? 300 : 390), (serviceCount > rowLimit) ? 420 : 300, true, false);
+		this.showDialog(dlg.container, (rowLimit < 3) ? 260 : 300,
+			(serviceCount > rowLimit) ? 420 : 300, true, false);
 		dlg.init();
 	}
 	else if (urlParams['create'] == null)

+ 47 - 36
war/js/diagramly/Dialogs.js

@@ -92,7 +92,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 
 	buttons.style.border = '1px solid #d3d3d3';
 	buttons.style.borderWidth = '1px 0px 1px 0px';
-	buttons.style.padding = '18px 0px 18px 0px';
+	buttons.style.padding = '12px 0px 12px 0px';
 
 	var cb = document.createElement('input');
 	cb.setAttribute('type', 'checkbox');
@@ -305,34 +305,12 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 	{
 		addLogo(IMAGE_PATH + '/osa_database.png', mxResources.get('browser'), App.MODE_BROWSER);
 	}
-	else if (Graph.fileSupport && !mxClient.IS_IE && !mxClient.IS_IE11)
-	{
-		addLogo(null, mxResources.get('import'), null, null, ['', mxResources.get('gliffy'),
-			mxResources.get('formatVssx'), mxResources.get('formatVsdx'),
-			mxResources.get('lucidchart')], function()
-		{
-			var input = document.createElement('input');
-			input.setAttribute('type', 'file');
-			
-			mxEvent.addListener(input, 'change', function()
-			{
-				if (input.files != null)
-				{
-					// Using null for position will disable crop of input file
-					editorUi.hideDialog();
-					editorUi.openFiles(input.files, true);
-				}
-			});
-
-			input.click();
-		});
-	}
 	
 	div.appendChild(buttons);
 
 	var p2 = document.createElement('p');
 	p2.style.marginTop = '12px';
-	p2.style.marginBottom = '10px';
+	p2.style.marginBottom = '6px';
 	p2.appendChild(cb);
 	
 	var span = document.createElement('span');
@@ -347,7 +325,7 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 	if (recent != null && recent.length > 0)
 	{
 		var recentSelect = document.createElement('select');
-		recentSelect.style.marginTop = '14px';
+		recentSelect.style.marginTop = '8px';
 		recentSelect.style.width = '140px';
 
 		var titleOption = document.createElement('option');
@@ -396,6 +374,39 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 		buttons.style.padding = '30px 0px 26px 0px';
 	}
 	
+	if (Graph.fileSupport && !mxClient.IS_IE && !mxClient.IS_IE11)
+	{
+		var link = document.createElement('div');
+		link.style.cursor = 'pointer';
+		link.style.padding = '18px 0px 6px 0px';
+		link.style.fontSize = '12px';
+		link.style.color = 'gray';
+		mxUtils.write(link, mxResources.get('import') + ' ' + mxResources.get('gliffy') + ', ' +
+				mxResources.get('formatVssx') + ', ' + mxResources.get('formatVsdx') + ', ' +
+				mxResources.get('lucidchart') + '...');
+		
+		mxEvent.addListener(link, 'click', function()
+		{
+			var input = document.createElement('input');
+			input.setAttribute('type', 'file');
+			
+			mxEvent.addListener(input, 'change', function()
+			{
+				if (input.files != null)
+				{
+					// Using null for position will disable crop of input file
+					editorUi.hideDialog();
+					editorUi.openFiles(input.files, true);
+				}
+			});
+
+			input.click();
+		});
+		
+		p2.appendChild(link);
+		buttons.style.paddingBottom = '4px';
+	}
+	
 	buttons.appendChild(p2);
 	
 	mxEvent.addListener(span, 'click', function(evt)
@@ -3180,17 +3191,7 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
 			
 			addLogo(IMAGE_PATH + '/github-logo.svg', mxResources.get('github'), App.MODE_GITHUB, 'gitHub');
 		}
-	
-		if (editorUi.trello != null)
-		{
-			var trelloOption = document.createElement('option');
-			trelloOption.setAttribute('value', App.MODE_TRELLO);
-			mxUtils.write(trelloOption, mxResources.get('trello'));
-			serviceSelect.appendChild(trelloOption);
-			
-			addLogo(IMAGE_PATH + '/trello-logo.svg', mxResources.get('trello'), App.MODE_TRELLO, 'trello');
-		}
-		
+
 		if (typeof window.DropboxClient === 'function')
 		{
 			var dropboxOption = document.createElement('option');
@@ -3220,6 +3221,16 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
 			
 			addLogo(IMAGE_PATH + '/onedrive-logo.svg', mxResources.get('oneDrive'), App.MODE_ONEDRIVE, 'oneDrive');
 		}
+		
+		if (editorUi.trello != null)
+		{
+			var trelloOption = document.createElement('option');
+			trelloOption.setAttribute('value', App.MODE_TRELLO);
+			mxUtils.write(trelloOption, mxResources.get('trello'));
+			serviceSelect.appendChild(trelloOption);
+			
+			addLogo(IMAGE_PATH + '/trello-logo.svg', mxResources.get('trello'), App.MODE_TRELLO, 'trello');
+		}
 	}
 	
 	if (!Editor.useLocalStorage || urlParams['storage'] == 'device' ||

+ 6 - 5
war/js/diagramly/EditorUi.js

@@ -2714,6 +2714,7 @@
 	{
 		allowBrowser = (allowBrowser != null) ? allowBrowser : false;
 		var allowTab = (format != 'vsdx') && (!mxClient.IS_IOS || !navigator.standalone);
+		var count = this.getServiceCount(allowBrowser);
 		
 		var dlg = new CreateDialog(this, filename, mxUtils.bind(this, function(newTitle, mode)
 		{
@@ -2797,9 +2798,8 @@
 		{
 			this.hideDialog();
 		}), mxResources.get('saveAs'), mxResources.get('download'), false, allowBrowser, allowTab,
-			null, null, (allowBrowser) ? 3 : 4, data, mimeType, base64Encoded);
-		this.showDialog(dlg.container, 380, (this.getServiceCount(allowBrowser) - 1 <
-			((allowBrowser) ? 4 : 5)) ? 270 : 390, true, true);
+			null, null, (count > 4) ? 3 : 4, data, mimeType, base64Encoded);
+		this.showDialog(dlg.container, 380, (count > 4) ? 390 : 270, true, true);
 		dlg.init();
 	};
 
@@ -2836,6 +2836,7 @@
 	EditorUi.prototype.saveRequest = function(filename, format, fn, data, base64Encoded, mimeType)
 	{
 		var allowTab = !mxClient.IS_IOS || !navigator.standalone;
+		var count = this.getServiceCount(false);
 		
 		var dlg = new CreateDialog(this, filename, mxUtils.bind(this, function(newTitle, mode)
 		{
@@ -2907,8 +2908,8 @@
 		{
 			this.hideDialog();
 		}), mxResources.get('saveAs'), mxResources.get('download'), false, false, allowTab,
-			null, null, 4, data, mimeType, base64Encoded);
-		this.showDialog(dlg.container, 380, (this.getServiceCount(false) - 1 < 5) ? 270 : 390, true, true);
+			null, null, (count > 4) ? 3 : 4, data, mimeType, base64Encoded);
+		this.showDialog(dlg.container, 380, (count > 4) ? 390 : 270, true, true);
 		dlg.init();
 	};
 		

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1282 - 1267
war/js/diagramly/Extensions.js


+ 21 - 8
war/js/diagramly/TrelloClient.js

@@ -18,6 +18,11 @@ TrelloClient.prototype.baseUrl = 'https://api.trello.com/1/';
 
 TrelloClient.prototype.SEPARATOR = '|$|';
 
+/**
+ * Maximum attachment size of Trello.
+ */
+TrelloClient.prototype.maxFileSize = 10000000 /*10MB*/;
+
 /**
  * Default extension for new files.
  */
@@ -40,7 +45,7 @@ TrelloClient.prototype.getFile = function(id, success, error, denyConvert, asLib
 
 	Trello.authorize({
 	  type: 'popup',
-	  name: 'Draw.io',
+	  name: 'draw.io',
 	  scope: {
 	    read: 'true',
 	    write: 'true' },
@@ -138,7 +143,7 @@ TrelloClient.prototype.saveFile = function(file, success, error)
 	var ids = file.meta.compoundId.split(this.SEPARATOR);
 	Trello.authorize({
 	  type: 'popup',
-	  name: 'Draw.io',
+	  name: 'draw.io',
 	  scope: {
 	    read: 'true',
 	    write: 'true' 
@@ -162,9 +167,17 @@ TrelloClient.prototype.writeFile = function(filename, data, cardId, success, err
 {
 	if (filename != null && data != null)
 	{
+		if (data.length >= this.maxFileSize)
+		{
+			error({message: mxResources.get('drawingTooLarge') + ' (' +
+				this.ui.formatFileSize(data.length) + ' / 10 MB)'});
+			
+			return;
+		}
+		
 		Trello.authorize({
 		  type: 'popup',
-		  name: 'Draw.io',
+		  name: 'draw.io',
 		  scope: {
 		    read: 'true',
 		    write: 'true' 
@@ -238,7 +251,7 @@ TrelloClient.prototype.pickFolder = function(fn)
 {
 	Trello.authorize({
 		  type: 'popup',
-		  name: 'Draw.io',
+		  name: 'draw.io',
 		  scope: {
 		    read: 'true',
 		    write: 'true' },
@@ -266,7 +279,7 @@ TrelloClient.prototype.pickFile = function(fn, returnObject)
 	
 	Trello.authorize({
 		  type: 'popup',
-		  name: 'Draw.io',
+		  name: 'draw.io',
 		  scope: {
 		    read: 'true',
 		    write: 'true' },
@@ -426,7 +439,7 @@ TrelloClient.prototype.showTrelloDialog = function(showFiles, fn)
 		mxEvent.addListener(nextPageDiv, 'click', nextPage);
 		
 		Trello.get('search', {
-				'query': '@me' + (filter != null ? ' ' + filter : ''),
+				'query': (filter != null ? filter : 'is:open'),
 				'cards_limit': pageSize,
 				'cards_page': page-1
 			},
@@ -464,14 +477,14 @@ TrelloClient.prototype.showTrelloDialog = function(showFiles, fn)
 						{
 							div.appendChild(createLink(mxResources.get('filterCards') + '...', mxUtils.bind(this, function()
 							{
-								var dlg = new FilenameDialog(this.ui, mxResources.get('cardName'), mxResources.get('ok'), mxUtils.bind(this, function(value)
+								var dlg = new FilenameDialog(this.ui, 'is:open', mxResources.get('ok'), mxUtils.bind(this, function(value)
 								{
 									if (value != null)
 									{
 										filter = value;
 										selectCard();
 									}
-								}), mxResources.get('cardName'));
+								}), mxResources.get('cardName'), null, null, 'http://help.trello.com/article/808-searching-for-cards-all-boards');
 								this.ui.showDialog(dlg.container, 300, 80, true, false);
 								dlg.init();
 							})));

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 4
war/js/embed-static.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 230 - 231
war/js/extensions.min.js


+ 2 - 2
war/js/mxgraph/Graph.js

@@ -191,8 +191,8 @@ Graph = function(container, model, renderHint, stylesheet, themes)
 			    	{
 			    		var state = start.state;
 			    		
-			    		if (Math.abs(start.point.x - me.getGraphX()) > tol * this.view.scale ||
-			    			Math.abs(start.point.y - me.getGraphY()) > tol * this.view.scale)
+			    		if (Math.abs(start.point.x - me.getGraphX()) > tol ||
+			    			Math.abs(start.point.y - me.getGraphY()) > tol)
 			    		{
 			    			// Lazy selection for edges inside groups
 			    			if (!this.isCellSelected(state.cell))

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 4
war/js/reader.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 302 - 302
war/js/viewer.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
war/templates/software/database_1.xml