diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-09-28 15:38:49 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-09-28 15:38:49 +0200 |
commit | bf1057143cdff8ec289d9d766ab100d64d7ea45d (patch) | |
tree | 6c35d0d99a72f27a981a07c93f0ecbf600764cd4 /apps/files_sharing/js/public.js | |
parent | 3efe1d3b24e65ed76d521c24b0cfe4e0ff2e7af5 (diff) | |
parent | 5144d26088b98685a37c73c776a9a47203efa68a (diff) | |
download | nextcloud-server-bf1057143cdff8ec289d9d766ab100d64d7ea45d.tar.gz nextcloud-server-bf1057143cdff8ec289d9d766ab100d64d7ea45d.zip |
Merge branch 'master' into routing
Conflicts:
apps/files/js/filelist.js
core/js/js.js
lib/ocs.php
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r-- | apps/files_sharing/js/public.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 92b626bba18..def02374804 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() { @@ -13,10 +17,21 @@ $(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()); } } + 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 |