<commit_before>var BASE_URL = "";

$(function() {
  function formatErrorMessage(resp) {
    return resp.error.message + "\n\n" + _(resp.error.exception.errors).map(function(message, code) { return message; }).join("\n");
  }

  function processErrorResponse(r) {
    try {
      var jsonResponse = $.parseJSON(r.responseText);
      alert(formatErrorMessage(jsonResponse));
    } catch (x) {
      console.log(x);
      alert(__("Unhandled server error") + x);
    }
  }

  $.ajaxSetup({
    headers: {
      accept: "application/json"
    }
  });

  $(".line .btn-add")
    .on("click",
        function() {
          var line = $(this).closest(".line");

		      $("#reading-modal #reading-modal-label").html("Add a new reading - Line " + line.data("line-name"));
		      $("#reading-modal input[name='employees']").val(line.data("line-employee"));
		      $("#reading-modal input[name='reading']").val(line.data("line-reading"));
		      $("#reading-modal select[name='product_id']").val(line.data("product-id"));
		  	  $("#reading-modal select[name='notes']").filter(function() {
		  	  													return $(this).text() == line.data("line-notes");
		  	  												}).prop('selected', true);
		  	  
          $("#reading-modal")
            .data("line-id", 
                  line.data("line-id"));
          ;
        });

  $("#reading-modal")
    .on("click",
        ".btn-save:not(.disabled)",
        function() {
          var modal = $(this).closest(".modal");
          var line_id = modal.data("line-id");
          var buttons = modal.find(".modal-footer .btn");<commit_msg>Fixed: notes are auto-selected in the 'new reading' modal.<commit_after>var BASE_URL = "";

$(function() {
  function formatErrorMessage(resp) {
    return resp.error.message + "\n\n" + _(resp.error.exception.errors).map(function(message, code) { return message; }).join("\n");
  }

  function processErrorResponse(r) {
    try {
      var jsonResponse = $.parseJSON(r.responseText);
      alert(formatErrorMessage(jsonResponse));
    } catch (x) {
      console.log(x);
      alert(__("Unhandled server error") + x);
    }
  }

  $.ajaxSetup({
    headers: {
      accept: "application/json"
    }
  });

  $(".line .btn-add")
    .on("click",
        function() {
          var line = $(this).closest(".line");

		      $("#reading-modal #reading-modal-label").html("Add a new reading - Line " + line.data("line-name"));
		      $("#reading-modal input[name='employees']").val(line.data("line-employee"));
		      $("#reading-modal input[name='reading']").val(line.data("line-reading"));
		      $("#reading-modal select[name='product_id']").val(line.data("product-id"));
		  	  $("#reading-modal select[name='notes']").val(line.data("line-notes"));
		  	  
          $("#reading-modal")
            .data("line-id", 
                  line.data("line-id"));
          ;
        });

  $("#reading-modal")
    .on("click",
        ".btn-save:not(.disabled)",
        function() {
          var modal = $(this).closest(".modal");
          var line_id = modal.data("line-id");
          var buttons = modal.find(".modal-footer .btn");
{'fraction_non_alphanumeric': 0.20568508463749602, 'fraction_numerical': 0.0, 'mean_word_length': 2.5230596175478066, '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': '1648140', 'n_tokens_mistral': 1030, 'n_tokens_neox': 956, 'n_words': 152}