src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 771 0a5194b39ffb
parent 687 3583e8b447f5
child 820 7968346b9689
equal deleted inserted replaced
770:14d56cb5d75d 771:0a5194b39ffb
    51     view_type = this._serializer.getNonTweetIds()[0];  
    51     view_type = this._serializer.getNonTweetIds()[0];  
    52   }
    52   }
    53   this.positionMarker = this.selector.children(":first");
    53   this.positionMarker = this.selector.children(":first");
    54   
    54   
    55   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.positionUpdater));
    55   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.positionUpdater));
    56   
    56 
    57   
    57   
    58   var i = 0;
    58   var i = 0;
    59   
    59   
    60   var segments_annotations = [];
    60   var segments_annotations = [];
    61   
    61   
   146     } })(divTitle)).mouseout(function(){
   146     } })(divTitle)).mouseout(function(){
   147       IriSP.jQuery(this).animate({opacity: 0.3}, 5);
   147       IriSP.jQuery(this).animate({opacity: 0.3}, 5);
   148       self.TooltipWidget.hide();
   148       self.TooltipWidget.hide();
   149     });
   149     });
   150 
   150 
       
   151     // react to mediafragment messages.
       
   152     this._Popcorn.listen("IriSP.Mediafragment.showAnnotation", 
       
   153       function(id, divTitle) { 
       
   154       return function(annotation_id) { 
       
   155         if (annotation_id !== id)
       
   156           return;
       
   157         
       
   158           var divObject = IriSP.jQuery("#" + id);
       
   159           divObject.animate({opacity: 0.6}, 5);
       
   160           var offset = divObject.offset();
       
   161           var correction = divObject.outerWidth() / 2;
       
   162 
       
   163           var offset_x = offset.left + correction - 106;
       
   164           if (offset_x < 0)
       
   165             offset_x = 0;
       
   166           
       
   167           var offset_y = offset.top;          
       
   168 
       
   169           self.TooltipWidget.show(divTitle, color, offset_x, offset_y - 160);
       
   170           IriSP.jQuery(document).one("mousemove", function() { divObject.animate({opacity: 0.3}, 5);
       
   171                                                                 self.TooltipWidget.hide(); });
       
   172       }; }(id, divTitle));
       
   173     
   151     IriSP.jQuery("#" + id).click(function(_this, annotation) {
   174     IriSP.jQuery("#" + id).click(function(_this, annotation) {
   152                                     return function() { _this.clickHandler(annotation)};
   175                                     return function() { _this.clickHandler(annotation)};
   153                                  }(this, annotation));
   176                                  }(this, annotation));
   154   }
   177     }
   155 };
   178 };
   156 
   179 
   157 /* restores the view after a search */
   180 /* restores the view after a search */
   158 IriSP.SegmentsWidget.prototype.clear = function() {
   181 IriSP.SegmentsWidget.prototype.clear = function() {
   159   this.selector.children(".Ldt-iri-chapter").animate({opacity:0.3}, 100);
   182   this.selector.children(".Ldt-iri-chapter").animate({opacity:0.3}, 100);
   206   //var position 	= ((time / duration) * 100).toFixed(2);
   229   //var position 	= ((time / duration) * 100).toFixed(2);
   207   var position 	= ((time / duration) * 100).toFixed(2);
   230   var position 	= ((time / duration) * 100).toFixed(2);
   208 
   231 
   209   this.positionMarker.css("left", position + "%");  
   232   this.positionMarker.css("left", position + "%");  
   210 };
   233 };
       
   234 
       
   235 IriSP.SegmentsWidget.prototype.showAnnotation = function() {
       
   236 
       
   237 };