cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From riknoll <...@git.apache.org>
Subject [GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...
Date Thu, 03 Mar 2016 01:54:22 GMT
Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#discussion_r54825731
  
    --- Diff: README.md ---
    @@ -57,120 +60,81 @@ attach an event listener after the `deviceready` event fires.
     - BlackBerry 10
     - Windows Phone 7 and 8
     - Windows (Windows Phone 8.1 only)
    -- Tizen
     - Firefox OS
    -- Browser
    +- Browsers
    +    - Chrome
    +    - Firefox
    +    - Opera
     
    -### Android and Amazon Fire OS Quirks
    +### Quirks: Android &amp; Amazon Fire OS
     
    -- Warning: the Android + Fire OS implementations are greedy and prolonged use will drain
the user's battery. 
    +**Warning**: the Android and Fire OS implementations are greedy and prolonged use will
drain the device's battery.
     
    -### Windows Phone 7 and 8 Quirks
    +### Quirks: Windows Phone 7 &amp; Windows Phone 8
     
    -Windows Phone 7 does not provide native APIs to determine battery
    -level, so the `level` property is unavailable.  The `isPlugged`
    -parameter _is_ supported.
    +The `level` property is _not_ supported on Windows Phone 7 because the OS does not provide
native APIs to determine battery level. The `isPlugged` parameter _is_ supported.
     
    -### Windows Quirks
    +### Quirks: Windows &amp; Windows Phone 8.1
     
    -Windows Phone 8.1 does not support `isPlugged` parameter.
    -The `level` parameter _is_ supported.
    +The `isPlugged` parameter is _not_ supported on Windows Phone 8.1. The `level` parameter
_is_ supported.
     
    -### Browser Quirks
    +## batterylow event
     
    -Supported browsers are Chrome, Firefox and Opera. 
    +Fires when the battery charge percentage reaches the low charge threshold. This threshold
value is device-specific. Returns an [object][status_object] containing battery status.
     
     ### Example
     
    -    window.addEventListener("batterystatus", onBatteryStatus, false);
    +    window.addEventListener("batterylow", onBatteryLow, false);
     
    -    function onBatteryStatus(info) {
    -        // Handle the online event
    -        console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
    +    function onBatteryLow(status) {
    +        alert("Battery Level Low " + status.level + "%");
         }
     
    -## batterycritical
    -
    -The event fires when the percentage of battery charge has reached the
    -critical battery threshold. The value is device-specific.
    -
    -The `batterycritical` handler is passed an object that contains two
    -properties:
    -
    -- __level__: The percentage of battery charge (0-100). _(Number)_
    -
    -- __isPlugged__: A boolean that indicates whether the device is plugged in. _(Boolean)_
    -
    -Applications typically should use `window.addEventListener` to attach
    -an event listener once the `deviceready` event fires.
    -
     ### Supported Platforms
     
     - Amazon Fire OS
     - iOS
     - Android
     - BlackBerry 10
    -- Tizen
     - Firefox OS
     - Windows (Windows Phone 8.1 only)
    -- Browser
    +- Browsers
    +    - Chrome
    +    - Firefox
    +    - Opera
     
    -### Windows Quirks
    +### Quirks: Windows &amp; Windows Phone 8.1
     
    -Windows Phone 8.1 will fire `batterycritical` event regardless of plugged state as it
is not supported.
    +The `batterylow` event fires on Windows Phone 8.1 irrespective of whether the device
is plugged in or not. This happens because the OS does not provide an API to detect whether
the device is plugged in.
    +
    +## batterycritical event
    +
    +Fires when the battery charge percentage reaches the critical charge threshold. This
threshold value is device-specific. Returns an [object][status_object] containing battery
status.
     
     ### Example
     
         window.addEventListener("batterycritical", onBatteryCritical, false);
     
    -    function onBatteryCritical(info) {
    -        // Handle the battery critical event
    -        alert("Battery Level Critical " + info.level + "%\nRecharge Soon!");
    +    function onBatteryCritical(status) {
    +        alert("Battery Level Critical " + status.level + "%\nRecharge Soon!");
         }
     
    -### Browser Quirks
    -
    -Supported browsers are Chrome, Firefox and Opera. 
    -
    -## batterylow
    -
    -The event fires when the percentage of battery charge has reached the
    -low battery threshold, device-specific value.
    -
    -The `batterylow` handler is passed an object that contains two
    -properties:
    -
    -- __level__: The percentage of battery charge (0-100). _(Number)_
    -
    -- __isPlugged__: A boolean that indicates whether the device is plugged in. _(Boolean)_
    -
    -Applications typically should use `window.addEventListener` to
    -attach an event listener once the `deviceready` event fires.
    -
     ### Supported Platforms
     
     - Amazon Fire OS
     - iOS
     - Android
     - BlackBerry 10
    -- Tizen
     - Firefox OS
     - Windows (Windows Phone 8.1 only)
    -- Browser
    -
    -### Windows Quirks
    +- Browsers
    --- End diff --
    
    Browser is the name of the platform. For the supported ones, maybe just list them in parentheses
like windows does above


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message