Sha256: 435bcaaedd346ced208eccbcefa8ffe93f3e3c7dbd0bf6bb27589d5dd579ea7f

Contents?: true

Size: 1.8 KB

Versions: 22

Compression:

Stored size: 1.8 KB

Contents

$('.attachment_tile a, .picture_link a').live("click",function(e){
	if(this.type ==""){
		return true;
	}
	e.preventDefault();
	
	var download_link = this;

    /*
	if($('.player').length > 0 && $('.attachment_tile.selected').length==1){
		removePlayers();
		return;
	}
	*/
	if(this.type == "Audio"){
		removePlayers();
		$(this).parent().parent().addClass("selected");
		$('body').append("<audio class='player' autoplay='autoplay' id='audio_player' src='"+this+"' controls='controls'></audio>");
		$('body').append("<a href='"+download_link+"'><img id='downloadButton' src='<%= asset_path "16/default.png" %>' /></a>");
		return;
	}
	if(this.type == "Video"){
		removePlayers();
		$(this).parent().parent().addClass("selected");
		var show = (this+"").split('/download')[0];
		show = show.replace("documents","videos");
		$('body').append("<video class='player' autoplay='autoplay' id='video_player' src='"+show+"?style=webm' controls='controls'></video>");		
		$('body').append("<a href='"+download_link+"'><img id='downloadButton' src='<%= asset_path "16/default.png" %>' /></a>");
		return;
	}
});

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);
});

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
social_stream-0.9.5 documents/app/assets/javascripts/documents.js.erb
social_stream-documents-0.2.8 app/assets/javascripts/documents.js.erb