diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-13 17:41:20 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-22 16:05:50 +0100 |
commit | f20232d4bd3e78c4ea980aa03849c3f9bcf5b893 (patch) | |
tree | c23d4511baaf4df2d1c397326334d40f8455243a /apps/files_sharing/js | |
parent | fa2be0750c50de45a2fd101eb23fa858c0e0771b (diff) | |
download | nextcloud-server-f20232d4bd3e78c4ea980aa03849c3f9bcf5b893.tar.gz nextcloud-server-f20232d4bd3e78c4ea980aa03849c3f9bcf5b893.zip |
Make public link share page work with Webdav and add operations
The public page now uses the public.php/webdav endpoint.
Also enabled more file operations like rename, move, delete and create
folder from the public page, which are now all possible thanks to the
public.php/webdav endpoint.
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 246b639f652..82691129926 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -48,8 +48,20 @@ OCA.Sharing.PublicApp = { this._initialized = true; this.initialDir = $('#dir').val(); + var token = $('#sharingToken').val(); + // file list mode ? if ($el.find('#filestable').length) { + var filesClient = new OC.Files.Client({ + host: OC.getHost(), + port: OC.getPort(), + userName: token, + // note: password not be required, the endpoint + // will recognize previous validation from the session + root: OC.getRootPath() + '/public.php/webdav', + useHTTPS: OC.getProtocol() === 'https' + }); + this.fileList = new OCA.Files.FileList( $el, { @@ -58,7 +70,8 @@ OCA.Sharing.PublicApp = { dragOptions: dragOptions, folderDropOptions: folderDropOptions, fileActions: fileActions, - detailsViewEnabled: false + detailsViewEnabled: false, + filesClient: filesClient } ); this.files = OCA.Files.Files; @@ -88,7 +101,6 @@ OCA.Sharing.PublicApp = { // dynamically load image previews - var token = $('#sharingToken').val(); var bottomMargin = 350; var previewWidth = Math.ceil($(window).width() * window.devicePixelRatio); var previewHeight = Math.ceil(($(window).height() - bottomMargin) * window.devicePixelRatio); |