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:06 UTC

[02/10] git commit: updated plugin to work with ffos

updated plugin to work with ffos


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/5200e054
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/tree/5200e054
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/diff/5200e054

Branch: refs/heads/master
Commit: 5200e0549b5b3264c9d0c5ffccad47d6f776e9c9
Parents: c5edd8a
Author: Steven Gill <st...@gmail.com>
Authored: Thu Sep 12 16:05:27 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Thu Sep 12 16:05:27 2013 -0700

----------------------------------------------------------------------
 src/firefoxos/vibration.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/5200e054/src/firefoxos/vibration.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/vibration.js b/src/firefoxos/vibration.js
index 7299848..4dcaa26 100644
--- a/src/firefoxos/vibration.js
+++ b/src/firefoxos/vibration.js
@@ -19,16 +19,17 @@
  *
 */
 
-module.exports = {
+var firefoxos = require('cordova/platform');
 
-    vibrate: function(milliseconds) {
-        console.log ("milliseconds" , milliseconds);
+var Vibration = {
 
-        if (navigator.vibrate) {
+    vibrate: function(success, fail, milliseconds) {
+        if (navigator.notification.vibrate) {
             navigator.vibrate(milliseconds);
         } else {
             console.log ("cordova/plugin/firefoxos/vibration, vibrate API does not exist");
         }
     }
+};
 
-};
\ No newline at end of file
+firefoxos.registerPlugin('Vibration', Vibration);
\ No newline at end of file