From 749b5b52ca5361be76d8e6ffb5857e2b6ca60311 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Tue, 18 Sep 2012 23:56:00 -0400 Subject: Show preview for public folder links --- apps/files_sharing/js/public.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'apps/files_sharing/js/public.js') diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 92b626bba18..b1b6b079db6 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -1,6 +1,10 @@ // Override download path to files_sharing/public.php function fileDownloadPath(dir, file) { - return $('#downloadURL').val(); + var url = $('#downloadURL').val(); + if (url.indexOf('&path=') != -1) { + url += '/'+file; + } + return url; } $(document).ready(function() { @@ -17,6 +21,12 @@ $(document).ready(function() { action($('#filename').val()); } } + FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename) { + var tr = $('tr').filterAttr('data-file', filename) + if (tr.length > 0) { + window.location = $(tr).find('a.name').attr('href'); + } + }); } }); \ No newline at end of file -- cgit v1.2.3 From 39e587b52c92c8b71bb3eed4824c2cfc10b37306 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 19 Sep 2012 00:27:20 -0400 Subject: Remove the content and table to prevent covering the download link --- apps/files_sharing/js/public.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps/files_sharing/js/public.js') diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index b1b6b079db6..def02374804 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -17,6 +17,11 @@ $(document).ready(function() { var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ); if (typeof action === 'undefined') { $('#noPreview').show(); + if (mimetype != 'httpd/unix-directory') { + // NOTE: Remove when a better file previewer solution exists + $('#content').remove(); + $('table').remove(); + } } else { action($('#filename').val()); } -- cgit v1.2.3