18 Commits

Author SHA1 Message Date
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
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
Ferran Recio
461226ed27 MDL-72569 core_courseformat: aria-tree to move tool 2021-11-02 16:00:12 +01:00
Dongsheng Cai
e3690a392d MDL-70846 accessibility: update tree attributes to pass a11y check
- Move aria-* atrributes from <p> to <li>
- Move "role" attribute from <p> to <li>
- Update behat tests

Based on reference implementation from:
- https://www.w3.org/TR/wai-aria-practices-1.1/examples/treeview/treeview-2/treeview-2a.html
- https://www.w3.org/WAI/GL/wiki/Using_ARIA_trees
2021-06-03 13:52:04 +10:00
Paul Holden
be48efc9b7 MDL-70580 core: retrieve closest tree node in click handler. 2021-01-12 20:11:25 +00:00
Andrew Nicols
d0bc893972 MDL-70580 core: Tree nodes should check if they were clicked directly 2021-01-11 23:42:03 +00: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
Michael Hawkins
2660d542c8 MDL-69559 core: Removed stopPropagation from tree click handling
It was preventing JS click event handlers being reached on some
elements, such as course admin items in Classic
(eg download course content for teachers).
2020-10-27 07:52:43 +08:00
Andrew Nicols
7cc18dc2ad MDL-68390 js: Update to use Aria mod 2020-07-15 14:40:49 +08:00
Ryan Wyllie
195ea4480b MDL-62497 javascript: build AMD modules with new transpiler 2019-07-19 14:12:49 +08:00
Adrian Greeve
ff40c7d374 MDL-62491 navigation: Update to tree.js to allow callbacks. 2018-10-08 09:00:08 +08:00
Dan Poltawski
9b62a3eb71 MDL-55048 js: rebuilt files with new version of uglifyjs 2016-07-11 15:53:10 +01:00
Cameron Ball
4838a19641 MDL-53311 navigation: Move treeitem role on to p
Previously the li elements had the treeitem role, which was not invalid,
but it meant that when a menu item expanded, the entire li was clickable
and clicking anywhere that was not another menu item would cause the
(sub)tree to collapse. This patch moves the treeitem role on to the p
element (which contains the node name) and uses aria-owns to expand

Mad shoutouts to Ryan Wyllie for his assistance 🙌

🌄 ᚳᚱᛒ
2016-05-13 16:01:44 +08:00
Ryan Wyllie
fd83879728 MDL-53989 cbe: CMD + click selection for competency picker 2016-05-06 04:40:02 +00:00
David Monllao
ed654d4aa8 MDL-35590 block_navigation: Set attribute on node creation
Otherwise we would need to unescape href and title.
2016-01-29 13:01:26 +08:00
Ryan Wyllie
5697de1832 MDL-35590 block_navigation: fix keyboard nav
Fixed up the left/right keyboard navigation to match
the aria specification. Also stopped the root node from
being collapsible.
2016-01-29 10:15:26 +08:00
Simey Lameze
6759dc35fe MDL-35590 block_navigation: fix remaining issues 2016-01-22 18:48:04 +08:00