121 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
76f5445451 MDL-74510 upgrade: add the 4.0.0 separation line to all upgrade scripts 2022-04-22 18:45:10 +02:00
Jun Pataleta
70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
Eloy Lafuente (stronk7)
c111717ffb Merge branch 'MDL-74042-master' of https://github.com/jleyva/moodle 2022-03-04 12:19:22 +01:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Jun Pataleta
a1044ab030 NOBUG: Fixed file access permissions 2022-03-03 17:51:53 +08:00
Jun Pataleta
96e5418134 NOBUG: Fixed SVG browser compatibility 2022-03-03 17:51:51 +08:00
Juan Leyva
c112780113 MDL-74042 vimeo: Support security hash for restricted videos 2022-03-01 13:32:34 +01:00
Huong Nguyen
9ea8fa37cc MDL-71714 Libraries: Upgrade VideoJS to 7.17.0 2022-02-28 09:26:33 +07: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
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Frederik Milling Pytlick
b9898a23a7 MDL-73046 media_html5video: Fixed .mov files
.mov files will now have the mimetype 'video/mp4' instead of 'video/quicktime'. (Only if the user's browser is chromium-based)
2021-12-22 18:33:12 +08:00
Mihail Geshoski
93b3bf6ed3 MDL-71912 media_videojs: Update behat tests 2021-11-09 11:24:08 +08:00
Víctor Déniz
f8cab39a04 Merge branch 'MDL-72607-master_fix_media_vimeo_url_parser' of https://github.com/praxisdigital/moodle 2021-10-21 23:29:41 +01:00
Eloy Lafuente (stronk7)
46fd268d3f NOBUG: Fixed file access permissions 2021-10-19 12:52:08 +02:00
Sam Møller
87d26b4743 MDL-72607 media_vimeo: Fix vimeo URL parser
Fix vimeo URL parser to support the new vimeo URL format with privacy
settings (the video with password or domain restricted setting).
For example "https://vimeo.com/123456789/2bffff0000" the plugin must
parse the URL "https://player.vimeo.com/video/123456789?h=2bffff0000"
to the iframe source to make it compatible with the new vimeo URL
format.
See more about vimeo video privacy settings at
https://vimeo.com/blog/post/video-privacy-explained/
2021-10-18 08:54:53 +02:00
Huong Nguyen
88c87a1ffa MDL-65943 media_videojs: add videojs-ogvjs plugin
VideoJS now support to play Ogg Vorbis/Opus/Theora and WebM VP8/VP9/AV1 video on:
 - Safari on Mac OS
 - Safari on iPhone OS
 - Safari on iPad OS
2021-10-17 21:52:05 +07:00
Sara Arjona
2a3527ccb0 MDL-72407 videojs: Remove videojs-flash and videojs-swf libraries
Apart from removing these libraries because the Flash Player was deprecated
in 2017 and officially discontinued on 31 December 2020, the rtmp and useflash
settings have been removed too (they make no sense anymore).
2021-10-04 09:31:25 +02:00
Bas Brands
16c726cde7 MDL-71610 core_behat: use new edit mode step in feature files 2021-09-29 09:25:36 +02:00
Sara Arjona
a0d3e32aa9 MDL-72042 media: Remove SWF media player
The Flash Player was deprecated in 2017 and officially discontinued
on 31 December 2020, so media_swf player has been completely
removed from Moodle core.
2021-09-17 10:39:17 +02:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +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
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Andrew Nicols
c10791cab9 Merge branch 'MDL-71169-master-execute' of git://github.com/mudrd8mz/moodle 2021-04-14 08:35:07 +08:00
Eloy Lafuente (stronk7)
003a47bd02 Merge branch 'MDL-71064' of git://github.com/paulholden/moodle 2021-04-12 17:32:24 +02:00
David Mudrák
22ecf2f9b8 MDL-71169 external: Do not explicitly specify the default methodname 2021-03-22 15:56:46 +01:00
Paul Holden
a2b0686773 MDL-71064 media_videojs: enable hotkeys support in player.
Hotkeys were enabled by default, except fullscreen (hotkey "f").
2021-03-15 22:32:35 +00:00
Eloy Lafuente (stronk7)
713722c3fb MDL-71036 phpunit: Coding style changes, 99% whitespace only
I've gone over a few of the mofified files (those
which were showing warnings and errors to CiBoT. Some of them
have been fixed completely, while others only have fixed
for the lines belonging to this issue (lib/tests/moodlelib_test.php)
for example.
2021-03-11 23:04:32 +01:00
Eloy Lafuente (stronk7)
ba5b6089d5 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 19:22:24 +01:00
Sara Arjona
7fde34ad55 Merge branch 'MDL-70535' of git://github.com/paulholden/moodle 2021-02-03 11:19:14 +01:00
Paul Holden
c8ed6413f7 MDL-58673 media_videojs: enable playback rates in player. 2021-01-15 14:06:30 +00:00
Paul Holden
c4c5eb9ace MDL-70535 media_videojs: fallback to English language video player.
When current language doesn't have accompanying videojs language file
we should fallback to displaying the player in English, otherwise the
web service returns empty and a Javascript exception is triggered.
2021-01-15 13:51:13 +00:00
Sara Arjona
f1333db578 NOBUG: Fixed file access permissions 2021-01-15 08:25:37 +01:00
Sara Arjona
c2f91dc03a NOBUG: Fixed SVG browser compatibility 2021-01-15 08:25:35 +01:00
Ferran Recio
6f8a3bc181 MDL-70308 libraries: upgrade videojs to 7.10.0 2020-12-23 11:04:17 +01:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Andrew Nicols
5f581ce9eb MDL-57682 mediaplayer_videojs: Improve in-page caching of lang strings 2020-09-09 15:36:46 +08:00
Andrew Nicols
36f90b454c MDL-57682 mediaplayer_videojs: Login not required for lang fetch 2020-09-09 15:14:09 +08:00
Shamim Rezaie
f10ba30bbd MDL-57682 media_videojs: Cache videojs languages in the localstorage 2020-09-04 18:49:28 +10:00
Shamim Rezaie
375ca114e2 MDL-57682 media_videojs: webservice to get the language pack of videojs 2020-09-04 18:39:12 +10:00
Shamim Rezaie
e11cf31d53 MDL-57682 media_videojs: convert videojs loader to es6 2020-09-04 18:39:12 +10:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02: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
Eloy Lafuente (stronk7)
635ea71fb0 NOBUG: Fixed file access permissions 2020-05-08 13:32:22 +02:00
Eloy Lafuente (stronk7)
c6b75af51b NOBUG: Fixed SVG browser compatibility 2020-05-08 13:32:20 +02:00
Andrew Nicols
1ad79ecb18 Merge branch 'MDL-67383-master-1' of git://github.com/mihailges/moodle 2020-05-06 11:06:10 +08:00
Mihail Geshoski
5aca440471 MDL-67383 media_videojs: Update VideoJS versions in Moodle related files 2020-05-06 11:06:08 +08:00
Mihail Geshoski
9632fde77f MDL-67383 media_videojs: Upgrade VideoJS and plugins to latest version
Upgrade VideoJS (7.7.6), Youtube Playback for VideoJS (2.6.1), Flash Tech for VideoJS (2.2.1), Flash Player for VideoJS (5.4.2)
2020-05-06 11:06:08 +08:00