src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 353 21f3a1d501eb
parent 336 8da13562cfea
child 355 d8df77c40676
equal deleted inserted replaced
352:cc2cdecc5ce5 353:21f3a1d501eb
   120 IriSP.SegmentsWidget.prototype.clear = function() {
   120 IriSP.SegmentsWidget.prototype.clear = function() {
   121   // reinit the fields
   121   // reinit the fields
   122   for (var id in this.oldSearchMatches) {
   122   for (var id in this.oldSearchMatches) {
   123 
   123 
   124       IriSP.jQuery("#"+id).dequeue();
   124       IriSP.jQuery("#"+id).dequeue();
   125 			IriSP.jQuery("#"+id).animate({height:0}, 100);
   125 			IriSP.jQuery("#"+id).css('border','none');
   126 			IriSP.jQuery("#"+id).css('border-color','lightgray');
       
   127 			IriSP.jQuery("#"+id).animate({opacity:0.3}, 100);
   126 			IriSP.jQuery("#"+id).animate({opacity:0.3}, 100);
   128   }
   127   }
   129 };
   128 };
   130 
   129 
   131 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) {
   130 IriSP.SegmentsWidget.prototype.clickHandler = function(annotation) {
   139     return;
   138     return;
   140 
   139 
   141   var matches = this._serializer.searchOccurences(searchString);
   140   var matches = this._serializer.searchOccurences(searchString);
   142 
   141 
   143   for (var id in matches) {
   142   for (var id in matches) {
   144     var factor = matches[id] * 8;
   143     var factor = (0.3 + matches[id] * 0.2) % 1;
   145     this.selector.find("#"+id).dequeue();
   144     this.selector.find("#"+id).dequeue();
   146     this.selector.find("#"+id).animate({height: factor}, 200);    
   145     this.selector.find("#"+id).css('border','1px red');
   147     this.selector.find("#"+id).css('border-color','red');
   146     this.selector.find("#"+id).animate({opacity:factor}, 200);
   148     this.selector.find("#"+id).animate({opacity:0.6}, 200);
       
   149 
   147 
   150     IriSP.jQuery("#LdtSearchInput").css('background-color','#e1ffe1');
   148     IriSP.jQuery("#LdtSearchInput").css('background-color','#e1ffe1');
   151   }
   149   }
   152 
   150 
   153   // clean up the blocks that were in the previous search
   151   // clean up the blocks that were in the previous search
   154   // but who aren't in the current one.
   152   // but who aren't in the current one.
   155   for (var id in this.oldSearchMatches) {
   153   for (var id in this.oldSearchMatches) {
   156     if (!matches.hasOwnProperty(id)) {
   154     if (!matches.hasOwnProperty(id)) {
   157         IriSP.jQuery("#"+id).dequeue();
   155         IriSP.jQuery("#"+id).dequeue();
   158 				IriSP.jQuery("#"+id).animate({height:0}, 250);				
       
   159 				IriSP.jQuery("#"+id).animate({opacity:0.3}, 200);
   156 				IriSP.jQuery("#"+id).animate({opacity:0.3}, 200);
   160         this.selector.find("#"+id).css('border','solid 1px #aaaaaa');
       
   161     }
   157     }
   162   }
   158   }
   163   
   159   
   164   this.oldSearchMatches = matches;
   160   this.oldSearchMatches = matches;
   165 };
   161 };