[CB-7966] Add cordova-plugin-vibration support for browser platform
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",
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">
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);
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 @@
//cancel vibration (param = 0 or [])
else
exec(null, null, "Vibration", "cancelVibration", []);
+
+ return true;
},
/**