From a3c691f8150416a235b909847b05c47ea64c0bb0 Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Tue, 8 Jul 2014 21:21:57 +0530 Subject: [PATCH] Fix incompatible method in chrome for URL Incompatible method .contains was used to check if a URL string has image extensions. This was causing the app to fail in chrome. Fix using merge. --- swtr/static/js/swtmaker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swtr/static/js/swtmaker.js b/swtr/static/js/swtmaker.js index 05e407a..24a19b4 100644 --- a/swtr/static/js/swtmaker.js +++ b/swtr/static/js/swtmaker.js @@ -295,8 +295,8 @@ setImage: function(event) { event.preventDefault(); var url = $('#img-url-input').val(); - if(url.contains('.jpg') || url.contains('.png') || - url.contains('.gif') || url.contains('.jpeg')) { + if(url.match(/.jpg|.jpeg|.png|.gif|.bmp|.svg/)) { + this.imgURL = $('#img-url-input').val(); if(!this.imgURL) { return false; -- 1.7.10.4