Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Unified API for single site browsers - Fork for js lib agnostic
Branch: master
Pull request Compare This branch is even with alexyoung:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
ruby_libs
src
tests
README.textile
Rakefile
ssbx.js

README.textile

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).

Something went wrong with that request. Please try again.