Use gallery preview endpoints again since they have some additional details for SVG images

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-07-28 00:08:29 +02:00
parent 56e59908cc
commit 739ce553cf
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
3 changed files with 3 additions and 12 deletions

View File

@ -162,16 +162,10 @@ window.Gallery = window.Gallery || {};
/* jshint camelcase: false */
var params = {
fileId: fileId,
width: longEdge,
height: longEdge,
a: 1
};
if (Gallery.token) {
// TODO: return link for public pages
return this.buildGalleryUrl('preview', '/' + fileId, params);
}
return OC.generateUrl('core/preview?fileId={fileId}&x={width}&y={width}&a={a}', params);
return this.buildGalleryUrl('preview', '/' + fileId, params);
},
/**

View File

@ -129,11 +129,7 @@ function Thumbnail (fileId, square) {
thumb.loadingDeferred.resolve(null);
};
var width = square ? 200 : 400;
if (Gallery.token) {
thumb.image.src = Gallery.utility.buildGalleryUrl('preview', '/' + id, {width: width, height: 200});
} else {
thumb.image.src = OC.generateUrl('core/preview?fileId={fileId}&x={width}&y={width}&a={a}', {fileId: id, width: width, a: 1});
}
thumb.image.src = Gallery.utility.buildGalleryUrl('preview', '/' + id, {width: width, height: 200});
});
}

View File

@ -114,6 +114,7 @@ class PreviewController extends Controller {
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* Sends either a large preview of the requested file or the original file itself
*