aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-02-20 16:55:18 +0100
committerRobin Appelman <icewind@owncloud.com>2014-02-20 16:55:18 +0100
commit0624476aa19a63b1f4e35f35e151c3fc46cb697f (patch)
tree67e9ead3bfd44e7efe3f4a6d1325866075dbd702 /apps/files_sharing
parentf33d35cd073addb08c78a65b719c72eb5424434a (diff)
parentec45a3c0e2567c89729bc6fe8c996b7939025429 (diff)
downloadnextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.tar.gz
nextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.zip
Merge branch 'master' into mimeicons-svg
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);
};
}