<commit_before>(function($) {
  // Pagination.
  $('#search-content .pagination a').live('click', function () {
    $.ajax({
      url: this.href,
      beforeSend: function(){$('#search-content').addClass('fetching')},
      complete: function() {$('#search-content').removeClass('fetching')},
      dataType: 'script'
    })
    return false;
  });

  // Sorting
  $('#search-filters select').change(function(){
    $('form.search_form').submit();
  });

  // Custom styled select
  $('#search-filters select').selectOrDie();

  // Form Ajax submission
  $('form.search_form').submit(function () {
    $.ajax({
      url: this.action,
      data: $(this).serialize(),
      beforeSend: function(){$('#search-content').addClass('fetching')},
      complete: function() {$('#search-content').removeClass('fetching')},
      dataType: 'script'
    })
    return false;
  });

  // Assets links
  $('#assets-links a').click(function(e){
    e.preventDefault();
    window.location.href = $(this).attr("href") + '?query=' + $('#search-input').val();
  });

  // Real time search
  // $("input#search-input").typeWatch({
  //   callback: function (value) {$('form.search_form').submit()},
  //   wait: 750,
  //   highlight: true,
  //   captureLength: 2
  // });
})(jQuery);<commit_msg>[search-improvements] Update search results if search query gets empty<commit_after>(function($) {
  // Pagination.
  $('#search-content .pagination a').live('click', function () {
    $.ajax({
      url: this.href,
      beforeSend: function(){$('#search-content').addClass('fetching')},
      complete: function() {$('#search-content').removeClass('fetching')},
      dataType: 'script'
    })
    return false;
  });

  // Sorting
  $('#search-filters select').change(function(){
    $('form.search_form').submit();
  });

  // Custom styled select
  $('#search-filters select').selectOrDie();

  // Form Ajax submission
  $('form.search_form').submit(function () {
    $.ajax({
      url: this.action,
      data: $(this).serialize(),
      beforeSend: function(){$('#search-content').addClass('fetching')},
      complete: function() {$('#search-content').removeClass('fetching')},
      dataType: 'script'
    })
    return false;
  });

  // Assets links
  $('#assets-links a').click(function(e){
    e.preventDefault();
    window.location.href = $(this).attr("href") + '?query=' + $('#search-input').val();
  });

  // Real time search
  // $("input#search-input").typeWatch({
  //   callback: function (value) {$('form.search_form').submit()},
  //   wait: 750,
  //   highlight: true,
  //   captureLength: 2
  // });

  $("input#search-input").bind('notext', function(){ $('form.search_form').submit() });
})(jQuery);
{'fraction_non_alphanumeric': 0.22713864306784662, 'fraction_numerical': 0.0029498525073746312, 'mean_word_length': 3.3547351524879616, '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': '3685069', 'n_tokens_mistral': 833, 'n_tokens_neox': 821, 'n_words': 148}