You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by dblotsky <gi...@git.apache.org> on 2016/02/27 04:57:39 UTC

[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

GitHub user dblotsky opened a pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33

    Reorganizing and rewording docs.

    - Put examples below events
    - De-duped returned object section
    - Removed Tizen (deprecated)
    - Made quirks a little easier to distinguish
    - Switched to using reference-style links


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-plugin-battery-status CB-10720

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-battery-status/pull/33.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 #33
    
----
commit 39a752997e9e0e66d1f16f702603b3fc3ce14ae9
Author: Dmitry Blotsky <dm...@gmail.com>
Date:   2016-02-27T02:32:59Z

    Reorganizing and rewording docs.

----


---
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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#discussion_r54825752
  
    --- 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
    --- 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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-battery-status/pull/33


---
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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by riknoll <gi...@git.apache.org>.
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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#discussion_r54829785
  
    --- 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
    --- End diff --
    
    That's still a good point. I fixed it to be more specific.


---
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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#discussion_r54763344
  
    --- 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
    --- End diff --
    
    I think the quirk only applies to Windows Phone 8.1 as stated and not to Windows platform overall which includes Windows 8.1, Windows Phone 8.1 & Windows 10. Does your edit change the meaning?


---
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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#discussion_r54825729
  
    --- 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
    --- 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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#issuecomment-189573337
  
    @nikhilkh @riknoll @rkatyal please review when you have a moment.


---
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


[GitHub] cordova-plugin-battery-status pull request: Reorganizing and rewor...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-battery-status/pull/33#discussion_r54764106
  
    --- 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
    --- End diff --
    
    Scratch that - I see what you have done - I'm OK with it. Let's get this in. It LGTM.


---
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