From 897f219d615bfdfa9447d6814c446b3bfdbb0fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 4 Jun 2014 19:51:26 +0200 Subject: [PATCH] BUGFIX: change the image upload icon when only images are authorized (fixes #2359) --- .../javascripts/discourse/lib/utilities.js | 2 +- .../modal/upload_selector.js.handlebars | 2 +- .../discourse/views/composer/composer_view.js | 7 +++ .../views/modal/upload_selector_view.js | 2 +- .../stylesheets/common/base/pagedown.scss | 4 ++ test/javascripts/lib/utilities_test.js | 53 +++++++++++-------- 6 files changed, 46 insertions(+), 24 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/utilities.js b/app/assets/javascripts/discourse/lib/utilities.js index 5799ee130b5..20ed59f0a41 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js +++ b/app/assets/javascripts/discourse/lib/utilities.js @@ -279,7 +279,7 @@ Discourse.Utilities = { **/ allowsAttachments: function() { return Discourse.Utilities.authorizesAllExtensions() || - (/(png|jpg|jpeg|gif|bmp|tif|tiff)/i).test(Discourse.SiteSettings.authorized_extensions); + !(/((png|jpg|jpeg|gif|bmp|tif|tiff)(,\s)?)+$/i).test(Discourse.Utilities.authorizedExtensions()); }, displayErrorForUpload: function(data) { diff --git a/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars b/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars index df8e01d87d7..eca424b1cf3 100644 --- a/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars @@ -38,7 +38,7 @@