Mail Application Development Platform API Reference

openmail.Application

Core Yahoo! Mail application UI and webservice methods.

Methods

callWebService
int callWebService ( service , handler )
Calls a third-party Web service. This requires the third-party service to support Flash clients.

Sample Use:
For usage examples, refer to the Delicious Skeleton Sample App.
Parameters:
service < Object > An object describing the Web service to call. Attribute values expected are listed below.
url: String Target URL. Can include pathInfo or attr=value params. Note that if you include parameters here, it is your responsibility to URL encode (or not, as appropriate for the receiving service) via something like encodeURIComponent().
method: String "GET" or "POST". Neither the GET nor the POST will ever encodeURIComponents() on any values that might be provided in the URL.
parameters: Object A map of key/value pairs to use as the query string or the POST body. These parameters will be run thru encodeURIComponent() before being sent across the network.
headers: Array of String An array of HTTP headers as strings. You can set any arbitrary headers if it is accepted by cross-domain policy file. Content-Type header is always accepted. It is only supported for "POST"
dataformat: String "text"(default) or "binary". "binary" returns Base64-encoded binary data.
handler < function > A callback function. Response Object returned from callback has the following data:
On success: response.data contains the HTTP body returned by the Web service.
On failure: response.error contains an error message describing the failure. Error code described below.
ERR_FLASH_REQUIRED: The flash plugin is not installed. User should install Flash 9.0 and restart the browser to successfully run OpenMail applications.
ERR_FLASH_ERR: The OpenMail application's call to callWebService failed due to a Flash runtime error. User should verify that Flash is configured correctly and executable in this browser.
ERR_FLASH_LAUNCH_ERR: The OpenMail application's call to callWebService failed because FLASH could not be launched. Flash may be blocked by a Flash Blocker Plugin or another error has occurred with starting Flash. User should verify that Flash is configured correctly and executable in this browser.
Returns: int
An error code.

closeView
int closeView ( view , handler )
Closes a currently opened view. To close the view initiating the call, pass null for view.

Sample Use:
For usage examples, refer to the Kitchen Sink Sample App.
Parameters:
view < Object | null > If view is not null, it must be an object that includes the following:
id: String (Required) Application-defined id.
handler < function > A callback function. If a view closes itself, callback will not be called. Callback response Object has the following data.
On success: response.error is ERR_NONE
On failure: response.error contains a generic error code or ERR_VIEW_NOT_FOUND.
Returns: int
An error code.

filterHTML
int filterHTML ( args , handler )
Filters HTML to make it safe for rendering in an OpenMail app. Intended for use by OpenMail apps that inject HTML from 3rd-party webservices or from user input into views.
Parameters:
args < Object > An object with one member, html, which is a String that contains the HTML to validate.
handler < function > A callback function to receive the response. Callback response Object has the following data:
On success: response.html contains filtered html result.
On failure: response.error contains an error code, response.errorMsg contains a string describing the error.
Returns: int
An error code.

getAttachmentUrl
int getAttachmentUrl ( args , handler )
Get the time-sensitive URL of a message's attachment content. message.read event provides response.message.attachment member object to access the attachments associated with an email. Each of these attachment objects will have the 'url' member which can be used with getAttachmentUrl API to get to the actual attachment content. The returned URL is time sensitive and cannot be tampered with. Also, note that the attachment pointed to by the returned URL is not virus scanned.

Sample Use:
var om = openmail;
function handleAttachment(resp) {
var attachments = resp.message.attachment;
function onGotAttachment(attachment){
alert(attachment.data);
} function onGotAttachmentURL(aURL) {
if(aURL.error){
alert(aURL.error);
return;
} om.Application.callWebService( { url : aURL.url, method : 'GET', parameters : {} }, onGotAttachment);
} for(var i = 0; i < attachments.length; i += 1){
var mimeurl = attachments[i].url
om.Application.getAttachmentUrl( {url : mimeurl}, onGotAttachmentURL );
return;
}
} om.Application.setListener( {event : "message.read"}, {afterRender : handleAttachment} );
Parameters:
args < Object > An object containing a member 'url' of type String with the mimepart attachment URL.
handler < function > A callback function. Callback response Object has the following data:
On success:
data.url contains the time sensitive dotted quad actual URL for the attachment content.
data.mimeurl contains the original passed in mime part URL from the app.
On failure:
data.error contains an error message describing the failure.
data.mimeurl contains the original passed in mime part URL from the app.
Returns: int
An error code.

getAuthService
Object getAuthService ( conf )
Helper for interacting with web services that require authorization.

Sample Use:
For usage examples, refer to the OAuth section of ydn. For a more detailed explanation, visit YQL Sample App.
Parameters:
conf < Object > An object containing the configuration of authorization service requested. Object has the following members:
profile: The name of the stored profile
url: URL of the target service; only needed if service is used with http proxy
proxy: URL of the proxy; only needed if service is used with http.
Returns: Object
An authorization object to interact with the Web service specified in the profile.

getData
int getData ( keys , handler )
Retrieves data by key from the per-app-per-user persistent store.

Sample Use:
For detailed usage examples, refer to the Memories Sample App. An example usage for getData is listed below.
<script>
...
openmail.Application.getData({keys:['name','timeWeFirstMet']}, onGotData);
...
</script>

Here is another example of using the wildcard "*" as the key name:
<script>
function getAllData() {
openmail.Application.getData({ keys: [ "*" ] },
function( result ) {
var s = "";
for ( var keyName in result.data) {
s += keyName + "=" + result.data[keyName] = "\n";
} alert( s );
}
);
}
</script>
Parameters:
keys < Object > Key names of the data to retrieve. This object must have a single data member named keys; this is array of key names to retrieve. The wildcards "*" (any arbitrary string) and "?" (any single character) are supported.
handler < function > A callback function. Callback response Object has the following data:
On success: response.error is ERR_NONE.
On failure: response.error contains a generic error code. Has following members:
data: Object The data requested. Member names are the keys requested; values are the stored data.
version: Object Version number of application instance. Members names are the keys requested; values are version numbers.
errorCode: Object Error codes for the requested data, which corresponds to the error codes in module.openmail. Member names are the keys requested; values are the error codes for each corresponding key.
totalCount: Number Number of keys in the returned data set.
Returns: int
Error Code. See module.openmail for error codes for the API call itself. Check the response handler callback object (response.error) for error status of data fetch.

getParameters
int getParameters ( handler )
Retrieves properties associated with the view that invoked the function. These properties include user, reason the view was launched, application-defined view context, and action-dependent data. If the view was opened by a call to openView(), data property is the same as the parameters argument passed to openView(). For example, in the "Kitchen Sink" example application, if an email message is dragged and dropped onto the application, then the data is JSON representation of email message.

Sample Use:
For usage examples, refer to the Kitchen Sink Sample App.
Parameters:
handler < function > The callback function that receives the response. Callback response object has a member object response.user. This object has following members:
guid: unique user identifier as string, not human-friendly.
intl: internationalization domain (e.g. "us").
lang: user's language preferences as an array (e.g. ["en-US"]). See also getUserLanguages().
theme: user's ymail options color theme (e.g. "mountain").
themeinfo: user's ymail options color theme object (contains name - themename and css - theme file path ), this is available only in new version.
The remaining response members depend on the user action.
For a message drag-and-drop action, they are:
response.context: the value of the context node in the configuration XML of application.
response.data: message JSON object.
response.index: The index of the subfolder that the message was dropped on. This member will not be present if the message was dropped on the main application folder.
response.reason: "data/message".
For click action:
response.context: the value of the context node in the configuration XML of the application.
response.data: null.
response.reason: "events/click".
For openView() call:
response.context: the value passed to context argument of openView().
response.data: the value passed to parameters argument of openView().
response.reason: "api/openView".
For uninstall action:
response.context: the value of the context node in the configuration XML of the application.
response.reason: "events/uninstall".
Returns: int
An error code.

getUserLanguages
array getUserLanguages ( )
Obtain the user's language preferences. Returns the user's language preferences as an array of RFC 4646 language tags. If preferences are not available, it will return 'en-US' as the default value. See also, getParameters() response object, specifically the user.lang array response.

Returns: array
RFC 4646 language tags.

isSSL
Boolean isSSL ( )
Was Yahoo! Mail launched over SSL?
Returns: Boolean

openView
int openView ( view , handler )
Opens a new view for the current application.

Sample Use:
For usage examples, refer to the Kitchen Sink Sample App.
Parameters:
view < Object > Should include the following:
id: String An application-defined id used to reference the view in other API calls
view: String The name of a view to load (e.g. "main.html" ) as uploaded with ymdt.
target: String A valid target for the view to load that supports the following views: "tab", "dialog", and "hidden".
parameters: Object A map of values available to the loaded view through the getParameters() API call.
context: Object A value specifying the context of the opened view that can be retrieved through the getParameters() API call.
width: Number "Dialog" view only. The default width of the dialog view is 400 px.
height: Number "Dialog" view only. The default height of the dialog view is 400 px.
ttl: Number "Hidden" view only. The "time to live" of the view in seconds. The view will be forcibly closed afterward. A ttl of zero means the view will never be forcibly closed. The default value for ttl is 60 seconds.
title: String "Tab" and "dialog" only. The title is shown in the tab or dialog header area.
options: Object A map of values that can be added to view. May include element Title: String to describe the Title for the view's iframe.
handler < function > A callback function. reponse Object has the following information:
On success: response.error is ERR_NONE
On failure: response.error contains a generic error code, ERR_INVALID_TARGET, or ERR_VIEW_EXISTS.
On warning: response.warn contains ERR_BAD_ARG if the width or height are not specified for a "Dialog" view.
Returns: int
An error code.

removeData
int removeData ( keys , handler )
Removes data by key from the per-app-per-user persistent store.

Sample Use:
For usage examples, refer to Kitchen Sink Sample App.
Parameters:
keys < Object > Key names of the data to remove. This object must have a single data member named keys, which is an array of key names to remove. The wildcards "*" (any arbitrary string) and "?" (any single character) are NOT supported.
handler < function > A callback function. Callback response Object has the following data
On success: response.error is ERR_NONE
On failure: response.error is ERR_REMOVE_DATA and response.errorMsg contains an error message.
Returns: int
Error Code. See module.openmail for error codes for the API call itself. Check the response handler callback object (response.error) for error status.

sendMessage
int sendMessage ( params )
Send message between views of the same app.

Sample Use:
// Broadcast "Hello World" to all views subscribed to "view.message" event,
// including the sending view
openmail.Application.sendMessage({ msg: "Hello World" });
// Send object to view id 'dashboard', the view must be subscribed to
// "view.message" event
openmail.Application.sendMessage({
msg: { action: 'updateStatus', status: 'online' },
target: 'dashboard'
});
Parameters:
params <Object> May include the following:
msg: Object|Array|String|Number|Boolean Message content.
target: String (Optional) Target view id to send the message to. If omitted, message will be sent to all the views.
Returns: int
An error code.

setData
int setData ( data , handler )
Saves key/value datasets into a per-application-per-user persistent store. Keys can be optionally given a time-to-live value, after which they are considerd expired and automatically removed from the store.

Sample Use:
For detailed usage examples, refer to the Memories Sample App. Code snippet below illustrates setData usage.
<script>
...
// Handler for when the user submits their name.
function onJustMet() {
var dataStruct = {
keys : { "name" : who, "timeWeFirstMet" : now }
} openmail.Application.setData( dataStruct, onResponse);
} ... </script>
Parameters:
data < Object > An object describing the data to set. It can include the following.
keys: Object The key/value pairs to store (Required)
ttl: Object key/ttl pairs. Member names should match the keys in keys. The value is the time-to-live in seconds for the corresponding keys.
handler < function > A callback function. Callback response has the following data:
On success: response.error is ERR_NONE.
On failure: response.error contains a generic error code.
Returns: int
Error Code. See module.openmail for error codes for the API call itself. Check the response handler callback object (response.error ) for error status of data storage.

setFolderConfig
int setFolderConfig ( config , handler )
Customize the appearance of an application's folder, including changing its tooltip, count and subfolders, or extending its label. The root label provided in this configuration is appended to the default label. The default label is the application's name. The subfolder labels are defined in the config object. Short of giving a full specification of the JSON format accepted for config, here's an example:
{
label: " - Beta",
tooltip: "click me",
subFolders: [{
label: "eden_people",
tooltip: "sub1 tt",
}, {
label: "flexcoders",
tooltip: "sub2 tt",
}, {
label: "shoop da woop",
tooltip: "blah"
}]
}

Sample Use:
In this excerpt from the "Saved Searches" sample application, each saved search is set up as a separate subfolder.
...
<script>
var state = [
{label:"Sample 1", query:"test"},
{label:"Sample 2", query:"openmail"}
]; ... function updateFolders(){
var obj = {
subFolders:[]
} for (var i=0;i<state.length;i++) {
var s = state[i];
obj.subFolders.push(s);
} openmail.Application.setFolderConfig(obj);
}
</script> ...
Parameters:
config < Object > An object that describes the folder configuration. Can include the following:
label: String Text to be appended to the application's folder
tooltip: String Tooltip to display for the application
subFolders: Array of Objects An array of objects. Each object in the subFolders array can include the following:
label: String Name of the subfolder (Required).
tooltip: String Tooltip for the subfolder.
handler < function > The callback function that receives the response. Callback response has the following data.
response.error can be ERR_BAD_ARG or ERR_NONE.
Returns: int
An error code.

setListener
int setListener ( registration , handler )
Registers an event handler for a particular event. Each instance of an application can only have one handler for a given application event (every open view is a different instance of the application). Setting a handler for an event will override any previous handlers for that event. Once a view is closed, the events that it registered for, will no longer get delivered. Views are not allowed to set a listener for an event that will be handled by another view.

Sample Use:
The "Saved Searches" example application uses setListener() to run a search for a subfolder.
...
var state = [
{label:"Sample 1", query:"test"},
{label:"Sample 2", query:"openmail"}
];
...
function omSubfolderClick(args) {
subfolderIndex = args.index;
openmail.Application.getData({keys:["state"]}, doSearch);
}
function loadHandler() {
updateFolders();
openmail.Application.setListener( {event: "subfolder.click"}, omSubfolderClick);
} ...
Parameters:
registration < Object > Object with one member, event. Value should be a string specifying the event to listen for, e.g. 'subfolder.click'. Supported events are described here.
handler < function > A callback function that takes a single object. See individual event definitions for event-specific callback object members.
Returns: int
An error code.

setTabCloseMessage
void setTabCloseMessage ( config )
Trigger a modal dialog with customizable message when user attempts to close a tab targetzone.
Parameters:
config < Object > An object containing API parameters
id: String View Id of a tab targetzone to display close message.
msg: String Message to display when user attempting to close the tab.
Returns: void

upgradeIfNecessary
int upgradeIfNecessary ( args , handler )
If a newer version of the app is available, trigger the upgrade flow. Normally, if there is a new version of the application available, upgrade flow is automatically triggered when the app is launched or whenever a new view is invoked. Long-running apps that don't invoke new views may make this call to ensure that the latest version of the app is installed.

This is particularly useful for long-running apps that fetch assets long after launch. Why? If a new version of such an app is published, assets published with the old (currently running) version may have been deleted. This API lets such long-running, late-fetching apps preemptively upgrade before attempting an asset fetch or check for an upgrade after failing to fetch an asset.

Parameters:
args < Object > Optional object. Has one member, 'suppressMessaging', that, if true, will suppress alerting the user if an upgrade does occur.
handler < function > A callback function invoked if an upgrade was not necessary or if an error occurs. Not invoked if an upgrade does occur. Callback result object has the following data:
On success: result.data contains a string describing the app version.
On failure:
data.error contains an error code.
data.errorMsg contains a string with extra diagnostic information.
Returns: int
An error code.

Events

app.jserror
Fired when a javascript exeception is caught.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
app < String > unique application identifier as string, not human-friendly.
appName < String > human-friendly application name.
url < String > the URL where the script error was encountered.
lineno < Number > the line number where the script errori was encountered.
message < String > the error message.

app.uninstall
Fired when an app is uninstalled, but only if the app has an uninstall section in its config.xml. The app should perform custom cleanup and then call Application.closeView.

Sample Use:
In config.xml, specify <uninstall> event with uninstall launch target zone:
...
<events>
  <uninstall>
    <action>
      <launch>
        <view>sample.html</view>
        <target_zone>uninstall</target_zone>
      </launch>
    </action>
  </uninstall>
</events>
...

In sample.html, set up a listener for app.uninstall event:
openmail.Application.setListener({ event: 'app.uninstall' }, function() {
   // Perform app clean up here
      ...
 
   // Signal Mail to continue app uninstall process
   openmail.Application.closeView();
});


Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
uninstall < Boolean > Always true.

browser.resize
Fired when browser window resizes. The event is fired continuously during the resize on active view until the resize ends. For inactive view, the event is fired once when the view receives focus. Note that app view size can be retrieved by calling YAHOO.util.Dom.getClientRegion

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.

compose.sendstart
compose.sendstart allows you to enhance the sendconfirm page.

To register for compose.sendstart, define a compose block defined in your app config.xml's event section, for example:
  <events>
    <compose>
      <action>
        <launch>
          <view>compose</view>
        </launch>
      </action>
    </compose>
  </events>

When the app's configured view loads, it should register to listen for compose.sendstart:

openmail.Application.setListener({event:'compose.sendstart'}, handleSendstart );

The above setListener invokes the handleSendstart callback whenever the 'send' button is pressed. The app may decide to attach a panel view to the sendconfirm page once sending is complete.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
data < Object > Data object that contains the following members:
recipients an object containing:
to The To header as an array of objects with the following members:
email String
name String
cc The CC header as an array of objects with the following members:
email String
name String
bcc The BCC header as an array of objects with the following members:
email String
name String
from The From header object with the following members:
email String
name String
subject The Subject header as a string.
proceed < Function > A function to call if the app wants to enhance the sendconfirm page. The function takes an object as an argument. The object may have the following members:
view The name of the view to load into an iframe (eg, "list.html")
width (optional) The CSS string for the width of the iframe (eg, "100%")
height (optional) The CSS string for the height of the iframe (eg, "120px")
cancel <Function> The function the app should call to cancel its invocation.

compose.user_event
compose.user_event allows you to add a button to the composer. Clicks on the button invoke your listener, which can modify the composer contents. For an app to be able to register for compose.user_event, the app config needs to have a compose block defined in the events section. The following is an example:
  <events>
    <compose>
      <action>
        <launch>
          <view>compose</view>
        </launch>
      </action>
    </compose>
  </events>

When the app's configured view loads, it should register to listen for compose.user_event:

openmail.Application.setListener({event:'compose.user_event', label:'click me', tooltip:'click me now!', tab:'format' }, handleCompose );

The above setListener call adds a 'click me' button to the composer's 'format' tab, with the handleCompose callback invoked whenever the button is pressed. The only other valid tab is 'attachments'.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
data < Object > Data object that contains the following members:
recipients an object containing:
to The To header as an array of objects with the following members:
email String
name String
cc The CC header as an array of objects with the following members:
email String
name String
bcc The BCC header as an array of objects with the following members:
email String
name String
from The From header object with the following members:
email String
name String
subject The Subject header as a string.
body < String > the value of the message body in the composer.
action < String > The action that opened the compose tab: 'compose', 'reply', or 'forward'
elemID < String > Unique identifier of the button
instance < String > Unique identifier of the compose tab instance (useful in case multiple compose tabs are open)
returnMessage < Function > function the app should call to return data back the mail client. The function takes an Object as an argument with the following fields:
body String - the modified email body.
cancel <Function> the function the app should call to cancel its invocation.

message.read
The message.read event lets apps inject javascript and css into the message rendering iframe. This lets the app modify the look and feel of the message, change the message body, and inspect both the message body and message metadata. To register for message.read events, the app's config.xml needs a <message_read> in its <events>. Here's a config.xml excerpt that injects the app's "enhance.js" and "enhance.css" assets into email with "Flickr" in the subject line:
  <events>
    <message_read>
      <match>
        <header>
          <name>subject</name>
          <regex>/.*?Flickr.*/</regex>
        </header>
      </match>
      <message_actions>
        <enhance_message>
          <css>
            <path>/yahoo/mail/assets/enhance.css</path>
          </css>
          <js>
            <path>/yahoo/mail/assets/enhance.js</path>
          </js>
        </enhance_message>
      </message_actions>
    </message_read>
  </events>

<match> supports the following sub-elements. Each sub-element must have at least one <name> and <regex> element pair.
<header>: name element supports the following values (from, to, subject, attachment.filename, attachment.type and attachment.subtype). regex element can have any JS regular expression string value.
<flag>: name element supports the following values (hasAttachment, inAddressBook, isDraft, isFlagged, isForwarded, isHam, isSpam, isRead, isRecent and isReplied). regex element can check whether value is 1 or 0.
<annotation>: name element supports the arbitrary identifiers such as person, place, event and etc. regex element can have any JS regular expression string value.
Within "enhance.js", the app sets up handlers for the message.read event:

openmail.Application.setListener( {event:"message.read"}, {
     beforeRender:beforeRenderHandler,
     afterRender:afterRenderHandler
});

It can register two handlers: beforeRender and afterRender. These handlers are invoked before and after rendering and are passed the current message's data, including: the message body, attachment references, annotations and message status flags. The app can modify the message content before or after it is displayed to the user. Handlers are invoked with the response object described below.

For performance reasons, try to use only the afterRender handler. If you must use the beforeRender handler, we need to toggle an administrative setting to enable it for your app. We rarely see a case where using beforeRender is worth the performance downside.

Response object member variables:
response < Object > - Data object that contains the following members:
view: view object that contains the following members:
doc: document object of the message pane that the message is rendered or will be rendered.
win: window object of the message pane that the message is rendered or will be rendered.
fullView: Boolean value, false if this message is rendered in preview pane. Otherwise, true
YUI: YUI global object
message: message object that contains the following members:
node: Message node to be inserted (beforeRender) or already inserted (afterRender) into the document.
subject: The Subject header as an HTML-entity-encoded string.
from: The From header as an array of email address / person name pairs.
to:The To header as an array of objects with the following members:
email: String
name: String
cc:The CC header as an array of array of objects with the following members:
email: String
name: String
replyto:The Reply To header as an array of array of objects with the following members:
email: String
name: String
suppressImages: Boolean value, the user's requested image blocking behavior, true if remote resources must not be fetched. Applications must not fetch remote resources or fire any remote beacons if this is true.
imagesBlocked: Boolean value, true if images have actually been suppressed for this message. Indicates whether the user will see ui indicating there are images being suppressed.
body: The text of the mail message, as an object with the following members:
content: String
truncated: Boolean value, true if message body is truncated. Message is truncated by default when its size >100kb unless user chooses to view full message. false when message body is not truncated.
sandboxPrefix: String Element id of the DOM node enclosing the message. This prefix is also prepended to all id and class attributes within the message.
annotation: The annotations for the response is an object where each attribute is a type of annotation (email_address, day_of_week, etc). within the array usually contains:
text: String text that triggered the annotion. eg: Wednesday
id: String for ease of access, each entry is surrounded by a dom node (<span>) with this id.
context: String a snippet of the surrounding message where the match occurred.
attachment: The attachments for the message have an array of objects with the following members:
type: String Content Type, e.g. application
subtype: String Sub Content Type, e.g. msword
url: String An URL that can be used with openmail.Application.getAttachementUrl()

message.user_event
The message.user_event allows you to add a button to the message header. Clicking on the button will invoke your listener, which can open a new view or modify the message. To register for message.user_event, the app's config.xml needs a <message_read> in its <events>. Here's a config.xml excerpt that will run the script in "add-button.js" when the user opens an email with "Flickr" in the subject line:
  <events>
    <message_read>
      <match>
        <header>
          <name>subject</name>
          <regex>/.*?Flickr.*/</regex>
        </header>
      </match>
      <message_actions>
        <enhance_message>
          <js>
            <path>/yahoo/mail/assets/add-button.js</path>
          </js>
        </enhance_message>
      </message_actions>
    </message_read>
  </events>

Within "add-button.js", the app calls setListener to declare what function will be called when the button is pressed as well as to set the button's text and tooltip:

openmail.Application.setListener({event:'message.user_event', label:'click me', tooltip:'click me now!' }, handleMessageUserEvent );


Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
response < Object > - The response object is identical to the message.read response object.

subfolder.click
Fired when an app's subfolder is clicked.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
index < Number > The index of the subfolder that was clicked on.

themes:change
Fired when there is a theme change. (This event is availble only in the new version)

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
name < String > New theme name.
css < String > New theme file path, app has to import the new css file.

view.blur
Fired when a view lost focus.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.

view.focus
Fired when a view receives focus.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.

view.message
Fired when this view receives a message from another view.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.
Response object member variables:
msg < Object|Array|String|Number|Boolean > Message content.
origin < String > id of the view that sent the message.

view.unload
Fired when a view gets unloaded.

Register for this event using Application.setListener. When the event occurs, your event handler will be invoked with a response object.