<commit_before>$ ->
  $(".protected-branches-list :checkbox").change ->
    name = $(this).attr("name")
    if name == "developers_can_push"
      id = $(this).val()
      checked = $(this).is(":checked")
      url = $(this).data("url")
      $.ajax
        type: "PUT"
        url: url
        dataType: "json"
        data:
          id: id
          developers_can_push: checked

        success: ->
          new Flash("Branch updated.", "notice")
          location.reload true

        error: ->
          new Flash("Failed to update branch!", "alert")<commit_msg>Improve protected branches page UX<commit_after>$ ->
  $(".protected-branches-list :checkbox").change (e) ->
    name = $(this).attr("name")
    if name == "developers_can_push"
      id = $(this).val()
      checked = $(this).is(":checked")
      url = $(this).data("url")
      $.ajax
        type: "PUT"
        url: url
        dataType: "json"
        data:
          id: id
          developers_can_push: checked

        success: ->
          row = $(e.target)
          row.closest('tr').effect('highlight')

        error: ->
          new Flash("Failed to update branch!", "alert")
{'fraction_non_alphanumeric': 0.165374677002584, 'fraction_numerical': 0.0, 'mean_word_length': 1.912280701754386, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, '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': '2269046', 'n_tokens_mistral': 349, 'n_tokens_neox': 343, 'n_words': 81}