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 2013/07/31 01:09:35 UTC

git commit: added firefoxos network apis

Updated Branches:
  refs/heads/master f761170ac -> 96b0c5d2f


added firefoxos network apis


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/96b0c5d2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/96b0c5d2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/96b0c5d2

Branch: refs/heads/master
Commit: 96b0c5d2f61f977916441447f7ed787fa670771f
Parents: f761170
Author: Herm Wong <he...@gmail.com>
Authored: Tue Jul 30 16:09:21 2013 -0700
Committer: Herm Wong <he...@gmail.com>
Committed: Tue Jul 30 16:09:21 2013 -0700

----------------------------------------------------------------------
 plugin.xml               |  9 +++++++++
 src/firefoxos/network.js | 29 +++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/96b0c5d2/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 37ce3dc..a4acfa7 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -17,6 +17,15 @@
     <js-module src="www/Connection.js" name="Connection">
         <clobbers target="Connection" />
     </js-module>
+                
+    <!-- firefoxos --> 
+    <platform name="firefoxos">
+        <config-file target="config.xml" parent="/*">
+            <param name="firefox-package" value="Network" />
+        </config-file>                                      
+        
+        <source-file src="src/firefoxos/network.js" target dir="src/firefoxos" />
+    </platform>
             
     <!-- android -->
     <platform name="android">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/96b0c5d2/src/firefoxos/network.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/network.js b/src/firefoxos/network.js
new file mode 100644
index 0000000..e4298a0
--- /dev/null
+++ b/src/firefoxos/network.js
@@ -0,0 +1,29 @@
+/*
+ *
+ * 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 cordova = require('cordova');
+
+module.exports = {
+    getConnectionInfo: function (win, fail, args) {   
+        var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
+        win(connection.bandwidth);
+    }
+};
\ No newline at end of file