141 Commits

Author SHA1 Message Date
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
Shamim Rezaie
379f15f3b4 MDL-71818 calendar: Fix detection of a click on day link 2021-12-29 19:02:55 +11:00
Dongsheng Cai
41587ffb43 MDL-71818 core_calendar: fix accessibility issues 2021-12-13 00:19:05 +11:00
Dongsheng Cai
cffefca11c MDL-72237 core_calendar: limit number of day events on calenar view 2021-12-03 16:21:30 +11:00
Michael Hawkins
0d644fe4e0 MDL-72810 core_calendar: Remove the three-month pseudo block
This removes the three-month pseudo block from along the side of the
main calendar, and deprecates relevant files/methods which will no
longer be in use.
2021-11-19 18:33:46 +08:00
Eloy Lafuente (stronk7)
6863a92722 Merge branch 'MDL-72013-master-int' of git://github.com/andrewnicols/moodle 2021-10-21 09:25:58 +02:00
Andrew Nicols
349312143d MDL-72013 js: Fix jsdocs to meet stricter eslint 2021-10-21 13:28:00 +08:00
Huong Nguyen
bca6b06a1c MDL-71953 calendar: Accessibility improvement for manage subscription
- Create new web services for manage subscription (Update calendar subscription)
 - Modified delete subscription feature to use Web service.
 - Midified update subscription feature to use in-place editbale
 - Delete subscription feature now have a confirmation box before processing.
 - Fixed some accessibility issues
 - Used 'Delete' instead of 'Remove' for deleting subscriptions
2021-10-21 11:02:34 +07:00
Huong Nguyen
0328241373 MDL-71810 calendar: responsiveness for calendar block
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>>
2021-10-15 10:24:34 +07:00
Eloy Lafuente (stronk7)
962b7f56a8 Merge branch 'MDL-71500-master' of git://github.com/lameze/moodle 2021-08-11 20:10:40 +02:00
Jun Pataleta
8a2c797cc0 MDL-71817 calendar: Set the calendar view mode properly for month view
* Store the view mode of the calendar in the calendar_information
   object.
 * Let the month exporter handle the production of context data by
   moving 'viewingmonth', 'showviewselector', and 'viewinginblock'
   inside it.
 * Set the proper calendar view mode in the core_calendar/month_detailed
   template.
 * Pass the calendar view mode to the
   core_calendar_get_calendar_monthly_view WS function.
2021-07-22 09:04:44 +08:00
Simey Lameze
f0897dce80 MDL-71817 calendar: clicking on day link should redirect to day view
This patch prevents the full day view to be loaded
in the calendar block as this won't be supported.
When clicking in the day link it will redirect the
user to day view in the full calendar.
2021-07-22 08:46:01 +08:00
Simey Lameze
98612827b0 MDL-71817 calendar: only update url on full view
This patch prevents the URL from being updated on the calendar
block. It only updates the url if viewing the full calendar.
2021-07-22 08:46:01 +08:00
Simey Lameze
d2f612ab24 MDL-71817 block_calendar_month: load month view in the block 2021-07-22 08:46:01 +08:00
boygr49p
15e311a1fd MDL-71500 calendar_threemonth: clicking in a diff day should refresh day view
Clicking in a day in the three month block replaces the div with id starting
with calendar- so we can do so repeatedly and successfully and test that it does (with behat).
2021-07-16 14:46:40 +08:00
Jun Pataleta
a067fc1df1 MDL-71788 calendar: Remove ready state listener
Adding a document ready state change listener might be too late by the
time this AMD module gets loaded. So there's really no point listening
for it. It's better to enable the Copy URL button by the time this
the calendar export module gets loaded since at this point, the
copy to clipboard JS module would have been loaded as well.
2021-07-15 14:55:16 +08:00
Jun Pataleta
5c70150450 MDL-71788 calendar: Make it easier to copy the calendar URL
Converted the Calendar URL string to a read-only text input containing
the calendar URL. Pressing the "Copy URL" button will copy the calendar
URL to the clipboard.
Fixed Behat tests as well for the export feature. With the calendar URL
in a text input that clips the whole URL, the `preset_what` URL
parameter cannot be seen by the "I should see" step. Worked around
this by checking that the actual value attribute of the calendar URL
text input contains the preset_what parameter.

Plus: Deprecate the calendarurl string. It will be replaced by a new
lang string that does not contain the actual calendar URL.
2021-07-08 12:33:55 +08: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
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
94711c151d MDL-69135 core_calendar: PendingJS for event filtering 2020-06-26 07:58:36 +08:00
Shamim Rezaie
3b3269ee1d MDL-67828 calendar: Fix the js error in IE11 2020-05-27 02:36:55 +10:00
Marina Glancy
d268c5bac3 MDL-58866 core_calendar: separate color for other events, icons 2020-05-19 19:04:15 +02:00
Marina Glancy
1a972b06f1 MDL-58866 core_calendar: allow component events 2020-05-19 19:04:13 +02:00
Andrew Nicols
88f1a81bd6 MDL-68728 calendar: Pending promises for event summary 2020-05-18 13:00:32 +08:00
Andrew Nicols
15d02a3045 MDL-68728 calendar: Remove calendar modal on close 2020-05-18 13:00:30 +08:00
Andrew Nicols
f879cc518e MDL-66109 js: Build changes for NodeJS upgrade
This change includes a build to fix all minified file changes in Moodle
as a result of upgrades to our build process.
2020-05-11 10:55:54 +08:00
Andrew Nicols
47d094817f MDL-68409 behat: Fix tests from modal rewrite 2020-05-04 15:08:11 +08:00
Sara Arjona
e6ef9d3236 MDL-67910 behat: PendingJS improvements for deleteevent modal 2020-03-31 08:40:03 +02:00
Shamim Rezaie
ac0ae31953 MDL-67902 calendar: informative aria label for event days in mini cals 2020-02-25 03:38:35 +11:00
Andrew Nicols
fd58e6dc62 MDL-67152 calendar: Documentation fix 2019-12-10 08:19:12 +08:00
Shamim Rezaie
0ab57f8128 MDL-67152 calendar: Rewrite core_calendar/view_manager using ES6 syntax 2019-12-10 06:46:38 +11:00
Shamim Rezaie
eaa0439eca MDL-67152 calendar: Rewrite core_calendar/repository using ES6 syntax 2019-12-09 23:24:57 +11:00
Shamim Rezaie
f046b70355 MDL-67152 calendar: The day view should start from the current day 2019-12-09 22:37:21 +11:00
Paul Holden
dcab750551 MDL-67140 calendar: fix selector switching between days. 2019-11-05 16:41:12 +00:00
David Matamoros
21ad9531d0 MDL-66354 core_calendar: Notices in error.log on calendar events 2019-09-25 09:08:41 +02:00
Ryan Wyllie
195ea4480b MDL-62497 javascript: build AMD modules with new transpiler 2019-07-19 14:12:49 +08:00
Andrew Nicols
444f85aaa9 MDL-66158 calendar: Events should be space separated not an array 2019-07-16 09:46:02 +08:00
Simey Lameze
e5ab472810 MDL-65671 calendar: add event listener to three month block 2019-06-12 15:54:25 +08:00
Simey Lameze
859bc931d8 MDL-65671 calendar: remove course selector label from exporters 2019-06-12 15:54:24 +08:00
Simey Lameze
4cc9d7c83a MDL-65671 calendar: add listener to day link in month view 2019-06-12 15:54:12 +08:00
Simey Lameze
dbccdae8f5 MDL-65671 calendar: add the calendar view selector 2019-06-10 13:09:57 +08:00
Jun Pataleta
ab709ed274 MDL-65318 core_calendar: Additional fixes
* Move 'calendareventtype' property to event_exporter_base and
  rename it to 'normalisedeventtype'
* Add a 'normalisedeventtypetext' property to event_exporter_base
  for displaying the human-friendly text for the normalised
  event type.
* Clean up calendareventtype from other exporter/template locations
* Fix template names.
2019-05-02 14:19:28 +08:00
Damyon Wiese
260565e305 MDL-64573 output: ajax form event
Add an event that can be fired when an mform is about to be submitted via ajax.
This allows custom field types to perform an action when the form is submitted.

The atto text editor will reset any autosaves when the form is submitted.
2019-04-24 16:17:49 +08:00
Simey Lameze
dfc609e55d MDL-60826 calendar: lazy load groups on event form 2018-07-24 07:58:34 +08:00
Ryan Wyllie
60908b2187 MDL-60967 calendar: only load course filter when required 2018-01-09 05:57:38 +00:00
Jun Pataleta
60236650d6 Merge branch 'MDL-60962-master' of git://github.com/ryanwyllie/moodle 2018-01-03 16:53:49 +08:00
Simey Lameze
39cda40590 MDL-61055 calendar: guest user cannot create events 2017-12-19 16:30:08 +08:00