diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-23 09:38:01 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-23 09:38:01 +0100 |
commit | 79bbda994bb8dd2231f68f57785237f79f86f6c7 (patch) | |
tree | 65585aed0d21cc679cdf7e2509efd6fa3d33b458 /apps/files_sharing/js/public.js | |
parent | 2f89eef334bd445a7e046d845d5d5d1b3e4b6b8c (diff) | |
parent | 418fefc93c3332c77ec617ef108138efb6a34544 (diff) | |
download | nextcloud-server-79bbda994bb8dd2231f68f57785237f79f86f6c7.tar.gz nextcloud-server-79bbda994bb8dd2231f68f57785237f79f86f6c7.zip |
Merge pull request #16902 from owncloud/jsocclient
Web UI uses Webdav instead of ajax/* calls
Diffstat (limited to 'apps/files_sharing/js/public.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); |