diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-23 10:50:44 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-06-20 08:53:37 +0200 |
commit | 366981fba6d01167c1ac38f559bd611062d8e534 (patch) | |
tree | 0025a9def17d24615e4cfa6f512870aa6d6b59fb /apps/files_sharing/js | |
parent | 53a1b9a84e452bebfc701c93f32f44aefea87a2f (diff) | |
download | nextcloud-server-366981fba6d01167c1ac38f559bd611062d8e534.tar.gz nextcloud-server-366981fba6d01167c1ac38f559bd611062d8e534.zip |
Move public preview endpoint over
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 1de7c6b4fcd..e1e05f8964c 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -112,7 +112,6 @@ OCA.Sharing.PublicApp = { y: Math.ceil(previewHeight * window.devicePixelRatio), a: 'true', file: encodeURIComponent(this.initialDir + $('#filename').val()), - t: token, scalingup: 0 }; @@ -150,7 +149,7 @@ OCA.Sharing.PublicApp = { } else if ((previewSupported === 'true' && mimetype.substr(0, mimetype.indexOf('/')) !== 'video') || mimetype.substr(0, mimetype.indexOf('/')) === 'image' && mimetype !== 'image/svg+xml') { - img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params)); + img.attr('src', OC.linkTo('files_sharing', '/publicpreview/'+token) + '?' + OC.buildQueryString(params)); imgcontainer.appendTo('#imgframe'); } else if (mimetype.substr(0, mimetype.indexOf('/')) !== 'video') { img.attr('src', OC.Util.replaceSVGIcon(mimetypeIcon)); @@ -158,7 +157,7 @@ OCA.Sharing.PublicApp = { imgcontainer.appendTo('#imgframe'); } else if (previewSupported === 'true') { - $('#imgframe > video').attr('poster', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params)); + $('#imgframe > video').attr('poster', OC.linkTo('files_sharing', '/publicpreview/'+token) + '?' + OC.buildQueryString(params)); } if (this.fileList) { @@ -223,8 +222,8 @@ OCA.Sharing.PublicApp = { urlSpec.y *= window.devicePixelRatio; urlSpec.x = Math.ceil(urlSpec.x); urlSpec.y = Math.ceil(urlSpec.y); - urlSpec.t = $('#dirToken').val(); - return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec); + var token = $('#dirToken').val(); + return OC.linkTo('files_sharing', '/publicpreview/'+token) + '?' + OC.buildQueryString(urlSpec); }; this.fileList.updateEmptyContent = function() { @@ -427,4 +426,4 @@ $(document).ready(function () { }; } -});
\ No newline at end of file +}); |