incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [3/11] js commit: broke out methods to their own file/modules per Command
Date Fri, 20 Jul 2012 22:56:18 GMT
broke out methods to their own file/modules per Command


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

Branch: refs/heads/master
Commit: 3fed8ddbf1a0a9df0b4dab2c8f3cdceb20969b21
Parents: 174aff1
Author: Jesse <purplecabbage@gmail.com>
Authored: Fri Jul 20 15:49:15 2012 -0700
Committer: Jesse <purplecabbage@gmail.com>
Committed: Fri Jul 20 15:49:15 2012 -0700

----------------------------------------------------------------------
 lib/win8metro/exec.js                              |  257 +--------------
 .../plugin/win8metro/AccelerometerProxy.js         |    9 +-
 lib/win8metro/plugin/win8metro/CameraProxy.js      |   86 +++++
 lib/win8metro/plugin/win8metro/CompassProxy.js     |   40 +++
 lib/win8metro/plugin/win8metro/DeviceProxy.js      |   12 +
 lib/win8metro/plugin/win8metro/FileProxy.js        |   72 ++++
 .../plugin/win8metro/NetworkStatusProxy.js         |   46 +++
 lib/win8metro/plugin/win8metro/device.js           |    2 +-
 8 files changed, 277 insertions(+), 247 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/exec.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/exec.js b/lib/win8metro/exec.js
index d0faee1..e03151d 100644
--- a/lib/win8metro/exec.js
+++ b/lib/win8metro/exec.js
@@ -28,250 +28,16 @@ var cordova = require('cordova');
 var CommandProxy  = {
 
     "Accelerometer": require('cordova/plugin/win8metro/AccelerometerProxy'),
-    "Camera":{
-        // args will contain ...  it is an array, so be careful
-        // 0 quality:50, 
-        // 1 destinationType:Camera.DestinationType.FILE_URI, 
-        // 2 sourceType:Camera.PictureSourceType.CAMERA, 
-        // 3 targetWidth:-1, 
-        // 4 targetHeight:-1, 
-        // 5 encodingType:Camera.EncodingType.JPEG,
-        // 6 mediaType:Camera.MediaType.PICTURE, 
-        // 7 allowEdit:false, 
-        // 8 correctOrientation:false, 
-        // 9 saveToPhotoAlbum:false, 
-        // 10 popoverOptions:null        
-        "takePicture":function(win,lose,args) {
-            if(args[2] == Camera.PictureSourceType.CAMERA) {
-                // display the camera, and capture an image
-                var dialog = new Windows.Media.Capture.CameraCaptureUI();
-                var allowCrop = !!args[7];
-                if(!allowCrop) {
-                    dialog.photoSettings.allowCrop = false;
-                }
-                else {
-                    var aspectRatio = { width:args[3] > 0 ? args[3] : 1, height: args[4]
> 0 ? args[4] : 1};
-                    dialog.photoSettings.croppedAspectRatio = aspectRatio;
-                }
-                if(args[5] == Camera.EncodingType.JPEG) {
-                    dialog.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
-                }
-                else if (args[5] == Camera.EncodingType.PNG) {
-                    dialog.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
-                }
-
-                dialog.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).done(
-                    function(file){
-                        if(file) {
-                            console.log("got a file in success handler");
-                            if(args[1] == Camera.DestinationType.FILE_URI)
-                            {
-                                var imageBlobUrl = URL.createObjectURL(file);
-                                win(imageBlobUrl);
-                            }
-                        }
-                        else {
-                            console.log("success handler without file ...");
-                        }
-                    },
-                    function(err) {
-                        console.log("err in camerq");
-                    });
-            }
-            else {
-                // grab from the photo library
-                var picker = new Windows.Storage.Pickers.FileOpenPicker();
-                picker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
-                picker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
-
-                picker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
-
-                picker.pickSingleFileAsync().then(function (file) {
-                    if (file) {
-                        console.log("got a file in success handler");
-                        if(args[1] == Camera.DestinationType.FILE_URI)
-                        {
-                            var imageBlobUrl = URL.createObjectURL(file);
-                            win(imageBlobUrl);
-                        }
-                    } else {
-                        // cancelled ??
-                        console.log("success handler without file ...");
-                    }
-                });
-            }
-
-        }
-
-    },
-    "Compass":{
-        onReadingChanged:null,
-        getHeading:function(win,lose) {
-            var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
-            if(!deviceCompass) {
-                setTimeout(function(){lose("Compass not available");},0);
-            }
-            else {
-
-                deviceCompass.reportInterval = Math.max(16,deviceCompass.minimumReportInterval);
-
-                this.onReadingChanged = function(e) {
-                    var reading = e.reading;
-                    var heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth);
-                    win(heading);
-                };
-                deviceCompass.addEventListener("readingchanged",this.onReadingChanged);
-            }
-
-        },
-        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);
-                this.onReadingChanged = null;
-                deviceCompass.reportInterval = 0;
-                win();
-            }
-
-        }
-    },
-    "Device": {
-        getDeviceInfo:function(win,fail,args){
-            console.log("NativeProxy::getDeviceInfo");
-            setTimeout(function(){
-                win({platform:"win8metro", version:"8", name:"metrova", uuid:"42", cordova:"2.0.1"});
-            },0);
-        }
-    },
-    "File": {
-
-        getFileMetaData:function(win,fail,args) { // ["fullPath"]
-            var fullPath = args[0];
-        },
-        getMetadata:function(win,fail,args) { // ["fullPath"]
-            var fullPath = args[0];
-        },
-        getParent:function(win,fail,args) { // ["fullPath"]
-            var fullPath = args[0];
-        },
-        readAsText:function(win,fail,args) { // ["fileName","encoding"]
-            var fileName = args[0];
-            var encoding = args[1];
-        },
-        readAsDataURL:function(win,fail,args) { // ["fileName"]
-            var fileName = args[0];
-        },
-        getDirectory:function(win,fail,args) { // ["fullPath","path","options"]
-            var fullPath = args[0];
-            var path = args[1];
-            var options = args[2];
-        },
-        remove:function(win,fail,args) { // ["fullPath"]
-            var fullPath = args[0];
-        },
-        removeRecursively:function(win,fail,args) { // ["fullPath"]
-            var fullPath = args[0];
-        },
-        getFile:function(win,fail,args) { // ["fullPath","path","options"]
-            var fullPath = args[0];
-            var path = args[1];
-            var options = args[2];
-        },      
-        readEntries:function(win,fail,args) { // ["fullPath"]
-            var fullPath = args[0];
-        },
-        write:function(win,fail,args) { // ["fileName","data","position"]
-            var fileName = args[0];
-            var data = args[1];
-            var position = args[2];
-        },
-        truncate:function(win,fail,args) { // ["fileName","size"]
-            var fileName = args[0];
-            var size = args[1];
-        },
-        copyTo:function(win,fail,args) { // ["fullPath","parent", "newName"]
-            var fullPath = args[0];
-            var parent = args[1];
-            var newName = args[2];
-        },
-        moveTo:function(win,fail,args) { // ["fullPath","parent", "newName"]
-            var fullPath = args[0];
-            var parent = args[1];
-            var newName = args[2];
-        },
-        tempFileSystem:null,
-        persistentFileSystem:null,
-        requestFileSystem:function(win,fail,args) { // ["type","size"]
-
-            var type = args[0];
-            var size = args[1];
-
-
-        },         
-        resolveLocalFileSystemURI:function(win,fail,args) { // ["uri"]
-            var uri = args[0];
-        }           
-
-    },
-    "NetworkStatus": { 
-        getConnectionInfo:function(win,fail,args)
-        {
-            var winNetConn = Windows.Networking.Connectivity;
-            var networkInfo = winNetConn.NetworkInformation;
-            var networkCostInfo = winNetConn.NetworkCostType;
-            var networkConnectivityInfo = winNetConn.NetworkConnectivityLevel;
-            var networkAuthenticationInfo = winNetConn.NetworkAuthenticationType;
-            var networkEncryptionInfo = winNetConn.NetworkEncryptionType;
-
-            var profile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile();
-            if(profile) {
-            var conLevel = profile.getNetworkConnectivityLevel();
-
-            switch (conLevel) {
-                case Windows.Networking.Connectivity.NetworkConnectivityLevel.none:
-                    break;
-                case Windows.Networking.Connectivity.NetworkConnectivityLevel.localAccess:
-                    break;
-                case Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess:
-                    break;
-                case Windows.Networking.Connectivity.NetworkConnectivityLevel.constrainedInternetAccess:
-                    break;
-            }
-        }
-
-
-            // FYI
-            //Connection.UNKNOWN  'Unknown connection';
-            //Connection.ETHERNET 'Ethernet connection';
-            //Connection.WIFI     'WiFi connection';
-            //Connection.CELL_2G  'Cell 2G connection';
-            //Connection.CELL_3G  'Cell 3G connection';
-            //Connection.CELL_4G  'Cell 4G connection';
-            //Connection.NONE     'No network connection';
-
-            setTimeout(function(){
-                win("wifi");
-            },0);
-        }
-
-    } 
+    "Camera":require('cordova/plugin/win8metro/CameraProxy'),
+    "Compass":require('cordova/plugin/win8metro/CompassProxy'),
+    "Device":require('cordova/plugin/win8metro/DeviceProxy'),
+    "File":require('cordova/plugin/win8metro/FileProxy'),
+    "NetworkStatus":require('cordova/plugin/win8metro/NetworkStatusProxy')
 };
-    // ,
-    // "Accelerometer": require('cordova/plugin/bada/Accelerometer'),
-    // "Notification": require('cordova/plugin/bada/Notification'),
-    // "Compass": require('cordova/plugin/bada/Compass'),
-    // "Capture": require('cordova/plugin/bada/Capture'),
-    // "Camera": require('cordova/plugin/bada/Camera'),
-    // "Contacts": require('cordova/plugin/bada/Contacts')
 
+var Exec = function(success, fail, service, action, args) {
 
-module.exports = function(success, fail, service, action, args) {
-
-    if(CommandProxy [service] && CommandProxy [service][action]) {
+    if(CommandProxy[service] && CommandProxy[service][action]) {
 
         var callbackId = service + cordova.callbackId++;
         console.log("EXEC:" + service + " : " + action);
@@ -289,10 +55,17 @@ module.exports = function(success, fail, service, action, args) {
     }
     else
     {
-        if(fail) { fail("Missing Command Error"); };
+        if(fail) { fail("Missing Command Error"); }
     }
 
 };
 
+Exec.addCommandProxy = function(id,proxyObj) {
+
+    CommandProxy[id] = proxyObj;
+};
+
+module.exports = Exec;
+
 
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/AccelerometerProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/AccelerometerProxy.js b/lib/win8metro/plugin/win8metro/AccelerometerProxy.js
index 37fd590..017ee91 100644
--- a/lib/win8metro/plugin/win8metro/AccelerometerProxy.js
+++ b/lib/win8metro/plugin/win8metro/AccelerometerProxy.js
@@ -1,10 +1,11 @@
-var cordova = require('cordova');
+var cordova = require('cordova'),
+    Acceleration = require('cordova/plugin/Acceleration');
 
 /* This is the actual implementation part that returns the result on Win8Metro
 */
 
-module.exports = { 
-    onDataChanged:null,       
+module.exports = {
+    onDataChanged:null,
     start:function(win,lose){
 
         var accel = Windows.Devices.Sensors.Accelerometer.getDefault();
@@ -19,7 +20,7 @@ module.exports = {
             this.onDataChanged = function(e) {
                 var a = e.reading;
                 win(new Acceleration(a.accelerationX,a.accelerationY,a.accelerationZ));
-            }
+            };
             accel.addEventListener("readingchanged",this.onDataChanged);
         }
     },

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/CameraProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/CameraProxy.js b/lib/win8metro/plugin/win8metro/CameraProxy.js
new file mode 100644
index 0000000..db6613a
--- /dev/null
+++ b/lib/win8metro/plugin/win8metro/CameraProxy.js
@@ -0,0 +1,86 @@
+/*global Windows:true, URL:true */
+
+
+var cordova = require('cordova'),
+    Camera = require('cordova/plugin/CameraConstants');
+
+
+module.exports = {
+
+// args will contain :
+//  ...  it is an array, so be careful
+// 0 quality:50,
+// 1 destinationType:Camera.DestinationType.FILE_URI,
+// 2 sourceType:Camera.PictureSourceType.CAMERA,
+// 3 targetWidth:-1,
+// 4 targetHeight:-1,
+// 5 encodingType:Camera.EncodingType.JPEG,
+// 6 mediaType:Camera.MediaType.PICTURE,
+// 7 allowEdit:false,
+// 8 correctOrientation:false,
+// 9 saveToPhotoAlbum:false,
+// 10 popoverOptions:null
+
+"takePicture":function(win,lose,args) {
+
+    if(args[2] == Camera.PictureSourceType.CAMERA) {
+        // display the camera, and capture an image
+        var dialog = new Windows.Media.Capture.CameraCaptureUI();
+        var allowCrop = !!args[7];
+        if(!allowCrop) {
+            dialog.photoSettings.allowCrop = false;
+        }
+        else {
+            var aspectRatio = { width:args[3] > 0 ? args[3] : 1, height: args[4] >
0 ? args[4] : 1};
+            dialog.photoSettings.croppedAspectRatio = aspectRatio;
+        }
+        if(args[5] == Camera.EncodingType.JPEG) {
+            dialog.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
+        }
+        else if (args[5] == Camera.EncodingType.PNG) {
+            dialog.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
+        }
+
+        dialog.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).done(
+            function(file){
+                if(file) {
+                    console.log("got a file in success handler");
+                    if(args[1] == Camera.DestinationType.FILE_URI)
+                    {
+                        var imageBlobUrl = URL.createObjectURL(file);
+                        win(imageBlobUrl);
+                    }
+                }
+                else {
+                    console.log("success handler without file ...");
+                }
+            },
+            function(err) {
+                console.log("err in camerq");
+            });
+    }
+    else {
+        // grab from the photo library
+        var picker = new Windows.Storage.Pickers.FileOpenPicker();
+        picker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail;
+        picker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
+
+        picker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
+
+        picker.pickSingleFileAsync().then(function (file) {
+            if (file) {
+                console.log("got a file in success handler");
+                if(args[1] == Camera.DestinationType.FILE_URI)
+                {
+                    var imageBlobUrl = URL.createObjectURL(file);
+                    win(imageBlobUrl);
+                }
+            } else {
+                // cancelled ??
+                console.log("success handler without file ...");
+            }
+        });
+    }
+
+}
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/CompassProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/CompassProxy.js b/lib/win8metro/plugin/win8metro/CompassProxy.js
new file mode 100644
index 0000000..c2bd18f
--- /dev/null
+++ b/lib/win8metro/plugin/win8metro/CompassProxy.js
@@ -0,0 +1,40 @@
+var cordova = require('cordova'),
+    CompassHeading = require('cordova/plugin/CompassHeading');
+
+
+module.exports = {
+
+    onReadingChanged:null,
+    getHeading:function(win,lose) {
+        var deviceCompass = Windows.Devices.Sensors.Compass.getDefault();
+        if(!deviceCompass) {
+            setTimeout(function(){lose("Compass not available");},0);
+        }
+        else {
+
+            deviceCompass.reportInterval = Math.max(16,deviceCompass.minimumReportInterval);
+
+            this.onReadingChanged = function(e) {
+                var reading = e.reading;
+                var heading = new CompassHeading(reading.headingMagneticNorth, reading.headingTrueNorth);
+                win(heading);
+            };
+            deviceCompass.addEventListener("readingchanged",this.onReadingChanged);
+        }
+
+    },
+    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);
+            this.onReadingChanged = null;
+            deviceCompass.reportInterval = 0;
+            win();
+        }
+
+    }
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/DeviceProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/DeviceProxy.js b/lib/win8metro/plugin/win8metro/DeviceProxy.js
new file mode 100644
index 0000000..6856f21
--- /dev/null
+++ b/lib/win8metro/plugin/win8metro/DeviceProxy.js
@@ -0,0 +1,12 @@
+var cordova = require('cordova');
+
+
+module.exports = {
+
+        getDeviceInfo:function(win,fail,args){
+            console.log("NativeProxy::getDeviceInfo");
+            setTimeout(function(){
+                win({platform:"win8metro", version:"8", name:"metrova", uuid:"42", cordova:"2.0.1"});
+            },0);
+        }
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/FileProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/FileProxy.js b/lib/win8metro/plugin/win8metro/FileProxy.js
new file mode 100644
index 0000000..9c2dade
--- /dev/null
+++ b/lib/win8metro/plugin/win8metro/FileProxy.js
@@ -0,0 +1,72 @@
+var cordova = require('cordova');
+
+
+module.exports = {
+
+    getFileMetaData:function(win,fail,args) { // ["fullPath"]
+        var fullPath = args[0];
+    },
+    getMetadata:function(win,fail,args) { // ["fullPath"]
+        var fullPath = args[0];
+    },
+    getParent:function(win,fail,args) { // ["fullPath"]
+        var fullPath = args[0];
+    },
+    readAsText:function(win,fail,args) { // ["fileName","encoding"]
+        var fileName = args[0];
+        var encoding = args[1];
+    },
+    readAsDataURL:function(win,fail,args) { // ["fileName"]
+        var fileName = args[0];
+    },
+    getDirectory:function(win,fail,args) { // ["fullPath","path","options"]
+        var fullPath = args[0];
+        var path = args[1];
+        var options = args[2];
+    },
+    remove:function(win,fail,args) { // ["fullPath"]
+        var fullPath = args[0];
+    },
+    removeRecursively:function(win,fail,args) { // ["fullPath"]
+        var fullPath = args[0];
+    },
+    getFile:function(win,fail,args) { // ["fullPath","path","options"]
+        var fullPath = args[0];
+        var path = args[1];
+        var options = args[2];
+    },
+    readEntries:function(win,fail,args) { // ["fullPath"]
+        var fullPath = args[0];
+    },
+    write:function(win,fail,args) { // ["fileName","data","position"]
+        var fileName = args[0];
+        var data = args[1];
+        var position = args[2];
+    },
+    truncate:function(win,fail,args) { // ["fileName","size"]
+        var fileName = args[0];
+        var size = args[1];
+    },
+    copyTo:function(win,fail,args) { // ["fullPath","parent", "newName"]
+        var fullPath = args[0];
+        var parent = args[1];
+        var newName = args[2];
+    },
+    moveTo:function(win,fail,args) { // ["fullPath","parent", "newName"]
+        var fullPath = args[0];
+        var parent = args[1];
+        var newName = args[2];
+    },
+    tempFileSystem:null,
+    persistentFileSystem:null,
+    requestFileSystem:function(win,fail,args) { // ["type","size"]
+
+        var type = args[0];
+        var size = args[1];
+
+    },
+    resolveLocalFileSystemURI:function(win,fail,args) { // ["uri"]
+        var uri = args[0];
+    }
+
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/NetworkStatusProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/NetworkStatusProxy.js b/lib/win8metro/plugin/win8metro/NetworkStatusProxy.js
new file mode 100644
index 0000000..46a3b94
--- /dev/null
+++ b/lib/win8metro/plugin/win8metro/NetworkStatusProxy.js
@@ -0,0 +1,46 @@
+var cordova = require('cordova');
+
+
+module.exports = {
+
+    getConnectionInfo:function(win,fail,args)
+    {
+        var winNetConn = Windows.Networking.Connectivity;
+        var networkInfo = winNetConn.NetworkInformation;
+        var networkCostInfo = winNetConn.NetworkCostType;
+        var networkConnectivityInfo = winNetConn.NetworkConnectivityLevel;
+        var networkAuthenticationInfo = winNetConn.NetworkAuthenticationType;
+        var networkEncryptionInfo = winNetConn.NetworkEncryptionType;
+
+        var profile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile();
+        if(profile) {
+        var conLevel = profile.getNetworkConnectivityLevel();
+
+        switch (conLevel) {
+            case Windows.Networking.Connectivity.NetworkConnectivityLevel.none:
+                break;
+            case Windows.Networking.Connectivity.NetworkConnectivityLevel.localAccess:
+                break;
+            case Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess:
+                break;
+            case Windows.Networking.Connectivity.NetworkConnectivityLevel.constrainedInternetAccess:
+                break;
+        }
+    }
+
+
+        // FYI
+        //Connection.UNKNOWN  'Unknown connection';
+        //Connection.ETHERNET 'Ethernet connection';
+        //Connection.WIFI     'WiFi connection';
+        //Connection.CELL_2G  'Cell 2G connection';
+        //Connection.CELL_3G  'Cell 3G connection';
+        //Connection.CELL_4G  'Cell 4G connection';
+        //Connection.NONE     'No network connection';
+
+        setTimeout(function(){
+            win("wifi");
+        },0);
+    }
+
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3fed8ddb/lib/win8metro/plugin/win8metro/device.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/device.js b/lib/win8metro/plugin/win8metro/device.js
index 4889cb9..26381fe 100644
--- a/lib/win8metro/plugin/win8metro/device.js
+++ b/lib/win8metro/plugin/win8metro/device.js
@@ -4,7 +4,7 @@ if(!console || !console.log)
 {
     var exec = require('cordova/exec'),
         channel = require('cordova/channel');
-    var cordova = require("cordova");
+
 
 
     var debugConsole = {


Mime
View raw message