In Drupal, users can direct javascript to be loaded in the header (via variables['scripts']) as well as in the footer (via variables['closure']). Currently, this module only supports rewriting the JS path for the header-based Javascript. Update the parallel_preprocess_page function as follows to add support for footer-based Javascript...
function parallel_preprocess_page(&$variables) {
if (variable_get('parallel_enabled', TRUE)) {
if (variable_get('parallel_domain_css', '') != '') {
$variables['styles'] = str_replace(' href="/', ' href="' . variable_get('parallel_domain_css', '') . '/', $variables['styles']);
}
if (variable_get('parallel_domain_js', '') != '') {
$variables['scripts'] = str_replace(' src="/', ' src="' . variable_get('parallel_domain_js', '') . '/', $variables['scripts']);
//adds support for footer-based JS
$variables['closure'] = str_replace(' src="/', ' src="' . variable_get('parallel_domain_js', '') . '/', $variables['closure']);
}
Comments
Comment #1
dalinHere's a patch
Comment #2
mikeytown2 commentedcommitted