implement previews for public upload

This commit is contained in:
Georg Ehrke 2013-09-23 12:27:05 +02:00
parent edd38e5948
commit 8a1618bce5
1 changed files with 5 additions and 1 deletions

View File

@ -644,7 +644,11 @@ function lazyLoadPreview(path, mime, ready, width, height) {
if ( ! height ) { if ( ! height ) {
height = $('#filestable').data('preview-y'); height = $('#filestable').data('preview-y');
} }
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}); var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
}
$.get(previewURL, function() { $.get(previewURL, function() {
previewURL = previewURL.replace('(', '%28'); previewURL = previewURL.replace('(', '%28');
previewURL = previewURL.replace(')', '%29'); previewURL = previewURL.replace(')', '%29');