<commit_before>TT.Search = (function () {

  var pub = {};

  pub.addSearchTag = function (term) {
    TT.addFilter({
      name: term,
      fn: function (story) {
        return JSON.stringify(story).toLowerCase().indexOf(term) !== -1;
      }
    });
    TT.View.drawStories();
  };

  pub.init = function () {
    var timeout;
    var search = $('#search input');
    search.blur(function () {
      search.val('');
    }).keyup(function () {
      clearTimeout(timeout);
      timeout = setTimeout(function () {
        var term = $.trim(search.val().toLowerCase());
        if (term) {
          pub.addSearchTag(term);
        }
      }, 500);
    });
  };

  return pub;

}());<commit_msg>AC: Update search to fire on enter key<commit_after>TT.Search = (function () {

  var pub = {};

  function enterKeyPressed(e) {
    return e.which === 13;
  }

  pub.addSearchTag = function (term) {
    TT.addFilter({
      name: term,
      fn: function (story) {
        return JSON.stringify(story).toLowerCase().indexOf(term) !== -1;
      }
    });
    TT.View.drawStories();
  };

  pub.init = function () {
    var timeout;
    var search = $('#search input');
    search.blur(function () {
      search.val('');
    }).keyup(function (e) {
      if (enterKeyPressed(e)) {
        var term = $.trim(search.val().toLowerCase());
        if (term) {
          pub.addSearchTag(term);
        }
        search.val('');
      }
    });
  };

  return pub;

}());
{'fraction_non_alphanumeric': 0.18045112781954886, 'fraction_numerical': 0.004784688995215311, 'mean_word_length': 2.1551724137931036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5540046', 'n_tokens_mistral': 481, 'n_tokens_neox': 469, 'n_words': 92}