Sha256: 7c313e128e1361efc86e9daeff9d0792cf018073656fae9d81cbfb0b3cbb69c8

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 KB

Contents

function removePlayers(){
	$('.attachment_tile').removeClass("selected");
	$('.player').remove();
	$('#downloadButton').remove();
}

$('#closeButton').live("click",function(){
	removePlayers();
});

function hideJplayer(jplayerid){
  $("#full_video_"+jplayerid).removeClass("jp-video-270p");
  $("#jp_interface_"+jplayerid).hide();
  $("#jp_playlist_"+jplayerid).hide();
}

function showJplayer(jplayerid){
  $("#full_video_"+jplayerid).addClass("jp-video-270p");
  $("#jp_interface_"+jplayerid).show();
  $("#jp_playlist_"+jplayerid).show();
  
}

$(".video_thumbnail_play_over").livequery("click",function(){
  the_id = $(this).attr('id');
  showJplayer(the_id);
  $(this).parent().hide();
  $("#jpId"+the_id).jPlayer("play", 0);
});

$(document).ready(function(){  
  //if there are 6 or more commments we only show the last 5 and a link to show the rest
  $("#document_comments .activity_comments").each(function(){
    var comments = $(this).children(".subactivity");    
    if (comments.size() > 5){
      $(this).prepend("<div class='hide_show_comments'><a href='#' onclick='showAllDocumentComments(\""+ 
                       $(this).attr('id') +"\"); return false;'><%= I18n.t('comment.view_all') %> (" + 
                      comments.size() + ")</a></div><div class='space_comments'></div>");
      comments.slice(0,comments.size()-5).hide();
      //hide alto space_comments
      $(this).children(".space_comments").slice(0,comments.size()-5).hide();
    }
  });    
});

showAllDocumentComments = function(id){
  $("#"+id).children().show("slow");
  //and hide the hide_show_comments
  $("#"+id).children(".hide_show_comments").hide();
};

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
social_stream-0.12.0 documents/app/assets/javascripts/documents.js.erb
social_stream-documents-0.4.0 app/assets/javascripts/documents.js.erb