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/12/05 02:00:29 UTC

[3/7] git commit: Added amazon-fireos platform. Change to include amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'

Added amazon-fireos platform.
Change to include amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'


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

Branch: refs/heads/master
Commit: d42d68b8a5200554b9faf18d09ee7efe75befcd1
Parents: 683651a
Author: Archana Naik <na...@lab126.com>
Authored: Fri Oct 18 15:35:24 2013 -0700
Committer: Archana Naik <na...@lab126.com>
Committed: Wed Oct 30 15:56:24 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/d42d68b8/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 6f83e23..02e9c6f 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -65,6 +65,21 @@
         </config-file>
     </platform>
 
+    <!-- amazon-fireos -->
+    <platform name="amazon-fireos">
+        <config-file target="res/xml/config.xml" parent="/*">
+            <feature name="Vibration">
+                <param name="android-package" value="org.apache.cordova.vibration.Vibration"/>
+            </feature>
+        </config-file>
+
+        <source-file src="src/android/Vibration.java" target-dir="src/org/apache/cordova/vibration" />
+
+        <config-file target="AndroidManifest.xml" parent="/manifest">
+            <uses-permission android:name="android.permission.VIBRATE"/>
+        </config-file>
+    </platform>
+    
     <!-- ios -->
     <platform name="ios">
         <config-file target="config.xml" parent="/*">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/d42d68b8/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 {