 
   cleanupPaste = () ->
     # erase any styling
-    setDomContent getDomContent()
+    setContent getDomContent()
 
   scheduleCleanupPaste = (evt) ->
     setTimeout cleanupPaste, 100

        break  if filename is promptFilename
    url = "tastes/#{filename}"

    currentContent = getDomContent().trim().replace(/\s+\n/g, '\n')
    currentContent += '\n'  if currentContent.length
    setDomContent currentContent  if currentContent isnt getDomContent()
    return true  unless currentContent.length

    done = (body, status, xhr) ->
      window.location.hash = filename

    fail = () ->
      window.alert "Failed to save"
      edit currentContent

    lock()
    $.ajax({
      method: 'PUT'
      url
      contentType: 'application/octet-stream'
      data: currentContent
    }).done(done).fail(fail)
    false

  edit = (content) ->
    content ?= getDomContent()
    $content.html content
    $content.attr('contentEditable', 'true').focus()
    $content.on 'blur', keepFocus

$ () ->
  contentSrc = ''
  $window = $ window
  $body = $ window.document.body
  $theme = $ '#theme'
