Using the Libraries API for external libraries such as jquery.lazyload.js is a great way to mitigate possible problems where multiple modules may require the same plugins.

When combined with hook_library, we also allow other modules to gain access and possibly modify the library on an as needed basis.

By implementing the Libraries API and moving Jquery.lazy load from our module directly, we would also meet better Drupal standards by not including third party plugins in our modules.

If you're interested I would like to contribute a patch that would make jQuery.lazyload available as a library, and make sure that all dependency checks are handled in hook_requirements.

Comments

sinasalek’s picture

Yes that's a great idea. i'll make a new release once your patch is ready to use