Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add print plugin, use npm package via yarn #51

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 5 additions & 12 deletions .gitignore
@@ -1,15 +1,8 @@
*.egg-info
*.mo
*.pyc
*~
.*.kate-swp
.coverage
.DS_Store
.installed.cfg
.mr.developer.cfg
.project
.pydevproject
.settings/
.*
!.yarnrc
!.gitignore
!.coveragerc
!.travis.yml
bin/
coverage/
develop-eggs/
Expand Down
1 change: 1 addition & 0 deletions .yarnrc
@@ -0,0 +1 @@
--modules-folder src/collective/lazysizes/static
9 changes: 9 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,15 @@ Changelog
4.0.2 (unreleased)
------------------

- Remove unused dependencies from setup.py.
[thet]

- Add the print plugin by default.
[thet]

- Use ``yarn`` to manage JavaScript dependencies and upgrade resource paths to new location.
[thet]

- Avoid ``ValueError`` when upgrading from profile version 3 (fixes `#46 <https://github.com/collective/collective.lazysizes/issues/46>`_).
[hvelarde]

Expand Down
8 changes: 8 additions & 0 deletions package.json
@@ -0,0 +1,8 @@
{
"name": "collective.lazysizes",
"repository": "git@github.com:collective/collective.lazysizes.git",
"license": "GPLv2",
"dependencies": {
"lazysizes": "4.0.1"
}
}
4 changes: 1 addition & 3 deletions setup.py
Expand Up @@ -40,10 +40,8 @@
zip_safe=False,
install_requires=[
'lxml',
'plone.api',
'plone.app.imaging',
'plone.app.registry >=1.5',
'plone.app.upgrade',
'plone.autoform',
'plone.supermodel',
'plone.transformchain',
Expand All @@ -52,6 +50,7 @@
'Products.ResourceRegistries >=2.2.12',
'repoze.xmliter',
'setuptools',
'zope.component',
'zope.i18nmessageid',
'zope.interface',
'zope.schema',
Expand All @@ -66,7 +65,6 @@
'plone.testing',
'robotsuite',
'testfixtures',
'zope.component',
],
},
entry_points="""
Expand Down
9 changes: 7 additions & 2 deletions src/collective/lazysizes/profiles/default/jsregistry.xml
@@ -1,11 +1,16 @@
<?xml version="1.0"?>
<object name="portal_javascripts">
<javascript id="++resource++collective.lazysizes/ls.twitter.min.js"
<javascript id="++resource++collective.lazysizes/lazysizes/plugins/twitter/ls.twitter.min.js"
cacheable="True" compression="none" cookable="True" enabled="True"
expression="" inline="False"
insert-before="++resource++collective.lazysizes/lazysizes-umd.min.js"
insert-before="++resource++collective.lazysizes/lazysizes/lazysizes-umd.min.js"
/>
<javascript id="++resource++collective.lazysizes/lazysizes-umd.min.js"
cacheable="True" compression="none" cookable="True" enabled="True"
expression="" inline="False" />
<javascript id="++resource++collective.lazysizes/lazysizes/plugins/print/ls.print.js"
cacheable="True" compression="none" cookable="True" enabled="True"
expression="" inline="False"
insert-after="++resource++collective.lazysizes/lazysizes-umd.min.js"
/>
</object>
2 changes: 1 addition & 1 deletion src/collective/lazysizes/profiles/default/metadata.xml
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<metadata>
<version>9</version>
<version>10</version>
</metadata>
9 changes: 7 additions & 2 deletions src/collective/lazysizes/profiles/default/registry.xml
Expand Up @@ -16,18 +16,23 @@
<value key="resources">
<element>lazysizes-twitter</element>
<element>lazysizes</element>
<element>lazysizes-print</element>
</value>
</records>

<!-- PLONE 5 RESOURCES - to depend on from other modules. -->
<records prefix="plone.resources/lazysizes" interface='Products.CMFPlone.interfaces.IResourceRegistry'
condition="have plone-5">
<value key="js">++plone++collective.lazysizes/lazysizes-umd.js</value>
<value key="js">++plone++collective.lazysizes/lazysizes/lazysizes-umd.js</value>
<value key="url">++plone++collective.lazysizes</value>
</records>
<records prefix="plone.resources/lazysizes-twitter" interface='Products.CMFPlone.interfaces.IResourceRegistry'
condition="have plone-5">
<value key="js">++plone++collective.lazysizes/ls.twitter.js</value>
<value key="js">++plone++collective.lazysizes/lazysizes/plugins/twitter/ls.twitter.js</value>
</records>
<records prefix="plone.resources/lazysizes-print" interface='Products.CMFPlone.interfaces.IResourceRegistry'
condition="have plone-5">
<value key="js">++plone++collective.lazysizes/lazysizes/plugins/print/ls.print.js</value>
</records>

</registry>
56 changes: 56 additions & 0 deletions src/collective/lazysizes/static/lazysizes/CHANGELOG.md
@@ -0,0 +1,56 @@
# Changelog

## 4.0.0-RC1
* make all plugins CommonJS compatible (thx to @claudiobmgrtnr and @jantimon)
* added `loadHidden` option(thx to @justinvoelker)
* added artdirection plugin (no documentation yet, but great)
* iOS 8.1 fixes has to be loaded explicitly in non CommonJS environments (not included in respimg plugin anymore)
* removed `picture` support for old FF 38-

## 2.0.0

* lazysizes core:
* heavily improved performance (`requestIdleCallback`, better debouncing and a lot more).
* plugins:
* new plugin: [**object fit polyfill**](plugins/object-fit).
* improved new options for [parent-fit plugin](plugins/parent-fit).

## 1.5.0
Breaking change:
* the lazysizes.js and lazysizes.min.js files do not register as AMD modules anymore, if you need an AMD module use the new lazysizes-umd.js or lazysizes-umd.min.js file.
* lazysizes core:
* improved lazyloading in background tabs.
* fixed set lazyloaded class to early in FF.
* bgset/parentFit plugin:
* improved avoiding layout thrashing.
* respimg/bgset/parentFit plugin:
* fixed bug in Edge 14 to parse height descriptors correctly.
* unload plugin:
unload plugin was broken since version 1.4.0 (thanks to @hokamoto)

## 1.4.0
* lazysizes core:
* improved lazyloading in background tabs.
* improved avoiding layout thrashing
* support of SVG elements (`svg`/`image`/`use`...)
* bgset/parentFit plugin:
* improved avoiding layout thrashing
* rias (and bgset):
* added support for height calculation (thx to @LRancez, [#213](https://github.com/aFarkas/lazysizes/pull/213))

## 1.3.2

* lazysizes core:
* add `hFactor` option (see #181).
* unload plugin:
* simplified `unloadPixelThreshold` calculation.
* bgset plugin:
* add an empty alt to image (see #200).

## 1.3.1 version

* lazysizes core:
* replace `setImmediate` with `setTimeout` (improved performance for IE/EDGE).
* plugins:
* fixed conflict with respimg plugin in combination with bgset plugin, in case of art direction and resize to smaller.
* fixed conflict with RIaS plugin in combination with respimg plugin/picturefill in Safari 8/9.
22 changes: 22 additions & 0 deletions src/collective/lazysizes/static/lazysizes/LICENSE
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Alexander Farkas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.