From ef8a4a16292ad370661ccf1c77f157ab3d867eac Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Fri, 5 Oct 2012 14:20:38 +0200 Subject: register download action for files --- apps/files_sharing/js/public.js | 6 ++++++ 1 file changed, 6 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 def02374804..fb87c04ee26 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -32,6 +32,12 @@ $(document).ready(function() { window.location = $(tr).find('a.name').attr('href'); } }); + FileActions.register('file', 'Download', 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 0d081ac5acbb049659eedca0766c99ed7e91c4d7 Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Fri, 5 Oct 2012 14:28:03 +0200 Subject: register download action for directories --- apps/files_sharing/js/public.js | 6 ++++++ 1 file changed, 6 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 fb87c04ee26..916e35419c1 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -38,6 +38,12 @@ $(document).ready(function() { window.location = $(tr).find('a.name').attr('href'); } }); + FileActions.register('dir', 'Download', OC.PERMISSION_READ, '', function(filename) { + var tr = $('tr').filterAttr('data-file', filename) + if (tr.length > 0) { + window.location = $(tr).find('a.name').attr('href')+'&download'; + } + }); } }); \ No newline at end of file -- cgit v1.2.3