cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [33/44] js commit: [CB-3509] Removed network plugin code from cordova.js 3.0 branch. Removed creation of CordovaConnectionReady channel, and its hook into waitForInitialization.
Date Fri, 28 Jun 2013 14:27:37 GMT
[CB-3509] Removed network plugin code from cordova.js 3.0 branch. Removed creation of CordovaConnectionReady
channel, and its hook into waitForInitialization.


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

Branch: refs/heads/master
Commit: 208b97a9d3be4fe900d34c6816d21e09b1d8ebc9
Parents: f0108ae
Author: Fil Maj <maj.fil@gmail.com>
Authored: Mon Jun 17 12:03:31 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Jun 17 12:03:31 2013 -0700

----------------------------------------------------------------------
 lib/common/channel.js                      |  4 --
 lib/common/plugin/Connection.js            | 34 ----------
 lib/common/plugin/network.js               | 87 -------------------------
 lib/common/plugin/networkstatus/symbols.js | 26 --------
 4 files changed, 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/208b97a9/lib/common/channel.js
----------------------------------------------------------------------
diff --git a/lib/common/channel.js b/lib/common/channel.js
index 23d1d66..0fe56c1 100644
--- a/lib/common/channel.js
+++ b/lib/common/channel.js
@@ -239,9 +239,6 @@ channel.createSticky('onCordovaReady');
 // Event to indicate that device properties are available
 channel.createSticky('onCordovaInfoReady');
 
-// Event to indicate that the connection property has been set.
-channel.createSticky('onCordovaConnectionReady');
-
 // Event to indicate that all automatically loaded JS plugins are loaded and ready.
 channel.createSticky('onPluginsReady');
 
@@ -259,7 +256,6 @@ channel.createSticky('onDestroy');
 
 // Channels that must fire before "deviceready" is fired.
 channel.waitForInitialization('onCordovaReady');
-channel.waitForInitialization('onCordovaConnectionReady');
 channel.waitForInitialization('onDOMContentLoaded');
 
 module.exports = channel;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/208b97a9/lib/common/plugin/Connection.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Connection.js b/lib/common/plugin/Connection.js
deleted file mode 100644
index f20a485..0000000
--- a/lib/common/plugin/Connection.js
+++ /dev/null
@@ -1,34 +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.
- *
-*/
-
-/**
- * Network status
- */
-module.exports = {
-        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-js/blob/208b97a9/lib/common/plugin/network.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/network.js b/lib/common/plugin/network.js
deleted file mode 100644
index 63736a9..0000000
--- a/lib/common/plugin/network.js
+++ /dev/null
@@ -1,87 +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.
- *
-*/
-
-var exec = require('cordova/exec'),
-    cordova = require('cordova'),
-    channel = require('cordova/channel'),
-    utils = require('cordova/utils');
-
-// Link the onLine property with the Cordova-supplied network info.
-// This works because we clobber the naviagtor object with our own
-// object in bootstrap.js.
-if (typeof navigator != 'undefined') {
-    utils.defineGetter(navigator, 'onLine', function() {
-        return this.connection.type != 'none';
-    });
-}
-
-function NetworkConnection() {
-    this.type = 'unknown';
-}
-
-/**
- * Get connection info
- *
- * @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", []);
-};
-
-var me = new NetworkConnection();
-var timerId = null;
-var timeout = 500;
-
-channel.onCordovaReady.subscribe(function() {
-    me.getInfo(function(info) {
-        me.type = info;
-        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 = null;
-            }, timeout);
-        } else {
-            // If there is a current offline event pending clear it
-            if (timerId !== null) {
-                clearTimeout(timerId);
-                timerId = null;
-            }
-            cordova.fireDocumentEvent("online");
-        }
-
-        // should only fire this once
-        if (channel.onCordovaConnectionReady.state !== 2) {
-            channel.onCordovaConnectionReady.fire();
-        }
-    },
-    function (e) {
-        // If we can't get the network info we should still tell Cordova
-        // to fire the deviceready event.
-        if (channel.onCordovaConnectionReady.state !== 2) {
-            channel.onCordovaConnectionReady.fire();
-        }
-        console.log("Error initializing Network Connection: " + e);
-    });
-});
-
-module.exports = me;

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/208b97a9/lib/common/plugin/networkstatus/symbols.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/networkstatus/symbols.js b/lib/common/plugin/networkstatus/symbols.js
deleted file mode 100644
index 8ca64c1..0000000
--- a/lib/common/plugin/networkstatus/symbols.js
+++ /dev/null
@@ -1,26 +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.
- *
-*/
-
-
-var modulemapper = require('cordova/modulemapper');
-
-modulemapper.clobbers('cordova/plugin/network', 'navigator.network.connection', 'navigator.network.connection
is deprecated. Use navigator.connection instead.');
-modulemapper.clobbers('cordova/plugin/network', 'navigator.connection');
-modulemapper.defaults('cordova/plugin/Connection', 'Connection');


Mime
View raw message