cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/11] js commit: removed unneeded geolocation objects but had to add Position+Coordinates in order to pass tests, fixed space encoding issues in FileProxy
Date Mon, 29 Oct 2012 22:47:12 GMT
Updated Branches:
  refs/heads/master d819e1e60 -> 8a5873592


removed unneeded geolocation objects but had to add Position+Coordinates in order to pass
tests, fixed space encoding issues in FileProxy


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/8a587359
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/8a587359
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/8a587359

Branch: refs/heads/master
Commit: 8a5873592c21a2e70ee39a8189798d07c2496d96
Parents: d163b1f
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Mon Oct 29 15:45:22 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Mon Oct 29 15:45:22 2012 -0700

----------------------------------------------------------------------
 lib/windows8/platform.js                    |    7 ++
 lib/windows8/plugin/windows8/FileProxy.js   |    7 +-
 lib/windows8/plugin/windows8/geolocation.js |  114 ----------------------
 3 files changed, 8 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/8a587359/lib/windows8/platform.js
----------------------------------------------------------------------
diff --git a/lib/windows8/platform.js b/lib/windows8/platform.js
index 75f0a28..cc107b9 100755
--- a/lib/windows8/platform.js
+++ b/lib/windows8/platform.js
@@ -39,6 +39,7 @@ require('cordova/plugin/windows8/FileTransferProxy');
 require('cordova/plugin/windows8/MediaProxy');
 require('cordova/plugin/windows8/NotificationProxy');
 
+
 module.exports = {
     id: "windows8",
     initialize:function() {
@@ -80,6 +81,12 @@ module.exports = {
                 }
             }
         },
+        Position:{
+            path:'cordova/plugin/Position'
+        },
+        Coordinates:{
+            path:'cordova/plugin/Coordinates'
+        },
         navigator: {
             children: {
                 device: {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/8a587359/lib/windows8/plugin/windows8/FileProxy.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/FileProxy.js b/lib/windows8/plugin/windows8/FileProxy.js
index 71cdb37..2e6f50c 100644
--- a/lib/windows8/plugin/windows8/FileProxy.js
+++ b/lib/windows8/plugin/windows8/FileProxy.js
@@ -194,8 +194,6 @@ module.exports = {
             flag = new Flags(false, false);
         }
 
-        path = String(path).split(" ").join("\ ");
-
         Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then(
             function (storageFolder) {
                 if (flag.create === true && flag.exclusive === true) {
@@ -374,8 +372,6 @@ module.exports = {
             flag = new Flags(false, false);
         }
 
-        path = String(path).split(" ").join("\ ");
-
         Windows.Storage.StorageFolder.getFolderFromPathAsync(fullPath).then(
             function (storageFolder) {
                 if (flag.create === true && flag.exclusive === true) {
@@ -800,11 +796,10 @@ module.exports = {
         var uri = args[0];
 
         var path = uri;
-        path = path.split(" ").join("\ ");
 
         // support for file name with parameters
         if (/\?/g.test(path)) {
-            path = String(path).split("\?")[0];
+            path = String(path).split("?")[0];
         }
 
         // support for encodeURI

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/8a587359/lib/windows8/plugin/windows8/geolocation.js
----------------------------------------------------------------------
diff --git a/lib/windows8/plugin/windows8/geolocation.js b/lib/windows8/plugin/windows8/geolocation.js
deleted file mode 100644
index e6af048..0000000
--- a/lib/windows8/plugin/windows8/geolocation.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*global Windows:true */
-
-var Position = require('cordova/plugin/Position'),
-    PositionError = require('cordova/plugin/PositionError');
-
-module.exports = { // Merges with common
-
-
-    getLocation:function(win, lose, args) {
-        // options.enableHighAccuracy
-        // options.maximumAge
-        // options.timeout
-        
-        var options = args[0];
-
-        var geolocator = new Windows.Devices.Geolocation.Geolocator();
-        if (options.enableHighAccuracy) {
-            geolocator.desiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.high;
-        }
-
-        geolocator.getGeopositionAsync(options.maximumAge, options.timeout).done(
-            function(geoposition) {
-                // Win8 JS API coordinate Object
-                win(geoposition.coordinate);
-            }, function() {
-                var e = {};
-
-                switch (geolocator.locationStatus) {
-                    case Windows.Devices.Geolocation.PositionStatus.ready:
-                        // Location data is available
-                        e.message = "Location is available.";
-                        e.code = PositionError.TIMEOUT;
-                        lose (e);
-                        break;
-                    case Windows.Devices.Geolocation.PositionStatus.initializing:
-                        // This status indicates that a GPS is still acquiring a fix
-                        e.message = "A GPS device is still initializing.";
-                        e.code = PositionError.POSITION_UNAVAILABLE;
-                        lose(e);
-                        break;
-                    case Windows.Devices.Geolocation.PositionStatus.noData:
-                        // No location data is currently available
-                        e.message = "Data from location services is currently unavailable.";
-                        e.code = PositionError.POSITION_UNAVAILABLE;
-                        lose(e);
-                        break;
-                    case Windows.Devices.Geolocation.PositionStatus.disabled:
-                        // The app doesn't have permission to access location,
-                        // either because location has been turned off.
-                        e.message = "Your location is currently turned off. " +
-                        "Change your settings through the Settings charm " +
-                        " to turn it back on.";
-                        e.code = PositionError.PERMISSION_DENIED;
-                        lose(e);
-                        break;
-                    case Windows.Devices.Geolocation.PositionStatus.notInitialized:
-                        // This status indicates that the app has not yet requested
-                        // location data by calling GetGeolocationAsync() or
-                        // registering an event handler for the positionChanged event.
-                        e.message = "Location status is not initialized because " +
-                        "the app has not requested location data.";
-                        e.code = PositionError.POSITION_UNAVAILABLE;
-                        lose(e);
-                        break;
-                    case Windows.Devices.Geolocation.PositionStatus.notAvailable:
-                        // Location is not available on this version of Windows
-                        e.message = "You do not have the required location services " +
-                        "present on your system.";
-                        e.code = PositionError.POSITION_UNAVAILABLE;
-                        lose(e);
-                        break;
-                    default:
-                        e.code = PositionError.TIMEOUT;
-                        lose(e);
-                        break;
-
-                }
-            }
-        );
-    },
-
-    addWatch:function(win, lose, args) {
-        // id
-        // options
-        // options.maximumAge
-        // options.timeout
-        // timers[]
-        timers[id] = new Windows.Devices.Geolocation.Geolocator().getGeopositionAsync(options.maximumAge,
options.timeout).done(
-            new Geolocation().getCurrentPosition(win, lose, options)
-        );
-    }
-    // clearWatch is not needed as in common code the timer is deleted
-};


Mime
View raw message