gist: 948691, 2011-04-29 17:46:26Z
function buildDisplayList(videos)
{
if (videos == null)
{
$('#Notification').jnotifyAddMessage({ text: "Error processing queue.", permanent: true, type: 'error' });
throw("I failed, sorry.");
}
// ok the object isnt null, lets build a sortable table with the info
for (i = 0; i < videos.length; i++)
{
// generate the lightbox entry prior to appending to the list
lbox = generateLightBox(videos[i].VideoId, videos[i].EmbedFile);
$('#TemplateContainer').append(lbox);
// now append it to the list
entry = $('#list-template').clone();
entry.attr('id', videos[i].VideoId);
// append the data to the cloned item
// bind any and all events in this row
entry.find('a.changeStatus').bind('click', function () {
changeApproval(videos[i].MemberId);
});
entry.find('td.memberId').text(videos[i].MemberId);
entry.find('td.memberName').text(videos[i].Author);
entry.find('td.submittedOn').text(videos[i].CreatedOn);
entry.find('td.votes').text(videos[i].Votes);
if (videos[i].IsApproved == false)
{
entry.find('img#videoStatus').attr('src', "images/onebit_33.png");
} else {
entry.find('img#videoStatus').attr('src', "images/onebit_34.png");
}
//entry.find('td.view').text(genView(videos[i].HasThumb, videos[i].VideoId));
//stick it in the table
$('#VideoList TBody').append(entry);
}//end loop
//apply the lightbox to our built objects
$("a#inline").fancybox({
'hideOnContentClick': true
});