You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by za...@apache.org on 2014/05/20 20:50:52 UTC

[1/8] git commit: call FxOS's getCurrentProxy added

Repository: cordova-plugin-geolocation
Updated Branches:
  refs/heads/master 1ac220094 -> dee44b125


call FxOS's getCurrentProxy added


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

Branch: refs/heads/master
Commit: 4c0795507beaa9bf0af46004ddc82eb16b3e624c
Parents: 459a01c
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Thu Oct 31 14:17:38 2013 +0100
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Thu Oct 31 14:17:38 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/4c079550/src/firefoxos/GeolocationProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/GeolocationProxy.js b/src/firefoxos/GeolocationProxy.js
index 0f05f02..a9661da 100644
--- a/src/firefoxos/GeolocationProxy.js
+++ b/src/firefoxos/GeolocationProxy.js
@@ -24,10 +24,10 @@
 module.exports = {
 
     getCurrentPosition: function(win, geolocationError, args) {
-        win(position);
+        return navigator.geolocation.getCurrentPosition(win, geolocationError);
     },
     
-    geolocationError(error) {
+    geolocationError: function(error) {
         switch(error.code) {
             case error.TIMEOUT:
                 console.log("geolocation timeout");
@@ -35,7 +35,7 @@ module.exports = {
             case error.POSITION_UNAVAILABLE:
                 console.log("position unavailable");
                 break;
-            case error:.PERMISSION_DENIED:
+            case error.PERMISSION_DENIED:
                 console.log("permission denied");
                 break;
             default:    
@@ -46,4 +46,4 @@ module.exports = {
 
 };
 
-require("cordova/firefoxos/commandProxy").add("Geolocation", module.exports);
\ No newline at end of file
+require("cordova/firefoxos/commandProxy").add("Geolocation", module.exports);


[5/8] git commit: Merge branch 'master' of github.com:apache/cordova-plugin-geolocation

Posted by za...@apache.org.
Merge branch 'master' of github.com:apache/cordova-plugin-geolocation

Conflicts:
	plugin.xml


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

Branch: refs/heads/master
Commit: cb3612c74c8d35d826d1f11182f8d9b2d2f5de17
Parents: 9e8ce30 236ec15
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Tue Jan 14 12:41:53 2014 +0100
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Tue Jan 14 12:41:53 2014 +0100

----------------------------------------------------------------------
 README.md                               |  25 ++-
 RELEASENOTES.md                         |  18 +-
 doc/index.md                            | 268 +++++++++++++++++++++++++++
 docs/Coordinates/coordinates.md         | 127 -------------
 docs/Position/position.md               | 121 ------------
 docs/PositionError/positionError.md     |  59 ------
 docs/geolocation.clearWatch.md          | 119 ------------
 docs/geolocation.getCurrentPosition.md  | 128 -------------
 docs/geolocation.md                     | 104 -----------
 docs/geolocation.watchPosition.md       | 130 -------------
 docs/parameters/geolocation.options.md  |  41 ----
 docs/parameters/geolocationError.md     |  32 ----
 docs/parameters/geolocationSuccess.md   |  46 -----
 plugin.xml                              |  54 +++++-
 src/amazon/CordovaLocationListener.java | 252 +++++++++++++++++++++++++
 src/amazon/GPSListener.java             |  51 +++++
 src/amazon/GeoBroker.java               | 205 ++++++++++++++++++++
 src/amazon/NetworkListener.java         |  33 ++++
 src/android/GPSListener.java            |   1 -
 src/android/GeoBroker.java              |   3 +-
 src/blackberry10/index.js               |  64 -------
 src/windows8/GeolocationProxy.js        | 163 ++++++++++++++++
 test/cordova-incl.js                    |   6 +-
 www/blackberry10/GeolocationProxy.js    |  61 ++++++
 24 files changed, 1128 insertions(+), 983 deletions(-)
----------------------------------------------------------------------



[6/8] git commit: CB-5416 - Adding support for auto-managing permissions

Posted by za...@apache.org.
CB-5416 - Adding support for auto-managing permissions


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

Branch: refs/heads/master
Commit: d4558831838ae3070de46ef8bcaa5e7174a1db7d
Parents: 1ac2200
Author: Rodrigo Silveira <ro...@outlook.com>
Authored: Tue Apr 22 15:07:19 2014 -0400
Committer: Rodrigo Silveira <ro...@outlook.com>
Committed: Fri May 2 12:43:49 2014 -0700

----------------------------------------------------------------------
 doc/index.md | 10 ----------
 plugin.xml   |  8 +++-----
 2 files changed, 3 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/d4558831/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index 038af3d..8b53a2f 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -49,16 +49,6 @@ see the Privacy Guide.
 
     cordova plugin add org.apache.cordova.geolocation
 
-### Firefox OS Quirks
-
-Create __www/manifest.webapp__ as described in 
-[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest).
-Add permisions: 
-
-    "permissions": {
-		"geolocation": { "description": "Used to position the map to your current position" }
-	}
-
 ## Supported Platforms
 
 - Amazon Fire OS

http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/d4558831/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index f395fa4..716dffe 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -201,11 +201,9 @@ xmlns:android="http://schemas.android.com/apk/res/android"
 
     <!-- firefoxos -->
     <platform name="firefoxos">
-        <config-file target="config.xml" parent="/*">
-            <feature name="Geolocation">
-                <param name="firefoxos-package" value="Geolocation" />
-            </feature>
-        </config-file>
+      <config-file target="config.xml" parent="/*">
+          <permission name="geolocation" description="Required for accessing user location." />
+      </config-file>
 
         <js-module src="src/firefoxos/GeolocationProxy.js" name="GeolocationProxy">
             <runs />


[8/8] git commit: Merge remote-tracking branch 'mozilla/auto-permission'

Posted by za...@apache.org.
Merge remote-tracking branch 'mozilla/auto-permission'


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

Branch: refs/heads/master
Commit: dee44b125e44706779d3b7f8c2496e7d9631d765
Parents: 48af4c4 d455883
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Tue May 20 20:50:25 2014 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Tue May 20 20:50:25 2014 +0200

----------------------------------------------------------------------
 doc/index.md | 10 ----------
 plugin.xml   |  8 +++-----
 2 files changed, 3 insertions(+), 15 deletions(-)
----------------------------------------------------------------------



[3/8] git commit: Merge branch 'master' of github.com:jlongster/cordova-plugin-geolocation

Posted by za...@apache.org.
Merge branch 'master' of github.com:jlongster/cordova-plugin-geolocation

Conflicts:
	src/firefoxos/GeolocationProxy.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/1bd76739
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/1bd76739
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/1bd76739

Branch: refs/heads/master
Commit: 1bd76739177d0bcbf9aad53765f0859c2659b832
Parents: 4c07955 61062b9
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Mon Nov 4 20:49:05 2013 +0100
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Mon Nov 4 20:49:05 2013 +0100

----------------------------------------------------------------------
 plugin.xml                        | 21 ++++++++++++---
 src/firefoxos/GeolocationProxy.js | 47 +++++++++++++++++++++-------------
 2 files changed, 47 insertions(+), 21 deletions(-)
----------------------------------------------------------------------



[7/8] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation

Posted by za...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/48af4c4d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/48af4c4d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/48af4c4d

Branch: refs/heads/master
Commit: 48af4c4d9f5d9e11304be58e0f509c57bff409f1
Parents: cb3612c 1ac2200
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Tue May 20 20:48:38 2014 +0200
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Tue May 20 20:48:38 2014 +0200

----------------------------------------------------------------------
 CONTRIBUTING.md                           |   16 +
 NOTICE                                    |    5 +
 RELEASENOTES.md                           |   12 +
 doc/index.md                              |   11 +
 plugin.xml                                |   74 +-
 src/android/CordovaLocationListener.java  |  251 ---
 src/android/GPSListener.java              |   50 -
 src/android/GeoBroker.java                |  205 --
 src/android/NetworkListener.java          |   33 -
 src/ios/CDVLocation.m                     |    2 +-
 src/ubuntu/geolocation.cpp                |  119 ++
 src/ubuntu/geolocation.h                  |   69 +
 src/windows8/GeolocationProxy.js          |    2 +-
 test/.DS_Store                            |  Bin 6148 -> 0 bytes
 test/autotest/html/HtmlReporter.js        |  101 -
 test/autotest/html/HtmlReporterHelpers.js |   60 -
 test/autotest/html/ReporterView.js        |  164 --
 test/autotest/html/SpecView.js            |   79 -
 test/autotest/html/SuiteView.js           |   22 -
 test/autotest/html/TrivialReporter.js     |  192 --
 test/autotest/index.html                  |   59 -
 test/autotest/jasmine.css                 |   81 -
 test/autotest/jasmine.js                  | 2530 ------------------------
 test/autotest/pages/.DS_Store             |  Bin 6148 -> 0 bytes
 test/autotest/pages/geolocation.html      |   71 -
 test/autotest/test-runner.js              |   62 -
 test/autotest/tests/.DS_Store             |  Bin 6148 -> 0 bytes
 test/autotest/tests/geolocation.tests.js  |  140 --
 test/cordova-incl.js                      |   72 -
 test/index.html                           |   65 -
 test/location/index.html                  |  169 --
 test/main.js                              |  163 --
 test/master.css                           |  164 --
 www/blackberry10/GeolocationProxy.js      |   34 +-
 34 files changed, 301 insertions(+), 4776 deletions(-)
----------------------------------------------------------------------



[4/8] git commit: pass by only coords

Posted by za...@apache.org.
pass by only coords


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

Branch: refs/heads/master
Commit: 9e8ce3074e726a2f5315bac5ff848e331dfb5cfb
Parents: 1bd7673
Author: Piotr Zalewa <pi...@zalewa.info>
Authored: Tue Nov 5 14:23:51 2013 +0100
Committer: Piotr Zalewa <pi...@zalewa.info>
Committed: Tue Nov 5 14:23:51 2013 +0100

----------------------------------------------------------------------
 src/firefoxos/GeolocationProxy.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/9e8ce307/src/firefoxos/GeolocationProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/GeolocationProxy.js b/src/firefoxos/GeolocationProxy.js
index c5803de..305eed1 100644
--- a/src/firefoxos/GeolocationProxy.js
+++ b/src/firefoxos/GeolocationProxy.js
@@ -26,7 +26,11 @@ var idsMap = {};
 module.exports = {
     getLocation: function(success, error, args) {
         var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');
-        geo.getCurrentPosition(success, error, {
+        function successCallback(position) {
+          // Cordova is creating Position object using just coords
+          success(position.coords);
+        }
+        geo.getCurrentPosition(successCallback, error, {
             enableHighAccuracy: args[0],
             maximumAge: args[1]
         });


[2/8] git commit: proper implementation for firefoxos

Posted by za...@apache.org.
proper implementation for firefoxos


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/61062b90
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/61062b90
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/61062b90

Branch: refs/heads/master
Commit: 61062b906eab51792ca47a9928ff13b67712a377
Parents: 459a01c
Author: James Long <lo...@gmail.com>
Authored: Mon Nov 4 13:50:38 2013 -0500
Committer: James Long <lo...@gmail.com>
Committed: Mon Nov 4 13:50:38 2013 -0500

----------------------------------------------------------------------
 plugin.xml                        | 21 ++++++++++++---
 src/firefoxos/GeolocationProxy.js | 49 +++++++++++++++++++++-------------
 2 files changed, 48 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/61062b90/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index fa074bd..dd33874 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -132,18 +132,33 @@ xmlns:android="http://schemas.android.com/apk/res/android"
             <DeviceCapability Name="location" />
         </config-file>
     </platform>
-    
+
     <!-- firefoxos -->
     <platform name="firefoxos">
         <config-file target="config.xml" parent="/*">
             <feature name="Geolocation">
                 <param name="firefoxos-package" value="Geolocation" />
             </feature>
-        </config-file>                                         
+        </config-file>
+
         <js-module src="src/firefoxos/GeolocationProxy.js" name="GeolocationProxy">
             <runs />
         </js-module>
-    </platform>
 
+        <js-module src="www/Coordinates.js" name="Coordinates">
+            <clobbers target="Coordinates" />
+        </js-module>
 
+        <js-module src="www/PositionError.js" name="PositionError">
+            <clobbers target="PositionError" />
+        </js-module>
+
+        <js-module src="www/Position.js" name="Position">
+            <clobbers target="Position" />
+        </js-module>
+
+        <js-module src="www/geolocation.js" name="geolocation">
+            <clobbers target="navigator.geolocation" />
+        </js-module>
+    </platform>
 </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/61062b90/src/firefoxos/GeolocationProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/GeolocationProxy.js b/src/firefoxos/GeolocationProxy.js
index 0f05f02..c5803de 100644
--- a/src/firefoxos/GeolocationProxy.js
+++ b/src/firefoxos/GeolocationProxy.js
@@ -21,29 +21,40 @@
            
 // latest geolocation spec can be found here: http://www.w3.org/TR/geolocation-API/
 
+var idsMap = {};
+
 module.exports = {
+    getLocation: function(success, error, args) {
+        var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');
+        geo.getCurrentPosition(success, error, {
+            enableHighAccuracy: args[0],
+            maximumAge: args[1]
+        });
+    },
 
-    getCurrentPosition: function(win, geolocationError, args) {
-        win(position);
+    addWatch: function(success, error, args) {
+        var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');        
+        var id = args[0];
+        var nativeId = geo.watchPosition(success, error, {
+            enableHighAccuracy: args[1]
+        });
+
+        idsMap[id] = nativeId;
     },
-    
-    geolocationError(error) {
-        switch(error.code) {
-            case error.TIMEOUT:
-                console.log("geolocation timeout");
-                break;
-            case error.POSITION_UNAVAILABLE:
-                console.log("position unavailable");
-                break;
-            case error:.PERMISSION_DENIED:
-                console.log("permission denied");
-                break;
-            default:    
-                console.log("unknown error");
-                break;
+
+    clearWatch: function(success, error, args) {
+        var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');
+        var id = args[0];
+
+        if(id in idsMap) {
+            geo.clearWatch(idsMap[id]);
+            delete idsMap[id];
         }
-    }
 
+        if(success) {
+            success();
+        }
+    }
 };
 
-require("cordova/firefoxos/commandProxy").add("Geolocation", module.exports);
\ No newline at end of file
+require("cordova/firefoxos/commandProxy").add("Geolocation", module.exports);