From 1840ca4fd8bc5ef2987221ff422fe5d50d6a80b9 Mon Sep 17 00:00:00 2001 From: 0ip Date: Sun, 8 Jan 2012 18:49:05 +0100 Subject: [PATCH] Added Twitpic and Imgur support, removed YT/V support temporarily --- static/js/domline.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/static/js/domline.js b/static/js/domline.js index da5a7e8d0..4fee790b0 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -175,8 +175,21 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) // video if (href_ext==".mp4" || href_ext==".ogv" || href_ext==".ogg" || href.slice(-5)==".webm" || href_ext==".mov") { extraOpenTags = extraOpenTags + '
'; - } + } + + // Imgur + if (href.match(/[http|https]\:\/\/imgur\.com\/([A-Za-z0-9]{5})/) != null) { + var imgur_id = href.match(/[http|https]\:\/\/imgur\.com\/([A-Za-z0-9]{5})/)[1]; + extraOpenTags = extraOpenTags + '
'; + } + // Twitpic + if (href.match(/[http|https]\:\/\/twitpic\.com\/([A-Za-z0-9]+)/) != null) { + var twitpic_id = href.match(/[http|https]\:\/\/twitpic\.com\/([A-Za-z0-9]+)/)[1]; + extraOpenTags = extraOpenTags + '
'; + } + + /* not working in Firefox // YouTube if (href.match(/[http|https]\:\/\/www\.youtube\.com\/watch\?v=([A-z0-9-_]{11})/) != null) { var youtube_id = href.match(/[http|https]\:\/\/www\.youtube\.com\/watch\?v=([A-z0-9-_]{11})/)[1]; @@ -189,6 +202,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) txt = 'https://vimeo.com/' + vimeo_id; extraOpenTags = extraOpenTags + '

'; } + */ // If nothing applies, consider it as a normal url if (extraOpenTags.length == 0) {