If Javascript aggregation is on, Galleria will not function.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gopherspidey’s picture

This is a patch that has only be tested with #1082882-8: Public/private paths and using the image styles patch applied first. It fixes the Aggregation problem.

gopherspidey’s picture

Status: Active » Needs review

changing status

larowlan’s picture

Status: Needs review » Needs work
+++ b/galleria.module
@@ -132,7 +132,7 @@ function galleria_includes() {
     drupal_add_css($path . '/galleria.container.css');
     drupal_add_js($path . '/js/jquery.galleria.js');
-    drupal_add_js($path . '/js/themes/classic/galleria.classic.js');
+    drupal_add_js(array('galleria' => array( 'path' => $path )), array('type' => 'setting', 'scope' => JS_DEFAULT));
     drupal_add_js($path . '/js/galleria.load.js');

Couldn't all of these use the new #attached property of the form api. See http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....

Powered by Dreditor.

larowlan’s picture

Status: Needs work » Needs review
FileSize
1.61 KB

Attached patch uses the new #attached property.

miro_dietiker’s picture

Status: Needs review » Fixed

Great patch. However it was against an old version.

That's what we missed in D6 to D7 conversion.

I've redone the patch and added the new features (settings, ..) of galleria also... A bunch more to cover.

gopherspidey’s picture

Status: Fixed » Needs work

I am still seeing an aggregation issue. It does not find the theme when Javascript aggregation is on. I found that it is best to use the Loadtheme function http://galleria.aino.se/docs/1.2/api/utilities/#galleria-loadtheme-url-o...

If you do not, the preprocessing does something with the ordering of when the theme functions are loading.

miro_dietiker’s picture

I'd love to get a patch. .-)

Will you find time to work on that?
We already ran out of time for galleria...

jackhutton’s picture

same experience here; when javascript aggregation is turned on the theme is not found;

jackhutton’s picture

I'd like the galleria to work w. aggregation turned on.. of course.
since the developers of galleria are slow to support ..
I'm wondering how I'd implement gopherspidey's work around in #6..
any advice ..
thanks

gopherspidey’s picture

Take a look at the patch in comment #1. The method is still valid. You have to add Galleria.loadTheme(); to the galleria.load.js file with the theme javascript file as the argument.

I just have not had time to look at the updated code that was changed with when the settings page and theme selection was added. It should be easy.

jackhutton’s picture

thanks gopherspidey - i'll look at that remedy..
as always, really appreciate the consistent help you offer.. thanks again.

jackhutton’s picture

in sites/all/modules/galleria/galleria.module

line 366 loads the galleria.load.js

      // add the global galleria settings and the galleria loader script
      galleria_add_settings($js);
      $path = drupal_get_path('module', 'galleria');
      $js[] = $path . '/js/galleria.load.js';
   

-- and the galleria.load.js file is pretty minimal

(function ($) {
  Drupal.behaviors.galleria = {
    attach: function(context, settings) {
      jQuery('.galleria-content', context).galleria(Drupal.settings.galleria.opt);
    }
  }
})(jQuery);

..I'm not well versed in javascript: not sure where I would I drop in the line

           Galleria.loadTheme('/' + settings.galleria.path + '/js/themes/classic/galleria.classic.js');

sorry to be confused here..

thanks for looking at this..

jackhutton’s picture

in sites/all/modules/galleria/galleria.module
line 339 the .js loads ..


      // load the theme JS file dynamically
      $dir_handle = opendir($libpath . '/themes/' . $theme . '/');
      // @todo store the theme file, not the theme name

and the theme .js file loads on line 345

          // add the theme JS file
          $js[] = $libpath . '/themes/' . $theme . '/' . $file;
          break;
 

and on line 366 the galleria.load.js file is called (reiterating myself, I know.. )

      // add the global galleria settings and the galleria loader script
      galleria_add_settings($js);
      $path = drupal_get_path('module', 'galleria');
      $js[] = $path . '/js/galleria.load.js';

just trying to understand how afford .js / .css aggregation on this module.. thanks

s_leu’s picture

once again thanks for the hint eggonbeagle, i implemented this on my local repository. will commit soon. cheers

jackhutton’s picture

look forward to your fix - thanks for your work on this

s_leu’s picture

Status: Needs work » Fixed

pushed.

miro_dietiker’s picture

eggonbeagle, thank you for your recent inputs.

However, quoting your statement:
"since the developers of galleria are slow to support .."
Note that words like this absolutely won't help you getting any kind of support from us.

If you want to push things wither provide clean patches yourself or hire a developer to do the same.

jackhutton’s picture

Miro, I apologize of course.
I acknowldge all of your input - I was under an impression that you were acting independently of the developers - please accept my apologies

miro_dietiker’s picture

eggonbeagle

.-) thanks - BTW: s_leu also belongs to our team.
(See more about us on the bottom of the galleria project page.)

Looking forward to hear more from you - and keep having fun with galleria!

jackhutton’s picture

.. can I just say 'beauty'!! aggregation works terrifically in the june 10 7.x version.. Thank you!

Status: Fixed » Closed (fixed)

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