src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 148 5e877acd85ca
parent 139 ba2b3c15bd47
child 152 5950ab2855a8
equal deleted inserted replaced
147:955119f901b4 148:5e877acd85ca
     4 
     4 
     5 IriSP.SegmentsWidget.prototype = new IriSP.Widget();
     5 IriSP.SegmentsWidget.prototype = new IriSP.Widget();
     6 
     6 
     7 IriSP.SegmentsWidget.prototype.draw = function() {
     7 IriSP.SegmentsWidget.prototype.draw = function() {
     8 
     8 
       
     9   var self = this;
     9   var annotations = this._serializer._data.annotations;
    10   var annotations = this._serializer._data.annotations;
    10   
    11   
    11   var i = 0;
    12   var i = 0;
    12 	for (i = 0; i < annotations.length; i++) {    
    13 	for (i = 0; i < annotations.length; i++) {    
    13     var annotation = annotations[i];
    14     var annotation = annotations[i];
    60                         return function() { 
    61                         return function() { 
    61                           IriSP.jQuery("#Ldt-Show-Arrow").animate({left: real_middle + '%'}, 1000); }}(middle)                
    62                           IriSP.jQuery("#Ldt-Show-Arrow").animate({left: real_middle + '%'}, 1000); }}(middle)                
    62                 };
    63                 };
    63     this._Popcorn = this._Popcorn.code(conf);
    64     this._Popcorn = this._Popcorn.code(conf);
    64   }
    65   }
       
    66   
       
    67   this._Popcorn.listen("IriSP.search", function(searchWord) { self.searchHandler.call(self, searchWord); });
    65 };
    68 };
    66 
    69 
    67 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) {
    70 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) {
    68   var begin = Math.round((+ annotation.begin) / 1000);
    71   var begin = Math.round((+ annotation.begin) / 1000);
    69   this._Popcorn.currentTime(begin)
    72   this._Popcorn.currentTime(begin)
    70 };
    73 };
       
    74 
       
    75 IriSP.SegmentsWidget.prototype.searchHandler = function(searchWord) {
       
    76   console.log("received" + searchWord);
       
    77 };