Browse Source

treat Streetview API urls as images, not maps. Closes #520. Thanks @obsoleter

pull/631/head
Joe Germuska 11 years ago
parent
commit
e180edd80b
  1. 8
      source/js/Core/Media/VMM.MediaType.js

8
source/js/Core/Media/VMM.MediaType.js

@ -84,7 +84,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
} }
media.type = "twitter"; media.type = "twitter";
success = true; 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.type = "google-map";
media.id = d.split(/src=['|"][^'|"]*?['|"]/gi); media.id = d.split(/src=['|"][^'|"]*?['|"]/gi);
success = true; success = true;
@ -109,7 +109,11 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
media.link = d; media.link = d;
media.id = VMM.ExternalAPI.instagram.getInstagramIdFromUrl(d) media.id = VMM.ExternalAPI.instagram.getInstagramIdFromUrl(d)
success = Boolean(media.id); 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.type = "image";
media.id = d; media.id = d;
success = true; success = true;

Loading…
Cancel
Save