diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-09-18 23:56:00 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-09-18 23:56:14 -0400 |
commit | 749b5b52ca5361be76d8e6ffb5857e2b6ca60311 (patch) | |
tree | 1bebbe9694745f9fb6b54976a34d4ee142a94c2b /apps/files_sharing/js/public.js | |
parent | b0e645fe1372f7408507abb755626eba55f47dfb (diff) | |
download | nextcloud-server-749b5b52ca5361be76d8e6ffb5857e2b6ca60311.tar.gz nextcloud-server-749b5b52ca5361be76d8e6ffb5857e2b6ca60311.zip |
Show preview for public folder links
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r-- | apps/files_sharing/js/public.js | 12 |
1 files changed, 11 insertions, 1 deletions
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 |