GitHub user Uldax opened a pull request: https://github.com/apache/cordova-plugin-battery-status/pull/24
Alignment with W3C Battery API Addition of the methode navigator.getBattery which return a BatteryManager object using promises to align with the [W3C API](http://www.w3.org/TR/battery-status/) Here is the associate [Jira issue](https://issues.apache.org/jira/browse/CB-6065). Some notes on the proposed changes: * The previous navigator.battery and the new navigator.getBattery can't run together on android ( only one callbackContext allowed with the current version) * chargingtime and dischargingtime value aren't available for now (since that data is not provided by default at least on Android and FirefoxOS) Also, I was not clear whether there is a coding guideline (formatting, etc) ? I tried to keep it close to the original You can merge this pull request into a Git repository by running: $ git pull https://github.com/Uldax/cordova-plugin-battery-status CB-6065cordova-plugin-battery-status Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-battery-status/pull/24.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #24 ---- commit a020f8fb4d55028bf4a44a3638a82d406703ecb6 Author: pcontat <contat.p...@gmail.com> Date: 2015-06-22T09:08:17Z CB-6065 Initialisation - CB-7583 : readonly property called charging - CB-7589 : readonly property called level - CB-7585 : readonly property called chargingTime - CB-7587 : readonly property called dischargingTime - CB-7581 : The W3C battery status specification uses promises. commit 29803994a8672d18330430dd1a9de5d0babc0d41 Author: pcontat <contat.p...@gmail.com> Date: 2015-06-22T09:47:40Z CB-7581 and CB-7584 : eventHandler and access to batteryManager - CB-7581 : Battery information should be accessible from navigator.getBattery() - CB-7584 : event handler: onchargingchange commit 70b086f3d21638e421576c13114662bf4512daaf Author: pcontat <contat.p...@gmail.com> Date: 2015-06-22T11:05:24Z CB-7586 chargingTimeChange event commit 71675c608ebe64c5698eda69a00a9239e351e85b Author: pcontat <contat.p...@gmail.com> Date: 2015-06-22T12:53:01Z CB-7588 and CB-7590 : dischargingTimeChange, levelchange event commit 4df41149252f5be4763d978cc2f4eaa0a5be7a24 Author: pcontat <contat.p...@gmail.com> Date: 2015-06-23T13:04:16Z BatteryManager implement EventTarget using cordova chanels commit 2354a7ee65265ee552b5fd0084c0a1745bce9dae Author: pcontat <contat.p...@gmail.com> Date: 2015-06-23T13:44:37Z Add test for new implementation commit 3cc6bb3f81ccef18f257027258cd17017dc0a300 Author: pcontat <contat.p...@gmail.com> Date: 2015-06-24T13:34:05Z CB-7589 : level between 0 and 1.0 and add manual test ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org