You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/10/28 23:11:38 UTC

[01/19] git commit: fxos added, not working

Updated Branches:
  refs/heads/master d660d02c0 -> f53889856


fxos added, not working


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/6d3a17bc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/6d3a17bc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/6d3a17bc

Branch: refs/heads/master
Commit: 6d3a17bca3e02c8130fdd2a8c83c57cf1da4c12f
Parents: 81b8f96
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Fri Sep 20 11:09:30 2013 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Fri Sep 20 11:09:30 2013 +0200

----------------------------------------------------------------------
 plugin.xml                     | 13 +++++++++++
 src/firefoxos/accelerometer.js | 44 +++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/6d3a17bc/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 032ab01..cd7e840 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -17,6 +17,19 @@
         <clobbers target="navigator.accelerometer" />
     </js-module>
     
+    <!-- firefoxos -->
+    <platform name="firefoxos">
+        <config-file target="config.xml" parent="/*">
+            <feature name="Accelerometer">
+                <param name="firefoxos-package" value="Accelerometer" />
+            </feature>
+        </config-file>                                         
+        
+        <js-module src="src/firefoxos/accelerometer.js" name="accelerometer-impl">
+          <runs />
+        </js-module>
+    </platform>
+
     <!-- android -->
     <platform name="android">
 	    

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/6d3a17bc/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
new file mode 100644
index 0000000..bde8acc
--- /dev/null
+++ b/src/firefoxos/accelerometer.js
@@ -0,0 +1,44 @@
+var firefoxos = require('cordova/platform');
+
+// initiate watching the acceleration and clear it straight afterwards
+function getCurrentAcceleration(accelerometerSuccess, accelerometerError) {
+    var listener = document.addEventListener('devicemotion', accelerationCallback, false);
+    function accelerationCallback(deviceMotionEvent) {
+        accelerometerSuccess(deviceMotionEvent.acceleration);
+        document.removeEventListener('devicemotion', listener, false);
+    }
+}
+
+// listen to acceleration and call accelerometerSuccess every x milliseconds
+function watchAcceleration(accelerometerSuccess, accelerometerError, options) {
+    // last timestamp when callback was called
+    var hit = 0;
+    var frequency = 0;
+    if (options && options.frequency) {
+        frequency = options.frequency;
+    }
+    function accelerationCallback(deviceMotionEvent) {
+        var newHit;
+        if (frequency) {
+          newHit = new Date().getTime();
+        }
+        if (!frequency || newHit >= hit + frequency) {
+            // return acceleration object instead of event
+            accelerometerSuccess(deviceMotionEvent.acceleration);
+            hit = newHit;
+        }
+    }
+    return document.removeEventListener('devicemotion', accelerationCallback, false);
+}
+
+function clearWatch(watchId) {
+    document.removeEventListener('devicemotion', watchId);
+}
+
+var Accelerometer = {
+    getCurrentAcceleration: getCurrentAcceleration,
+    watchAcceleration: watchAcceleration,
+    clearWatch: clearWatch,
+};
+
+firefoxos.registerPlugin('Accelerometer', Accelerometer);


[05/19] git commit: [CB-4825] use CoreMotion framework for accelerometer

Posted by st...@apache.org.
[CB-4825] use CoreMotion framework for accelerometer


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/ea304063
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/ea304063
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/ea304063

Branch: refs/heads/master
Commit: ea3040634aa2d86925c29a41f172eb96a1145fd4
Parents: 3312a40
Author: James Jong <wj...@gmail.com>
Authored: Wed Oct 2 11:34:30 2013 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Wed Oct 2 11:34:30 2013 -0400

----------------------------------------------------------------------
 src/ios/CDVAccelerometer.h |  2 +-
 src/ios/CDVAccelerometer.m | 52 +++++++++++++++++++++--------------------
 2 files changed, 28 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/ea304063/src/ios/CDVAccelerometer.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVAccelerometer.h b/src/ios/CDVAccelerometer.h
index 923d0c8..ee1664f 100755
--- a/src/ios/CDVAccelerometer.h
+++ b/src/ios/CDVAccelerometer.h
@@ -20,7 +20,7 @@
 #import <UIKit/UIKit.h>
 #import <Cordova/CDVPlugin.h>
 
-@interface CDVAccelerometer : CDVPlugin <UIAccelerometerDelegate>
+@interface CDVAccelerometer : CDVPlugin
 {
     double x;
     double y;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/ea304063/src/ios/CDVAccelerometer.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVAccelerometer.m b/src/ios/CDVAccelerometer.m
index 33093d0..b338245 100755
--- a/src/ios/CDVAccelerometer.m
+++ b/src/ios/CDVAccelerometer.m
@@ -17,10 +17,12 @@
  under the License.
  */
 
+#import <CoreMotion/CoreMotion.h>
 #import "CDVAccelerometer.h"
 
 @interface CDVAccelerometer () {}
 @property (readwrite, assign) BOOL isRunning;
+@property (readwrite, strong) CMMotionManager* motionManager;
 @end
 
 @implementation CDVAccelerometer
@@ -42,6 +44,7 @@
         timestamp = 0;
         self.callbackId = nil;
         self.isRunning = NO;
+        self.motionManager = nil;
     }
     return self;
 }
@@ -54,16 +57,29 @@
 - (void)start:(CDVInvokedUrlCommand*)command
 {
     NSString* cbId = command.callbackId;
-    NSTimeInterval desiredFrequency_num = kAccelerometerInterval;
-    UIAccelerometer* pAccel = [UIAccelerometer sharedAccelerometer];
 
-    // accelerometer expects fractional seconds, but we have msecs
-    pAccel.updateInterval = desiredFrequency_num / 1000;
-    self.callbackId = cbId;
-    if (!self.isRunning) {
-        pAccel.delegate = self;
-        self.isRunning = YES;
+    if (!self.motionManager)
+    {
+        self.motionManager = [[CMMotionManager alloc] init];
+    }
+
+    if ([self.motionManager isAccelerometerAvailable] == YES) {
+        // Assign the update interval to the motion manager and start updates
+        [self.motionManager setAccelerometerUpdateInterval:kAccelerometerInterval/1000];  // expected in seconds
+        [self.motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) {
+            x = accelerometerData.acceleration.x;
+            y = accelerometerData.acceleration.y;
+            z = accelerometerData.acceleration.z;
+            timestamp = ([[NSDate date] timeIntervalSince1970] * 1000);
+            [self returnAccelInfo];
+        }];
+
+        if (!self.isRunning) {
+            self.isRunning = YES;
+        }
     }
+    
+    self.callbackId = cbId;
 }
 
 - (void)onReset
@@ -73,24 +89,10 @@
 
 - (void)stop:(CDVInvokedUrlCommand*)command
 {
-    UIAccelerometer* theAccelerometer = [UIAccelerometer sharedAccelerometer];
-
-    theAccelerometer.delegate = nil;
-    self.isRunning = NO;
-}
-
-/**
- * Picks up accel updates from device and stores them in this class
- */
-- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
-{
-    if (self.isRunning) {
-        x = acceleration.x;
-        y = acceleration.y;
-        z = acceleration.z;
-        timestamp = ([[NSDate date] timeIntervalSince1970] * 1000);
-        [self returnAccelInfo];
+    if ([self.motionManager isAccelerometerAvailable] == YES) {
+        [self.motionManager stopAccelerometerUpdates];
     }
+    self.isRunning = NO;
 }
 
 - (void)returnAccelInfo


[11/19] git commit: CB-5128: added repo + issue tag to plugin.xml for device motion

Posted by st...@apache.org.
CB-5128: added repo + issue tag to plugin.xml for device motion


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/3576342c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/3576342c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/3576342c

Branch: refs/heads/master
Commit: 3576342c560010877cf6433e0aeeda76e8486e4f
Parents: e6bb4a8
Author: hermwong <he...@gmail.com>
Authored: Mon Oct 21 16:00:48 2013 -0700
Committer: hermwong <he...@gmail.com>
Committed: Mon Oct 21 16:00:48 2013 -0700

----------------------------------------------------------------------
 plugin.xml | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/3576342c/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 948632c..925e328 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -8,6 +8,8 @@
     <description>Cordova Device Motion Plugin</description>
     <license>Apache 2.0</license>
     <keywords>cordova,device,motion</keywords>
+    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion.git</repo>
+    <issue>https://issues.apache.org/jira/browse/CB/component/12320636</issue>
 
     <js-module src="www/Acceleration.js" name="Acceleration">
         <clobbers target="Acceleration" />


[08/19] git commit: CB-5012 ensure result is returned

Posted by st...@apache.org.
CB-5012 ensure result is returned


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/e6bb4a84
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/e6bb4a84
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/e6bb4a84

Branch: refs/heads/master
Commit: e6bb4a844e4a2267dfb8f18a25211893656fa8b6
Parents: 9093259
Author: James Jong <wj...@gmail.com>
Authored: Sat Oct 12 13:21:14 2013 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Sat Oct 12 13:21:14 2013 -0400

----------------------------------------------------------------------
 src/ios/CDVAccelerometer.m | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/e6bb4a84/src/ios/CDVAccelerometer.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVAccelerometer.m b/src/ios/CDVAccelerometer.m
index 20bcbc6..e98aacd 100755
--- a/src/ios/CDVAccelerometer.m
+++ b/src/ios/CDVAccelerometer.m
@@ -22,6 +22,7 @@
 
 @interface CDVAccelerometer () {}
 @property (readwrite, assign) BOOL isRunning;
+@property (readwrite, assign) BOOL haveReturnedResult;
 @property (readwrite, strong) CMMotionManager* motionManager;
 @end
 
@@ -30,7 +31,7 @@
 @synthesize callbackId, isRunning;
 
 // defaults to 10 msec
-#define kAccelerometerInterval 40
+#define kAccelerometerInterval 10
 // g constant: -9.81 m/s^2
 #define kGravitationalConstant -9.81
 
@@ -44,6 +45,7 @@
         timestamp = 0;
         self.callbackId = nil;
         self.isRunning = NO;
+        self.haveReturnedResult = YES;
         self.motionManager = nil;
     }
     return self;
@@ -56,7 +58,8 @@
 
 - (void)start:(CDVInvokedUrlCommand*)command
 {
-    NSString* cbId = command.callbackId;
+    self.haveReturnedResult = NO;
+    self.callbackId = command.callbackId;
 
     if (!self.motionManager)
     {
@@ -80,7 +83,6 @@
         }
     }
     
-    self.callbackId = cbId;
 }
 
 - (void)onReset
@@ -91,6 +93,10 @@
 - (void)stop:(CDVInvokedUrlCommand*)command
 {
     if ([self.motionManager isAccelerometerAvailable] == YES) {
+        if (self.haveReturnedResult == NO){
+            // block has not fired before stop was called, return whatever result we currently have
+            [self returnAccelInfo];
+        }
         [self.motionManager stopAccelerometerUpdates];
     }
     self.isRunning = NO;
@@ -109,6 +115,7 @@
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:accelProps];
     [result setKeepCallback:[NSNumber numberWithBool:YES]];
     [self.commandDelegate sendPluginResult:result callbackId:self.callbackId];
+    self.haveReturnedResult = YES;
 }
 
 // TODO: Consider using filtering to isolate instantaneous data vs. gravity data -jm


[03/19] git commit: [CB-4915] Incremented plugin version on dev branch.

Posted by st...@apache.org.
[CB-4915] Incremented plugin version on dev branch.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/3312a408
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/3312a408
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/3312a408

Branch: refs/heads/master
Commit: 3312a408a9b2bb80608c95e434aea272bfe111be
Parents: d660d02
Author: Steven Gill <st...@gmail.com>
Authored: Wed Sep 25 18:34:13 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Sep 25 18:34:13 2013 -0700

----------------------------------------------------------------------
 plugin.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/3312a408/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 26e7485..cbf620d 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -2,7 +2,7 @@
 
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
            id="org.apache.cordova.device-motion"
-      version="0.2.2">
+      version="0.2.3-dev">
 	
     <name>Device Motion</name>
     <description>Cordova Device Motion Plugin</description>


[13/19] git commit: adding timestamp to the response

Posted by st...@apache.org.
adding timestamp to the response


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/470c7c61
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/470c7c61
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/470c7c61

Branch: refs/heads/master
Commit: 470c7c61e0a2474f457961da4f90a12f246cd068
Parents: 015e3f9
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Thu Oct 24 13:40:41 2013 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Thu Oct 24 13:40:41 2013 +0200

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/470c7c61/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index d2fa658..8f33c51 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -4,7 +4,7 @@ var Accelerometer = {
         return window.addEventListener('devicemotion', function(ev) {
             var acc = ev.accelerationIncludingGravity;
             acc.timestamp = new Date().getTime();
-            success(ev.accelerationIncludingGravity);
+            success(acc);
         }, false);
     },
 


[18/19] git commit: Merge branch 'master' of github.com:jlongster/cordova-plugin-device-motion into dev

Posted by st...@apache.org.
Merge branch 'master' of github.com:jlongster/cordova-plugin-device-motion into dev


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/f3fe396b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/f3fe396b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/f3fe396b

Branch: refs/heads/master
Commit: f3fe396bde11df9e618883ea22087978a2307e15
Parents: 9db0950 8a245a5
Author: Steven Gill <st...@gmail.com>
Authored: Fri Oct 25 14:38:14 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri Oct 25 14:38:14 2013 -0700

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[10/19] git commit: fix acceleromter for firefox os

Posted by st...@apache.org.
fix acceleromter for firefox os


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/015e3f9b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/015e3f9b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/015e3f9b

Branch: refs/heads/master
Commit: 015e3f9b134849f29af08aca54cb1adf701bda41
Parents: fcc626a
Author: James Long <lo...@gmail.com>
Authored: Mon Oct 21 17:47:05 2013 -0400
Committer: James Long <lo...@gmail.com>
Committed: Mon Oct 21 17:47:05 2013 -0400

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/015e3f9b/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index 5ba0b7d..d2fa658 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -1,15 +1,15 @@
 
 var Accelerometer = {
-    start: function start(successCallback, errorCallback) {
-        console.log('start watching accelerometer');
-        function accelerationCallback(deviceMotionEvent) {
-            successCallback(deviceMotionEvent.acceleration);
-        }
-        return document.addEventListener('devicemotion', accelerationCallback, false);
+    start: function start(success, error) {
+        return window.addEventListener('devicemotion', function(ev) {
+            var acc = ev.accelerationIncludingGravity;
+            acc.timestamp = new Date().getTime();
+            success(ev.accelerationIncludingGravity);
+        }, false);
     },
-    stop: function stop(watchId) {
-        console.log('stop watching acecelerometer');
-        document.removeEventListener('devicemotion', watchId);
+
+    stop: function stop() {
+        window.removeEventListener('devicemotion');
     }
 };
 


[02/19] git commit: accelerometer registers, but is not responding

Posted by st...@apache.org.
accelerometer registers, but is not responding


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/3dad5222
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/3dad5222
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/3dad5222

Branch: refs/heads/master
Commit: 3dad522215752b086ed106f82d4f6792750e82fe
Parents: 6d3a17b
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Fri Sep 20 12:22:47 2013 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Fri Sep 20 12:22:47 2013 +0200

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 44 ++++++++-----------------------------
 1 file changed, 9 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/3dad5222/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index bde8acc..696f1e5 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -1,44 +1,18 @@
 var firefoxos = require('cordova/platform');
 
-// initiate watching the acceleration and clear it straight afterwards
-function getCurrentAcceleration(accelerometerSuccess, accelerometerError) {
-    var listener = document.addEventListener('devicemotion', accelerationCallback, false);
-    function accelerationCallback(deviceMotionEvent) {
-        accelerometerSuccess(deviceMotionEvent.acceleration);
-        document.removeEventListener('devicemotion', listener, false);
-    }
-}
 
-// listen to acceleration and call accelerometerSuccess every x milliseconds
-function watchAcceleration(accelerometerSuccess, accelerometerError, options) {
-    // last timestamp when callback was called
-    var hit = 0;
-    var frequency = 0;
-    if (options && options.frequency) {
-        frequency = options.frequency;
-    }
-    function accelerationCallback(deviceMotionEvent) {
-        var newHit;
-        if (frequency) {
-          newHit = new Date().getTime();
-        }
-        if (!frequency || newHit >= hit + frequency) {
-            // return acceleration object instead of event
+var Accelerometer = {
+    start: function start(accelerometerSuccess, accelerometerError) {
+        console.log('start watching acecelerometer');
+        function accelerationCallback(deviceMotionEvent) {
             accelerometerSuccess(deviceMotionEvent.acceleration);
-            hit = newHit;
         }
+        return document.addEventListener('devicemotion', accelerationCallback, false);
+    },
+    stop: function stop(watchId) {
+        console.log('stop watching acecelerometer');
+        document.removeEventListener('devicemotion', watchId);
     }
-    return document.removeEventListener('devicemotion', accelerationCallback, false);
-}
-
-function clearWatch(watchId) {
-    document.removeEventListener('devicemotion', watchId);
-}
-
-var Accelerometer = {
-    getCurrentAcceleration: getCurrentAcceleration,
-    watchAcceleration: watchAcceleration,
-    clearWatch: clearWatch,
 };
 
 firefoxos.registerPlugin('Accelerometer', Accelerometer);


[14/19] git commit: properly stop watching...

Posted by st...@apache.org.
properly stop watching...


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/4d202c1f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/4d202c1f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/4d202c1f

Branch: refs/heads/master
Commit: 4d202c1f0d911c4f05469724db82eb03911f2415
Parents: 470c7c6
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Thu Oct 24 14:31:10 2013 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Thu Oct 24 14:31:10 2013 +0200

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/4d202c1f/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index 8f33c51..b01f77c 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -1,15 +1,16 @@
 
+function listener function(ev) {
+    var acc = ev.accelerationIncludingGravity;
+    acc.timestamp = new Date().getTime();
+    success(acc);
+}
 var Accelerometer = {
     start: function start(success, error) {
-        return window.addEventListener('devicemotion', function(ev) {
-            var acc = ev.accelerationIncludingGravity;
-            acc.timestamp = new Date().getTime();
-            success(acc);
-        }, false);
+        return window.addEventListener('devicemotion', listener, false);
     },
 
     stop: function stop() {
-        window.removeEventListener('devicemotion');
+        window.removeEventListener('devicemotion', listener, false);
     }
 };
 


[16/19] git commit: Merge pull request #1 from zalun/master

Posted by st...@apache.org.
Merge pull request #1 from zalun/master

adding timestamp to the response

Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/4a3a33f3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/4a3a33f3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/4a3a33f3

Branch: refs/heads/master
Commit: 4a3a33f3a515132c7c09e2bbc04be6a1a5b0cad2
Parents: 015e3f9 2043d2e
Author: James Long <lo...@gmail.com>
Authored: Thu Oct 24 15:26:05 2013 -0700
Committer: James Long <lo...@gmail.com>
Committed: Thu Oct 24 15:26:05 2013 -0700

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[15/19] git commit: fixed the scope

Posted by st...@apache.org.
fixed the scope


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/2043d2e3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/2043d2e3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/2043d2e3

Branch: refs/heads/master
Commit: 2043d2e3fecf06acfedd9096eebafa96d2162f3f
Parents: 4d202c1
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Thu Oct 24 18:23:44 2013 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Thu Oct 24 18:23:44 2013 +0200

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/2043d2e3/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index b01f77c..025b6c8 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -1,11 +1,11 @@
-
-function listener function(ev) {
-    var acc = ev.accelerationIncludingGravity;
-    acc.timestamp = new Date().getTime();
-    success(acc);
-}
+var listener;
 var Accelerometer = {
     start: function start(success, error) {
+        listener = function(ev) {
+            var acc = ev.accelerationIncludingGravity;
+            acc.timestamp = new Date().getTime();
+            success(acc);
+        }
         return window.addEventListener('devicemotion', listener, false);
     },
 


[06/19] git commit: [CB-4825] avoid retain cycle in update block

Posted by st...@apache.org.
[CB-4825] avoid retain cycle in update block


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/b2e17a78
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/b2e17a78
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/b2e17a78

Branch: refs/heads/master
Commit: b2e17a784a6d69a89410e661f3f9d76f0fcb4bc5
Parents: ea30406
Author: James Jong <wj...@gmail.com>
Authored: Wed Oct 2 16:21:49 2013 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Wed Oct 2 16:21:49 2013 -0400

----------------------------------------------------------------------
 src/ios/CDVAccelerometer.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/b2e17a78/src/ios/CDVAccelerometer.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVAccelerometer.m b/src/ios/CDVAccelerometer.m
index b338245..20bcbc6 100755
--- a/src/ios/CDVAccelerometer.m
+++ b/src/ios/CDVAccelerometer.m
@@ -66,12 +66,13 @@
     if ([self.motionManager isAccelerometerAvailable] == YES) {
         // Assign the update interval to the motion manager and start updates
         [self.motionManager setAccelerometerUpdateInterval:kAccelerometerInterval/1000];  // expected in seconds
+        __weak CDVAccelerometer* weakSelf = self;
         [self.motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) {
             x = accelerometerData.acceleration.x;
             y = accelerometerData.acceleration.y;
             z = accelerometerData.acceleration.z;
             timestamp = ([[NSDate date] timeIntervalSince1970] * 1000);
-            [self returnAccelInfo];
+            [weakSelf returnAccelInfo];
         }];
 
         if (!self.isRunning) {


[17/19] git commit: tweak scoping

Posted by st...@apache.org.
tweak scoping


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/8a245a57
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/8a245a57
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/8a245a57

Branch: refs/heads/master
Commit: 8a245a57cf90b2fb8c650103826b33d9b46b9b81
Parents: 4a3a33f
Author: James Long <lo...@gmail.com>
Authored: Thu Oct 24 19:15:29 2013 -0400
Committer: James Long <lo...@gmail.com>
Committed: Thu Oct 24 19:15:29 2013 -0400

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/8a245a57/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index 025b6c8..6d22509 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -1,12 +1,15 @@
-var listener;
+
+function listener(success, ev) {
+    var acc = ev.accelerationIncludingGravity;
+    acc.timestamp = new Date().getTime();
+    success(acc);
+}
+
 var Accelerometer = {
     start: function start(success, error) {
-        listener = function(ev) {
-            var acc = ev.accelerationIncludingGravity;
-            acc.timestamp = new Date().getTime();
-            success(acc);
-        }
-        return window.addEventListener('devicemotion', listener, false);
+        return window.addEventListener('devicemotion', function(ev) {
+            listener(success, ev);
+        }, false);
     },
 
     stop: function stop() {


[09/19] git commit: update firefoxos integration

Posted by st...@apache.org.
update firefoxos integration


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/fcc626a8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/fcc626a8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/fcc626a8

Branch: refs/heads/master
Commit: fcc626a8ae049e7fe3a9322cafde6477da92204e
Parents: 53a2e82
Author: James Long <lo...@gmail.com>
Authored: Fri Oct 18 00:15:26 2013 -0400
Committer: James Long <lo...@gmail.com>
Committed: Fri Oct 18 00:15:26 2013 -0400

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/fcc626a8/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index b0f8b70..5ba0b7d 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -1,5 +1,3 @@
-var firefoxos = require('cordova/platform');
-
 
 var Accelerometer = {
     start: function start(successCallback, errorCallback) {
@@ -15,4 +13,5 @@ var Accelerometer = {
     }
 };
 
-firefoxos.registerPlugin('Accelerometer', Accelerometer);
+module.exports = Accelerometer;
+require('cordova/firefoxos/commandProxy').add('Accelerometer', Accelerometer);


[07/19] git commit: [CB-4825] Add CoreMotion.framework to plugin.xml

Posted by st...@apache.org.
[CB-4825] Add CoreMotion.framework to plugin.xml


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/90932591
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/90932591
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/90932591

Branch: refs/heads/master
Commit: 90932591e862f04aa4b4f57885db31592562c081
Parents: b2e17a7
Author: James Jong <wj...@gmail.com>
Authored: Wed Oct 9 16:31:54 2013 -0400
Committer: James Jong <wj...@gmail.com>
Committed: Wed Oct 9 16:31:54 2013 -0400

----------------------------------------------------------------------
 plugin.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/90932591/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index cbf620d..948632c 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -42,6 +42,7 @@
         <header-file src="src/ios/CDVAccelerometer.h" />
         <source-file src="src/ios/CDVAccelerometer.m" />
         
+        <framework src="CoreMotion.framework" />
     </platform>
 
     <!-- blackberry10 -->


[19/19] git commit: [CB-5188] Updated version and RELEASENOTES.md for release 0.2.3

Posted by st...@apache.org.
[CB-5188] Updated version and RELEASENOTES.md for release 0.2.3


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/f5388985
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/f5388985
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/f5388985

Branch: refs/heads/master
Commit: f5388985664569a0d6ba696fdca4ddcaad25bd3d
Parents: f3fe396
Author: Steven Gill <st...@gmail.com>
Authored: Mon Oct 28 11:34:35 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Mon Oct 28 11:34:35 2013 -0700

----------------------------------------------------------------------
 RELEASENOTES.md | 17 +++++++++++++++++
 plugin.xml      |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/f5388985/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 1509ede..a6bb1b8 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -28,3 +28,20 @@
 * CB-4889 renaming org.apache.cordova.core.device-motion to org.apache.cordova.device-motion
 * Rename CHANGELOG.md -> RELEASENOTES.md
 * [CB-4752] Incremented plugin version on dev branch.
+
+ ### 0.2.3 (Oct 28, 2013)
+* tweak scoping
+* fixed the scope
+* properly stop watching...
+* adding timestamp to the response
+* fix acceleromter for firefox os
+* update firefoxos integration
+* fixed callbacks
+* accelerometer registers, but is not responding
+* fxos added, not working
+* CB-5128: added repo + issue tag to plugin.xml for device motion
+* CB-5012 ensure result is returned
+* [CB-4825] Add CoreMotion.framework to plugin.xml
+* [CB-4825] avoid retain cycle in update block
+* [CB-4825] use CoreMotion framework for accelerometer
+* [CB-4915] Incremented plugin version on dev branch.

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/f5388985/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index beeee29..7b9abd5 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -2,7 +2,7 @@
 
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
            id="org.apache.cordova.device-motion"
-      version="0.2.3-dev">
+      version="0.2.3">
 	
     <name>Device Motion</name>
     <description>Cordova Device Motion Plugin</description>


[12/19] git commit: Merge branch 'master' of github.com:jlongster/cordova-plugin-device-motion into dev

Posted by st...@apache.org.
Merge branch 'master' of github.com:jlongster/cordova-plugin-device-motion into dev


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/9db09502
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/9db09502
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/9db09502

Branch: refs/heads/master
Commit: 9db09502ee73e09e0bf478179b64df353de0bc52
Parents: 3576342 015e3f9
Author: Steven Gill <st...@gmail.com>
Authored: Mon Oct 21 16:27:35 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Mon Oct 21 16:27:35 2013 -0700

----------------------------------------------------------------------
 plugin.xml                     | 13 +++++++++++++
 src/firefoxos/accelerometer.js | 17 +++++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/9db09502/plugin.xml
----------------------------------------------------------------------


[04/19] git commit: fixed callbacks

Posted by st...@apache.org.
fixed callbacks


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/53a2e822
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/53a2e822
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/53a2e822

Branch: refs/heads/master
Commit: 53a2e8225e8a36e86860af048b78fbd630111057
Parents: 3dad522
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Sat Sep 28 12:02:43 2013 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Sat Sep 28 12:02:43 2013 +0200

----------------------------------------------------------------------
 src/firefoxos/accelerometer.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/53a2e822/src/firefoxos/accelerometer.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/accelerometer.js b/src/firefoxos/accelerometer.js
index 696f1e5..b0f8b70 100644
--- a/src/firefoxos/accelerometer.js
+++ b/src/firefoxos/accelerometer.js
@@ -2,10 +2,10 @@ var firefoxos = require('cordova/platform');
 
 
 var Accelerometer = {
-    start: function start(accelerometerSuccess, accelerometerError) {
-        console.log('start watching acecelerometer');
+    start: function start(successCallback, errorCallback) {
+        console.log('start watching accelerometer');
         function accelerationCallback(deviceMotionEvent) {
-            accelerometerSuccess(deviceMotionEvent.acceleration);
+            successCallback(deviceMotionEvent.acceleration);
         }
         return document.addEventListener('devicemotion', accelerationCallback, false);
     },