You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by au...@apache.org on 2017/08/07 17:08:32 UTC

cordova-plugin-network-information git commit: CB-12895 : added eslint and removed eslint

Repository: cordova-plugin-network-information
Updated Branches:
  refs/heads/master f9643daba -> 78691e43e


CB-12895 : added eslint and removed eslint


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/commit/78691e43
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/78691e43
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/78691e43

Branch: refs/heads/master
Commit: 78691e43e16d753603f41d646ca7e71b3212c282
Parents: f9643da
Author: Audrey So <au...@apache.org>
Authored: Mon Jun 12 11:15:35 2017 -0700
Committer: Audrey So <au...@apache.org>
Committed: Wed Aug 2 10:52:17 2017 -0700

----------------------------------------------------------------------
 .eslintrc.yml                   |  10 ++++
 .jshintrc                       |  17 ------
 package.json                    |  12 +++-
 src/blackberry10/index.js       |  17 +++---
 src/browser/network.js          |  22 ++++---
 src/firefoxos/NetworkProxy.js   | 112 +++++++++++++++++------------------
 src/tizen/NetworkProxy.js       |  28 ++++-----
 src/windows/NetworkInfoProxy.js |  39 ++++++------
 tests/tests.js                  |  44 +++++++-------
 www/Connection.js               |  16 ++---
 www/network.js                  |  34 +++++------
 11 files changed, 171 insertions(+), 180 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/.eslintrc.yml
----------------------------------------------------------------------
diff --git a/.eslintrc.yml b/.eslintrc.yml
new file mode 100644
index 0000000..0cccb8c
--- /dev/null
+++ b/.eslintrc.yml
@@ -0,0 +1,10 @@
+root: true
+extends: semistandard
+rules:
+  indent:
+    - error
+    - 4
+  camelcase: off
+  padded-blocks: off
+  operator-linebreak: off
+  no-throw-literal: off
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index df32482..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-    "browser": true
-  , "devel": true
-  , "bitwise": true
-  , "undef": true
-  , "trailing": true
-  , "quotmark": false
-  , "indent": 4
-  , "unused": "vars"
-  , "latedef": "nofunc"
-  , "globals": {
-        "module": false,
-        "exports": false,
-        "require": false,
-        "cordova": true
-    }
-}

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8cb7eed..6c06f41 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
     "cordova-browser"
   ],
   "scripts": {
-    "test": "npm run jshint",
-    "jshint": "jshint www && jshint src && jshint tests"
+    "test": "npm run eslint",
+    "eslint": "eslint www && eslint src && eslint tests"
   },
   "author": "Apache Software Foundation",
   "license": "Apache-2.0",
@@ -59,6 +59,12 @@
     }
   },
   "devDependencies": {
-    "jshint": "^2.6.0"
+    "eslint": "^4.0.0",
+    "eslint-config-semistandard": "^11.0.0",
+    "eslint-config-standard": "^10.2.1",
+    "eslint-plugin-import": "^2.3.0",
+    "eslint-plugin-node": "^5.0.0",
+    "eslint-plugin-promise": "^3.5.0",
+    "eslint-plugin-standard": "^3.0.1"
   }
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
index c6cd00a..1c8588b 100644
--- a/src/blackberry10/index.js
+++ b/src/blackberry10/index.js
@@ -21,9 +21,9 @@
 
 /* global PluginResult */
 
-//map from BB10 to cordova connection types:
-//https://github.com/apache/cordova-js/blob/master/lib/common/plugin/Connection.js
-function mapConnectionType(con) {
+// map from BB10 to cordova connection types:
+// https://github.com/apache/cordova-js/blob/master/lib/common/plugin/Connection.js
+function mapConnectionType (con) {
     switch (con.type) {
     case 'wired':
         return 'ethernet';
@@ -43,17 +43,16 @@ function mapConnectionType(con) {
         case 'lte':
             return '4g';
         }
-        return "cellular";
+        return 'cellular';
     }
     return 'unknown';
 }
 
-function currentConnectionType() {
+function currentConnectionType () {
     try {
-        //possible for webplatform to throw pps exception
-        return mapConnectionType(window.qnx.webplatform.device.activeConnection || { type : 'none' });
-    }
-    catch (e) {
+        // possible for webplatform to throw pps exception
+        return mapConnectionType(window.qnx.webplatform.device.activeConnection || { type: 'none' });
+    } catch (e) {
         return 'unknown';
     }
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/src/browser/network.js
----------------------------------------------------------------------
diff --git a/src/browser/network.js b/src/browser/network.js
index 8a6ddb0..6e453ee 100644
--- a/src/browser/network.js
+++ b/src/browser/network.js
@@ -18,31 +18,29 @@
  *
 */
 
-var cordova = require('cordova'),
-    proxy = require("cordova/exec/proxy"),
-    Connection = require('./Connection');
+var cordova = require('cordova');
+var proxy = require('cordova/exec/proxy');
+var Connection = require('./Connection');
 
 var type = navigator.onLine ? Connection.UNKNOWN : Connection.NONE;
 
 // Subscribe to 'native' online/offline events
-function onStatusChange(evt) {
+function onStatusChange (evt) {
     type = navigator.onLine ? Connection.UNKNOWN : Connection.NONE;
     // force async
-    setTimeout(function(){
+    setTimeout(function () {
         cordova.fireDocumentEvent(evt.type);
-    },0);
+    }, 0);
 }
 
 window.addEventListener('online', onStatusChange);
 window.addEventListener('offline', onStatusChange);
 
-proxy.add("NetworkStatus", {
-    getConnectionInfo:function(cbSuccess) {
+proxy.add('NetworkStatus', {
+    getConnectionInfo: function (cbSuccess) {
         // force async
-        setTimeout(function(){
+        setTimeout(function () {
             cbSuccess(type);
-        },0);
+        }, 0);
     }
 });
-
-

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/src/firefoxos/NetworkProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/NetworkProxy.js b/src/firefoxos/NetworkProxy.js
index 8c82557..7d49b96 100644
--- a/src/firefoxos/NetworkProxy.js
+++ b/src/firefoxos/NetworkProxy.js
@@ -24,73 +24,73 @@
   and http://w3c.github.io/netinfo/
 */
 
-var Connection = require('./Connection'),
-    modulemapper = require('cordova/modulemapper');
+var Connection = require('./Connection');
+var modulemapper = require('cordova/modulemapper');
 
 var origConnection = modulemapper.getOriginalSymbol(window, 'navigator.connection');
 
 module.exports = {
 
-  getConnectionInfo: function(successCallback, errorCallback) {
-    var connection = origConnection || navigator.mozConnection,
-        connectionType = Connection.UNKNOWN;
+    getConnectionInfo: function (successCallback, errorCallback) {
+        var connection = origConnection || navigator.mozConnection;
+        var connectionType = Connection.UNKNOWN;
 
-    if (!connection) {
-        setTimeout(function() {
-            successCallback(connectionType);
-        }, 0);
-        return;
-    }
+        if (!connection) {
+            setTimeout(function () {
+                successCallback(connectionType);
+            }, 0);
+            return;
+        }
 
-    var bandwidth = connection.bandwidth,
-      metered = connection.metered,
-      type = connection.type;
+        var bandwidth = connection.bandwidth;
+        var metered = connection.metered;
+        var type = connection.type;
 
-    if (type !== undefined) {
-      // For more information see:
-      // https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API
+        if (type !== undefined) {
+        // For more information see:
+        // https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API
 
-      switch(type) {
-        case "cellular":
-          connectionType = Connection.CELL;
-          break;
-        case "ethernet":
-          connectionType = Connection.ETHERNET;
-          break;
-        case "wifi":
-          connectionType = Connection.WIFI;
-          break;
-        case "none":
-          connectionType = Connection.NONE;
-          break;
-      }
-    } else if (bandwidth !== undefined && metered !== undefined) {
-      /*
-      bandwidth of type double, readonly
-      The user agent must set the value of the bandwidth attribute to:
-      0 if the user is currently offline;
-      Infinity if the bandwidth is unknown;
-      an estimation of the current bandwidth in MB/s (Megabytes per seconds)
-      available for communication with the browsing context active document's
-      domain.
+            switch (type) {
+            case 'cellular':
+                connectionType = Connection.CELL;
+                break;
+            case 'ethernet':
+                connectionType = Connection.ETHERNET;
+                break;
+            case 'wifi':
+                connectionType = Connection.WIFI;
+                break;
+            case 'none':
+                connectionType = Connection.NONE;
+                break;
+            }
+        } else if (bandwidth !== undefined && metered !== undefined) {
+        /*
+        bandwidth of type double, readonly
+        The user agent must set the value of the bandwidth attribute to:
+        0 if the user is currently offline;
+        Infinity if the bandwidth is unknown;
+        an estimation of the current bandwidth in MB/s (Megabytes per seconds)
+        available for communication with the browsing context active document's
+        domain.
 
-      For more information see:
-      https://developer.mozilla.org/en-US/docs/Web/API/Connection
-      */
+        For more information see:
+        https://developer.mozilla.org/en-US/docs/Web/API/Connection
+        */
 
-      if (bandwidth === 0) {
-        connectionType = Connection.NONE;
-      } else if (metered && isFinite(bandwidth)) {
-        connectionType = Connection.CELL;
-      } else if (!metered && isFinite(bandwidth)) {
-        connectionType = Connection.WIFI;
-      }
-    }
+            if (bandwidth === 0) {
+                connectionType = Connection.NONE;
+            } else if (metered && isFinite(bandwidth)) {
+                connectionType = Connection.CELL;
+            } else if (!metered && isFinite(bandwidth)) {
+                connectionType = Connection.WIFI;
+            }
+        }
 
-    setTimeout(function() {
-      successCallback(connectionType);
-    }, 0);
-  }
+        setTimeout(function () {
+            successCallback(connectionType);
+        }, 0);
+    }
 };
 
-require("cordova/exec/proxy").add("NetworkStatus", module.exports);
+require('cordova/exec/proxy').add('NetworkStatus', module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/src/tizen/NetworkProxy.js
----------------------------------------------------------------------
diff --git a/src/tizen/NetworkProxy.js b/src/tizen/NetworkProxy.js
index d2de2cc..63684d1 100644
--- a/src/tizen/NetworkProxy.js
+++ b/src/tizen/NetworkProxy.js
@@ -24,15 +24,14 @@
 var Connection = require('./Connection');
 
 module.exports = {
-    getConnectionInfo: function(successCallback, errorCallback) {
+    getConnectionInfo: function (successCallback, errorCallback) {
         var cncType = Connection.NONE;
         var infoCount = 0;
         var deviceCapabilities = null;
         var timerId = 0;
         var timeout = 300;
 
-
-        function connectionCB() {
+        function connectionCB () {
             if (timerId !== null) {
                 clearTimeout(timerId);
                 timerId = null;
@@ -47,47 +46,44 @@ module.exports = {
             }
         }
 
-        function errorCB(error) {
-            console.log("Error: " + error.code + "," + error.name + "," + error.message);
+        function errorCB (error) {
+            console.log('Error: ' + error.code + ',' + error.name + ',' + error.message);
 
             if (errorCallback) {
                 errorCallback();
             }
         }
 
-        function wifiSuccessCB(wifi) {
-            if ((wifi.status === "ON")  && (wifi.ipAddress.length !== 0)) {
+        function wifiSuccessCB (wifi) {
+            if ((wifi.status === 'ON') && (wifi.ipAddress.length !== 0)) {
                 cncType = Connection.WIFI;
             }
             connectionCB();
         }
 
-        function cellularSuccessCB(cell) {
-            if ((cncType === Connection.NONE) && (cell.status === "ON") && (cell.ipAddress.length !== 0)) {
+        function cellularSuccessCB (cell) {
+            if ((cncType === Connection.NONE) && (cell.status === 'ON') && (cell.ipAddress.length !== 0)) {
                 cncType = Connection.CELL_2G;
             }
             connectionCB();
         }
 
-
         deviceCapabilities = tizen.systeminfo.getCapabilities();
 
-
-        timerId = setTimeout(function() {
+        timerId = setTimeout(function () {
             timerId = null;
             infoCount = 1;
             connectionCB();
         }, timeout);
 
-
         if (deviceCapabilities.wifi) {
-            tizen.systeminfo.getPropertyValue("WIFI_NETWORK", wifiSuccessCB, errorCB);
+            tizen.systeminfo.getPropertyValue('WIFI_NETWORK', wifiSuccessCB, errorCB);
         }
 
         if (deviceCapabilities.telephony) {
-            tizen.systeminfo.getPropertyValue("CELLULAR_NETWORK", cellularSuccessCB, errorCB);
+            tizen.systeminfo.getPropertyValue('CELLULAR_NETWORK', cellularSuccessCB, errorCB);
         }
     }
 };
 
-require("cordova/tizen/commandProxy").add("NetworkStatus", module.exports);
+require('cordova/tizen/commandProxy').add('NetworkStatus', module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/src/windows/NetworkInfoProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/NetworkInfoProxy.js b/src/windows/NetworkInfoProxy.js
index 92153c7..e07ecc6 100644
--- a/src/windows/NetworkInfoProxy.js
+++ b/src/windows/NetworkInfoProxy.js
@@ -19,14 +19,14 @@
  *
 */
 
-/*global Windows:true */
+/* global Windows:true */
 
 var Connection = require('./Connection');
 
 var winNetConn = Windows.Networking.Connectivity;
 var networkInfo = winNetConn.NetworkInformation;
 
-function getCurrrentConnectionType() {
+function getCurrrentConnectionType () {
 
     var profile = networkInfo.getInternetConnectionProfile();
 
@@ -40,26 +40,26 @@ function getCurrrentConnectionType() {
     // since we use this to detect whether we are online or offline we do check agains InternetAccess
     // localAccess (airplane mode as an example) or constrainedInternetAccess mean there is no access to the internet available
     // https://msdn.microsoft.com/library/windows/apps/windows.networking.connectivity.networkconnectivitylevel.aspx
-    if (conLevel != Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess) {
+    if (conLevel !== Windows.Networking.Connectivity.NetworkConnectivityLevel.internetAccess) {
         return Connection.NONE;
     }
 
     var connectionType;
 
     switch (interfaceType) {
-        case 71:
-            connectionType = Connection.WIFI;
-            break;
-        case 6:
-            connectionType = Connection.ETHERNET;
-            break;
-        case 243: // (3GPP WWAN) // Fallthrough is intentional
-        case 244: // (3GPP2 WWAN)
-            connectionType = Connection.CELL_3G;
-            break;
-        default:
-            connectionType = Connection.UNKNOWN;
-            break;
+    case 71:
+        connectionType = Connection.WIFI;
+        break;
+    case 6:
+        connectionType = Connection.ETHERNET;
+        break;
+    case 243: // (3GPP WWAN) // Fallthrough is intentional
+    case 244: // (3GPP2 WWAN)
+        connectionType = Connection.CELL_3G;
+        break;
+    default:
+        connectionType = Connection.UNKNOWN;
+        break;
     }
 
     return connectionType;
@@ -67,8 +67,7 @@ function getCurrrentConnectionType() {
 
 module.exports = {
 
-    getConnectionInfo:function(win,fail,args)
-    {
+    getConnectionInfo: function (win, fail, args) {
         var reportConnectionInfoOnce = function () {
             win(getCurrrentConnectionType(), { keepCallback: true });
         };
@@ -76,8 +75,8 @@ module.exports = {
         // report current connection  type
         setTimeout(reportConnectionInfoOnce, 0);
         // start traking future changes
-        networkInfo.addEventListener("networkstatuschanged", reportConnectionInfoOnce);
+        networkInfo.addEventListener('networkstatuschanged', reportConnectionInfoOnce);
     }
 };
 
-require("cordova/exec/proxy").add("NetworkStatus",module.exports);
+require('cordova/exec/proxy').add('NetworkStatus', module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 07f4b27..c28e7eb 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -19,17 +19,17 @@
  *
 */
 
-/* jshint jasmine: true */
+/* eslint-env jasmine */
 /* global Connection */
 
 exports.defineAutoTests = function () {
     describe('Network (navigator.connection)', function () {
-        it("network.spec.1 should exist", function () {
+        it('network.spec.1 should exist', function () {
             expect(navigator.network && navigator.network.connection).toBeDefined();
             expect(navigator.connection).toBeDefined();
         });
 
-        it("network.spec.2 should be set to a valid value", function () {
+        it('network.spec.2 should be set to a valid value', function () {
             var validValues = {
                 'unknown': 1,
                 'ethernet': 1,
@@ -43,19 +43,19 @@ exports.defineAutoTests = function () {
             expect(validValues[navigator.connection.type]).toBe(1);
         });
 
-        it("network.spec.3 should have the same value in deprecated and non-deprecated apis", function () {
+        it('network.spec.3 should have the same value in deprecated and non-deprecated apis', function () {
             expect(navigator.network.connection.type).toBe(navigator.connection.type);
         });
 
-        it("network.spec.4 should define constants for connection status", function () {
-            expect(Connection.UNKNOWN).toBe("unknown");
-            expect(Connection.ETHERNET).toBe("ethernet");
-            expect(Connection.WIFI).toBe("wifi");
-            expect(Connection.CELL_2G).toBe("2g");
-            expect(Connection.CELL_3G).toBe("3g");
-            expect(Connection.CELL_4G).toBe("4g");
-            expect(Connection.NONE).toBe("none");
-            expect(Connection.CELL).toBe("cellular");
+        it('network.spec.4 should define constants for connection status', function () {
+            expect(Connection.UNKNOWN).toBe('unknown');
+            expect(Connection.ETHERNET).toBe('ethernet');
+            expect(Connection.WIFI).toBe('wifi');
+            expect(Connection.CELL_2G).toBe('2g');
+            expect(Connection.CELL_3G).toBe('3g');
+            expect(Connection.CELL_4G).toBe('4g');
+            expect(Connection.NONE).toBe('none');
+            expect(Connection.CELL).toBe('cellular');
         });
     });
 };
@@ -65,17 +65,17 @@ exports.defineAutoTests = function () {
 /******************************************************************************/
 
 exports.defineManualTests = function (contentEl, createActionButton) {
-    function eventOutput(s) {
-        var el = document.getElementById("results");
-        el.innerHTML = el.innerHTML + s + "<br>";
+    function eventOutput (s) {
+        var el = document.getElementById('results');
+        el.innerHTML = el.innerHTML + s + '<br>';
     }
 
-    function printNetwork() {
-        eventOutput("navigator.connection.type=" + navigator.connection.type);
-        eventOutput("navigator.network.connection.type=" + navigator.network.connection.type);
+    function printNetwork () {
+        eventOutput('navigator.connection.type=' + navigator.connection.type);
+        eventOutput('navigator.network.connection.type=' + navigator.network.connection.type);
     }
 
-    function onEvent(e) {
+    function onEvent (e) {
         eventOutput('Event of type: ' + e.type);
         printNetwork();
     }
@@ -90,8 +90,8 @@ exports.defineManualTests = function (contentEl, createActionButton) {
         '  The result will be unknown, ethernet, wifi, 2g, 3g, 4g, none, or cellular. Make sure it matches what the device is connected to.' +
         '</p> <div id="actions"></div>';
 
-    document.addEventListener("online", onEvent, false);
-    document.addEventListener("offline", onEvent, false);
+    document.addEventListener('online', onEvent, false);
+    document.addEventListener('offline', onEvent, false);
     contentEl.innerHTML = html;
 
     createActionButton('Show Network Connection', function () {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/www/Connection.js
----------------------------------------------------------------------
diff --git a/www/Connection.js b/www/Connection.js
index f20a485..fb1d0ad 100644
--- a/www/Connection.js
+++ b/www/Connection.js
@@ -23,12 +23,12 @@
  * Network status
  */
 module.exports = {
-        UNKNOWN: "unknown",
-        ETHERNET: "ethernet",
-        WIFI: "wifi",
-        CELL_2G: "2g",
-        CELL_3G: "3g",
-        CELL_4G: "4g",
-        CELL:"cellular",
-        NONE: "none"
+    UNKNOWN: 'unknown',
+    ETHERNET: 'ethernet',
+    WIFI: 'wifi',
+    CELL_2G: '2g',
+    CELL_3G: '3g',
+    CELL_4G: '4g',
+    CELL: 'cellular',
+    NONE: 'none'
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/78691e43/www/network.js
----------------------------------------------------------------------
diff --git a/www/network.js b/www/network.js
index ac792d8..87ff906 100644
--- a/www/network.js
+++ b/www/network.js
@@ -18,23 +18,23 @@
  *
 */
 
-var exec = require('cordova/exec'),
-    cordova = require('cordova'),
-    channel = require('cordova/channel'),
-    utils = require('cordova/utils');
+var exec = require('cordova/exec');
+var cordova = require('cordova');
+var channel = require('cordova/channel');
+var utils = require('cordova/utils');
 
 // Link the onLine property with the Cordova-supplied network info.
 // This works because we clobber the navigator object with our own
 // object in bootstrap.js.
 // Browser platform do not need to define this property, because
 // it is already supported by modern browsers
-if (cordova.platformId !== 'browser' && typeof navigator != 'undefined') {
-    utils.defineGetter(navigator, 'onLine', function() {
-        return this.connection.type != 'none';
+if (cordova.platformId !== 'browser' && typeof navigator !== 'undefined') {
+    utils.defineGetter(navigator, 'onLine', function () {
+        return this.connection.type !== 'none';
     });
 }
 
-function NetworkConnection() {
+function NetworkConnection () {
     this.type = 'unknown';
 }
 
@@ -44,8 +44,8 @@ function NetworkConnection() {
  * @param {Function} successCallback The function to call when the Connection data is available
  * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL)
  */
-NetworkConnection.prototype.getInfo = function(successCallback, errorCallback) {
-    exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []);
+NetworkConnection.prototype.getInfo = function (successCallback, errorCallback) {
+    exec(successCallback, errorCallback, 'NetworkStatus', 'getConnectionInfo', []);
 };
 
 var me = new NetworkConnection();
@@ -55,13 +55,13 @@ var timeout = 500;
 channel.createSticky('onCordovaConnectionReady');
 channel.waitForInitialization('onCordovaConnectionReady');
 
-channel.onCordovaReady.subscribe(function() {
-    me.getInfo(function(info) {
+channel.onCordovaReady.subscribe(function () {
+    me.getInfo(function (info) {
         me.type = info;
-        if (info === "none") {
+        if (info === 'none') {
             // set a timer if still offline at the end of timer send the offline event
-            timerId = setTimeout(function(){
-                cordova.fireDocumentEvent("offline");
+            timerId = setTimeout(function () {
+                cordova.fireDocumentEvent('offline');
                 timerId = null;
             }, timeout);
         } else {
@@ -70,7 +70,7 @@ channel.onCordovaReady.subscribe(function() {
                 clearTimeout(timerId);
                 timerId = null;
             }
-            cordova.fireDocumentEvent("online");
+            cordova.fireDocumentEvent('online');
         }
 
         // should only fire this once
@@ -84,7 +84,7 @@ channel.onCordovaReady.subscribe(function() {
         if (channel.onCordovaConnectionReady.state !== 2) {
             channel.onCordovaConnectionReady.fire();
         }
-        console.log("Error initializing Network Connection: " + e);
+        console.log('Error initializing Network Connection: ' + e);
     });
 });
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org