<commit_before>$(function() {
  //binding the enter key to the input
  var $input = $('#new-todo');
  $input.keyup(function(e){
    if(e.keyCode == 13)  {
      $(this).trigger("addTask");
      }
    });

/* ensure there is more than whitespace in the input field (line 17)
// If yes, then
// display the main section
// add the input field value to the list item
// clear the input value
*/
  $input.bind("addTask",function(){
    if ($input.val().trim().length > 0 ){
      $('#main').css({display: 'block'});
      $('#todo-list').append('<li><div class="view"><input class="toggle" type="checkbox"><label>' +
        $input.val() + '</label><button class="destroy"></button></div><input class="edit" value="' +
        $input.val() + '" ></li>');

      //Clears the input field
      $input.val('');

      // Display the footer
      $('#footer').show();

      // update footer new count
      $('#todo-count strong').text($('#todo-list li').length);

    }
  });

// Toggling all of the Tasks on/off
   var $complete = $('#todo-list li');
   var $toggleAll = $('#toggle-all');
   $toggleAll.click(function() {
     if ($('#todo-list li').hasClass('')) {
       $('#todo-list li').addClass('completed');
       $('.toggle').prop('checked', true);
     } else {
       $('.toggle').prop('checked', false);
       $('#todo-list li').removeClass('completed');
     }
   });

// Toggle individual Tasks on/off
  $('#todo-list').on('click', '.toggle', function(){
    $(this).closest('li').toggleClass('completed');
    // if all individual tasks are checked off, the toggle-all icon will toggle
    if($('.completed').length === $('#todo-list li').length) {
      $('#toggle-all').prop('checked', true);
    } else {
      $('#toggle-all').prop('checked', false);
    }
  });

});
<commit_msg>added comments to code for clarity<commit_after>$(function() {

//binding the enter key to the input
  var $input = $('#new-todo');
  $input.keyup(function(e){
    if(e.keyCode == 13)  {
      $(this).trigger("addTask");
      }
    });

/* ensure there is more than whitespace in the input field (line 17)
// If yes, then
// display the main section
// add the input field value to the list item
// clear the input value
*/
  $input.bind("addTask",function(){
    if ($input.val().trim().length > 0 ){
      $('#main').css({display: 'block'});
      $('#todo-list').append('<li><div class="view"><input class="toggle" type="checkbox"><label>' +
        $input.val() + '</label><button class="destroy"></button></div><input class="edit" value="' +
        $input.val() + '" ></li>');

      //Clears the input field
      $input.val('');

      // Display the footer
      $('#footer').show();

      // update footer new count
      $('#todo-count strong').text($('#todo-list li').length);

    }
  });

// Toggling all of the Tasks on/off
   var $complete = $('#todo-list li');
   var $toggleAll = $('#toggle-all');
   $toggleAll.click(function() {
     if ($('#todo-list li').hasClass('')) {
       $('#todo-list li').addClass('completed');
       $('.toggle').prop('checked', true);
     } else {
       $('.toggle').prop('checked', false);
       $('#todo-list li').removeClass('completed');
     }
   });

// Toggle individual Tasks on/off
  $('#todo-list').on('click', '.toggle', function(){
    $(this).closest('li').toggleClass('completed');

    // if all individual tasks are checked off, the toggle-all icon will toggle
    if($('.completed').length === $('#todo-list li').length) {
      $('#toggle-all').prop('checked', true);
    } else {
      $('#toggle-all').prop('checked', false);
    }
  });

});

{'fraction_non_alphanumeric': 0.2284923928077455, 'fraction_numerical': 0.0027662517289073307, 'mean_word_length': 2.9649122807017543, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '282623', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1113, 'n_words': 273}