fkelly12054 / juicebox-kelly

Juicebox moving towards Drupal 9
GNU General Public License v2.0
1 stars 1 forks source link

Juicebox Pro Options Config #18

Closed D4KO closed 3 years ago

D4KO commented 3 years ago

fkelly: I see the dots you are suggesting can be configured for thumbnails. They are on the Juicebox Lite config screen, not on the pro one. I guess we need to do both configuration options and they are cumulative?

Juicebox Pro options are configured in the different way. You can define them in ' Juicebox Library - Pro / Manual Config' textfield. Available options (lite/pro) are listed here http://www.juicebox.net/support/config_options

So I don't think we need to take care about this. Just test it as it works as designed. Seems there's no other way of settings Pro options at the current Juicebox version. Only that textfield.

D4KO commented 3 years ago

It does not. I tried to add FB Share Icon (shareFacebook="TRUE") and got the error: Juicebox Error: Config file not found.

fkelly12054 commented 3 years ago

So testing this with a JB gallery built on site within a content type. 1st note: you can't edit the individual instance of the content type. The configuration can only be set for the entire content type. Going into Manage display of that content type and using the PRO display I have captions set to use ALT field. (and titles to use the filename). I also have access to Lite config. Setting thumbs to show the dots. Saving content type, then viewing the instance of the content type I get the dots shown, thus overriding the PRO option. (noting that the caption from the alt field and the title from the filename shows in the image area when set by the PRO option ... it's in the area BELOW THE IMAGE WHERE the dots and thumbnail images show with the LITE option taking precedence if it's set).

I tried manual configuration to set thumbsPosition="TOP" and got the config file not found error, just like you did.

Going over to my production site and changing the structure for a build on site content type to add thumbsPosition="TOP" ... it works. In other words we've introduced a regression. The production site (fkelly.org) is using a version of Juicebox from before we started all these changes.

The error I'm seeing is:

Exception building Juicebox XML: !message in DOMElement->setAttribute() (line 226 of D:\webpage\dr9\web\modules\juicebox\src\JuiceboxGallery.php).

I'll post this and keep looking.

fkelly12054 commented 3 years ago

Editing the content type structure to take thumbsPosition out, seems to rectify the situation. However (and it could just be me) sometimes the edit seems to take, and sometimes it doesn't. In other words I blank out the thumbsPosition setting and save and come back in and it's still there. Do it again and it's gone. No such flakiness on my production system. Seems at a minimum you have to update the settings screen, then save the content type structure, then come back in.

However, bottom line manual settings such as thumbsPosition "should" work. Oh sh** ... was throwing var_dumps into my d8 code and trying to view the results on my D9 test system. Most of the the rest above should apply. I will test with the d8 now.

fkelly12054 commented 3 years ago

Nuts. putting the formatting options in manually through the PRO manual configuration is haywire. I am getting a dump of the configuration values like this:

gallery_attributes D:\webpage\drupal8\modules\juicebox\src\JuiceboxGallery.php:187: array (size=11) 'gallerywidth' => string '100%' (length=4) 'galleryheight' => string '100%' (length=4) 'backgroundcolor' => string '#222222' (length=7) 'textcolor' => string 'rgba(255,255,255,1)' (length=19) 'thumbframecolor' => string 'rgba(255,255,255,.5)' (length=20) 'showopenbutton' => string 'TRUE' (length=4) 'showexpandbutton' => string 'TRUE' (length=4) 'showthumbsbutton' => string 'TRUE' (length=4) 'usethumbdots' => string 'FALSE' (length=5) 'usefullscreenexpand' => string 'FALSE' (length=5) 'thumbsposition="top"' => string 'thumbsPosition' (length=14) <-- this is nuts ... the "string" value should be "top"

for the $gallery_attributes array. I am inputting thumbsPosition="TOP" This seems to conform to the documentation. If I try any other way I get an error message that's generated down at the bottom of JuiceboxModule.php. It doesn't want any spaces nor single quotes or to leave the quotes out. I can't find any other examples of setting these attributes manually and how to do it correctly. Life calls ... I'll look again tomorrow.

D4KO commented 3 years ago

Your var_dump gives me a hint.

The last line 'thumbsposition="top"' => string 'thumbsPosition' (length=14) should be 'thumbsposition' => string 'top' (length=14)

I've tried to fix the array on the fly while debugging and the gallery gets working with Pro option. It seems you're right that we introduced the regression. Pro options are not parsed correctly for some reason. Needs more work.

On Sun, Dec 13, 2020 at 10:58 PM fkelly12054 notifications@github.com wrote:

Nuts. putting the formatting options in manually through the PRO manual configuration is haywire. I am getting a dump of the configuration values like this:

gallery_attributes D:\webpage\drupal8\modules\juicebox\src\JuiceboxGallery.php:187: array (size=11) 'gallerywidth' => string '100%' (length=4) 'galleryheight' => string '100%' (length=4) 'backgroundcolor' => string '#222222' (length=7) 'textcolor' => string 'rgba(255,255,255,1)' (length=19) 'thumbframecolor' => string 'rgba(255,255,255,.5)' (length=20) 'showopenbutton' => string 'TRUE' (length=4) 'showexpandbutton' => string 'TRUE' (length=4) 'showthumbsbutton' => string 'TRUE' (length=4) 'usethumbdots' => string 'FALSE' (length=5) 'usefullscreenexpand' => string 'FALSE' (length=5) 'thumbsposition="top"' => string 'thumbsPosition' (length=14)

for the $gallery_attributes array. I am inputting thumbsPosition="TOP" This seems to conform to the documentation. If I try any other way I get an error message that's generated down at the bottom of JuiceboxModule.php. It doesn't want any spaces nor single quotes or to leave the quotes out. I can't find any other examples of setting these attributes manually and how to do it correctly. Life calls ... I'll look again tomorrow.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fkelly12054/juicebox-kelly/issues/18#issuecomment-744075082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJQHTBDMMNXDV7CTS7HMD5DSUU2IPANCNFSM4UZVDDKA .

D4KO commented 3 years ago

Got it fixed! I'll test it in various Lite/Pro config options variations and commit it if everything's works fine.

On Mon, Dec 14, 2020 at 9:52 AM DK koutas@gmail.com wrote:

Your var_dump gives me a hint.

The last line 'thumbsposition="top"' => string 'thumbsPosition' (length=14) should be 'thumbsposition' => string 'top' (length=14)

I've tried to fix the array on the fly while debugging and the gallery gets working with Pro option. It seems you're right that we introduced the regression. Pro options are not parsed correctly for some reason. Needs more work.

On Sun, Dec 13, 2020 at 10:58 PM fkelly12054 notifications@github.com wrote:

Nuts. putting the formatting options in manually through the PRO manual configuration is haywire. I am getting a dump of the configuration values like this:

gallery_attributes D:\webpage\drupal8\modules\juicebox\src\JuiceboxGallery.php:187: array (size=11) 'gallerywidth' => string '100%' (length=4) 'galleryheight' => string '100%' (length=4) 'backgroundcolor' => string '#222222' (length=7) 'textcolor' => string 'rgba(255,255,255,1)' (length=19) 'thumbframecolor' => string 'rgba(255,255,255,.5)' (length=20) 'showopenbutton' => string 'TRUE' (length=4) 'showexpandbutton' => string 'TRUE' (length=4) 'showthumbsbutton' => string 'TRUE' (length=4) 'usethumbdots' => string 'FALSE' (length=5) 'usefullscreenexpand' => string 'FALSE' (length=5) 'thumbsposition="top"' => string 'thumbsPosition' (length=14)

for the $gallery_attributes array. I am inputting thumbsPosition="TOP" This seems to conform to the documentation. If I try any other way I get an error message that's generated down at the bottom of JuiceboxModule.php. It doesn't want any spaces nor single quotes or to leave the quotes out. I can't find any other examples of setting these attributes manually and how to do it correctly. Life calls ... I'll look again tomorrow.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fkelly12054/juicebox-kelly/issues/18#issuecomment-744075082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJQHTBDMMNXDV7CTS7HMD5DSUU2IPANCNFSM4UZVDDKA .

D4KO commented 3 years ago

Well, looks like it's OK. I was experimenting with various option variations at http://sandboxd9.test.pink-future.cz/ My Current Pro Config: showPreloader="TRUE" showOverlayOnLoad="TRUE" showSmallThumbNav="TRUE" showImageNav="ALWAYS" autoPlayOnLoad="TRUE" displayTime="2" showAutoPlayButton="TRUE" showAutoPlayStatus="TRUE" changeImageOnHover="TRUE" imageShadowBlur="0" shareFacebook="TRUE" imageTransitionTime="0.6" imageScaleMode="SCALE" screenMode="AUTO" imageTransitionType="CROSS_FADE" buttonBarPosition="OVERLAY" showInfoButton="TRUE" showDownloadButton="TRUE" showNavButtons="TRUE" splashButtonText="Zobrazit galerii" splashShowImageCount="TRUE" thumbsPosition="TOP"

fkelly12054 commented 3 years ago

Synched up files and tested on both Drupal 8 and 9, going back and forth with thumbsPosition="TOP" and trying the Juicebox lite option of having the three dots for thumbnails. All works as expected.

We should probably make a note in the documentation that these settings apply to the ENTIRE CONTENT TYPE. So, if you have 100 galleries in a content type all will have thumbsPosition top or not. Users should be aware before they start mucking around with this. I guess in some instances you could create a couple of content types for "on-site" galleries with different settings.

Anyway the immediate bug is squashed. Thanks.