<commit_before>$(document).ready ->
  photoForm = $("form#photograph-uploader")
  if photoForm.length > 0
    photoForm.S3Uploader
      before_add: (file) ->
        file.type == "image/jpeg"

    photoForm.find("input[type = 'file']").hide()

    photoForm.bind "ajax:success", (e, data) ->
      $(".photo-grid").prepend(data)
      $(".photo-grid").trigger("reload:grid")

    photoForm.bind "ajax:failure", (e, data) -><commit_msg>Improved resizing on upload<commit_after>$(document).ready ->
  photoForm = $("form#photograph-uploader")
  if photoForm.length > 0
    photoForm.S3Uploader
      before_add: (file) ->
        file.type == "image/jpeg"

    photoForm.find("input[type = 'file']").hide()

    photoForm.bind "ajax:success", (e, data) ->
      $(".photo-grid").prepend(data).find("img").load ->
        $(".photo-grid").trigger("reload:grid")

    photoForm.bind "ajax:failure", (e, data) ->
{'fraction_non_alphanumeric': 0.20044052863436124, 'fraction_numerical': 0.004405286343612335, 'mean_word_length': 3.3701923076923075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '5895346', 'n_tokens_mistral': 315, 'n_tokens_neox': 301, 'n_words': 49}