3 function myCarousel_initCallback(carousel) {
\r
4 theCarousel = carousel; // hack!
\r
7 function myCarousel_onBeforeAnimation(carousel, state) {
\r
8 for (var i = carousel.first; i <= carousel.last; i++) {
\r
9 if (carousel.has(i)) {
\r
13 if (i > carousel.options.customEventManager.getEventCount()) {
\r
17 var event = carousel.options.customEventManager.getEvent(i - 1);
\r
19 var html = '<img src="' + event.args.src + '" width="' + html5tv.carousel.width + '" height="' + html5tv.carousel.height + '" alt="' + event.args.description + '" id="' + event.args.id + '" /><div class="thumbnailOverlay">' + event.args.title + '</div>';
\r
21 carousel.add(i, html);
\r
23 myCarousel_addClickHandler(event.args.id, event.startTime);
\r
27 function seek_video(time) {
\r
28 var videoElement = $("video#vid").get(0);
\r
29 videoElement.currentTime = time;
\r
33 function myCarousel_addClickHandler(id, time) {
\r
34 $("#" + id).click(function() {
\r
39 function chapterChange(isActive, args) {
\r
41 //console.debug( isActive, args );
\r
44 $("#carousel img").css("border-color", "#272928");
\r
45 $("#" + args.id).css("border-color", "white");
\r
46 $("#carousel .thumbnailOverlay").css("visibility", "hidden");
\r
47 $("#" + args.id + " + .thumbnailOverlay").css("visibility", "visible");
\r
49 $('#sub_' + args.index).addClass('active');
\r
51 theCarousel.scroll(args.index, true);
\r
53 $('#sub_' + args.index).removeClass('active');
\r
58 function additional_video(isActive, args) {
\r
59 var video = $('video#' + args.id);
\r
60 //console.debug( isActive, args, video );
\r
62 $('div#slide').hide();
\r
68 $('div#slide').show();
\r
73 $().ready(function() {
\r
74 //console.debug( video_sync );
\r
75 $("#vid").sync( html5tv.sync );
\r
77 $(".toggleContentPanel").click(function() {
\r
78 var contentPanelId = "#" + ($(this).attr("class")).split(" ")[1];
\r
79 $(contentPanelId).toggle("blind", {}, 100);
\r
81 var currentBackground = $(this).css("background-image");
\r
82 var newBackground = currentBackground.indexOf("Show") >=0 ? "url(contentPanelHide.png)" : "url(contentPanelShow.png)";
\r
83 $(this).css("background-image", newBackground);
\r
87 var synchroniser = $("#vid").data("synchroniser");
\r
89 var customEventManager = synchroniser.getCustomEventManager();
\r
90 var chapterCount = customEventManager.getEventCount();
\r
92 $('#carousel').jcarousel({
\r
95 onBeforeAnimation: myCarousel_onBeforeAnimation
\r
97 initCallback: myCarousel_initCallback,
\r
98 customEventManager: customEventManager
\r
101 $('td.seek_video').click( function() {
\r
102 //console.debug( 'click', this );
\r
103 var mmss = this.textContent;
\r
104 var to = this.firstChild.hash.replace('#','');
\r
105 //console.debug( 'seek', mmss, to );
\r