# HG changeset patch # User hamidouk # Date 1322580933 -3600 # Node ID d8df77c40676123fdcddf3e099822743607d2505 # Parent 002c314cabbfdc5be1d6bb55b2d9602eee7e536b fixed search field coloring. diff -r 002c314cabbf -r d8df77c40676 src/js/widgets/playerWidget.js --- a/src/js/widgets/playerWidget.js Tue Nov 29 16:35:20 2011 +0100 +++ b/src/js/widgets/playerWidget.js Tue Nov 29 16:35:33 2011 +0100 @@ -24,6 +24,8 @@ this._Popcorn.listen("play", IriSP.wrap(this, this.playButtonUpdater)); this._Popcorn.listen("pause", IriSP.wrap(this, this.playButtonUpdater)); this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.timeDisplayUpdater)); + this._Popcorn.listen("IriSP.SegmentsWidget.matchFound", IriSP.wrap(this, this.searchMatch)); + this._Popcorn.listen("IriSP.SegmentsWidget.noMatchFound", IriSP.wrap(this, this.searchNoMatch)); this.selector.find(".Ldt-CtrlPlay").click(function() { self.playHandler.call(self); }); @@ -147,6 +149,7 @@ // do nothing if the search field is empty, instead of highlighting everything. if (this._searchLastValue == "") { this._Popcorn.trigger("IriSP.search.cleared"); + this.selector.find(".LdtSearchInput").css('background-color',''); } else { this._Popcorn.trigger("IriSP.search", this._searchLastValue); } @@ -162,6 +165,6 @@ /* the same, except that no value could be found */ IriSP.PlayerWidget.prototype.searchNoMatch = function() { - this.selector.find(".LdtSearchInput").css('background-color','#e1ffe1'); + this.selector.find(".LdtSearchInput").css('background-color', "#d62e3a"); } diff -r 002c314cabbf -r d8df77c40676 src/js/widgets/segmentsWidget.js --- a/src/js/widgets/segmentsWidget.js Tue Nov 29 16:35:20 2011 +0100 +++ b/src/js/widgets/segmentsWidget.js Tue Nov 29 16:35:33 2011 +0100 @@ -139,13 +139,19 @@ var matches = this._serializer.searchOccurences(searchString); + if (IriSP.countProperties(matches) > 0) { + this._Popcorn.trigger("IriSP.SegmentsWidget.matchFound"); + } else { + this._Popcorn.trigger("IriSP.SegmentsWidget.noMatchFound"); + } + + console.log(matches.length, matches); + for (var id in matches) { var factor = (0.3 + matches[id] * 0.2) % 1; this.selector.find("#"+id).dequeue(); this.selector.find("#"+id).css('border','1px red'); this.selector.find("#"+id).animate({opacity:factor}, 200); - - IriSP.jQuery("#LdtSearchInput").css('background-color','#e1ffe1'); } // clean up the blocks that were in the previous search