Move the close button out of the element that is set as the
aria-labelledby for the dialog.
Also used h5 for the dialog titles so they are consistent with
AMD modals.
The legacy M.core.event.FORM_SUBMIT_AJAX ecent has been replaced with a
new core_form/events::formSubmittedByJavascript native DOM event.
The new event can be listened to at any point in the DOM using the
following syntax:
```
import {eventTypes} from 'core_form/events';
document.addEventListener(eventTypes.formSubmittedByJavascript, handler);
```
A backward-compatabibility layer is included to ensure that any
legacy YUI event triggered on a form is still respected and the new
native event is also fired.
A similar handler is also included to ensure that any legacy YUI event
listener is still called with the same arguments.
These legacy bridges will be removed after Moodle 4.3.
The "Ok" (with lower-case "k") string was added in MDL-68409 to keep
backwards compatibility with YUI alerts that had it hard-coded. But we
should not need to explain to translators why we have two OK strings
like this and why they use different wording.
Additionally, there would be inconsistency in Behat tests and everywhere
depending on which "OK" or "Ok" string is used for buttons.
So instead, this patch changes the hard-coded 'Ok' string in the YUI and
we should stick to "OK" from now on everywhere.
Before this change the node that is displayed during a the last mouse
drag and drop would be listed in a keyboard drag and drop if it was
the container node of one of the types of node being moved in this action.
If a node is inside a node with the .yui3-dd-proxy class then it is
one of the proxy elements used to display the dragged content during
mouse drag and drop so we will start ignoring it.
Before this change sections and blocks could not be moved to be the
top item when using keyboard drag and drop.
They can now be moved to the top in one action.
The way they move using keyboard drag and drop has changed when they
are below the item they are dropped on, not instead of appearing
below it they will be placed above it.
Before this change keyboard drag and drop could not detect the
direction of movement, this meant that an item would only be placed
below an item or at the top of a container item.
This change means that extending modules can declare
detectkeyboarddirection to true. This will mean that when an item is
moved it's position will be determined by the direction of travel as
it would be when dragging using the mouse.
If detectkeyboarddirection is true then:
* If you move an item upwards it will be placed before the item
selected in the drop menu
* If you move a item downwards it will be placed after the item
selected in the drop menu
* The item above the one being dragged will now be displayed on
the drop menu
If detectkeyboarddirection is false there will be no change in
behaviour.
YUI Dialogues were using an older method for locking focus to modals,
but this way conflicts with the way in which we lock focus for AMD
modules.
As a result, when an AMD dialogue launches a YUI dialogue the focus is
not correctly locked and it is not possible to focus on anything in the
YUI dialogue.
This includes a minor changes to the focuslock AMD module to ensure that
it is possible to loop the focus in both directions. Many of our older
YUI dialogues are themselves focusable. As a result we need to include
the lock region in the calculation when calculating the possible
descendants.
If we do not do so then the reverse looping does not work.
Add an event that can be fired when an mform is about to be submitted via ajax.
This allows custom field types to perform an action when the form is submitted.
The atto text editor will reset any autosaves when the form is submitted.
In the issue MDL-39319 (6ddf92c77), the ability to uninstall multiple
language packs at once was added. By a mistake, the PARAM_ALPHAEXT was
used as paramater type for the dash-separated list of language packs to
be uninstalled. Language packs with a number in the name (such as
en_us_k12) do not pass the ALPHAEXT cleaning.
This patch changes the parameter cleaning to PARAM_SAFEPATH which is
more appropriate for the given scenario as language code themselves must
be SAFEDIRs.
Fixes a regression caused by MDL-56364, wherein the buttons were made
readOnly, meaning addButtons wouldn't work. This removes that change,
while maintaining the original dependency between the buttons and the
closeButton config options.