summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2013-09-23 12:27:05 +0200
committerGeorg Ehrke <developer@georgehrke.com>2013-09-23 12:27:05 +0200
commit8a1618bce56a32e311626cd9f0e322dd7cf330c4 (patch)
tree83e80adf022819031882a4977b90ec2ce69fb14d
parentedd38e59481a98c56645a43ca6c9048fe1458d20 (diff)
downloadnextcloud-server-8a1618bce56a32e311626cd9f0e322dd7cf330c4.tar.gz
nextcloud-server-8a1618bce56a32e311626cd9f0e322dd7cf330c4.zip
implement previews for public upload
-rw-r--r--apps/files/js/files.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 8ccb448abfb..ec688eaf63e 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -644,7 +644,11 @@ function lazyLoadPreview(path, mime, ready, width, height) {
if ( ! height ) {
height = $('#filestable').data('preview-y');
}
- var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
+ if( $('#publicUploadButtonMock').length ) {
+ var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()});
+ } else {
+ var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
+ }
$.get(previewURL, function() {
previewURL = previewURL.replace('(', '%28');
previewURL = previewURL.replace(')', '%29');