<commit_before>$(function(){
  $('#new_share_link').click(function(e){
    e.preventDefault();
    $('#new_share_modal').modal({
      remote: '/shares/new',
      show: true
    });
  });

  $('#new_share_modal').submit('#new-share-form', function(e){
    e.preventDefault();
    $('#new_share_modal').modal('toggle');
    var data = $(event.target).serialize();
    $.ajax({
        type: "POST",
        url: "/shares",
        data: data,
        beforeSend: customBlockUi(this)
      }).done(function(response) {
          swal({
                title: "Awesome!",
                text: "Thanks for your share!",
                confirmButtonColor: "#FFFFFF",
                showConfirmButton: false,
                allowOutsideClick: true,
                timer: 1500,
                type: "success"
            });
      }).fail(function(response) {
        swal({
              title: "Oops...",
              text: response.responseJSON.errors,
              confirmButtonColor: "#EF5350",<commit_msg>Model only closes on success and the page reloads with the new share"<commit_after>$(function(){
  $('#new_share_link').click(function(e){
    e.preventDefault();
    $('#new_share_modal').modal({
      remote: '/shares/new',
      show: true
    });
  });

  $('#new_share_modal').submit('#new-share-form', function(e){
    e.preventDefault();
    var data = $(event.target).serialize();
    $.ajax({
        type: "POST",
        url: "/shares",
        data: data,
        beforeSend: customBlockUi(this)
      }).done(function(response) {
         $('#new_share_modal').modal('toggle');
         location.reload();
          swal({
                title: "Awesome!",
                text: "Thanks for your share!",
                confirmButtonColor: "#FFFFFF",
                showConfirmButton: false,
                allowOutsideClick: true,
                timer: 1500,
                type: "success"
            });
      }).fail(function(response) {
        swal({
              title: "Oops...",
              text: response.responseJSON.errors,
              confirmButtonColor: "#EF5350",
{'fraction_non_alphanumeric': 0.15933806146572105, 'fraction_numerical': 0.007565011820330969, 'mean_word_length': 1.8867667121418827, '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': '5306164', 'n_tokens_mistral': 606, 'n_tokens_neox': 584, 'n_words': 114}