From fb5a477b73b147d1349f7af555e2df1e09bbf1cb Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sat, 22 Feb 2014 22:16:32 -0500 Subject: [PATCH] Implement asciinema plugin Close #66 --- js/plugins.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/js/plugins.js b/js/plugins.js index ccd31bd..63420a3 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -266,7 +266,23 @@ plugins.factory('userPlugins', function() { }); googlemapPlugin.name = 'Google Map'; + /* + * Asciinema plugin + */ + var asciinemaPlugin = new Plugin(function(message) { + + var regexp = /http(s){0,1}:\/\/(www\.){0,1}asciinema.org\/a\/(\d+)/; + var match = message.match(regexp); + if (match) { + var id = match[3]; + return ""; + } + }); + asciinemaPlugin.name = "ascii cast"; + return { - plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin] + plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin] }; + + });