Clone this wiki locally
The API provided by Calatrava to the kernel of your app is actually quite small.
calatrava.bridge.changePage(<target>): Changes the current page to the page named
calatrava.bridge.openUrl(<url>): Open the given URL in a new web browser, however makes the most sense for the native platform.
calatrava.bridge.log(<message>): Log the given message for debugging purposes.
calatrava.bridge.request(<options>): Issue an AJAX request.
optionsis an object that can contain the following keys.
url: The URL to issue the request to.
method: The HTTP method to use.
body: The body to include with the request. Optional.
success: A callback to invoke on success.
failure: A callback to invoke if the request fails. Optional.
contentType: The Content-Type header to use. Optional.
customHeaders: A hash of additional custom headers to attach to the request. Optional.
calatrava.bridge.pages.pageNamed(<pageName>): Returns the page reference for the named page.
calatrava.bridge.timers.start(<timeout>, <callback>): Start a timer to fire after the timeout, given in seconds. When the timeout expires, the callback is called. Returns a timer handle.
calatrava.bridge.plugins.call(<pluginName>, <method>, <args>): Calls a previously registered plugin named
<pluginName>. Execute the
<args>. Exactly what the method means, and if one is even used is up to the plugin to define. This will forward on to the native implementation of your plugin.