cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lisa Seacat DeLuca (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-7589) Cordova W3C Battery Alignment - level property
Date Thu, 18 Sep 2014 16:49:33 GMT

     [ https://issues.apache.org/jira/browse/CB-7589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lisa Seacat DeLuca updated CB-7589:
-----------------------------------
    Description: 
JIRA parent issue: https://issues.apache.org/jira/browse/CB-6065 
Cordova documentation: https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md

w3c spec: http://www.w3.org/TR/battery-status 

Gap analysis document can be found here: https://docs.google.com/document/d/1mAcjwf39IcIqpIuS-7SzlDxTgk4OebCHae6yfOwnStE/edit?usp=sharing

The BatteryManager object should have a readonly property called level.  The level attribute
must be set to 0 if the system's battery is depleted and the system is about to be suspended,
and to 1.0 if the battery is full, the implementation is unable to report the battery's level,
or there is no battery attached to the system. 
Mulitple Batteries. level attribute.  The level attribute can be set to the average of the
levels of batteries of same capacity, or the weighted average of the battery level attributes
for batteries of different capacities.
Example:
// We get the initial value when the promise resolves ...
navigator.getBattery().then(function(battery) {
  console.log(battery.level);
  // ... and any subsequent updates.
  battery.onlevelchange = function() {
    console.log(this.level);
  };
});
Example 2 (Alternative):
navigator.getBattery().then(function(battery) {
  console.log(battery.level);
  battery.addEventListener('levelchange', function() {
    console.log(this.level);
  });
});



  was:
JIRA parent issue: https://issues.apache.org/jira/browse/CB-6065 
Cordova documentation: https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md

w3c spec: http://www.w3.org/TR/battery-status 

Gap analysis document can be found here: https://docs.google.com/document/d/1mAcjwf39IcIqpIuS-7SzlDxTgk4OebCHae6yfOwnStE/edit?usp=sharing

dischargingtimechange event.  When the battery discharging time is updated, the user agent
must queue a task which sets the dischargingTime attribute's value and fires a simple event
nameddischargingtimechange at the BatteryManager object.
event handler: ondischargingtimechange




> Cordova W3C Battery Alignment - level property
> ----------------------------------------------
>
>                 Key: CB-7589
>                 URL: https://issues.apache.org/jira/browse/CB-7589
>             Project: Apache Cordova
>          Issue Type: Sub-task
>          Components: Plugin Battery Status
>            Reporter: Lisa Seacat DeLuca
>
> JIRA parent issue: https://issues.apache.org/jira/browse/CB-6065 
> Cordova documentation: https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md

> w3c spec: http://www.w3.org/TR/battery-status 
> Gap analysis document can be found here: https://docs.google.com/document/d/1mAcjwf39IcIqpIuS-7SzlDxTgk4OebCHae6yfOwnStE/edit?usp=sharing
> The BatteryManager object should have a readonly property called level.  The level attribute
must be set to 0 if the system's battery is depleted and the system is about to be suspended,
and to 1.0 if the battery is full, the implementation is unable to report the battery's level,
or there is no battery attached to the system. 
> Mulitple Batteries. level attribute.  The level attribute can be set to the average of
the levels of batteries of same capacity, or the weighted average of the battery level attributes
for batteries of different capacities.
> Example:
> // We get the initial value when the promise resolves ...
> navigator.getBattery().then(function(battery) {
>   console.log(battery.level);
>   // ... and any subsequent updates.
>   battery.onlevelchange = function() {
>     console.log(this.level);
>   };
> });
> Example 2 (Alternative):
> navigator.getBattery().then(function(battery) {
>   console.log(battery.level);
>   battery.addEventListener('levelchange', function() {
>     console.log(this.level);
>   });
> });



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message