var $padmaQuery = jQuery.noConflict(); (function($) { var p = padmaConfig; var padmaContainer; var wikiContainer; $(function() { padmaContainer = $('
').attr("id", "padmaSidebar").css({'position': 'fixed', 'bottom': '0px', 'top': '0px', 'right': '0px', 'width': '0px', 'background': p.background, 'color': p.color}).appendTo('body'); padmaContainer.data("currentVideo", false); wikiContainer = $('
').attr("id", "wikiWrapper").css({'width': '100%'}); $('body').wrapInner(wikiContainer); }); function setupPadmaLink(videoObj, data) { var $a = $(data.jq); // $a.data("isDisplayed", false); var linkData = data.linkData; var $container = padmaContainer; videoObj.currentLayers = []; switch (linkData.type) { case "tcRange": var mid_frame_npt = ms2npt(parseInt((npt2ms(linkData.tcIn) + npt2ms(linkData.tcOut)) / 2)); var thumbUrl = videoObj.getFrame(mid_frame_npt); default: var frame_npt = ms2npt(videoObj.video.poster_frame); var thumbUrl = videoObj.getFrame(frame_npt); } var html = videoObj.video.title + "
"; html += "
"; html += "Click to Play"; $a.tooltip({ bodyHandler: function() { return html; }, showURL: false }); $a.click(function(e) { function sidebarAnimateIn() { $container.show(); $container.animate({'width': '400px'}); var docWidth = $(document).width(); var newWidth = docWidth - 440; $('#wikiWrapper').animate({'width': newWidth + "px"}); } function sidebarAnimateOut() { $container.animate({'width': '0px'}).hide(); sidebarWrap.remove(); $('#wikiWrapper').animate({'width': '100%'}); cleanupVideo(videoObj); } function isSidebarVisible() { if (padmaContainer.width() > 0) { return true; } else { return false; } } e.preventDefault(); var currentVideo = $container.data("currentVideo"); if (currentVideo) { cleanupVideo(currentVideo); } $container.data("currentVideo", videoObj); if (!isSidebarVisible()) { sidebarAnimateIn(); } padmaContainer.empty(); var sidebarWrap = $('
').attr("id", "padmaSidebarWrapper").css({'position': 'relative'}).appendTo($container); var videoElem = $('