diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index 88e799bdd..d8f0be134 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -11,12 +11,9 @@ var Stream = { Diaspora.widgets.timeago.updateTimeAgo(); $stream.not(".show").delegate("a.show_post_comments", "click", Stream.toggleComments); //audio linx - $(".stream a[target='_blank']").each(function(){ - if($(this).attr('href').match(/\.mp3$|\.ogg$/)) { - $(this).hide(); - $(this).parent().append("");} - }); - + // + Stream.setUpAudioLinks(); + Stream.setUpImageLinks(); // comment link form focus $stream.delegate(".focus_comment_textarea", "click", function(e){ @@ -63,6 +60,8 @@ var Stream = { //collapse publisher Publisher.close(); Publisher.clear(); + Stream.setUpImageLinks(); + Stream.setUpAudioLinks(); }); $(".new_status_message").bind('ajax:failure', function(data, html , xhr) { @@ -87,6 +86,23 @@ var Stream = { }); }, + setUpAudioLinks: function(){ + $(".stream a[target='_blank']").each(function(){ + if($(this).attr('href').match(/\.gif$|\.jpg$|\.png$|\.jpeg$/)) { + $(this).hide(); + $(this).parent().append("");} + }); + }, + + setUpImageLinks: function(){ + $(".stream a[target='_blank']").each(function(){ + if($(this).attr('href').match(/\.mp3$|\.ogg$/)) { + $(this).hide(); + $(this).parent().append("");} + }); + + }, + toggleComments: function(evt) { evt.preventDefault(); var $this = $(this),