diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-09-19 17:24:53 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-11-20 21:00:26 +0100 |
commit | 7bc28f14de8c3d77ec611a4ffd8ad48dc6093cea (patch) | |
tree | 1b48fa49cf6ad996c9da8ddfb2736fad99b421ac /core/js | |
parent | 37d8d3d858d66ccfc9b9a32606a9448bc15f5960 (diff) | |
download | nextcloud-server-7bc28f14de8c3d77ec611a4ffd8ad48dc6093cea.tar.gz nextcloud-server-7bc28f14de8c3d77ec611a4ffd8ad48dc6093cea.zip |
show e2e folder icon on encrypted folders
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/mimetype.js | 2 | ||||
-rw-r--r-- | core/js/mimetypelist.js | 1 | ||||
-rw-r--r-- | core/js/share.js | 6 | ||||
-rw-r--r-- | core/js/tests/specs/shareSpec.js | 7 |
4 files changed, 15 insertions, 1 deletions
diff --git a/core/js/mimetype.js b/core/js/mimetype.js index ed4fedc7f8a..e5a07abc951 100644 --- a/core/js/mimetype.js +++ b/core/js/mimetype.js @@ -44,6 +44,8 @@ OC.MimeType = { // Generate path if (mimeType === 'dir' && $.inArray('folder', files) !== -1) { return 'folder'; + } else if (mimeType === 'dir-encrypted' && $.inArray('folder-encrypted', files) !== -1) { + return 'folder-encrypted'; } else if (mimeType === 'dir-shared' && $.inArray('folder-shared', files) !== -1) { return 'folder-shared'; } else if (mimeType === 'dir-public' && $.inArray('folder-public', files) !== -1) { diff --git a/core/js/mimetypelist.js b/core/js/mimetypelist.js index ea513131d88..13db16c5a21 100644 --- a/core/js/mimetypelist.js +++ b/core/js/mimetypelist.js @@ -104,6 +104,7 @@ OC.MimeTypeList={ "file", "folder", "folder-drag-accept", + "folder-encrypted", "folder-external", "folder-public", "folder-shared", diff --git a/core/js/share.js b/core/js/share.js index 25d59b46fb4..be90c626959 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -276,10 +276,14 @@ OC.Share = _.extend(OC.Share || {}, { $tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')'); $tr.attr('data-icon', shareFolderIcon); } else if (type === 'dir') { + var isEncrypted = $tr.attr('data-e2eencrypted'); var mountType = $tr.attr('data-mounttype'); // FIXME: duplicate of FileList._createRow logic for external folder, // need to refactor the icon logic into a single code path eventually - if (mountType && mountType.indexOf('external') === 0) { + if (isEncrypted === 'true') { + shareFolderIcon = OC.MimeType.getIconUrl('dir-encrypted'); + $tr.attr('data-icon', shareFolderIcon); + } else if (mountType && mountType.indexOf('external') === 0) { shareFolderIcon = OC.MimeType.getIconUrl('dir-external'); $tr.attr('data-icon', shareFolderIcon); } else { diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js index 70c698c99a2..127582ace61 100644 --- a/core/js/tests/specs/shareSpec.js +++ b/core/js/tests/specs/shareSpec.js @@ -149,6 +149,13 @@ describe('OC.Share tests', function() { checkIcon('filetypes/folder-external'); }); + it('shows encrypted icon if encrypted folder', function() { + $file.attr('data-type', 'dir'); + $file.attr('data-e2eencrypted', true); + OC.Share.markFileAsShared($file, false, false); + + checkIcon('filetypes/folder-encrypted'); + }); }); describe('displaying the recipients', function() { |