Permalink
Browse files

Show error message if server is down.

  • Loading branch information...
epeli committed Feb 25, 2011
1 parent 2724d6f commit 4f17f7ba3b490d2b62a2c4c54d62de349468be1b
Showing with 18 additions and 7 deletions.
  1. +8 −3 bg.coffee
  2. +10 −4 bg.js
View
@@ -100,14 +100,19 @@ class Connection
@socket.connect()
send: (obj) ->
- @socket.send JSON.stringify obj
+ if not @isConnected()
+ alert "Sorry, not connected to TextareaServer"
+ else
+ @socket.send JSON.stringify obj
+ isConnected: ->
+ @socket?.connected
_reConnect: ->
- console.log "Trying to connect to #{ @socket.transport?.socket?.URL }"
+ # console.log "Trying to connect to #{ @socket.transport?.socket?.URL }"
- if not @socket?.connected
+ if not @isConnected()
@socket.connect()
clearTimeout @reconnectTimer
View
14 bg.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 4f17f7b

Please sign in to comment.