summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2015-01-17 12:11:52 +0100
committerGeorg Ehrke <developer@georgehrke.com>2015-01-19 16:20:06 +0100
commit374ddbff55719ee42986383e6700e01370d68627 (patch)
tree4e8b0a4272cd64137ff006e7691e7d1b9b962a42 /apps/files_sharing/js
parent60c4cb1dd669a0c40abcff50a636d7b4cb6469e0 (diff)
downloadnextcloud-server-374ddbff55719ee42986383e6700e01370d68627.tar.gz
nextcloud-server-374ddbff55719ee42986383e6700e01370d68627.zip
show animated gifs on public sharing page
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/public.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index cbd135028f1..bec43a4fb57 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -97,7 +97,17 @@ OCA.Sharing.PublicApp = {
};
var img = $('<img class="publicpreview" alt="">');
- if (previewSupported === 'true' || mimetype.substr(0, mimetype.indexOf('/')) === 'image' && mimetype !== 'image/svg+xml') {
+
+ var fileSize = parseInt($('#filesize').val(), 10);
+ var maxGifSize = parseInt($('#maxSizeAnimateGif').val(), 10);
+
+ if (mimetype === 'image/gif' &&
+ (maxGifSize === -1 || fileSize <= (maxGifSize * 1024 * 1024))) {
+ img.attr('src', $('#downloadURL').val());
+ img.appendTo('#imgframe');
+ } else if (previewSupported === 'true' ||
+ mimetype.substr(0, mimetype.indexOf('/')) === 'image' &&
+ mimetype !== 'image/svg+xml') {
img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params));
img.appendTo('#imgframe');
} else if (mimetype.substr(0, mimetype.indexOf('/')) !== 'video') {