cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [2/5] git commit: 1. Added amazon-fireos platform. 2. Change to use amazon-fireos as the platform if the user agent string contains 'cordova-amazon-fireos'
Date Thu, 05 Dec 2013 00:57:01 GMT
1. Added amazon-fireos platform.
2. Change to use amazon-fireos as the platform if the user agent string contains 'cordova-amazon-fireos'


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

Branch: refs/heads/master
Commit: e1e2c307d988cb214a04033e64b153ca886ecc6f
Parents: e94c414
Author: Archana Naik <naika@lab126.com>
Authored: Fri Oct 18 11:15:49 2013 -0700
Committer: Archana Naik <naika@lab126.com>
Committed: Wed Oct 30 12:48:36 2013 -0700

----------------------------------------------------------------------
 plugin.xml           | 13 +++++++++++++
 test/cordova-incl.js |  6 ++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/e1e2c307/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 951bbed..0171234 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -45,6 +45,19 @@
     
     </platform>
     
+    <!-- amazon-fireos -->
+    <platform name="amazon-fireos">
+	    
+        <config-file target="res/xml/config.xml" parent="/*">
+            <feature name="Accelerometer">
+                <param name="android-package" value="org.apache.cordova.devicemotion.AccelListener"/>
+            </feature>
+        </config-file>
+
+        <source-file src="src/android/AccelListener.java" target-dir="src/org/apache/cordova/devicemotion"
/>
+    
+    </platform>
+    
     <!-- ios -->
     <platform name="ios">
         

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/e1e2c307/test/cordova-incl.js
----------------------------------------------------------------------
diff --git a/test/cordova-incl.js b/test/cordova-incl.js
index dbcd1a6..bc1dd7a 100644
--- a/test/cordova-incl.js
+++ b/test/cordova-incl.js
@@ -20,7 +20,9 @@
 */
 
 var PLAT;
-if (/Android/.exec(navigator.userAgent)) {
+if (/cordova-amazon-fireos/.exec(navigator.userAgent)) {
+    PLAT = 'amazon-fireos';
+}else if (/Android/.exec(navigator.userAgent)) {
     PLAT = 'android';
 } else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {
     PLAT = 'ios';
@@ -61,7 +63,7 @@ if (!window._doNotWriteCordovaScript) {
 }
 
 function backHome() {
-	if (window.device && device.platform && device.platform.toLowerCase() ==
'android') {
+	if (window.device && device.platform && (device.platform.toLowerCase() ==
'android' || device.platform.toLowerCase() == 'amazon-fireos')) {
             navigator.app.backHistory();
 	}
 	else {


Mime
View raw message