Selecting the check box for "Aggregate JavaScript files" found under "Bandwidth optimization" on admin/config/development/performance makes it such that the Juicebox Gallery (for an individual node/as a field formatter) disappears. This is on a fresh install with the bare minimum of contrib modules running and no changes to the default Juicebox formatter settings. Please let me know what/if additional information would be helpful.
I am looking forward to using Juicebox - thanks for your work on this module. EWB
Comments
Comment #1
rjacobs commentedHi Eric, thanks for testing.
I see what you mean and can confirm that this is a problem. Currently the Juicebox library javascript is both registered and loaded through the Libraries API, which I have been assuming integrates with Drupal's "aggregate javascript" feature. It looks like either this assumption was incorrect or I am simply not using the correct Libraries API methods to load the Juicebox Library.
I think I just have to make sure that the load method for the Juicebox library ultimately calls drupal_add_js(). I thought Libraries API was doing this already, but it must not be. Anyway, I'll have a look.
Comment #2
rjacobs commentedOk, so from what I can see my assumptions were correct, and the Libraries API is correctly handling the aggregation of the Juicebox library javascript (it's getting correctly cached/aggregated by Drupal when aggregation is enabled). I think the problem is that we should in fact not be aggregating the specific Juicebox javascript. I see at least 2 reasons for this:
So we just want to exclude the specific Juicebox javascript (juicebox.js) from being aggregated when aggregation is turned on. I just committed some changes to dev that should address this and have tested them with success.
Eric, can you install the most recent dev version (which will be available as soon as the timestamp on 7.x-1.x-dev reflects today's date), clear your caches, and see if everything works with aggregation enabled on your end? I went ahead with a commit for this fix as I think this is pretty straightforward, but would certainly appreciate it if someone can test this change via the dev version.
Comment #3
EWB commentedI uploaded the most recent dev version, cleared caches, selected the checkbox to "Aggregate JavaScript files" and Juicebox is now working nicely. Thanks, EWB
Comment #4
rjacobs commentedThanks for confirming the fix. This will be in the next release (which will probably be marked 7.x-1.0-beta1).
Also, the commit that captures the change is: http://drupalcode.org/project/juicebox.git/commit/c3005d5
At some point it might be worth setting things up so that the Juicebox js and css can be correctly aggregated, but this will require overriding the "standard" Juicebox embed setup (to define custom theme/CSS paths, etc.) which might get a little involved. I think the performance benefits of doing this would also be fairly small. Anyway, if that becomes a priority someone can open a separate issue for it.