mirror of
https://github.com/moodle/moodle.git
synced 2025-04-05 08:23:01 +02:00
Merge branch 'MDL-64684-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
91425ec00d
@ -1326,6 +1326,9 @@ class page_requirements_manager {
|
||||
protected function get_amd_footercode() {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
|
||||
// We will cache JS if cachejs is not set, or it is true.
|
||||
$cachejs = !isset($CFG->cachejs) || $CFG->cachejs;
|
||||
$jsrev = $this->get_jsrev();
|
||||
|
||||
$jsloader = new moodle_url('/lib/javascript.php');
|
||||
@ -1341,15 +1344,21 @@ class page_requirements_manager {
|
||||
$jsextension = '';
|
||||
}
|
||||
|
||||
$minextension = '.min';
|
||||
if (!$cachejs) {
|
||||
$minextension = '';
|
||||
}
|
||||
|
||||
$requirejsconfig = str_replace('[BASEURL]', $requirejsloader, $requirejsconfig);
|
||||
$requirejsconfig = str_replace('[JSURL]', $jsloader, $requirejsconfig);
|
||||
$requirejsconfig = str_replace('[JSMIN]', $minextension, $requirejsconfig);
|
||||
$requirejsconfig = str_replace('[JSEXT]', $jsextension, $requirejsconfig);
|
||||
|
||||
$output .= html_writer::script($requirejsconfig);
|
||||
if ($CFG->debugdeveloper) {
|
||||
$output .= html_writer::script('', $this->js_fix_url('/lib/requirejs/require.js'));
|
||||
} else {
|
||||
if ($cachejs) {
|
||||
$output .= html_writer::script('', $this->js_fix_url('/lib/requirejs/require.min.js'));
|
||||
} else {
|
||||
$output .= html_writer::script('', $this->js_fix_url('/lib/requirejs/require.js'));
|
||||
}
|
||||
|
||||
// First include must be to a module with no dependencies, this prevents multiple requests.
|
||||
|
@ -6,8 +6,8 @@ var require = {
|
||||
waitSeconds : 0,
|
||||
|
||||
paths: {
|
||||
jquery: '[JSURL]lib/jquery/jquery-3.2.1.min[JSEXT]',
|
||||
jqueryui: '[JSURL]lib/jquery/ui-1.12.1/jquery-ui.min[JSEXT]',
|
||||
jquery: '[JSURL]lib/jquery/jquery-3.2.1[JSMIN][JSEXT]',
|
||||
jqueryui: '[JSURL]lib/jquery/ui-1.12.1/jquery-ui[JSMIN][JSEXT]',
|
||||
jqueryprivate: '[JSURL]lib/requirejs/jquery-private[JSEXT]'
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user