| Candy | Chats are not dead yet. |
© 2011 Amiado Group AG. All rights reserved. © 2012-2014 Patrick Stadler & Michael Weibel
| observer.js | |
| Candy. | Observes Candy core events |
| Candy. | Chat events |
| Functions | |
| Connection | The update method gets called whenever an event to which “Chat” is subscribed. |
| Events | |
| candy: | Using this event, you can alter the default Candy (View) behaviour when reacting to connection updates. |
| Functions | |
| Message | Dispatches admin and info messages |
| Candy. | Presence update events |
| Functions | |
| update | Every presence update gets dispatched from this method. |
| Events | |
| candy: | Presence update when kicked or banned |
| Functions | |
| notifyPrivateChats | Notify private user chats if existing |
| Candy. | Presence errors get handled in this method |
| Candy. | Messages received get dispatched from this method. |
| Candy. | The login event gets dispatched to this method |
| Candy. | Displays an error about missing autojoin information |
Chat events
| Functions | |
| Connection | The update method gets called whenever an event to which “Chat” is subscribed. |
| Events | |
| candy: | Using this event, you can alter the default Candy (View) behaviour when reacting to connection updates. |
| Functions | |
| Message | Dispatches admin and info messages |
Using this event, you can alter the default Candy (View) behaviour when reacting to connection updates.
If your event handler returns `false`, no View changes will take place. You can, of course, also return `true` and do custom things but still let Candy (View) do it’s job.
This event has been implemented due to issue #202 and here’s an example use-case for it:
// react to DISCONNECTED event
$(Candy).on('candy:view.connection.status-6', function() {
// on next browser event loop
setTimeout(function() {
// reload page to automatically reattach on disconnect
window.location.reload();
}, 0);
// stop view changes right here.
return false;
});Presence update events
| Functions | |
| update | Every presence update gets dispatched from this method. |
| Events | |
| candy: | Presence update when kicked or banned |
| Functions | |
| notifyPrivateChats | Notify private user chats if existing |
| Candy. | Presence errors get handled in this method |
| Candy. | Messages received get dispatched from this method. |
| Candy. | The login event gets dispatched to this method |
The update method gets called whenever an event to which “Chat” is subscribed.
Connection: function( event, args )
Dispatches admin and info messages
Message: function( event, args )
Every presence update gets dispatched from this method.
update: function( event, args )
Notify private user chats if existing
notifyPrivateChats: function( user, type )