<commit_before>$(document).ready(function() {
  $('#new_review').on('submit', function(event){
    event.preventDefault();
    $target = $(event.target)
    $rating = $target.children('#rating').children('.rated').last().children('input').attr('value')
    $.ajax({
      url: $target.attr('action'),
      method: $target.attr('method'),
      data: $target.serialize()
    }).done(function(response){
      if ($(response).hasClass('venue-show-left')) {
        $('.rated').removeClass('rated')
        if ($('#no-reviews')) {
          $('#no-reviews').remove()
        }
        $('#reviews').prepend(response);
        $('.selected').removeClass('selected')
        $('.time-of-week').removeClass('time-of-week');
        $('#new-review-errors').html("");
        $('#new_review').each(function(){
          this.reset();
        });
      } else {
        $('#new-review-errors').html(response);
      }
    })
    $.ajax({
      url: $target.children('#rating').attr('action'),
      method: 'put',
      data: $rating
    }).done(function(response){
      $('#avg-rating').html(response);
      UpdateOctopusRating();
    })
  })
});<commit_msg>change js to have modal form for new reviews<commit_after>$(document).ready(function() {
  // $('#new_review').on('submit', function(event){
  //   event.preventDefault();
  //   $target = $(event.target)
  //   $rating = $target.children('#rating').children('.rated').last().children('input').attr('value')
  //   $.ajax({
  //     url: $target.attr('action'),
  //     method: $target.attr('method'),
  //     data: $target.serialize()
  //   }).done(function(response){
  //     if ($(response).hasClass('venue-show-left')) {
  //       $('.rated').removeClass('rated')
  //       if ($('#no-reviews')) {
  //         $('#no-reviews').remove()
  //       }
  //       $('#reviews').prepend(response);
  //       $('.selected').removeClass('selected')
  //       $('.time-of-week').removeClass('time-of-week');
  //       $('#new-review-errors').html("");
  //       $('#new_review').each(function(){
  //         this.reset();
  //       });
  //     } else {
  //       $('#new-review-errors').html(response);
  //     }
  //   })
  //   $.ajax({
  //     url: $target.children('#rating').attr('action'),
  //     method: 'put',
  //     data: $rating
  //   }).done(function(response){
  //     $('#avg-rating').html(response);
  //     UpdateOctopusRating();
  //   })
  // })
  $('#new-review-form').dialog({
    modal: true,
    autoOpen: false,
    minHeight: 500,
    width: 500,
    // appendTo: ,
    position: ({ my:"top", at: "middle", of: "#page-header-bottom"}),
    show: {
      effect: "bounce",
      duration: 1500
    },
    hide: {
      effect: "explode",
      duration: 2000
    }
  });

  $('#new-review-button').on('click', function(event){
    event.preventDefault()
    $('#new-review-form').dialog('open');
  })
});
{'fraction_non_alphanumeric': 0.24905139703345983, 'fraction_numerical': 0.004829251466022766, 'mean_word_length': 2.391812865497076, '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': '1778364', 'n_tokens_mistral': 908, 'n_tokens_neox': 912, 'n_words': 118}