From 5f5373837611f28a0fa58976e58e22ad8ca679fe Mon Sep 17 00:00:00 2001 From: Miguel Dantas Date: Sat, 15 Jun 2019 15:16:28 +0100 Subject: [PATCH] [MEDIA][UI] Added preview support for BMP, WEBP and ICO, displaying the name underneath, centered --- js/util.js | 9 ++++++--- lib/framework.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/util.js b/js/util.js index b645e8b029..2e966dfcef 100644 --- a/js/util.js +++ b/js/util.js @@ -952,7 +952,8 @@ var SN = { // StatusNet preview = false; } - var imageTypes = ['image/png', 'image/jpeg', 'image/gif', 'image/svg+xml']; + var imageTypes = ['image/png', 'image/jpeg', 'image/gif', 'image/svg+xml', + 'image/bmp', 'image/webp', 'image/vnd.microsoft.icon']; if ($.inArray(file.type, imageTypes) == -1) { // We probably don't know how to show the file. preview = false; @@ -966,14 +967,16 @@ var SN = { // StatusNet if (preview) { blobAsDataURL(file, function (url) { - var fileentry = $('
  • '); - fileentry.append($('' + file.name + '')); + var fileentry = $('
  • ') + .attr('class', 'attachment') + .attr('style', 'text-align: center'); var img = $('') .attr('title', tooltip) .attr('alt', tooltip) .attr('src', url) .attr('style', 'height: 120px'); fileentry.append(img); + fileentry.append($('
    ' + file.name + '')); form.find('.attach-status').append(fileentry); }); } else { diff --git a/lib/framework.php b/lib/framework.php index 355894e993..024ee1b1bf 100644 --- a/lib/framework.php +++ b/lib/framework.php @@ -32,7 +32,7 @@ defined('GNUSOCIAL') || die(); define('GNUSOCIAL_ENGINE', 'GNU social'); define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/'); -define('GNUSOCIAL_BASE_VERSION', '1.21.0'); +define('GNUSOCIAL_BASE_VERSION', '1.21.1'); define('GNUSOCIAL_LIFECYCLE', 'dev'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);