What is this all about?

Below is a list of function added to the Document Object Model in Bubbles.

You can:

BB_visible property
Tells you if the window is visible or not. true/false.
BB_balloon(title, message, action, delay) function
Pop up a messenger-style notification. title — a text title for the notification.
message — a text message for the notification.
action can be a URL, 'javascript:***' or ''.
delay — in seconds, 0 means infinite.
BB_setIcon(url) function
Change the system-tray icon. url — jus a URL.
Icons are cached so don't be afraid to flip between icons quickly (eg. blinking)

Manage Bubble shortcut menus

BB_addMenuItem(title, action, iconUrl) function
Add a menu Item to the system tray, returns an ID as string for for the menu item.
BB_modifyMenuItem(itemId, title, action, iconUrl) function
Modify a menu item. Use the ID returned from BB_addMenuItem.
BB_removeMenuItem(itemId) function
Removes a menu item. Use the ID returned from BB_addMenuItem.
BB_clearMenu() function
Clears all the menu Items from the system tray. Note: when switching domains the menu will be cleared automaticlly.

Managed files "dropped" into the Bubble

BB_dropHandler() function
Event handler for file drop operation. When a file is dropped, the method is called with no parameters, if you defined this method you now have a chance to work with dropped files.
Note: all dropped file data is cleared when bubbles switches domains.
BB_numDropFiles property
Number of dropped files.
BB_getDropFileName(index) function
Returns the full path of the dropped file at index. The index is zero based.
BB_getDropFileData(index, encoding) function
Returns the data for the dropped file at index. The index is zero based. Posting dropped files is done using our own XmlHttpRequest, shown below.

Manage Bubble context variables

BB_setValue(name, value) function
Inits & sets a Bubbles context variable. Persistent storage uses strings.
BB_getValue(name) function
Get Bubbles context variable by name. Returns empty string if value doesn't exist.
Persistent storage uses strings.
BB_setSessionValue(name, value) function
Value is saved For the current bubble session. Volatile storage uses strings.
BB_getSessionValue(name) function
Get Bubbles session variable by name. Returns empty string if value doesn't exist in the current session.
Volatile storage uses strings.

Logging

BB_log(message) function
Log a textual message. Currently maps to the notification method, next versions will have a log window

XmlHttpRequest

BB_xmlHttpRequest function
XmlHttpRequest init. Cross-site-scripting allowed. Works just like [Greasemonkey's method], only that:
  • Handlers are specified by function name, not an inline function. e.g.: onload: 'handleOnDataLoad'.
  • Handlers receive responseDetails object [like in GreaseMonkey].
  • There's no onreadystatechange.

Uploading files (posting drag & drop files): this is supported by a 'behind the scenes' connection between the drag-and-drop mechanism and the BB_xmlHttpRequest method.
To upload a file, have it dragged into the bubble, and then post it using BB_xmlHttpRequest.

How do you tell BB_xmlHttpRequest to do this? In the form parameter simply use this syntax:
form: {
            "name" : "joe", 
            "file1" : {'dragged_id' : 4} 
      }
this shows how to post a regular variable called name, and a binary file called file1.

BB_xmlHttpRequest will do all the work behind the scenes to send the file, for a live example check out the flickr.bblbox script.

Version

BB_version property
Returns bubbles's version as string.
← Back to Developers Page