aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-09-18 23:56:00 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-09-18 23:56:14 -0400
commit749b5b52ca5361be76d8e6ffb5857e2b6ca60311 (patch)
tree1bebbe9694745f9fb6b54976a34d4ee142a94c2b /apps/files_sharing/js/public.js
parentb0e645fe1372f7408507abb755626eba55f47dfb (diff)
downloadnextcloud-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.js12
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