<commit_before>Template.planTomorrow.helpers({
  todos: function() {
    return todos.find();
  }
});

Template.planTomorrow.events({
  'click #addtodo': function() {
    var todo = document.getElementById("todo").value;
    todos.insert({todo: todo});
    document.getElementById("todo").updateValueAndPreserveCaret("");
  },
  'click paper-checkbox': function() {
    todos.remove(this._id);
  }
});
<commit_msg>tomorrow page: add item on enter<commit_after>Template.planTomorrow.helpers({
  todos: function() {
    return todos.find();
  }
});

function addTodo() {
  var todo = document.getElementById("todo");
  todos.insert({todo: todo.value});
  todo.updateValueAndPreserveCaret("");
}

Template.planTomorrow.events({
  'click #addtodo': addTodo,
  'keyup #todo': function(evt) {
    if (evt.keyCode == 13) addTodo();
  },
  'click paper-checkbox': function() {
    todos.remove(this._id);
  }
});

{'fraction_non_alphanumeric': 0.17790055248618786, 'fraction_numerical': 0.0022099447513812156, 'mean_word_length': 4.425149700598802, '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': '746954', 'n_tokens_mistral': 303, 'n_tokens_neox': 319, 'n_words': 52}