[
https://issues.apache.org/jira/browse/CB-6065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14599476#comment-14599476
]
ASF GitHub Bot commented on CB-6065:
------------------------------------
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Date: 2015-06-22T11:05:24Z
CB-7586 chargingTimeChange event
commit 71675c608ebe64c5698eda69a00a9239e351e85b
Author: pcontat <[email protected]>
Date: 2015-06-22T12:53:01Z
CB-7588 and CB-7590 : dischargingTimeChange, levelchange event
commit 4df41149252f5be4763d978cc2f4eaa0a5be7a24
Author: pcontat <[email protected]>
Date: 2015-06-23T13:04:16Z
BatteryManager implement EventTarget using cordova chanels
commit 2354a7ee65265ee552b5fd0084c0a1745bce9dae
Author: pcontat <[email protected]>
Date: 2015-06-23T13:44:37Z
Add test for new implementation
commit 3cc6bb3f81ccef18f257027258cd17017dc0a300
Author: pcontat <[email protected]>
Date: 2015-06-24T13:34:05Z
CB-7589 : level between 0 and 1.0 and add manual test
----
> alignment with W3C Battery API
> ------------------------------
>
> Key: CB-6065
> URL: https://issues.apache.org/jira/browse/CB-6065
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Plugin Battery Status
> Reporter: Dominique Hazael-Massieux
>
> As indicated in
> https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md
> , the current battery plugin implements an old version of the W3C Battery
> API.
> The latest version http://www.w3.org/TR/battery-status/ is at Candidate
> Recommendation status, so it is now deemed to be stable, so it would be great
> if the battery plugin could be aligned with it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]