Sha256: 53451c45e9deda93cc3c6a6e6a029a6a284169edeb7bb0cb3f7b924ab6c5eb7d

Contents?: true

Size: 775 Bytes

Versions: 5

Compression:

Stored size: 775 Bytes

Contents

App.pills = App.cable.subscriptions.create "PillsChannel",
  connected: ->
    $ ->
      $().user_feedback("blue", 'канал подключен')
      $('#websocket-status').attr 'class', 'green-online'
# Called when the subscription is ready for use on the server

  disconnected: ->
    $ ->
      $().user_feedback("red", 'канал отключен')
      $('#websocket-status').attr 'class', 'red-offline'
# Called when the subscription has been terminated by the server

  received: (data) ->
    console.log data
    $().user_feedback(data.state, data.message, 1500, 1500)
    unless data.url == undefined
      setTimeout ( ->
        window.location.href = data.url
      ), 2000, data

# Called when there's incoming data on the webs
# Socket for this channel

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
digital_heroes_startkit-0.1.1.4 app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee
digital_heroes_startkit-0.1.1.3 app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee
digital_heroes_startkit-0.1.1.2 app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee
digital_heroes_startkit-0.1.1.1 app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee
digital_heroes_startkit-0.1.1 app/assets/javascripts/digital_heroes_startkit/channels/pills.coffee