Configure this to work like https://drupal.org/project/popcornjs where http://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/1.5.25/jquery.isoto... is used by default, but users have the option to add it to sites/all/libraries.

Should cut down on support requests.

CommentFileSizeAuthor
#1 cdn-support-2265823-1.patch5.74 KBChris Gillis

Comments

Chris Gillis’s picture

Status: Active » Needs review
StatusFileSize
new5.74 KB
sherakama’s picture

knalstaaf’s picture

I'm getting this error after applying the patch:

Notice: Constant ISOTOPE_CDN_PATH already defined in include_once() (line 4 of sites/all/modules/views_isotope/views_isotope_core.module).
Notice: Constant ISOTOPE_FILENAME already defined in include_once() (line 5 of sites/all/modules/views_isotope/views_isotope_core.module).

Before applying this patch, I got the following notice in my status report:

Isotope is not correctly using Libraries API
Please install Isotope in /isotope.pkgd.min.js. The module is using an external copy from http://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.0.0/isotope.pkgd....

According to this (recent) video of CodeKarate, the v1.5.26 release of the js should be placed in libraries/jquery.isotope.

So I'm a bit confused about where this project is heading to right now (tried several approaches, releases, versions, video's), and which approach is now the right one. I got as far as it's filtering the results correctly, but there's no animation and my images are just grey squares.

gausarts’s picture

@knalstaaf there are two different locations for different versions:

7.x-2.x-dev forwards is expecting Isotope v2:
https://github.com/metafizzy/isotope/blob/v2.2.2/dist/isotope.pkgd.min.js

Download and place the v2 JS file as follows:
sites/../libraries/isotope/isotope.pkgd.min.js
Says:
sites/all/libraries/isotope/isotope.pkgd.min.js

7.x-2.0-alpha1, 7.x-1.0-beta2 and 7.x-1.x-dev are expecting Isotope v1:
https://github.com/metafizzy/isotope/blob/v1.5.26/jquery.isotope.min.js

Place the v1 JS file as follows:
sites/../libraries/jquery.isotope/jquery.isotope.min.js

You can pickup any version of JS files from here:
https://github.com/metafizzy/isotope

It is common to change file locations based on maintainers' policy, or old library vs new one directions.

The patch was obsolete against the latest DEV.
It was for 7.x-2.0-alpha1 below, yet it is already included at the latest 7.x-2.x-dev.
There may be a bit of complication here also when you placed the latest DEV version on top of the old one without removing the old module folder first? That maybe the reason you have such notices.

Both versions have different structures as mentioned here:
#2316161: 2.x Roadmap

The patch is attempting to fetch the v2 file from CDN as a fallback to avoid such issue you have.
If you have the latest DEV, you should ignore this patch as it is already included.

Hope that helps.

knalstaaf’s picture

Hi gausarts, thanks for the clear explanation. All seems to be in order now according to the status report. Maybe it wouldn't be a bad idea to mention a link to an explanation like this on the project page, for it seems quite essential.

On the other hand I must say that the output of the module didn't change (de-installed everything, re-installed the 7.x-2.x-dev version), followed the instructions above (confirmed in status report). But the outcome remains the same: gray squares (caused by .isotope-element * {display: none;}, line 125 in views_isotope_example.css) and no (filter) animation. As it's quite hard to find similar issues I take it must be something specific for my installation (I'm having this issue on 2 separated projects though). No javascript errors either.
Edit: same behaviour on clean platform. Since I have no longer time to dig into this, I will go for an alternative until there's a recommended release available.

Maybe I'd better start a separate issue thread for this, as it seems no longer related to the OP.

gausarts’s picture

..it must be something specific for my installation...

Not necessarily, I noticed 7.x-2.x-dev is a total rewrite, and can be considered a WIP. I remembered I had issues with it as well. I meant you are not alone ;)

...until there's a recommended release available.

You are right, unless we are ready for surprises and planning to help with it, IMHO, DEV releases are not recommended.

Perhaps consider a 7.x-2.0-alpha1, or below?
IIRC, they had less issues except some styling, and few little things, which are normal to most modules.

knalstaaf’s picture

7.x-2.0-alpha1 combined with libraries/jquery.isotope/jquery.isotope.min.js (v1.5.26) seems to do the job on a clean install. Edit: ànd it works on my project.

Thank you for pushing me in the right direction, much appreciated! :)

Chris Gillis’s picture

Status: Needs review » Fixed

Fixed in 7.x-2.0-beta1

Status: Fixed » Closed (fixed)

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