Comparing version 2.0.2 to 2.0.3
@@ -5,6 +5,2 @@ # Conduct | ||
# Questions | ||
Please ask all questions in the [Gitter chatroom](https://gitter.im/callmecavs/layzr.js). Registration is simple via GitHub authentication. | ||
# Issues | ||
@@ -11,0 +7,0 @@ |
/*! | ||
* Layzr.js 2.0.2 - A small, fast, and modern library for lazy loading images. | ||
* Layzr.js 2.0.3 - A small, fast, and modern library for lazy loading images. | ||
* Copyright (c) 2016 Michael Cavalea - http://callmecavs.github.io/layzr.js/ | ||
* License: MIT | ||
* License: GPL | ||
*/ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Layzr=e()}}(function(){var e;return function t(e,n,r){function o(u,f){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!f&&s)return s(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(t){var n=e[u][1][t];return o(n?n:t)},a,a.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,n,r){(function(o){!function(t){if("object"==typeof r&&"undefined"!=typeof n)n.exports=t();else if("function"==typeof e&&e.amd)e([],t);else{var i;i="undefined"!=typeof window?window:"undefined"!=typeof o?o:"undefined"!=typeof self?self:this,i.Knot=t()}}(function(){return function e(n,r,o){function i(f,s){if(!r[f]){if(!n[f]){var c="function"==typeof t&&t;if(!s&&c)return c(f,!0);if(u)return u(f,!0);var a=new Error("Cannot find module '"+f+"'");throw a.code="MODULE_NOT_FOUND",a}var d=r[f]={exports:{}};n[f][0].call(d.exports,function(e){var t=n[f][1][e];return i(t?t:e)},d,d.exports,e,n,r,o)}return r[f].exports}for(var u="function"==typeof t&&t,f=0;f<o.length;f++)i(o[f]);return i}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return e.events={},e.on=function(t,n){return e.events[t]=e.events[t]||[],e.events[t].push(n),e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(t,n){return 2===arguments.length?e.events[t].splice(e.events[t].indexOf(n),1):delete e.events[t],e},e.emit=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];var i=e.events[t]&&e.events[t].slice();return i&&i.forEach(function(n){n._once&&e.off(t,n),n.apply(e,r)}),e},e},t.exports=n["default"]},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e("knot.js"),i=r(o);n["default"]=function(){function e(){return window.scrollY||window.pageYOffset}function t(){d=e(),n()}function n(){l||(requestAnimationFrame(function(){return s()}),l=!0)}function r(e){return e.getBoundingClientRect().top+d}function o(e){var t=d,n=t+v,o=r(e),i=o+e.offsetHeight,u=m.threshold/100*v;return i>=t-u&&n+u>=o}function u(e){if(g.emit("src:before",e),h&&e.hasAttribute(m.srcset))e.setAttribute("srcset",e.getAttribute(m.srcset));else{var t=w>1&&e.getAttribute(m.retina);e.setAttribute("src",t||e.getAttribute(m.normal))}g.emit("src:after",e),[m.normal,m.retina,m.srcset].forEach(function(t){return e.removeAttribute(t)}),c()}function f(e){var n=e?"addEventListener":"removeEventListener";return["scroll","resize"].forEach(function(e){return window[n](e,t)}),this}function s(){return v=window.innerHeight,p.forEach(function(e){return o(e)&&u(e)}),l=!1,this}function c(){return p=Array.prototype.slice.call(document.querySelectorAll("["+m.normal+"]")),this}var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],d=e(),l=void 0,p=void 0,v=void 0,m={normal:a.normal||"data-normal",retina:a.retina||"data-retina",srcset:a.srcset||"data-srcset",threshold:a.threshold||0},h=document.body.classList.contains("srcset")||"srcset"in document.createElement("img"),w=window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI,g=(0,i["default"])({handlers:f,check:s,update:c});return g},t.exports=n["default"]},{"knot.js":1}]},{},[2])(2)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Layzr=e()}}(function(){var e;return function t(e,n,r){function o(f,u){if(!n[f]){if(!e[f]){var s="function"==typeof require&&require;if(!u&&s)return s(f,!0);if(i)return i(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(t){var n=e[f][1][t];return o(n?n:t)},d,d.exports,t,e,n,r)}return n[f].exports}for(var i="function"==typeof require&&require,f=0;f<r.length;f++)o(r[f]);return o}({1:[function(t,n,r){(function(o){!function(t){if("object"==typeof r&&"undefined"!=typeof n)n.exports=t();else if("function"==typeof e&&e.amd)e([],t);else{var i;i="undefined"!=typeof window?window:"undefined"!=typeof o?o:"undefined"!=typeof self?self:this,i.Knot=t()}}(function(){return function e(n,r,o){function i(u,s){if(!r[u]){if(!n[u]){var c="function"==typeof t&&t;if(!s&&c)return c(u,!0);if(f)return f(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var a=r[u]={exports:{}};n[u][0].call(a.exports,function(e){var t=n[u][1][e];return i(t?t:e)},a,a.exports,e,n,r,o)}return r[u].exports}for(var f="function"==typeof t&&t,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return e.events={},e.on=function(t,n){return e.events[t]=e.events[t]||[],e.events[t].push(n),e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(t,n){return 2===arguments.length?e.events[t].splice(e.events[t].indexOf(n),1):delete e.events[t],e},e.emit=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];var i=e.events[t]&&e.events[t].slice();return i&&i.forEach(function(n){n._once&&e.off(t,n),n.apply(e,r)}),e},e},t.exports=n["default"]},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e("knot.js"),i=r(o);n["default"]=function(){function e(){return window.scrollY||window.pageYOffset}function t(){a=e(),n()}function n(){l||(requestAnimationFrame(function(){return s()}),l=!0)}function r(e){return e.getBoundingClientRect().top+a}function o(e){var t=a,n=t+v,o=r(e),i=o+e.offsetHeight,f=h.threshold/100*v;return i>=t-f&&n+f>=o}function f(e){if(m.emit("src:before",e),w&&e.hasAttribute(h.srcset))e.setAttribute("srcset",e.getAttribute(h.srcset));else{var t=y>1&&e.getAttribute(h.retina);e.setAttribute("src",t||e.getAttribute(h.normal))}m.emit("src:after",e),[h.normal,h.retina,h.srcset].forEach(function(t){return e.removeAttribute(t)}),c()}function u(e){var n=e?"addEventListener":"removeEventListener";return["scroll","resize"].forEach(function(e){return window[n](e,t)}),this}function s(){return v=window.innerHeight,p.forEach(function(e){return o(e)&&f(e)}),l=!1,this}function c(){return p=Array.prototype.slice.call(document.querySelectorAll("["+h.normal+"]")),this}var d=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],a=e(),l=void 0,p=void 0,v=void 0,h={normal:d.normal||"data-normal",retina:d.retina||"data-retina",srcset:d.srcset||"data-srcset",threshold:d.threshold||0},w=document.body.classList.contains("srcset")||"srcset"in document.createElement("img"),y=window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI,m=(0,i["default"])({handlers:u,check:s,update:c});return m},t.exports=n["default"]},{"knot.js":1}]},{},[2])(2)}); |
{ | ||
"name": "layzr.js", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "A small, fast, and modern library for lazy loading images.", | ||
@@ -9,3 +9,3 @@ "homepage": "http://callmecavs.github.io/layzr.js/", | ||
"author": "Michael Cavalea", | ||
"license": "MIT", | ||
"license": "GPL", | ||
@@ -12,0 +12,0 @@ "repository": { |
# Layzr.js | ||
[![Layzr.js on NPM](https://img.shields.io/npm/v/layzr.js.svg)](https://www.npmjs.com/package/layzr.js) [![Layzr.js on Gitter](https://img.shields.io/badge/gitter-join%20chat-green.svg)](https://gitter.im/callmecavs/layzr.js) | ||
[![Layzr.js on NPM](https://img.shields.io/npm/v/layzr.js.svg?style=flat-square)](https://www.npmjs.com/package/layzr.js) | ||
@@ -31,2 +31,3 @@ A small, fast, and modern library for lazy loading images. | ||
* [Download](#download) | ||
* [Framework Bridge](#framework-bridge) | ||
@@ -56,3 +57,3 @@ Refer to the [releases](https://github.com/callmecavs/layzr.js/releases) page for version specific information. | ||
```html | ||
<script src="https://cdn.jsdelivr.net/layzr.js/2.0.0/layzr.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/layzr.js/2.0.2/layzr.min.js"></script> | ||
``` | ||
@@ -63,3 +64,3 @@ | ||
```html | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/layzr.js/2.0.0/layzr.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/layzr.js/2.0.2/layzr.min.js"></script> | ||
``` | ||
@@ -75,2 +76,8 @@ | ||
### Framework Bridge | ||
Thank you to the community members who created these framework bridges! | ||
* Ruby on Rails: [layzr-rails](https://github.com/mohitjain/layzr-rails) by [Mohit Jain](https://github.com/mohitjain) | ||
## Setup Images | ||
@@ -83,3 +90,3 @@ | ||
Note that all attribute names are configureable via the [options](#options) passed to Layzr. To indicate potential sources, add the following attributes to your images: | ||
Note that all attribute names are configurable via the [options](#options) passed to Layzr. To indicate potential sources, add the following attributes to your images: | ||
@@ -218,3 +225,3 @@ | Name | Required | Optional | | ||
Load event handlers should be attached using this event. See the [example](https://github.com/callmecavs/layzr.js/blob/v2.0.0/examples/large.js), and note the [caveats](https://api.jquery.com/load-event/) associated with image load events before proceeding. | ||
Load event handlers should be attached using this event. See the [example](https://github.com/callmecavs/layzr.js/blob/master/examples/large.js), and note the [caveats](https://api.jquery.com/load-event/) associated with image load events before proceeding. | ||
@@ -267,3 +274,3 @@ ### src:after | ||
**Dynamically added elements** should be handled using this method. See the [example](https://github.com/callmecavs/layzr.js/blob/v2.0.0/examples/large.js). | ||
**Dynamically added elements** should be handled using this method. See the [example](https://github.com/callmecavs/layzr.js/blob/master/examples/large.js). | ||
@@ -298,4 +305,4 @@ ## Browser Support | ||
MIT. © 2016 Michael Cavalea | ||
[GPL](http://www.gnu.org/licenses/gpl.txt). © 2016 Michael Cavalea | ||
[![Built With Love](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301
21997
11
1