Hello,

When I enable your module, it ought to add the following script:

(full path)/live.js#css

However, what it's actually adding is this:

(full path)/live.js%23css

(Plus a cachebreaker in both cases)

My browsers (Chrome/Firefox) can't work out where to find this, so they return a 404. For the time being I'm hacking the module like so:

drupal_add_js($path .'/'. $filename);

...and this works, but I'm guessing there's a reason why adding #css at the end is a good thing.

I've tried disabling some other contrib modules, but to no avail, and I can't see an easy fix in the documentation of drupal_add_js.

Anyhow, would be great to have a fix for this (notwithstanding the fact that it may be down to a failing of drupal_add_js).

Thanks for putting the module together!

Comments

doublejosh’s picture

Status: Active » Needs work

Darn, drupal_add_js does not have a solution for fragments. I imagine that's an extreme edge case. I'm guessing an extra layer of cleanup happened in Drupal 7.

The #css tells livejs to ONLY monitor CSS changes rather than both CSS and JS which with a framework like Drupal is just too much and tends to overrun CPUs. That was my experience.

I don't so much care about breaking cache since this is certainly a dev only tool. Plus the #css is part of the utility itself so there isn't a lot of options.

Guess I'll add something like...

$scrpt = array(
  '#type' => 'markup',
  '#markup' => '<script language="javascript" type="text/javascript" src="'. $path .'#css"></script>',
);
drupal_add_html_head($scrpt, 'livejs');
doublejosh’s picture

doublejosh’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)