MDL-43105 JavaScript: Use the correct versions of our rollups

This commit is contained in:
Andrew Nicols 2013-11-28 11:49:12 +08:00
parent f7434db109
commit 104d698ffd
2 changed files with 20 additions and 8 deletions

View file

@ -1249,14 +1249,25 @@ class page_requirements_manager {
$code = '';
$jsrev = $this->get_jsrev();
$yuiformat = '-min';
if ($this->yui3loader->filter === 'RAW') {
$yuiformat = '';
}
$format = '-min';
if ($this->YUI_config->groups['moodle']['filter'] === 'DEBUG') {
$format = '-debug';
}
$baserollups = array(
'rollup/' . $CFG->yui3version . '/yui-moodlesimple-min.js',
'rollup/' . $CFG->yui3version . '/yui-moodlesimple' . $yuiformat . '.js',
);
// The reason for separate rollups is that the Y = YUI().use('*') call is run async and
// it gets it's knickers in a twist. Putting it in a separate <script>
// to the moodle rollup means that it's completed before the moodle one starts.
$moodlerollups = array(
'rollup/' . $jsrev . '/mcore-min.js',
'rollup/' . $jsrev . '/mcore' . $format . '.js',
);
if ($this->yui3loader->combine) {
@ -1290,10 +1301,8 @@ class page_requirements_manager {
if ($this->yui3loader->filter === 'RAW') {
$code = str_replace('-min.css', '.css', $code);
$code = str_replace('-min.js', '.js', $code);
} else if ($this->yui3loader->filter === 'DEBUG') {
$code = str_replace('-min.css', '.css', $code);
$code = str_replace('-min.js', '-debug.js', $code);
}
return $code;
}