The module is a "responsive lazyloader". There is no device detection but use of mediaqueries.
That mean it will load on scroll the best apropriate image style according to the current breakpoint &/or display. (small image on sidebar, medium in content as exemple)
This module allow you to use real complex mediaqueries as retina display detection or orientation recognition. (what i was not able to do with the contrib modules I've tested).
There is no dependancies to the image field but realy to the position of the image in the page layout & to the mediaquery.
I hope my UI is pretty clear and make the config of the module as simple as possible.
The module is pre-setup with basic settings.
For now this is a Drupal 7.x module.
Features :
A simple lazy loader.
A custom lazy loader to load specific image style according to html structure.
A custom lazy loader to load specific image style according to current media query.
A custom lazy loader to load specific image style matching the html structure and the media query.
Load image only when the image is on the active window.
Available Settings :
Enable / disable the lazy loader.
Set the distance between the image and the active window to triger le image loading.
Exclude some pages from the lazy loader.
Configure the breakpoints (media queries)
Configure the layouts.
Advance features as javascript actions on image load or after all images load (as for custom analytics action).
Some debug code is available on the UI to help users ton configure the module. (see : advance settings)
It works with AJAX
The plugin already used with views using ajax and views infinite scroll.
Learn more
To learn more about responsivelazyloader look at the jQuery plugin http://plugins.jquery.com/responsivelazyloader/
From my point of view, this module is not a duplicate of the following ones :
https://drupal.org/project/cs_adaptive_image
https://drupal.org/project/rwdimages
https://drupal.org/project/lazyloader
The module use a jQuery plugin i've published on MIT & GPL licence.
I've already made a "coder" check of the code with success and made some manual reviews from the Drupal gidelines.
This is the sandbox link : https://drupal.org/sandbox/jetmartin/2158105
This is the link to the GIT :
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jetmartin/2158105.git responsivelazyloader
cd responsivelazyloader
I've previously never contributed to Drupal but it's never too late to start. I hope this module could be usefull for others peoples.
Thank you for spending some of you'r time to review my code.
| Comment | File | Size | Author |
|---|---|---|---|
| Capture d’écran 2013-12-19 à 10.40.51.png | 76.1 KB | jetmartin | |
| Capture d’écran 2013-12-19 à 10.39.46.png | 71.13 KB | jetmartin | |
| Capture d’écran 2013-12-17 à 09.57.53.png | 64.39 KB | jetmartin |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxjetmartin2158105git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
jetmartin commentedI've made the code review and some updates as the use of librarie to load the external jQuery plugin.
I still have on issue with http://pareview.sh/ about the readme file.
I guess i read in another Drupal documentation, to wait for the project application to write this file.
So i wait for feedback.
Comment #3
arlina commentedHi jetmartin,
Looks like an interesting module. I see you almost pass PAReview! Some pointers:
$conf['image_allow_insecure_derivatives'] = TRUE;must be added tosettings.php. You should add that to the installation instructions as well.responsivelazyloader_process_html()it basically adds an inline javascript to$vars['page_bottom'], but that way Drupal can't take advantage of js aggregation. Perhaps you can split your code in two to fix this:drupal_add_js(array('responsivelazyloader' => $your_settings_array), 'setting');Drupal.settings.responsivelazyloader.That should allow aggregation while using variable settings.
I'll keep testing your module and giving you feedback.
Comment #4
arlina commentedComment #5
arlina commentedYour post also lists your personal git URL, change it to your public git clone command:
http://git.drupal.org/sandbox/jetmartin/2158105.gitComment #6
jetmartin commentedThank's a lot for you'r review ! (sorry for the delay of answer)
I'm glad to see that you find it interesting.
I've also think to this JS aggregation solution but to be honest some contrib plugin do it this way so I was lazy...
You'r right i will fix that.
I'm also updating the jQuery plugin, now the parent is optional if it match with the display class.
So i will made some updates to make the config easier.
I'll made the updates very soon.
Comment #7
jetmartin commentedComment #8
jetmartin commentedHi.
I've made some major changes yesterday.
I've completely remove the hook_process_html(). It's much cleaner now, thank you. I've made some testings using AJAX, aggregation & caching...
I've added a readme file and the requirement instruction about the image insecure derivatives on the project page.
I've also made some UX updates on displays.
I hope the module is in a good shape now.
I do not added a check on the jQuery plugin release even if the plugin need a >0.1.4 release for now.
I assume there is not really a chance for a new user to download an old release.
Thank you for reviewing the module.
Comment #9
rmn commentedHi
Please rename readme.md to README.md. It's even showing up as en error in pareview.sh.
Verify there are no comments/errors on pareview before changing the status further.
Thanks
Raman
Comment #10
jetmartin commentedHi.
Sorry, my mistake.
pareview.sh is now fine : http://pareview.sh/pareview/httpgitdrupalorgsandboxjetmartin2158105git
I've also :
- Added the hook_help.
- Updated the code with some early users feedback.
Comment #11
rmn commentedHi
Under the file responsivelazyloader.init.js.
Thanks
Raman
Comment #12
jetmartin commentedHi.
Thank's rmn for the review and advises.
Now, i've updated the code according to the jQuery doc using $(document).ajaxStop();
So i've tested it with a brand new Drupal install and with an update to jQuery 1.8, it's works in both cases.
No more need of check the jQuery release.
To answer your last question, the second call is used for set the LazyLoder on AJAX event.
Without this call, the images loaded by AJAX such as views AJAX, views infinite scroll, the cTools Modal, ... will never be loaded.
Regards
J-Et. MARTIN
Comment #13
plazik commentedYou should name folder with module
responsivelazyloaderas yourresponsivelazyloader.modulefile.You should rename README.md to README.txt. It's a standart for Drupal.
responsivelazyloader.info:
Some typos:
description = Enable a full configurable responsive lazyloader. You cand create custon configuration for any CSS grid system.
These files is added to all pages including page where they are not using. You shoud add it via drupal_add_js() and drupal_add_css() in .module file.
responsivelazyloader.module
You are using it only once. Are you sure it should be a constant?
Hook_init().should beImplements hook_init().. Also everywhere.These files also is added to all pages.
'#markup' => '<noscript><style type="text/css" media="all">img[data-src] { display: none; }</style></noscript>',See the proper version of adding noscript tag https://drupal.org/comment/6840288#comment-6840288
responsivelazyloader.admin.inc
It should be like this:
"JQuery responsivelazyloader must be installed" should be "jQuery responsivelazyloader must be installed".
Comment #14
lukusHey - this module looks great. Can't wait for a release.
I'll check out the module in the meantime and provide any feedback that comes to mind.
Thanks :)
Luke
Comment #15
jetmartin commentedHi.
I will have some free time this week or next one.
I will made the update as soon as possible, thank you Plazik for this complete review.
@Lukus : thanks for the nice feedback !
J-Et.
Comment #16
jetmartin commentedComment #17
jetmartin commentedHi.
I've made the code updates.
I've made some basics tests with & without caching & aggregations.
The new JS implementation looks fine.
I wait for you'r feedbacks.
Regards.
J-Et.
Comment #18
BigEd commentedHi JetMartin,
Wow a great module you have here I am looking forward to seeing this in the wild.
I checked and there are no issues from http://pareview.sh, however there are some small things I picked.
They are small things and can be quite frustrating but it looks like you are quite close. I need to go through this again in a bit more detail later to see if I can spot anything that might be an issue.
Great work!
Comment #19
jetmartin commentedHi BigEd.
Thank you :D
So, i've made the minor fix you'r asking for.
The fact is i'm not english native so if you could help for the readme file ? i'll really appreciate your help !
Regards.
PS : I will be on vacation with no internet connection in the coming days, don't worry i i do not answer before the 22th of april.
Comment #20
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #21
lukusHey ... any more news on this app?
Hope your vacation was good.
L
Comment #22
jetmartin commentedHey.
Sorry, but I woudn't post a single "UP"...
I've not enough english friends here to help me on that review.
So if anyone would like to help me to review my poor english i will really apreciate your help !
So we could end this application process.
As BigEd said it's not a big deal just "quite a few punctuation and spelling issues in the read me file".
In advance thank you to the one who will spend some of his time on this to help ! I will also ask again on my side...
Thank you Lukus, seeing someone following the project reboost myself :)
J-Et.
Comment #23
jeroentI recently created a patch for this module in which I reviewed the spelling issues (https://www.drupal.org/node/2298185).
If BigEd or someone else could review this module again and eventually make a list of the remaining spelling and punctuation issues, that would be great!
Comment #24
SGhosh commentedHey,
Following is the review -
Automated Review
pareview.sh still identifies a few errors and warnings. Please go through them here - http://pareview.sh/pareview/httpgitdrupalorgsandboxjetmartin2158105git
Manual Review
Good module, serves the purpose well. Though for future development(after release) you could make application of this functionality configurable like field/image formatters.
This review uses the Project Application Review Template.
Comment #25
jetmartin commentedThank you for the review !
I will fix this very soon.
Comment #26
jetmartin commentedHi.
I've fix the issues on pareview.sh.
I guess this time it could be good.
Thank yout for the idea of field/image formatter. May we could discuss about that and more at DC Amsterdam if you go there.
Regards
J-Et.
Comment #27
codesidekick commentedManual Review
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Great work otherwise, I can really see potential for this module. My only real concern is the security issue and I think we can fix that.
Comment #28
codesidekick commentedComment #29
jetmartin commentedHi.
Thank's a lots for this detailed review and the nice feedback.
I will re-think about the image derivatives and others stuff you reviewed after the new year.
I'll keep you in touch, even more if i need somme help to fix any issue.
I wish you an happy new year !
J-Et.
Comment #30
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #31
lukusHi, any update on this? I'd be happy to help out if I can.