There are two ways to start a CloudWall app programmatically: changing page URL hash using window.location.hash = URLhash
, and calling cw.state.set(URLhash)
.
CloudWall apps are started inside slots, which are children of a DOM node, defined in config.$slots
global CW config.
Each slot also carries additional properties, describing slot app.
Collection of basic slot manager methods.
Returns Slot object for current active slot.
Decodes URL hash and starts app with init params passed through URL. If app is already running, switches to the running app instance.
Returns Promise resolved with Slot object.
Returns list of all running slots.
Returns current state URL.
Slot object represents running CloudWall app. Slot objects are returned on app start/switch, also cw.state.slots()
returns list of Slot objects for all running apps.
Returns jQuery object, pointing to the app container DOM node.
String, id
attribute of the slot DOM node.
Points to app-bound bucket methods collection object. Methods are described more detailed in App runtime section.
String, app name, in most cases the name is a second part of URL hash.
String, slot title for display.
Boolean, value is true
if slot is busy (can’t receive user interactions).
Part of URL hash string, params the app was started with. In most cases is base64-encoded and may be decoded using cw.lib.fromurl64(slot.initstate)
.
String, URL hash the app was started with.
Boolean, value is true
if the app is an editor.
Sends a message to slot app. To receive a message an app should use
Number, timestamp of the moment the slot was started.
Current URL hash of the slot. Slot URL hash generally consists of 3 parts, delimited by slash:
lab/Inliner/!WyJlZGl0IiwiMTUzNjUwMDc4MDg0eHozMnA1MWsiXQ--
Here the first part lab
is the bucket. Second part Inliner
is the app name. Third part is app state shortcut, it’s has fixed hard-coded format for editors and is more or less freeform for non-editors.
For editors:
Fon non-editors: