 currentTarget = null
-keySequence = ""
+keySequence = ''
 keySequences = []
 
 specialKeys = [

  114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 144, 145, 191
]

bindRawKey = (hotkey, fn) -> $(document).bind "keydown", hotkey, fn

bindKey = (hotkey, fn) -> bindRawKey hotkey, (event) -> fn(event) if not event.metaKey

bindKeySequence = (expression, fn) -> keySequences.push([expression, fn])

clearNewPostsFromDiscussion = (target) ->
  $(".discussion" + exchangeId(target)).removeClass "new_posts"
  $(".discussion" + exchangeId(target) + " .new_posts").html ""

defaultTarget = ->
  if document.location.hash && document.location.hash.match(/^#post-([\d]+)$/)

  $(selector).focus()
  event.preventDefault()

isDiscussion = (target) -> $(target).closest('tr').hasClass('discussion')

keypressToCharacter = (event) ->
  return if event.which in specialKeys
