From 2bd15bf3e60321359fb89f50dad3c7da67e8aa38 Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 17 Mar 2011 21:48:11 -0700 Subject: [PATCH] embed images, and make sure they are activated on a new message is posted --- public/javascripts/stream.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index d8f0be134..b19c6f75c 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -88,19 +88,22 @@ var Stream = { setUpAudioLinks: function(){ $(".stream a[target='_blank']").each(function(){ - if($(this).attr('href').match(/\.gif$|\.jpg$|\.png$|\.jpeg$/)) { - $(this).hide(); - $(this).parent().append("");} + var link = $(this); + if(link.attr('href').match(/\.mp3$|\.ogg$/)) { + link.parent().append(""); + link.remove(); + } }); }, setUpImageLinks: function(){ $(".stream a[target='_blank']").each(function(){ - if($(this).attr('href').match(/\.mp3$|\.ogg$/)) { - $(this).hide(); - $(this).parent().append("");} + var link = $(this); + if(link.attr('href').match(/\.gif$|\.jpg$|\.png$|\.jpeg$/)) { + link.parent().append(""); + link.remove(); + } }); - }, toggleComments: function(evt) {