From 271684dcfec16122b88e03780b41af7120f27e45 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 30 Jan 2014 14:47:00 +0100 Subject: update share owner --- apps/files_sharing/js/share.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/files_sharing/js/share.js') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 36de452a55e..b795b921903 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -5,6 +5,14 @@ $(document).ready(function() { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { $('#fileList').on('fileActionsReady',function(){ + + var allShared = $('*[data-share-owner]').find('[data-Action="Share"]'); + allShared.addClass('permanent'); + allShared.find('span').text(function(){ + $owner = $(this).closest('tr').attr('data-share-owner'); + return ' ' + t('files_sharing', 'shared by {owner}', {owner: $owner}); + }); + if (!sharesLoaded){ OC.Share.loadIcons('file'); // assume that we got all shares, so switching directories -- cgit v1.2.3 From 2b84f5e0b91dc41c3bffe0149bfcd19fe39d1377 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 30 Jan 2014 14:49:38 +0100 Subject: remove duplicate selectors and declaration --- apps/files_sharing/js/share.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'apps/files_sharing/js/share.js') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index b795b921903..7df8a05f607 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -25,16 +25,15 @@ $(document).ready(function() { }); FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) { - if ($('#dir').val() == '/') { - var item = $('#dir').val() + filename; - } else { - var item = $('#dir').val() + '/' + filename; + var dir = $('#dir').val(); + var item = $dir + '/' + filename; + if ($dir == '/') { + item = $dir + filename; } var tr = FileList.findFileEl(filename); + var itemType = 'file'; if ($(tr).data('type') == 'dir') { - var itemType = 'folder'; - } else { - var itemType = 'file'; + itemType = 'folder'; } var possiblePermissions = $(tr).data('permissions'); var appendTo = $(tr).find('td.filename'); -- cgit v1.2.3 From d0c8b310b9bd3134c650b4d77a384859519086c6 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 30 Jan 2014 16:29:32 +0100 Subject: uppercase text and fix dialog popup --- apps/files_sharing/js/share.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files_sharing/js/share.js') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 7df8a05f607..b08f3370c6f 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -10,7 +10,7 @@ $(document).ready(function() { allShared.addClass('permanent'); allShared.find('span').text(function(){ $owner = $(this).closest('tr').attr('data-share-owner'); - return ' ' + t('files_sharing', 'shared by {owner}', {owner: $owner}); + return ' ' + t('files_sharing', 'Shared by {owner}', {owner: $owner}); }); if (!sharesLoaded){ @@ -26,9 +26,9 @@ $(document).ready(function() { FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) { var dir = $('#dir').val(); - var item = $dir + '/' + filename; - if ($dir == '/') { - item = $dir + filename; + var item = dir + '/' + filename; + if (dir == '/') { + item = dir + filename; } var tr = FileList.findFileEl(filename); var itemType = 'file'; -- cgit v1.2.3 From 65843e245996c9ecfd167be2b520bb917b32aa7e Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sat, 1 Feb 2014 14:52:41 +0100 Subject: Improve jQuery element selector see https://github.com/owncloud/core/pull/7012/files#r9337198 http://24ways.org/2011/your-jquery-now-with-less-suck/ --- apps/files_sharing/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files_sharing/js/share.js') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index b08f3370c6f..9f0ed12f935 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -6,7 +6,7 @@ $(document).ready(function() { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { $('#fileList').on('fileActionsReady',function(){ - var allShared = $('*[data-share-owner]').find('[data-Action="Share"]'); + var allShared = $('#fileList').find('[data-share-owner]').find('[data-Action="Share"]'); allShared.addClass('permanent'); allShared.find('span').text(function(){ $owner = $(this).closest('tr').attr('data-share-owner'); -- cgit v1.2.3