For one reason or another, imagesloaded no longer is providing a jquery.imagesloaded.js file in their package. It appears that the core imagesloaded.js file is now universally compatible.

See: https://github.com/desandro/imagesloaded
and: https://github.com/desandro/imagesloaded/commit/85655be76d8e52f77336b477...

I know the library API hooks will need to be updated, but I'm not entirely sure if the code itself will need some adjustment to account for this change. The documentation still shows compatibility with jQuery: http://desandro.github.io/imagesloaded/

Comments

mcfilms’s picture

Even if you have installed jquery.imagesloaded.js you get an error. Current error reads:

JQuery ImagesLoaded plugin Not found
For best results, you should download the JQuery ImagesLoaded plugin and move the downloaded js file(s) into the sites/all/libraries/jquery.imagesloaded folder of your server.

With JQuery ImagesLoaded plugin pointing to: https://github.com/desandro/imagesloaded/downloads

This appeares to be the same as the files at http://desandro.github.io/imagesloaded/

mcfilms’s picture

Oh I understand now.

More searching reveals this link:
https://drupal.org/node/1817046#comment-7509999

Apparently you have to rename imagesloaded.js to jquery.imagesloaded.js.

kaidjohnson’s picture

Asking people to change the structure of a library is fundamentally a bad idea -- the whole point behind the libraries api is to make adding third-party libraries to your project easy and to maintain a consistent language across modules. The third-party library developer for imagesloaded has recently deliberately made the decision to remove jquery.imagesloaded.js from their project. Accordingly, the hook_libraries_info declaration for jquery.imagesloaded should be updated in Field Slideshow.

Here's the scenario I'm hoping to avoid:
Module A declares jquery.imagesloaded to use the imagesloaded.js file. All is well.
Module B declares jquery.imagesloaded to use the jquery.imagesloaded.js file. All is no longer well, as that file no longer exists in the library.
User A goes in and renames imagesloaded.js to jquery.imagesloaded.js. Module A now is broken, but Module B works. User A eventually realizes to copy imagesloaded.js to jquery.imagesloaded.js to get both Module A and Module B working properly.
User B sees an update in the third-party library and re-downloads the library from the third-party vendor site. User B replaces the contents of jquery.imagesloaded library with the contents of the updated library. Module B is once again broken.

The users then become responsible for maintaining the library each time they choose to update the library. This issue completely defeats the purpose of the Libraries API.

Please do not encourage people to rename, move, or copy files within third-party libraries. Libraries should be treated as Modules and (especially) Core in that they should not be edited directly, but rather managed and updated through the maintainers. Reach out to the module developers to update their modules accordingly to account for changes in library structures.

mcfilms’s picture

Reach out to the module developers to update their modules accordingly to account for changes in library structures.

Uhhh... I thought that was what we were doing here.

Obviously this is a band-aid fix to prevent an error.

I hope that the module maintainer monitors the issue cue and will take the appropriate action. Or perhaps you (or I) could write a patch against the Field Slideshow module. But in the short term and until such a time as somebody provides a fix, then I suggest, dare I say encourage, this band-aid solution.

kaidjohnson’s picture

My point is that I am reaching out to module developers to resolve the issue; between developing full-time and enjoying my personal life when outside of work, I haven't had time to put together a patch to resolve the issue, but I'm hoping someone else might take the time to do so and not offer ill-advised band-aids or stop-gaps that could be mistaken by many in the community as a solution.

That said - @mcfilms, have you run across any side-effects of using the imagesloaded.js as jquery.imagesloaded.js (aside from the aforementioned bad practice)? If not, then the solution should be relatively easy to implement in the libraries api hook.

My biggest concern was simply moving to a possibly-different codeset in jquery.imagesloaded.js might inadvertently cause dependent code within the module to break or function with unexpected results. Previous versions of the imagesloaded plugin that included a jquery.imagesloaded.js file also contained an imagesloaded.js file, so I'm wondering if a direct translation from the jquery prefix to the imagesloaded.js file will be fully functional without the need to alter some other code around it.

If I get a chance over the next few days, I'll play around with these ideas and roll up a proposed patch. In the meantime, if @mcfilms or anyone else wants to take a stab at it, it would be quite welcomed.

idflood’s picture

Status: Active » Needs work
StatusFileSize
new1.52 KB

Here is a first patch which make the plugin try to load imagesloaded/imagesloaded.pkgd(.min).js if the jquery.imagesloaded is not found. With this it loads the correct file but since it requires jquery >= 1.9 it is still not possible to make it work. For this we will have to wait for #1901672: Offer latest jQuery 1.9.x as an option (currently 1.9.1).

But even with the jquery_update issue is fixed there are some little work to do on this patch. It should check if jquery_update is installed and if it is configured to load jquery >= 1.9. Then it should load imagesloaded only if these requirements are satisfied (+ display different messages if they are not).

sittard’s picture

It would appear that the name changes occured following the release of Imageloaded v3.0.0.

You can still download older versions via:
https://github.com/desandro/imagesloaded/releases

idflood’s picture

Title: Imagesloaded plugin has removed jquery.imagesloaded.js in favor of imagesloaded.js. » Make module compatible with latest version of Imagesloaded plugin when jquery_update allow jquery 1.9.
Status: Needs work » Postponed

Thanks @stittard. I've committed a little "fix": http://drupalcode.org/project/field_slideshow.git/commitdiff/fe1b2e27ea0...

So I'm marking this issue has postponed until the #1901672: Offer latest jQuery 1.9.x as an option (currently 1.9.1). is resolved.

sandip choudhury’s picture

Version: 7.x-1.x-dev » 7.x-1.82

Thanks, it works. I have downloaded the version v2.1.1 plugin from https://github.com/desandro/imagesloaded/releases to work with field slideshow version 7.x-1.82.

ivanhelguera’s picture

using 2.1.x version of the plugin worked for me. Thanks!

herinxi’s picture

Issue summary: View changes

version 7.x-1.82 worked with v2.1.1. thanks.

  • AjitS committed 53f24f9 on 7.x-2.x
    Merge branch '7.x-1.x' into 7.x-2.x
    
    * 7.x-1.x:
    #2007618, recommend to...
  • idflood committed fe1b2e2 on 7.x-2.x
    #2007618, recommend to download imagesloaded 2.1.2 until jquery_update...
ajits’s picture

Version: 7.x-1.82 » 7.x-2.x-dev
Status: Postponed » Fixed

I tested this and it appears to be working with 7.x-2.x-dev
Marking this as fixed. Please feel free to re open if you still encounter the issue.

ajits’s picture

Status: Fixed » Closed (fixed)

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

igorik’s picture

Status: Closed (fixed) » Active

Sorry if I am wrong but I think this is still active.
The message on status repoort is this:
"Query ImagesLoaded plugin Not found
For best results, you should download the JQuery ImagesLoaded plugin https://github.com/desandro/imagesloaded/downloads and move the downloaded js file(s) into the sites/all/libraries/jquery.imagesloaded folder of your server."

However on that url what is there written there is no js file, only this message "There aren’t any uploads for this repository."
I tried to download file from https://github.com/desandro/imagesloaded/releases
but till I found this thread Ididn't know that plugin 3.x is not working, (because change of the name?) and I have to use 2.x version
with name jquery.imagesloaded.js

Please add this information to the message on status report, because as it is now, it is very missunderstanding.

Thank you
Igor

  • idflood committed fe1b2e2 on 8.x-1.x
    #2007618, recommend to download imagesloaded 2.1.2 until jquery_update...
  • AjitS committed 53f24f9 on 8.x-1.x
    Merge branch '7.x-1.x' into 7.x-2.x
    
    * 7.x-1.x:
    #2007618, recommend to...
Mark_L6n’s picture

There are a few issues still with 7.x-2.0-beta1:
1) Is jquery.imagesloaded.js truly required, or is the requirement warning for this just legacy code that should be removed?
2) If jquery.imagesloaded.js is required, this should be documented on the project page, the documentation page and in README.txt. Currently it is not documented anywhere; there is only a REQUIREMENT_WARNING issued. Additionally, if version 3 of jquery.imagesloaded.js is incompatible, that should also be documented.
3) The link in the REQUIREMENT_WARNING doesn't exist; for the recommended version, 2.1.2, https://github.com/desandro/imagesloaded/tree/v2.1.2 can be used instead.

miteshmap’s picture

Status: Active » Needs review
StatusFileSize
new2.3 KB

Updated new patch to be used the same folder name for old and new jquery.
updated the .install file for hook_requirements, to avoid notice of jquery not found on status report page.

  • AjitS committed 53f24f9 on 8.x-2.x
    Merge branch '7.x-1.x' into 7.x-2.x
    
    * 7.x-1.x:
    #2007618, recommend to...
  • idflood committed fe1b2e2 on 8.x-2.x
    #2007618, recommend to download imagesloaded 2.1.2 until jquery_update...
mediaformat’s picture

It looks like the commits @ #17 and #20 went into the 8.x branch

ajits’s picture

@MediaFormat Yep. Those were mainly the merge commits from 7.x to 8.x branch.

As of this issue, patch at #19 is in review.

pontus.froden’s picture

Status: Needs review » Reviewed & tested by the community

patch in #19 works fine for me.

lamp5’s picture

Status: Reviewed & tested by the community » Needs work

It will be better to create one loop to detect all combination of plugin name.

lamp5’s picture

Status: Needs work » Closed (outdated)