<commit_before>App.PreventDoubleSubmission =
  disable_button: (button) ->
    unless button.hasClass('disabled')
      loading = button.data('loading') ? 'Sending ...'
      button.addClass('disabled').attr('disabled', 'disabled')
      button.data('text', button.val())
      button.val(loading)

  reset_button: (button) ->
    if button.hasClass('disabled')
      button_text = button.data('text')
      button.removeClass('disabled').attr('disabled', null)
      if button_text
        button.val(button_text)
        button.data('text', null)

  initialize: ->
    $('form').on('submit', event, ->
      button = $(this).find('.button')
      App.PreventDoubleSubmission.disable_button(button)
    ).on('ajax:success', ->
      button = $(this).find('.button')
      App.PreventDoubleSubmission.reset_button(button)
    )

    false<commit_msg>changes default loading text to "..."<commit_after>App.PreventDoubleSubmission =
  disable_button: (button) ->
    unless button.hasClass('disabled')
      loading = button.data('loading') ? '...'
      button.addClass('disabled').attr('disabled', 'disabled')
      button.data('text', button.val())
      button.val(loading)

  reset_button: (button) ->
    if button.hasClass('disabled')
      button_text = button.data('text')
      button.removeClass('disabled').attr('disabled', null)
      if button_text
        button.val(button_text)
        button.data('text', null)

  initialize: ->
    $('form').on('submit', event, ->
      button = $(this).find('.button')
      App.PreventDoubleSubmission.disable_button(button)
    ).on('ajax:success', ->
      button = $(this).find('.button')
      App.PreventDoubleSubmission.reset_button(button)
    )

    false
{'fraction_non_alphanumeric': 0.1684149184149184, 'fraction_numerical': 0.0, 'mean_word_length': 3.2925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '7147965', 'n_tokens_mistral': 504, 'n_tokens_neox': 499, 'n_words': 77}