MDL-65700 javascript: Add url-polyfill.

This commit is contained in:
Mikhail Golenkov 2020-04-07 20:54:46 +10:00
parent 1d4fdb0d1c
commit 3180869e19
8 changed files with 29 additions and 18 deletions

View File

@ -62,7 +62,7 @@ lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/babel-polyfill/
lib/mdn-polyfills/
lib/polyfills/
lib/emoji-data/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js

View File

@ -63,7 +63,7 @@ lib/amd/src/popper.js
lib/geopattern-php/
lib/php-jwt/
lib/babel-polyfill/
lib/mdn-polyfills/
lib/polyfills/
lib/emoji-data/
media/player/videojs/amd/src/video-lazy.js
media/player/videojs/amd/src/Youtube-lazy.js

View File

@ -1,13 +0,0 @@
The steps are essentially:
1) Install mdn-polyfills package
npm install --no-save mdn-polyfills
2) Join them all together:
cd node_modules/mdn-polyfills
cat CustomEvent.* Element.* Function.* HTMLCanvasElement.* MouseEvent.* Node.prototype.* NodeList.* > ../../lib/mdn-polyfills/polyfill.js
3) Uninstall the package again
npm uninstall --no-save mdn-polyfills

View File

@ -1608,8 +1608,8 @@ class page_requirements_manager {
$output .= html_writer::script('', $this->js_fix_url('/lib/babel-polyfill/polyfill.min.js'));
}
// Include the MDN Polyfill.
$output .= html_writer::script('', $this->js_fix_url('/lib/mdn-polyfills/polyfill.js'));
// Include the Polyfills.
$output .= html_writer::script('', $this->js_fix_url('/lib/polyfills/polyfill.js'));
// YUI3 JS needs to be loaded early in the body. It should be cached well by the browser.
$output .= $this->get_yui3lib_headcode();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
The steps are essentially:
1) Install mdn-polyfills and url-polyfill packages
npm install --no-save mdn-polyfills url-polyfill
2) Join them all together:
cd node_modules/mdn-polyfills
cat CustomEvent.* Element.* Function.* HTMLCanvasElement.* MouseEvent.* Node.prototype.* NodeList.* > ../../lib/polyfills/polyfill.js
cd ../url-polyfill/
cat url-polyfill.min.js >> ../../lib/polyfills/polyfill.js
3) Uninstall the packages again
npm uninstall --no-save mdn-polyfills url-polyfill

View File

@ -309,7 +309,7 @@
<version>7.7.0</version>
</library>
<library>
<location>mdn-polyfills</location>
<location>polyfills</location>
<name>mdn-polyfill</name>
<license>MIT</license>
<version>5.19.0</version>
@ -320,4 +320,10 @@
<license>MIT</license>
<version>4.1.0</version>
</library>
<library>
<location>polyfills</location>
<name>url-polyfill</name>
<license>MIT</license>
<version>1.1.8</version>
</library>
</libraries>

View File

@ -36,6 +36,8 @@ information provided here is intended especially for developers.
* grade_item::update_final_grade() can now take an optional parameter to set the grade->timemodified. If not present the current time will carry on being used.
* lib/outputrequirementslib::get_jsrev now is public, it can be called from other classes.
* H5P libraries have been moved from /lib/h5p to h5p/h5plib as an h5plib plugintype.
* mdn-polyfills has been renamed to polyfills. The reason there is no polyfill from the MDN is
because there is no example polyfills on the MDN for this functionality.
=== 3.8 ===
* Add CLI option to notify all cron tasks to stop: admin/cli/cron.php --stop