<commit_before>var recipeSearchEvent = function(apiRequest){
  $('.container').on('submit', '#search-form', function(event) {
    event.preventDefault();
    var data = $('#search').val();
    $('#search').val('');
    renderSplash('#logged-in', '#logged-out', '.container');
    $('body').css("background-color", "#FFF");
    apiRequest(data);
  });
};<commit_msg>extract sign up form submit from app.js<commit_after>var recipeSearchEvent = function(apiRequest){
  $('.container').on('submit', '#search-form', function(event) {
    event.preventDefault();
    var data = $('#search').val();
    $('#search').val('');
    renderSplash('#logged-in', '#logged-out', '.container');
    $('body').css("background-color", "#FFF");
    apiRequest(data);
  });
};

var signUpEvent = function(serverUrl) {
  $('.container').on('submit', '.signup-form', function(event) {
    event.preventDefault();

    $target = $(event.target)
    $.ajax({
      url: serverUrl + "/signup",
      type: "POST",
      data: $target.serialize()
    }).then(function(response) {
      window.localStorage.setItem("sessionId", response.id);
      var indexTemplate = Mustache.render($('#logged-in').html());
      $('.container').html(indexTemplate);
      $('body').css("background-color", "#FFF");
    });
  });
};
{'fraction_non_alphanumeric': 0.23565891472868217, 'fraction_numerical': 0.0, 'mean_word_length': 4.123015873015873, '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': '4491192', 'n_tokens_mistral': 395, 'n_tokens_neox': 393, 'n_words': 66}