137 if (searchString == "") |
137 if (searchString == "") |
138 return; |
138 return; |
139 |
139 |
140 var matches = this._serializer.searchOccurences(searchString); |
140 var matches = this._serializer.searchOccurences(searchString); |
141 |
141 |
|
142 if (IriSP.countProperties(matches) > 0) { |
|
143 this._Popcorn.trigger("IriSP.SegmentsWidget.matchFound"); |
|
144 } else { |
|
145 this._Popcorn.trigger("IriSP.SegmentsWidget.noMatchFound"); |
|
146 } |
|
147 |
|
148 console.log(matches.length, matches); |
|
149 |
142 for (var id in matches) { |
150 for (var id in matches) { |
143 var factor = (0.3 + matches[id] * 0.2) % 1; |
151 var factor = (0.3 + matches[id] * 0.2) % 1; |
144 this.selector.find("#"+id).dequeue(); |
152 this.selector.find("#"+id).dequeue(); |
145 this.selector.find("#"+id).css('border','1px red'); |
153 this.selector.find("#"+id).css('border','1px red'); |
146 this.selector.find("#"+id).animate({opacity:factor}, 200); |
154 this.selector.find("#"+id).animate({opacity:factor}, 200); |
147 |
|
148 IriSP.jQuery("#LdtSearchInput").css('background-color','#e1ffe1'); |
|
149 } |
155 } |
150 |
156 |
151 // clean up the blocks that were in the previous search |
157 // clean up the blocks that were in the previous search |
152 // but who aren't in the current one. |
158 // but who aren't in the current one. |
153 for (var id in this.oldSearchMatches) { |
159 for (var id in this.oldSearchMatches) { |