Commit Graph

630 Commits

Author SHA1 Message Date
Ilya Tregubov 843066ecf4 Merge branch 'MDL-72091-rebase-3' of https://github.com/Chocolate-lightning/moodle 2021-10-11 14:46:54 +07:00
Andrew Nicols 551371c710 Merge branch 'MDL-71834-master-v02' of git://github.com/ferranrecio/moodle 2021-10-11 14:06:23 +08:00
Mathew May dba47e8641 MDL-72091 Navigation: Update navigation to match designs 2021-10-11 12:20:34 +08:00
Andrew Nicols 0310b76642 MDL-71963 js: Address lint issues in integration 2021-10-05 23:18:50 +02:00
Andrew Nicols 89457e9acb Merge branch 'MDL-71963-master' of https://github.com/Chocolate-lightning/moodle 2021-10-05 23:18:50 +02:00
Mathew May 6dcb5eb8a5 MDL-71963 Core: Add toast for confirmation modal success 2021-10-04 13:08:44 +08:00
Andrew Nicols 529c5c2ece MDL-71963 Core: Convert block deletion to a modal
Co-authored-by: Mathew May <mathewm@hotmail.co.nz>
2021-10-04 13:07:31 +08:00
Andrew Nicols a8db8e590a MDL-72291 js: Fix event names for inplace_editable 2021-10-04 11:17:10 +08:00
Andrew Nicols c00e7b1bb8 Merge branch 'MDL-72291' of git://github.com/paulholden/moodle 2021-10-04 10:54:32 +08:00
Paul Holden 244d304b6e MDL-72291 output: emit native events from inplace editable element.
Removes jQuery dependency from calling code that wants to listen
for these events. Maintains backwards compatibility with existing
code that does want to listen to jQuery-style events.
2021-10-01 10:41:45 +01:00
Andrew Nicols f4604fe5fb Merge branch 'MDL-72544' of git://github.com/paulholden/moodle 2021-10-01 10:14:51 +08:00
Ilya Tregubov 34a0ba3232 Merge branch 'MDL-71610-master' of git://github.com/bmbrands/moodle 2021-09-29 15:40:39 +02:00
Ferran Recio 639a99014d MDL-71834 course: lock elements
Now components has a new property lock to disable all user interactions.
This is applied directly into the course index and course content to
freeze an element if some action is performed over it. To set this
locked value there are 2 new mutations cmLock and sectionLock.
2021-09-29 11:34:43 +02:00
Bas Brands 09f6ce9fed MDL-71610 theme_boost: add a edit mode switch 2021-09-29 09:25:36 +02:00
David Matamoros 5909d5b0ce MDL-71943 core: Dynamic (AJAX) tabs in Moodle LMS 2021-09-27 17:53:37 +02:00
Paul Holden e8d7817f7f MDL-72544 output: set default core/toast message type to information.
Update existing code to set type to warning as appropriate.
2021-09-24 08:19:54 +01:00
Ferran Recio 7659a18993 MDL-71228 course: sorting course on section state change 2021-09-09 11:16:10 +02:00
Ferran Recio 7f750dc01c MDL-71228 course: course index drag and drop 2021-09-09 11:16:10 +02:00
Jun Pataleta 4e75e73cb5 Merge branch 'primary_secondary_nav' of https://github.com/Chocolate-lightning/moodle 2021-08-25 10:42:57 +08:00
Mathew May c1130de5ff MDL-69588 accessibility: Address further review points 2021-08-24 11:56:02 +08:00
Mathew May 1f6bcd7eae MDL-69588 accessibility: Address review points 2021-08-23 17:47:24 +08:00
Bas Brands eed2498215 MDL-72032 core: Fix aria roles moremenu
- Part of: MDL-69588
2021-08-23 17:47:24 +08:00
Mihail Geshoski 7318b68b77 MDL-71683 navigation: Enable submenus within the user menu
- Part of: MDL-69588
Adds support for creating collapsible submenus within the user
menu dropdown.
2021-08-23 17:46:40 +08:00
Mihail Geshoski 1c017ad8fb MDL-71680 navigation: Update templates/js to force nodes into more menu
- Part of: MDL-69588
2021-08-23 17:46:39 +08:00
Bas Brands da67b468fa MDL-70208 theme_boost: frontend for primary navigation
- Part of: MDL-69588
2021-08-23 17:46:39 +08:00
Ferran Recio 804e138cb2 MDL-71209 core: reactive parent registration and updates
Now a reactive component could inherit the reactive instance from the
parent DOM element. This way components are more reusable. Apart, some
new state updates have been added. To the previous create, update and
delete, now the update message could provide also put and override,
making the state update message more REST alike and simplifying the
backend returns processing.
2021-08-20 16:49:06 +02:00
Andrew Nicols 530322e2ce MDL-69918 core: Update uses of legacy form change checker 2021-08-10 23:54:01 +08:00
Víctor Déniz 73a868c38d Merge branch 'MDL-72108-master' of git://github.com/andrewnicols/moodle 2021-07-21 19:25:54 +01:00
Andrew Nicols 36f21508fb MDL-72108 js: Fix incorrect jsdoc examples for core/ajax 2021-07-08 10:39:13 +08:00
Jun Pataleta 341578bfde MDL-61460 core: Create a copy to clipboard JS module
This works by adding event listeners for elements that contain
the 'copytoclipboard' "data-action" attribute through event delegation.
These trigger elements must also define a "data-clipboard-target"
attribute which contains the query selector for the target element
where text will be copied.

On success, a toast message is shown to the user that the text has
been copied to the clipboard. This success message can be customised
by passing a message string to the "data-clipboard-success-message"
attribute in the trigger element.

When the element's value or innerText cannot be found, a toast message
indicating that the text cannot be copied to the clipboard is shown.

The copy to clipboard functionality is primarily using the Clipboard API
but in the event that this is not available, e.g. the site is not
running on HTTPS, this falls back to the document.execCommand('copy')
approach of copying the text in the target container.

Special thanks to Andrew for improving this module with the event
delegation approach and improved fallback handling.

Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2021-07-08 09:50:34 +08:00
Tim Hunt 0bb2d16337 MDL-68003 session timeout warning: don't show in iframes 2021-06-29 16:58:06 +01:00
Andrew Nicols 4f422785c6 MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols 92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Andrew Nicols a9b0f4dafe Merge branch 'MDL-71134-master-v03' of git://github.com/ferranrecio/moodle 2021-06-14 11:52:35 +08:00
Ferran Recio b85cba317e MDL-71134 core: add new reactive modules
The new course creation for Moodle 4.0 requires to add
some leavel of reactivity to the frontend. Instead of
building a specific solution only for the course editor,
in this commit there's a generic solution that can be
used in other places in Moodle to implement single
state reactive components.
2021-06-07 12:27:06 +02: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
Andrew Nicols 743d17ff58 MDL-70990 core: Deprecate core/events::getLegacyEvents() 2021-05-26 10:49:01 +08:00
Andrew Nicols d4c6ac20c7 MDL-70990 core_filter: Add new native filterContentUpdated event
The legacy M.core.event.FILTER_CONTENT_UPDATED event has been replaced with a
new core_filter/events::filterContentUpdated native DOM event.

The new event can be triggered using the `notifyFilterContentUpdated`
function, and by providing with an Array containing the HTMLElements
that were updated, for example:

```
import {notifyFilterContentUpdated} from 'core_filter/events';

const someHandler = e => {
    // ...
    const nodeList = Array.from(document.querySelectorAll('div'));
    notifyFilterContentUpdated(nodeList);
};
```

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_filter/events';

const handler = e => {
    // The list of HTMLElements in an Array.
    e.detail.nodes;
};

document.addEventListener(eventTypes.filterContentUpdated, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
YUI event listener, or jQuery event listener are still called with the
same arguments.

This legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:47:15 +08:00
Andrew Nicols a44cee78f1 MDL-70990 core_editor: Replace EDITOR_CONTENT_RESTORED event
The legacy M.core.event.EDITOR_CONTENT_RESTORED event has been replaced
with a new core_editor/events::editorContentRestored native DOM event.

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_editor/events';

document.addEventListener(eventTypes.editorContentRestored, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
jQuery event is still called with the same arguments.

This legacy bridge will be removed after Moodle 4.3.
2021-05-26 10:47:03 +08: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
Andrew Nicols da8658e49a MDL-70990 core: Rewrite core/event as ES6 2021-05-26 10:45:21 +08:00
Jun Pataleta 97429f82b4 Merge branch 'MDL-71157-master' of git://github.com/sarjona/moodle 2021-05-20 12:30:15 +08:00
Andrew Nicols dfaa450621 MDL-71157 core: Pending JS in paged content bars 2021-05-19 09:30:15 +02:00
Dongsheng Cai ee58790e46 MDL-65203 template: tab should be quoted to produce valid json 2021-05-18 20:40:32 +10:00
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