From 54b2c3eb6b59ba7c7434d260cbc0622e87b0dc2a Mon Sep 17 00:00:00 2001 From: sanj Date: Thu, 30 Dec 2010 21:01:05 +0530 Subject: [PATCH] handle info, edit pages --- padmaTexts/static/js/views/sidebar.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/padmaTexts/static/js/views/sidebar.js b/padmaTexts/static/js/views/sidebar.js index a4f2ccd..091de04 100644 --- a/padmaTexts/static/js/views/sidebar.js +++ b/padmaTexts/static/js/views/sidebar.js @@ -16,23 +16,17 @@ function setupPadmaLink(videoObj, data) { var $a = $(data.jq); // $a.data("isDisplayed", false); var linkData = data.linkData; - if (linkData.type != 'tcRange') { - return false; + if (linkData.type in ['info', 'editor']) { + linkData.tcIn = ms2npt(0); + linkData.tcOut = ms2npt(videoObj.video.duration); } //FIXME: put this as a variable, option somewhere? var $container = padmaContainer; videoObj.currentLayers = []; - switch (linkData.type) { - case "tcRange": - var mid_frame_npt = ms2npt(parseInt((npt2ms(linkData.tcIn) + npt2ms(linkData.tcOut)) / 2)); -// console.log(mid_frame_npt); - var thumbUrl = videoObj.getFrame(mid_frame_npt); - break; - default: - var frame_npt = ms2npt(videoObj.video.poster_frame); - var thumbUrl = videoObj.getFrame(frame_npt); - } + var mid_frame_npt = ms2npt(parseInt((npt2ms(linkData.tcIn) + npt2ms(linkData.tcOut)) / 2)); +// console.log(mid_frame_npt); + var thumbUrl = videoObj.getFrame(mid_frame_npt); //FIXME: Html may need to be conditional on linkData.type, probably put html in switch case above. var html = tmpl("tmpl_tooltip", {'video': videoObj, 'thumbUrl': thumbUrl, 'linkData': linkData}); // $a.attr("title", title);