cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [4/8] git commit: CB-6411 [BlackBerry10] Updates to beep
Date Wed, 23 Apr 2014 18:56:54 GMT
CB-6411 [BlackBerry10] Updates to beep

- Update to embedded wav file to prevent long fade out
- Fix issues when quantity is not a number
- Fix issues when beep called while previous beep still playing


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/commit/47751e8b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/tree/47751e8b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/diff/47751e8b

Branch: refs/heads/master
Commit: 47751e8b04230a21f53a4f494c232c270342fcd5
Parents: 9c7d444
Author: Bryan Higgins <bhiggins@blackberry.com>
Authored: Mon Apr 7 13:20:02 2014 -0400
Committer: Bryan Higgins <bhiggins@blackberry.com>
Committed: Mon Apr 7 13:23:35 2014 -0400

----------------------------------------------------------------------
 plugin.xml                             |   1 +
 www/blackberry10/beep.js               |  29 +++++++++++++---------------
 www/blackberry10/notification-beep.wav | Bin 0 -> 16630 bytes
 3 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/47751e8b/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index dd1831f..4a25f02 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -98,6 +98,7 @@
         <js-module src="www/blackberry10/beep.js" name="beep">
             <clobbers target="window.navigator.notification.beep" />
         </js-module>
+        <source-file src="www/blackberry10/notification-beep.wav" />
     </platform>
 
     <!-- wp7 -->

http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/47751e8b/www/blackberry10/beep.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/beep.js b/www/blackberry10/beep.js
index 6d4a77a..1b1dedc 100644
--- a/www/blackberry10/beep.js
+++ b/www/blackberry10/beep.js
@@ -18,25 +18,22 @@
  * under the License.
  *
 */
-var beep,
-    count = 0,
-    beepObj = new Audio('file:///usr/share/sounds/notification_text_message_im_received.wav');
 
-beep = function (quantity) {
-    var callback = function () {
-        if (--count > 0) {
-            beepObj.play();
-        } else {
-            beepObj.removeEventListener("ended", callback);
-            delete beepObj;
-        }
-    };
+module.exports = function (quantity) {
+    var count = 0,
+        beepObj = new Audio('local:///chrome/plugin/org.apache.cordova.dialogs/notification-beep.wav'),
+        callback = function () {
+            if (--count > 0) {
+                beepObj.play();
+            } else {
+                beepObj.removeEventListener("ended", callback);
+                delete beepObj;
+            }
+        };
 
-    count += quantity;
-    if (count === quantity) {
+    count += quantity || 1;
+    if (count > 0) {
         beepObj.addEventListener("ended", callback);
         beepObj.play();
     }
 };
-
-module.exports = beep;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/47751e8b/www/blackberry10/notification-beep.wav
----------------------------------------------------------------------
diff --git a/www/blackberry10/notification-beep.wav b/www/blackberry10/notification-beep.wav
new file mode 100644
index 0000000..d0ad085
Binary files /dev/null and b/www/blackberry10/notification-beep.wav differ


Mime
View raw message