<commit_before>// app.js
//
// the main application file for PickSix

(function() {

  var items = [];

  // grab the static UI elements to work with
  var itemElements = document.querySelectorAll('#main .todo-item');
  var itemTitleElements = document.querySelectorAll('#main .todo-item .todo-item-text');
  var itemCheckboxElements = document.querySelectorAll('#main .todo-item .todo-item-checkbox');

  var initializeItems = function() {
    var items = JSON.parse(localStorage.getItem('items'));
    if( !items ) {
      items = [];
      for(var i = 0; i < 6; i++) {
        var item = {
          title: '',
          created_at: null,
          updated_at: null,
          complete: false,
          completed_at: null
        };
        items.push(item);
      }
    }
    return items;
  };

  var initializeView = function(items) {
    Array.prototype.forEach.call(itemElements, function(el, i) {
      var itemTitle = el.querySelector('.todo-item-text');
      var itemCheckbox = el.querySelector('.todo-item-checkbox');
      itemTitle.innerHTML = items[i].title;
      itemCheckbox.checked = items[i].completed;
    });
  };

  // update the title of the item with the index corresponding with the given
  // id. The `id` should be an integer between 0 and 5, inclusive. The
  // `updated_at` value should be updated to the current datetime.<commit_msg>Add a fix so that checkboxes are properly rendered on page load.<commit_after>// app.js
//
// the main application file for PickSix

(function() {

  var items = [];

  // grab the static UI elements to work with
  var itemElements = document.querySelectorAll('#main .todo-item');
  var itemTitleElements = document.querySelectorAll('#main .todo-item .todo-item-text');
  var itemCheckboxElements = document.querySelectorAll('#main .todo-item .todo-item-checkbox');

  var initializeItems = function() {
    var items = JSON.parse(localStorage.getItem('items'));
    if( !items ) {
      items = [];
      for(var i = 0; i < 6; i++) {
        var item = {
          title: '',
          created_at: null,
          updated_at: null,
          complete: false,
          completed_at: null
        };
        items.push(item);
      }
    }
    return items;
  };

  var initializeView = function(items) {
    Array.prototype.forEach.call(itemElements, function(el, i) {
      var itemTitle = el.querySelector('.todo-item-text');
      var itemCheckbox = el.querySelector('.todo-item-checkbox');
      itemTitle.innerHTML = items[i].title;
      itemCheckbox.checked = items[i].complete;
    });
  };

  // update the title of the item with the index corresponding with the given
  // id. The `id` should be an integer between 0 and 5, inclusive. The
  // `updated_at` value should be updated to the current datetime.
{'fraction_non_alphanumeric': 0.1261682242990654, 'fraction_numerical': 0.002875629043853343, 'mean_word_length': 2.686092715231788, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1236384', 'n_tokens_mistral': 811, 'n_tokens_neox': 801, 'n_words': 236}