586 Commits

Author SHA1 Message Date
Mikel Martín
5fade7fcc6 MDL-71089 core: Add different Toast notification styling 'types' 2021-04-13 16:28:35 +02:00
Eloy Lafuente (stronk7)
c06ed30430 Merge branch 'MDL-70802-master' of git://github.com/andrewnicols/moodle 2021-04-08 18:30:13 +02:00
Paul Holden
11099c15bb MDL-70962 forms: catch modal exceptions when getting body content.
They are thrown in the following circumstances:

 * The dynamic form class doesn't exist;
 * It does exist but it's `check_access` method throws exception

Co-Authored-By: Andrew Nicols <andrew@nicols.co.uk>
2021-03-25 17:26:36 +00:00
Andrew Nicols
1b7ce2dd0d MDL-70802 javascript: Normalise component consistently in templates 2021-03-24 11:18:33 +08:00
Ilya Tregubov
eaf40e050e MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:48:26 +08:00
Marina Glancy
72be49c473 MDL-64554 core_form: new API for modal forms 2021-02-17 18:06:49 +01:00
Andrew Nicols
6995888454 Merge branch 'MDL-69748-master' of git://github.com/rezaies/moodle 2021-02-04 11:51:57 +08:00
Shamim Rezaie
a321181fe6 MDL-69748 core: Fix hideif issue with array elements
Changed the element selector to get all array elements,
whether named or unnamed. The previus selector was only
working for elements that thir names were like name="something[]".
It was not working for name="something[a]" elements.
2021-02-04 14:37:40 +11:00
Sara Arjona
1e5a862c93 Merge branch 'MDL-70316-master' of git://github.com/mihailges/moodle 2021-02-03 15:29:23 +01:00
Ilya Tregubov
e174f19db6 MDL-70304 core: updated adapter.js to 7.4.0 2021-02-02 08:58:30 +02:00
Mihail Geshoski
517069bc8e MDL-70316 core: Upgrade emoji-data to 6.0.0 2021-01-27 13:35:44 +08:00
Sara Arjona
fea8fb3e92 Merge branch 'MDL-70305-master' of git://github.com/peterRd/moodle 2021-01-18 09:20:21 +01:00
Peter Dias
a0573603e6 MDL-70305 lib: Update thirdpartylibs chartjs version 2021-01-14 07:54:19 +08:00
Peter Dias
79ee30c6ca MDL-70305 lib: Upgrade chartjs to 2.9.4 2021-01-14 07:36:35 +08:00
Sara Arjona
b3164b3253 Merge branch 'MDL-70299' of git://github.com/paulholden/moodle 2021-01-13 17:19:50 +01:00
Jun Pataleta
81cb8b9f09 Merge branch 'MDL-70580' of git://github.com/paulholden/moodle 2021-01-13 10:20:20 +08:00
Paul Holden
be48efc9b7 MDL-70580 core: retrieve closest tree node in click handler. 2021-01-12 20:11:25 +00:00
Jun Pataleta
495f45ef3b Merge branch 'MDL-70580' of git://github.com/paulholden/moodle 2021-01-12 13:16:00 +08:00
Andrew Nicols
d0bc893972 MDL-70580 core: Tree nodes should check if they were clicked directly 2021-01-11 23:42:03 +00:00
Paul Holden
67f137832d MDL-70299 libraries: upgrade to version 1.7.1 of loglevel. 2021-01-08 09:55:03 +00:00
Dmitrii Metelkin
21789c7168 MDL-70352 core: attach modal to a specific element 2020-12-31 14:02:20 +11:00
Andrew Nicols
eed01bbc94 Merge branch 'MDL-65856' of https://github.com/hdagheda/moodle 2020-12-22 09:38:01 +08:00
Heena Agheda
9c5dc8fc7d MDL-65856 session: UX review of session timeout
Add new setting 'sessiontimeoutwarning', gives logged in user ability to extend session when there is no activity.
2020-12-21 08:43:21 +11:00
Sara Arjona
8099deda48 Merge branch 'MDL-69107-master-2' of git://github.com/andrewnicols/moodle 2020-12-18 15:22:09 +01:00
Andrew Nicols
f07d3b71d2 MDL-69107 form_autocomplete: Rewrite item selection
The form_autocomplete is essentially a custom element. Unfortunately the
`setValue()` function in Mink has undesired actions so it is necessary
to write our own handling for it.

The standard Mink `setValue()` function focuses the element, sets a
value, and then blurs the element. In the case of the autocomplete this
can cause the autocomplete suggestions list to be closed in some
situations. Instead of using the setValue we click, and type the value,
but do not immediately blur.
2020-12-15 09:08:05 +08:00
Tom Dickman
c00fc9707f MDL-67623 block overview: fix pagination regression
Fixed a regression caused by MDL-64194 resulting in Dashboard - Course
overview pagination not working from second page of courses onwards.

Course overview block should now do the following:
- Display no pagination controls when user has no courses
- Display no pagination controls when less than 12 courses to display
- Only display pagination controls up to the number of courses user is
enrolled in
- Work correctly when on a page greater than the second page.
2020-12-14 13:15:26 +11:00
Andrew Nicols
cd3809653c Merge branch 'MDL-70320' of https://github.com/timhunt/moodle 2020-12-09 11:56:05 +08:00
Mihail Geshoski
16b72504b3 MDL-57614 core: Fetch blocks through a webservice in add block modal 2020-12-02 13:43:15 +08:00
Tim Hunt
374d3e7700 MDL-70320 permission overrides: role names were double-escaped 2020-11-25 21:19:57 +00:00
Eloy Lafuente (stronk7)
de317c2cd4 Merge branch 'MDL-67513-master-fix' of https://github.com/andrewnicols/moodle into master 2020-11-16 09:17:31 +01:00
Andrew Nicols
78962293ef MDL-67513 core: Only move modal to body if currently attached
A previous change as part of this commitset was intended to move the
modal to the document.body, but where the modal had been destroyed it
was instead added back to the body.
2020-11-16 15:19:32 +08:00
Andrew Nicols
73bd838c1b Merge branch 'MDL-67513' of https://github.com/NeillM/moodle 2020-11-16 08:22:51 +08:00
Neill Magill
524253382c MDL-67513 forum: View conversations while fullscreen grading
Before this change when a modal was shown and an element on the page
was fullscreen the modal would be created behind it.

This change ensures that the modal will be inside an element that is
fullscreen so that it will be correctly displayed.
2020-11-12 08:35:55 +00:00
Jun Pataleta
f0b91724fe Merge branch 'MDL-70072-master' of git://github.com/rezaies/moodle 2020-11-11 22:08:07 +08:00
Sara Arjona
16af4ae4db Merge branch 'MDL-70106-icon-cache' of https://github.com/Peterburnett/moodle 2020-11-10 16:53:27 +01:00
Shamim Rezaie
f0f45c01b1 MDL-70072 core: Fix always displaying date in Gregorian 2020-11-06 19:21:17 +11:00
Andrew Nicols
7d786c7968 MDL-70075 core: Autocomplete selection should always have an active item
Ensure that there is always one active element in the list of selected
autocomplete elements.

Without this we have issues beacuse clicking on the link makes the first
one active if one is not already active, and this turns a click event
into a drag event, which means that it is not deleted.
2020-11-05 08:55:50 +08:00
Peter Burnett
7fe1554c21 MDL-70106 cache: Set icon localstorage cache to use theme localisation 2020-11-04 13:29:53 +10:00
Andrew Nicols
a88838c25f MDL-70075 core: Do not return a value in an event handler
Returning a value of `false` in an event handler has the effect of
calling event.preventDefault() and event.stopPropagation().

This is neither obvious, nor desirable in this situation.
2020-11-04 11:27:55 +08:00
Andrew Nicols
5d16bfcf7c MDL-70075 core: jQuery.attr() does not accept a bool value
The documented values that jQuery.attr() accepts are String, Number, or
null. For some reason, when we pass a Boolean value, the subsequent
click handler does not work in some situations.

Changing this to take a Number, and unsetting it when empty, resolves
this issue.
2020-11-04 11:27:55 +08:00
Andrew Nicols
189a4c8f8e MDL-70075 core: Listen for change in accessibleChange event
The accessibleChange custom interaction event was only listening for
blur and focus, however some OS/browser combinations do not emit these
events until the element is explicitly blurred. This is notably
different on Firefox on some Operating Systems.

Recent changes in MDL-68167 explicitly moved the user participants page
filter module to use the accessibleChange event, which means that the
selections are now only triggered on an explicit blur when using
Firefox. This highlight a bug whereby, when the mouse is used to make a
selection, the event is not triggered until the element is blurred.

This change modifies the accessibleChange event to ignore the `change`
event where it was triggered by the keyboard and where that keybaord
event was not a [return] or [escape] keypress, but to otherwise respect
the native change event.
2020-11-04 11:27:55 +08:00
Andrew Nicols
3caa6bfbe1 MDL-70075 core: Listen for the focus and blur events again
The `blur` event does not bubble, but the `focusout` events are not
available in all supported versions of Firefox.

Rather than switching event, this patch using event capture to
effectively achieve the same result and bubble the event up through the
DOM to the delegated listener.

There should be no functional change with this patch, except to support
Firefox fully.
2020-11-04 11:27:55 +08:00
Jun Pataleta
e275f0f5da Merge branch 'MDL-70033-master-2' of git://github.com/mickhawkins/moodle 2020-11-03 12:02:08 +08:00
Michael Hawkins
f01c2fa4e7 MDL-70033 core: Update tree.js event handlers to replace stopPropagation
Also added support to allow links to override action keys (enter/space)

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2020-11-03 11:53:57 +08:00
Shamim Rezaie
0438cd60bb MDL-68167 lib: autocomplete focos should not be removed on blur
See https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/listbox-rearrangeable.html
2020-10-30 16:01:38 +11:00
Shamim Rezaie
e2ee6025fe MDL-68167 lib: Do not set aria-expanded if it should not be set 2020-10-30 16:01:38 +11:00
Shamim Rezaie
15a349dd4f MDL-68167 lib: The accessibleChange custom event now supports bubbling
The change event bubbles so the accessibleChange shoud bubble as well.
2020-10-30 14:52:52 +11:00
Shamim Rezaie
b643c88682 MDL-68167 lib: Autocomplete selection to use listbox aria role
The aria-selected state cannot be used for the listitem role. The
autocomplete widget highly uses the aria-selected state internally.
2020-10-30 14:43:00 +11:00
Andrew Nicols
931f36ce15 Merge branch 'MDL-69166-master-4' of git://github.com/rezaies/moodle 2020-10-27 12:47:50 +08:00
Marina Glancy
7740c45de4 MDL-69166 core_form: allow modals to prevent closing on accidental click 2020-10-27 14:37:28 +11:00