Kindly EditDocumentationTry the editor

kindly-training.js

The video buttons' window on Kindly Edit's screens.

Responsibility#

The video buttons on Kindly Edit's screens: a button opens its video in a window over the screen and only then loads it from the public guide; Esc, Close or a press outside leave it, the video stops and focus returns to the button. Esc also works while the player has focus: the guide's embed page posts a close request, and only the open window's own frame is listened to. Each open and close swaps in a fresh frame, so the browser's Back history is untouched.

File characteristics#

  • Source: assets/kindly-training.js
  • Lines in this release: 45
  • Type: browser JavaScript

Named browser helpers#

swap.

Literal event listeners#

click, close, message. Dynamic event names may be assembled elsewhere.

Integration and verification#

Loaded by training.php on the Kindly Edit screens only, and only when the site has a guide. Check that nothing loads before a button is pressed, that Esc and Close stop the video, that focus returns to the button, and that opening and closing adds nothing to Back history.

About this page

Documents Kindly Edit 0.9.16. Source: assets/kindly-training.js. Theme choices and account permissions can change which controls appear.

Type a word or phrase to search the full documentation.