cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject git commit: 1. Added amazon-fireos platform. 2. Change to use amazon-fireos as a platform if user agent string contains 'cordova-amazon-fireos'.
Date Tue, 26 Nov 2013 23:58:34 GMT
Updated Branches:
  refs/heads/dev 10f543834 -> b622be522


1. Added amazon-fireos platform.
2. Change to use amazon-fireos as a platform if user agent string contains 'cordova-amazon-fireos'.


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

Branch: refs/heads/dev
Commit: b622be522e85661957a76174b74bfa0d8f6b85a3
Parents: 10f5438
Author: Archana Naik <naika@lab126.com>
Authored: Fri Oct 18 11:24:25 2013 -0700
Committer: Archana Naik <naika@lab126.com>
Committed: Wed Oct 30 12:57:53 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/b622be52/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index a775b57..33d9ae0 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -53,6 +53,22 @@
 	    <source-file src="src/android/CompassListener.java" target-dir="src/org/apache/cordova/deviceorientation"
/>
     </platform>
 
+    <!-- amazon-fireos -->
+    <platform name="amazon-fireos">
+        <config-file target="res/xml/config.xml" parent="/*">
+	        <feature name="Compass">
+	            <param name="android-package" value="org.apache.cordova.deviceorientation.CompassListener"/>
+	        </feature>
+	    </config-file>
+
+	    <config-file target="AndroidManifest.xml" parent="/*">
+	        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+        </config-file>
+
+	    <source-file src="src/android/CompassListener.java" target-dir="src/org/apache/cordova/deviceorientation"
/>
+    </platform>
+    
     <!-- blackberry10 -->
     <platform name="blackberry10">
         <config-file target="www/config.xml" parent="/widget">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/b622be52/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