9 Commits

Author SHA1 Message Date
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
Shamim Rezaie
f0f45c01b1 MDL-70072 core: Fix always displaying date in Gregorian 2020-11-06 19:21:17 +11:00
Jun Pataleta
e21252b309 MDL-68200 core: Support fixday/hour for core/user_date's get() method 2020-05-12 10:59:02 +10:00
Shamim Rezaie
127f69d3fe MDL-68200 core: Add calendartype param to user_date.loadDatesFromServer 2020-05-12 10:59:02 +10:00
Ryan Wyllie
195ea4480b MDL-62497 javascript: build AMD modules with new transpiler 2019-07-19 14:12:49 +08:00
Ryan Wyllie
119c0124c4 MDL-63044 javascript: add getUserMidnightForTimestamp to user_date 2018-09-27 13:09:23 +08:00
Dan Poltawski
50c277a5d8 MDL-57139 js: built 2017-06-01 14:54:40 +01:00
David Mudrák
f387058839 MDL-58698 js: Fix the detection of the moodle language
This is the same problem that we had in MDL-52486. When the language
pack with multiple underscores (such as "en_us_k12") is selected, the
html root element's "lang" attribute is set to

    <html lang="en-us-12" ...>

which we then map back to the Moodle lang code using the JS function
replace().

What was missed in MDL-52486 was that when replacing a value (and not a
regular expression), only the first instance of the value is replaced.
So the value "en_us-k12" was sent as the lang parameter for the
core_string, which is invalid PARAM_LANG value and the exception was
thrown.

In case of the user_date.js, there was no actual problem experienced and
probably there is none as the language code is used as a cache key
rather than a PARAM_LANG parameter. But we are changing it too for
consistency.
2017-04-26 18:47:10 +02:00
Ryan Wyllie
b61015cfcd MDL-57975 javascript: add user_date.js
Part of MDL-55611
2017-03-08 03:33:23 +00:00