<commit_before>ignoreEvent = (event) ->
  event.stopPropagation()
  event.preventDefault()

class @JackUp.DragAndDrop
  constructor: (@droppableElement, @processor) ->
    @droppableElement
      .bind("dragenter", @_drag)
      .bind("drop", @_drop)
      .bind("drop", @_dragOut)

  _drag: (event) =>
    ignoreEvent event
    event.originalEvent.dataTransfer.dropEffect = "copy"
    @droppableElement.addClass("hover")

  _dragOut: (event) =>
    ignoreEvent event
    @droppableElement.removeClass("hover")

  _drop: (event) =>
    ignoreEvent event
    @droppableElement.find('[data-placeholder]').hide()
    @processor.processFilesForEvent(event)<commit_msg>Remove hover class when leaving the drop zone.<commit_after>ignoreEvent = (event) ->
  event.stopPropagation()
  event.preventDefault()

class @JackUp.DragAndDrop
  constructor: (@droppableElement, @processor) ->
    @droppableElement
      .bind("dragenter", @_dragEnter)
      .bind("dragleave", @_dragLeave)
      .bind("drop", @_drop)

  _dragEnter: (event) =>
    ignoreEvent event
    event.originalEvent.dataTransfer.dropEffect = "copy"
    @droppableElement.addClass("hover")

  _dragLeave: (event) =>
    ignoreEvent event
    @droppableElement.removeClass("hover")

  _drop: (event) =>
    ignoreEvent event
    @droppableElement.removeClass("hover")
    @droppableElement.find('[data-placeholder]').hide()
    @processor.processFilesForEvent(event)
{'fraction_non_alphanumeric': 0.13843991567111735, 'fraction_numerical': 0.0, 'mean_word_length': 4.29368029739777, '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': '4886778', 'n_tokens_mistral': 446, 'n_tokens_neox': 445, 'n_words': 75}