 _     = require('lodash')
-_.str = require('underscore.string')
 
 lastKeyEvent = null    # Workaround for fact we can't dispatch keyboard event via javascript
 

    if node.classList?
      node.classList.add(cssClass)
    else if node.className?
      node.className = _.str.trim(node.className + ' ' + cssClass)

  addEventListener: (node, eventName, listener) ->
    node.addEventListener(eventName, (event) ->

    obj = _.reduce(styleString.split(';'), (styles, str) ->
      [name, value] = str.split(':')
      if name and value
        name = name.trim()
        value = value.trim()
        styles[name.toLowerCase()] = value
      return styles
    , {})
