From e180edd80b1faad7c29fafb602cd8d01eecab84a Mon Sep 17 00:00:00 2001 From: Joe Germuska Date: Fri, 9 May 2014 11:58:30 -0500 Subject: [PATCH] treat Streetview API urls as images, not maps. Closes #520. Thanks @obsoleter --- source/js/Core/Media/VMM.MediaType.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/js/Core/Media/VMM.MediaType.js b/source/js/Core/Media/VMM.MediaType.js index 37d4bc6..ec50c90 100644 --- a/source/js/Core/Media/VMM.MediaType.js +++ b/source/js/Core/Media/VMM.MediaType.js @@ -84,7 +84,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') { } media.type = "twitter"; success = true; - } else if (d.match("maps.google") && !d.match("staticmap")) { + } else if (d.match("maps.google") && !d.match("staticmap") && !d.match('streetview')) { media.type = "google-map"; media.id = d.split(/src=['|"][^'|"]*?['|"]/gi); success = true; @@ -109,7 +109,11 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') { media.link = d; media.id = VMM.ExternalAPI.instagram.getInstagramIdFromUrl(d) success = Boolean(media.id); - } else if (d.match(/jpg|jpeg|png|gif|svg/i) || d.match("staticmap") || d.match("yfrog.com") || d.match("twitpic.com")) { + } else if (d.match(/jpg|jpeg|png|gif|svg/i) || + d.match("staticmap") || + d.match("yfrog.com") || + d.match("twitpic.com") || + d.match('maps.googleapis.com/maps/api/streetview')) { media.type = "image"; media.id = d; success = true;