forked from mozilla/openwebapps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.js
More file actions
24 lines (20 loc) · 813 Bytes
/
Copy pathbasic.js
File metadata and controls
24 lines (20 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// A simple web-app implementing the 'test.basic' service.
navigator.mozActivities.services.registerHandler('test.basic', "init",
// support the default mediator by supplying the init handler
function(activity) {});
navigator.mozActivities.services.registerHandler('test.basic', "echoArgs",
function(activity, credentials) {
// just bounce the data back
activity.postResult(activity.data);
});
navigator.mozActivities.services.registerHandler('test.basic', "testErrors",
function(activity, credentials) {
activity.postException({code: "testable_error", message: "a testable error"});
}
);
navigator.mozActivities.services.registerHandler('test.basic', "testErrorsThrown",
function(activity, credentials) {
throw "a thrown error";
}
);
navigator.mozActivities.services.ready();