diff options
author | John McLear <john@mclear.co.uk> | 2012-08-12 08:55:44 -0700 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2012-08-12 08:55:44 -0700 |
commit | aabdf665a7e3c11db838b8612666cbc251d70660 (patch) | |
tree | 789ec8eee93f82af7984ce641099396b3706e0fc /doc | |
parent | 75c07ad569e08a8f90766d52f64f3f91da12f5c8 (diff) | |
parent | 14da09dddd684f6601738c3fce99621917a9a604 (diff) | |
download | etherpad-lite-aabdf665a7e3c11db838b8612666cbc251d70660.zip |
Merge pull request #934 from MarkTraceur/new-doc/plugin/handle-client-message
Add in docs for the new hook I just added
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/hooks_client-side.md | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/api/hooks_client-side.md b/doc/api/hooks_client-side.md index 6652f757..b991d62d 100644 --- a/doc/api/hooks_client-side.md +++ b/doc/api/hooks_client-side.md @@ -158,4 +158,15 @@ Things in context: 4. style - the style applied to the node (probably CSS) 5. cls - the HTML class string of the node -This hook is called after the content of a node is collected by the usual methods. The cc object can be used to do a bunch of things that modify the content of the pad. See, for example, the heading1 plugin for etherpad original.
\ No newline at end of file +This hook is called after the content of a node is collected by the usual methods. The cc object can be used to do a bunch of things that modify the content of the pad. See, for example, the heading1 plugin for etherpad original. + +### handleClientMessage_`name` +Called from: `src/static/js/collab_client.js` + +Things in context: + +1. payload - the data that got sent with the message (use it for custom message content) + +This hook gets called every time the client receives a message of type `name`. This can most notably be used with the new HTTP API call, "sendClientsMessage", which sends a custom message type to all clients connected to a pad. You can also use this to handle existing types. + +`collab_client.js` has a pretty extensive list of message types, if you want to take a look. |