diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-13 20:20:00 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-13 20:28:52 +0100 |
commit | d5397d813cd731b5bf8ac4b7c193ac39d704af6e (patch) | |
tree | 9de3d45f938bdb755ac158933aef994cb58e257e /apps/files_sharing | |
parent | 30662fa7acbe7a367ee8b0c07afabf425a10ef06 (diff) | |
download | nextcloud-server-d5397d813cd731b5bf8ac4b7c193ac39d704af6e.tar.gz nextcloud-server-d5397d813cd731b5bf8ac4b7c193ac39d704af6e.zip |
Do not send file list for select all on Download/delete
- When all files are selected, do not send the whole file list
- Download will trigger download for the parent folder, also works
with root
- Delete will send "allfiles" to the server that will find the file
list or the passed directory by itself
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/public.js | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index c1b7eee3fb7..06c168969de 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -1,3 +1,15 @@ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global OC, FileList, FileActions */ + // Override download path to files_sharing/public.php function fileDownloadPath(dir, file) { var url = $('#downloadURL').val(); @@ -28,12 +40,20 @@ $(document).ready(function() { // override since the format is different FileList.getDownloadUrl = function(filename, dir) { - // we use this because we need the service and token attributes - var tr = FileList.findFileEl(filename); - if (tr.length > 0) { - return $(tr).find('a.name').attr('href') + '&download'; + if ($.isArray(filename)) { + filename = JSON.stringify(filename); + } + var path = dir || FileList.getCurrentDirectory(); + var params = { + service: 'files', + t: $('#sharingToken').val(), + path: path, + download: null + }; + if (filename) { + params.files = filename; } - return null; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); }; } |