Browse Source

Interpret Google Maps Streetview API URLs correctly

Google Maps Streetview API URLs return images and should be classified thusly.  This commit narrows the conditional for the google-map media type and widens the conditional for the image media type.
pull/520/head
Jeremy A 11 years ago
parent
commit
c092ef559b
  1. 6
      source/js/Core/Media/VMM.MediaType.js

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

@ -69,7 +69,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;
@ -94,7 +94,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
media.link = d; media.link = d;
media.id = d.split("\/p\/")[1].split("/")[0]; media.id = d.split("\/p\/")[1].split("/")[0];
success = true; success = true;
} else if (d.match(/jpg|jpeg|png|gif/i) || d.match("staticmap") || d.match("yfrog.com") || d.match("twitpic.com")) { } else if (d.match(/jpg|jpeg|png|gif/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;
@ -142,4 +142,4 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
} }
return false; return false;
} }
} }

Loading…
Cancel
Save