plugins: provide names for plugins

This commit is contained in:
David Cormier 2013-10-13 15:00:00 -04:00
parent b2ee67707b
commit 741416cb79
1 changed files with 3 additions and 0 deletions

View File

@ -120,6 +120,7 @@ plugins.factory('userPlugins', function() {
return null;
});
youtubePlugin.name = 'youtube video';
var urlPlugin = new Plugin(function(message) {
var urlPattern = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
@ -130,6 +131,7 @@ plugins.factory('userPlugins', function() {
return null;
});
urlPlugin.name = 'url';
var imagePlugin = new Plugin(function(message) {
var urls = message.match(/https?:\/\/[^\s]*\.(jpg|png|gif)\b/)
@ -139,6 +141,7 @@ plugins.factory('userPlugins', function() {
}
return null;
});
imagePlugin.name = 'image';
return {
plugins: [youtubePlugin, urlPlugin, imagePlugin]