From b42e490f7f1115faf39db3510301f413e217e6d6 Mon Sep 17 00:00:00 2001 From: HausdorffHimself Date: Tue, 27 Aug 2013 18:34:02 +0200 Subject: [PATCH] FIX: downcase in JS --- app/assets/javascripts/application.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 67930f6..c94246e 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -23,13 +23,13 @@ //= require jquery-fileupload function insertAttachment(url,name) { - var ext = url.split('.').pop(); - var img_ext = [ "jpg", "png", "bmp" , "jpeg" ]; - - if ( img_ext.indexOf(ext) > -1) { - tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + ""); - } - else { - tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "" + name +""); - } + var ext = url.split('.').pop().toLowerCase(); + var img_ext = [ "jpg", "png", "bmp" , "jpeg" ]; + + if ( img_ext.indexOf(ext) > -1) { + tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + ""); + } + else { + tinymce.activeEditor.setContent(tinymce.activeEditor.getContent({format : 'raw'}) + "" + name +""); + } }