<commit_before>$(function() {
  $("#subscribe").click(subscribe);
  setInterval(rotateThought, 6000);
  setInterval(updateCount, 10000);
  updateCount();
});

var thoughtIndex = 0;

function rotateThought() {
  $("#thought").removeClass('bounceInRight').addClass('bounceOutLeft');
  setTimeout(moveInThought, 1000);
}

function updateCount() {
  $.get("/count", function(data) {
    $("#count").text(data)
  });
}

function moveInThought() {
  $("#thought").text(thoughts[thoughtIndex]).removeClass('bounceOutLeft').addClass('bounceInRight');
  thoughtIndex++;
  if(thoughtIndex > thoughts.length) {
    thoughtIndex = 0;
  }
}

function subscribe() {
  $("#heading").removeClass('rubberBand').addClass('bounceOutLeft');
  $.post("/subscribe", {'sms_number': $('#sms_number').val()}, function(data) {<commit_msg>Support for enter key<commit_after>$(function() {
  $("#subscribe").click(subscribe);
  setInterval(rotateThought, 6000);
  setInterval(updateCount, 10000);
  updateCount();
  $("#sms_number").keyup(smsNumberKeyup);
});

var thoughtIndex = 0;
function smsNumberKeyup(event){
    if(event.keyCode == 13){
        $("#subscribe").focus();
        subscribe();
    }
}
function rotateThought() {
  $("#thought").removeClass('bounceInRight').addClass('bounceOutLeft');
  setTimeout(moveInThought, 1000);
}

function updateCount() {
  $.get("/count", function(data) {
    $("#count").text(data)
  });
}

function moveInThought() {
  $("#thought").text(thoughts[thoughtIndex]).removeClass('bounceOutLeft').addClass('bounceInRight');
  thoughtIndex++;
  if(thoughtIndex > thoughts.length) {
    thoughtIndex = 0;
  }
}

function subscribe() {
  $("#heading").removeClass('rubberBand').addClass('bounceOutLeft');
  $.post("/subscribe", {'sms_number': $('#sms_number').val()}, function(data) {
{'fraction_non_alphanumeric': 0.20489977728285078, 'fraction_numerical': 0.017817371937639197, 'mean_word_length': 6.01953125, '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': '3288900', 'n_tokens_mistral': 596, 'n_tokens_neox': 570, 'n_words': 80}