plugins: add Google Maps support

This commit is contained in:
Vivien Didelot 2013-10-18 17:32:39 -04:00
parent 4eddc8bf57
commit 10480843c2
1 changed files with 21 additions and 1 deletions

View File

@ -219,7 +219,27 @@ plugins.factory('userPlugins', function() {
}); });
cloudmusicPlugin.name = 'cloud music'; cloudmusicPlugin.name = 'cloud music';
/*
* Google Maps
*/
var googlemapPlugin = new Plugin(function(message) {
var match = message.match(urlRegexp);
if (match) {
var url = match[0];
/* SoundCloud http://help.soundcloud.com/customer/portal/articles/247785-what-widgets-can-i-use-from-soundcloud- */
if (url.match(/google.*maps/)) {
return '<iframe width="450" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' + url + '&output=embed"></iframe>';
}
}
return null;
});
googlemapPlugin.name = 'Google Map';
return { return {
plugins: [youtubePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin] plugins: [youtubePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin]
} }
}); });