<commit_before>$(document).ready(function() {

  $('button').on('click', function(event) {
    event.preventDefault();
    var buttonData = $(event.target);
    buttonData.next().toggle();
  });

  $('#new_answer').on('submit', function(e){
    e.preventDefault();
    var target = $(e.target);
    console.log(target);
    var data = target.serialize();
    var body = target.find('#answer_body').val();
    var questionId = target.find('#answer_question_id').val();
    console.log(data);
    $.ajax({
      url: '/answers',
      method: 'post',
      data: {answer: {body: body, question_id: questionId}},
      dataType: "json"
    }).done(function(data) {
      var body = data.answer.body
      var username = data.username
      var partial = ""
      partial += "<p>" + body + "<p>";
      partial += "<p>" + username + "<p>";
      $('.answer_form').after(partial).toggle();
      $('#answer_body').val('');
    }).fail(function(err) {
      console.log(err);
    })
  });

  $('#new_comment').on('submit', function(e){
    e.preventDefault();
    var target = $(e.target);
    var data = target.serialize();
    var body = target.find('#comment_body').val();
    var userId = target.find('#comment_commentable_id').val();
    var commentable_type = target.find('#comment_commentable_type').val();
    var commentable_id = target.find('#comment_commentable_id').val();
    $.ajax({
      url: '/comments',
      method: 'post',
      data: {comment: {body: body, user_id: userId, commentable_type: commentable_type, commentable_id: commentable_id}},
      dataType: "json"
    }).done(function(data) {
      var body = data.comment.body
      var username = data.username
      var partial = ""
      partial += "<p>" + body + "<p>";
      partial += "<p>" + username + "<p>";
      $('#question-comment-button').before(partial);
      $('.question-comment-form').toggle();
      $('#comment_body').val('');
    }).fail(function(err) {
      console.log(err);
    })
  });

  $('.answer-comment-form').on('submit', function(e){
    e.preventDefault();
    var target = $(e.target);
    var data = target.serialize();
    var body = target.find('#comment_body').val();
    var userId = target.find('#comment_commentable_id').val();
    var commentable_type = target.find('#comment_commentable_type').val();
    var commentable_id = target.find('#comment_commentable_id').val();
    $.ajax({
      url: '/comments',
      method: 'post',
      data: {comment: {body: body, user_id: userId, commentable_type: commentable_type, commentable_id: commentable_id}},
      dataType: "json"
    }).done(function(data) {
      var body = data.comment.body
      var username = data.username
      var partial = ""
      partial += "<p>" + body + "<p>";
      partial += "<p>" + username + "<p>";
      $('#answer-comment-' + data.comment.commentable_id.toString()).after(partial).toggle();
      // TOM SAVE US SOMETHING WRONG WITH CLEARING THE FIELD
      $('#comment_body').val('');
    }).fail(function(err) {
      console.log(err);
    })
  });

});<commit_msg>added jquery to enarge question link<commit_after>$(document).ready(function() {

  $('button').on('click', function(event) {
    event.preventDefault();
    var buttonData = $(event.target);
    buttonData.next().toggle();
  });

  $('#new_answer').on('submit', function(e){
    e.preventDefault();
    var target = $(e.target);
    console.log(target);
    var data = target.serialize();
    var body = target.find('#answer_body').val();
    var questionId = target.find('#answer_question_id').val();
    console.log(data);
    $.ajax({
      url: '/answers',
      method: 'post',
      data: {answer: {body: body, question_id: questionId}},
      dataType: "json"
    }).done(function(data) {
      var body = data.answer.body
      var username = data.username
      var partial = ""
      partial += "<p>" + body + "<p>";
      partial += "<p>" + username + "<p>";
      $('.answer_form').after(partial).toggle();
      $('#answer_body').val('');
    }).fail(function(err) {
      console.log(err);
    })
  });

  $('#new_comment').on('submit', function(e){
    e.preventDefault();
    var target = $(e.target);
    var data = target.serialize();
    var body = target.find('#comment_body').val();
    var userId = target.find('#comment_commentable_id').val();
    var commentable_type = target.find('#comment_commentable_type').val();
    var commentable_id = target.find('#comment_commentable_id').val();
    $.ajax({
      url: '/comments',
      method: 'post',
      data: {comment: {body: body, user_id: userId, commentable_type: commentable_type, commentable_id: commentable_id}},
      dataType: "json"
    }).done(function(data) {
      var body = data.comment.body
      var username = data.username
      var partial = ""
      partial += "<p>" + body + "<p>";
      partial += "<p>" + username + "<p>";
      $('#question-comment-button').before(partial);
      $('.question-comment-form').toggle();
      $('#comment_body').val('');
    }).fail(function(err) {
      console.log(err);
    })
  });

  $('.answer-comment-form').on('submit', function(e){
    e.preventDefault();
    var target = $(e.target);
    var data = target.serialize();
    var body = target.find('#comment_body').val();
    var userId = target.find('#comment_commentable_id').val();
    var commentable_type = target.find('#comment_commentable_type').val();
    var commentable_id = target.find('#comment_commentable_id').val();
    $.ajax({
      url: '/comments',
      method: 'post',
      data: {comment: {body: body, user_id: userId, commentable_type: commentable_type, commentable_id: commentable_id}},
      dataType: "json"
    }).done(function(data) {
      var body = data.comment.body
      var username = data.username
      var partial = ""
      partial += "<p>" + body + "<p>";
      partial += "<p>" + username + "<p>";
      $('#answer-comment-' + data.comment.commentable_id.toString()).after(partial).toggle();
      // TOM SAVE US SOMETHING WRONG WITH CLEARING THE FIELD
      $('#comment_body').val('');
    }).fail(function(err) {
      console.log(err);
    })
  });

  $('.enlarge').mouseover(function() {
    $(this).animate({ fontSize : '26px' });
  }),

  $('.enlarge').mouseleave(function() {
    $(this).animate({ fontSize : '20px' });
  });
});
{'fraction_non_alphanumeric': 0.19990525817148272, 'fraction_numerical': 0.0006316121901152693, 'mean_word_length': 3.186384666226041, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '943459', 'n_tokens_mistral': 1947, 'n_tokens_neox': 1956, 'n_words': 389}