[Pkg-owncloud-commits] [owncloud] 14/59: reduce share action text to the user name only

David Prévot taffit at moszumanska.debian.org
Fri Jul 18 16:19:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 8e8c6c9f72402139bfa4e0442820171ead6f6d81
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Fri Jul 11 15:16:26 2014 +0200

    reduce share action text to the user name only
---
 apps/files_sharing/js/share.js           |  2 +-
 apps/files_sharing/tests/js/shareSpec.js |  8 ++++----
 core/js/share.js                         |  4 ++--
 core/js/tests/specs/shareSpec.js         | 14 +++++++-------
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index e46be4a..eccd21c 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -143,7 +143,7 @@
 							' data-action="Share-Notification" href="#" original-title="">' +
 							' <img class="svg" src="' + OC.imagePath('core', 'actions/share') + '"></img>';
 					$tr.find('.fileactions').append(function() {
-						var shareBy = t('files_sharing', 'Shared by {owner}', {owner: escapeHTML($tr.attr('data-share-owner'))});
+						var shareBy = escapeHTML($tr.attr('data-share-owner'));
 						var $result = $(shareNotification + '<span> ' + shareBy + '</span></span>');
 						$result.on('click', function() {
 							return false;
diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js
index 600859b..2cf5dc4 100644
--- a/apps/files_sharing/tests/js/shareSpec.js
+++ b/apps/files_sharing/tests/js/shareSpec.js
@@ -165,7 +165,7 @@ describe('OCA.Sharing.Util tests', function() {
 			$tr = fileList.$el.find('tbody tr:first');
 			$action = $tr.find('.action-share');
 			expect($action.hasClass('permanent')).toEqual(true);
-			expect($action.find('>span').text()).toEqual('Shared by User One');
+			expect($action.find('>span').text()).toEqual('User One');
 			expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
 			expect(OC.basename(getImageUrl($tr.find('.filename')))).toEqual('folder-shared.svg');
 		});
@@ -207,7 +207,7 @@ describe('OCA.Sharing.Util tests', function() {
 			expect($tr.find('.action-share').length).toEqual(0);
 			$action = $tr.find('.action-share-notification');
 			expect($action.hasClass('permanent')).toEqual(true);
-			expect($action.find('>span').text().trim()).toEqual('Shared by User One');
+			expect($action.find('>span').text().trim()).toEqual('User One');
 			expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
 			expect(OC.basename(getImageUrl($tr.find('.filename')))).toEqual('folder-shared.svg');
 			expect($action.find('img').length).toEqual(1);
@@ -369,7 +369,7 @@ describe('OCA.Sharing.Util tests', function() {
 			OC.Share.updateIcon('file', 1);
 
 			expect($action.hasClass('permanent')).toEqual(true);
-			expect($action.find('>span').text()).toEqual('Shared by User One');
+			expect($action.find('>span').text()).toEqual('User One');
 			expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
 		});
 		it('keep share text after unsharing reshare', function() {
@@ -405,7 +405,7 @@ describe('OCA.Sharing.Util tests', function() {
 			OC.Share.updateIcon('file', 1);
 
 			expect($action.hasClass('permanent')).toEqual(true);
-			expect($action.find('>span').text()).toEqual('Shared by User One');
+			expect($action.find('>span').text()).toEqual('User One');
 			expect(OC.basename($action.find('img').attr('src'))).toEqual('share.svg');
 		});
 	});
diff --git a/core/js/share.js b/core/js/share.js
index 4264693..e8d4860 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -191,7 +191,7 @@ OC.Share={
 		var parts = this._REMOTE_OWNER_REGEXP.exec(owner);
 		if (!parts) {
 			// display as is, most likely to be a simple owner name
-			return t('files_sharing', 'Shared by {owner}', {owner: escapeHTML(owner)});
+			return escapeHTML(owner);
 		}
 
 		var userName = parts[1];
@@ -211,7 +211,7 @@ OC.Share={
 			html += '<span class="userDomain">@' + escapeHTML(userDomain) + '</span>';
 		}
 		html += '</span>';
-		return t('files_sharing', 'Shared by {owner}', {owner: html});
+		return html;
 	},
 	/**
 	 * Marks/unmarks a given file as shared by changing its action icon
diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index ed04df3..00a88ba 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -403,39 +403,39 @@ describe('OC.Share tests', function() {
 			}
 
 			it('displays the local share owner as is', function() {
-				checkOwner('User One', 'Shared by User One', null);
+				checkOwner('User One', 'User One', null);
 			});
 			it('displays the user name part of a remote share owner', function() {
 				checkOwner(
 					'User One at someserver.com',
-					'Shared by User One',
+					'User One',
 					'User One at someserver.com'
 				);
 				checkOwner(
 					'User One at someserver.com/',
-					'Shared by User One',
+					'User One',
 					'User One at someserver.com'
 				);
 				checkOwner(
 					'User One at someserver.com/root/of/owncloud',
-					'Shared by User One',
+					'User One',
 					'User One at someserver.com'
 				);
 			});
 			it('displays the user name part with domain of a remote share owner', function() {
 				checkOwner(
 					'User One at example.com@someserver.com',
-					'Shared by User One at example.com',
+					'User One at example.com',
 					'User One at example.com@someserver.com'
 				);
 				checkOwner(
 					'User One at example.com@someserver.com/',
-					'Shared by User One at example.com',
+					'User One at example.com',
 					'User One at example.com@someserver.com'
 				);
 				checkOwner(
 					'User One at example.com@someserver.com/root/of/owncloud',
-					'Shared by User One at example.com',
+					'User One at example.com',
 					'User One at example.com@someserver.com'
 				);
 			});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list