We rolled out two new features this morning: a presence API and a few options for customizing and branding your chat widget.
On the presence side, the basic idea is that you don't need to have a chat widget cluttering up your page. You could just have a "Click here to chat with a librarian" link that opens the chat in a popup. Of course, you could already open the chat in a popup, that's not new. What is new is an easy way to have the "Click here" link go away or morph into "See our contact page" when you're not online. For details, see the wiki page http://code.google.com/p/libraryh3lp/wiki/PresenceApi.
We've also added a few hooks to allow you to personalize the appearance of your widget. You can display a title, pick a new icon theme for the presence display, or even write your own CSS to completely overhaul the way it looks. The options work as keyword arguments appended to your chat URL. So, if your URL is:
http://libraryh3lp.com/chat/me@libraryh3lp.com
You can add a title:
.../me@libraryh3lp.com?title=My+Chat+Widget
To add a title and pick a new theme:
.../me@libraryh3lp.com?title=My+Chat+Widget&theme=gota
You can view all of the available themes at http://libraryh3lp.com/presence/themes.
The keyword to supply your own CSS is "css" and the argument should be a URL pointing to your file. The default CSS is http://libraryh3lp.com/css/chat.css. Your customizations will be added to the default, so that you have a chance to override what's there without having to reinvent the wheel. An example:
.../me@libraryh3lp.com?css=http://my.library.edu/chat/custom.css
One last item of note. If you use the presence API, you'll notice that it supplies an "openChat" method for convenience, so that you don't have to supply the raw chat URL. If you want to use the customization features with this method, just pass the options as part of the argument, as in:
libraryh3lp.openChat({title: 'My Chat Widget', theme: 'gota'});
Subscribe to:
Post Comments (Atom)
4 comments:
Nice!
If you have time down the road, it would be useful to have a presence webservice as well - say you don't want to (or can't) use JavaScript, but you have access to a server side scripting language.
Or would I use an XMPP library for that?
There actually is a webservice API underneath. It's just not well documented. (Or maybe barely documented is a better description.) What I described above is intended as a convenient wrapper.
The webservice side of things is documented at the bottom of the wiki page http://code.google.com/p/libraryh3lp/wiki/PresenceApi "The Not-So-Easy Way", but it's pretty incomplete. I've got some PHP sample code I'd like to include to make it more accessible.
The basic difference, though, is if you use the webservice API server-side, you get presence at page-load time. Client-side, you can get real-time updates.
This is a fabulous tool and we're really looking forward to using it. But I'm trying to edit the CSS and the config tool isn't displaying accurately today. The link above to your css file isn't working anymore either. Is there another source for a css sample?
Emily,
Oops, sorry about that! We put the CSS file back. In the web interface, it's also possible to use the "Configurator" tool to handle custom CSS.
I'm also sorry to have missed your comment for a few days -- for some reason, Blogger didn't notify me of it.
Post a Comment