Commit cb7bfa34 authored by Nigel McNie's avatar Nigel McNie
Browse files

Include various helper js and css files if developermode is on. Also, include...

Include various helper js and css files if developermode is on. Also, include the packed MochiKit file if developermode is NOT on, to speed things up quite a bit
parent 60df1327
......@@ -106,7 +106,12 @@ EOF;
}
}
$javascript_array[] = $jsroot . 'MochiKit/setup.js';
if (get_config('developermode')) {
$javascript_array[] = $jsroot . 'MochiKit/MochiKit.js';
}
else {
$javascript_array[] = $jsroot . 'MochiKit/Packed.js';
}
$javascript_array[] = $jsroot . 'keyboardNavigation.js';
$strings = array();
......@@ -182,7 +187,12 @@ EOF;
}
$javascript_array[] = $jsroot . 'mahara.js';
$javascript_array[] = $jsroot . 'debug.js';
if (get_config('developermode')) {
$javascript_array[] = $jsroot . 'debug.js';
if (isset($_SERVER['HTTP_USER_AGENT']) && false === stripos($_SERVER['HTTP_USER_AGENT'], 'gecko')) {
$javascript_array[] = $jsroot . 'firebug/firebug.js';
}
}
foreach ($jsstrings['mahara'] as $section => $tags) {
foreach ($tags as $tag) {
......@@ -221,6 +231,9 @@ EOF;
$stylesheets = array_merge($stylesheets, array_reverse($pluginsheets));
}
}
if (get_config('developermode')) {
$stylesheets[] = get_config('wwwroot') . 'theme/debug.css';
}
$smarty->assign('STYLESHEETLIST', $stylesheets);
$smarty->assign('WWWROOT', $wwwroot);
$smarty->assign('SESSKEY', $USER->get('sesskey'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment