mirror of
https://gitee.com/shuto-github/cordova-plugin-network-information.git
synced 2026-05-10 00:00:02 +08:00
CB-10636 Add JSHint for plugins
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* 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) {
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*global module, require*/
|
||||
|
||||
var cordova = require('cordova'),
|
||||
proxy = require("cordova/exec/proxy"),
|
||||
Connection = require('./Connection');
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
and http://w3c.github.io/netinfo/
|
||||
*/
|
||||
|
||||
var cordova = require('cordova'),
|
||||
Connection = require('./Connection'),
|
||||
var Connection = require('./Connection'),
|
||||
modulemapper = require('cordova/modulemapper');
|
||||
|
||||
var origConnection = modulemapper.getOriginalSymbol(window, 'navigator.connection');
|
||||
@@ -47,7 +46,7 @@ module.exports = {
|
||||
metered = connection.metered,
|
||||
type = connection.type;
|
||||
|
||||
if (type != undefined) {
|
||||
if (type !== undefined) {
|
||||
// For more information see:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API
|
||||
|
||||
@@ -65,7 +64,7 @@ module.exports = {
|
||||
connectionType = Connection.NONE;
|
||||
break;
|
||||
}
|
||||
} else if (bandwidth != undefined && metered != undefined) {
|
||||
} else if (bandwidth !== undefined && metered !== undefined) {
|
||||
/*
|
||||
bandwidth of type double, readonly
|
||||
The user agent must set the value of the bandwidth attribute to:
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
var cordova = require('cordova');
|
||||
/* global tizen */
|
||||
|
||||
var Connection = require('./Connection');
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -21,15 +21,10 @@
|
||||
|
||||
/*global Windows:true */
|
||||
|
||||
var cordova = require('cordova');
|
||||
var Connection = require('./Connection');
|
||||
|
||||
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;
|
||||
|
||||
function getCurrrentConnectionType() {
|
||||
|
||||
@@ -76,7 +71,7 @@ module.exports = {
|
||||
{
|
||||
var reportConnectionInfoOnce = function () {
|
||||
win(getCurrrentConnectionType(), { keepCallback: true });
|
||||
}
|
||||
};
|
||||
|
||||
// report current connection type
|
||||
setTimeout(reportConnectionInfoOnce, 0);
|
||||
|
||||
Reference in New Issue
Block a user