                     historyList.appendChild(createHistoryItem({ item: result[item], hash: item }))
         )
 , false)
+
+forceFocus = ->
+    if document.activeElement.tagName in ['TEXTAREA', 'INPUT']
+        setTimeout(forceFocus, 250)
+        return
+    pasteTarget = document.getElementById('paste-target')
+    pasteTarget.focus()
+    setTimeout(forceFocus, 250)
 
 createHistoryItem = (h) ->
     item = h.item

    file.isHashed = true
    uploadFile(file)

uploadFile = (file) ->
    oldHash = file.hash
    upload = ->

    compile = (name) -> Handlebars.compile(document.getElementById(name + '-template').innerHTML)
    templates.preview = compile 'preview'

    pasteTarget = document.getElementById('paste-target')
    pasteTarget.addEventListener('paste', handlePaste, false)
    forceFocus()

    loadHistory()
    items = getHistory()[..4].reverse()
    historyContainer = document.getElementById('history')
