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:28:07 UTC
[03/10] git commit: [CB-4593] [Blackberry10] Added vibration support
for bb10
[CB-4593] [Blackberry10] Added vibration support for bb10
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/4728fdea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/tree/4728fdea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/diff/4728fdea
Branch: refs/heads/master
Commit: 4728fdeaa7e6b31db805018f2778886fdac0453e
Parents: 5200e05
Author: Kristoffer Flores <kf...@blackberry.com>
Authored: Wed Aug 21 17:59:52 2013 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Fri Sep 13 08:33:29 2013 -0400
----------------------------------------------------------------------
plugin.xml | 16 ++++++++++++----
www/blackberry10/vibrate.js | 26 ++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/4728fdea/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 2ca978c..bb66626 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -12,7 +12,7 @@
<js-module src="www/vibration.js" name="notification">
<merges target="navigator.notification" />
</js-module>
-
+
<!-- firefoxos -->
<platform name="firefoxos">
<config-file target="config.xml" parent="/*">
@@ -20,9 +20,7 @@
<param name="firefoxos-package" value="Vibration" />
</feature>
</config-file>
-
<source-file src="src/firefoxos/vibration.js" target-dir="Vibration" />
-
</platform>
<!-- wp7 -->
@@ -71,8 +69,18 @@
</config-file>
<header-file src="src/ios/CDVVibration.h" />
<source-file src="src/ios/CDVVibration.m" />
-
+
<framework src="AudioToolbox.framework" weak="true" />
</platform>
+ <!-- blackberry10 -->
+ <platform name="blackberry10">
+ <config-file target="www/config.xml" parent="/widget">
+ <feature name="Vibration" value="Vibration" />
+ </config-file>
+
+ <js-module src="www/blackberry10/vibrate.js" name="vibrate">
+ <clobbers target="window.navigator.notification.vibrate" />
+ </js-module>
+ </platform>
</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/4728fdea/www/blackberry10/vibrate.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/vibrate.js b/www/blackberry10/vibrate.js
new file mode 100644
index 0000000..ff7a1ec
--- /dev/null
+++ b/www/blackberry10/vibrate.js
@@ -0,0 +1,26 @@
+/*
+ *
+ * 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 vibrate = function(duration) {
+ navigator.vibrate(duration);
+};
+
+module.exports = vibrate;