cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtan...@apache.org
Subject js commit: Switched BB10 Battery support over to navigator.webkitBattery
Date Mon, 05 Nov 2012 17:52:49 GMT
Updated Branches:
  refs/heads/master 08f7fe4ae -> 3ae88d121


Switched BB10 Battery support over to navigator.webkitBattery

also cleaned up some lint errors


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/3ae88d12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/3ae88d12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/3ae88d12

Branch: refs/heads/master
Commit: 3ae88d12133e4de8ec15fec6c6cc83d2ab8719d8
Parents: 08f7fe4
Author: Gord Tanner <gtanner@gmail.com>
Authored: Mon Nov 5 12:52:12 2012 -0500
Committer: Gord Tanner <gtanner@gmail.com>
Committed: Mon Nov 5 12:52:12 2012 -0500

----------------------------------------------------------------------
 lib/blackberry/plugin/java/app.js    |    2 +-
 lib/blackberry/plugin/qnx/battery.js |   13 ++++++++-----
 lib/blackberry/plugin/qnx/capture.js |    2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3ae88d12/lib/blackberry/plugin/java/app.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/java/app.js b/lib/blackberry/plugin/java/app.js
index ff61ba5..bbfd360 100644
--- a/lib/blackberry/plugin/java/app.js
+++ b/lib/blackberry/plugin/java/app.js
@@ -19,7 +19,7 @@
  *
 */
 
-var exec = require('cordova/exec');
+var exec = require('cordova/exec'),
     platform = require('cordova/platform'),
     manager = require('cordova/plugin/' + platform.runtime() + '/manager');
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3ae88d12/lib/blackberry/plugin/qnx/battery.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/qnx/battery.js b/lib/blackberry/plugin/qnx/battery.js
index 1971a49..81a35fc 100644
--- a/lib/blackberry/plugin/qnx/battery.js
+++ b/lib/blackberry/plugin/qnx/battery.js
@@ -20,17 +20,20 @@
 */
 
 var cordova = require('cordova'),
-    handler;
+    interval;
 
 module.exports = {
     start: function (args, win, fail) {
-        handler = win;
-        blackberry.event.addEventListener("batterystatus", handler);
+        interval = window.setInterval(function () {
+            win({
+                level: navigator.webkitBattery.level * 100,
+                isPlugged: navigator.webkitBattery.charging
+            });
+        }, 500);
         return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "WebWorks Is On
It" };
     },
 
     stop: function (args, win, fail) {
-        blackberry.event.removeEventListener("batterystatus", handler);
-        return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "WebWorks Is On
It" };
+        window.stopInterval(interval);
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/3ae88d12/lib/blackberry/plugin/qnx/capture.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/qnx/capture.js b/lib/blackberry/plugin/qnx/capture.js
index 41c5de0..3c8f1cb 100644
--- a/lib/blackberry/plugin/qnx/capture.js
+++ b/lib/blackberry/plugin/qnx/capture.js
@@ -27,7 +27,7 @@ function capture(action, win, fail) {
     blackberry.invoke.card.invokeCamera(action, function (path) {
         var sb = blackberry.io.sandbox;
         blackberry.io.sandbox = false;
-        webkitRequestFileSystem(PERSISTENT, 1024, function (fs) {
+        window.webkitRequestFileSystem(window.PERSISTENT, 1024, function (fs) {
             fs.root.getFile(path, {}, function (fe) {
                 fe.file(function (file) {
                     file.fullPath = fe.fullPath;


Mime
View raw message