incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deedu...@apache.org
Subject git commit: Add require cordova for PlayBook callbackStatus references.
Date Tue, 06 Mar 2012 21:51:04 GMT
Updated Branches:
  refs/heads/master 4b94695cf -> 2400a6f67


Add require cordova for PlayBook callbackStatus references.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/2400a6f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/2400a6f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/2400a6f6

Branch: refs/heads/master
Commit: 2400a6f67e6e4e5b0a2e54d4063c0fa9d239a0dd
Parents: 4b94695
Author: Drew Walters <deedubbu@gmail.com>
Authored: Tue Mar 6 15:49:44 2012 -0600
Committer: Drew Walters <deedubbu@gmail.com>
Committed: Tue Mar 6 15:49:44 2012 -0600

----------------------------------------------------------------------
 lib/exec/playbook.js           |    1 +
 lib/plugin/playbook/manager.js |   23 ++++++++++++-----------
 2 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2400a6f6/lib/exec/playbook.js
----------------------------------------------------------------------
diff --git a/lib/exec/playbook.js b/lib/exec/playbook.js
index da49e54..ff2cbd9 100644
--- a/lib/exec/playbook.js
+++ b/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

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2400a6f6/lib/plugin/playbook/manager.js
----------------------------------------------------------------------
diff --git a/lib/plugin/playbook/manager.js b/lib/plugin/playbook/manager.js
index 9a5fc26..312a1d2 100644
--- a/lib/plugin/playbook/manager.js
+++ b/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);
         }


Mime
View raw message