aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-15 11:58:44 +0200
committerLukas Reschke <lukas@owncloud.com>2014-11-14 16:26:59 +0100
commit988c85d2922a03346389e3656dc71dfee514e645 (patch)
tree9be0d1674dd7e780c70c77a987c4a810145078ab /apps/files_sharing/js/public.js
parent0f3c5d8541dcb41eebd00f22864a0a646c11124f (diff)
downloadnextcloud-server-988c85d2922a03346389e3656dc71dfee514e645.tar.gz
nextcloud-server-988c85d2922a03346389e3656dc71dfee514e645.zip
Refactor file sharing public link handling
fixes download issue introduced by #10755 Conflicts: apps/files_sharing/public.php
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r--apps/files_sharing/js/public.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 52679a7158d..0627ed6ab54 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -109,14 +109,12 @@ OCA.Sharing.PublicApp = {
filename = JSON.stringify(filename);
}
var path = dir || FileList.getCurrentDirectory();
+ var token = $('#sharingToken').val();
var params = {
- service: 'files',
- t: $('#sharingToken').val(),
path: path,
- files: filename,
- download: null
+ files: filename
};
- return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params);
+ return OC.generateUrl('/s/'+token+'/download') + '?' + OC.buildQueryString(params);
};
this.fileList.getAjaxUrl = function (action, params) {
@@ -126,12 +124,11 @@ OCA.Sharing.PublicApp = {
};
this.fileList.linkTo = function (dir) {
+ var token = $('#sharingToken').val();
var params = {
- service: 'files',
- t: $('#sharingToken').val(),
dir: dir
};
- return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params);
+ return OC.generateUrl('/s/'+token+'') + '?' + OC.buildQueryString(params);
};
this.fileList.generatePreviewUrl = function (urlSpec) {
@@ -193,8 +190,6 @@ OCA.Sharing.PublicApp = {
_onDirectoryChanged: function (e) {
OC.Util.History.pushState({
- service: 'files',
- t: $('#sharingToken').val(),
// arghhhh, why is this not called "dir" !?
path: e.dir
});