diff --git a/.gitignore b/.gitignore index a488f3cda3..facfb9a3b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store build/jsdoc_toolkit-2.4.0.zip build/jsdoc_toolkit-2.4.0 +/build/output/ +tags diff --git a/api/blackberry_app.js b/api/blackberry_app.js index f3a5acf0cd..ab85b4fa89 100644 --- a/api/blackberry_app.js +++ b/api/blackberry_app.js @@ -17,6 +17,8 @@ /** * @toc {System} Application * @featureID blackberry.app + * @notice {Warning ( Playbook 1.0 Notice):} + * For URI based APIs, webworks:// has been deprecated and replaced with http://localhost:8472. This change does not affect the procedural APIs. * @namespace The Application object provides functions and properties for the currently running application. * @example * <script type="text/javascript"> @@ -245,7 +247,7 @@ A banner indicator can have an optional numeric value that usually serves as a c * function getAppData(){ * $.ajax({ * type: "get", - * url: "webworks://blackberry/app/get", + * url: "http://localhost:8472/blackberry/app/get", * success: function(msg){ * $('#myAppDiv').populate(JSON.parse(msg).data); * } diff --git a/api/blackberry_bbm_platform.js b/api/blackberry_bbm_platform.js new file mode 100644 index 0000000000..9af06c28ba --- /dev/null +++ b/api/blackberry_bbm_platform.js @@ -0,0 +1,180 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @toc {BBM} BBM Platform + * @featureID blackberry.bbm.platform + * @namespace Provides access to the BBM Social Platform. + * + *

Required BBM Version

+ * + * BBM Social Platform APIs come with BBM6 and later. BBM6 is supported on BlackBerry OS 5, 6, and 7. + * + *

Authorization

+ * + *

+ * Applications must first obtain access to the platform by calling + * {@link blackberry.bbm.platform.register}. + *

+ * + * + * @BB50+ + * @learns {Download BBM SDK Resources} http://us.blackberry.com/developers/blackberrymessenger/ Download the resources required to use the BBM SDK for WebWorks [BlackBerry]. + * @learns {Getting Started Guide} http://docs.blackberry.com/en/developers/deliverables/30299/ Setup the BBM SDK for BlackBerry WebWorks [BlackBerry Developer Resource Center]. + * @learns {Sample Application Guide} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Getting-Started-BlackBerry-WebWorks-Development-for-Smartphones/ta-p/1185353 Get started with the sample application included with the BBM SDK for BlackBerry WebWorks [BlackBerry Developer Resource Center]. + */ +blackberry.bbm.platform = { + + /** + * @description Registers for access to BBM Platform. + *

The application must assign a callback to {@link blackberry.bbm.platform.event:onaccesschanged} + * before registering. During registration, a dialog will be shown to guide the user through the registration process. + * The application should wait until {@link blackberry.bbm.platform.event:onaccesschanged} is invoked before continuing.

+ *

Application in Test Environment

+ * Applications must provide a UUID used to identify the application in the test + * environment. If the application is in App World then the UUID will not be used. The same + * UUID should be used for future releases of the same application; otherwise communication + * between them will not be possible. The UUID must be a randomly generated 36-character UUID. + * Any UUID generator can be used. + * @param {Object} options Options. + * @param {String} options.uuid ID used to identify the application in the test environment. + * @throws {IllegalStateException} If blackberry.bbm.platform.onaccesschanged is not assigned. + * @throws {IllegalArgumentException} If UUID is not a valid 36-character UUID. + * @example + * <script type="text/javascript"> + * + * // Create callback invoked when access changes + * blackberry.bbm.platform.onaccesschanged = function(accessible, status) { + * if (status == "allowed") { + * // Access allowed + * } else if (status == "user") { + * // Access blocked by user + * } else if (status == "rim") { + * // Access blocked by RIM + * } + * // Listen for other status... + * }; + * + * // Register with the platform + * blackberry.bbm.platform.register({ + * uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID + * }); + * + * </script> + * @BB50+ + */ + register : function(options) { + }, + + /** + * @description Shows a dialog prompting the user to connect this application to BBM. This will + * only work if the application is blocked by the user (i.e. access status is "user"). + *

If the user decides to connect then the application should call {@link blackberry.bbm.platform.register} + * to complete connecting this application to BBM. + * @param {Function} onComplete Called when the user has finished connecting this application to BBM. + * @param {Boolean} connected true if the user connected the application to BBM; + * false otherwise. + * @example + * <script type="text/javascript"> + * + * // Prompt the user to connect to BBM, and call register() if they do + * blackberry.bbm.platform.requestUserPermission(function(allowed) { + * if(allowed) { + * // Register with the platform + * blackberry.bbm.platform.register({ + * uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID + * }); + * } + * }); + * + * </script> + * @BB50+ + */ + requestUserPermission : function(onComplete) { + + } + + /** + * Called when the access status changes. + *

This callback is mandatory and must be assigned before the call to {@link blackberry.bbm.platform.register}. + * @param {Boolean} accessible true if access is allowed; + * false otherwise. + * @param {String} status The access status. + *

+ * @event + * @BB50+ + */ + onaccesschanged : function(accessible, status) { + }, + + /** + * Called in certain cases when the application is invoked from within BBM. At the moment this + * event is only triggered by profile box items. + *

This callback should be assigned before the call to {@link blackberry.bbm.platform.register}. If the application is not yet running then it will be launched. This callback will only be invoked once access to the platform is allowed. + *

This callback is optional. Applications are not required to handle this type of event. + *

ProfileBoxItem Invocations

+ * The user can launch the application via profile box items (see {@link blackberry.bbm.platform.self.profilebox}). + * This callback will be invoked with the reason "profilebox" and a + * {@link blackberry.bbm.platform.self.profilebox.ProfileBoxItem} param -- the profile box item + * which was clicked. + * @param {String} reason The reason that the application was invoked. If "profilebox" then + * param is a {@link blackberry.bbm.platform.self.profilebox.ProfileBoxItem}. + * @param {blackberry.bbm.platform.self.profilebox.ProfileBoxItem} param The parameter associated with reason. + * @example + * <script type="text/javascript"> + * + * // Trigger an action in the application when a profile box item is selected + * blackberry.bbm.platform.onappinvoked = function(reason, param) { + * if(reason == "profilebox") { + * var boxItem = param; + * // Take action based on profile box item... + * } + * }; + * + * </script> + * @event + * @BB50+ + */ + onappinvoked : function(reason, param) { + }, + + /** + * The application environment. + * + * @type String + * @readOnly + * @BB50+ + */ + environment : "" +}; diff --git a/api/blackberry_bbm_platform_io.js b/api/blackberry_bbm_platform_io.js new file mode 100644 index 0000000000..cba8e6f7e6 --- /dev/null +++ b/api/blackberry_bbm_platform_io.js @@ -0,0 +1,262 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @toc {BBM} Connections + * @featureID blackberry.bbm.platform + * @namespace Provides services to create, accept, and manage connections. + *

Connections

+ *

Connection types

+ * The BBM Platform supports the following types of connections: + *
{@link blackberry.bbm.platform.io.Channel} + *
{@link blackberry.bbm.platform.io.Session} + * + *

Creating a connections

+ *

Connections can be created using {@link blackberry.bbm.platform.io.createConnection}. + * When a connection is created, the application should assign callbacks to it in order to be notified + * of various events.

+ * + *
+ * var type = ... // One of "channel" or "session"
+ * var conn = blackberry.bbm.platform.io.createConnection(type);
+ * setConnectionCallbacks(conn, type);
+ * 
+ * + *

Accepting incoming connections

+ * When the current user accepts an invitation within BBM, {@link blackberry.bbm.platform.io.event:onconnectionaccepted} + * will be invoked with the connection on which the invitation was accepted. The application should + * assign callbacks to the connection within this method. + *
+ * var conn;
+ * 
+ * blackberry.bbm.platform.io.onconnectionaccepted = function(type, connection, cookie) {
+ *     // Save the connection and set the callbacks
+ *     conn = connection;
+ *     setConnectionCallbacks(conn, type);
+ * };
+ * 
+ * + *

Connection events

+ * A generic function can be used to assign callbacks to connections. + *
+ * function setConnectionCallbacks(conn, type) {
+ *     // Channel/Session callbacks
+ *     conn.onusersinvited = function(users) {
+ *         // ...
+ *     };
+ *     conn.onusersjoined = function(users, type, cookie) {
+ *         // ...
+ *     };
+ *     conn.onuserdeclined = function(user) {
+ *         // ...
+ *     };
+ *     conn.onuserleft = function(user) {
+ *         // ...
+ *     };
+ *     conn.ondata = function(user, data) {
+ *         // ...
+ *     };
+ *     
+ *     // Session callbacks
+ *     if(type == "session") {
+ *         conn.onbroadcastdata = function(user, data) {
+ *             // ...
+ *         };
+ *         conn.onusersremoved = function(user, users) {
+ *             // ...
+ *         };
+ *         conn.onended = function(user) {
+ *             // ...
+ *         };
+ *     }
+ * };
+ * 
+ * + *

Adding Users to Connections

+ *

There are two ways to add users to connections: (1) inviting contacts to join a connection, and + * (2) hosting a connection for non-contacts to join. A user does not have to be the connection + * creator in order to invite users. + * + *

1. Inviting contacts to join

+ *

An application user can invite contacts to join a connection.

+ *

When the application calls {@link blackberry.bbm.platform.io.Connection#inviteContacts} a Contact Picker dialog will be shown containing contacts that have the application installed. + * If the user invites contacts then the {@link blackberry.bbm.platform.io.Connection#event:onusersinvited} callback will be invoked on the inviter's side.

+ *

Invitees receive the invitations within BBM.

+ * + *
{@image /images/bbm/invite_to_join.png}
+ * + *

2. Hosting a public connection for non-contacts to join

+ *

An application user can also host an event within a public connection to let all application users join.

+ *

When the application calls {@link blackberry.bbm.platform.io.host} a dialog will be shown for the user to allow or deny the decision. If the user allows, the application should then post the host's PIN and PPID to its discovery service. The BBM platform does not provide a discovery service. This must be provided by the application developer. + *

Peers should download host information (PIN and PPID) from the discovery service and then call {@link blackberry.bbm.platform.io.joinHost}. The peer will also be presented with a dialog to allow or deny the decision. + *

At this point the request is in the "pending" state. In this state the peer can {@link blackberry.bbm.platform.io.OutgoingJoinRequest#cancel} the request, and the host can {@link blackberry.bbm.platform.io.IncomingJoinRequest#accept} or {@link blackberry.bbm.platform.io.IncomingJoinRequest#decline}.

+ *
{@image /images/bbm/hosting.png}
+ *

+ * @BB50+ + */ +blackberry.bbm.platform.io = { + + /** + * @description Creates a connection. + *

The application should assign callbacks to the connection after creating it.

+ * @param {String} type The type of connection to create: "channel" or "session". + * @returns {blackberry.bbm.platform.io.Channel|blackberry.bbm.platform.io.Session} The connection created. + * @BB50+ + */ + createConnection: function(type) { + }, + + /** + * Invoked when an incoming connection is accepted. There are two cases when this may happen: + * + *

This callback is required when using either invitation framework. It must be assigned before the call to {@link blackberry.bbm.platform.register}. + *

The application should assign callbacks to the connection in this method.

+ * @param {String} connectionType The type of connection: "channel" or "session". + * @param {blackberry.bbm.platform.io.Channel|blackberry.bbm.platform.io.Session} connection The connection. + * @param {String} cookie The cookie sent with the invitation. May be null. + * @event + * @BB50+ + */ + onconnectionaccepted: function(connectionType, connection, cookie) { + }, + + //////////////////////////////////// + // Non-BBM Contact Invite Support // + //////////////////////////////////// + + /** + * @description Sends a join request to a user hosting a public connection for others to join. + *

The host does not need to be a contact of the current user. + *

Reasons why a request is declined

+ * + * @param {String} hostPIN The host PIN. Can be obtained by blackberry.identity.PIN + * @param {String} hostPPID The host PPID. Can be obtained by blackberry.bbm.platform.self.ppid. + * @callback {Function} onComplete Invoked when the user finishes approving the join request. + * @callback {blackberry.bbm.platform.io.BBMPlatformOutgoingJoinRequest} onComplete.request The + * request sent to the host; undefined if the user aborted the join request. + * @callback {Function} onHostAccepted Invoked when the join request is accepted by the host. + * @callback {blackberry.bbm.platform.io.BBMPlatformOutgoingJoinRequest} onHostAccepted.request The accepted request. + * @callback {String} onHostAccepted.cookie The cookie sent when the host accepted the join request in {@link blackberry.bbm.platform.io.IncomingJoinRequest#accept}. undefined + * if no cookie was provided. + * @callback {Function} onHostDeclined Invoked when the join request is declined by the host. + * @callback {blackberry.bbm.platform.io.BBMPlatformOutgoingJoinRequest} onHostDeclined.request The declined request. + * @callback {String} onHostDeclined.reason The reason that the request was declined. + * @param {String} [cookie] A custom parameter provided by the application. + * e.g. Their current game level. Max length of 128 characters. + * @throws {IllegalStateException} If the current user has connected with the host in a connection + * but still attempts to send another join request to the host. + * @throws {IllegalArgumentException} If hostPIN is invalid. + * @throws {IllegalArgumentException} If hostPPID is invalid. + * @throws {IllegalArgumentException} If cookie is longer than 128 characters. + * @BB50+ + */ + joinHost: function(pin, ppid, onComplete, onHostAccepted, onHostDeclined, cookie) { }, + + /** + * Requests that the current user (peer) has sent to hosts using {@link blackberry.bbm.platform.io.joinHost}. + *

Requests in this list are in the pending state. New requests will be added to this list + * automatically. Requests that are accepted, denied, or canceled will be removed from this + * list automatically. + *

The user can cancel a request using {@link blackberry.bbm.platform.io.OutgoingJoinRequest#cancel}. + * @type blackberry.bbm.platform.io.OutgoingJoinRequest[] + * @readOnly + * @BB50+ + */ + joinHostRequests: [], + + /** + * Enables hosting on this connection. The user will be prompted with a dialog to allow or deny hosting. + *

To stop hosting, call blackberry.bbm.platform.io.host(). Stopping hosting will not + * remove users from the connection who have already joined, it will only disallow others from joining. + * {@link blackberry.bbm.platform.io.hostRequests} will be emptied.

+ *

The user may only host on one connection in the application. If this application is already + * hosting a public connection and this method is invoked on a different connection, then hosting + * will stop on the old connection and begin on the new one. The user will again be prompted with + * a dialog to allow or deny hosting.

+ *

Reasons why a request is canceled

+ * + * @param {blackberry.bbm.platform.io.Connection} connection The connection on which to host. + * @callback {Function} onComplete Invoked when the user finishes approving/denying hosting. + * @callback {Boolean} onComplete.hosting true if the user decided to start hosting; + * false otherwise. + * @callback {Function} onRequestReceived Invoked when the host receives a join request from a peer. + * @callback {blackberry.bbm.platform.io.IncomingJoinRequest} onRequestReceived.request The received request. + * @callback {Function} onRequestCanceled Invoked when a peer cancels a join request. + * @callback {blackberry.bbm.platform.io.IncomingJoinRequest} onRequestCanceled.request The canceled request. + * @callback {String} onRequestCanceled.reason The reason that the request was canceled. + * @BB50+ + */ + host: function(connection, onComplete, onRequestReceived, onRequestCanceled) { + }, + + /** + * The connection being hosted. undefined if no connection is being hosted. + *

Use {@link blackberry.bbm.platform.io.host} to host an existing connection. + * @type blackberry.bbm.platform.io.Connection + * @readOnly + * @BB50+ + */ + hostedConnection: undefined, + + /** + * Requests that the current user (host) has received on {@link blackberry.bbm.platform.io.hostedConnection}. + *

Requests in this list are in the pending state. New requests will be added to this list + * automatically. Requests that are accepted, denied, or canceled will be removed from this + * list automatically. + *

The host can accept or decline a request using {@link blackberry.bbm.platform.io.IncomingJoinRequest#accept} + * and {@link blackberry.bbm.platform.io.IncomingJoinRequest#decline}. + * @type blackberry.bbm.platform.io.IncomingJoinRequest[] + * @readOnly + * @BB50+ + */ + hostRequests: [], + + ///////////////////////////////// + // CONTACT UNREACHABLE SUPPORT // + ///////////////////////////////// + + /** + * Invoked when a contact has become reachable after a ContactUnreachableException was thrown. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} user The user who has become reachable. + * @event + * @BB50+ + */ + onuserreachable: function(user) { }, + + /** + * Invoked when pending data for an unreachable user has expired. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} user The unreachable user. + * @param {String[]} data The data messages which expired. + * @event + * @BB50+ + */ + ondataexpired: function(user, data) { } +}; diff --git a/api/blackberry_bbm_platform_io_Channel.js b/api/blackberry_bbm_platform_io_Channel.js new file mode 100644 index 0000000000..33859b57d7 --- /dev/null +++ b/api/blackberry_bbm_platform_io_Channel.js @@ -0,0 +1,39 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @class A connection to communicate with one or more peers, where the peers are not aware of + * each other. Each peer can only communicate with the current user. + *

For example, a channel connection could be used when a user wants to have a private chat with + * a contact, or wants to send their location information to one or more contacts. + *

{@image /images/bbm/channel.png}

+ * In diagram above, the current user A has invited users B, C, and D to the channel. Once the users + * join, user A can send data to B, C, and D, but B, C, and D can only send data to A. + * @featureID blackberry.bbm.platform + * @extends blackberry.bbm.platform.io.Connection + * @BB50+ + */ +blackberry.bbm.platform.io.Channel = function() { + + /** + * Removes the current user from the connection, but leaves it active for all other participants. + *

{@link onUserLeft} will be called for all other users currently in the connection. + *

The connection will become inactive for the current user, and should not be used afterwards. + * @throws {IllegalStateException} if the current user has already left the connection. + * @BB50+ + */ + this.leave = function() { }; +}; diff --git a/api/blackberry_bbm_platform_io_Connection.js b/api/blackberry_bbm_platform_io_Connection.js new file mode 100644 index 0000000000..adc87d1772 --- /dev/null +++ b/api/blackberry_bbm_platform_io_Connection.js @@ -0,0 +1,300 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @class The base interface for all connections. See {@link blackberry.bbm.platform.io.Channel} and + * {@link blackberry.bbm.platform.io.Session} for more information on the respective connection types. + * @BB50+ + */ +blackberry.bbm.platform.io.Connection = function() { + + /** + * @description The maximum number of users a connection can have, not including the current user. + *

Once the limit is reached, the platform will not allow the user to send more join invitations + * and will not allow more users to join. + * @type Number + * @constant + * @default 24 users + * @BB50+ + */ + this.MAX_USERS = 0; + + /** + * @description The maximum length of an invitation cookie. + * @type Number + * @constant + * @default 128 characters + * @BB50+ + */ + this.MAX_COOKIE_LENGTH = 0; + + /** + * @description The maximum length of an invitation message. + * @type Number + * @constant + * @default 128 characters + * @BB50+ + */ + this.MAX_INVITE_MSG_LENGTH = 0; + + /** + * @description The maximum length of a data payload . + * @type Number + * @constant + * @default 61440 characters + * @BB50+ + */ + this.MAX_DATA_LENGTH = 0; + + /** + * @description This connection's unique ID. Automatically set on connection creation. + * @type Number + * @readOnly + * @BB50+ + */ + this.id = 0; + + /** + * @description Users who have joined the connection. + * @type blackberry.bbm.platform.users.BBMPlatformUser[] + * @readOnly + * @BB50+ + */ + this.joinedUsers = []; + + /** + * @description The number of invited users who have not yet joined the connection. + * @type Number + * @readOnly + * @BB50+ + */ + this.pendingUsersCount = 0; + + /** + * @description Removes a user from the connection. + * @param {blackberry.bbm.platform.users.BBMPlatformUser | blackberry.bbm.platform.users.BBMPlatformUser[]} + * user Single user, or array of users, to remove from the connection. + * @throws {NullPointerException} If user is null. + * @throws {IllegalArgumentException} If of of the users being removed does not belong to the connection. + * @throws {PersistentContentException} If Content Protection is enabled and device is locked. + * @example + * <script type="text/javascript"> + * + * // Remove the first user in a connection + * var users = conn.joinedUsers; + * if(users.length > 0) { + * conn.remove(conn.joinedUsers[0]) + * } + * + * </script> + * @example + * <script type="text/javascript"> + * + * // Remove all users in a connection + * var users = conn.joinedUsers; + * if(users.length > 0) { + * conn.remove(conn.joinedUsers) + * } + * + * </script> + * @BB50+ + */ + this.remove = function(user) { + }; + + /** + * @description Removes all users from the connection. + * @throws {PersistentContentException} If Content Protection is enabled and device is locked. + * @BB50+ + */ + this.removeAll = function() { + }; + + /** + * @description Adds a user, who has already joined a connection in this application, to this connection. + * @param {blackberry.bbm.platform.user.BBMPlatformUser} user The user to be added. + * @param {String} [cookie] A custom parameter provided by the third party application. + * @throws {NullPointerException} If user is null. + * @throws {IllegalArgumentException} If user is not connected with the current user in any existing connections in this application. + * @throws {PersistentContentException} If Content Protection is enabled and device is locked. + * @BB50+ + */ + this.add = function(user, cookie) { + }; + + /** + * @description Sends data to all users on the connection or a subset. Data cannot be sent to users + * who have not joined. + * @param {String} data Object to be sent. + * @param {blackberry.bbm.platform.users.BBMPlatformUser[]} [users] Data recipients. + * If not provided, data will be sent to all users on this connection. + * @throws {ContactUnreachableException} If a user is unreachable, up to 50 packets will be queued. This will be thrown on the 51st call. + * @throws {DataOverflowException} If the rate of data sent by the application exceeds that which the BBM Platform allows. + * @throws {NullPointerException} If data is null or empty. + * @throws {IllegalArgumentException} If data.length is larger than {@link blackberry.bbm.platform.io.Connection.MAX_DATA_LENGTH}. + * @throws {IllegalArgumentException} If users contains a user who has not joined this connection. + * @throws {IllegalArgumentException} If users.length > 24. + * @throws {PersistentContentException} If Content Protection is enabled and device is locked. + * + * @example + * <script type="text/javascript"> + * + * // Send message to all users + * var replyText = ""; // Obtain reply text from user... + * var msgObj = { + * id:'msg', + * value:replyText + * }; + * try { + * connnection1.send(JSON.stringify(msgObj)); + * } catch(e) { + * // Error occurred while sending data + * } + * + * </script> + * + * @example + * <script type="text/javascript"> + * + * // Ping all users + * var pingObj = { id:'ping' }; + * try { + * connection1.send(JSON.stringify(pingObj)); + * } catch(e) { + * // Error occurred while sending data + * } + * + * </script> + * + * @example + * <script type="text/javascript"> + * + * // Send high score to all users + * var highScoreObj = { + * id: 'highscore', + * score: 9000, + * hits: 130, + * misses: 40 + * }; + * try { + * connection1.send(JSON.stringify(highScoreObj)); + * } catch(e) { + * // Error occurred while sending data + * } + * + * </script> + * @BB50+ + */ + this.send = function(data, users) { + }; + + /** + * @description Allows the user to invite contacts to join this connection. + *

A Contact Picker dialog will appear allowing the user to select contacts to invite. Only + * contacts with the application will be shown in the Contact Picker. + * @param {String} inviteMessage Message shown to user in invitation. + * @param {Object} [options] Options. + * @param {Number} [options.expiryTime] Delay until the invitation expires (ms). If not provided + * or <= 0, then invitation will never expire. + * @param {String} [options.cookie] A custom parameter provided by the third party application. + * e.g. The current game level. Max length of 128 characters. + * @param {blackberry.bbm.platform.users.BBMPlatformUser[]} [options.contacts] The contacts that + * will be shown. + * @throws {IllegalStateException} If the connection is full. + * @throws {IllegalStateException} If the connection is inactive, which can happen if the user + * ends or leaves the connection. + * @BB50+ + */ + this.inviteContacts = function(inviteMessage, options) { + }; + + ////////////////////// + // LISTENER METHODS // + ////////////////////// + + /** + * Invoked when data is received from a user. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} sender User that sent the data. + * @param {String} data Data received. + * @event + * @example + * <script type="text/javascript"> + * + * connection1.ondata = function(user, data) { + * var dataObj = JSON.parse(data); + * var dataID = dataObj.id; + * + * // Handle application-defined data types + * if(dataID == "msg") { + * // Handle msg type + * } else if(dataID == "ping") { + * // Handle ping type + * } else if(dataID == "highscore") { + * // Handle highscore type + * } + * }; + * + * </script> + * @BB50+ + */ + this.ondata = function(sender, data) { + }; + + /** + * Invoked when the user invites others to join the connection. This will not be + * called if the user invites others to download the application. + * @param {blackberry.bbm.platform.io.BBMPlatformUser} users the users who were invited + * @event + * @BB50+ + */ + this.onusersinvited = function(users) { + }; + + /** + * Invoked when a user declines an invitation. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} user User who declined. + * @event + * @BB50+ + */ + this.onuserdeclined = function(user) { + }; + + /** + * Invoked when users join the connection by accepting an invitation. + * @param {blackberry.bbm.platform.users.BBMPlatformUser[]} users The users who joined. + * @param {String} type The type of join. + *

+ * @param {String} cookie The cookie that was sent with the invitation. undefined + * if no cookie was sent. + * @event + * @BB50+ + */ + this.onusersjoined = function(users, type, cookie) { + }; + + /** + * Invoked when a user leaves the connection. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} user User who left. + * @event + * @BB50+ + */ + this.onuserleft = function(user) { + }; +}; diff --git a/api/blackberry_bbm_platform_io_IncomingJoinRequest.js b/api/blackberry_bbm_platform_io_IncomingJoinRequest.js new file mode 100644 index 0000000000..4aae476d97 --- /dev/null +++ b/api/blackberry_bbm_platform_io_IncomingJoinRequest.js @@ -0,0 +1,58 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @class A request to join received on the host's side. + * @extends blackberry.bbm.platform.io.JoinRequest + * @BB50+ + */ +blackberry.bbm.platform.io.IncomingJoinRequest = function() { + + /** + * The cookie specified by the requesting peer. undefined if no cookie was specified. + * @type String + * @BB50+ + */ + this.cookie = undefined; + + /** + * The user who is requesting to join. + * @type blackberry.bbm.platform.users.BBMPlatformUser + * @BB50+ + */ + this.peer = undefined; + + /** + * Accepts the join request from a peer. This can be called from the host's side. + *

onHostAccepted supplied to {@link blackberry.bbm.platform.io.joinHost} will + * be invoked on the peer's side. + * @param {String} [cookie] A custom parameter provided by the third party application. This + * parameter will be sent to the joining peer. + * @throws {IllegalArgumentException} If cookie is longer than 128 characters. + * @BB50+ + */ + this.accept = function(cookie) { }; + + /** + * Declines the join request from a peer. This can be called from the host's side. + *

onHostDeclined supplied to {@link blackberry.bbm.platform.io.joinHost} will + * be invoked on the peer's + * side, with the reason "declinedbyhost". + * @BB50+ + */ + this.decline = function() { }; +}; diff --git a/api/blackberry_bbm_platform_io_JoinRequest.js b/api/blackberry_bbm_platform_io_JoinRequest.js new file mode 100644 index 0000000000..190cf33b2d --- /dev/null +++ b/api/blackberry_bbm_platform_io_JoinRequest.js @@ -0,0 +1,43 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @class Provides basic request functionality including a request ID and status. + * @BB50+ + */ +blackberry.bbm.platform.io.JoinRequest = function() { + /** + * @description The unique ID. + * @type Number + * @BB50+ + */ + this.id = 0; + + /** + * @description The status. + *

+ * @type String + * @BB50+ + */ + this.status = ""; + +}; diff --git a/api/blackberry_bbm_platform_io_OutgoingJoinRequest.js b/api/blackberry_bbm_platform_io_OutgoingJoinRequest.js new file mode 100644 index 0000000000..dc9af3881e --- /dev/null +++ b/api/blackberry_bbm_platform_io_OutgoingJoinRequest.js @@ -0,0 +1,39 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @class A request to join sent from the peer's side. + * @extends blackberry.bbm.platform.io.JoinRequest + * @BB50+ + */ +blackberry.bbm.platform.io.OutgoingJoinRequest = function() { + + /** + * The host to whom the request is sent. + * @type blackberry.bbm.platform.users.BBMPlatformUser + * @BB50+ + */ + this.host = undefined; + + /** + * Cancels the request. The request can only be canceled if its status == "pending"; otherwise, this will do nothing. + *

onRequestCanceled supplied to {@link blackberry.bbm.platform.io.host} will be invoked on the host's side. + * @BB50+ + */ + this.cancel = function() { }; + +}; diff --git a/api/blackberry_bbm_platform_io_Session.js b/api/blackberry_bbm_platform_io_Session.js new file mode 100644 index 0000000000..b92efa75fa --- /dev/null +++ b/api/blackberry_bbm_platform_io_Session.js @@ -0,0 +1,99 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @class A connection to communicate with one or more peers, where the peers are aware of each other. + *

Peers may in turn invite other users, who are also visible to everyone in the session, whether or not they are contacts of the session originator.

+ *

For example, a session connection could be used for a multi-player game application such as a poker game. When all the users in the session want to see the poker table, and game data is sent to each player in the game as it occurs.

+ * User A invites user B, and user B joins the session + *

{@image /images/bbm/session_invite1.png}

+ * User B invites user C, and user C joins the session + *

{@image /images/bbm/session_invite2.png}

+ * User C invites user D, and user D joins the session + *

{@image /images/bbm/session_invite3.png}

+ * Once a user has joined they can send data to anyone in the session. + * @featureID blackberry.bbm.platform + * @extends blackberry.bbm.platform.io.Connection + * @BB50+ + */ +blackberry.bbm.platform.io.Session = function() { + + ///////////////////// + // Session methods // + ///////////////////// + + /** + * Ends the connection for all participants. + *

All participants will be removed from {@link joinedUsers}. All pending invitations will be + * removed and {@link pendingUsers} will be set to 0. + *

{@link blackberry.bbm.platform.io.Session#event:onended} will be called for all users currently in the connection. + *

The connection will become inactive for the current user, and should not be used afterwards. + * @throws {IllegalStateException} if the current user has already ended the connection. + * @BB50+ + */ + this.end = function() { }; + + /** + * Removes the current user from the connection, but leaves it active for all other participants. + *

{@link onUserLeft} will be called for all other users currently in the connection. + *

The connection will become inactive for the current user, and should not be used afterwards. + * @throws {IllegalStateException} if the current user has already left the connection. + * @BB50+ + */ + this.leave = function() { }; + + /** + * Sends data to all users. + * @throws {ContactUnreachableException} If a user is unreachable, up to 50 packets will be queued. This will be thrown on the 51st call. + * @throws {DataOverflowException} If the rate of data sent by the application exceeds that which the BBM Platform allows. + * @throws {NullPointerException} If data is null or empty. + * @throws {IllegalArgumentException} If data.length is larger than {@link blackberry.bbm.platform.io.Connection.MAX_DATA_LENGTH}. + * @throws {PersistentContentException} If Content Protection is enabled and device is locked. + * @param {String} data Object to be sent. + * @BB50+ + */ + this.broadcast = function(data) { }; + + ///////////////////////////// + // SessionListener methods // + ///////////////////////////// + + /** + * Invoked when broadcast data is received from a user. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} sender User that sent the data. + * @param {String} data Data received. + * @event + * @BB50+ + */ + this.onbroadcastdata = function(sender, data) { }; + + /** + * Invoked when users are removed. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} remover The user who removed users. + * @param {blackberry.bbm.platform.users.BBMPlatformUser[]}users The removed users. + * @event + * @BB50+ + */ + this.onusersremoved = function(remover, users) { }; + + /** + * Invoked when the connection is ended by another user. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} user The user who ended the connection. + * @event + * @BB50+ + */ + this.onended = function(user) { }; +}; diff --git a/api/blackberry_bbm_platform_self.js b/api/blackberry_bbm_platform_self.js new file mode 100644 index 0000000000..efe0f67c00 --- /dev/null +++ b/api/blackberry_bbm_platform_self.js @@ -0,0 +1,92 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @toc {BBM} Current User + * @featureID blackberry.bbm.platform + * @namespace Provides access to the current user's information. + * @base blackberry.bbm.platform.users.BBMPlatformUser + * @BB50+ + */ +blackberry.bbm.platform.self = { + + prototype: new blackberry.bbm.platform.users.BBMPlatformUser(), + + /** + * @description Sets the user's display picture from a URI. A dialog will be presented to + * the user to allow or deny the change. + *

The URI must be fully qualified. Non-local URIs must be whitelisted in the application's configuration file. Examples: + *

+ *

+ * @param {String} displayPictureURI The fully qualified URI. + * @callback {Function} onComplete Invoked when the user has dismissed the dialog. + * @callback {Boolean} onComplete.accepted true if the user allowed the change; + * false otherwise. + * @BB50+ + * @example + * <script type="text/javascript"> + * // Set the user's display picture + * blackberry.bbm.platform.self.setDisplayPicture("local:///smiley.jpg", function(accepted) { + * if(accepted) { + * // User allowed the change + * } else { + * // User denied the change + * } + * }); + * </script> + */ + setDisplayPicture: function(displayPictureURI, onComplete) { }, + + /** + * @description Sets the user's personal message. A dialog will be presented to the user to + * allow or deny the change. + * @param {String} personalMessage The personal message. The maximum length is 64 characters; + * anything over will be truncated. If null is provided then the personal message + * will be cleared. + * @callback {Function} onComplete Invoked when the user has dismissed the dialog. + * @callback {Boolean} onComplete.accepted true if the user allowed the change; + * false otherwise. + * @BB50+ + */ + setPersonalMessage: function(personalMessage, onComplete) { }, + + /** + * @description Sets the user's status. A dialog will be presented to the user to allow + * or deny the change. + * @param {String} status The status: one of "available" or "busy". + * @param {String} [message] The optional status message. If not provided then the default message of + * either "Available" or "Busy" will be used. + * @callback {Function} onComplete Invoked when the user has dismissed the dialog. + * @callback {Boolean} onComplete.accepted true if the user allowed the change; + * false otherwise. + * @BB50+ + * @example + * <script type="text/javascript"> + * // Set the user's status and status message + * blackberry.bbm.platform.self.setStatus("busy", "Playing Tic-Tac-Toe!", function(accepted) { + * if(accepted) { + * // User allowed the change + * } else { + * // User denied the change + * } + * }); + * </script> + */ + setStatus: function(status, message, onComplete) { } +}; diff --git a/api/blackberry_bbm_platform_self_location.js b/api/blackberry_bbm_platform_self_location.js new file mode 100644 index 0000000000..62d4293bd4 --- /dev/null +++ b/api/blackberry_bbm_platform_self_location.js @@ -0,0 +1,58 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @namespace Provides access to the current user's location information. + *

This namespace is undefined if the user has disabled this feature on their profile. + * @BB50+ + * @example + * <script type="text/javascript"> + * var location = blackberry.bbm.platform.self.location; + * if(location) { + * var flag = location.flag; + * var countryCode = location.countryCode; + * var timezoneOffset = location.timezoneOffset; + * // Do something with location info + * } else { + * // Location is not enabled by user + * } + * </script> + */ +blackberry.bbm.platform.self.location = { + + /** + * @description The timezone offset in minutes. Equal to + * (new Date()).getTimezoneOffset() for the same time zone. + * @type Number + * @BB50+ + */ + timezoneOffset: 0, + + /** + * @description The country flag image, encoded as a base64 image string. + * @type String + * @BB50+ + */ + flag: { }, + + /** + * @description The country code. + * @type String + * @BB50+ + */ + countryCode: { } +}; diff --git a/api/blackberry_bbm_platform_self_profilebox.js b/api/blackberry_bbm_platform_self_profilebox.js new file mode 100644 index 0000000000..b2f972f146 --- /dev/null +++ b/api/blackberry_bbm_platform_self_profilebox.js @@ -0,0 +1,122 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @toc {BBM} Profile Box + * @featureID blackberry.bbm.platform + * @namespace Provides access to the current user's profile box. + *

A box for this application that appears in the current user's profile. Each box contains a + * list of items, each composed of text and an optional icon. There is a maximum of 3 items; as + * more are added, older items will be removed automatically.

+ * + *

This box can be viewed by the current user and their contacts, and is editable by the current + * user and the owning application (on this device). The current user can only remove items.

+ * + *

Icon recommendations

+ * + * + *

Launching your application from the profile box

+ *

The user can invoke an application through its profile box items in their profile or a + * contact's profile. The application will be brought to the foreground and/or launched if not yet + * running. The invoking profile box item can be obtained by assigning a callback to + * {@link blackberry.bbm.platform.event:onappinvoked}. + * + * @example + * <script type="text/javascript"> + * // Trigger an action in the application when a profile box item is selected + * blackberry.bbm.platform.onAppInvoked = function(reason, param) { + * if(reason == "profilebox") { + * var boxItem = param; + * var achievementID = boxItem.cookie; + * // Take action based on profile box item... + * } + * }; + * </script> + * @BB50+ + */ +blackberry.bbm.platform.self.profilebox = { + + /** + * true if the profile box is accessible and can be updated; false otherwise. + * The profile box is not accessible when the device is in mass storage mode. + * @type Boolean + * @readOnly + * @BB50+ + */ + accessible : false, + + /** + * The profile box items. undefined if the device is in mass storage mode. + * @type blackberry.bbm.platform.self.profilebox.ProfileBoxItem[] + * @readOnly + * @BB50+ + */ + items : null, + + /** + * Adds an item to the top of the user's profile box. + *

Icons are optional and are provided via fully-qualified URI. Non-local URIs must be whitelisted in the application's configuration file. Examples: + *

+ * @param {Object} options The options. + * @param {String} options.text The text of the item. + * @param {Number} [options.icon] Optional The URI of the icon to use. If not provided + * then no icon will be used. + * @param {String} [options.cookie] Optional The customizable cookie. + * @returns {blackberry.bbm.platform.self.profilebox.ProfileBoxItem} the new item. + * @throws {UserProfileBoxAccessException} If the profile box is inaccessible. + * @example + * <script type="text/javascript"> + * // Add an item with icon, text, and a cookie + * var options = {text:"Planted an apple orchard on 10 acres!", icon:"local:///smiley.jpg", cookie:"10acres"}; + * blackberry.bbm.platform.self.profilebox.addItem(options); + * </script> + * + * @example + * <script type="text/javascript"> + * // Add an item with text + * var options = {text:"Bought a 100 acre farm!"}; + * blackberry.bbm.platform.self.profilebox.addItem(options); + * </script> + * @BB50+ + */ + addItem : function(options) { + }, + + /** + * Removes an item. + * @param {blackberry.bbm.platform.self.profilebox.ProfileBoxItem} item The item to remove. + * @throws {UserProfileBoxAccessException} If the profile box is inaccessible. + * @BB50+ + */ + removeItem: function(item) { + }, + + /** + * Removes all items. + * @throws {UserProfileBoxAccessException} If the profile box is inaccessible. + * @BB50+ + */ + clearItems: function() { + } +}; diff --git a/api/blackberry_bbm_platform_self_profilebox_ProfileBoxItem.js b/api/blackberry_bbm_platform_self_profilebox_ProfileBoxItem.js new file mode 100644 index 0000000000..8b0f544e1a --- /dev/null +++ b/api/blackberry_bbm_platform_self_profilebox_ProfileBoxItem.js @@ -0,0 +1,54 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @class A profile box item. Consists of text and possibly an icon. + * @BB50+ + */ +blackberry.bbm.platform.self.profilebox.ProfileBoxItem = function() { + /** + * The item ID. + * @type Number + * @readOnly + * @BB50+ + */ + this.id = 0; + + /** + * The item icon as a base64 encoded image string. This is undefined if the item has no icon. + * @type String + * @readOnly + * @BB50+ + */ + this.icon = 0; + + /** + * The item text. + * @type String + * @readOnly + * @BB50+ + */ + this.text = ""; + + /** + * The customizable cookie. This is undefined if this item has no cookie. + * @type String + * @readOnly + * @BB50+ + */ + this.cookie = ""; +}; diff --git a/api/blackberry_bbm_platform_users.js b/api/blackberry_bbm_platform_users.js new file mode 100644 index 0000000000..c008bf2dce --- /dev/null +++ b/api/blackberry_bbm_platform_users.js @@ -0,0 +1,307 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @toc {BBM} Other Users + * @featureID blackberry.bbm.platform + * @namespace Provides access to and interaction with other users. For the current user see + * {@link blackberry.bbm.platform.self}. + * + *

Picking Users

+ *

The application can display a Contact Picker to the user with {@link blackberry.bbm.platform.users.pickUsers}. + * This is generally part of a larger use case. For example, pickUsers() might be used + * so that the current user can select players to remove from a connection. + * + *

The Contact Picker will be displayed for all methods in this namespace. The Contact Picker can be + * avoided in {@link blackberry.bbm.platform.users.sendFile} and {@link blackberry.bbm.platform.users.startBBMChat} + * by providing a {@link blackberry.bbm.platform.users.BBMPlatformUser} in the method call. + * + *

File Transfer, Invite to Download, and Starting a BBM Chat

+ *

The current user can send files, start a chat in BBM, and invite others to download the + * application using the following methods: + *

+ *

+ * + *

Inviting users to BBM contact list

+ *

Inviting users to the current user's contact list is also supported. You can invite anonymous + * users by PIN using {@link blackberry.bbm.platform.users.inviteToBBM}. Alternatively you can invite + * users from open connection(s) using {@link blackberry.bbm.platform.users.inviteToBBMFromConnections}. + * + *

BBM Social Graph

+ *

Applications can also obtain access to the user's social graph. + * {@link blackberry.bbm.platform.users.contactsWithApp} is a complete list of the current user's BBM + * contacts who have the application installed. + * + *

Applications can also listen for changes in the social graph by assigning a callback to + * {@link blackberry.bbm.platform.users.event:onupdate}. Events are fired for both the current user + * and their contacts who have the application installed. You can listen for user profile property + * changes, such as display name and display picture, and also when a user installs/uninstalls your + * application. + * @BB50+ + */ +blackberry.bbm.platform.users = { + + /** + * @description Contacts who have the application installed. + * @type blackberry.bbm.platform.users.BBMPlatformUser[] + * @readOnly + * @BB50+ + */ + contactsWithApp : [], + + /** + * @description Shows Contact Picker dialog allowing the user to select users. + * @param {Object} options Object containing Contact Picker options. + * @param {String} [options.title] Title of the Contact Picker dialog. + * @param {String} [options.type] Type of users to include in the dialog. May be "contactswithapp". + * @param {blackberry.bbm.platform.users.BBMPlatformUser[]} [options.users] Users shown in the + * dialog. + * @param {Boolean} [options.multiSelect=false] true to allow the user to select + * multiple users; false to only allow 1. + * @param {Boolean} [options.showSelectAll=false] true to show Select All option; + * false otherwise. Ignored if options.multiSelect == false. + * @callback {Function} onComplete Function called when user is finished. + * @callback {blackberry.bbm.platform.users.BBMPlatformUser[]} onComplete.users The picked + * users. users.length == 0 if no users were selected. + * @example + * <script type="text/javascript"> + * + * blackberry.bbm.platform.users.pickUsers( { + * title : "Who would you like to chat with?", + * type : "contactswithapp" + * }, function(users) { + * if (users.length == 0) { + * // No users picked + * } else { + * // One or more users picked + * } + * }); + * + * </script> + * @BB50+ + */ + pickUsers : function(options, onComplete) { + }, + + /** + * @description Starts a chat within BBM, bringing the chat screen to the foreground and entering + * a message in the reply field. + *

If users is provided, the chat screen is opened immediately; otherwise a Contact + * Picker dialog is displayed beforehand. + *

Chats can be started with any contact. + * @param {Function} onComplete Invoked when the chat has been started or canceled. + * @param {String} message The initial message in the reply field of the chat screen. + * @param {blackberry.bbm.platform.users.BBMPlatformUser[]} [users] The users with whom to chat. + * Must not contain {@link blackberry.bbm.platform.self}. + * @example + * <script type="text/javascript"> + * + * // Start chat with Contact Picker dialog + * blackberry.bbm.platform.users.startBBMChat(function() { + * // Continue with application... + * }, "Did you see the game?"); + * + * </script> + * @BB50+ + */ + startBBMChat: function(onComplete, message, users) { + }, + + /** + * @description Sends a file to a contact. The user will be prompted to edit the comment and + * choose to send or cancel the file transfer. + *

If contact is not provided then the Contact Picker dialog be shown first, + * allowing the user to pick someone in their contact list whom to send the file. Otherwise, + * the Contact Picker dialog will not be shown.

+ *

Files can be sent to any contact. + *

If the contact cannot receive the specific file type, the file will not be sent.

+ *

The application is notified of any errors that occur through the onFailure(reason) + * callback. The reasons are:

+ * + * @param {String} fileURI The fully qualified path of the file to send. + * @param {String} comment The default comment on the file. The user may edit this comment before sending. + * @callback {Function} onFailure Invoked if the file transfer fails. + * @callback {String} onFailure.reason The reason why the transfer failed. + * @param {blackberry.bbm.platform.users.BBMPlatformUser} [contact] The recipient of the file. The recipient + * must be in the current user's contact list. + * @example + * <script type="text/javascript"> + * + * var onFailure = function(reason) { + * var message = getFileFailureString(reason); + * if(message) { + * alert(message); + * } + * }; + * blackberry.bbm.platform.users.sendFile("file:///SDCard/smiley.jpg", "Check out this file.", onFailure); + * + * function getFileFailureString(reason) { + * if(reason == "filenotfound") { + * return "The file does not exist."; + * } else if(reason == "filetoolarge") { + * return "The file is too large."; + * } else if(reason == "fileforwardlocked") { + * return "The file is DRM protected."; + * } else if(reason == "filebadtype") { + * return "The user is unable to receive files of this type."; + * } else if(reason == "fileempty") { + * return "The file is empty and cannot be sent."; + * } else if(reason == "usercanceled") { + * return "You canceled the file transfer."; + * } else if(reason == "noncontact") { + * return "You may only send files to your BBM contacts."; + * } + * }; + * + * </script> + * @BB50+ + */ + sendFile : function(fileURI, comment, onFailure, contact) { + }, + + /** + * Invoked when a user's information is updated. Assign a function to receive user updates. + *

User updates can be captured such as profile information and application installation changes. + * Updates can be received from the current user, contacts who have the application, and non-contacts + * who have joined in an application connection with the current user.

+ * + * @param {blackberry.bbm.platform.users.BBMPlatformUser} user The user whose information updated. + * @param {String} event The type of update. + * @example + * <script type="text/javascript"> + * + * blackberry.bbm.platform.users.onupdate = function(user, event) { + * // Handle events for the current user + * if(user.handle == blackberry.platform.self.handle) { + * if (event == "displaypicture") { + * var displayPicImg = document.getElementById("myPicture"); // Must have img element with id="myPicture" + * displayPicImg.src = user.displayPicture; + * } + * // Handle other events for the current user... + * } + * // Handle events for other users... + * }; + * + * </script> + * @event + * @BB50+ + */ + onupdate : function(user, event) { + }, + + /** + * @description Allows the user to invite contacts to download the application. A Contact Picker + * dialog will appear allowing the user to select contacts to invite. + *

Only contacts without the application can be invited to download. + * @callback {Function} onComplete Invoked when the user is complete. + * @callback {String} onComplete.result "limitreached" if the download invitation limit has been reached;undefined otherwise. A + * maximum of 10 download invitations per minute is allowed. + * @example + * blackberry.bbm.platform.users.inviteToDownload(function(result) { + * if(result == "limitreached") { + * // Download invitation limit reached + * } else { + * // User is finished inviting + * } + * }); + * @BB50+ + */ + inviteToDownload : function(onComplete) { + }, + + /** + * Allows the user to invite users to their BBM contact list. A dialog will appear allowing the + * user to select users to invite. Users already in the current user's contact list will not be + * included in the dialog. + * @param {Function} onComplete Invoked when the user has finished selecting contacts to invite. + * @param {Object[]} invitations The pin-name pairs of the users to invite to BBM. + * @throws {IllegalArgumentException} If PIN is invalid for any invitation. + * @throws {IllegalArgumentException} If name is null or empty for any invitation. + * @throws {IllegalArgumentException} If invitations.length > 24. + * @example + * <script type="text/javascript"> + * + * // Invite to BBM by PIN + * var onComplete = function() { + * // Continue... + * } + * var users = blackberry.bbm.platform.users; + * var invitations = [ + * { pin:"2100000A", name:"John Doe" }, + * { pin:"2100000B", name:"Jane Doe" } + * ]; + * blackberry.bbm.platform.users.inviteToBBM(onComplete, invitations); + * + * </script> + * @BB50+ + */ + inviteToBBM: function(onComplete, invitations) { + }, + + /** + * Allows the user to invite users to their BBM contact list. A dialog will appear allowing the + * user to select users to invite. Users already in the current user's contact list will not be + * included in the dialog. + *

Users from connection (who are not in the user's contact list) will be shown + * in the dialog. + *

If connection is not provided, then users from all connections the application + * has open (who are not in the user's contact list) will be shown in the dialog. + * @param {Function} onComplete Invoked when the user has finished selecting contacts to invite. + * @param {blackberry.bbm.platform.io.Connection} [connection] The connection to invite users from. + * @example + * <script type="text/javascript"> + * + * // Invite to BBM from a specific connection + * blackberry.bbm.platform.users.inviteToBBMFromConnections(function () { + * // Continue... + * }, connection); + * + * </script> + * + * @example + * <script type="text/javascript"> + * + * // Invite to BBM from all open connections in the application + * blackberry.bbm.platform.users.inviteToBBMFromConnections(function () { + * // Continue... + * }); + * + * </script> + * @BB50+ + */ + inviteToBBMFromConnections: function() { + } +}; diff --git a/api/blackberry_bbm_platform_users_BBMPlatformUser.js b/api/blackberry_bbm_platform_users_BBMPlatformUser.js new file mode 100644 index 0000000000..6a4a2c5f2e --- /dev/null +++ b/api/blackberry_bbm_platform_users_BBMPlatformUser.js @@ -0,0 +1,97 @@ +/* + * Copyright 2010 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @featureID blackberry.bbm.platform + * @class

Provides read-only access to a BBM platform user's information as defined in their BBM profile. + *

Instances of this object are not created, but obtained from the BBM platform. + *

Current User

+ * The current user's BBMPlatformUser instance is {@link blackberry.bbm.platform.self}. It also provides the ability to set properties of the current user. + *

Other Users

+ * You can obtain other users from the following functions/callbacks: + * + * {@link blackberry.bbm.platform.io.Channel} and {@link blackberry.bbm.platform.io.Session} also use BBMPlatformUser extensively. + * @BB50+ + */ +blackberry.bbm.platform.users.BBMPlatformUser = function() { + /** + * @description The display picture, encoded as a base64 image string. + * @type String + * @readOnly + * @BB50+ + * @example + * <script type="text/javascript"> + * // Show the current user's display picture + * var user = blackberry.bbm.platform.self; + * var displayPicImg = document.getElementById("displayPicture"); // Must have img tag with id='displayPicture' + * displayPicImg.src = user.displayPicture; + * </script> + * + */ + this.displayPicture = ""; + + /** + * @description The display name. + * @type String + * @readOnly + * @BB50+ + */ + this.displayName = ""; + + /** + * @description The personal message. + * @type String + * @readOnly + * @BB50+ + */ + this.personalMessage = ""; + + /** + * @description One of "available" or "busy". + * @type String + * @readOnly + * @BB50+ + */ + this.status = ""; + + /** + * @description The status message. + * @type String + * @readOnly + * @BB50+ + */ + this.statusMessage = ""; + + /** + * @description A unique ID representing the user on a specific device. This will be different for the same user on different devices (BlackBerry smartphone, BlackBerry PlayBook, etc.) + * @type String + * @readOnly + * @BB50+ + */ + this.handle = 0; + + /** + * @description A unique ID representing the user on all devices. This will be the same for the same user on all devices (BlackBerry smartphone, BlackBerry PlayBook, etc.) + * @type String + * @readOnly + * @BB50+ + */ + this.ppid = 0; +}; diff --git a/api/blackberry_identity.js b/api/blackberry_identity.js index 4c14aa5bb7..302917fedd 100644 --- a/api/blackberry_identity.js +++ b/api/blackberry_identity.js @@ -18,6 +18,8 @@ * @toc {Identity} Identity * @BB50+ * @RIPPLE +* @notice {Warning ( Playbook 1.0 Notice):} +* For URI based APIs, webworks:// has been deprecated and replaced with http://localhost:8472. This change does not affect the procedural APIs. * @namespace The Identity object contains information regarding the user's identity and accounts on a BlackBerry smartphone. * @featureID blackberry.identity * @featureID blackberry.identity.phone @@ -46,7 +48,7 @@ blackberry.identity = { * function getIdentityData(){ * $.ajax({ * type: "get", - * url: "webworks://blackberry/identity/get", + * url: "http://localhost:8472/blackberry/identity/get", * success: function(msg){ * $('#myIdentityDiv').populate(JSON.parse(msg).data); * } diff --git a/api/blackberry_io_dir.js b/api/blackberry_io_dir.js index 4fb28110c6..9c7a8b6043 100644 --- a/api/blackberry_io_dir.js +++ b/api/blackberry_io_dir.js @@ -16,6 +16,8 @@ /** * @toc {IO} Directory +* @notice {Warning ( Playbook 1.0 Notice):} +* For URI based APIs, webworks:// has been deprecated and replaced with http://localhost:8472. This change does not affect the procedural APIs. * @namespace The Directory object provides functions for interacting with directories on the file system.

* See also {@link blackberry.io.file} * @featureID blackberry.io.dir @@ -320,7 +322,7 @@ blackberry.io.dir = { * <script type="text/javascript"> * var dirPath = encodeURI(blackberry.io.dir.appDirs.app.storage.path + '/app_settings'); * $.ajax({ - * url: "webworks://blackberry/io/dir/list?path=" + filePath, + * url: "http://localhost:8472/blackberry/io/dir/list?path=" + filePath, * success: function(result, textStatus, jqXHR){ * try { * var resultObj = JSON.parse(result); diff --git a/api/blackberry_io_file.js b/api/blackberry_io_file.js index a5b6261d12..5e9071ddcd 100644 --- a/api/blackberry_io_file.js +++ b/api/blackberry_io_file.js @@ -16,147 +16,151 @@ /** * @toc {IO} File +* @notice {Warning ( Playbook 1.0 Notice):} +* For URI based APIs, webworks:// has been deprecated and replaced with http://localhost:8472. This change does not affect the procedural APIs. * @namespace The File object provides functions for interacting with the file system.

* See also {@link blackberry.io.dir} * @featureID blackberry.io.file * @permission [access_shared] Any references to files/directories under "shared" folder (e.g. music) requires this permission to be set. */ blackberry.io.file = { - /** - * Get the FileProperties object for a given file. - * @param {String} path local storage file path to the file - * @returns {blackberry.io.file.FileProperties} - * @BB50+ - * @PB10 - */ - getFileProperties : function(path) { }, - - /** - * @name blackberry.io.file.exists^2 - * @function - * @description Check whether or not a given file exists. - * @param {String} path local storage file path to the file - * @returns {Boolean} - * @BB50+ - * @PB10 - */ - /** - * @name blackberry.io.file.exists - * @description Determine whether a given file exists or not. - * @param {String} path path of the file, specified in the form of file:/// URL - * @returns {Object Literal} - * { - * "data" : { - * "path": "<path that was passed>", - * "exists" : true if the path exists and points to a file, false otherwise - * } - * } - * @PB10 - * @uri - * @function - */ - exists : function(path) { }, - - /** - * @name blackberry.io.file.open^2 - * @function - * @description Open the specified file with the registered content handler. - * @param {String} path file path to the file to be opened. - * @returns {Boolean} - * @BB50+ - * @PB10 - */ - /** - * @name blackberry.io.file.open - * @description Open the specified file with the registered content handler. - * @param {String} path path to the file to be opened, specified in the form of file:/// URL - * @returns {Object Literal} - * { - * "data" : { - * "path" : "<path that was passed>" - * } - * } - * @type {Boolean} - * @PB10 - * @uri - * @function - */ - open : function(path) { }, - - /** - * @name blackberry.io.file.rename^2 - * @function - * @description Rename a given file. - * @param {String} path local storage file path to the file - * @param {String} newFileName the new file name. - * @returns {void} - * @BB50+ - * @PB10 - */ - /** - * @name blackberry.io.file.rename - * @description Rename a given file. - * @param {String} path path to the file, specified in the form of file:/// URL - * @param {String} newFileName new file name - * @returns {Object Literal} - * { - * "data" : { - * "path" : "<path that was passed>", - * "newFileName" : "<newFileName that was passed>" - * } - * } - * @PB10 - * @uri - * @function - */ - rename : function(path,newFileName) { }, - + /** + * Get the FileProperties object for a given file. + * @param {String} path local storage file path to the file + * @returns {blackberry.io.file.FileProperties} + * @BB50+ + * @PB10 + */ + getFileProperties : function(path) { }, + + /** + * @name blackberry.io.file.exists^2 + * @function + * @description Check whether or not a given file exists. + * @param {String} path local storage file path to the file + * @returns {Boolean} + * @BB50+ + * @PB10 + */ + /** + * @name blackberry.io.file.exists + * @description Determine whether a given file exists or not. + * @param {String} path path of the file, specified in the form of file:/// URL + * @returns {Object Literal} + * { + * "data" : { + * "path": "<path that was passed>", + * "exists" : true if the path exists and points to a file, false otherwise + * } + * } + * @PB10 + * @uri + * @function + */ + exists : function(path) { }, + + /** + * @name blackberry.io.file.open^2 + * @function + * @description Open the specified file with the registered content handler. + * @param {String} path file path to the file to be opened. + * @returns {Boolean} + * @BB50+ + * @PB10 + */ + /** + * @name blackberry.io.file.open + * @description Open the specified file with the registered content handler. + * @param {String} path path to the file to be opened, specified in the form of file:/// URL + * @returns {Object Literal} + * { + * "data" : { + * "path" : "<path that was passed>" + * } + * } + * @type {Boolean} + * @PB10 + * @uri + * @function + */ + open : function(path) { }, + + /** + * @name blackberry.io.file.rename^2 + * @function + * @description Rename a given file. + * @param {String} path local storage file path to the file + * @param {String} newFileName the new file name. + * @returns {void} + * @BB50+ + * @PB10 + */ + /** + * @name blackberry.io.file.rename + * @description Rename a given file. + * @param {String} path path to the file, specified in the form of file:/// URL + * @param {String} newFileName new file name + * @returns {Object Literal} + * { + * "data" : { + * "path" : "<path that was passed>", + * "newFileName" : "<newFileName that was passed>" + * } + * } + * @PB10 + * @uri + * @function + */ + rename : function(path,newFileName) { }, + /** - * @name blackberry.io.file.copy^2 - * @function - * @description Copy a file to a given destination. - * @param {String} sourcePath local storage file path to the file to be copied - * @param {String} targetPath local storage file path to the new copied file. The name of the copied file should be specified at the end of the targetPath. - * @returns {void} - * @BB50+ - * @PB10 - */ - /** - * @name blackberry.io.file.copy - * @description Copy a file to a given destination. - * @param {String} path path to the file to be copied, specified in the form of file:/// URL - * @param {String} targetPath path to the newly copied file, the name of the copied file should be specified at the end of the targetPath, in the form of file:/// URL - * @returns {Object Literal} - * { - * "data" : { - * "path" : "<path that was passed>", - * "targetPath" : "<targetPath that was passed>" - * } - * } - * @PB10 - * @uri - * @function - */ - copy : function(sourcePath,targetPath) { }, - - /** - * Delete a given file. - * @param {String} path local storage file path to the file to be deleted - * @returns {void} - * @BB50+ - * @PB10 - */ - deleteFile : function(path) { }, - - /** - * Save a Blob to the local file system. - * @param {String} path Local storage file path to the file that is going to store the data - * @param {Blob} data The Blob to be saved. - * @returns {void} - * @BB50+ + * @name blackberry.io.file.copy^2 + * @function + * @description Copy a file to a given destination. + * @param {String} sourcePath local storage file path to the file to be copied + * @param {String} targetPath local storage file path to the new copied file. The name of the copied file should be specified at the end of the targetPath. + * @returns {void} + * @BB50+ + * @PB10 + */ + /** + * @name blackberry.io.file.copy + * @description Copy a file to a given destination. + * @param {String} path path to the file to be copied, specified in the form of file:/// URL + * @param {String} targetPath path to the newly copied file, the name of the copied file should be specified at the end of the targetPath, in the form of file:/// URL + * @returns {Object Literal} + * { + * "data" : { + * "path" : "<path that was passed>", + * "targetPath" : "<targetPath that was passed>" + * } + * } + * @PB10 + * @uri + * @function + */ + copy : function(sourcePath,targetPath) { }, + + /** + * Delete a given file. + * @param {String} path local storage file path to the file to be deleted + * @returns {void} + * @BB50+ + * @PB10 + */ + deleteFile : function(path) { }, + + /** + * @name blackberry.io.file.saveFile + * @function + * @description Save a Blob to the local file system. + * @param {String} path Local storage file path to the file that is going to store the data + * @param {Blob} data The Blob to be saved. + * @returns {void} + * @BB50+ + * @PB10 * @example * <script type="text/javascript"> - * // This example is for BlackBerry OS 5.0+ * var xmlString = "<test>IO functions</test>"; * var filePath = "file:///store/home/user/sample.xml"; * var parser = new DOMParser(); @@ -174,84 +178,85 @@ blackberry.io.file = { * alert("file opened was: " + fullPath + " which contained " + blobData.length + " bytes"); * } * </script> - */ - saveFile : function(path,data) { }, - - /** - * Reads in a file from the local file system. - * @param {String} path local storage file path to the file to be opened into a Blob - * @callback {function} onFileOpened callback function to call on completion of loading the file from the file system. - * @callback {String} onFileOpened.fullPath full path of the file that was just opened - * @callback {Blob} onFileOpened.blobData blob that contains the file's contents - * @param {Boolean} [async] a flag specifying if the call to read should be asynchronous or synchronous. If this parameter is not supplied the default of true will be used. This flag is ignored if used on BlackBerry PlayBook. - * @returns {void} - * @BB50+ - */ - readFile : function(path,onFileOpened,async) { }, - - /** - * @name blackberry.io.file.delete - * @description Delete the specified file. - * @param {String} path path to the file to be deleted, specified in the form of file:/// URL - * @returns {Object Literal} - * { - * "data" : { - * "path" : "<path that was passed>" - * } - * } - * @PB10 - * @uri - * @function - */ - delete : function(path) {}, - - /** - * Get properties for a given file. - * @param {String} path path to the file, specified in the form of file:/// URL - * @returns {Object Literal} - * { - * "data" : { - * "path" : "<path that was passed>", - * "dateCreated" : "<file creation date, in number of milliseconds since UTC>", // only defined if "code" is 0 - * "dateModified" : "<file modification date, in number of milliseconds since UTC>", // only defined if "code" is 0 - * "directory" : "<path of directory that contains this file>", // only defined if "code" is 0 - * "fileExtension" : "<file extension>", // only defined if "code" is 0 - * "isHidden" : true (if file is hidden) or false (if file is not hidden), // only defined if "code" is 0 - * "size" : <file size in bytes> // only defined if "code" is 0 - * } - * } - * @PB10 - * @uri - * @example - * <script type="text/javascript" src="js/jquery-1.4.2.js"></script> - * <script type="text/javascript"> - * var filePath = encodeURI(blackberry.io.dir.appDirs.app.storage.path + '/myfile.txt'); - * var reviverFn = function(key, value) { - * // construct JS Date object from number of milliseconds since UTC - * if (key.toLowerCase().indexOf('date') != -1) { - * return new Date(value); - * } else { - * return value; - * } - * }; - * - * // inspect properties for this file - * $.ajax({ - * url: "webworks://blackberry/io/file/get?path=" + filePath, - * success: function(result, textStatus, jqXHR){ - * try { - * var resultObj = JSON.parse(result, reviverFn); - * alert("code=" + resultObj.code + " msg=" + resultObj.msg); - * - * for (var f in resultObj.data) { - * alert(f + ':' + resultObj.data[f]); - * } - * } catch (e) { - * alert('e.message = ' + e.message); - * } - * } - * }); - * </script> - */ - get : function(path) {} + */ + saveFile : function(path,data) { }, + + /** + * Reads in a file from the local file system. + * @param {String} path local storage file path to the file to be opened into a Blob + * @callback {function} onFileOpened callback function to call on completion of loading the file from the file system. + * @callback {String} onFileOpened.fullPath full path of the file that was just opened + * @callback {Blob} onFileOpened.blobData blob that contains the file's contents + * @param {Boolean} [async] a flag specifying if the call to read should be asynchronous or synchronous. If this parameter is not supplied the default of true will be used. + * @returns {void} + * @BB50+ + * @PB10 + */ + readFile : function(path,onFileOpened,async) { }, + + /** + * @name blackberry.io.file.delete + * @description Delete the specified file. + * @param {String} path path to the file to be deleted, specified in the form of file:/// URL + * @returns {Object Literal} + * { + * "data" : { + * "path" : "<path that was passed>" + * } + * } + * @PB10 + * @uri + * @function + */ + delete : function(path) {}, + + /** + * Get properties for a given file. + * @param {String} path path to the file, specified in the form of file:/// URL + * @returns {Object Literal} + * { + * "data" : { + * "path" : "<path that was passed>", + * "dateCreated" : "<file creation date, in number of milliseconds since UTC>", // only defined if "code" is 0 + * "dateModified" : "<file modification date, in number of milliseconds since UTC>", // only defined if "code" is 0 + * "directory" : "<path of directory that contains this file>", // only defined if "code" is 0 + * "fileExtension" : "<file extension>", // only defined if "code" is 0 + * "isHidden" : true (if file is hidden) or false (if file is not hidden), // only defined if "code" is 0 + * "size" : <file size in bytes> // only defined if "code" is 0 + * } + * } + * @PB10 + * @uri + * @example + * <script type="text/javascript" src="js/jquery-1.4.2.js"></script> + * <script type="text/javascript"> + * var filePath = encodeURI(blackberry.io.dir.appDirs.app.storage.path + '/myfile.txt'); + * var reviverFn = function(key, value) { + * // construct JS Date object from number of milliseconds since UTC + * if (key.toLowerCase().indexOf('date') != -1) { + * return new Date(value); + * } else { + * return value; + * } + * }; + * + * // inspect properties for this file + * $.ajax({ + * url: "http://localhost:8472/blackberry/io/file/get?path=" + filePath, + * success: function(result, textStatus, jqXHR){ + * try { + * var resultObj = JSON.parse(result, reviverFn); + * alert("code=" + resultObj.code + " msg=" + resultObj.msg); + * + * for (var f in resultObj.data) { + * alert(f + ':' + resultObj.data[f]); + * } + * } catch (e) { + * alert('e.message = ' + e.message); + * } + * } + * }); + * </script> + */ + get : function(path) {} }; diff --git a/api/blackberry_payment.js b/api/blackberry_payment.js index 22155e615e..eaea92bcf1 100644 --- a/api/blackberry_payment.js +++ b/api/blackberry_payment.js @@ -22,7 +22,7 @@ *

* Purchases are initiated via the purchase method. The amount of time that elapses before a response is returned depends on how quickly the user completes the purchase process (which may include steps such as signing in to their BlackBerry ID account and setting up their preferred billing method). The purchase method dispatches a callbackOnSuccess on success, or dispatches a callbackOnFailure on failure. *

- * When calling the puchase method only the ID or SKU of the digital good to be purchased is required; it is not necessary to provide both, and all other arguments are optional. If both the ID and SKU are provided, then the ID takes precedence; the SKU is only used if the digital good could not be located on the Payment Service server based on the ID. + * When calling the purchase method only the ID or SKU of the digital good to be purchased is required; it is not necessary to provide both, and all other arguments are optional. If both the ID and SKU are provided, then the ID takes precedence; the SKU is only used if the digital good could not be located on the Payment Service server based on the ID. *

* If an application requires a list of its digital goods that have already been purchased by the user (for example, to avoid offering for sale a digital good the user already owns), such a list can be obtained with the {@link blackberry.payment.getExistingPurchases} method. This method requires the same user interaction as the purchase method, so it can also be a long-running method. * @toc {Payment} Payment @@ -35,22 +35,22 @@ blackberry.payment = { * @description Retrieves the previous successful purchases made by the user from within the calling application. * @param {Boolean} [refresh] True if the BlackBerry should be allowed to refresh the list of purchases from the Payment Service server. False if the current list of cached purchases should be returned immediately. * @callback {function} callbackOnSuccess Function to be invoked on successful call. - * @callback {Purchase[]} callbackOnSuccess.data An array of purchases is passed as a parameter in the form below. + * @callback {String} callbackOnSuccess.data A string representing a literal array of {@link Purchase} items is passed as a parameter in the form below: *

[{
      * "transactionID": "00000001",
      * "digitalGoodID": "123",
      * "date": "1234567891011",
-     * "digitalGoodSKU": "SKU 1",
+     * "digitalGoodSKU": "SKU_1",
      * "licenseKey": null,
-     * "metaData": ""
+     * "metaData": "My Metadata"
      * },
      * {
      * "transactionID": "00000002",
      * "digitalGoodID": "456",
      * "date": "1234567891011",
-     * "digitalGoodSKU": "SKU 2",
+     * "digitalGoodSKU": "SKU_2",
      * "licenseKey": null,
-     * "metaData": ""
+     * "metaData": "My Metadata"
      * }]
* @callback {function} [callbackOnFailure] Function to be invoked when an error occurs. * @callback {String} callbackOnFailure.errorText Retrieves the message set for an error. In addition to descriptive text, error code may appear at the end of the message. @@ -60,9 +60,11 @@ blackberry.payment = { *
  • Payment System Busy = 2
  • *
  • General Payment System Error = 3
  • *
  • Digital Good not Found = 4
  • + *
  • Illegal Application Error = 5 [BlackBerry OS 5.0+ only]
  • * * Note: The actual values may be different when {@link blackberry.payment.developmentMode} equals true. * @PB10 + * @BB50+ */ getExistingPurchases : function (refresh, callbackOnSuccess, callbackOnFailure) { }, @@ -77,16 +79,19 @@ blackberry.payment = { * @callback {String} args.purchaseAppName Name of the application requesting the purchase. * @callback {String} args.purchaseAppIcon Icon of the application requesting the purchase. * @callback {function} callbackOnSuccess Function to be called when the payment is successful. - * @callback {Purchase} callbackOnSuccess.data An object representing a purchase is passed as a parameter in the form below. + * @callback {String} callbackOnSuccess.data A string representing a {@link Purchase} object literal. * @callback {function} [callbackOnFailure] Function to be called when an error occurs. - * @callback {Number} callbackOnFailure.error An error code will be passed in corresponding to the following codes + * @callback {String} callbackOnFailure.errorText Retrieves the message set for an error. In addition to descriptive text, error code may appear at the end of the message. + * @callback {Number} callbackOnFailure.errorID Contains the reference number associated with the specific error in corresponding to the following values. * * @PB10 + * @BB50+ * @example * <script type="text/javascript"> * function pay() { @@ -105,11 +110,15 @@ blackberry.payment = { * } * * function success(purchase) { - * alert ("success called:"+ JSON.stringify(purchase)); - * } + * var purchasedItem = JSON.parse(purchase); + * var transId = purchasedItem.transactionID; + * var sku = purchasedItem.digitalGoodSKU; + * var dgId = purchasedItem.digitalGoodID; + * alert("Purchased Item: " + transId + "," + sku + "," + dgId); + * } * - * function failure(error) { - * alert ("failure called with error code:"+ error); + * function failure(errorText, errorId) { + * alert("Error occured: " + errorText + ", " + errorId); * } * </script> */ @@ -120,8 +129,9 @@ blackberry.payment = { * @description Defines the development mode used in the application. If development mode is set to true, the application does not contact the Payment Service server for any transactions. For purchases, a simulated purchase screen is displayed, allowing the user to choose the result of the purchase. For retrieving existing purchases, only simulated successful purchases are returned. This mode is useful for testing how your application handles the possible results without requiring network connections or currency. THIS MODE SHOULD NOT BE USED IN PRODUCTION CODE. If development mode is set to false, purchases and retrievals of existing purchases proceed normally, contacting the Payment Service server as necessary. This is the default development mode, and applications in production should not modify it. * @default false * @PB10 + * @BB50+ */ - developmentMode: false + developmentMode: false; }; @@ -138,6 +148,7 @@ Purchase = { }; * @type String * @description The transaction ID for this purchase. * @PB10 + * @BB50+ */ Purchase.prototype.transactionID = null; @@ -145,6 +156,7 @@ Purchase.prototype.transactionID = null; * @type String * @description The ID of the purchased digital good. * @PB10 + * @BB50+ */ Purchase.prototype.digitalGoodID = null; @@ -152,6 +164,7 @@ Purchase.prototype.digitalGoodID = null; * @type String * @description The SKU of the purchased digital good. * @PB10 + * @BB50+ */ Purchase.prototype.digitalGoodSKU = null; @@ -159,13 +172,15 @@ Purchase.prototype.digitalGoodSKU = null; * @type String * @description The metadata for this purchase, or null if no metadata was included with the purchase. * @PB10 + * @BB50+ */ Purchase.prototype.metaData = null; /** * @type String - * @description Represents the date this purchase was made. + * @description The Epoch time represention of the date this purchase was made. * @PB10 + * @BB50+ */ Purchase.prototype.date = null; @@ -173,5 +188,6 @@ Purchase.prototype.date = null; * @type String * @description Represents the license key for this purchase, or null if the purchased digital good does not have a license key. * @PB10 + * @BB50+ */ -Purchase.prototype.licenseKey = null; \ No newline at end of file +Purchase.prototype.licenseKey = null; diff --git a/api/blackberry_system.js b/api/blackberry_system.js index 406bd92da6..8620ed7fdf 100644 --- a/api/blackberry_system.js +++ b/api/blackberry_system.js @@ -17,23 +17,25 @@ /** * @toc {System} System * @featureID blackberry.system + * @notice {Warning ( Playbook 1.0 Notice):} + * For URI based APIs, webworks:// has been deprecated and replaced with http://localhost:8472. This change does not affect the procedural APIs. * @namespace The System object allows you to get access to system level functions and attributes of the BlackBerry PlayBook.
    *
    The System object is static; all of its functions and properties are used directly from the object. * @example * <script type="text/javascript"> - * // See if we are in coverage + * // See if we are in coverage * if (!blackberry.system.hasDataCoverage()) { * alert("You are not in coverage, we will attempt to send later"); * } * - * // Check if we have GPS capability + * // Check if we have GPS capability * if (blackberry.system.hasCapability("location.gps")) { * alert("This PlayBook has a GPS."); * } * </script> */ blackberry.system ={ - + /** * @param {String} capability The capability being checked for. * @description This method will determine if the BlackBerry PlayBook or the BlackBerry Smartphone device is capable of the given service.
    @@ -60,7 +62,7 @@ blackberry.system ={ hasCapability : function(capability){}, /** - * @function + * @function * @description Returns true if the device is in coverage, otherwise returns false. This can be used in conjunction with the blackberry.network property to find out what kind of coverage it is in. * @returns {Boolean} Returns true if the BlackBerry PlayBook or the BlackBerry Smartphone device has any network interface active. * @BB50+ @@ -68,26 +70,26 @@ blackberry.system ={ * @RIPPLE */ hasDataCoverage : function(){}, - + /** - * @function + * @function * @description Set the image that appears as the background of the Home screen on a BlackBerry device. * @param {String} uri URI path to an image file that resides in flash memory or a microSD Card. * @BB50+ * @RIPPLE */ setHomeScreenBackground : function(uri){}, - + /** * @param {String} module The BlackBerry WebWorks namespace or class to check for access. For example blackberry.system, blackberry.app. * @description Determines the level of access to the requested module. - * @returns {Number} The possible return values: 0 - ALLOW 1 - DENY + * @returns {Number} The possible return values: 0 - ALLOW 1 - DENY * @BB50+ * @PB10 * @RIPPLE */ hasPermission : function(module){}, - + /** * @description Returns whether USB MassStorage mode is active. * @returns {Boolean} Always returns false on the BlackBerry PlayBook since Mass Storage Mode is not supported. All memory is presented as a network share when connected by USB and is not blocked. @@ -96,9 +98,10 @@ blackberry.system ={ * @RIPPLE */ isMassStorageActive : function(){}, - + /** - * @uri + * @uri + * @BB50+ * @PB10 * @description The objects in hasPermission will always be ALLOW (0). They will correspond to all the entries in the whitelist. If they are not whitelisted, they are omitted from the list. Similarly, all of the objects in hasCapability will be true, otherwise they will be omitted. * @returns {JSON of all the properties} @@ -128,25 +131,25 @@ blackberry.system ={ * "isMassStorageActive":false * } * } - * @example + * @example * <html> * <head> * <script type="text/javascript" src="js/jquery-1.4.2.js" ></script> * <script type="text/javascript" src="js/jquery.form.js" ></script> * <script type="text/javascript" src="js/jquery.populate.js" ></script> - * + * * <script type="text/javascript"> * function getSystemData(){ * $.ajax({ * type: "get", - * url: "webworks://blackberry/system/get", + * url: "http://localhost:8472/blackberry/system/get", * success: function(msg){ * $('#mySystemDiv').populate(JSON.parse(msg).data); * } * }); * } * </script> - * + * *</head> *<body> * @@ -155,12 +158,12 @@ blackberry.system ={ * Software Version: <span id="softwareVersion"></span><br/> * Mass Storage Active: <span id="isMassStorageActive"></span> * </div> - * + * *</body> *</html> */ get: function(){}, - + /** * @type String * @description Returns the model number of the BlackBerry PlayBook or the BlackBerry Smartphone device. @@ -170,7 +173,7 @@ blackberry.system ={ * @RIPPLE */ model: null, - + /** * @type String * @description Returns the current version of the WebWorks library being used. @@ -180,7 +183,7 @@ blackberry.system ={ * @RIPPLE */ scriptApiVersion:null, - + /** * @type String * @description Returns the current version of the operating system, for example, 1.0.0.0. @@ -190,7 +193,7 @@ blackberry.system ={ * @RIPPLE */ softwareVersion:null, - + /** * @constant * @type Number diff --git a/api/blackberry_system_event.js b/api/blackberry_system_event.js index e8179516b8..c0b3505eee 100644 --- a/api/blackberry_system_event.js +++ b/api/blackberry_system_event.js @@ -20,39 +20,96 @@ *

    * The System Object is static; all of its functions and properties are used directly from the object. *

    -* @toc {System} System Event +* @toc {System} System Event * @featureID blackberry.system.event * @BB50+ * @RIPPLE * @namespace The System Event object allows you to get access to events triggered by system events on the BlackBerry device. * @example -* <script type="text/javascript"> -* function trapForBackKey() { -* blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, handleBack); -* } -* -* function handleBack() { -* alert("handle back button"); -* } -* </script> - * @example - * <script type="text/javascript"> - * - * function onBatteryLevelChange(level) { - * alert("Battery Level: " + level); - * } - * - * function notifyOnBatteryLevelChange(batteryLevelChangeCb) { - * blackberry.system.event.deviceBatteryLevelChange(batteryLevelChangeCb); - * } - * - * notifyOnBatteryLevelChange(onBatteryLevelChange); - * </script> +* // This example is for BlackBerry OS 5.0+ +* <html> +* <head> +* <script type="text/javascript" src="jquery.min.js"></script> +* <script type="text/javascript"> +* $.support.cors = true; // this is needed in BB5.0 for jQuery to support cross-domain request +* +* function asyncCall(method, args, callback) { +* $.ajax({ +* url : "http://localhost:8472/blackberry/system/event/" + method, +* data : args, +* type : "GET", +* success : callback, +* async : true, +* error : function(jqXHR, textStatus, errorThrown) { +* alert('error:' + textStatus + ' errorThrown:' + errorThrown); +* } +* }); +* } +* +* function poll(method, args, callback) { +* asyncCall(method, args, function(response) { +* if (callback(response)) { +* poll(method, args, callback); +* } +* }); +* } +* +* function getCallback(callback) { +* return function(response) { +* var result = JSON.parse(response); +* +* if (result.code < 0) { +* return false; +* } +* +* if (callback) { +* callback(); +* } +* +* return !!callback; +* }; +* } +* +* function coverageChanged() { +* $("#status").html((new Date()).toLocaleString() + " coverage changed!"); +* } +* +* function volumeUpKeyPressed() { +* $("#status").html((new Date()).toLocaleString() + " volume up key pressed!"); +* } +* </script> +* </head> +* <body> +* <input type="button" id="setCoverageChange" value="Listen coverage change"><br><br> +* <input type="button" id="unsetCoverageChange" value="Stop listen coverage change"><br><br> +* <input type="button" id="setVolumeUp" value="Listen volume up key press"><br><br> +* <input type="button" id="unsetVolumeUp" value="Stop listen volume up key press"><br><br> +* <div id="status"></div> +* <script type="text/javascript"> +* $("#setCoverageChange").click(function() { +* var callback = coverageChanged; +* poll("onCoverageChange", { "monitor" : true }, getCallback(callback)); +* }); +* $("#unsetCoverageChange").click(function(){ +* var callback = null; +* poll("onCoverageChange", { "monitor" : false }, getCallback(callback)); +* }); +* $("#setVolumeUp").click(function() { +* var callback = volumeUpKeyPressed; +* poll("onHardwareKey", { "key" : blackberry.system.event.KEY_VOLUMEUP, "monitor" : true }, getCallback(callback)); +* }); +* $("#unsetVolumeUp").click(function(){ +* var callback = null; +* poll("onHardwareKey", { "key" : blackberry.system.event.KEY_VOLUMEUP, "monitor" : false }, getCallback(callback)); +* }); +* </script> +* </body> +* </html> */ blackberry.system.event = { }; /** -* Constant representing the back button. +* Constant representing the back button. * @type Number * @constant * @BB50+ @@ -61,7 +118,7 @@ blackberry.system.event = { }; blackberry.system.event.KEY_BACK = 0; /** -* Constant representing the menu button. +* Constant representing the menu button. * @type Number * @constant * @BB50+ @@ -70,7 +127,7 @@ blackberry.system.event.KEY_BACK = 0; blackberry.system.event.KEY_MENU = 1; /** -* Constant representing the first convenience button. +* Constant representing the first convenience button. * @type Number * @constant * @BB50+ @@ -79,7 +136,7 @@ blackberry.system.event.KEY_MENU = 1; blackberry.system.event.KEY_CONVENIENCE_1 = 2; /** -* Constant representing the second convenience button. +* Constant representing the second convenience button. * @type Number * @constant * @BB50+ @@ -88,7 +145,7 @@ blackberry.system.event.KEY_CONVENIENCE_1 = 2; blackberry.system.event.KEY_CONVENIENCE_2 = 3; /** -* Constant representing the call button. +* Constant representing the call button. * @type Number * @constant * @BB50+ @@ -97,7 +154,7 @@ blackberry.system.event.KEY_CONVENIENCE_2 = 3; blackberry.system.event.KEY_STARTCALL = 4; /** -* Constant representing the end call button. +* Constant representing the end call button. * @type Number * @constant * @BB50+ @@ -106,7 +163,7 @@ blackberry.system.event.KEY_STARTCALL = 4; blackberry.system.event.KEY_ENDCALL = 5; /** -* Constant representing the volume down button. +* Constant representing the volume down button. * @type Number * @constant * @BB50+ @@ -115,7 +172,7 @@ blackberry.system.event.KEY_ENDCALL = 5; blackberry.system.event.KEY_VOLUMEDOWN = 6; /** -* Constant representing the volume up button. +* Constant representing the volume up button. * @type Number * @constant * @BB50+ @@ -124,19 +181,63 @@ blackberry.system.event.KEY_VOLUMEDOWN = 6; blackberry.system.event.KEY_VOLUMEUP = 7; /** -* Assigns a listener for the click of one of the hardware buttons on the device. +* @name blackberry.system.event.onHardwareKey^2 +* @description Assigns a listener for the click of one of the hardware buttons on the device. * @param {Number} key Hardware key to listen for. A list of constants allowed for these keys is shown above. * @callback {function} onSystemEvent Function to be called when the key is clicked - this function takes no parameters and no return value is required. If you attempt to subscribe more than one callback function to a particular key, only the newest callback will be used when the key is pressed. To remove the callback simply call the onHardwareKey with null as the callback parameter. * @BB50+ +* @function +* @example +* <script type="text/javascript"> +* function trapForBackKey() { +* blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, handleBack); +* } +* +* function handleBack() { +* alert("handle back button"); +* } +* </script> +*/ +/** +* @name blackberry.system.event.onHardwareKey +* @description Get notification when one of the hardware buttons on the device is clicked.

    To invoke this API, issue an asychronous HTTP request.

    An HTTP response will be returned when the specified key is clicked. When the response is received, it is the caller's responsibility to perform necessary actions (e.g. invoke a callback function). Once that is done, a new HTTP request should be issued again to listen to further clicks to the key. +* @param {Number} key Hardware key to listen for. A list of constants allowed for these keys is shown above. +* @param {Boolean} monitor Flag to indicate whether the caller wants to get notifications for clicks to the hardware buttons or not. Pass true to start monitoring, or false to stop monitoring. +* @returns {Object Literal} +* { +* "data" : { +* "key" : <key that was passed>, +* "monitor" : <the flag that was passed> +* } +* } +* @BB50+ * @RIPPLE +* @uri +* @function */ blackberry.system.event.onHardwareKey = function(key,onSystemEvent) { }; /** -* Assigns a listener for when the coverage status changes. +* @name blackberry.system.event.onCoverageChange^2 +* @description Assigns a listener for when the coverage status changes. * @callback {function} onSystemEvent Function to be called when coverage changes. Only one function can be assigned to this event. To unregister the callback, call the onCoverageChange method and pass in null for the callback parameter. * @BB50+ * @RIPPLE +* @function +*/ +/** +* @name blackberry.system.event.onCoverageChange +* @description Get notification whenever the coverage status changes.

    To invoke this API, issue an asychronous HTTP request.

    An HTTP response will be returned when there is a coverage change. When the response is received, it is the caller's responsibility to perform necessary actions (e.g. invoke a callback function). Once that is done, a new HTTP request should be issued again to listen to further coverage changes. +* @param {Boolean} monitor Flag to indicate whether the caller wants to get notifications for coverage status changes or not. Pass true to start monitoring, or false to stop monitoring. +* @returns {Object Literal} +* { +* "data" : { +* "monitor" : <the flag that was passed> +* } +* } +* @BB50+ +* @uri +* @function */ blackberry.system.event.onCoverageChange = function(onSystemEvent) { }; @@ -148,6 +249,18 @@ blackberry.system.event.onCoverageChange = function(onSystemEvent) { }; * @callback {Number} onBatteryLevelChange.level battery level of the device ranging from 0 to 100 * @PB10 * @RIPPLE + * @example + * <script type="text/javascript"> + * function onBatteryLevelChange(level) { + * alert("Battery Level: " + level); + * } + * + * function notifyOnBatteryLevelChange(batteryLevelChangeCb) { + * blackberry.system.event.deviceBatteryLevelChange(batteryLevelChangeCb); + * } + * + * notifyOnBatteryLevelChange(onBatteryLevelChange); + * </script> */ blackberry.system.event.deviceBatteryLevelChange = function(onBatteryLevelChange){}; @@ -166,4 +279,3 @@ blackberry.system.event.deviceBatteryLevelChange = function(onBatteryLevelChang * @RIPPLE */ blackberry.system.event.deviceBatteryStateChange = function(onBatteryStateChange){}; - diff --git a/api/blackberry_utils.js b/api/blackberry_utils.js index 8f0c82220c..afa971c752 100644 --- a/api/blackberry_utils.js +++ b/api/blackberry_utils.js @@ -33,6 +33,7 @@ blackberry.utils = { * @param {String} [encoding = ISO-8859-1] The name of a supported character encoding.BlackBerry supports the following character encodings: ISO-8859-1, UTF-8, UTF-16BE, US-ASCII. Besides these encodings, Web API also supports BASE64 encoding. Support of other encodings depends on the configuration of the BlackBerry Smartphone. * @returns {String} The String result from converting the Blob * @BB50+ + * @PB10 * @RIPPLE */ blobToString : function(blob,encoding){}, @@ -59,6 +60,7 @@ blackberry.utils = { * @param {String} [encoding = ISO-8859-1] The name of a supported character encoding.BlackBerry supports the following character encodings: ISO-8859-1, UTF-8, UTF-16BE, US-ASCII. Besides these encodings, Web API also supports BASE64 encoding. Support of other encodings depends on the configuration of the BlackBerry Smartphone. * @returns {Blob} The Blob result from converting the String * @BB50+ + * @PB10 * @RIPPLE */ stringToBlob : function(str,encoding){}, @@ -67,8 +69,8 @@ blackberry.utils = { /** * @description This method will generate a unique number. * @returns {Number} A unique number from JavaScript's Math.random() function. - * @PB10 * @BB50+ + * @PB10 * @RIPPLE */ generateUniqueId: function(){}, diff --git a/api/images/bbm/channel.png b/api/images/bbm/channel.png new file mode 100644 index 0000000000..0753a95a0f Binary files /dev/null and b/api/images/bbm/channel.png differ diff --git a/api/images/bbm/hosting.png b/api/images/bbm/hosting.png new file mode 100644 index 0000000000..0188aab25f Binary files /dev/null and b/api/images/bbm/hosting.png differ diff --git a/api/images/bbm/invite_to_join.png b/api/images/bbm/invite_to_join.png new file mode 100644 index 0000000000..3a124f59af Binary files /dev/null and b/api/images/bbm/invite_to_join.png differ diff --git a/api/images/bbm/session_invite1.png b/api/images/bbm/session_invite1.png new file mode 100644 index 0000000000..0e89ba4ad3 Binary files /dev/null and b/api/images/bbm/session_invite1.png differ diff --git a/api/images/bbm/session_invite2.png b/api/images/bbm/session_invite2.png new file mode 100644 index 0000000000..ee321c7917 Binary files /dev/null and b/api/images/bbm/session_invite2.png differ diff --git a/api/images/bbm/session_invite3.png b/api/images/bbm/session_invite3.png new file mode 100644 index 0000000000..a8438c8a4c Binary files /dev/null and b/api/images/bbm/session_invite3.png differ diff --git a/build/BBTemplate/JSON.tmpl b/build/BBTemplate/JSON.tmpl new file mode 100644 index 0000000000..54a1ff36cd --- /dev/null +++ b/build/BBTemplate/JSON.tmpl @@ -0,0 +1,57 @@ +{! +/** +* Copyright 2010-2011 Research In Motion Limited. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +function TextLink() {} +TextLink.prototype = new Link(); +TextLink.prototype.constructor = TextLink; +Link.prototype.toString = TextLink.prototype.toString; //Must do this to keep track of the function +TextLink.prototype.toString = function () { + var hrefLink = Link.prototype.toString.call(this), + re = new RegExp('^(?:.*)(?:.*)(?:<[//]a>$)'); + return hrefLink.replace(re,'$1'); +}; + + +var prevTocType, + i=0, + tocSymbols, + tocSupport; + +!} + + +[ + + + + ,{ "title":"{+thisClass.toc.desc+}", "id":"{+thisClass.toc.desc+}", "link":"/html5/apis/{+new TextLink().toClass(thisClass.alias)+}", "children":[]} + + +]}, + + {! + tocSymbols = data.filter(function($){return $.toc.type == thisClass.toc.type}); + tocSupport = new BBTag.Support(tocSymbols); + !} +{ "title":"{+thisClass.toc.type+}", "id":"{+thisClass.toc.type+}", "link":"/html5/apis/index1.html", "children":[ + { "title":"{+thisClass.toc.desc+}", "id":"{+thisClass.toc.desc+}", "link":"/html5/apis/{+new TextLink().toClass(thisClass.alias)+}", "children":[]} + {!prevTocType = thisClass.toc.type;!} + + + +]} +] diff --git a/build/BBTemplate/PHP.tmpl b/build/BBTemplate/PHP.tmpl new file mode 100644 index 0000000000..265ce6d2d2 --- /dev/null +++ b/build/BBTemplate/PHP.tmpl @@ -0,0 +1,59 @@ +{! +/** +* Copyright 2010-2011 Research In Motion Limited. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +**/ + +function TextLink() {} +TextLink.prototype = new Link(); +TextLink.prototype.constructor = TextLink; +Link.prototype.toString = TextLink.prototype.toString; //Must do this to keep track of the function +TextLink.prototype.toString = function () { + var hrefLink = Link.prototype.toString.call(this), + re = new RegExp('^(?:.*)(?:.*)(?:<[//]a>$)'); + return hrefLink.replace(re,'$1'); +}; + + +var prevTocType, + i=0, + tocSymbols, + tocSupport; + +!} + + + + + + ,array('title'=>'{+thisClass.toc.desc+}','link'=>'/html5/apis/{+new TextLink().toClass(thisClass.alias)+}','id'=>'{+thisClass.toc.desc+}','children'=>array()) + + +)), + + {! + tocSymbols = data.filter(function($){return $.toc.type == thisClass.toc.type}); + tocSupport = new BBTag.Support(tocSymbols); + !} +array('title'=>'{+thisClass.toc.type+}','link'=>'/html5/apis/{+new TextLink().toClass(thisClass.alias)+}','id'=>'{+thisClass.toc.type+}','children'=>array( + array('title'=>'{+thisClass.toc.desc+}','link'=>'/html5/apis/{+new TextLink().toClass(thisClass.alias)+}','id'=>'{+thisClass.toc.desc+}','children'=>array()) + {!prevTocType = thisClass.toc.type;!} + + + +)) +); +?> diff --git a/build/BBTemplate/class.tmpl b/build/BBTemplate/class.tmpl index f45d268356..ec960a525b 100644 --- a/build/BBTemplate/class.tmpl +++ b/build/BBTemplate/class.tmpl @@ -1,1353 +1,334 @@ - +{! + var allChildren = [], + constructors = [], + ownMethods = [], + ownURIMethods = [], + constructors = [], + ownProperties = [], + ownConstants = [], + ownEvents = [], + mandatoryPermissions, + optionalPermissions, + generateDefaultConstructor = !data.isBuiltin() && data.is('CONSTRUCTOR') && !data.noConstructor; - - - - - - - {+data.toc.desc+} - - {+data.alias+} - - - - - - - - - -
    + } + + - -

    - - {+resolveLinks(data.classDesc)+} - -

    + + +
    + +{!/********** Class Heading **********/!} +

    + + {+data.toc.desc+} + + {+data.alias+} + +

    + +{!/********** Class Description **********/!} + +

    + {+resolveLinks(data.classDesc)+} +

    +
    + +{!/********** Notices **********/!} - - - - -
    -
    {+item.title+}
    - {+item.desc+} -
    +
    +

    {+item.title+}

    + {+item.desc+} +
    +
    - - + +{!/*********** Beta Notice ***********/!} - - - - -
    -
    Beta Notice:
    - This API is considered to be in Beta. - The function and property signatures listed below could change at anytime. - Once the API moves out of Beta it will be distributed as part of the core API. -

    - - {+item.desc+} - -

    - Last Updated: {+new Date()+} -
    +
    +

    Beta Notice:

    + This API is considered to be in Beta. + The function and property signatures listed below could change at anytime. + Once the API moves out of Beta it will be distributed as part of the core API. +

    + + {+item.desc+} + +

    + Last Updated: {+new Date()+} +
    - - + +{!/*********** Learning Resources ***********/!} - -
    Learning Resources:
    +
    +

    Learning Resources:

    - - - +
    - {!output+="" + item.type + "";!} - {+item.desc+} -
    + {!output+="" + item.type + "";!} + {+item.desc+} +
    - - - {!var allChildren =[]; var constructors = [];!} - - {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && isMethod($)}).sort(makeNameSort()); !} - {! var ownURIMethods = data.methods.filter(function($){return $.memberOf == data.alias && isURIMethod($)}).sort(makeNameSort()); !} - {! constructors = data.methods.filter(function($){return $.memberOf == data.alias && isConstructor($)}).sort(makeNameSort()); !} - {! allChildren = allChildren.concat(ownMethods, ownURIMethods);!} - - - {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && isProperty($)}).sort(makeNameSort()); !} - {! var ownConstants = data.properties.filter(function($){return $.memberOf == data.alias && isConstant($)}); !} - {! constructors = constructors.concat(data.properties.filter(function($){return $.memberOf == data.alias && isConstructor($)})); !} - {! allChildren = allChildren.concat(ownProperties,ownConstants);!} - - - {! var ownEvents = data.events.filter(function($){return $.memberOf == data.alias && isEvent($)}).sort(makeNameSort()); !} - {! allChildren = allChildren.concat(ownEvents);!} - - {! var generateDefaultConstructor = !data.isBuiltin() && data.is('CONSTRUCTOR') && !data.noConstructor; !} - - {! constructors.unshift(data); !} - + +{!/*********** Supported Platforms ***********/!} -
    Supported Platform(s)
    - - - - - - - -
    - - - {+item+}
    -
    -
    -
    - Supported Platform Table: Expand
    -
    - - - - - - - - - - - - - - - - - - - - - -
    - API - - - OS 5.0 - - - OS 6.0 - - - OS 7.0 - - - PlayBook - - - Ripple - -
    - {+new Link().toSymbol(item.alias).withText(getSymbolName(item))+} - {+item.support.supportTable+} -
    - {+new Link().toSymbol(item.alias).withText(getSymbolName(item))+} - {+item.support.supportTable+} -
    -
    -
    -
    - - -
    -
    Configuration Document Settings
    - To use all of the API described for this object, you must ensure the following settings are in your configuration document: - - - - - - - -
    - - -
    - -
    Feature Elements
    - You must declare the feature element(s) below in your configuration document: -
    -
    - - - - - - - - - - - {!item.support = (new BBTag.Support()) !} - - {!item.support.populateByString(item.type)!} - - {!item.support.populateBySymbol(data)!} - +

    Supported Platform(s)

    + {! + if(data.support.supportStrings.length) { + output += "
    ";
    +                }
    +
    +                for (var ll = 0; ll < data.support.supportStrings.length; ll++) {
    +                    output += "- " + data.support.supportStrings[ll];
    +                    if (ll != data.support.supportStrings.length - 1) {
    +                        output += "
    "; + } + } + + if(data.support.supportStrings.length) { + output += "
    "; + } + !} +

    + View Supported Platform Table +

    +
    +
    - Feature ID - - - OS 5.0 - - - OS 6.0 - - - OS 7.0 - - - PlayBook - - - Ripple - -
    + {+ BBTag.tableHeader("API") +} + + - -
    - <feature id="{+item.desc+}" /> + + {+new Link().toSymbol(item.alias).withText(getSymbolName(item))+} {+item.support.supportTable+}
    -
    -
    - This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application. -
    - -
    - - - - {! var mandatory = data.permission.filter(function($){return !$.isOptional}).sort(makeSortby("name"));!} - {! var optional = data.permission.filter(function($){return $.isOptional}).sort(makeSortby("name"));!} - - -
    - - - - - - - -
    - - - - - - -
    - -
    Permission Elements (PlayBook Only)
    - You must declare the permission element(s) below in your configuration document: -
    - - <rim:permit>{+item.name+}</rim:permit> {+item.desc+} -
    -
    -
    - Note: Declaring the permission element(s) below in your configuration document is optional.
    -
    - - <rim:permit>{+item.name+}</rim:permit> {+item.desc+} -
    -
    - This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. -
    -
    - - - -
    -

    Constructors

    -
      - -
    • - {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} - - ** - {! hasDeprecation = true; deprecationSupport.populateBySymbol(member); !} - -
    • -
      -
    -
    -
    - - - {! - var hasDeprecation = false; - var deprecationSupport = new BBTag.Support(); - !} - - - - {! - var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias && isMethod($)}); - var memberContributors = []; - borrowedMembers.map(function($) {if (memberContributors.indexOf($.memberOf) < 0) memberContributors.push($.memberOf)}); - !} - - - {!var methodSupport =new BBTag.Support(data.methods.filter(isMethod));!} -
    -
    -

    Functions

    - - - -
      - -
    • - {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} - - ** - {! hasDeprecation = true; deprecationSupport.populateBySymbol(member); !} - -
    • -
      -
    -
    - - - -
    - {! - for (var i = 0, l = memberContributors.length; i < l; i++) { - output += - "
    Functions inherited from class "+new Link().toSymbol(memberContributors[i])+":
    " - + - "
    " + - borrowedMembers - .filter( - function($) { return $.memberOf == memberContributors[i] } - ) - .sort(makeSortby("name")) - .map( - function($) { return ""+ new Link().toSymbol($.alias).withText($.name)+"" } - ) - .join(", ") - + - "
    "; - } - !} -
    -
    - - -
    -
    - - - - {! - var borrowedEvents = data.events.filter(function($) {return $.memberOf != data.alias && isEvent($)}); - var eventContributors = []; - borrowedEvents.map(function($) {if (eventContributors.indexOf($.memberOf) < 0) eventContributors.push($.memberOf)}); - !} - - - - {!var eventSupport =new BBTag.Support(data.events.filter(isEvent));!} -
    -
    -

    Events

    - - - -
      - -
    • - {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} - - ** - {!hasDeprecation = true; deprecationSupport.populateBySymbol(member);!} - -
    • -
      -
    -
    - - - -
    - {! - for (var i = 0, l = eventContributors.length; i < l; i++) { - output += - "
    Events inherited from class "+new Link().toSymbol(eventContributors[i])+":
    " - + - "
    " + - borrowedEvents - .filter( - function($) { return $.memberOf == eventContributors[i] } - ) - .sort(makeSortby("name")) - .map( - function($) { return ""+ new Link().toSymbol($.alias).withText($.name)+"" } - ) - .join(", ") - + - "
    "; - } - !} -
    -
    - - -
    -
    - - - {! - var borrowedProperties = data.properties.filter(function($) {return $.memberOf != data.alias && isProperty($)}); - var propertyContributors = []; - borrowedProperties.map(function($) {if (propertyContributors.indexOf($.memberOf) < 0) propertyContributors.push($.memberOf)}); - !} - - - - {!var propertySupport =new BBTag.Support(data.properties.filter(isProperty));!} -
    -
    -

    Properties

    - - - -
      - -
    • - {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} - - ** - {!hasDeprecation = true; deprecationSupport.populateBySymbol(member);!} - -
    • -
      -
    -
    - - -
    - {! - for (var i = 0, l = propertyContributors.length; i < l; i++) { - output += - "
    Properties inherited from class "+new Link().toSymbol(propertyContributors[i])+":
    " - + - "
    " + - borrowedProperties - .filter( - function($) { return $.memberOf == propertyContributors[i] } - ) - .sort(makeSortby("name")) - .map( - function($) { return ""+ new Link().toSymbol($.alias).withText($.name)+"" } - ) - .join(", ") - + - "
    "; - } - !} -
    -
    - - -
    -
    - - - {! - var borrowedConstants = data.properties.filter(function($) {return $.memberOf != data.alias && isConstant($)}); - var constantContributors = []; - borrowedConstants.map(function($) {if (constantContributors.indexOf($.memberOf) < 0) constantContributors.push($.memberOf)}); - !} - - - - {!var constantSupport =new BBTag.Support(data.properties.filter(isConstant));!} -
    -
    -

    Constants

    - - - -
      - -
    • - {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} - - ** - {!hasDeprecation = true; deprecationSupport.populateBySymbol(member);!} - -
    • + + + + + {+new Link().toSymbol(item.alias).withText(getSymbolName(item))+} + {+item.support.supportTable+} + + -
    -
    - - - -
    - {! - for (var i = 0, l = constantContributors.length; i < l; i++) { - output += - "
    Constants inherited from class "+new Link().toSymbol(constantContributors[i])+":
    " - + - "
    " + - borrowedConstants - .filter( - function($) { return $.memberOf == constantContributors[i] } - ) - .sort(makeSortby("name")) - .map( - function($) { return ""+ new Link().toSymbol($.alias).withText($.name)+"" } - ) - .join(", ") - + - "
    "; - } - !} -
    -
    - - +
    - - - {! - var borrowedURI = data.properties.filter(function($) {return $.memberOf != data.alias && isURIMethod($)}); - var URIContributors = []; - borrowedURI.map(function($) {if (URIContributors.indexOf($.memberOf) < 0) URIContributors.push($.memberOf)}); - !} - - - - {!var URISupport =new BBTag.Support(data.methods.filter(isURIMethod));!} -
    -
    -

    URI Functions

    + +{!/*********** Configuration Settings ***********/!} +
    +

    Configuration Document Settings

    +

    To use all of the API described for this object, you must ensure the following settings are in your configuration document:

    + +
    +

    You must declare the feature element(s) below in your configuration document:

    + + {+ BBTag.tableHeader("Feature ID") +} + + {! item.support = (new BBTag.Support()); !} + + {!item.support.populateByString(item.type)!} + + {!item.support.populateBySymbol(data)!} + + + + + +
    + <feature id="{+item.desc+}" /> + {+item.support.supportTable+} +
    + + This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application. +
    - - -
      - -
    • - {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} - - ** - {!hasDeprecation = true; deprecationSupport.populateBySymbol(member);!} - -
    • -
      -
    -
    - - - -
    + + +
    + {! - for (var i = 0, l = URIContributors.length; i < l; i++) { - output += - "
    URI inherited from class "+new Link().toSymbol(URIContributors[i])+":
    " - + - "
    " + - borrowedURI - .filter( - function($) { return $.memberOf == URIContributors[i] } - ) - .sort(makeSortby("name")) - .map( - function($) { return ""+ new Link().toSymbol($.alias).withText($.name)+"" } - ) - .join(", ") - + - "
    "; - } + mandatoryPermissions = data.permission.filter(function($){return !$.isOptional}).sort(makeSortby("name")); + optionalPermissions = data.permission.filter(function($){return $.isOptional}).sort(makeSortby("name")); !} -
    -
    - - -
    -
    - - - -
    - ** Marked for Deprecation -
    -
    - - - - -
    -

    {+getSymbolName(member)+}

    -
    - - - - - -
    - {+getSymbolName(member)+} - - {+makeSignature(member.params)+} - -
    -
    - - - - - - -
    -
    Deprecation Notice:
    - {+ resolveLinks(member.deprecated) +} -
    -
    - -
    Supported Platform(s)
    - -  - {+item+}
    -
    -
    - -
    Description
    -  {+resolveLinks(member.desc)+} - - -

    - - - - - - - {!var functionParams = member.params.filter(function($){return $.name.indexOf(".") == -1});!} - - {!var subParams = member.params.filter(function($){return $.name.indexOf(item.name+".") != -1});!} - - - - - - -
    - Parameter - - - Type - - - Description - -
    {+item.name+} - - {+ ((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+ makeCallbackSignature(subParams) +} - - {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} - -
    Optional
    -
    - [Default Value: {+item.defaultValue+}]

    - {+resolveLinks(item.desc)+} - -
    - -
    - {+subItem.name.slice(subItem.name.indexOf(".")+1,subItem.name.length)+":"+} {+resolveLinks(subItem.desc)+} -
    -
    -

    -
    - - -
    -
    Code Example(s)
    - - - -
    -
    {+example+}
    -
    -
    -
    -
    - - - - - -
    -

    - {+getSymbolName(member)+} -

    -
    - - - - - -
    - static - {+new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')+}void - - [{+makeSignature(member.params).slice(1,-1)+}] - - {+member.name.replace(/\^\d+$/, '')+}{+makeSignature(member.params)+} - -
    -
    - - - - - - -
    -
    Deprecation Notice:
    - {+ resolveLinks(member.deprecated) +} -
    -
    - - -
    Supported Platform(s)
    - -  - {+item+}
    -
    -
    -
    - -
    Description
    -  {+resolveLinks(member.desc)+} - - -

    -
    Returns
    - - {+resolveLinks(item.desc)+} - -
    - - -

    - - - - - - - {!var functionParams = member.params.filter(function($){return $.name.indexOf(".") == -1});!} - - {!var subParams = member.params.filter(function($){return $.name.indexOf(item.name+".") != -1});!} - - - - - - -
    - Parameter - - - Type - - - Description - -
    {+item.name+} - - {+ ((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "") + makeCallbackSignature(subParams) +} - - {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} - -
    Optional
    -
    - [Default Value: {+item.defaultValue+}]

    - {+resolveLinks(item.desc)+} - -
    - -
    - {+subItem.name.slice(subItem.name.indexOf(".")+1,subItem.name.length)+":"+} {+resolveLinks(subItem.desc)+} -
    -
    -

    -
    - - - - - - - - - - - - - -
    - Throws - - - Description - -
    - {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} - - {+resolveLinks(item.desc)+} -
    -
    - - -
    -
    Code Example(s)
    - - - -
    -
    {+example+}
    -
    -
    -
    -
    -
    -
    - - - - -
    -

    - - {+getSymbolName(member)+} -

    -
    - - - - - -
    - static - {+new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')+}void - {+member.name.replace(/\^\d+$/, '')+}{+makeSignature(member.params)+} -
    -
    - - - - - - -
    -
    Deprecation Notice:
    - {+ resolveLinks(member.deprecated) +} -
    -
    - - -
    Supported Platform(s)
    - -  - {+item+}
    -
    -
    -
    - -
    Description
    -  {+resolveLinks(member.desc)+} - - -

    -
    Returns
    - - {+resolveLinks(item.desc)+} - -
    - - -

    - - - - - - - {!var functionParams = member.params.filter(function($){return $.name.indexOf(".") == -1});!} - - {!var subParams = member.params.filter(function($){return $.name.indexOf(item.name+".") != -1});!} - - - - - - -
    - Parameter - - - Type - - - Description - -
    {+item.name+} - - {+ ((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+ makeCallbackSignature(subParams) +} - - {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} - -
    Optional
    -
    - [Default Value: {+item.defaultValue+}]

    - {+resolveLinks(item.desc)+} - -
    - -
    - {+subItem.name.slice(subItem.name.indexOf(".")+1,subItem.name.length)+":"+} {+resolveLinks(subItem.desc)+} -
    -
    -

    -
    - - - - - - - - - - - - - -
    - Throws - - - Description - -
    - {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} - - {+resolveLinks(item.desc)+} -
    -
    - - -
    -
    Code Example(s)
    - - - -
    -
    {+example+}
    -
    + + +
    +

    You must declare the permission element(s) below in your configuration document:

    +
    +
    + + + + + + + + + - - - - - - {!var ownPropertySupport = new BBTag.Support(ownProperties)!} -
    -

    Properties:

    -
    - -
    Permission Elements (PlayBook Only)
    + - <rim:permit>{+item.name+}</rim:permit> {+item.desc+} +
    +
    - - - - - - - - - - - - - - - - - -
    - Property - - - Type - - - Description - - - Supported Platform(s) - -
    {+getSymbolName(member)+} - - Static
    -
    - - {+ ((member.type)?(new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')) : "") + makeCallbackSignature(member.params) +} - - {+((member.type)?(new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')) : "")+} - - - {+" = " +resolveLinks(member.defaultValue)+} - - -
    readonly -
    -
    {+resolveLinks(member.desc)+} - -
    - -
    - {+subItem.name+":"+} - {+resolveLinks(subItem.desc)+} -
    -
    - - - - - -
    - {+ resolveLinks(member.deprecated) +} -
    -
    -
    - - -  - {+item+} -
    -
    -
    -
    - - - -
    Code Example(s)
    - - - -
    -
    {+example+}
    -
    + + + +
    + Note: Declaring the permission element(s) below in your configuration document is optional. +
    + +
    + + + + - <rim:permit>{+item.name+}</rim:permit> {+item.desc+} +
    +
    -
    -
    -
    - - - - {!var ownConstantSupport = new BBTag.Support(ownConstants)!} -
    -

    Constants:

    -
    - - - - - - - - - - - - - - - - - -
    - Constant - - - Type - - - Description - - - Supported Platform(s) - -
    - {+getSymbolName(member)+} - {+new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')+} - - {+" = " + resolveLinks(member.defaultValue)+} - - {+resolveLinks(member.desc)+} - - - - - -
    - {+ resolveLinks(member.deprecated) +} -
    -
    -
    - - -  - {+item+} -
    -
    -
    -
    -
    -
    - - - - - -
    -

    {+getSymbolName(member)+}

    -
    - -
    Description
    -  {+resolveLinks(member.desc)+} -
    - - -
    - - - - -
    -
    Deprecation Notice:
    - {+ resolveLinks(member.deprecated) +} -
    -
    - - -
    -
    Supported Platform(s)
    - -  - {+item+} -
    -
    -
    - - -
    - - - - - - - - - - - - - -
    - Parameter - - - Type - - - Description - -
    - {+item.name+} - - {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} - Optional - {+resolveLinks(item.desc)+}
    -
    - - -
    - - - - - - - - - - - -
    - Error Code - - - Description - -
    {+item.type+}{+resolveLinks(item.desc)+}
    -
    - - -
    -
    Returns
    - - - - -
    -
    {+resolveLinks(item.desc)+}
    -
    -
    - - - -
    -
    Code Example(s)
    - - - - -
    -
    {+example+}
    -
    -
    -
    -
    -
    -
    - - + + + This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. + +
    +
    + +
    + +{!/*********** Summary ***********/!} + {!var args = + { + ownChildren : [constructors, + ownMethods, + ownEvents, + ownProperties, + ownConstants, + ownURIMethods ], + headerText : ["Constructors", + "Functions", + "Events", + "Properties", + "Constants", + "URI Functions" ], + inheritedChildren : [[], + data.methods.filter(function($) {return $.memberOf != data.alias && isMethod($)}), + data.events.filter(function($) {return $.memberOf != data.alias && isEvent($)}), + data.properties.filter(function($) {return $.memberOf != data.alias && isProperty($)}), + data.properties.filter(function($) {return $.memberOf != data.alias && isConstant($)}), + data.methods.filter(function($) {return $.memberOf != data.alias && isURIMethod($)}) ], + supportTags : [data.support.supportTag, + (new BBTag.Support(data.methods.filter(function($) {return isMethod($)}))).supportTag, + (new BBTag.Support(data.events.filter(function($) {return isEvent($)}))).supportTag, + (new BBTag.Support(data.properties.filter(function($) {return isProperty($)}))).supportTag, + (new BBTag.Support(data.properties.filter(function($) {return isConstant($)}))).supportTag, + (new BBTag.Support(data.methods.filter(function($) {return isURIMethod($)}))).supportTag ] + } + !} + {+subtemplate("subtemplates/summary.tmpl",args)+} + +{!/*********** Constructor,Functions and Event Details ***********/!} + {!var args = + { + ownChildren : [constructors, + ownMethods, + ownEvents] + } + !} + {+subtemplate("subtemplates/functionDetails.tmpl",args)+} + +{!/*********** Properties and Constants Details ***********/!} + {!var args = + { + ownChildren : [ownProperties, + ownConstants], + headerText : ["Properties", + "Constants"] + } + !} + {+subtemplate("subtemplates/propertyDetails.tmpl",args)+} + +{!/*********** URI Function Details ***********/!} + {!var args = + { + ownChildren : [ownURIMethods] + } + !} + {+subtemplate("subtemplates/functionDetails.tmpl",args)+} + +{!/*********** Class-Wide examples ***********/!} +
    -

    Code Example(s)

    -
    - - - -
    -
    {+example+}
    -
    -
    + {+subtemplate("subtemplates/example.tmpl", {example: data.example, type: "Class"})+}
    - - - -
    -
    + +{!/*********** Footer ***********/!} +
    +
    ©{+JSDOC.opt.D.copyright+}
    Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+}
    - -
    - + +
    + diff --git a/build/BBTemplate/css/about.css b/build/BBTemplate/css/about.css deleted file mode 100644 index 1ce739c743..0000000000 --- a/build/BBTemplate/css/about.css +++ /dev/null @@ -1,132 +0,0 @@ - -body { - margin-top: 110px; - margin-left: 240px; - padding-top: 10px; -} - -.topicDiv { - position: absolute; - top: 90px; - padding-left: 10px; - padding-bottom: 5px; - left: 0px; - font-size: 14pt; - border-bottom:1px solid #898989; - width: 99%; -} - -.toc { - width: 220px; -} - -/*------------------------------------------------------------*/ - -html, body { - font-family: verdana,sans-serif; - font-size:9pt; - color:#484848; -} - -h3 -{ - color: #6C7B8B; - font-size:14pt; -} - -h4 -{ - color: #4C4646; - font-size: 12pt; - margin-bottom: 10px; -} - -a { - color: #0b78b2; - text-decoration: underline; -} - -iframe { - height:60px; - border:none; - -} - -.osTable -{ - background-color:White; -} - -.osTable th -{ - background-color:Silver; -} - -.osTable td -{ - border-left: solid 1px Silver; - border-right: solid 1px Silver; - border-bottom: solid 1px Silver; - text-align: center; -} - -.topicsTitle -{ - color: Green; - white-space:nowrap; - font-weight: bold; -} - -.topicsTd -{ - vertical-align: top; -} - -.topicsContainer -{ - border-width: 3px; - border-style: solid; - border-color: #ccc; - padding: 5px; - vertical-align: top; - margin: 5px; - background-color: #F5F5F5; - line-height: 20px; - width: 250px; -} - -.topicsContainer a -{ - margin-left: 10px; - white-space: nowrap; -} - -h4 a -{ - color: #4C4646; - text-decoration: none; -} - -.numberCol { - width: 20px; - vertical-align: top; - padding: 7px; - font-weight: bold; -} - -.commandStep { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -margin: 5px; -width : 70%; -background-color: #F5F5F5; -} - -.instructions -{ - color: Green; -} - diff --git a/build/BBTemplate/css/browser-ie.css b/build/BBTemplate/css/browser-ie.css deleted file mode 100644 index cb13afe397..0000000000 --- a/build/BBTemplate/css/browser-ie.css +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright 2010-2011 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -.scrollable { - position:absolute; - left: 250px; -} - -.mainHeader { - position: absolute; -} - -.toc { - width: 230px; - position: absolute; - left: 0px; - top: 97px; -} \ No newline at end of file diff --git a/build/BBTemplate/css/browser-other.css b/build/BBTemplate/css/browser-other.css deleted file mode 100644 index 15ae847758..0000000000 --- a/build/BBTemplate/css/browser-other.css +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright 2010-2011 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -.scrollable { - position:fixed; - right: 0px; - bottom: 0px; - overflow: auto; - left: 270px; -} - -.mainHeader { - position: fixed; -} - -.toc { - position: fixed; - bottom: 0px; - left: 0px; - top: 98px; - overflow:auto; - z-index: 1; - width: 245px; - padding-right: 8px; -} \ No newline at end of file diff --git a/build/BBTemplate/css/docs.css b/build/BBTemplate/css/docs.css deleted file mode 100644 index 443294e7c0..0000000000 --- a/build/BBTemplate/css/docs.css +++ /dev/null @@ -1,180 +0,0 @@ - -body { - margin-top: 220px; - padding-top: 10px; -} - -.topicDiv { - position: absolute; - top: 90px; - padding-left: 10px; - padding-bottom: 5px; - left: 0px; - font-size: 14pt; - border-bottom:1px solid #898989; - width: 99%; - height: 125px; -} - - - -/*------------------------------------------------------------*/ - -.toc { - font-size:9pt; -} - -.toc td { - width: 231px; - vertical-align: top; -} - -.toc table { - width:100%; - margin-top: 0px; - border-top: 1px solid #898989; -} - -.toc .title { - font-weight: bold; - margin-bottom: 5px; - color: #484848; -} - -.toc .lineItem { - position: relative; - left: 7px; - margin-top: 4px; -} - -.toc .lineItem a { - color: #0b78b2; - text-decoration: none; -} - -.toc .lineItem a:hover { - text-decoration: underline; -} - -.toc .section { - margin-top: 5px; -} - - -/*------------------------------------------------------------*/ - - - - - - - - -html, body { - font-family: verdana,sans-serif; - font-size:9pt; - color:#484848; -} - -h3 -{ - color: #6C7B8B; - font-size:14pt; -} - -h4 -{ - color: #4C4646; - font-size: 12pt; - margin-bottom: 10px; -} - -a { - color: #0b78b2; - text-decoration: underline; -} - -iframe { - height:60px; - border:none; - -} - -.osTable -{ - background-color:White; -} - -.osTable th -{ - background-color:Silver; -} - -.osTable td -{ - border-left: solid 1px Silver; - border-right: solid 1px Silver; - border-bottom: solid 1px Silver; - text-align: center; -} - -.topicsTitle -{ - color: Green; - white-space:nowrap; - font-weight: bold; -} - -.topicsTd -{ - vertical-align: top; -} - -.topicsContainer -{ - border-width: 3px; - border-style: solid; - border-color: #ccc; - padding: 5px; - vertical-align: top; - margin: 5px; - background-color: #F5F5F5; - line-height: 20px; - width: 250px; -} - -.topicsContainer a -{ - margin-left: 10px; - white-space: nowrap; -} - -h4 a -{ - color: #4C4646; - text-decoration: none; -} - -.numberCol { - width: 20px; - vertical-align: top; - padding: 7px; - font-weight: bold; -} - -.commandStep { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -margin: 5px; -width : 70%; -background-color: #F5F5F5; -} - -.instructions -{ - color: Green; -} - diff --git a/build/BBTemplate/css/headerStyle.css b/build/BBTemplate/css/headerStyle.css deleted file mode 100644 index 23b2853356..0000000000 --- a/build/BBTemplate/css/headerStyle.css +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright 2010-2011 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -.mainHeader { - padding: 0; - margin: 0; - width:100%; - border-top:1px solid #898989; - font-family: Verdana; - font-size:13px; - background:url('../images/header_back.png') repeat-x 0px top; - top: 0px; - left: 0px; -} - -.headerBackground { - margin: 0 auto; - overflow: hidden; - height:75px; - padding:30px 7px 0; - background:url('../images/header_back_inner.png') no-repeat center top; -} - -.headerIcon { - background:url('../images/icon.png') no-repeat left top; - width: 400px; - top: 5px; - height: 75px; - position: absolute; -} - - - - diff --git a/build/BBTemplate/css/toc.css b/build/BBTemplate/css/toc.css deleted file mode 100644 index a53ee9b73c..0000000000 --- a/build/BBTemplate/css/toc.css +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright 2010-2011 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -.toc { - padding-bottom: 30px; - border-right:1px solid #898989; - padding-top: 15px; -} - -.toc .title { - font-weight: bold; - margin-bottom: 5px; - color: #484848; -} - -.toc .lineItem { - position: relative; - left: 7px; - margin-top: 4px; - white-space:nowrap; -} - -.toc .lineItem a { - color: #0b78b2; - text-decoration: none; - white-space:nowrap; -} - -.toc .lineItem a:hover { - text-decoration: underline; -} - -.toc .section { - margin-top: 15px; - margin-left: 10px; -} - -#featureIds .lineItem { - margin-left: 5px; -} - -.tocFilter { - margin-left: 10px; -} diff --git a/build/BBTemplate/ditamap.tmpl b/build/BBTemplate/ditamap.tmpl new file mode 100644 index 0000000000..91ef9a2ff0 --- /dev/null +++ b/build/BBTemplate/ditamap.tmpl @@ -0,0 +1,69 @@ + + +{! + +function DitaMapLink() {} +DitaMapLink.prototype = new Link(); +DitaMapLink.prototype.constructor = DitaMapLink; +Link.prototype.toString = DitaMapLink.prototype.toString; //Must do this to keep track of the function +DitaMapLink.prototype.toString = function () { + var hrefLink = Link.prototype.toString.call(this), + re = new RegExp('^(?:.*)(?:.*)(?:<[//]a>$)'); + return hrefLink.replace(re,'$1'); +}; + + +var prevTocType, + i=0, + tocSymbols, + tocSupport; + +!} + + + + +{!/*Don't know if the index is needed for the Ditamap and if so how? + + +*/!} + + + + + + {+thisClass.toc.desc+} + + + + + + {! + tocSymbols = data.filter(function($){return $.toc.type == thisClass.toc.type}); + tocSupport = new BBTag.Support(tocSymbols); + !} + + {+thisClass.toc.type+} + + {+thisClass.toc.desc+} + + {!prevTocType = thisClass.toc.type;!} + + + + + diff --git a/build/BBTemplate/featureList.tmpl b/build/BBTemplate/featureList.tmpl deleted file mode 100644 index 93074c2f6e..0000000000 --- a/build/BBTemplate/featureList.tmpl +++ /dev/null @@ -1,35 +0,0 @@ - - -
    -
    -
    Topic Index | Object Index
    - -
    -
    - -
    {+new Link().toClass(thisClass.alias)+}
    -
    -
    -
    \ No newline at end of file diff --git a/build/BBTemplate/images/header_back.png b/build/BBTemplate/images/header_back.png deleted file mode 100644 index cc4a2bc0d9..0000000000 Binary files a/build/BBTemplate/images/header_back.png and /dev/null differ diff --git a/build/BBTemplate/images/header_back_inner.png b/build/BBTemplate/images/header_back_inner.png deleted file mode 100644 index d21077aa06..0000000000 Binary files a/build/BBTemplate/images/header_back_inner.png and /dev/null differ diff --git a/build/BBTemplate/images/icon.png b/build/BBTemplate/images/icon.png deleted file mode 100644 index 19c125d41e..0000000000 Binary files a/build/BBTemplate/images/icon.png and /dev/null differ diff --git a/build/BBTemplate/images/title_header.png b/build/BBTemplate/images/title_header.png deleted file mode 100644 index f140b8fc82..0000000000 Binary files a/build/BBTemplate/images/title_header.png and /dev/null differ diff --git a/build/BBTemplate/publish.js b/build/BBTemplate/publish.js index 232af3c260..34820a00dd 100644 --- a/build/BBTemplate/publish.js +++ b/build/BBTemplate/publish.js @@ -38,10 +38,12 @@ function publish(symbolSet) { } // create the folders and subfolders to hold the output - IO.mkPath((publish.conf.outDir + publish.conf.cssDir)); IO.mkPath((publish.conf.outDir + publish.conf.imagesDir)); + /* These paths are no longer used + IO.mkPath((publish.conf.outDir + publish.conf.cssDir)); IO.mkPath((publish.conf.outDir + publish.conf.jsDir)); IO.mkPath((publish.conf.outDir + publish.conf.srcDir)); + */ // used to allow Link to check the details of things being linked to Link.symbolSet = symbolSet; @@ -49,8 +51,10 @@ function publish(symbolSet) { // create the required templates try { var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl"); - var tocTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"toc.tmpl"); - var featureListTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"featureList.tmpl"); + // var ditamapTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"ditamap.tmpl"); + var JSONTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"JSON.tmpl"); + var PHPTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"PHP.tmpl"); + // var viewableClassTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"viewableClass.tmpl"); } catch(e) { print("Couldn't create the required templates: " + e); @@ -61,19 +65,10 @@ function publish(symbolSet) { function hasNoParent($) {return ($.memberOf == "");}; function isaFile($) {return ($.is("FILE"));}; function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace) && !($.alias == "_global_");}; - + // get an array version of the symbolset, useful for filtering var symbols = symbolSet.toArray(); - /* create the hilited source code files - var files = JSDOC.opt.srcFiles; - for (var i = 0, l = files.length; i < l; i++) { - var file = files[i]; - var srcDir = publish.conf.outDir +publish.conf.srcDir; - makeSrcFile(file, srcDir); - } - */ - // get a list of all the classes in the symbolset var classes = symbols.filter(isaClass).sort(makeSortby("name")); @@ -87,7 +82,7 @@ function publish(symbolSet) { if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1; else filemapCounts[lcAlias]++; - Link.filemap[classes[i].alias] = + Link.filemap[classes[i].alias] = (filemapCounts[lcAlias] > 1)? lcAlias+"_"+filemapCounts[lcAlias] : lcAlias; } @@ -101,35 +96,36 @@ function publish(symbolSet) { symbol.methods = symbol.getMethods(); // 2 Link.currentSymbol = symbol; - var output = ""; - output = classTemplate.process(symbol); + Link.base=""; - IO.saveFile(publish.conf.outDir+"/"+publish.conf.symbolsDir, ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output); + var output = classTemplate.process(symbol); + IO.saveFile(publish.conf.outDir, ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output); } // Generate the toc page Link.base = ""; - function hasTOC($) {return ($.toc)} - var classes = classes.filter(hasTOC).sort(makeTocSort()); - publish.classesIndex = tocTemplate.process(classes); - IO.saveFile(publish.conf.outDir, "toc"+publish.conf.ext, publish.classesIndex); + var classes = classes.filter(function ($) {return ($.toc)} ).sort(makeTocSort()); + + // var processedDitamap = ditamapTemplate.process(classes); + // IO.saveFile(publish.conf.outDir, "toc.ditamap", processedDitamap); + + var processedJSON = JSONTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "menu-apis.php.json", processedJSON); - // Create the feature list page - classes = symbols.filter(isaClass).sort(makeSortby("alias")); - var featureList = featureListTemplate.process(classes); - IO.saveFile(publish.conf.outDir, "list" + publish.conf.ext, featureList); - featureListTemplate = featureList = classes = null; + var processedPHP = PHPTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "menu-apis.php", processedPHP); // COPY FILES // CSS files - copyFiles(publish.conf.templatesDir+"/"+publish.conf.cssDir,publish.conf.outDir+"/"+publish.conf.cssDir ); + // copyFiles(publish.conf.templatesDir+"/"+publish.conf.cssDir,publish.conf.outDir+"/"+publish.conf.cssDir ); // Static files copyFiles(publish.conf.templatesDir+"/"+publish.conf.staticDir,publish.conf.outDir ); // Image Files - copyFiles(publish.conf.templatesDir+"/"+publish.conf.imagesDir,publish.conf.outDir+"/"+publish.conf.imagesDir ); + // copyFiles(publish.conf.templatesDir+"/"+publish.conf.imagesDir,publish.conf.outDir+"/"+publish.conf.imagesDir ); // JS Files - copyFiles(publish.conf.templatesDir+"/"+publish.conf.jsDir,publish.conf.outDir+"/"+publish.conf.jsDir ); + // copyFiles(publish.conf.templatesDir+"/"+publish.conf.jsDir,publish.conf.outDir+"/"+publish.conf.jsDir ); + } function copyFiles(srcDir, destDir) { @@ -276,9 +272,9 @@ function makeSignature(params) { /** Build output for displaying Callback function parameters. * These differ because - * callbacks only have subParams (will not be filtered), + * callbacks only have subParams (will not be filtered), * the names of the params are sliced - * the type is a link to the actual type + * the type is a link to the actual type **/ function makeCallbackSignature(params) { if (!params) return "()"; @@ -302,7 +298,7 @@ function makeCallbackSignature(params) { /** Find symbol {@link ...} strings in text and turn into html links */ function resolveLinks(str, from) { - str = str.replace(/\{@link ([^} ]+) ?\}/gi, + str = str.replace(/\{@link ([^} ]+) ?\}/gi, function(match, symbolName) { var symbol = JSDOC.Parser.symbols.getSymbol(symbolName); var textSymbolName = symbol ? getSymbolName(symbol) : symbolName; @@ -329,7 +325,7 @@ function resolveLinks(str, from) { return str; } -function getSymbolName(symbol) { +function getSymbolName(symbol, forSummary) { if(symbol.is('CONSTRUCTOR')){ return symbol.alias.replace(/\^\d+$/, '').toString().replace(/\|/g, ' | '); }else if (symbol.constructedBy){ @@ -337,8 +333,8 @@ function getSymbolName(symbol) { }else if (symbol.squareAccessor) { return "[]"; } else if (symbol.uri) { - return "webworks://" + symbol.alias.replace(/\./g, "/").replace("[\^][\d]", ''); - } else if (symbol.isStatic) { + return "http://localhost:8472/" + symbol.alias.replace(/\./g, "/").replace("[\^][\d]", ''); + } else if (symbol.isStatic && !forSummary) { return symbol.memberOf + "." + symbol.name.replace(/\^\d+$/, '').replace("[\^][\d]", ''); } else { return symbol.name.replace(/\^\d+$/, '').replace("[\^][\d]", ''); @@ -347,7 +343,17 @@ function getSymbolName(symbol) { function isMethod($) {return (!$.isNamespace && !$.uri && !$.isConstant && !$.constructedBy);}; function isURIMethod($) {return (!$.isNamespace && $.uri && !$.isConstant && !$.constructedBy);}; -function isConstructor($) {return (!$.isNamespace && !$.uri && !$.isConstant && $.constructedBy);}; +function isConstructor($) {return ((!$.isNamespace && !$.uri && !$.isConstant && $.constructedBy) || ($.is('CONSTRUCTOR')));}; function isProperty($) {return (!$.isNamespace && !$.uri && !$.isConstant && !$.constructedBy);}; function isConstant($) {return (!$.isNamespace && !$.uri && $.isConstant && !$.constructedBy);}; function isEvent($) {return (!$.isNamespace && !$.uri && !$.isConstant && !$.constructedBy);}; + +function isBlank(str) { return (!str || /^\s*$/.test(str)); }; + +/** Include a sub-template in the current template, specifying a data object */ +function subtemplate(template, data) { + try { + return new JSDOC.JsPlate(publish.conf.templatesDir+template).process(data); + } + catch(e) { print(e.message); quit(); } +} diff --git a/build/BBTemplate/publish.js.orig b/build/BBTemplate/publish.js.orig new file mode 100644 index 0000000000..21e91d28c8 --- /dev/null +++ b/build/BBTemplate/publish.js.orig @@ -0,0 +1,382 @@ +/* +* Copyright 2010-2011 Research In Motion Limited. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/** Called automatically by JsDoc Toolkit. */ +function publish(symbolSet) { + publish.conf = { // trailing slash expected for dirs + ext : ".html", + outDir : JSDOC.opt.d || SYS.pwd + "../out/jsdoc/", + templatesDir : JSDOC.opt.t || SYS.pwd + "../templates/jsdoc/", + staticDir : "static/", + symbolsDir : "", + srcDir : "src/", + cssDir : "css/", + imagesDir : "images/", + jsDir : "javascript/", + templateName : "BBTest", + templateVersion : "0.1" + }; + + // is source output is suppressed, just display the links to the source file + if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) { + Link.prototype._makeSrcLink = function(srcFilePath) { + return "<" + srcFilePath + ">"; + } + } + + // create the folders and subfolders to hold the output + IO.mkPath((publish.conf.outDir + publish.conf.imagesDir)); + /* These paths are no longer used + IO.mkPath((publish.conf.outDir + publish.conf.cssDir)); + IO.mkPath((publish.conf.outDir + publish.conf.jsDir)); + IO.mkPath((publish.conf.outDir + publish.conf.srcDir)); + */ + + // used to allow Link to check the details of things being linked to + Link.symbolSet = symbolSet; + + // create the required templates + try { + var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl"); + // var ditamapTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"ditamap.tmpl"); + var JSONTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"JSON.tmpl"); + var PHPTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"PHP.tmpl"); + // var viewableClassTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"viewableClass.tmpl"); + } + catch(e) { + print("Couldn't create the required templates: " + e); + quit(); + } + + // some utility filters + function hasNoParent($) {return ($.memberOf == "");}; + function isaFile($) {return ($.is("FILE"));}; + function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace) && !($.alias == "_global_");}; + + // get an array version of the symbolset, useful for filtering + var symbols = symbolSet.toArray(); + + // get a list of all the classes in the symbolset + var classes = symbols.filter(isaClass).sort(makeSortby("name")); + + // create a filemap in which outfiles must be to be named uniquely, ignoring case + if (JSDOC.opt.u) { + var filemapCounts = {}; + Link.filemap = {}; + for ( var i = 0, l = classes.length; i < l; i++) { + var lcAlias = classes[i].alias.toLowerCase(); + + if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1; + else filemapCounts[lcAlias]++; + + Link.filemap[classes[i].alias] = + (filemapCounts[lcAlias] > 1)? + lcAlias+"_"+filemapCounts[lcAlias] : lcAlias; + } + } + + // create each of the class pages + for ( var i = 0, l = classes.length; i < l; i++) { + var symbol = classes[i]; + + symbol.events = symbol.getEvents(); // 1 order matters + symbol.methods = symbol.getMethods(); // 2 + + Link.currentSymbol = symbol; + Link.base=""; + + var output = classTemplate.process(symbol); + IO.saveFile(publish.conf.outDir, ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output); + } + + // Generate the toc page + Link.base = ""; +<<<<<<< HEAD + + var classes = classes.filter(function ($) {return ($.toc)} ).sort(makeTocSort()); + + // var processedDitamap = ditamapTemplate.process(classes); + // IO.saveFile(publish.conf.outDir, "toc.ditamap", processedDitamap); + + var processedJSON = JSONTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "menu-apis.php.json", processedJSON); + + var processedPHP = PHPTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "menu-apis.php", processedPHP); +======= + function hasTOC($) {return ($.toc)} + var classes = classes.filter(hasTOC).sort(makeTocSort()); + + publish.classesIndex = tocTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "toc"+publish.conf.ext, publish.classesIndex); + + // Create the feature list page + classes = symbols.filter(isaClass).sort(makeSortby("alias")); + var featureList = featureListTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "list" + publish.conf.ext, featureList); + featureListTemplate = featureList = classes = null; +>>>>>>> blackberry-webworks/master + + // COPY FILES + // CSS files + // copyFiles(publish.conf.templatesDir+"/"+publish.conf.cssDir,publish.conf.outDir+"/"+publish.conf.cssDir ); + // Static files + copyFiles(publish.conf.templatesDir+"/"+publish.conf.staticDir,publish.conf.outDir ); + // Image Files +<<<<<<< HEAD + // copyFiles(publish.conf.templatesDir+"/"+publish.conf.imagesDir,publish.conf.outDir+"/"+publish.conf.imagesDir ); +======= + copyFiles(publish.conf.templatesDir+"/"+publish.conf.imagesDir,publish.conf.outDir+"/"+publish.conf.imagesDir ); +>>>>>>> blackberry-webworks/master + // JS Files + // copyFiles(publish.conf.templatesDir+"/"+publish.conf.jsDir,publish.conf.outDir+"/"+publish.conf.jsDir ); + +} + +function copyFiles(srcDir, destDir) { + if (IO.exists(srcDir)) { + var files = IO.ls(srcDir); + for ( var i = 0; i < files.length; i++) { + IO.copyFile(files[i], destDir); + } + } +} + + +/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */ +function summarize(desc) { + if (typeof desc != "undefined") + return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i) ? RegExp.$1 : desc; +} + +/** Make a symbol sorter by some attribute. */ +function makeSortby(attribute) { + return function(a, b) { + try{ + if (a[attribute] != undefined && b[attribute] != undefined) { + if (a[attribute].toLowerCase && b[attribute].toLowerCase) { + a = a[attribute].toLowerCase(); + b = b[attribute].toLowerCase(); + } + if (a < b) return -1; + if (a > b) return 1; + return 0; + } + } catch (e) { + print("Couldn't sort by attribute " + attribute + ": " + e); + } + } +} + +/** Make a symbol sorter by some attribute. */ +function makeNameSort() { + return function(a, b) { + try { + a = getSymbolName(a); + b = getSymbolName(b); + if (a < b) + return -1; + if (a > b) + return 1; + return 0; + } catch (e) { + print("Couldn't sort by attribute " + attribute + ": " + e); + } + } +} + +function makeSpecialSortby(attribute1, attribute2) { + return function(a, b) { + try { + if (a[attribute1] != undefined && a[attribute1][attribute2] != undefined && b[attribute1] != undefined && b[attribute1][attribute2] != undefined ) { + a = a[attribute1][attribute2].toLowerCase(); + b = b[attribute1][attribute2].toLowerCase(); + if (a < b) return -1; + if (a > b) return 1; + return 0; + } + } catch (e) { + print("Couldn't sort by attribute " + attribute + ": " + e); + } + } +} + +function makeTocSort() { + return function(a, b) { + try { + var baseAttribute = "toc"; + var subAttribute1 = "type"; + var subAttribute2 = "desc"; + if (a[baseAttribute] != undefined && + a[baseAttribute][subAttribute1] != undefined && + a[baseAttribute][subAttribute2] != undefined && + b[baseAttribute] != undefined && + a[baseAttribute][subAttribute1] != undefined && + b[baseAttribute][subAttribute2] != undefined ) { + a = a[baseAttribute][subAttribute1].toLowerCase() + a[baseAttribute][subAttribute2].toLowerCase(); + b = b[baseAttribute][subAttribute1].toLowerCase() + b[baseAttribute][subAttribute2].toLowerCase(); + //print("Comparing " + a + " and " +b + " and result is " + (a>b?1:(a b) return 1; + return 0; + } + } catch (e) { + print("Couldn't sort by attribute " + attribute + ": " + e); + } + } +} + +/** Pull in the contents of an external file at the given path. */ +function include(path) { + var path = publish.conf.templatesDir + path; + return IO.readFile(path); +} + +/** Turn a raw source file into a code-hilited page in the docs. */ +function makeSrcFile(path, srcDir, name) { + if (JSDOC.opt.s) return; + + if (!name) { + name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_"); + name = name.replace(/\:/g, "_"); + } + + var src = {path: path, name:name, charset: IO.encoding, hilited: ""}; + + if (defined(JSDOC.PluginManager)) { + JSDOC.PluginManager.run("onPublishSrc", src); + } + + if (src.hilited) { + IO.saveFile(srcDir, name + publish.conf.ext, src.hilited); + } +} + +/** Build output for displaying function parameters. */ +function makeSignature(params) { + if (!params) return "()"; + var signature = "(" + + + params.filter( + function($) { + return $.name.indexOf(".") == -1; // don't show config params in signature + } + ).map( + function($) { + if ($.isOptional) { + return "[" + $.name + ": " + $.type + "]"; + } else { + return $.name + " : " + $.type; + } + } + ).join(", ") + + + ")"; + return signature; +} + +/** Build output for displaying Callback function parameters. + * These differ because + * callbacks only have subParams (will not be filtered), + * the names of the params are sliced + * the type is a link to the actual type + **/ +function makeCallbackSignature(params) { + if (!params) return "()"; + var signature = "(" + + + params.map( + function($) { + var name = ($.name.indexOf(".") != -1) ? ($.name.slice($.name.indexOf('.')+1, $.name.length)) : $.name; + var type = (($.type)?(new Link().toSymbol($.type)) : ""); + if ($.isOptional) { + return "[" + name + ": " + type + "]"; + } else { + return name + " : " + type; + } + } + ).join(", ") + + + ")"; + return signature; +} + +/** Find symbol {@link ...} strings in text and turn into html links */ +function resolveLinks(str, from) { + str = str.replace(/\{@link ([^} ]+) ?\}/gi, + function(match, symbolName) { + var symbol = JSDOC.Parser.symbols.getSymbol(symbolName); + var textSymbolName = symbol ? getSymbolName(symbol) : symbolName; + return new Link().toSymbol(symbolName).withText(textSymbolName); + }); + + str = str.replace(/\{@image ([^} ]+) ?\}/gi, + function(match, symbolName) { + + // Find filename independant of slashes used + var fileName = symbolName.substring(symbolName.lastIndexOf("\\") + 1); + var fileName = symbolName.substring(symbolName.lastIndexOf("/") + 1); + // Try catch to ignore missing files + // Use for loop to try all source locations + try { + for ( var i = 0; i < JSDOC.opt._.length; i++) { + IO.copyFile(JSDOC.opt._[i]+"/"+symbolName, publish.conf.outDir+"/"+publish.conf.imagesDir); + } + }catch(e){} + return ""; + } + ); + + return str; +} + +function getSymbolName(symbol, forSummary) { + if(symbol.is('CONSTRUCTOR')){ + return symbol.alias.replace(/\^\d+$/, '').toString().replace(/\|/g, ' | '); + }else if (symbol.constructedBy){ + return symbol.constructedBy.toString().replace("[\^][\d]", ''); + }else if (symbol.squareAccessor) { + return "[]"; + } else if (symbol.uri) { +<<<<<<< HEAD + return "webworks://" + symbol.alias.replace(/\./g, "/").replace("[\^][\d]", ''); + } else if (symbol.isStatic && !forSummary) { +======= + return "http://localhost:8472/" + symbol.alias.replace(/\./g, "/").replace("[\^][\d]", ''); + } else if (symbol.isStatic) { +>>>>>>> blackberry-webworks/master + return symbol.memberOf + "." + symbol.name.replace(/\^\d+$/, '').replace("[\^][\d]", ''); + } else { + return symbol.name.replace(/\^\d+$/, '').replace("[\^][\d]", ''); + } +} + +function isMethod($) {return (!$.isNamespace && !$.uri && !$.isConstant && !$.constructedBy);}; +function isURIMethod($) {return (!$.isNamespace && $.uri && !$.isConstant && !$.constructedBy);}; +function isConstructor($) {return ((!$.isNamespace && !$.uri && !$.isConstant && $.constructedBy) || ($.is('CONSTRUCTOR')));}; +function isProperty($) {return (!$.isNamespace && !$.uri && !$.isConstant && !$.constructedBy);}; +function isConstant($) {return (!$.isNamespace && !$.uri && $.isConstant && !$.constructedBy);}; +function isEvent($) {return (!$.isNamespace && !$.uri && !$.isConstant && !$.constructedBy);}; + +function isBlank(str) { return (!str || /^\s*$/.test(str)); }; + +/** Include a sub-template in the current template, specifying a data object */ +function subtemplate(template, data) { + try { + return new JSDOC.JsPlate(publish.conf.templatesDir+template).process(data); + } + catch(e) { print(e.message); quit(); } +} diff --git a/build/BBTemplate/static/common.css b/build/BBTemplate/static/common.css deleted file mode 100644 index ca9664a323..0000000000 --- a/build/BBTemplate/static/common.css +++ /dev/null @@ -1,360 +0,0 @@ -/* -* Copyright 2010-2011 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - - -.scrollable { - top: 98px; -} - -.topicDiv { - position: absolute; - height:33px; - top: 65px; - text-align:center; - padding-bottom: 5px; - padding-top:2px; - left: 0px; - font-size: 14pt; - background:url('images/title_header.png') repeat-x 0px top; - width: 100%; -} - -.featureList { - width: 280px; -} - -/*------------------------------------------------------------*/ - -table.noticeTable { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -margin: 5px; -margin-bottom:15px; -width : 90%; -background-color: #FAF8CC; -} - -td.noticeTd { -color: #484848; -vertical-align: top; -background-color: #FAF8CC; -} - - -table.depricationTable { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -margin: 5px; -margin-bottom:15px; -width : 90%; -background-color: #FAF8CC; -} - -td.depricationTd { -color: #484848; -vertical-align: top; -background-color: #FAF8CC; -} - - -a { - color: #0b78b2; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -.propertyName { - text-decoration: none; - font-weight:bold; - color:#484848; -} - -.propertyName:hover { - text-decoration:none; - color:#484848; -} - -.depricate { - font-style: italic; - font-size:8pt; -} - -.nowrap { - white-space:nowrap; -} - -.ulNoTopMargin { - margin-top:0px; -} - -h1, h3{ - font-size: 12pt; -} - -h2 { - margin-top: 30px; -} - -h2 a { - text-decoration: none; - color:#484848; -} - -h2 a:hover { - text-decoration:none; - color:#484848; -} - -.downloadTable { - background-color: #FAF8CC; - margin-bottom: 15px; - margin-top: 15px; - border-width: 1px; - border-style: solid; - border-color: #ccc; - width : 70%; -} - -.downloadTable .title { - font-weight: bold; -} - -.downloadTable ol { - margin-bottom: 10px; -} - - -.headerBar { - background-color: Black; - color: White; - padding: 5px; -} - - -#codeExpand { - text-decoration: underline; - font-weight: normal; - font-size: 10pt; - color: #1569C7; - cursor: pointer; -} - -/* =================== new inserted above this line ==================== */ - -.wiki-content p { -margin: 10px 0; -padding: 0; -} - -.wiki-content, -.wiki-content p, -.wiki-content table, -.wiki-content tr, -.wiki-content td, -.wiki-content th, -.wiki-content ol, -.wiki-content ul, -.wiki-content li { -font-size: 10pt; -line-height: 13pt; -} - -body, p, td, table, tr, .bodytext, .stepfield { -font-size: 10pt; -font-family: Verdana; -line-height: 1.3; -color: #484848; -font-weight: normal; -} - -.wiki-content .confluenceTable, .grid { -margin-left: 0; -margin-right: 0; -margin-top: 10px; -margin-bottom: 10px; -padding: 0; -} - -table.confluenceTable { -margin: 5px; -border-collapse: collapse; -} - -table { -clear: left; -} - -th.confluenceTh, table.confluenceTable th.confluenceTh { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -background-color: #f0f0f0; -text-align: left; -vertical-align: top; -} - -.wiki-content th.confluenceTh { -margin: 0; -padding: 0; -color: #484848; -} - -td.confluenceTd, td.confluenceTd { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -} - -table.confluenceTable { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -width :90%; -} - -.wiki-content td.confluenceTd { -margin: 0; -padding: 0; -padding-right: 10px; -} - -th.confluenceThnoverflow, table.confluenceTable th.confluenceThnoverflow { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -background-color: #f0f0f0; -text-align: left; -vertical-align: top; -width : 175px; -} - -.wiki-content th.confluenceThnoverflow { -margin: 0; -padding: 0; -color: #484848; -width : 175px; -} - -td.confluenceTdnoverflow, td.confluenceTdnoverflow { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -width : 175px; -} - -.wiki-content td.confluenceTdnoverdlow { -margin: 0; -padding: 0; -padding-right: 10px; -width : 175px; -} - -div.title { -font-weight : bold; -/*font-size: 12pt; Changed this */ -font-size: 10pt; -} - -div.smallTitle { -font-weight : bold; -font-size: 10pt; -} - -table.scriptTable { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -margin: 5px; -width : 90%; -background-color: #F5F5F5; -} - -td.scriptTd { -color: #484848; -vertical-align: top; -background-color: #F5F5F5; -} - -table.functionTable { -border-collapse: collapse; -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -margin: 5px; -vertical-align: top; -width :800px; -} - -td.functionHeaderTd { -color: #484848; -vertical-align: top; -background-color: #F5F5F5; -} - -td.functionTd { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: top; -width : 720px; -} - -td.functionCol1Td { -border-width: 1px; -border-style: solid; -border-color: #ccc; -padding: 5px; -vertical-align: center; -width : 80px; -} - - -dl.inheritsList -{ -list-style: square; -margin-left: 20px; -padding-left: 0; -width : 90%; -} -/*A:link {text-decoration: underline; color: #0b78b2} -A:visited {text-decoration: underline; color: #0b78b2} -A:hover {text-decoration: underline; color: navy;} - -A.details:link {text-decoration: underline; color: #0b78b2} -A.details:visited {text-decoration: underline; color: #0b78b2} -*/ - diff --git a/build/BBTemplate/static/header.html b/build/BBTemplate/static/header.html deleted file mode 100644 index 30b88b21cd..0000000000 --- a/build/BBTemplate/static/header.html +++ /dev/null @@ -1,21 +0,0 @@ - - -
    -
    -
    - -
    diff --git a/build/BBTemplate/static/index.html b/build/BBTemplate/static/index.html index 8ed34affc2..bb42a68f85 100644 --- a/build/BBTemplate/static/index.html +++ b/build/BBTemplate/static/index.html @@ -14,191 +14,52 @@ * limitations under the License. --> - - - - - - - - Welcome to the BlackBerry® WebWorks™ API Reference - - -
    -
    - - - - - -
    BlackBerry WebWorks application development provides APIs that help take your application to a new level. WebWorks APIs provide you access to - compelling technology that you can leverage to create engaging and visually stunning new apps that seamlessly connect to system-level functionallity on both BlackBerry smartphone and PlayBook tablet devices. -
    -
    - Start exploring the APIs and find out how you can interact with the BlackBerry ecosystem: from built-in features such as GPS and the camera and video recorder, to push services on smartphones - and the BlackBerry Enterprise Server.

    - Download the latest BlackBerry WebWorks SDK for Smartphones and Tablet OS -
    - -

    Learn more

    - - -
    - -

    Emulating BlackBerry WebWorks APIs

    -

    BlackBerry WebWorks applications can be emulated and tested without the use of a device Simulator for the majority of WebWorks APIs. - This is accomplished by the use of the BETA Ripple emulator which is currently implemented as a Chrome plug-in. As this BETA product evolves it will - eventually move away from its current implementation as a Chrome plug-in and grow into something even more powerful. Be sure to follow the BlackBerry Developer Blog for further updates surrounding the Ripple tooling.

    - -
    - -

    Preparing Your Environment

    -

    Before packaging your first BlackBerry WebWorks application, you will need to ensure that you have your environment properly configured. You can follow the Getting Started Guide for - BlackBerry Smartphones on Windows, and the Getting Started Guides for WebWorks on Tablet OS for either - Mac OS X or Windows.

    - - -

    You can download the BlackBerry WebWorks SDK for Smartphones and for - Tablet OS from the BlackBerry Developer Zone

    - - -
    - -

    Building Your First App Using BlackBerry WebWorks APIs

    -

    Creating your first WebWorks application that utilizes BlackBerry specific APIs is quite simple. The steps below will demonstrate the pattern to use when create an - application using a WebWorks API. Make sure you follow the "Preparing Your Environment" instructions right above this topic first before attempting the following steps. +

    +

    API Reference

    +

    Creating your first HTML5 application that utilizes BlackBerry WebWorks APIs is quite simple. The steps below will demonstrate the pattern to use when creating an + HTML5 application using BlackBerry APIs.

    +

    Building Your First HTML5 App Using BlackBerry WebWorks APIs

    - NOTE: The steps outlined below are the same for Windows and Mac OS X. However, the path examples given are sample Windows paths. + NOTE: The steps outlined below are the same for Windows and Mac OS X. However, the path examples given are sample Windows paths.

    - - - - - - - - - - - - - - - - - - - - - -
    1. -
    - Create the main HTML file for your BlackBerry WebWorks application by creating a directory that includes an index.html file.

    - C:\MyDirectory\index.html

    - Then add a simple BlackBerry specific API to your application's source code:

    - <html>
    -   <head>
    -     <meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no" />
    -     <script type="text/javascript" >
    -       function doAlert() {
    -         alert('The name of my app is: ' + blackberry.app.name);
    -       }
    -     </script>
    -   </head>
    -   <body onload="doAlert()" >
    -     <h1>Hello World</h1>
    -   </body>
    - </html>

    -
    -
    2. -
    - Now create a config.xml file for your app:

    - C:\MyDirectory\config.xml

    - Edit your config.xml file to include a <feature> declaration for your desired API:

    - <?xml version="1.0" encoding="utf-8"?>
    - <widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0" rim:header="RIM-Widget:rim/widget">
    -   <name>My App</name>
    -   <author>Me</author>
    -   <content src="index.html" />
    -   <feature id="blackberry.app" />
    - </widget>

    -
    -
    3. -
    - Add your index.html and config.xml to a ZIP file (myapp.zip):

    - myapp.zip
    -   |- index.html
    -   |- config.xml

    - Both files should be at the root of the ZIP archive -
    -
    4. -
    - Open a command prompt and change directories to the root of the WebWorks SDK install folder. If you find the bbwp application you will know you are in the root folder of the SDK.

    - Now run the command line utility to build up your application and place the output in the "C:\OutputDirectory"

    - bbwp "C:\myapp.zip" -o "C:\OutputDirectory"

    - >>[INFO]            Parsing command line options
    - >>[INFO]            Parsing bbwp.properties
    - >>[INFO]            Validating WebWorks archive
    - >>[INFO]            Parsing config.xml
    - >>[INFO]            Populating WebWorks source
    - >>[INFO]            Compiling WebWorks app
    - >>[INFO]            Generating output files
    - >>[INFO]            WebWorks packaging complete
    -
    -
    5. -
    - You now have an installable application for either a BlackBerry Smartphone or a BlackBerry PlayBook located in your specified output directory

    - C:\OutputDirectory\bin

    - For more detailed information please refer to the WebWorks SDK documentation for Tablet OS and BlackBerry Smartphones

    -
    -
    -
    - - \ No newline at end of file +
      +
    1. Create the main HTML file for your application by creating a directory that includes an index.html file.
      +
      C:\MyDirectory\index.html
      +Then add a simple BlackBerry WebWorks specific API to your application's source code: +
      +<html>
      +  <head>
      +    <meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no"/>
      +    <script type="text/javascript">
      +      function doAlert() {
      +        alert('The name of my app is: ' + blackberry.app.name);
      +      }
      +    </script>
      +  </head>
      +  <body onload="doAlert()">
      +  <h1>Hello World</h1>
      +  </body>
      +</html>
      +
      +
    2. +
    3. Now create a config.xml file for your app:
      +
      C:\MyDirectory\config.xml
      +Edit your config.xml file to include a <feature> declaration for your desired API: +
      +<?xml version="1.0" encoding="utf-8"?>
      +<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0">
      +  <name>My App</name>
      +  <author>Me</author>
      +  <content src="index.html"/>
      +  <feature id="blackberry.app"/>
      +</widget>
      +
      +
    4. +
    5. Open up your index.html file in the Ripple Emulator to test your application.
    6. +
    7. Package your application using BlackBerry WebWorks to load your app on a device or distribute through BlackBerry App World
    8. + +
    + +
    \ No newline at end of file diff --git a/build/BBTemplate/static/server.js b/build/BBTemplate/static/server.js deleted file mode 100644 index 479de11fe4..0000000000 --- a/build/BBTemplate/static/server.js +++ /dev/null @@ -1,304 +0,0 @@ -/* -* Copyright 2010-2011 Research In Motion Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -var deployMachine = 'http://it0000000049025/'; //include the http protocol and trailing slash -var deployFolder = 'jam_extensions_jars/'; //do not include a leading slash but keep the trailing slash - -var loading = 0; - -var deployUrl = deployMachine + deployFolder; - -var linkId = 'deploy-link'; - -var xmlhttp; - -var isIE = navigator.appName == 'Microsoft Internet Explorer'; - - -if (window.XMLHttpRequest) -{// code for IE7+, Firefox, Chrome, Opera, Safari - xmlhttp=new XMLHttpRequest(); -} -else -{// code for IE6, IE5 - xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); -} - -if(typeof window.addEventListener != 'undefined') -{ - //.. gecko, safari, konqueror and standard - window.addEventListener('load', doLoad, false); -} -else if(typeof document.addEventListener != 'undefined') -{ - //.. opera - document.addEventListener('load', doLoad, false); -} -else if(typeof window.attachEvent != 'undefined') -{ - //.. win/ie - window.attachEvent('onload', doLoad); -} - - -function doLoad() { - loadProperCSS(); - setDownloadLink(); - setHeaderBar(); - insertFooter(); - insertTOC(); - runFilter(); -} - -function loadProperCSS() { - var path; - - if (isIE) { - path = 'css/browser-ie.css'; - } - else { - path = 'css/browser-other.css'; - } - - // Insert the proper style sheet with the browser differences - var style = document.createElement('link'); - style.setAttribute('rel', 'stylesheet'); - style.setAttribute('type', 'text/css'); - style.setAttribute('href', path); - document.getElementsByTagName("head")[0].appendChild(style); -} - -function setDownloadLink() { - var jarAnchor = document.getElementById(linkId); - if(jarAnchor != undefined && jarAnchor != null) { - var pageName = extractPageName(jarAnchor.href); - jarAnchor.href = deployUrl + pageName; - } -} - -function extractPageName(fromUrl) { - return fromUrl.substring(fromUrl.lastIndexOf('/') + 1, fromUrl.length); -} - -/********************************************************************* -This function will inject the Header bar into the page by retrieving -the header.html file and then inserting a div at the top of the page -*********************************************************************/ -function setHeaderBar() { - // Now insert the header CSS - var style = document.createElement('link'); - style.setAttribute('rel', 'stylesheet'); - style.setAttribute('type', 'text/css'); - style.setAttribute('href', 'css/headerStyle.css'); - document.getElementsByTagName("head")[0].appendChild(style); - - // Retrieve the header - xmlhttp.open("GET","header.html",false); - xmlhttp.send(); - var responseText =xmlhttp.responseText; - - // Insert header - var headerDiv = document.createElement('div'); - headerDiv.innerHTML = responseText; - document.body.appendChild(headerDiv); - - // Insert our topic header - var topicDiv = document.createElement('div'); - topicDiv.setAttribute('class', 'topicDiv'); - topicDiv.setAttribute('className', 'topicDiv'); - topicDiv.innerHTML = document.title; - document.body.appendChild(topicDiv); -} - -/********************************************************************* -This function will inject the TOC bar into the page by retrieving -the toc.html file and then inserting a div at the left of the page -*********************************************************************/ -function insertTOC() { - - // Now insert the TOC CSS - var style = document.createElement('link'); - style.setAttribute('rel', 'stylesheet'); - style.setAttribute('type', 'text/css'); - style.setAttribute('href', 'css/toc.css'); - document.getElementsByTagName("head")[0].appendChild(style); - - var cookie = getCookie('index'); - var tocFile = ''; - if (cookie == 'feature') { - tocFile = 'list.html'; - } else { - tocFile = 'toc.html'; - } - - // Retrieve the TOC - xmlhttp.open("GET",tocFile,false); - xmlhttp.send(); - var responseText =xmlhttp.responseText; - - // Insert TOC - var tocDiv = document.createElement('div'); - tocDiv.innerHTML = responseText; - document.body.appendChild(tocDiv); - - // Adjust the mody margins for the feature list - if (tocFile == 'list.html') { - document.getElementById('content').style.left = '310px'; - document.getElementById('toc').style.width = '290px'; - // Now scroll the TOC by the amount saved in the Cookie - document.getElementById('toc').scrollTop = getCookie('indexScroll'); - } - else { - // Now scroll the TOC by the amount saved in the Cookie - document.getElementById('toc').scrollTop = getCookie('tocScroll'); - } - - - -} - -function runFilter() { - var search = null; - if (document.location.search != '') { - search = document.location.search.substring(1,document.location.search.length); - var exp = new Date(); //set new date object - exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30)); //set it 30 days ahead - setCookie('search',search, exp); - } - else { - search = getCookie('search'); - } - - if (search != null && search.length > 0) { - loading++; - // Find our section in the combo box - var filter = document.getElementById('filter'); - for (var i = 0; i < filter.options.length; i++) { - if (filter.options[i].value == search) { - filter.selectedIndex = i; - } - } - loading--; - - // Apply the visibilty filter based on the search string - var elements = getDesiredElements(document.body, 'x-ww-support'); - for (var i = 0; i < elements.length; i++) { - var target = elements[i]; - var x_ww_support = target.getAttribute('x-ww-support'); - if (x_ww_support.indexOf(search) < 0) { - target.style.display = 'none'; - } - } - } -} - - -/* This is a brute force way of getting elements so that it will continue to work -on IE6 */ -function getDesiredElements(element, attributeName) { - var results = new Array(); - if (element.getAttribute(attributeName) != null) - results.push(element); - - // Check child nodes - for (var i = 0; i < element.childNodes.length; i++) { - var child = element.childNodes[i]; - if (child.nodeType == 1){ - results = results.concat(getDesiredElements(child, attributeName)); - } - } - return results; -} - -function getURLMinusSearch() { - var index = document.location.href.indexOf(document.location.search); - return document.location.href.substring(0, index); -} - -function doFilterChange(select) { - if (loading != 0) return; - - var value = select.value; - if (value == 'all') { - var exp = new Date(); //set new date object - exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30)); //set it 30 days ahead - setCookie('search','', exp); - document.location.href = getURLMinusSearch(); - } - else { - document.location.href = getURLMinusSearch() + '?'+value; - } -} - - -function insertFooter() { - // Insert footer - var footerText = '

    Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.

    '; - var footerDiv = document.createElement('div'); - footerDiv.innerHTML = footerText; - document.getElementById('content').appendChild(footerDiv); -} - -function codeClick(divID,element) { - var divToHide = document.getElementById(divID); - if (divToHide.style.display == 'inline') { - divToHide.style.display = 'none'; - element.innerHTML = 'Expand'; - } - else { - divToHide.style.display = 'inline'; - element.innerHTML = 'Collapse'; - } -} - -function setCookie(name, value, expires) { - document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString()); -} - -function getCookie (name) { - var dc = document.cookie; - var cname = name + "="; - if (dc.length > 0) { - begin = dc.indexOf(cname); - if (begin != -1) { - begin += cname.length; - end = dc.indexOf(";", begin); - if (end == -1) - end = dc.length; - return unescape(dc.substring(begin, end)); - } - } - return null; -} - -function clickIndex(index) { - var exp = new Date(); //set new date object - exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30)); //set it 30 days ahead - setCookie('index',index, exp); - location.reload(true); -} - -function onTocScroll(toc) { - var exp = new Date(); //set new date object - exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30)); //set it 30 days ahead - setCookie('tocScroll',toc.scrollTop, exp); -} - -function onObjectIndexScroll(index){ - var exp = new Date(); //set new date object - exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30)); //set it 30 days ahead - setCookie('indexScroll',index.scrollTop, exp); -} diff --git a/build/BBTemplate/static/webworks.png b/build/BBTemplate/static/webworks.png deleted file mode 100644 index 44698c7bd6..0000000000 Binary files a/build/BBTemplate/static/webworks.png and /dev/null differ diff --git a/build/BBTemplate/subtemplates/example.tmpl b/build/BBTemplate/subtemplates/example.tmpl new file mode 100644 index 0000000000..1bdbfc7c4f --- /dev/null +++ b/build/BBTemplate/subtemplates/example.tmpl @@ -0,0 +1,14 @@ + +{!/*********** Examples ***********/!} + + {! + if(data.type==='Function' || data.type==='Property') { + output += "

    Code Example(s)

    "; + } else if (data.type==='Class') { + output += "

    Code Example(s)


    "; + } + !} + +
    {+example+}
    +
    +
    \ No newline at end of file diff --git a/build/BBTemplate/subtemplates/functionDetails.tmpl b/build/BBTemplate/subtemplates/functionDetails.tmpl new file mode 100644 index 0000000000..f8a2b781f1 --- /dev/null +++ b/build/BBTemplate/subtemplates/functionDetails.tmpl @@ -0,0 +1,156 @@ +{! +var functionParams, + subParams; +!} + + + +
    +

    + + {+getSymbolName(member)+} +

    +
    + + + + +
    + + {+getSymbolName(member,true)+} + + {+makeSignature(member.params)+} + + + static + {+new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')+}void + + [{+makeSignature(member.params).slice(1,-1)+}] + + {+getSymbolName(member,true)+}{+makeSignature(member.params)+} + + +
    +
    +
    + + + + +
    +

    Deprecation Notice:

    + {+ resolveLinks(member.deprecated) +} +
    +
    + + +

    Supported Platform(s)

    + +  - {+item+} +
    +
    +
    +
    + +

    Description

    +

    {+resolveLinks(member.desc)+}

    +
    + + +
    +

    Returns

    + + {+resolveLinks(item.desc)+} + +
    +
    + + +
    + + + + + + + {!functionParams = member.params.filter(function($){return $.name.indexOf(".") == -1});!} + + {!subParams = member.params.filter(function($){return $.name.indexOf(item.name+".") != -1});!} + + + + + + +
    + Parameter + + + Type + + + Description + +
    {+item.name+} + + {+ ((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "") + makeCallbackSignature(subParams) +} + + {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} + +
    Optional
    +
    + [Default Value: {+item.defaultValue+}]

    + {+resolveLinks(item.desc)+} + +
    + +
    + {+subItem.name.slice(subItem.name.indexOf(".")+1,subItem.name.length)+":"+} {+resolveLinks(subItem.desc)+} +
    +
    +

    +
    + + +
    + + + + + + + + + + + +
    + Error CodeThrows + + + Description + +
    + {+((item.type)?(new Link().toSymbol(item.type).toString().replace(/\|/g, ' | ')) : "")+} + + {+resolveLinks(item.desc)+} +
    +
    + + +
    +

    Returns

    + + + + +
    +
    {+resolveLinks(item.desc)+}
    +
    +
    + + {+subtemplate("subtemplates/example.tmpl", {example: member.example, type: "Function"})+} +
    +
    +
    +
    \ No newline at end of file diff --git a/build/BBTemplate/subtemplates/propertyDetails.tmpl b/build/BBTemplate/subtemplates/propertyDetails.tmpl new file mode 100644 index 0000000000..70f9594432 --- /dev/null +++ b/build/BBTemplate/subtemplates/propertyDetails.tmpl @@ -0,0 +1,94 @@ +{! + var childrenSupport, + i=-1; + +!} + + + {!i++;!} + + {!childrenSupport = new BBTag.Support(children)!} +
    +

    {+data.headerText[i]+}:

    +
    + + + + + + + + + + + + + + + + + + + +
    + Property + + + Type + + + Description + + + Supported Platform(s) + +
    + {+getSymbolName(member)+} + + + Static
    +
    + + {+ ((member.type)?(new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')) : "") + makeCallbackSignature(member.params) +} + + {+((member.type)?(new Link().toSymbol(member.type).toString().replace(/\|/g, ' | ')) : "")+} + + + {+" = " +resolveLinks(member.defaultValue)+} + + +
    readonly +
    +
    {+resolveLinks(member.desc)+} + +
    + +
    + {+subItem.name+":"+} + {+resolveLinks(subItem.desc)+} +
    +
    + + + + + +
    + {+ resolveLinks(member.deprecated) +} +
    +
    +
    + + +  - {+item+} +
    +
    +
    +
    + + + {+subtemplate("subtemplates/example.tmpl", {example: member.example, type: "Property"})+} + +
    +
    +
    \ No newline at end of file diff --git a/build/BBTemplate/subtemplates/summary.tmpl b/build/BBTemplate/subtemplates/summary.tmpl new file mode 100644 index 0000000000..96e3522457 --- /dev/null +++ b/build/BBTemplate/subtemplates/summary.tmpl @@ -0,0 +1,61 @@ +{! + //Setup + var hasDeprecation = false, + deprecationSupport = new BBTag.Support(), + i, + parentsChildren, + contributingParents = []; + for( i = 0; i +

    API Summary

    + + {! i++; !} + +
    +
    +

    {+header+}

    + +
      + +
    • + {+new Link().toSymbol(member.alias).withText(getSymbolName(member))+} + + ** + {! hasDeprecation = true; deprecationSupport.populateBySymbol(member); !} + +
    • +
      +
    +
    + +
    + +
    {+header +" inherited from class "+(new Link().toSymbol(parent))+": "+}
    +
    + {! parentsChildren = data.inheritedChildren[i].filter(function($) { return $.memberOf == parent }).sort(makeSortby("name")); !} + + + {+(new Link().toSymbol(parentsChild.alias).withText(parentsChild.name))+} + + +
    +
    +
    +
    +
    +
    +
    + + +
    +

    ** Marked for Deprecation

    +
    +
    + diff --git a/build/BBTemplate/toc.tmpl b/build/BBTemplate/toc.tmpl deleted file mode 100644 index eea55aaf59..0000000000 --- a/build/BBTemplate/toc.tmpl +++ /dev/null @@ -1,55 +0,0 @@ - - -
    -
    -
    Topic Index | Object Index
    - -
    -
    -
    The Basics
    -
    - {+new Link().toFile("index.html").withText("API Reference")+}
    -
    - {!var prevTocType;!} - {! var i = 0;!} - - - -
    - {+new Link().toClass(thisClass.alias).withText(thisClass.toc.desc)+}
    - - -
    - - {!var tocSymbols = data.filter(function($){return $.toc.type == thisClass.toc.type});!} - {!var tocSupport = new BBTag.Support(tocSymbols);!} -
    -
    {+thisClass.toc.type+}
    -
    - {+new Link().toClass(thisClass.alias).withText(thisClass.toc.desc)+}
    - {!prevTocType = thisClass.toc.type;!} - - - -
    - - \ No newline at end of file diff --git a/build/BBTemplate/viewableClass.tmpl b/build/BBTemplate/viewableClass.tmpl new file mode 100644 index 0000000000..cb0868443f --- /dev/null +++ b/build/BBTemplate/viewableClass.tmpl @@ -0,0 +1,326 @@ + + + + + + + + + + <if test="data.toc && data.toc.desc"> + {+data.toc.desc+} + <else /> + {+data.alias+} + </if> + - BlackBerry WebWorks + + + + + + + + + + + + + + + + + + + +
    + + + + +{! + function StringLink() {} + StringLink.prototype = new Link(); + StringLink.prototype.constructor = StringLink; + Link.prototype.toString = StringLink.prototype.toString; //Must do this to keep track of the function + StringLink.prototype.toString = function () { + var hrefLink = Link.prototype.toString.call(this), + re = new RegExp('^(?:.*$)'); + return hrefLink.replace(re,'$1'); + }; + var ditaMap, + re, + stringLink, + childPage; + + + //Read in and process DitaMap into TOC + ditaMap = IO.readFile(publish.conf.outDir+publish.conf.srcDir+"toc.ditamap"); + ditaMap = ditaMap.substring(838); + ditaMap = ditaMap.replace(/^([\s\S]*?)( {4} $2
  • "); + ditaMap = ditaMap.replace(/<\/topicref>/g,""); + + //Modify TOC for highlighting + if(data.toc){ + if(data.toc.type){ + re = new RegExp('^
  • ( <\/span>)(\n|\r\n)( {4})('+data.toc.type+')','gm'); + ditaMap = ditaMap.replace(re,"
  • $1$2$3$4$5$6"); + } + if(data.toc.desc){ + re = new RegExp('( <\/span>)(\n|\r\n)( {8})('+data.toc.desc+')','gm'); + ditaMap = ditaMap.replace(re,"$1$2$3$4$5$6"); + } + } + + + + + + var stringLink = new StringLink().toClass(data.alias); + stringLink = publish.conf.outDir+publish.conf.srcDir+stringLink; + var childPage = IO.readFile(stringLink); + childPage = childPage.replace(/(
    )([\s\S]*?)( {8}<\/div>)/gm, + "$1$2"+"
      \n"+ditaMap+"\n
    \n$3"); +!} + + +{+childPage+} + + + + + + + + + +
    + +
    + +
    + + + + diff --git a/build/bbPlugin.js b/build/bbPlugin.js index d89fc119c2..9aa33b2e51 100644 --- a/build/bbPlugin.js +++ b/build/bbPlugin.js @@ -20,7 +20,11 @@ * Put this file in \app\plugins\ and it will be used whenever JSDoc is run. */ -BBTag = {}; +BBTag = { + tableHeader : function(firstColumnName){ + return ""+firstColumnName+"OS 5.0OS 6.0OS 7.0PlayBookRipple"; + } +}; BBTag.Support = function(symbolArray) { this.init(); @@ -43,8 +47,8 @@ BBTag.Support.prototype.resetSupportAttributes = function() { this.supportStrings = []; this.supportTag = ""; this.supportTable = ""; - var tableYes = "Y"; - var tableNo = " "; + var tableYes = "Y"; + var tableNo = " "; if(this.bb50 && this.bb60 && this.bb70){ this.supportStrings.push("BlackBerry OS 5.0+"); @@ -117,7 +121,7 @@ BBTag.Support.prototype.populateBySymbol = function(symbol) { var BB50P = symbol.comment.getTag("BB50+").length; var BB60 = symbol.comment.getTag("BB60").length; var BB60P = symbol.comment.getTag("BB60+").length; - var BB70 = symbol.comment.getTag("BB70").length; + var BB70 = symbol.comment.getTag("BB70").length; var BB70P = symbol.comment.getTag("BB70+").length; var PB10 = symbol.comment.getTag("PB10").length; var PB10P = symbol.comment.getTag("PB10+").length; @@ -139,7 +143,7 @@ BBTag.Support.prototype.populateByString = function(string) { var BB50P = string.equals("BB50+"); var BB60 = string.equals("BB60"); var BB60P = string.equals("BB60+"); - var BB70 = string.equals("BB70"); + var BB70 = string.equals("BB70"); var BB70P = string.equals("BB70+"); var PB10 = string.equals("PB10"); var PB10P = string.equals("PB10+"); @@ -151,7 +155,6 @@ BBTag.Support.prototype.populateByString = function(string) { }; BBTag.Support.prototype.populateBySupport = function(support) { - this.bb50 |= support.bb50; this.bb60 |= support.bb60; this.bb70 |= support.bb70; @@ -170,7 +173,7 @@ BBTag.Support.prototype.populateBySymbolArray = function(symbolArray) { BBTag.PlaybookSupport = function(){ var pbSupport = new BBTag.Support(); - pbSupport.populateByBools(false, false, true); + pbSupport.populateByBools(false, false, false, true, false); return pbSupport; }