Edgewall Software

Ticket #7324: search-limit.diff

File search-limit.diff, 630 bytes (added by athomas, 4 years ago)

Limit number of highlighted words on search

  • trac/htdocs/js/search.js

     
    3939          var terms = []; 
    4040          $.each(query.split(/(".*?")|('.*?')|(\s+)/), function() { 
    4141            term = this.replace(/^\s+$/, ""); 
    42             if (term.length) { 
     42            if (terms.length < 25 && term.length) { 
    4343              terms.push(term.replace(/^['"]/, "").replace(/['"]$/, "")); 
    4444            } 
    4545          }); 
     
    5656    }); 
    5757  }); 
    5858 
    59 })(jQuery); 
    60  No newline at end of file 
     59})(jQuery);