diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-21 17:09:46 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-21 17:09:46 +0100 |
commit | 8ba42abbe45affe7cd149c8e693c69b5994b2c98 (patch) | |
tree | baa6de9f810ae2048380cfa59a9a0fb023568189 /apps/files_sharing/js | |
parent | 3deb6600d055b98f3363ca62b7b7656d107c7795 (diff) | |
parent | 374ddbff55719ee42986383e6700e01370d68627 (diff) | |
download | nextcloud-server-8ba42abbe45affe7cd149c8e693c69b5994b2c98.tar.gz nextcloud-server-8ba42abbe45affe7cd149c8e693c69b5994b2c98.zip |
Merge pull request #13432 from owncloud/animate_gifs_public_sharing
show animated gifs on public sharing page
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 12 |
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') { |