<commit_before>(function($) {
  $(document).ready(function() {

    $('#template-entry-hidden').load("entry.template.html");

    $('#btn-load-project').click(function(){
      var project = $('#project-name').val();
      $.getJSON(project, renderData);
    });
  });

  function renderData(data) {
    // For each entry
    $.each(data, function(index, entry) {
      // Clone the template
      var entryDiv = $('#template-entry-hidden').clone().children();
      // Set background colour based on exit status
      entryDiv.addClass(exitClass(entry.entry.exitStatus));
      entryDiv.find(".tabula-command").html(entry.entry.command);
      // Append to the main div
      entryDiv.appendTo('div#project-data');
    });

  }

  function exitClass(exitStatus) {
    if (exitStatus === 0) {
      // Successful
      return "exitSuccess";
    } else if (exitStatus > 127) {
      // Killed by user
      return "exitKilled";
    } else {
      // Failed for some reason.
      return "exitFailure";
    }
  }

})(jQuery);<commit_msg>Cherry-pick on-enter-commit changes.<commit_after>(function ($) {
  $(document).ready(function () {
    $('#template-entry-hidden').load("entry.template.html");

    $('#btn-load-project').click(function () {
     var project = $('#project-name').val();
     $.getJSON(project, renderData);
    });

    $('#project-name').keypress(function (e) {
     if (e.which == 13) {
      var project = $('#project-name').val();
      $.getJSON(project, renderData);
     }
    });
   });

   function renderData(data) {
    $("h2").append("Project log contents");
    // For each entry
    $.each(data, function (index, entry) {
     // Clone the template
     var entryDiv = $('#template-entry-hidden').clone().children();
     // Set background colour based on exit status
     entryDiv.addClass(exitClass(entry.entry.exitStatus));
     entryDiv.find(".tabula-command").html(entry.entry.command);
     // Append to the main div
     entryDiv.appendTo('div#project-data');
    });

   }

   function exitClass(exitStatus) {
    if (exitStatus === 0) {
     // Successful
     return "exitSuccess";
    } else if (exitStatus > 127) {
     // Killed by user
     return "exitKilled";
    } else {
     // Failed for some reason.
     return "exitFailure";
    }
   }

  })(jQuery);
{'fraction_non_alphanumeric': 0.17649609713790113, 'fraction_numerical': 0.004770164787510842, 'mean_word_length': 2.6971153846153846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2532183', 'n_tokens_mistral': 703, 'n_tokens_neox': 682, 'n_words': 141}