cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/3] cordova-plugin-vibration git commit: [CB-7966] Add cordova-plugin-vibration support for browser platform
Date Wed, 02 Sep 2015 05:49:00 GMT
Repository: cordova-plugin-vibration
Updated Branches:
  refs/heads/master cc8d8031a -> 84a9ea29b


[CB-7966] Add cordova-plugin-vibration support for browser platform


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

Branch: refs/heads/master
Commit: aa9835a71bc12e62d4520ac575de74a4e2790c84
Parents: cc8d803
Author: Suraj Pindoria <suraj.pindoria@yahoo.com>
Authored: Mon Aug 31 12:00:51 2015 -0700
Committer: Suraj Pindoria <suraj.pindoria@yahoo.com>
Committed: Mon Aug 31 16:34:57 2015 -0700

----------------------------------------------------------------------
 package.json                  |  2 +-
 plugin.xml                    |  9 ++++++++-
 src/browser/VibrationProxy.js | 31 +++++++++++++++++++++++++++++++
 www/vibration.js              |  2 ++
 4 files changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/aa9835a7/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 6d5ee7f..06d0bcc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-plugin-vibration",
-  "version": "1.2.1-dev",
+  "version": "2.0.0-dev",
   "description": "Cordova Vibration Plugin",
   "cordova": {
     "id": "cordova-plugin-vibration",

http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/aa9835a7/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 67f75f5..c178327 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -21,7 +21,7 @@
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
     xmlns:android="http://schemas.android.com/apk/res/android"
     id="cordova-plugin-vibration"
-    version="1.2.1-dev">
+    version="2.0.0-dev">
 
     <name>Vibration</name>
     <description>Cordova Vibration Plugin</description>
@@ -138,6 +138,13 @@
         </config-file>
     </platform>
 
+    <!-- browser -->
+    <platform name="browser">
+        <js-module src="src/browser/VibrationProxy.js" name="VibrationProxy">
+            <clobbers target="navigator" />
+        </js-module>
+    </platform>
+
     <!-- tizen -->
     <platform name="tizen">
         <js-module src="src/tizen/VibrationProxy.js" name="VibrationProxy">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/aa9835a7/src/browser/VibrationProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/VibrationProxy.js b/src/browser/VibrationProxy.js
new file mode 100644
index 0000000..4d7825b
--- /dev/null
+++ b/src/browser/VibrationProxy.js
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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 cordova = require('cordova');
+
+module.exports = {
+    vibrate: function(success, fail, milliseconds) {
+        console.log('Vibration is not supported');
+        return false;
+    }
+};
+
+require('cordova/exec/proxy').add('Vibration', module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/aa9835a7/www/vibration.js
----------------------------------------------------------------------
diff --git a/www/vibration.js b/www/vibration.js
index 3f8bd3e..16a7398 100644
--- a/www/vibration.js
+++ b/www/vibration.js
@@ -80,6 +80,8 @@ module.exports = {
         //cancel vibration (param = 0 or [])
         else
             exec(null, null, "Vibration", "cancelVibration", []);
+
+        return true;
     },
 
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message