718 Commits

Author SHA1 Message Date
Ferran Recio
ff5f669cf8 MDL-76432 aria: add getFirst to nomalise
Half of the times the normalise module is used is to get a single
element. However, because jQuery elements can contain multiple elements
the getList is always an array. Due to this in many ocasions we repeat
the getList(VAR)[0] line instead of having a more readable getFirst
method which only implies a couple of lines in the original code.
2023-02-06 12:58:43 +01:00
Jun Pataleta
3f0b0dccb1 Merge branch 'MDL-72609-master' of https://github.com/andrewnicols/moodle 2023-02-02 12:41:16 +08:00
Andrew Nicols
44fd686a2f Merge branch 'MDL-77003' of https://github.com/paulholden/moodle 2023-02-02 08:19:45 +08:00
Paul Holden
ea0515758a MDL-77003 javascript: improve string helper JSON detection.
Changes in fbc2732d made the JS template string helper method
too strict in regards to what it considers a valid JSON object.

Co-authored-by: Mike Churchward <mike@brickfieldlabs.ie>
2023-01-24 22:14:12 +00:00
Sara Arjona
ae53d04144 Merge branch 'MDL-75337-master' of https://github.com/laurentdavid/moodle 2023-01-24 16:07:35 +01:00
Laurent David
377c962f11 MDL-75337 core: Single button - API changes
* Update component library for new features of single_button and modal
    * Update core_notification javascript
2023-01-23 13:45:21 +01:00
Andrew Nicols
116ddb8933 MDL-72609 behat: Rewrite core/pending to observe ES6 style
This commit makes the following changes:
* convert to use ES6 module format
* migrate from a jQuery Deferred to a native ES6 promise
* add a native-Promise-like instantiation

New uses are documented in appropriate jsdoc with examples.
2023-01-23 15:02:55 +08:00
Tien Nguyen
5863659d79 MDL-69164 Question: Convert question/qengine.js to AMD modules 2023-01-18 11:24:38 +07:00
Andrew Nicols
23d8120ab0 Merge branch 'MDL-76508-master' of https://github.com/meirzamoodle/moodle 2023-01-05 21:30:01 +08:00
Huong Nguyen
887f193c38 MDL-72523 javascript: Introduce setReturnElement for core/modal 2022-12-28 11:14:38 +00:00
Meirza
fbc2732d9f MDL-76508 templates: Handling non-JSON string
When the param string contains a left curly bracket as the first character,
the system will assume the string is a JSON string and will be parsed and returned as an object.
But in some cases, the string is not JSON and will return an error if the system parses it.
For example, a user might have used the course name with a left curly bracket as the first character.
Adding a double quote after the left curly bracket to differentiate between string and JSON string,
so it can be safe to parse the string, and also added try..catch to ensure that the parsing creates an object type.
2022-12-23 09:57:36 +07:00
Andrew Nicols
6982caf746 Merge branch 'MDL-76491' of https://github.com/paulholden/moodle 2022-12-08 08:08:19 +08:00
Lars Bonczek
e875c6118c MDL-75516 core: Perform proper JSON encoding in mustache quote helper 2022-12-02 13:39:58 +01:00
Paul Holden
077a30b7ff MDL-76491 javascript: add missing core/notification imports. 2022-12-02 10:05:28 +00:00
Eloy Lafuente (stronk7)
d3ee90b158 MDL-76388 user: Switch from deprecated string in core_user to core one
This case was left not changed @ MDL-72509, and detected by the
Moodle 4.1 apache logs review @ MDL-76064.

Not much to say, just switch to the core lang string, the other
is deprecated for 4.1 and up.
2022-11-20 10:46:41 +01:00
Mathew May
57e65480a3 MDL-75837 gradebook: accessibility improvements 2022-11-14 10:19:45 +08:00
Sara Arjona
4dc0505b2a Merge branch 'MDL-75471' of https://github.com/paulholden/moodle 2022-10-27 17:35:04 +02:00
Sara Arjona
83aa6c2a13 Merge branch 'MDL-75474-master' of https://github.com/davewoloszyn/moodle 2022-10-24 16:54:40 +02:00
Sara Arjona
963b7a4423 Merge branch 'MDL-72828-master' of https://github.com/davewoloszyn/moodle 2022-10-21 16:24:41 +02:00
Ilya Tregubov
660b56eb50 Merge branch 'MDL-75362-refactor' of https://github.com/Chocolate-lightning/moodle 2022-10-21 09:56:19 +03:00
David Woloszyn
bbe528c1ad MDL-72828 js: get_strings supports jquery objects 2022-10-21 13:47:34 +11:00
Paul Holden
492a1c1624 MDL-75471 libraries: upgrade to version 1.8.0 of loglevel. 2022-10-20 22:00:13 +01:00
Mathew May
e84948c4a7 MDL-75362 gradereport_singleview: Roll in zero state 2022-10-20 21:24:51 +08:00
Andrew Nicols
8f6835c6e8 Merge branch 'MDL-75834-master' of https://github.com/sammarshallou/moodle 2022-10-20 14:35:15 +08:00
Andrew Nicols
18a4241fee MDL-75962 js: Fix jsdoc violations 2022-10-12 10:06:40 +08:00
sam marshall
8e35bb415d MDL-75834 lib: Focus lock JS bug when focus area removed 2022-10-10 16:24:30 +01:00
David Woloszyn
0bcd6e4e12 MDL-75474 lib: Upgrade mustache.js to 4.2.0 2022-10-10 11:49:53 +11:00
Andrew Nicols
5bf222af33 Merge branch 'MDL-75485-master' of https://github.com/davewoloszyn/moodle 2022-10-06 10:49:14 +08:00
Andrew Nicols
46188420da Merge branch 'MDL-74922_master_fix_storage_wrapper_validate_cache' of https://github.com/gthomas2/moodle 2022-09-29 12:05:54 +08:00
Tomo Tsuyuki
68a5034b67 MDL-72509 core: De-couple participants filter from core_user to core
This implementation will de-couple the participant filter from
core user to core so its easily usable to any api in core or any
community plugin. This removes the dependency from the core_user
and creates a nice api where it can produce filterable objects.

Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
Co-Authored-By: Tomo Tsuyuki <tomotsuyuki@catalyst-au.net>

AMOS BEGIN
 MOV [addcondition,core_user], [addcondition,core]
 MOV [adverbfor_and,core_user], [operator_and,core]
 MOV [adverbfor_andnot,core_user], [operator_andnot,core]
 MOV [adverbfor_or,core_user], [operator_or,core]
 MOV [applyfilters,core_user], [applyfilters,core]
 MOV [clearfilterrow,core_user], [clearfilterrow,core]
 MOV [clearfilters,core_user], [clearfilters,core]
 MOV [filtersetmatchdescription,core_user], [filtersetmatchdescription,core]
 MOV [filterrowlegend,core_user], [filterrowlegend,core]
 MOV [filtertype,core_user], [filtertype,core]
 MOV [match,core_user], [match,core]
 MOV [matchofthefollowing,core_user], [matchofthefollowing,core]
 MOV [placeholdertypeorselect,core_user], [placeholdertypeorselect,core]
 MOV [selectfiltertype,core_user], [selectfiltertype,core]
AMOS END
2022-09-27 12:07:36 +08:00
David Woloszyn
e63357e57a MDL-75485 Emoji Data: updated from 7.0.2 to 14.0.1 2022-09-16 09:36:31 +10:00
Paul Holden
31cccc6058 MDL-74635 tag: add select all/none tags for bulk actions. 2022-09-12 11:19:17 +01:00
Carlos Castillo
562041adda MDL-71708 libraries: Upgrade chartjs to latest version
Changes in chart config file and the process to import library.

Co-authored-by: Andrew Lyons <andrew.lyons@moodle.com>
2022-07-20 15:42:02 -05:00
Huong Nguyen
47c6c30178 MDL-74701 core: Fix popover elements are focusable even when hidden 2022-06-13 09:44:55 +07:00
gthomas2
7d8fef801a MDL-74922 javascript: storragewrapper validateCache fix 2022-06-08 09:34:53 +01:00
Jun Pataleta
c1c52cfddd Merge branch 'MDL-73556-master' of https://github.com/ferranrecio/moodle 2022-03-24 23:50:07 +08:00
Ferran Recio
bf642fb6fc MDL-73556 core_courseformat: fix course index click toggle
When the user clicks on a course index chevron the section is toggled.
However, when clicks on the section name the section is expanded but
never collapsed.
2022-03-18 14:39:32 +01:00
Jun Pataleta
8c07f33d80 Merge branch 'MDL-72481-master' of https://github.com/rezaies/moodle 2022-03-16 11:45:40 +08:00
Shamim Rezaie
ef84c1607d MDL-72481 core: prevent loosing the tick next to selected dropdown itme
prevent loosing the tick when user clicks on the toggle button
or when they Press Esc to close the dropdown.
2022-03-15 12:48:22 +11:00
Shamim Rezaie
50c8bf68a8 MDL-72481 core: Make more menu tabbable when the active tab moves inside 2022-03-15 12:48:22 +11:00
Sujith Haridasan
1168e5fff1 MDL-72481 core: Fix the keyboard navigation in RTL
Also updated e.keyCode to e.key because keyCode is deprecated.

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:22 +11:00
Shamim Rezaie
4489132505 MDL-72481 core: only move through visible tabs 2022-03-15 12:48:22 +11:00
Jun Pataleta
1f21daf8b3 MDL-72481 core: Fix more menu keyboard navigation
* Allow the more menu to be rendered as a tablist when needed.
* Let menu_navigation handle keyboard navigation only when
menu items are not rendered as dropdowns. Otherwise, leave
the keyboard navigation handling via the default handlers
(e.g. dropdown.js/aria.js/tab.js).
* When the more menu is rendered as a tablist, use aria-selected
for the selected tab. When it's rendered as a menu, use aria-current
for the selected menu item. (The menuitem role supports aria-current and
not aria-selected)
* Make sure that the active tab is tabbable by default.
* Submenu items should always have tabindex=-1
* Update behat to use css_element instead of xpath. Also, improved it
to consider that it is the active element that should be tabbable.

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:21 +11:00
Amaia Anabitarte
329586411d MDL-74131 tags: Fix flagged tags color contrast 2022-03-14 09:59:13 +01:00
Huong Nguyen
0d4069918e MDL-73457 Course: Fix drag & drop image prevents moving resources
Including in this commit:
 - Modify the UI to make the section dropzone more visible
 - Prevent the direct image dragging in Chrome, Safari by improving the check
2022-02-28 14:00:57 +07:00
Jun Pataleta
baf360a7ba Merge branch 'MDL-73915-master-terser' of https://github.com/andrewnicols/moodle 2022-02-24 17:29:17 +08:00
Mihail Geshoski
cb802c269d MDL-73355 navigation: Do not always mark selected dropdown item active
Avoids always marking a selected dropdown item as active. When the
dropdown item has attribute data-disableactive="true" the active
classes will not be applied to this element. This is sometimes requred,
especially in the primary/secondary navigation more dropdown menu when
the dropdown item is an action link which opens a new page. Setting
this item as active will falsely indicate that the user is currently on
this page.
2022-02-23 21:44:08 +08:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00