<commit_before>module.exports =
class QuickFileActionsView
  constructor: (disposeAction) ->
    @disposeAction = disposeAction

  destroy: ->
    @element?.remove()

  focus: ->
    @input.focus()
    @input.getModel().scrollToScreenPosition([0, 10000])

  getElement: (text, path, callback) ->
    @element = document.createElement('form')

    atom.commands.add(@element,
      'core:confirm': (event) =>
        oldPath = path
        newPath = event.target.getModel().getText()
        callback(oldPath, newPath)
      'core:cancel': (event) =>
        @disposeAction()
    )

    label = document.createElement('label')
    label.textContent = text

    @input = document.createElement('atom-text-editor')
    @input.setAttribute('mini', true)
    @input.getModel().setText(path)

    @element.appendChild(label)
    @element.appendChild(@input)

    @element<commit_msg>Disposes of modal on blur.<commit_after>module.exports =
class QuickFileActionsView
  constructor: (disposeAction) ->
    @disposeAction = disposeAction

  destroy: ->
    @element?.remove()

  focus: ->
    @input.focus()
    @input.getModel().scrollToScreenPosition([0, 10000])

  getElement: (text, path, callback) ->
    @element = document.createElement('form')

    atom.commands.add(@element,
      'core:confirm': (event) =>
        oldPath = path
        newPath = event.target.getModel().getText()
        callback(oldPath, newPath)
      'core:cancel': (event) =>
        @disposeAction()
    )

    label = document.createElement('label')
    label.textContent = text

    @input = document.createElement('atom-text-editor')
    @input.setAttribute('mini', true)
    @input.getModel().setText(path)
    @input.onblur = @disposeAction

    @element.appendChild(label)
    @element.appendChild(@input)

    @element
{'fraction_non_alphanumeric': 0.14594894561598223, 'fraction_numerical': 0.006659267480577136, 'mean_word_length': 3.313397129186603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4992094', 'n_tokens_mistral': 553, 'n_tokens_neox': 521, 'n_words': 91}