summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-02-19 14:33:24 +0100
committerVincent Petry <pvince81@owncloud.com>2014-02-19 14:33:24 +0100
commit952584e9c782d196eb2bcd6df1e3ecdf21adcb55 (patch)
tree7900602434f86a503b800f63ceb0a6a7b4499964 /apps/files_sharing
parentf9d4780d27ca21d86d8dacf73eda52a73a479d61 (diff)
parent94b3296a71c5950f70919836bc12f0066016b705 (diff)
downloadnextcloud-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.js30
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);
};
}