You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/09/02 07:49:00 UTC
[1/3] cordova-plugin-vibration git commit: [CB-7966] Add
cordova-plugin-vibration support for browser platform
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 <su...@yahoo.com>
Authored: Mon Aug 31 12:00:51 2015 -0700
Committer: Suraj Pindoria <su...@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
[3/3] cordova-plugin-vibration git commit: Fixed browser platform to
pass tests and combined tests
Posted by pu...@apache.org.
Fixed browser platform to pass tests and combined tests
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/84a9ea29
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/tree/84a9ea29
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/diff/84a9ea29
Branch: refs/heads/master
Commit: 84a9ea29b7c49a5c2ab43cf8f062bd89a998e3c6
Parents: 6111d62
Author: Suraj Pindoria <su...@yahoo.com>
Authored: Tue Sep 1 14:03:32 2015 -0700
Committer: Suraj Pindoria <su...@yahoo.com>
Committed: Tue Sep 1 14:03:32 2015 -0700
----------------------------------------------------------------------
plugin.xml | 3 ++-
tests/tests.js | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/84a9ea29/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 51df391..73674a2 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -141,7 +141,8 @@
<!-- browser -->
<platform name="browser">
<js-module src="src/browser/Vibration.js" name="Vibration">
- <clobbers target="navigator" />
+ <merges target="navigator.notification" />
+ <merges target="navigator" />
</js-module>
</platform>
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/84a9ea29/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 3ab43d1..79aff30 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -22,13 +22,13 @@
exports.defineAutoTests = function () {
describe('Vibration (navigator.notification.vibrate)', function () {
- it("navigator.notification should exist", function () {
+ it("navigator.notification should exist with vibrate function", function () {
expect(navigator.notification).toBeDefined();
- });
-
- it("should contain a vibrate function", function () {
expect(typeof navigator.notification.vibrate).toBeDefined();
expect(typeof navigator.notification.vibrate).toBe("function");
+
+ if (cordova.platformId == "browser")
+ expect(navigator.notification.vibrate(0)).toBe(false);
});
});
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/3] cordova-plugin-vibration git commit: Removed call to add proxy
and renamed browser file
Posted by pu...@apache.org.
Removed call to add proxy and renamed browser file
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/6111d622
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/tree/6111d622
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/diff/6111d622
Branch: refs/heads/master
Commit: 6111d62262d280a8afdf6e47521123358295fe79
Parents: aa9835a
Author: Suraj Pindoria <su...@yahoo.com>
Authored: Tue Sep 1 11:51:20 2015 -0700
Committer: Suraj Pindoria <su...@yahoo.com>
Committed: Tue Sep 1 11:51:20 2015 -0700
----------------------------------------------------------------------
plugin.xml | 2 +-
src/browser/Vibration.js | 29 +++++++++++++++++++++++++++++
src/browser/VibrationProxy.js | 31 -------------------------------
3 files changed, 30 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/6111d622/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index c178327..51df391 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -140,7 +140,7 @@
<!-- browser -->
<platform name="browser">
- <js-module src="src/browser/VibrationProxy.js" name="VibrationProxy">
+ <js-module src="src/browser/Vibration.js" name="Vibration">
<clobbers target="navigator" />
</js-module>
</platform>
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/6111d622/src/browser/Vibration.js
----------------------------------------------------------------------
diff --git a/src/browser/Vibration.js b/src/browser/Vibration.js
new file mode 100644
index 0000000..04f1759
--- /dev/null
+++ b/src/browser/Vibration.js
@@ -0,0 +1,29 @@
+/*
+ *
+ * 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;
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration/blob/6111d622/src/browser/VibrationProxy.js
----------------------------------------------------------------------
diff --git a/src/browser/VibrationProxy.js b/src/browser/VibrationProxy.js
deleted file mode 100644
index 4d7825b..0000000
--- a/src/browser/VibrationProxy.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * 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);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org