plugins: provide names for plugins
This commit is contained in:
parent
b2ee67707b
commit
741416cb79
|
@ -120,6 +120,7 @@ plugins.factory('userPlugins', function() {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
youtubePlugin.name = 'youtube video';
|
||||||
|
|
||||||
var urlPlugin = new Plugin(function(message) {
|
var urlPlugin = new Plugin(function(message) {
|
||||||
var urlPattern = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
|
var urlPattern = /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
|
||||||
|
@ -130,6 +131,7 @@ plugins.factory('userPlugins', function() {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
urlPlugin.name = 'url';
|
||||||
|
|
||||||
var imagePlugin = new Plugin(function(message) {
|
var imagePlugin = new Plugin(function(message) {
|
||||||
var urls = message.match(/https?:\/\/[^\s]*\.(jpg|png|gif)\b/)
|
var urls = message.match(/https?:\/\/[^\s]*\.(jpg|png|gif)\b/)
|
||||||
|
@ -139,6 +141,7 @@ plugins.factory('userPlugins', function() {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
imagePlugin.name = 'image';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
plugins: [youtubePlugin, urlPlugin, imagePlugin]
|
plugins: [youtubePlugin, urlPlugin, imagePlugin]
|
||||||
|
|
Loading…
Reference in New Issue