Every repository with this icon (
Every repository with this icon (
tree 270da0e5655d429be157656cf052465a0320c25a
parent 353773a91dcfe89bb6b7c395a35c4068aacd28e4
| name | age | message | |
|---|---|---|---|
| |
README.textile | Wed Jan 14 07:54:41 -0800 2009 | |
| |
Rakefile | Tue Jan 06 10:52:49 -0800 2009 | |
| |
lib/ | Tue Jan 06 10:52:49 -0800 2009 | |
| |
ruby_libs/ | Tue Jan 06 10:52:49 -0800 2009 | |
| |
src/ | Wed Jan 14 07:39:40 -0800 2009 | |
| |
ssbx.js | Wed Jan 14 07:39:40 -0800 2009 | |
| |
tests/ | Wed Jan 14 07:39:40 -0800 2009 |
Introduction
SSBX provides a stupidly simple API for supporting Single Site Browsers (SSB) in your website.
The current version is a basic implementation to test out the feasibility of the concept, and explore how to make a consistent unified API across platforms.
Examples
if (SSBX.isAvailable()) {
SSBX.log('hello');
SSBX.notify({ message: 'This is a message', title: 'Title' });
SSBX.notifyOnce({ message: 'This is a message', title: 'Title', unique_id: 5});
SSBX.setDockBadge(5);
SSBX.log(SSBX.availableDriver);
}
You can also only run when there’s a compatible SSB available like this:
SSBX.run(function() {
SSBX.log('hello');
}
Requirements
SSBX requires Prototype.
Supported SSBs
Notification API
Show a notification (requires Growl in Mac OS). Title is optional.
SSBX.notify({ message: 'This is a message', title: 'Title' })
Show a notification and log it so it doesn’t get displayed again. Logs to a cookie:
SSBX.notifyOnce({ unique_id: 1, message: 'This is a message', title: 'Title' })
SSBX expects a unique integer ID for messages to be handled this way.
Dock badge icons
Only available in Mac OS (until someone offers a Windows equivalent):
SSBX.setDockBadge(3)
Console logging
To make it easier to debug your JavaScript from within an SSB you can use unified console logging:
SSBX.log('Message')
Capabilities
- Test if the SSB is available: SSBX.isAvailable()
- Check which SSB is active: SSBX.availableDriver
Drag and drop
Running tests
Run tests inside the appropriate SSB. There’s tests for Bubbles and Fluid.
Library style
I’ve added semicolons to line endings to make compressing/obscuring the library easier (if you do that sort of thing).







