ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on May 05, 2014, 01:38:44 pm

Title: [ADDON] Images Lazy Loading
Post by: emanuele on May 05, 2014, 01:38:44 pm
Images Lazy Loading v0.0.2
Introduction
Yet another simple addon: it makes all the images "lazy load (http://www.webresourcesdepot.com/lazy-loading-of-images-resources-you-need/)"[1].
In order to do the lazy loading, the Lazy Load Plugin for jQuery (http://www.appelsiini.net/projects/lazyload) is used.


License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Repository / Download
First result I found searching for lazy load :P
Title: Re: Images Lazy Loading
Post by: [SiNaN] on May 05, 2014, 02:03:39 pm
It would be nice if you included Beta versions in the required version range - makes the testing easier. I had to modify it myself.

In package-info.xml the name and destination of the JavaScript file is incorrect. So it doesn't install unless you fix those.

Also I'm not sure if lazy loading all the images on the page is a good idea. Maybe you should just limit it to images in posts, signatures and avatars.
Title: Re: Images Lazy Loading
Post by: emanuele on May 05, 2014, 04:42:15 pm
Oook. I should not change my mind so often... :-\
Should be fixed now. Thanks! (And sorry for the troubles. :-[)

Yup, the first idea was avatars and attachments, then I wend for "everything" just because it was easier. lol
At the moment is more a childish game, rather than something really useful. :P

I'll play some more in the next days. ;D
Title: Re: Images Lazy Loading
Post by: [SiNaN] on May 05, 2014, 05:14:50 pm
You don't seem to have THEMEDIR, so use $themedir. You can also just set the range as 1.0 beta 2 - 1.0.99; compareVersions() can handle that. (guess who coded it! :P)

For avatars, posts and signatures, you can just look for classes "avatar" and "bbc_image". Attachments don't seem to have a class attached to them but you could probably use the ";image" bit to catch them. (it would have been nice if they had a class though)
Title: Re: Images Lazy Loading
Post by: emanuele on May 05, 2014, 05:19:07 pm
I thought we changed for all-caps the theme dir as well.... meh.

/me opens a ranting topic.
Title: Re: [ADDON] Images Lazy Loading
Post by: txcas on February 13, 2016, 01:52:03 pm
I don't know why, but this brought my forum to a crawl.  Uninstalled it and everything is snappy again.
Title: Re: [ADDON] Images Lazy Loading
Post by: emanuele on February 19, 2016, 09:24:08 am
"Nice" to know.
It may be related to the buffer-rewriting it does in order to replace the images... I have to check it out more.
Title: Re: [ADDON] Images Lazy Loading
Post by: hartiberlin on January 24, 2018, 02:49:12 pm
Does this still work with Elkarte 1.1.1 ?
Title: Re: [ADDON] Images Lazy Loading
Post by: Frenzie on January 25, 2018, 08:56:31 am
It looks to me like it very well might. Why don't you give it a try?
Title: Re: [ADDON] Images Lazy Loading
Post by: badmonkey on January 25, 2018, 12:45:51 pm
It works fine on 1.1.1.   ;)
Title: Re: [ADDON] Images Lazy Loading
Post by: Spuds on November 06, 2022, 01:08:50 pm
I've made a PR to the official repo, but until that makes it through the system, here is a minor update