mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-62497 javascript: add babel polyfill for es6 support
This commit is contained in:
parent
8d9614b341
commit
67b2262938
@ -61,6 +61,7 @@ lib/validateurlsyntax.php
|
||||
lib/amd/src/popper.js
|
||||
lib/geopattern-php/
|
||||
lib/php-jwt/
|
||||
lib/babel-polyfill/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
@ -81,4 +82,4 @@ theme/boost/amd/src/tab.js
|
||||
theme/boost/amd/src/tooltip.js
|
||||
theme/boost/amd/src/util.js
|
||||
theme/boost/amd/src/tether.js
|
||||
theme/boost/scss/fontawesome/
|
||||
theme/boost/scss/fontawesome/
|
||||
|
@ -62,6 +62,7 @@ lib/validateurlsyntax.php
|
||||
lib/amd/src/popper.js
|
||||
lib/geopattern-php/
|
||||
lib/php-jwt/
|
||||
lib/babel-polyfill/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
@ -82,4 +83,4 @@ theme/boost/amd/src/tab.js
|
||||
theme/boost/amd/src/tooltip.js
|
||||
theme/boost/amd/src/util.js
|
||||
theme/boost/amd/src/tether.js
|
||||
theme/boost/scss/fontawesome/
|
||||
theme/boost/scss/fontawesome/
|
||||
|
6953
lib/babel-polyfill/polyfill.js
Normal file
6953
lib/babel-polyfill/polyfill.js
Normal file
File diff suppressed because it is too large
Load Diff
4
lib/babel-polyfill/polyfill.min.js
vendored
Normal file
4
lib/babel-polyfill/polyfill.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
lib/babel-polyfill/readme_moodle.txt
Normal file
6
lib/babel-polyfill/readme_moodle.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Installation instructions can be found at https://babeljs.io/docs/en/babel-polyfill.html#usage-in-browser
|
||||
|
||||
The steps are essentially:
|
||||
1.) npm install @babel/polyfill
|
||||
2.) copy polyfill.js and polyfill.min.js from the "dist" folder from the npm release into lib/babel-polyfill/
|
||||
3.) npm uninstall --save @babel/polyfill (don't want to include that with Moodle package.json)
|
@ -1569,9 +1569,19 @@ class page_requirements_manager {
|
||||
* @return string the HTML code to go at the start of the <body> tag.
|
||||
*/
|
||||
public function get_top_of_body_code(renderer_base $renderer) {
|
||||
global $CFG;
|
||||
|
||||
// First the skip links.
|
||||
$output = $renderer->render_skip_links($this->skiplinks);
|
||||
|
||||
// The polyfill needs to load before the other JavaScript in order to make sure
|
||||
// that we have access to the functions it provides.
|
||||
if (empty($CFG->cachejs)) {
|
||||
$output .= html_writer::script('', $this->js_fix_url('/lib/babel-polyfill/polyfill.js'));
|
||||
} else {
|
||||
$output .= html_writer::script('', $this->js_fix_url('/lib/babel-polyfill/polyfill.min.js'));
|
||||
}
|
||||
|
||||
// YUI3 JS needs to be loaded early in the body. It should be cached well by the browser.
|
||||
$output .= $this->get_yui3lib_headcode();
|
||||
|
||||
|
@ -302,4 +302,10 @@
|
||||
<version>5.0.0</version>
|
||||
<licenseversion>3-Clause</licenseversion>
|
||||
</library>
|
||||
<library>
|
||||
<location>babel-polyfill</location>
|
||||
<name>babel-polyfill</name>
|
||||
<license>MIT</license>
|
||||
<version>6.26.0</version>
|
||||
</library>
|
||||
</libraries>
|
||||
|
Loading…
x
Reference in New Issue
Block a user