You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/09/27 00:25:20 UTC

[04/12] git commit: updated to use commandProxy for ffos

updated to use commandProxy for ffos


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

Branch: refs/heads/master
Commit: c631a12590f68b7c59f17ae29fb7aee7df89b5ab
Parents: 30ba3ce
Author: Steven Gill <st...@gmail.com>
Authored: Fri Sep 13 17:39:22 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Fri Sep 13 17:39:22 2013 -0700

----------------------------------------------------------------------
 plugin.xml                   |  4 ++--
 src/firefoxos/DeviceProxy.js | 39 +++++++++++++++++++++++++++++++++++++++
 src/firefoxos/device.js      | 16 ----------------
 3 files changed, 41 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c631a125/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 4d6be1c..d9673e4 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -22,8 +22,8 @@
             </feature>
         </config-file>                                         
         
-        <js-module src="src/firefoxos/device.js" name="device-impl">
-          <runs />
+        <js-module src="src/firefoxos/DeviceProxy.js" name="DeviceProxy">
+            <runs />
         </js-module>
     </platform>
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c631a125/src/firefoxos/DeviceProxy.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/DeviceProxy.js b/src/firefoxos/DeviceProxy.js
new file mode 100644
index 0000000..f37e761
--- /dev/null
+++ b/src/firefoxos/DeviceProxy.js
@@ -0,0 +1,39 @@
+/*
+ *
+ * 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 firefoxos = require('cordova/platform');
+var cordova = require('cordova');
+
+module.exports = {
+    getDeviceInfo: function(success, error) {
+        setTimeout(function () {
+            success({
+                cordova: firefoxos.cordovaVersion,
+                platform: 'firefoxos',
+                model: null,
+                version: null,
+                uuid: null
+            });
+        }, 0);
+    }
+};
+
+require("cordova/firefoxos/commandProxy").add("Device", module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c631a125/src/firefoxos/device.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/device.js b/src/firefoxos/device.js
deleted file mode 100644
index 55d1c75..0000000
--- a/src/firefoxos/device.js
+++ /dev/null
@@ -1,16 +0,0 @@
-
-var firefoxos = require('cordova/platform');
-
-var Device = {
-    getDeviceInfo: function(success, error) {
-        success({
-            cordova: firefoxos.cordovaVersion,
-            platform: 'firefoxos',
-            model: null,
-            version: null,
-            uuid: null
-        });
-    }
-};
-
-firefoxos.registerPlugin('Device', Device);