455 Commits

Author SHA1 Message Date
Shamim Rezaie
d970bf0a1e MDL-71672 javascript: Fix the markup in the header of YUI dialogs
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.
2021-07-19 16:40:10 +10:00
Shamim Rezaie
2092f152b2 MDL-71672 javascript: Fix the issue of focusOnShowSelector being ignored
When focusOnShowSelector is not present, as a fallback, focus the first
focusable element in YUI dialogues
Ref:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role
2021-07-19 16:40:10 +10:00
Andrew Nicols
acd9d9823b MDL-70990 core_form: Replace FORM_SUBMIT_AJAX event
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.
2021-05-26 10:46:49 +08:00
David Mudrák
cde6c9d4a8 MDL-69050 lang: Fix variable name and comment in core-notification YUI 2020-09-24 19:41:58 +02:00
hiendinh
813c385320 MDL-68841 Modal dialogs: Wrong behavior of popup 2020-06-11 15:25:25 +07:00
Jun Pataleta
96dc92f099 Merge branch 'MDL-68353-master' of git://github.com/rezaies/moodle 2020-05-29 22:26:03 +08:00
Shamim Rezaie
1b4acd4f3f MDL-68353 core: Set aria-label for close buttons on YUI dialogues 2020-05-29 13:17:08 +10:00
David Mudrák
2615e429f4 MDL-68753 lang: Remove a redundant okay string and use "OK" everywhere
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.
2020-05-27 09:59:44 +02:00
Andrew Nicols
29c5fafff5 MDL-66109 js: Fix Shifter linting issues 2020-05-11 11:07:49 +08:00
Neill Magill
28ee72fd68 MDL-65539 dragdrop: Ignore drag proxy in keyboard menu
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.
2020-04-03 08:36:37 +01:00
Neill Magill
b08323a789 MDL-65539 dragdrop: Allow sections and blocks to move to the top
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.
2020-04-03 08:36:37 +01:00
Neill Magill
472c953093 MDL-65539 dragdrop: Allow direction detection when using keyboard
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.
2020-04-03 08:36:37 +01:00
Tim Hunt
007d13f147 MDL-67857 formchangechecker: support form submits that dont save 2020-02-11 10:25:45 +00:00
Andrew Nicols
47d18a7303 Merge branch 'MDL-66721-master' of git://github.com/bmbrands/moodle 2020-01-14 14:06:57 +08:00
Bas Brands
a3f7695f07 MDL-66721 core_chooser: height correction for chooser modal 2020-01-06 10:07:16 +01:00
Andrew Nicols
87eba94faf MDL-67544 core: Ensure unique IDs for YUI dialogues 2020-01-06 15:01:07 +08:00
Andrew Nicols
04e67878f9 MDL-67285 core: YUI dialogues must use focuslock
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.
2019-11-19 07:40:36 +08:00
Andrew Nicols
c72f5e33c5 MDL-66845 core: YUI Dialogues should have the same zIndex as bootstrap
Part of MDL-66074

This change allows YUI Modals to sit in the same space above the
fullscreen modal and other such elements.
2019-10-30 10:23:41 +08:00
Peter
d439fac53c MDL-52849 core: Focus reader onto popup with ajax errors 2019-08-12 10:45:08 +08:00
Andrew Nicols
0f2b29242e Merge branch 'MDL-65469-master' of git://github.com/peterRd/moodle 2019-06-17 14:18:40 +08:00
Peter
dfd0021749 MDL-65469 core: Expose formchecker to initialize current form state 2019-06-17 11:55:56 +08:00
Andrew Nicols
871679c9e0 Merge branch 'MDL-65509-master' of git://github.com/rezaies/moodle 2019-06-12 08:47:55 +08:00
Damyon Wiese
7aeeb44463 MDL-34498 session: Add a checker to warn before session expiry
Replaces old yui module checknet.
2019-06-06 09:31:01 +08:00
Shamim Rezaie
dc468ac523 MDL-65509 javascript: Make core dialogues translatable 2019-06-05 17:36:02 +10:00
Damyon Wiese
260565e305 MDL-64573 output: ajax form event
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.
2019-04-24 16:17:49 +08:00
Mathew May
9757c65687 MDL-64506 Javascript: Remove docking JS.
Deprecate related lang strings & base functions now return false.
2019-04-03 19:34:20 +08:00
Damyon Wiese
cdc7390446 MDL-64331 modals: Be careful closing modals
Don't close a modal when the user clicks outside of it and the modal contains a form.
2019-04-02 10:02:26 +08:00
Ryan Wyllie
7e0305be70 MDL-60207 javascript: remove click handler in YUI modal initialiser 2018-05-29 10:05:00 +08:00
Treu Quan
30e1f5a023 MDL-60207 javascript: close modal when user touch/click outside it 2018-05-29 10:04:37 +08:00
Bas Brands
e58362ed1e MDL-62160 Theme boost: center buttons on notification popup 2018-04-25 10:18:36 +02:00
Amy Groshek
ecdfab51a3 MDL-60478 mod_scorm: Makes checknet alerts less obtrusive.
Alters checknet component to accept frequency,
timeout, and maxalerts arguments. Sets checknet
launched during SCORM session for 30 sec
frequency, 10 sec timeout, and 1 alert max.
2017-11-20 12:59:14 -06:00
Andrew Nicols
bd90b61ad2 MDL-59312 js: Improve display of exception stacktrace 2017-06-23 10:44:15 +08:00
David Mudrák
64b6651cfa MDL-59269 lang: Fix ability to uninstall certain language packs
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.
2017-06-16 14:15:25 +02:00
Andrew Nicols
2154c9824d Merge branch 'MDL-40759-master' of git://github.com/damyon/moodle 2017-03-20 13:57:38 +08:00
Damyon Wiese
b9b409cfc3 MDL-40759 icons: Peer review fixes (all minor) 2017-03-17 15:52:46 +08:00
Damyon Wiese
8857c715d1 MDL-40759 icons: Behat fixes for font-awesome 2017-03-17 15:52:18 +08:00
Damyon Wiese
95b06c13c6 MDL-40759 icons: Refactor icon system to be extensible. 2017-03-17 15:51:29 +08:00
Damyon Wiese
e6bf10c772 MDL-40759 dragdrop: Use a pix icon renderer for drag handles. 2017-03-17 15:51:28 +08:00
Jake Dallimore
3d4339b817 MDL-58182 javascript: Fix for buttons regression in core dialog.
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.
2017-03-17 09:05:04 +08:00
Jake Dallimore
35fcaac78b MDL-56364 javascript: Prevent bad prototype chains in core dialogue
The DIALOGUE object was using Y.clone to copy the input config, messing
up the prototype chains for any objects in the config param. Really,
this doesn't need to clone the config, so I've refactored to avoid doing
so. Also moved some of the other attribute init and setup calls to the
appropriate places (initializer and modifyAttrs).
2017-02-24 08:25:31 +08:00
Dan Poltawski
d83d87f6ac MDL-56640 yui: remove moodle-core-formautosubmit
It's easily achieved with jquery primatives
2016-12-20 10:02:06 +00:00
Damyon Wiese
f2405a5f5c MDL-56242 theme_boost: Fix styling for confirm boxes (js and in page)
They should be left aligned with a header, content and footer (right aligned with the buttons).

There should be a primary continue button and a secondary cancel button.
2016-11-14 11:11:28 +08:00
Damyon Wiese
9280f62e38 MDL-56196 mod_lti: Fix popups and secret form in boost 2016-11-08 14:27:26 +08:00
Dan Poltawski
f95c00e551 Merge branch 'wip-MDL-54986-master' of https://github.com/Beedell/moodle 2016-11-04 14:31:00 +00:00
John Beedell
6e1e299554 MDL-54986 Quiz: Disable add button for quiz with attempts 2016-11-02 17:02:59 +00:00
David Monllao
f5d9072e51 Merge branch 'MDL-56462-master' of git://github.com/damyon/moodle 2016-11-02 09:14:09 +08:00
Dan Poltawski
5ad34c43f6 Merge branch 'MDL-56597-master' of git://github.com/damyon/moodle 2016-10-31 15:10:02 +00:00
Damyon Wiese
58488d0ff0 MDL-56462 boost: Fix assign grading options form
Classes attribute was not being honoured by all form element templates.
Formchangechecker was only looking for the ignoredirty class on the element,
in boost it is on the container.
Assign had specific styles to hide the submit buttons that were not matching in boost.
2016-10-28 12:24:50 +08:00
Damyon Wiese
bff9fd896a MDL-56597 theme_boost: Maintenance warning styles 2016-10-27 10:41:42 +08:00
David Ligne
f2510387e5 MDL-56442 administration: Display hours in maintenance mode messages 2016-10-20 13:17:07 -04:00