src/js/widgets/playerWidget.js
branchpopcorn-port
changeset 355 d8df77c40676
parent 338 3ff4499f79bb
child 398 d1883378b822
equal deleted inserted replaced
354:002c314cabbf 355:d8df77c40676
    22     
    22     
    23   // handle clicks by the user on the video.
    23   // handle clicks by the user on the video.
    24   this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater));
    24   this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater));
    25   this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater));
    25   this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater));
    26   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater));
    26   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater));
       
    27   this._Popcorn.listen("IriSP.SegmentsWidget.matchFound", IriSP.wrap(this, this.searchMatch));
       
    28   this._Popcorn.listen("IriSP.SegmentsWidget.noMatchFound", IriSP.wrap(this, this.searchNoMatch));
    27   
    29   
    28   
    30   
    29   this.selector.find(".Ldt-CtrlPlay").click(function() { self.playHandler.call(self); });
    31   this.selector.find(".Ldt-CtrlPlay").click(function() { self.playHandler.call(self); });
    30   this.selector.find(".Ldt-CtrlNext").click(function() { });
    32   this.selector.find(".Ldt-CtrlNext").click(function() { });
    31   this.selector.find(".Ldt-CtrlSearch").click(function() { self.searchButtonHandler.call(self); });
    33   this.selector.find(".Ldt-CtrlSearch").click(function() { self.searchButtonHandler.call(self); });
   145   this._searchLastValue = this.selector.find(".LdtSearchInput").attr('value');
   147   this._searchLastValue = this.selector.find(".LdtSearchInput").attr('value');
   146   
   148   
   147   // do nothing if the search field is empty, instead of highlighting everything.
   149   // do nothing if the search field is empty, instead of highlighting everything.
   148   if (this._searchLastValue == "") {
   150   if (this._searchLastValue == "") {
   149     this._Popcorn.trigger("IriSP.search.cleared");
   151     this._Popcorn.trigger("IriSP.search.cleared");
       
   152     this.selector.find(".LdtSearchInput").css('background-color','');
   150   } else {
   153   } else {
   151     this._Popcorn.trigger("IriSP.search", this._searchLastValue);
   154     this._Popcorn.trigger("IriSP.search", this._searchLastValue);
   152   }
   155   }
   153 };
   156 };
   154 
   157 
   160   this.selector.find(".LdtSearchInput").css('background-color','#e1ffe1');
   163   this.selector.find(".LdtSearchInput").css('background-color','#e1ffe1');
   161 }
   164 }
   162 
   165 
   163 /* the same, except that no value could be found */
   166 /* the same, except that no value could be found */
   164 IriSP.PlayerWidget.prototype.searchNoMatch = function() {
   167 IriSP.PlayerWidget.prototype.searchNoMatch = function() {
   165   this.selector.find(".LdtSearchInput").css('background-color','#e1ffe1');
   168   this.selector.find(".LdtSearchInput").css('background-color', "#d62e3a");
   166 }
   169 }
   167 
   170