diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-10-15 11:58:44 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-11-14 16:26:59 +0100 |
commit | 988c85d2922a03346389e3656dc71dfee514e645 (patch) | |
tree | 9be0d1674dd7e780c70c77a987c4a810145078ab /apps/files_sharing/js/public.js | |
parent | 0f3c5d8541dcb41eebd00f22864a0a646c11124f (diff) | |
download | nextcloud-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.js | 15 |
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 }); |