Sha256: 0a1e68c032fb5f45ae6016a4a8f654d34a12e673209e8bbc982375654cfd95d0

Contents?: true

Size: 703 Bytes

Versions: 23

Compression:

Stored size: 703 Bytes

Contents

class App.Services.NotificationCenter
  receivedSignal: (data) ->
    switch data.signal
      when 'ping'
        this._pingSignal()
      when 'message'
        this._messageSignal data

  _pingSignal: ->
    return if App.Env.namespaceController.constructor isnt App.Controllers.User
    alert 'Ping!'

  _messageSignal: (data) ->
    return if not view = this._getRoomView()
    view.receivedMessage data.message, data.author

  _getRoomView: ->
    return false if App.Env.namespaceController.constructor isnt App.Controllers.User
    return false if App.Env.controller.constructor isnt App.Controllers.User.Rooms
    return false if App.Env.action isnt 'show'
    App.Env.controller.getView 'show'

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
loco-rails-3.0.3 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.5.3 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.5.2 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-3.0.2 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-3.0.1 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.5.1 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.5.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.4.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.3.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-3.0.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.2.2 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.2.1 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.2.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.1.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-2.0.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-1.5.2 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-1.5.1 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-1.5.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-1.4.0 test/dummy/app/assets/javascripts/services/notification_center.coffee
loco-rails-1.3.3 test/dummy/app/assets/javascripts/services/notification_center.coffee