<commit_before>// toggle staff mode on and off
$('#stafftoggle').on('click', function() {
  var staffmode = $(this).hasClass('btn-warning');
  document.cookie = 'staffmode=' + ( ! staffmode) + '; path=/';
  location.reload();
});

// initialize repo creation dialog
$('#create-repo').on('show.bs.modal', function(event) {
  var spec = $(this).data('modal').options;
  $('#create-repo').prop('action', '/start/'+spec.kind+'/'+spec.proj+'/'+spec.users);
  $('.create-repo-users-text').text(spec.users);
  $('#create-repo button').prop('disabled', false);
});<commit_msg>Attempt to prevent double-submits of modal forms<commit_after>// toggle staff mode on and off
$('#stafftoggle').on('click', function() {
  var staffmode = $(this).hasClass('btn-warning');
  document.cookie = 'staffmode=' + ( ! staffmode) + '; path=/';
  location.reload();
});

// avoid double-submits
$('form.modal[method="post"]').on('submit', function(event) {
  $('button', event.target).prop('disabled', true);
});

// initialize repo creation dialog
$('#create-repo').on('show.bs.modal', function(event) {
  var spec = $(this).data('modal').options;
  $('#create-repo').prop('action', '/start/'+spec.kind+'/'+spec.proj+'/'+spec.users);
  $('.create-repo-users-text').text(spec.users);
  $('#create-repo button').prop('disabled', false);
});
{'fraction_non_alphanumeric': 0.2526636225266362, 'fraction_numerical': 0.0, 'mean_word_length': 5.202830188679245, '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': '6667780', 'n_tokens_mistral': 420, 'n_tokens_neox': 420, 'n_words': 77}