MDL-41878 JavaScript: Add an alias for Moodle in the YUI loader

This commit is contained in:
Andrew Nicols
2013-10-01 10:51:40 +08:00
parent d45e65ccad
commit 03e36e7077
3 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -219,11 +219,11 @@ class page_requirements_manager {
$configname = $this->YUI_config->set_config_source('lib/yui/config/moodle.js');
$this->YUI_config->add_group('moodle', array(
'name' => 'moodle',
'base' => $CFG->httpswwwroot . '/theme/yui_combo.php'.$sep.'moodle/'.$jsrev.'/',
'base' => $CFG->httpswwwroot . '/theme/yui_combo.php' . $sep . 'm/' . $jsrev . '/',
'combine' => $this->yui3loader->combine,
'comboBase' => $CFG->httpswwwroot . '/theme/yui_combo.php'.$sep,
'ext' => false,
'root' => 'moodle/'.$jsrev.'/', // Add the rev to the root path so that we can control caching.
'root' => 'm/'.$jsrev.'/', // Add the rev to the root path so that we can control caching.
'patterns' => array(
'moodle-' => array(
'group' => 'moodle',
+3
View File
@@ -81,6 +81,9 @@ foreach ($parts as $part) {
}
//debug($bits);
$version = array_shift($bits);
if ($version === 'm') {
$version = 'moodle';
}
if ($version === 'moodle') {
if (count($bits) <= 3) {
// This is an invalid module load attempt.
+3
View File
@@ -40,6 +40,9 @@ if ($slashargument = min_get_slash_argument()) {
$etag = sha1($path);
$parts = explode('/', $path);
$version = array_shift($parts);
if ($version === 'm') {
$version = 'moodle';
}
if ($version == 'moodle' && count($parts) >= 3) {
$frankenstyle = array_shift($parts);
$module = array_shift($parts);