 ###
-Copyright (c) 2012 Markus Kohlhase <mail@markus-kohlhase.de>
+Copyright (c) 2012 - 2013 Markus Kohlhase <mail@markus-kohlhase.de>
 ###
 
 throw new Error "This plugin only can be used in the browser" unless window?

    port: connection_options.port

key2cache   = (k) -> "#{CACHE_PREFIX}#{k}"
cache2key   = (c) -> c.split(CACHE_PREFIX)[1]

saveData = ->
  if localStorage?

restoreData = ->
  if localStorage?
    for k in [ "jid", "sid", "rid", "host", "port", "path" ]
      j = key2cache k
      connection_options[k] = localStorage[j]  if localStorage[j]

hasConnectionData = ->
