Metadata-Version: 2.0
Name: collective.lazysizes
Version: 1.4.0a1
Summary: Integration of lazysizes, a lightweight lazy loader, into Plone.
Home-page: https://github.com/simplesconsultoria/collective.lazysizes
Author: Simples Consultoria
Author-email: produtos@simplesconsultoria.com.br
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 4.3
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: Products.CMFPlone (>=4.3)
Requires-Dist: Products.CMFQuickInstallerTool
Requires-Dist: Products.GenericSetup
Requires-Dist: lxml
Requires-Dist: plone.api
Requires-Dist: plone.app.imaging
Requires-Dist: plone.app.registry
Requires-Dist: plone.app.upgrade
Requires-Dist: plone.directives.form
Requires-Dist: plone.transformchain
Requires-Dist: repoze.xmliter
Requires-Dist: setuptools
Requires-Dist: zope.i18nmessageid
Requires-Dist: zope.interface
Requires-Dist: zope.schema
Provides-Extra: test
Requires-Dist: AccessControl; extra == 'test'
Requires-Dist: plone.app.robotframework; extra == 'test'
Requires-Dist: plone.app.testing[robot]; extra == 'test'
Requires-Dist: plone.browserlayer; extra == 'test'
Requires-Dist: plone.registry; extra == 'test'
Requires-Dist: plone.testing; extra == 'test'
Requires-Dist: robotsuite; extra == 'test'
Requires-Dist: zope.component; extra == 'test'

********************
collective.lazysizes
********************

.. contents:: Table of Contents

Life, the Universe, and Everything
==================================

This package integrates `lazysizes`_, a lightweight lazy loader, into Plone.

`lazysizes`_ is a fast, SEO-friendly and self-initializing lazyloader for images (including responsive images picture/srcset), iframes, scripts/widgets and much more.
It also prioritizes resources by differentiating between crucial in view and near view elements to make perceived performance even faster.

Mostly Harmless
===============

.. image:: http://img.shields.io/pypi/v/collective.lazysizes.svg
   :target: https://pypi.python.org/pypi/collective.lazysizes

.. image:: https://img.shields.io/travis/collective/collective.lazysizes/master.svg
    :target: http://travis-ci.org/collective/collective.lazysizes

.. image:: https://img.shields.io/coveralls/collective/collective.lazysizes/master.svg
    :target: https://coveralls.io/r/collective/collective.lazysizes

Got an idea? Found a bug? Let us know by `opening a support ticket`_.

.. _`opening a support ticket`: https://github.com/collective/collective.lazysizes/issues

Don't Panic
===========

Installation
------------

To enable this package in a buildout-based installation:

#. Edit your buildout.cfg and add add the following to it::

    [buildout]
    ...
    eggs =
        collective.lazysizes

After updating the configuration you need to run ''bin/buildout'', which will take care of updating your system.

Go to the 'Site Setup' page in a Plone site and click on the 'Add-ons' link.

Check the box next to ``collective.lazysizes`` and click the 'Activate' button.

.. Note::
    You may have to empty your browser cache and save your resource registries in order to see the effects of the product installation.

How does it work
----------------

This package adds a transform to the transform chain to integrate `lazysizes`_ into Plone.

The transform looks for all the ``<img>`` and ``<iframe>`` elements inside the content and does the following:

* appends a ``lazyload`` class
* transforms the ``src`` attribute into a ``data-src`` attribute
* if the element is an ``<img>``, uses an spinner as ``src`` attribute (this is done to maintain valid HTML code)

The transform is only applied to anonymous users.

Todo
----

* implement support for responsive images with ``srcset`` and automatic ``sizes`` attribute
* replace spinner with low resolution image scale (if not to expensive to calculate)
* allow blacklisting images (lazing loading feature could be duplicated on some carousels)

.. _`lazysizes`: https://afarkas.github.io/lazysizes/

Share and Enjoy
===============

``collective.lazysizes`` would not have been possible without the contribution of the following people:

- Héctor Velarde
- `Alexander Farkas`_ (lazysizes)

You can find an updated list of package contributors on `GitHub`_.

Development sponsored by `Simples Consultoria`_.

.. _`Alexander Farkas`: https://github.com/aFarkas
.. _`GitHub`: https://github.com/collective/collective.lazysizes/contributors
.. _`Simples Consultoria`: http://www.simplesconsultoria.com.br/

Changelog
=========

1.4.0a1 (2016-02-23)
--------------------

- Add option to list class identifiers that will not be processed for lazy loading.
  `<img>` and `<iframe>` elements with that class directly applied to them, or to a parent element, will be skiped (closes `#5`_).
  [rodfersou, hvelarde]

- Update lazysizes and respimg polyfill extension to v1.4.0.
  [hvelarde]

- Use a blank image instead of a spinner as placeholder.
  [hvelarde]

- Logging now uses `debug` level instead of `info`.
  [hvelarde]


1.0a1 (2016-01-05)
------------------

- Initial release.

.. _`#5`: https://github.com/collective/collective.lazysizes/issues/5


