embed images, and make sure they are activated on a new message is posted
This commit is contained in:
parent
93f7f28b07
commit
275098a309
1 changed files with 22 additions and 6 deletions
|
|
@ -11,12 +11,9 @@ var Stream = {
|
||||||
Diaspora.widgets.timeago.updateTimeAgo();
|
Diaspora.widgets.timeago.updateTimeAgo();
|
||||||
$stream.not(".show").delegate("a.show_post_comments", "click", Stream.toggleComments);
|
$stream.not(".show").delegate("a.show_post_comments", "click", Stream.toggleComments);
|
||||||
//audio linx
|
//audio linx
|
||||||
$(".stream a[target='_blank']").each(function(){
|
//
|
||||||
if($(this).attr('href').match(/\.mp3$|\.ogg$/)) {
|
Stream.setUpAudioLinks();
|
||||||
$(this).hide();
|
Stream.setUpImageLinks();
|
||||||
$(this).parent().append("<audio preload='none' src='" + this.href + "' controls='controls'>mom</audio>");}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// comment link form focus
|
// comment link form focus
|
||||||
$stream.delegate(".focus_comment_textarea", "click", function(e){
|
$stream.delegate(".focus_comment_textarea", "click", function(e){
|
||||||
|
|
@ -63,6 +60,8 @@ var Stream = {
|
||||||
//collapse publisher
|
//collapse publisher
|
||||||
Publisher.close();
|
Publisher.close();
|
||||||
Publisher.clear();
|
Publisher.clear();
|
||||||
|
Stream.setUpImageLinks();
|
||||||
|
Stream.setUpAudioLinks();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".new_status_message").bind('ajax:failure', function(data, html , xhr) {
|
$(".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("<img src='" + this.href + "'</img>");}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setUpImageLinks: function(){
|
||||||
|
$(".stream a[target='_blank']").each(function(){
|
||||||
|
if($(this).attr('href').match(/\.mp3$|\.ogg$/)) {
|
||||||
|
$(this).hide();
|
||||||
|
$(this).parent().append("<audio preload='none' src='" + this.href + "' controls='controls'>mom</audio>");}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
toggleComments: function(evt) {
|
toggleComments: function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
var $this = $(this),
|
var $this = $(this),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue