owncloud/core — pull request #6692 by rnveach (2014-01-09 02:31:08+00:00)
Title: Adding Lazy Image Load for Icons

This is my first fork and pull request, so I hope nothing is wrong with it.
I originally submitted a feature request for changing always loading file icon images to lazy loading them to save on bandwidth when opening a folder with many pictures inside it.
The original issue can be read here at https://github.com/owncloud/core/issues/6591 and all my reasoning for the need of this addition.

I have made small changes to the owncloud's core app "files" that achieves this functionality and am submitting it here so hopefully it can be incorporated.
The main addition is the JQuery Lazy Load library that I found at http://www.appelsiini.net/projects/lazyload , which can be used, as is, with no modifications. The library is released under the MIT License, which I believe it compatible with owncloud's APGL. Correct me if I am wrong.
The main changes to the file listing is replacing the background image style for the icon and putting it into a custom attribute that Lazy Load recognizes and works with.
The only other change is the call to the Lazy Load function in JS to monitor the user scrolling and position in the document.

I have tested this with owncloud 6.0.0a and found no issues in IE8 and FF26. The images that are not in view don't load when opening a directory (verified with firebug's net panel), the images are loaded correctly when scrolled into view, and cached images still show up rather instantly. I didn't see any problems with applying the changes to the master in git.