You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/10/30 22:12:07 UTC

[1/3] js commit: resolve conflicts cherry-pickin

Updated Branches:
  refs/heads/2.9.x 138e92722 -> e9c04b561


resolve conflicts cherry-pickin


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

Branch: refs/heads/2.9.x
Commit: 995a9c3cc626d692cce9e8d0b0420f0b3c0802b9
Parents: 138e927
Author: Carlos Santana <cs...@gmail.com>
Authored: Tue Sep 24 19:17:17 2013 -0400
Committer: purplecabbage <pu...@gmail.com>
Committed: Wed Oct 30 10:41:30 2013 -0700

----------------------------------------------------------------------
 lib/windows8/exec.js | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/995a9c3c/lib/windows8/exec.js
----------------------------------------------------------------------
diff --git a/lib/windows8/exec.js b/lib/windows8/exec.js
index 46343bd..f5f17d3 100644
--- a/lib/windows8/exec.js
+++ b/lib/windows8/exec.js
@@ -36,23 +36,43 @@ var commandProxy = require('cordova/commandProxy');
  * @param {String} action       Action to be run in cordova
  * @param {String[]} [args]     Zero or more arguments to pass to the method
  */
-module.exports = function(success, fail, service, action, args) {
 
-    var proxy = commandProxy.get(service,action);
+module.exports = function (success, fail, service, action, args) {
+
+    var proxy = commandProxy.get(service, action),
+        callbackId,
+        onSuccess,
+        onError;
+
     if(proxy) {
-        var callbackId = service + cordova.callbackId++;
+        callbackId = service + cordova.callbackId++;
         // console.log("EXEC:" + service + " : " + action);
         if (typeof success == "function" || typeof fail == "function") {
             cordova.callbacks[callbackId] = {success:success, fail:fail};
         }
         try {
-            proxy(success, fail, args);
-        }
-        catch(e) {
+            onSuccess = function (result) {
+                cordova.callbackSuccess(callbackId,
+                        {
+                        status: cordova.callbackStatus.OK,
+                        message: result
+                    });
+            };
+            onError = function (err) {
+                cordova.callbackError(callbackId,
+                        {
+                        status: cordova.callbackStatus.ERROR,
+                        message: err
+                    });
+            };
+            proxy(onSuccess, onError, args);
+
+        } catch (e) {
             console.log("Exception calling native with command :: " + service + " :: " + action  + " ::exception=" + e);
         }
-    }
-    else {
-        fail && fail("Missing Command Error");
+    } else {
+        if (typeof fail === "function") {
+            fail("Missing Command Error");
+        }
     }
 };


[2/3] js commit: windows8 update platform init

Posted by pu...@apache.org.
windows8 update platform init


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

Branch: refs/heads/2.9.x
Commit: 3301b65c51feabcf59fef82ecfb549582cf35c1e
Parents: 995a9c3
Author: purplecabbage <pu...@gmail.com>
Authored: Wed Oct 30 13:55:05 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Wed Oct 30 13:55:05 2013 -0700

----------------------------------------------------------------------
 lib/windows8/platform.js | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/3301b65c/lib/windows8/platform.js
----------------------------------------------------------------------
diff --git a/lib/windows8/platform.js b/lib/windows8/platform.js
index 2e3618e..3b3076a 100755
--- a/lib/windows8/platform.js
+++ b/lib/windows8/platform.js
@@ -19,20 +19,24 @@
  *
 */
 
-var cordova = require('cordova'),
-    exec = require('cordova/exec'),
-    channel = cordova.require("cordova/channel"),
-    modulemapper = require('cordova/modulemapper');
 
-/*
- * Define native implementations ( there is no native layer, so need to make sure the proxies are there )
- */
-modulemapper.loadMatchingModules(/cordova.*\/windows8\/.*Proxy$/);
+
+
 
 module.exports = {
     id: "windows8",
     initialize:function() {
 
+        var cordova = require('cordova'),
+            exec = require('cordova/exec'),
+            channel = cordova.require("cordova/channel"),
+            modulemapper = require('cordova/modulemapper');
+
+        /*
+         * Define native implementations ( there is no native layer, so need to make sure the proxies are there )
+         */
+        modulemapper.loadMatchingModules(/cordova.*\/windows8\/.*Proxy$/);
+
         modulemapper.loadMatchingModules(/cordova.*\/plugininit$/);
 
         modulemapper.loadMatchingModules(/cordova.*\/symbols$/);


[3/3] js commit: windows8 update compass

Posted by pu...@apache.org.
windows8 update compass


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

Branch: refs/heads/2.9.x
Commit: e9c04b56151d5a164da6a7458ee6bd42af64dbfb
Parents: 3301b65
Author: purplecabbage <pu...@gmail.com>
Authored: Wed Oct 30 14:11:46 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Wed Oct 30 14:11:46 2013 -0700

----------------------------------------------------------------------
 lib/windows8/plugin/windows8/CompassProxy.js | 46 ++++++++++++-----------
 1 file changed, 24 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/e9c04b56/lib/windows8/plugin/windows8/CompassProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/CompassProxy.js b/lib/windows8/plugin/windows8/CompassProxy.js
index 91a4037..1d7e6b3 100644
--- a/lib/windows8/plugin/windows8/CompassProxy.js
+++ b/lib/windows8/plugin/windows8/CompassProxy.js
@@ -19,41 +19,43 @@
  *
 */
 
-/*global Windows:true */
+/*jslint sloppy:true */
+/*global Windows:true, require, module, setTimeout */
 
 var cordova = require('cordova'),
-    CompassHeading = require('cordova/plugin/CompassHeading');
+    CompassHeading = require('cordova/plugin/CompassHeading'),
+    CompassError = require('cordova/plugin/CompassError');
 
 
 module.exports = {
 
-    onReadingChanged:null,
-    getHeading:function(win,lose) {
+    onReadingChanged: null,
+    getHeading: function (win, lose) {
         var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
-        if(!deviceCompass) {
-            setTimeout(function(){lose("Compass not available");},0);
-        }
-        else {
+        if (!deviceCompass) {
+            setTimeout(function () {
+                lose(CompassError.COMPASS_NOT_SUPPORTED);
+            }, 0);
+        } else {
 
-            deviceCompass.reportInterval = Math.max(16,deviceCompass.minimumReportInterval);
+            deviceCompass.reportInterval = Math.max(16, deviceCompass.minimumReportInterval);
 
-            this.onReadingChanged = function(e) {
-                var reading = e.reading;
-                var heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth);
+            this.onReadingChanged = function (e) {
+                var reading = e.reading,
+                    heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth, null, reading.timestamp);
                 win(heading);
             };
-            deviceCompass.addEventListener("readingchanged",this.onReadingChanged);
+            deviceCompass.addEventListener("readingchanged", this.onReadingChanged);
         }
-
     },
-    stopHeading:function(win,lose) {
+    stopHeading: function (win, lose) {
         var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
-        if(!deviceCompass) {
-            setTimeout(function(){lose("Compass not available");},0);
-        }
-        else {
-
-            deviceCompass.removeEventListener("readingchanged",this.onReadingChanged);
+        if (!deviceCompass) {
+            setTimeout(function () {
+                lose(CompassError.COMPASS_NOT_SUPPORTED);
+            }, 0);
+        } else {
+            deviceCompass.removeEventListener("readingchanged", this.onReadingChanged);
             this.onReadingChanged = null;
             deviceCompass.reportInterval = 0;
             win();
@@ -62,4 +64,4 @@ module.exports = {
     }
 };
 
-require("cordova/commandProxy").add("Compass",module.exports);
\ No newline at end of file
+require("cordova/commandProxy").add("Compass", module.exports);
\ No newline at end of file