<commit_before>if (history && history.pushState) { history_api = true }
else { history_api = false }

// application events
$(function() {
  //applications
  $("#applications th a").live("click", function() {
    $.getScript(this.href);
    if (history_api) {
      history.pushState(null, document.title, this.href);
    }
    return false;
  });
  $("#applications_search").bindWithDelay("keyup", function() {
    $.get(this.action, $(this).serialize(), null, "script");
    if (history_api) {
      history.replaceState(null, document.title, this.action + "?" + this.serialize());
    }
    return false;
  }, 300);
  //machines
  $("#machines th a").live("click", function() {
    $.getScript(this.href);
    if (history_api) {
      history.pushState(null, document.title, this.href);
    }
    return false;
  });
  $("#machines_search").bindWithDelay("keyup", function() {
    $.get(this.action, $(this).serialize(), null, "script");
    if (history_api) {
      history.replaceState(null, document.title, this.action + "?" + this.serialize());
    }
    return false;
  }, 300);
  //back button
  $(window).bind("popstate", function() {<commit_msg>Fixed 500 error when hitting back button after search field triggered a replaceState()<commit_after>if (history && history.pushState) { history_api = true }
else { history_api = false }

// application events
$(function() {
  //applications
  $("#applications th a").live("click", function() {
    $.getScript(this.href);
    if (history_api) {
      history.pushState(null, document.title, this.href);
    }
    return false;
  });
  $("#applications_search input").bindWithDelay("keyup", function() {
    $.get($("#applications_search").attr("action"), $("#applications_search").serialize(), null, "script");
    if (history_api) {
      history.replaceState(null, document.title, $("#applications_search").attr("action") + "?" + $("#applications_search").serialize());
    }
    return false;
  }, 300);
  //machines
  $("#machines th a").live("click", function() {
    $.getScript(this.href);
    if (history_api) {
      history.pushState(null, document.title, this.href);
    }
    return false;
  });
  $("#machines_search").bindWithDelay("keyup", function() {
    $.get($("#machines_search").attr("action"), $("#machines_search").serialize(), null, "script");
    if (history_api) {
      history.replaceState(null, document.title, $("#machines_search").attr("action") + "?" + $("#machines_search").serialize());
    }
    return false;
  }, 300);
  //back button
  $(window).bind("popstate", function() {
{'fraction_non_alphanumeric': 0.19618528610354224, 'fraction_numerical': 0.0058388478007006615, 'mean_word_length': 3.9423076923076925, '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': '5088053', 'n_tokens_mistral': 803, 'n_tokens_neox': 785, 'n_words': 155}