Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt BatteryManager events to the new event structure #13021

Merged
merged 8 commits into from
Feb 16, 2022

Conversation

teoli2003
Copy link
Contributor

@teoli2003 teoli2003 commented Feb 15, 2022

This PR updates the BroadcastChannel interface for new-style event pages. (see the template).

As onXYZ exists and XYZ_event not, for each onXYZ

  • yarn content move /Web/API/xxxx/onXYZ /Web/API/xxxx/XYZ_event
  • Update browser-compat front-runner key
  • Update title front-runner key to: Interface: XYZ event (with ticks!)
  • Remove Property and Event Handler from the tag list and add Event instead (more cleaning possible)
  • Check if the event bubbles. Do nothing if not.
  • Change intro to explain the event itself and no more just onXYZ.


    Example: "The levelchange event of the Battery Status API is fired when the battery {{domxref("BatteryManager.level","level")}} property is updated."

  • Copy the syntax section from the template, and fix the names of event and of the onXYZ property
  • Add the Event type section (two texts possible! If inheritance is not only Event, do these additional steps:
    • N/A Update the argument of {{InheritanceDiagram}}
    • N/A Add the Event properties section and list the parameters, taken from the interface of the event type
  • Check that no mention of this onXYZ is a link.
  • Check that links to onXYZ is a link to the adequate XYZ_event

On the API interface page:

  • Remove the Event handlers section
  • Add the Events section

On each page of the interface and the API overview page:

  • Check that there are no links to onXYZ.
  • Check that examples uses the modern syntax for defining function in event handler (onXYZ = event => { …} )
  • Check that no {{event} macro is left.
  • Fix flaws (as much as possible); at least, make sure not to introduce new flaws.
  • Check that if an event is linked to a property value, that property documents when this event is fired.


    Example: "When its value changes, the chargingchange event is fired."

Optional:

  • Remove gremlins (non-breaking spaces, curly tick, curly double-ticks)
  • If the interface is no more experimental, remove the experimental tags/banners.

Administration:

  • Link to the BCD PR.

BCD: mdn/browser-compat-data#14993

@github-actions github-actions bot added the Content:WebAPI Web API docs label Feb 15, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2022

Preview URLs

Flaws

Note! 5 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/BatteryManager/chargingtimechange_event
Title: BatteryManager: chargingtimechange event
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.BatteryManager.chargingtimechange_event

URL: /en-US/docs/Web/API/BatteryManager/levelchange_event
Title: BatteryManager: levelchange event
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.BatteryManager.levelchange_event

URL: /en-US/docs/Web/API/BatteryManager/dischargingtimechange_event
Title: BatteryManager: dischargintimechange event
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.BatteryManager.dischargingtimechange_event

URL: /en-US/docs/Web/API/BatteryManager/chargingchange_event
Title: BatteryManager: chargingchange event
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.BatteryManager.chargingchange_event

URL: /en-US/docs/Web/API/Battery_Status_API
Title: Battery Status API
on GitHub
Flaw count: 4

  • bad_bcd_links:
    • no explanation!
    • no explanation!
    • no explanation!
    • no explanation!

External URLs

URL: /en-US/docs/Web/API/BatteryManager
Title: BatteryManager
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/chargingTime
Title: BatteryManager.chargingTime
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/level
Title: BatteryManager.level
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/chargingtimechange_event
Title: BatteryManager: chargingtimechange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/levelchange_event
Title: BatteryManager: levelchange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/dischargingtimechange_event
Title: BatteryManager: dischargintimechange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/dischargingTime
Title: BatteryManager.dischargingTime
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/charging
Title: BatteryManager.charging
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/BatteryManager/chargingchange_event
Title: BatteryManager: chargingchange event
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Battery_Status_API
Title: Battery Status API
on GitHub

(this comment was updated 2022-02-16 10:35:43.191480)

@teoli2003 teoli2003 requested a review from Elchi3 February 15, 2022 11:22
@teoli2003 teoli2003 marked this pull request as ready for review February 15, 2022 11:25
@teoli2003 teoli2003 requested review from a team as code owners February 15, 2022 11:25
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I just found some nits

teoli2003 and others added 4 commits February 16, 2022 11:32
Co-authored-by: Florian Scholz <fs@florianscholz.com>
Co-authored-by: Florian Scholz <fs@florianscholz.com>
Co-authored-by: Florian Scholz <fs@florianscholz.com>
Co-authored-by: Florian Scholz <fs@florianscholz.com>
@teoli2003 teoli2003 requested a review from Elchi3 February 16, 2022 10:34
@Elchi3 Elchi3 merged commit 2b3935c into mdn:main Feb 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants