Skip to content

Commit

Permalink
[docs] Manually backport moodle#1151
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Nov 4, 2024
1 parent c90cb55 commit e250200
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $action = new \core_ai\aiactions\generate_image(
// Send the action to the AI manager.
$manager = \core\di::get(\core_ai\manager::class);
$response = $manager->process_action($action);
````
```

- The process_action() method will then return a response object (instance of `responses\response_base`).
- It is up to the Placement to check for success (or not) of the response and pass the result back to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,53 +175,53 @@ Manually open and close the dropdown rather than purely relying on Bootstrap.

Ensure that nodes that are susceptible to change are up-to-date when we need them.

#### registerClickHandlers()
#### registerClickHandlers() {#registerClickHandlers}

Handle our base case of click handlers i.e. opening and closing the dropdown. This can be further extended in callers for any special handling.

#### registerKeyHandlers()
#### registerKeyHandlers() {#registerKeyHandlers}

Handle our base case of keyboard handlers i.e. opening and closing the dropdown, accessibility handling. This can be further extended in callers for any special handling.

#### registerInputHandlers()
#### registerInputHandlers() {#registerInputHandlers}

Register the text input handlers for the search input and debounce the input so that we don't need to fire a bunch of calls as the user is still typing.
<!-- cspell:ignore filterrenderpipe -->
#### filterrenderpipe()

Combine the filter and render methods into a single method to be called by the input handlers as a QoL shorthand call.

#### renderAndShow()
#### renderAndShow() {#renderAndShow}

Given we need to update the display, ensure we have the latest dataset and render it.

#### keyUpDown()
#### keyUpDown() {#keyUpDown}

Given the user is navigating the dropdown with the keyboard, handle the common up and down arrow key cases.

#### clickHandler()
#### clickHandler() {#clickHandler}

Used within [registerClickHandlers](#registerClickHandlers()) to handle the common click cases like selecting results, closing the dropdown, etc.
Used within [registerClickHandlers](#registerClickHandlers) to handle the common click cases like selecting results, closing the dropdown, etc.

#### keyHandler()
#### keyHandler() {#keyHandler}

Used within [registerKeyHandlers](#registerKeyHandlers()) to handle the common keyboard cases like navigating nodes, closing the dropdown, etc.
Used within [registerKeyHandlers](#registerKeyHandlers) to handle the common keyboard cases like navigating nodes, closing the dropdown, etc.

#### selectNode()

When used in conjunction with [keyUpDown](#keyUpDown()) and other similar functions, this function will select the node that the user has navigated to.
When used in conjunction with [keyUpDown](#keyUpDown) and other similar functions, this function will select the node that the user has navigated to.

#### moveToFirstNode()

When used in conjunction with [keyUpDown](#keyUpDown()) and other similar functions, this function will move the user to the first node in the dropdown.
When used in conjunction with [keyUpDown](#keyUpDown) and other similar functions, this function will move the user to the first node in the dropdown.

#### moveToLastNode()

When used in conjunction with [keyUpDown](#keyUpDown()) and other similar functions, this function will move the user to the last node in the dropdown.
When used in conjunction with [keyUpDown](#keyUpDown) and other similar functions, this function will move the user to the last node in the dropdown.

#### moveToNode()

When used in conjunction with [keyUpDown](#keyUpDown()) and other similar functions, this function will move the user to the node that is passed in.
When used in conjunction with [keyUpDown](#keyUpDown) and other similar functions, this function will move the user to the node that is passed in.

### Required functions to implement

Expand Down

0 comments on commit e250200

Please sign in to comment.