You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2012/11/29 01:27:19 UTC

[1/2] js commit: Switched from strings to Constants defined in Connection for connection type

Updated Branches:
  refs/heads/master fdfefbf24 -> f29591f86


Switched from strings to Constants defined in Connection for connection type


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

Branch: refs/heads/master
Commit: f29591f869db25f7fa52766e4ac5b60ced38a59f
Parents: 75f2fa6
Author: Markus Leutwyler <ml...@yahoo.com>
Authored: Thu Nov 22 15:29:42 2012 +0100
Committer: hermwong <he...@gmail.com>
Committed: Wed Nov 28 16:27:07 2012 -0800

----------------------------------------------------------------------
 lib/webos/plugin/webos/network.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f29591f8/lib/webos/plugin/webos/network.js
----------------------------------------------------------------------
diff --git a/lib/webos/plugin/webos/network.js b/lib/webos/plugin/webos/network.js
index 3cb894d..3f8f8f8 100644
--- a/lib/webos/plugin/webos/network.js
+++ b/lib/webos/plugin/webos/network.js
@@ -19,7 +19,8 @@
  *
 */
 
-var service=require('cordova/plugin/webos/service');
+var service=require('cordova/plugin/webos/service'),
+    Connection = require('cordova/plugin/Connection');
 
 module.exports = {
     /**
@@ -39,9 +40,9 @@ module.exports = {
                 console.log("result:"+JSON.stringify(result));
 
                 var info={};
-                if (!result.isInternetConnectionAvailable) { info.type="Connection.NONE"; }
-                if (result.wifi.onInternet) { info.type="Connection.WIFI"; }
-                if (result.wan.state==="connected") { info.type="Connection.CELL_2G"; }
+                if (!result.isInternetConnectionAvailable) { info.type=Connection.NONE; }
+                if (result.wifi.onInternet) { info.type=Connection.WIFI; }
+                if (result.wan.state==="connected") { info.type=Connection.CELL_2G; }
 
                 successCallback(info.type);
             },