 class _webSocketSingleton extends App.Controller
   @include App.LogInclude
 
-  queue: []
+  queue:                    []
   supported:                true
   lastSpoolMessage:         undefined
   sentSpoolFinished:        true

  connectionWasEstablished: false
  tryToConnect:             false
  backend:                  'websocket'
  client_id:                undefined
  error:                    false


    if @backend is 'websocket'
      @ws = new window.WebSocket( protocol + window.location.hostname + '/ws' )
    else if @backend is 'websocketPort'
      @backend_port = App.Config.get('websocket_port') || '6042'
      @ws           = new window.WebSocket( protocol + window.location.hostname + ':' + @backend_port + '/' )
    else
      @_ajaxInit()

    # Set event handlers.
    @ws.onopen = =>
      if @backend_port
        port = ":#{@backend_port}"
      @log 'notice', "new websocket (#{@channel()}#{port}) connection open"

      @connectionEstablished    = true
      @connectionWasEstablished = true
