Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

V1.0.0 #32

Merged
merged 36 commits into from Dec 21, 2012

Conversation

Projects
None yet
3 participants
Owner

vvo commented Dec 21, 2012

Adds:

  • custom container (not just body)
  • horizontal lazyloading
  • full position handling refactor
  • full .prototype refactor (to allow instanciation)
  • "automated" tests/
  • kisses

New features will be easier to implement using this architecture.

Coming next: callback functions to handle your crazy shit like retina

vvo added some commits Dec 5, 2012

Refactoring, you can now instantiate
Backward compatible with old "lzld"
Some events are now globally listened
Has for resize and load on window
Going all prototype baby
Why ? Seemed the only true way to have multiple instances of Lazyload
and keeping a small constructor.

Other options were:
- An enormous constructor wrapping all functions declarations and private variables
  all the way down. See previous commit.
- An enormous constructor wrapping this.fnName = function()
- A small constructor and lots of external functions declarations but
  then you have to pass arguments everywhere (imgs, img, lazyAttr, etc)

Now, I needed this for the next features of the Lazyloader: multiple
instances, different containers (not just body), horizontal and vertical

Closure compiler advanced eats this shit very well (1.2kb) minifying prototypes etc.
Fix retro compatibility init
I was not executing the first lzld call, only instantiating the default
lazyload
Add real tests/
Each test provide a success/error indicator on top left.

Could be easily used and tested on every browser.
Fix edge case on first lazyloaded image
See tests/first-image-src.html
Change the way we create window.lzld
Now to get lzld main function you would do:

window.lzld = (new Lazyload).lzld;
Add horizontal lazyloading
Completely change the way we find the element position.

Fixes #8
Update licences
Double MIT licence, zeroload, fasterize
CC
Code Conventions
Add specific container test
YAY! You cna now use lazyload in any container, not just body

vvo added a commit that referenced this pull request Dec 21, 2012

@vvo vvo merged commit 8c9febe into master Dec 21, 2012

@vvo vvo deleted the experimental branch Dec 21, 2012

@ghost ghost assigned vvo Dec 21, 2012

MoOx commented Dec 21, 2012

C'est beau mais pourquoi une PR à soit même ? Pourquoi pas juste un merge ? POURQUOI ?

Owner

vvo commented Dec 21, 2012

Cpour lfun tsais.

You mentioned "Coming next: callback functions to handle your crazy shit like retina" a couple months ago. Has that been implemented and I just missed it are does it still need to be done? I would be happy to help if you had some thoughts on how to go about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment