Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add require cordova for PlayBook callbackStatus references.

  • Loading branch information...
commit 2400a6f67e6e4e5b0a2e54d4063c0fa9d239a0dd 1 parent 4b94695
@deedubbu authored
Showing with 13 additions and 11 deletions.
  1. +1 −0  lib/exec/playbook.js
  2. +12 −11 lib/plugin/playbook/manager.js
View
1  lib/exec/playbook.js
@@ -16,6 +16,7 @@
module.exports = function(success, fail, service, action, args) {
try {
var playbook = require('cordova/plugin/playbook/manager'),
+ cordova = require('cordova'),
v = playbook.exec(success, fail, service, action, args);
// If status is OK, then return value back to caller
View
23 lib/plugin/playbook/manager.js
@@ -1,13 +1,14 @@
var webworks = require('cordova/plugin/webworks/manager'),
+ cordova = require('cordova'),
/**
* Private list of HTML 5 audio objects, indexed by the Cordova media object ids
*/
audioObjects = {},
- retInvalidAction = function () {
- return { "status" : Cordova.callbackStatus.INVALID_ACTION, "message" : "Action not found" };
+ retInvalidAction = function () {
+ return { "status" : cordova.callbackStatus.INVALID_ACTION, "message" : "Action not found" };
},
retAsyncCall = function () {
- return { "status" : Cordova.callbackStatus.NO_RESULT, "message" : "WebWorks Is On It" };
+ return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "WebWorks Is On It" };
},
cameraAPI = {
execute: function (webWorksResult, action, args, win, fail) {
@@ -23,7 +24,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
deviceAPI = {
execute: function (webWorksResult, action, args, win, fail) {
if (action === 'getDeviceInfo') {
- return {"status" : Cordova.callbackStatus.OK,
+ return {"status" : cordova.callbackStatus.OK,
"message" : {
"version" : blackberry.system.softwareVersion,
"name" : blackberry.system.model,
@@ -40,7 +41,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
execute: function (webWorksResult, action, args, win, fail) {
if (action === 'log') {
console.log(args);
- return {"status" : Cordova.callbackStatus.OK,
+ return {"status" : cordova.callbackStatus.OK,
"message" : 'Message logged to console: ' + args};
}
else {
@@ -180,7 +181,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
case 'getSupportedAudioModes':
case 'getSupportedImageModes':
case 'getSupportedVideoModes':
- return {"status": Cordova.callbackStatus.OK, "message": []};
+ return {"status": cordova.callbackStatus.OK, "message": []};
case 'captureImage':
captureMethod = "takePicture";
captureCB();
@@ -190,7 +191,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
captureCB();
break;
case 'captureAudio':
- return {"status": Cordova.callbackStatus.INVALID_ACTION, "message": "captureAudio is not currently supported"};
+ return {"status": cordova.callbackStatus.INVALID_ACTION, "message": "captureAudio is not currently supported"};
}
return retAsyncCall();
@@ -225,7 +226,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
request.addParam("networkStatusChangedID", callbackID);
request.makeSyncCall();
- return { "status": Cordova.callbackStatus.OK, "message": {"type": connectionType, "event": eventType } };
+ return { "status": cordova.callbackStatus.OK, "message": {"type": connectionType, "event": eventType } };
}
},
notificationAPI = {
@@ -234,7 +235,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
return {"status" : 9, "message" : "Notification action - " + action + " arguments not found"};
}
-
+
//Unpack and map the args
var msg = args[0],
title = args[1],
@@ -270,8 +271,8 @@ module.exports = {
//We got a sync result or a not found from WW that we can pass on to get a native mixin
//For async calls there's nothing to do
- if ((wwResult.status === Cordova.callbackStatus.OK ||
- wwResult.status === Cordova.callbackStatus.CLASS_NOT_FOUND_EXCEPTION) &&
+ if ((wwResult.status === cordova.callbackStatus.OK ||
+ wwResult.status === cordova.callbackStatus.CLASS_NOT_FOUND_EXCEPTION) &&
plugins[clazz]) {
return plugins[clazz].execute(wwResult.message, action, args, win, fail);
}
Please sign in to comment.
Something went wrong with that request. Please try again.