777 Commits

Author SHA1 Message Date
Andrew Nicols
f57af194fb
MDL-78316 core: Update async promises
Writing a Promise as:
```
const promise = new Promise(async (resolve, reject) => {
  return await 'foo';
});
```

Is equivalent to an IIFE:
```
const promise = (async () => {
  return await 'foo';
})();
```

A recent change introduced by MDL-74301 picks this up.

This commit addresses this flagged issue.
2023-07-07 16:23:26 +08:00
Andrew Nicols
5b54ac43b1
MDL-78316 core: Move IconSystem init to Factory
This is throwback to times when we understood JS less.

We should not have the factory method for the IconSystem in
core/templates.
2023-07-07 16:13:28 +08:00
Andrew Nicols
c0043004e1
MDL-78316 core: Convert IconSystems to ESM 2023-07-07 16:13:27 +08:00
Ilya Tregubov
048edee1e2
Merge branch 'MDL-74301-master' of https://github.com/kabalin/moodle 2023-07-06 09:06:31 +08:00
Huong Nguyen
54d470c313
Merge branch 'MDL-77732-master' of https://github.com/lameze/moodle 2023-07-04 17:10:26 +07:00
Stephan Robotta
1468ecf294
MDL-77732 navigation: fix active flag in navigation for custom menus
This is a follow up of MDL-75908 because a Behat tests with the Chrome
driver was failing and it could be traced back to the changes of
MDL-750908. There was no issue with the Firefox driver and
apparently no issue when using the Chrome browser under normal
circumstances.
2023-07-04 17:10:15 +07:00
Stephan Robotta
a617b9f6d7
MDL-77732 navigation: fix active flag in navigation for custom menus 2023-07-04 17:09:59 +07:00
Ruslan Kabalin
572ca40ce7 MDL-74301 eslint: Enable 'reportUnusedDisableDirectives' eslint setting
This will warn on unused /* eslint-disable */ statements.
2023-07-03 15:21:53 +01:00
Ruslan Kabalin
80a111d25e MDL-74301 eslint: Address issues reported by eslint 2023-07-03 15:21:53 +01:00
Mikel Martín
fb49de8875 MDL-78204 core: Add new showmore/showless UI component
- Create a new 'showmore' template that receives both collapsed and expanded content.
Initially only the collapsed content will be displayed with a "Show more" button. When it is expanded,
only the expanded content will be displayed with "Show less" button.

- Add 'showmore' component to component library
2023-06-26 09:32:39 +02:00
Andrew Nicols
0dfcb91ca2 Merge branch 'MDL-78350' of https://github.com/paulholden/moodle 2023-06-22 14:29:40 +02:00
Paul Holden
40cc1e53c2
MDL-78350 output: parse returned dynamic tab javascript when loading.
Ensure we don't create nested <script> tags when rendering templates,
which triggers console errors since 1ef815cd.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-06-21 17:25:34 +01:00
Mathew May
0fb1152345 MDL-78274 modal: Enable modals to be vertically centered 2023-06-21 14:51:26 +08:00
Andrew Nicols
9ce8a9e637
MDL-78306 core: Correct modal jsdoc 2023-06-14 21:52:55 +08:00
Andrew Nicols
af604082df
MDL-78306 core: Migrate core/config to ESM 2023-06-14 21:52:55 +08:00
Andrew Nicols
80780f755a
MDL-78306 core: Convert modal_backdrop to ESM 2023-06-14 21:52:55 +08:00
Andrew Nicols
a571b7c8bf
MDL-78306 core: Convert modal_events to ESM 2023-06-14 21:52:55 +08:00
Andrew Nicols
c6c871e2ce
MDL-78306 core: Convert modal_factory to ESM 2023-06-14 21:52:54 +08:00
Andrew Nicols
77b4d0236f
MDL-78306 core: Provide helper method to register modals classes 2023-06-14 21:41:49 +08:00
Andrew Nicols
fcb6fdf393
MDL-78306 core: Convert core/modal to ESM 2023-06-14 21:41:49 +08:00
Ilya Tregubov
59cd47c02f
Merge branch 'MDL-62859' of https://github.com/paulholden/moodle 2023-06-01 10:12:14 +08:00
Ilya Tregubov
accddabca3
Merge branch 'MDL-77168-master' of https://github.com/andrewnicols/moodle 2023-05-31 10:22:02 +08:00
Andrew Nicols
18dc795907
MDL-78266 core: Simplify string fetching/storing/retrieval
Rather than storing strings by an ID, we instead store them by the
string placeholder value.

This means that:
- we can fetch them by placeholder (e.g. `[[_s144]]`) rather than by
  index
- we can lazily clean them on fetch
- we only clean them once, rather than on every insertion.
2023-05-25 13:42:15 +08:00
Andrew Nicols
a438e2c72d
MDL-78266 core: Simplify string treatment in core/templates
The old handling was extremely convoluted, and likely inefficient.

It's much clearer to use a regex with named groups and loop through in a
standard way.
2023-05-25 13:42:08 +08:00
Andrew Nicols
1ef815cd97
MDL-78266 core: Break apart core/templates
This commit breaks apart the responsibilities of the core/templates
module to separate out the different constituent parts. Broadly speaking
these are:
- core/local/templates/loader - responsible for fetching, and caching,
  of templates
- core/local/templates/renderer - A Moodle wrapper around the Mustache
  engine
2023-05-25 13:42:00 +08:00
Andrew Nicols
16dee82ce5
MDL-78266 core: Migrate core/templates to esm 2023-05-25 12:09:46 +08:00
Paul Holden
c5d1f72dca
MDL-62859 javascript: replace user preference calls with new methods. 2023-05-22 13:51:39 +01:00
Andrew Nicols
2078efeca9
MDL-77168 core: Allow core/utility alerts to submit forms 2023-05-12 15:21:20 +08:00
Michael Hawkins
2e024f304a MDL-75316 core: MoodleNet integration final improvements 2023-04-18 17:00:54 +08:00
Huong Nguyen
58ced4add0 MDL-75316 core_moodlenet: Share to MoodleNet modal and activity menu
Originally implemented as MDL-75785
2023-04-18 17:05:07 +08:00
Marina Glancy
04f8fdd021 MDL-77164 various: fix javascript AMD module name 2023-04-13 09:43:15 +01:00
Marina Glancy
a507a9e68a MDL-74465 blocks: changes for backward-compatibility 2023-03-30 12:15:55 +01:00
Marina Glancy
6b081d2e9f MDL-74465 blocks: allow configuration in modal
Introduce 'pagehash' - an identifier that uniquely identifies a page for the user session
2023-03-30 12:15:54 +01:00
Simey Lameze
61f4843fed MDL-77721 navigation: Revert the patch for MDL-75908.
This reverts commit 7b8fa9de865aa7a22eeb25d00fd92d28222a3b71.
2023-03-23 15:45:11 +08:00
Ilya Tregubov
cc35edd595 Merge branch 'MDL-76914-master' of https://github.com/meirzamoodle/moodle 2023-03-17 13:04:35 +01:00
Stephan Robotta
7b8fa9de86 MDL-75908 navigation: fix active flag in navigation for custom menus 2023-03-15 11:16:44 +01:00
Meirza
170561ee94 MDL-76914 libraries: upgrade Chart.js to 4.2.1 2023-03-13 08:53:26 +07:00
Jake Dallimore
3f8994c07d Merge branch 'MDL-77517-master' of https://github.com/juancs/moodle 2023-03-10 11:38:11 +08:00
Jun Pataleta
8441270181 Merge branch 'MDL-77559-master-2' of https://github.com/andrewnicols/moodle 2023-03-09 16:02:01 +08:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Ferran Recio
5e445c0e3a MDL-77420 core: fix modal close button on remove on close 2023-03-07 13:13:44 +01:00
Juan Segarra Montesinos
35c2161472 MDL-77517 js: Disable "Edit mode" button when clicked
When clicked, disable the "Edit mode" button just before doing a
redirection. It's been reported that after clicling several times the
button, an inconsistent state between the button and the editing mode is
achieved. The patch mitigates the issue.
2023-03-05 06:40:49 +01:00
Jun Pataleta
916503658d Merge branch 'MDL-75012-master-5' of https://github.com/andrewnicols/moodle 2023-03-02 12:34:34 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Andrew Nicols
31aed9a211 Merge branch 'MDL-74585' of https://github.com/paulholden/moodle 2023-03-01 10:51:26 +08:00
Paul Holden
922c61dee8 MDL-74585 core: pass string identifier/component to network keepalive.
Avoid passing potentially large amounts of data in the page AMD call,
allow the `core/network` module to load actual string content itself.
2023-02-22 13:49:30 +00:00
Ilya Tregubov
4145046020 Merge branch 'MDL-76848-master' of https://github.com/ferranrecio/moodle 2023-02-21 17:36:32 +08:00
Ferran Recio
4f7d5541c4 MDL-76545 core: fix reactive debug panel
The reactive debug panel stops working when a new reactive instance is
created in the fly. This was not detected until the new dragf and drop
files into course uses a second reactive UI component in the same page.
2023-02-20 09:01:57 +01:00
Ferran Recio
b1ad8480fe MDL-76848 core: add disable buttons to modals 2023-02-17 10:07:32 +01:00
Andrew Nicols
d56df7c204 Merge branch 'MDL-76912' of https://github.com/paulholden/moodle 2023-02-09 09:37:00 +08:00