aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/assets/javascripts/cable/channel.js.coffee6
-rw-r--r--lib/assets/javascripts/cable/connection.js.coffee4
-rw-r--r--lib/assets/javascripts/cable/subscriber_manager.js.coffee4
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/assets/javascripts/cable/channel.js.coffee b/lib/assets/javascripts/cable/channel.js.coffee
index 645a44e140..bbdc9c5589 100644
--- a/lib/assets/javascripts/cable/channel.js.coffee
+++ b/lib/assets/javascripts/cable/channel.js.coffee
@@ -5,11 +5,11 @@ class Cable.Channel
@cable.subscribers.add(@identifier, this)
# Perform a channel action with the optional data passed as an attribute
- sendAction: (action, data = {}) ->
+ perform: (action, data = {}) ->
data.action = action
- @sendMessage(data)
+ @send(data)
- sendMessage: (data) ->
+ send: (data) ->
@cable.sendMessage(@identifier, JSON.stringify(data))
unsubscribe: ->
diff --git a/lib/assets/javascripts/cable/connection.js.coffee b/lib/assets/javascripts/cable/connection.js.coffee
index a318925b97..e987c227c6 100644
--- a/lib/assets/javascripts/cable/connection.js.coffee
+++ b/lib/assets/javascripts/cable/connection.js.coffee
@@ -31,7 +31,7 @@ class Cable.Connection
if data.identifier is '_ping'
@pingReceived(data.message)
else
- @cable.subscribers.notify(data.identifier, "onMessage", data.message)
+ @cable.subscribers.notify(data.identifier, "received", data.message)
onConnect: =>
@startWaitingForPing()
@@ -50,7 +50,7 @@ class Cable.Connection
disconnect: ->
@removeExistingConnection()
@resetPingTime()
- @cable.subscribers.notifyAll("onDisconnect")
+ @cable.subscribers.notifyAll("disconnected")
reconnect: ->
@disconnect()
diff --git a/lib/assets/javascripts/cable/subscriber_manager.js.coffee b/lib/assets/javascripts/cable/subscriber_manager.js.coffee
index 4f46efe817..98223d076c 100644
--- a/lib/assets/javascripts/cable/subscriber_manager.js.coffee
+++ b/lib/assets/javascripts/cable/subscriber_manager.js.coffee
@@ -5,12 +5,12 @@ class Cable.SubscriberManager
add: (identifier, subscriber) ->
@subscribers[identifier] = subscriber
if @cable.sendCommand(identifier, "subscribe")
- @notify(identifier, "onConnect")
+ @notify(identifier, "connected")
reload: ->
for identifier in Object.keys(@subscribers)
if @cable.sendCommand(identifier, "subscribe")
- @notify(identifier, "onConnect")
+ @notify(identifier, "connected")
remove: (identifier) ->
if subscriber = @subscribers[identifier]