cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/7] js commit: fixes CB-5806 [Windows8] Add keepCallback support to proxy
Date Thu, 06 Feb 2014 03:25:28 GMT
Updated Branches:
  refs/heads/browserify 4e674c344 -> 8ff104b6f


fixes CB-5806 [Windows8] Add keepCallback support to proxy


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

Branch: refs/heads/browserify
Commit: a9371e5959223bfeef163c034baaf0ec0ae597d9
Parents: 8f301f8
Author: sgrebnov <sergei.grebnov@gmail.com>
Authored: Wed Jan 22 20:16:20 2014 +0400
Committer: sgrebnov <sergei.grebnov@gmail.com>
Committed: Wed Jan 22 20:16:20 2014 +0400

----------------------------------------------------------------------
 src/windows8/exec.js | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/a9371e59/src/windows8/exec.js
----------------------------------------------------------------------
diff --git a/src/windows8/exec.js b/src/windows8/exec.js
index 6720572..d9d8cfe 100644
--- a/src/windows8/exec.js
+++ b/src/windows8/exec.js
@@ -53,18 +53,25 @@ module.exports = function (success, fail, service, action, args) {
             cordova.callbacks[callbackId] = {success: success, fail: fail};
         }
         try {
-            onSuccess = function (result) {
-                cordova.callbackSuccess(callbackId,
-                        {
-                        status: cordova.callbackStatus.OK,
-                        message: result
+            // callbackOptions param represents additional optional parameters command could
pass back, like keepCallback or
+            // custom callbackId, for example {callbackId: id, keepCallback: true, status:
cordova.callbackStatus.JSON_EXCEPTION }
+            // CB-5806 [Windows8] Add keepCallback support to proxy
+            onSuccess = function (result, callbackOptions) {
+                callbackOptions = callbackOptions || {};
+                cordova.callbackSuccess(callbackOptions.callbackId || callbackId,
+                    {
+                        status: callbackOptions.status || cordova.callbackStatus.OK,
+                        message: result,
+                        keepCallback: callbackOptions.keepCallback || false
                     });
             };
-            onError = function (err) {
-                cordova.callbackError(callbackId,
-                        {
-                        status: cordova.callbackStatus.ERROR,
-                        message: err
+            onError = function (err, callbackOptions) {
+                callbackOptions = callbackOptions || {};
+                cordova.callbackError(callbackOptions.callbackId || callbackId,
+                    {
+                        status: callbackOptions.status || cordova.callbackStatus.ERROR,
+                        message: err,
+                        keepCallback: callbackOptions.keepCallback || false
                     });
             };
             proxy(onSuccess, onError, args);


Mime
View raw message