<commit_before>$(function() {
  $("td").dblclick(function() {
    var td = $(this), originalContent = td.text();

    td.addClass("cellEditing");
    td.data("originalContent", originalContent);
    var el = document.createElement("input"), $el = $(el);
    $el.attr({type: "text", value: originalContent});
    td.empty();
    td.append(el);
    $el.focus();

    $el.keypress(function(e) {
      if (e.which == 13) {
        var text = $(this), newContent = text.val(), td = text.parent();
        td.text(newContent);
        td.removeData("originalContent");
        td.removeClass("cellEditing");
      }
    });

    $el.blur(function() {
      var td = $(this).parent();
      td.text(td.data("originalContent"));
      td.removeData("originalContent");
      td.removeClass("cellEditing");
    });
  });
});<commit_msg>Reset to the original content when ESCAPE key is down.<commit_after>$(function() {
  $("td").dblclick(function() {
    var td = $(this), originalContent = td.text();

    td.addClass("cellEditing");
    td.data("originalContent", originalContent);
    var el = document.createElement("input"), $el = $(el);
    $el.attr({type: "text", value: originalContent});
    td.empty();
    td.append(el);
    $el.focus();

    $el.keypress(function(e) {
      if (e.which == 13) {
        var text = $(this), newContent = text.val(), td = text.parent();
        td.text(newContent);
        td.removeData("originalContent");
        td.removeClass("cellEditing");
      }
    });

    var resetContent = function(e) {
      var td = $(e.target).parent();
      td.text(td.data("originalContent"));
      td.removeData("originalContent");
      td.removeClass("cellEditing");
    };

    $el.keydown(function(e) {
      if (e.which == 27) {
        resetContent(e);
      }
    });

    $el.blur(resetContent);
  });
});
{'fraction_non_alphanumeric': 0.19760479041916168, 'fraction_numerical': 0.00326619488296135, 'mean_word_length': 2.8776371308016877, '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': '1107259', 'n_tokens_mistral': 595, 'n_tokens_neox': 580, 'n_words': 103}