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']);
    }
CommentFileSizeAuthor
#1 parallel_742394.diff971 bytesdalin

Comments

dalin’s picture

Status: Active » Needs review
StatusFileSize
new971 bytes

Here's a patch

mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.