Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aFarkas/lazysizes
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1.2
Choose a base ref
...
head repository: aFarkas/lazysizes
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: gh-pages
Choose a head ref
Loading
Showing with 22,456 additions and 1,234 deletions.
  1. +15 −0 .editorconfig
  2. +30 −0 .github/ISSUE_TEMPLATE/bug_report.md
  3. +22 −0 .github/ISSUE_TEMPLATE/feature_request.md
  4. +10 −0 .github/ISSUE_TEMPLATE/other-issues.md
  5. +21 −0 .github/ISSUE_TEMPLATE/question.md
  6. +6 −0 .gitignore
  7. +23 −0 .npmignore
  8. +4 −0 BingSiteAuth.xml
  9. +163 −0 CHANGELOG.md
  10. +57 −11 Gruntfile.js
  11. +1 −1 LICENSE
  12. +669 −66 README.md
  13. +727 −0 animate.html
  14. +21 −11 assets/css/bootstrap-theme.css
  15. +4 −4 assets/css/bootstrap-theme.min.css
  16. +1,798 −279 assets/css/bootstrap.css
  17. +4 −4 assets/css/bootstrap.min.css
  18. +197 −0 assets/css/carousel.css
  19. +415 −211 assets/css/tidy.css
  20. BIN assets/imgs/loader.gif
  21. +13 −6 bower.json
  22. +1 −1 component.json
  23. +462 −231 index.html
  24. +815 −0 lazysizes-umd.js
  25. +3 −0 lazysizes-umd.min.js
  26. +81 −0 lazysizes.d.ts
  27. +717 −381 lazysizes.js
  28. +3 −3 lazysizes.min.js
  29. +811 −0 no-src.html
  30. +888 −0 optimumx/child.html
  31. +105 −0 optimumx/index.html
  32. +60 −0 optimumx/js/parent.js
  33. +4,755 −0 package-lock.json
  34. +68 −25 package.json
  35. +5 −0 plugins/README.md
  36. +138 −0 plugins/artdirect/README.md
  37. +176 −0 plugins/artdirect/ls.artdirect.js
  38. +3 −0 plugins/artdirect/ls.artdirect.min.js
  39. +66 −0 plugins/aspectratio/README.md
  40. +211 −0 plugins/aspectratio/ls.aspectratio.js
  41. +3 −0 plugins/aspectratio/ls.aspectratio.min.js
  42. +13 −0 plugins/attrchange/README.md
  43. +130 −0 plugins/attrchange/ls.attrchange.js
  44. +3 −0 plugins/attrchange/ls.attrchange.min.js
  45. +58 −0 plugins/bgset/README.md
  46. +203 −0 plugins/bgset/ls.bgset.js
  47. +3 −0 plugins/bgset/ls.bgset.min.js
  48. +123 −0 plugins/blur-up/README.md
  49. +238 −0 plugins/blur-up/ls.blur-up.js
  50. +3 −0 plugins/blur-up/ls.blur-up.min.js
  51. +83 −0 plugins/custommedia/README.md
  52. +77 −0 plugins/custommedia/ls.custommedia.js
  53. +3 −0 plugins/custommedia/ls.custommedia.min.js
  54. +5 −0 plugins/fix-edge-h-descriptor/README.md
  55. +81 −0 plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js
  56. +3 −0 plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.min.js
  57. +83 −0 plugins/fix-ios-sizes/fix-ios-sizes.js
  58. +3 −0 plugins/fix-ios-sizes/fix-ios-sizes.min.js
  59. +449 −0 plugins/include/README.md
  60. +588 −0 plugins/include/ls.include.js
  61. +3 −0 plugins/include/ls.include.min.js
  62. +69 −0 plugins/native-loading/README.md
  63. +115 −0 plugins/native-loading/ls.native-loading.js
  64. +3 −0 plugins/native-loading/ls.native-loading.min.js
  65. +72 −0 plugins/noscript/README.md
  66. +84 −0 plugins/noscript/ls.noscript.js
  67. +3 −0 plugins/noscript/ls.noscript.min.js
  68. +90 −0 plugins/object-fit/README.md
  69. +202 −0 plugins/object-fit/ls.object-fit.js
  70. +3 −0 plugins/object-fit/ls.object-fit.min.js
  71. +233 −0 plugins/optimumx/README.md
  72. +255 −0 plugins/optimumx/ls.optimumx.js
  73. +3 −0 plugins/optimumx/ls.optimumx.min.js
  74. +87 −0 plugins/parent-fit/README.md
  75. +174 −0 plugins/parent-fit/ls.parent-fit.js
  76. +3 −0 plugins/parent-fit/ls.parent-fit.min.js
  77. +3 −0 plugins/print/README.md
  78. +53 −0 plugins/print/ls.print.js
  79. +3 −0 plugins/print/ls.print.min.js
  80. +26 −0 plugins/progressive/README.md
  81. +51 −0 plugins/progressive/ls.progressive.js
  82. +3 −0 plugins/progressive/ls.progressive.min.js
  83. +114 −0 plugins/respimg/README.md
  84. +311 −0 plugins/respimg/ls.respimg.js
  85. +3 −0 plugins/respimg/ls.respimg.min.js
  86. +362 −0 plugins/rias/README.md
  87. +408 −0 plugins/rias/ls.rias.js
  88. +3 −0 plugins/rias/ls.rias.min.js
  89. +84 −0 plugins/static-gecko-picture/ls.static-gecko-picture.js
  90. +3 −0 plugins/static-gecko-picture/ls.static-gecko-picture.min.js
  91. +67 −0 plugins/twitter/ls.twitter.js
  92. +3 −0 plugins/twitter/ls.twitter.min.js
  93. +41 −0 plugins/unload/README.md
  94. +158 −0 plugins/unload/ls.unload.js
  95. +3 −0 plugins/unload/ls.unload.min.js
  96. +63 −0 plugins/unveilhooks/README.md
  97. +184 −0 plugins/unveilhooks/ls.unveilhooks.js
  98. +3 −0 plugins/unveilhooks/ls.unveilhooks.min.js
  99. +11 −0 plugins/video-embed/README.md
  100. +131 −0 plugins/video-embed/ls.video-embed.js
  101. +3 −0 plugins/video-embed/ls.video-embed.min.js
  102. +268 −0 rias/index.html
  103. +8 −0 src/common.wrapper
  104. +805 −0 src/lazysizes-core.js
  105. +544 −0 src/lazysizes-intersection.js
  106. +10 −0 src/umd.wrapper
  107. +722 −0 tests/functional-tests-plugins.js
  108. +562 −0 tests/functional-tests.js
  109. +44 −0 tests/index.html
  110. +72 −0 tests/test-files/content-file.html
  111. +46 −0 tests/test-files/matchMedia.js
  112. +62 −0 tests/test-helper.js
  113. +14 −0 tsconfig.json
  114. +56 −0 types/global.d.ts
  115. +30 −0 types/lazysizes-config.d.ts
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# editorconfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_size = 2
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A short, clear and concise description of what the bug is.

**To Reproduce**
Provide a url where the bug can be reproduced. (Use for example: [jsbin](https://jsbin.com), [codepen](https://codepen.io), [jsfiddle.net](https://jsfiddle.net) or [codesandbox.io](https://codesandbox.io)

**Steps to reproduce the behavior:**
Provide all necessary steps to reproduce the bug.

**What is the expected behavior:**


**What happened instead:**


**In what environment (browser/device etc.) does this bug happen/not happen:**

**Keywords help others to find this issue:**

⚠️ Search for existing open/closed issues/discussions before you report the issue.
⚠️ If you do not provide enough information to reproduce your bug. We won't be able to work on the issue. In most cases just providing a fraction of your code is not enough!
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

⚠️ Consider that most features can be solved by the simple plugin architecture and that most features doesn't need to be added to the core.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/other-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Other issues
about: If the other templates don't fit...
title: ''
labels: ''
assignees: ''

---

⚠️ Search for existing open/closed issues/discussions before you open your issue.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Question
about: Ask questions about the API and integration
title: ''
labels: question
assignees: ''

---

**Describe your problem/question**
A complete but concise description of your problem and how you are trying to fix it and where you are struggling.

**Make it reproduce-able**
If your problem is with code or the expected answer should include code provide a live code example using https://jsbin.com/ or https://codesandbox.io/.

**Add tags/keywords**
Make sure others can find your problem.

⚠️ Search for existing open/closed issues/discussions before you ask your question.
⚠️ I work on my spare time on helping users out. This means make it easy for me to simply see your live problem and help to fix it.
🤘 No panic: Don't be afraid to ask a question.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.bak
*.zip
.*
/play
node_modules
bower_components
23 changes: 23 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.bak
*.zip
.*
/play
node_modules
bower_components
/test
/tests
/maxdpr
/rias
/optimumx
/assets
/include
/plato-report
/src
index.html
no-src.html
user-developer-experience.html
animate.html
Gruntfile.js
component.json
bower.json
Authors.txt
4 changes: 4 additions & 0 deletions BingSiteAuth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<users>
<user>D45AA4276907D8A86808F0D7C84BC7BC</user>
</users>
163 changes: 163 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Changelog

### 5.3.1
- Added basic Typescript support

### 5.3.0

- BGSet: Support adding multiple images/backgrounds through `event.detail.fullSrc` ([#827](https://github.com/aFarkas/lazysizes/issues/827))
- RiaS plugin: Use `source` based config in case of `picture` element usage ([#764](https://github.com/aFarkas/lazysizes/issues/831))
- BlurUp plugin: Added possibility to change classNames ([#814](https://github.com/aFarkas/lazysizes/pull/814))
- Core: Added `iframeLoadMode` option (see [#810](https://github.com/aFarkas/lazysizes/pull/810))

## 5.2.2
- Add correct AMD module pattern for plugins.

## 5.2.1

- BlurUp-Plugin: Copy style attribute ([#764](https://github.com/aFarkas/lazysizes/pull/764))
- Fixes minor security issue with video-embed plugin ([#764](https://github.com/aFarkas/lazysizes/pull/764))
- Built: Update dependencies ([#774](https://github.com/aFarkas/lazysizes/pull/774), [#756](https://github.com/aFarkas/lazysizes/pull/756))
- Fixes diverse issues with old AMD module pattern ([#780](https://github.com/aFarkas/lazysizes/pull/780), [#779](https://github.com/aFarkas/lazysizes/pull/779))

## 5.2.0

* Fix wrong window context under very rare SSR (fixes [#717](https://github.com/aFarkas/lazysizes/pull/717))
* Fix Safari Back-Forward Cache issue with lazyloading image elements (fixes [#711](https://github.com/aFarkas/lazysizes/issues/711))
* Add lazyload of autoplay videos to unveilhooks (fixes [#697](https://github.com/aFarkas/lazysizes/issues/697))

## 5.1.2

* Fix visibility check (fixes [#709](https://github.com/aFarkas/lazysizes/issues/709))

## 5.1.1

* Fix ratio calculation in rias plugin (fixed in [#685](https://github.com/aFarkas/lazysizes/pull/685) by [tikotzky](https://github.com/tikotzky))
* Make thumb size for youtube poster image in video-embed plugin configurable (see [#681](https://github.com/aFarkas/lazysizes/pull/681) thx to [@nikitasol](https://github.com/nikitasol))

## 5.1.0

* Allow import/execution in node environment
* Use "hqdefault" for youtube poster image in video-embed plugin fixes [#666](https://github.com/aFarkas/lazysizes/issues/666)

## 5.0.0

* Use `width`/`height` content attributes to detect physical aspect ratio of image candidates, if `data-aspectratio` and `h`/`w` descriptors are missing. [#642](https://github.com/aFarkas/lazysizes/issues/642)
* Do not leak global `lazySizesConfig` anymore fixes [#647](https://github.com/aFarkas/lazysizes/issues/647)
* Improve handling of cloned object-fit images fixes [#648](https://github.com/aFarkas/lazysizes/issues/648)
* Improve blur-up/effect plugin.
* Add support for native `loading="lazy"` feature as a [native loading plugin](https://github.com/aFarkas/lazysizes/tree/gh-pages/plugins/native-loading).

## 4.1.8

* Added the class `ls-is-cached` to already cached images.
* Added h descriptor parsing fix plugin for MS edge (was already included in respimg polyfill.)
* Effects-Plugin/Blur Up plugin: Remove [].find because IE..., fixes [#631](https://github.com/aFarkas/lazysizes/issues/631)
* Documentation stuff
* Bring back *.min.js files to npm package, but don't use them in your `import`/`require`. These are mostly for CDNs. Not for Common JS bundlers.

## 4.1.7

* Blur Up plugin: make blur up mode configurable by script
* Unload Plugin: Fix unload plugin not knowing current expand, fixes [#608](https://github.com/aFarkas/lazysizes/issues/608)
* simplify resetPreloading and switchLoadingClass, fixes [#614](https://github.com/aFarkas/lazysizes/issues/614)

## 4.1.6

* Several Readme fixes
* Allow expand, hFax and expFactor to be changed after initialization, see [#581](https://github.com/aFarkas/lazysizes/issues/581)

## 4.1.5

* Blur Up plugin: Add an empty alt attribute to the blur image to satisfy a11y [c3256d6](https://github.com/aFarkas/lazysizes/commit/c3256d61c002a984ab3e644e922b0fdc052519d8)
* Blur Up plugin: added aria-hidden attribute [1d62efb](https://github.com/aFarkas/lazysizes/commit/1d62efb352f579d4505bd3d76d8166db2db9481f)
* RiaS plugin: fix wrong ratio calculation, fixes [#550](https://github.com/aFarkas/lazysizes/issues/550)
* Rias Plugin: add aspect-ratio to rias for calculating height, fixes [#557](https://github.com/aFarkas/lazysizes/issues/557)

## 4.1.4

* Resolve race condition with blurImg [dffa93b](https://github.com/aFarkas/lazysizes/commit/dffa93b804302363aceb7dc814b01629014ed03b)
* make intersectionobserver version compatible with plugins [2f1a025](https://github.com/aFarkas/lazysizes/commit/2f1a02531eb96e828d42fb7877e776b810d7f346)

## 4.1.3

* change from custom to basic event interface (maybe fixes [#520](https://github.com/aFarkas/lazysizes/issues/527))
* Clarify data-aspectratio attribute [d868605](https://github.com/aFarkas/lazysizes/commit/d8686050adeb68aae14e522bed12d68ab00b7595)

## 4.1.2

* fixes race condition with blurupimg [#527](https://github.com/aFarkas/lazysizes/issues/527)
* add proxy change event to extend bgset [#532](https://github.com/aFarkas/lazysizes/issues/532)


## 4.1.1

* See [3ace9f3](https://github.com/aFarkas/lazysizes/commit/3ace9f359617409fe2824311032439fcf76a7c99)

## 4.1.0

* improve effect plugin

## 4.0.4

* fixes issue in bgset introduced with version 4.0.3

## 4.0.3

* add [blur up plugin](https://jsfiddle.net/trixta/v0oq0412/embedded/result/)

## 4.0.0

* 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.
Loading