diff options
author | Olivier Paroz <github@oparoz.com> | 2015-04-16 19:23:42 +0200 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-04-23 18:19:12 +0200 |
commit | e113d67430c0433e96c0de83e989bd6284fd0d63 (patch) | |
tree | e2c4fbd97e1c085075e3c84fa0a4add0183fa475 /apps/files_sharing | |
parent | 8d3f88cf16f86212861db996023dadf1fb3e310f (diff) | |
download | nextcloud-server-e113d67430c0433e96c0de83e989bd6284fd0d63.tar.gz nextcloud-server-e113d67430c0433e96c0de83e989bd6284fd0d63.zip |
Cache the token value
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/public.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 59ef971ae67..cfb6569529f 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -87,6 +87,7 @@ OCA.Sharing.PublicApp = { // dynamically load image previews + var token = $('#sharingToken').val(); var bottomMargin = 350; var previewWidth = $(window).width() * window.devicePixelRatio; var previewHeight = $(window).height() - bottomMargin * window.devicePixelRatio; @@ -96,7 +97,7 @@ OCA.Sharing.PublicApp = { y: previewHeight, a: 'true', file: encodeURIComponent(this.initialDir + $('#filename').val()), - t: $('#sharingToken').val(), + t: token, scalingup: 0 }; @@ -144,7 +145,6 @@ OCA.Sharing.PublicApp = { filename = JSON.stringify(filename); } var path = dir || FileList.getCurrentDirectory(); - var token = $('#sharingToken').val(); var params = { path: path, files: filename @@ -154,12 +154,11 @@ OCA.Sharing.PublicApp = { this.fileList.getAjaxUrl = function (action, params) { params = params || {}; - params.t = $('#sharingToken').val(); + params.t = token; return OC.filePath('files_sharing', 'ajax', action + '.php') + '?' + OC.buildQueryString(params); }; this.fileList.linkTo = function (dir) { - var token = $('#sharingToken').val(); var params = { dir: dir }; |