This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
msokk edited this page Feb 16, 2011
·
10 revisions
- Go to /modules
- Must export "types" array to specify requests to be caught
- Also must export "init" function which is called with "this" being the socket client and with argument "data", which contains the whole payload from client
- There are 4 options to push data :
-
this.send(msg)
- msg is sent back to originating client -
this.broadcast(msg)
- msg is sent to everybody except originating client -
this.listener.broadcast(msg)
- msg is sent to everybody -
this.listener.announce(msg)
- msg is sent to everybody (even anonymous users)
-
- Go to /public/modules
- Subscribe to events with
Smog.on(type, callback)
- callback gets data variable - Add filters with
Smog.filter(name, callback)
- callback gets input string - Same event/filter can't be redefined
- Events can be removed with
Smog.die(type)
- Filters can be removed with
Smog.removeFilter(name)
colors.js - for Admin tool