JsChat and Ico Updates
I’ve updated both JsChat and Ico with major changes recently, as a result of some healthy Easter weekend open source hacking.
JsChat: Mongo, Twitter Auth
JsChat can now be configured to work with Mongo and Twitter authentication:
- The web interface now has tabs
- The server now has a config file in
/etc/jschat/config.json - The config file can be used to set up Twitter auth and Mongo
- Logging in with Twitter will save the user’s session (including tabs) until Quit is pressed or
/quitis entered
Read more on blog.jschat.org Twitter Auth, Mongo Logging and Tabs
Ico
I’ve removed the Prototype dependency from Ico, so it only depends on the core Raphael library. I used jslint to help tidy up the code as well.
I’m using SVG paths for drawing Ico’s graphs. They’re quite easy to build because they’re simple strings:
// Move to 0,0, draw a line to 10,10 'M0,0 L10,10'
Raphael’s calls can be chained, so the resulting code is concise:
// Move to 0,0, draw a line to 10,10, then apply a stroke
paper.path('M0,0 L10,10').attr({ 'stroke': colour });
The old API is still available through a plugin called raphael.path.methods.js, but despite initially being put off by SVG paths I now prefer them.