diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-19 14:33:24 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-19 14:33:24 +0100 |
commit | 952584e9c782d196eb2bcd6df1e3ecdf21adcb55 (patch) | |
tree | 7900602434f86a503b800f63ceb0a6a7b4499964 /apps/files_sharing | |
parent | f9d4780d27ca21d86d8dacf73eda52a73a479d61 (diff) | |
parent | 94b3296a71c5950f70919836bc12f0066016b705 (diff) | |
download | nextcloud-server-952584e9c782d196eb2bcd6df1e3ecdf21adcb55.tar.gz nextcloud-server-952584e9c782d196eb2bcd6df1e3ecdf21adcb55.zip |
Merge pull request #7195 from owncloud/files-selectall
Do not send file list for select all on Download/delete
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); }; } |