cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject spec commit: CB-7115 Add manual test for events volumedownbutton / volumeupbutton
Date Tue, 12 Aug 2014 20:30:20 GMT
Repository: cordova-mobile-spec
Updated Branches:
  refs/heads/master 92bca18dd -> 2ecc3eb1e


CB-7115 Add manual test for events volumedownbutton / volumeupbutton

github: close #80


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/2ecc3eb1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/2ecc3eb1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/2ecc3eb1

Branch: refs/heads/master
Commit: 2ecc3eb1e7b7026938a8bd722d5f833a602c3dbf
Parents: 92bca18
Author: schettino72 <schettino72@gmail.com>
Authored: Thu Jul 10 15:56:54 2014 +0800
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Aug 12 16:29:49 2014 -0400

----------------------------------------------------------------------
 www/events/index.html |  4 ++++
 www/events/index.js   | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/2ecc3eb1/www/events/index.html
----------------------------------------------------------------------
diff --git a/www/events/index.html b/www/events/index.html
index 3f45021..b1d4170 100644
--- a/www/events/index.html
+++ b/www/events/index.html
@@ -54,6 +54,10 @@
     <div class="btn large stopInterceptOfOnline">Stop intercept of online</div>
     <div class="btn large interceptOffline">Intercept offline</div>
     <div class="btn large stopInterceptOfOffline">Stop intercept of offline</div>
+    <div class="btn large interceptVolumeDownButton">Intercept volumedownbutton</div>
+    <div class="btn large stopInterceptOfVolumeDownButton">Stop intercept of volumedownbutton</div>
+    <div class="btn large interceptVolumeUpButton">Intercept volumeupbutton</div>
+    <div class="btn large stopInterceptOfVolumeUpButton">Stop intercept of volumeupbutton</div>
 
     <h2> </h2><div class="backBtn">Back</div>
   </body>

http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/2ecc3eb1/www/events/index.js
----------------------------------------------------------------------
diff --git a/www/events/index.js b/www/events/index.js
index e1bb922..5c4de83 100644
--- a/www/events/index.js
+++ b/www/events/index.js
@@ -21,6 +21,12 @@ function interceptOnline() {
 function interceptOffline() {
   eventOutput("Offline event intercepted");
 }
+function interceptVolumeDownButton() {
+  eventOutput("Volumedown button event intercepted");
+}
+function interceptVolumeUpButton() {
+  eventOutput("Volumeup button event intercepted");
+}
 
 var eventOutput = function(s) {
     var el = document.getElementById("results");
@@ -88,6 +94,18 @@ window.onload = function() {
   addListenerToClass('stopInterceptOfOffline', function() {
     document.removeEventListener('offline', interceptOffline, false);
   });
+  addListenerToClass('interceptVolumeDownButton', function() {
+    document.addEventListener('volumedownbutton', interceptVolumeDownButton, false);
+  });
+  addListenerToClass('stopInterceptOfVolumeDownButton', function() {
+    document.removeEventListener('volumedownbutton', interceptVolumeDownButton, false);
+  });
+  addListenerToClass('interceptVolumeUpButton', function() {
+    document.addEventListener('volumeupbutton', interceptVolumeUpButton, false);
+  });
+  addListenerToClass('stopInterceptOfVolumeUpButton', function() {
+    document.removeEventListener('volumeupbutton', interceptVolumeUpButton, false);
+  });
 
   addListenerToClass('backBtn', backHome);
   init();


Mime
View raw message