Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lozad

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lozad - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

4

dist/lozad.js

@@ -1,2 +0,2 @@

/*! lozad.js - v1.3.0 - 2018-02-16
/*! lozad.js - v1.4.0 - 2018-04-22
* https://github.com/ApoorvSaxena/lozad.js

@@ -39,3 +39,3 @@ * Copyright (c) 2018 Apoorv Saxena; Licensed MIT */

if (element.getAttribute('data-background-image')) {
element.style.backgroundImage = 'url(' + element.getAttribute('data-background-image') + ')';
element.style.backgroundImage = 'url(\'' + element.getAttribute('data-background-image') + '\')';
}

@@ -42,0 +42,0 @@ },

@@ -1,4 +0,4 @@

/*! lozad.js - v1.3.0 - 2018-02-16
/*! lozad.js - v1.4.0 - 2018-04-22
* https://github.com/ApoorvSaxena/lozad.js
* Copyright (c) 2018 Apoorv Saxena; Licensed MIT */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict";function t(t){t.setAttribute("data-loaded",!0)}var e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},r=document.documentMode,n={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=document.createElement("img");r&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.appendChild(e)}t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&(t.srcset=t.getAttribute("data-srcset")),t.getAttribute("data-background-image")&&(t.style.backgroundImage="url("+t.getAttribute("data-background-image")+")")},loaded:function(){}},o=function(t){return"true"===t.getAttribute("data-loaded")},a=function(e,r){return function(n,a){n.forEach(function(n){n.intersectionRatio>0&&(a.unobserve(n.target),o(n.target)||(e(n.target),t(n.target),r(n.target)))})}},i=function(t){return t instanceof Element?[t]:t instanceof NodeList?t:document.querySelectorAll(t)};return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".lozad",d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=e({},n,d),c=u.rootMargin,s=u.threshold,g=u.load,f=u.loaded,l=void 0;return window.IntersectionObserver&&(l=new IntersectionObserver(a(g,f),{rootMargin:c,threshold:s})),{observe:function(){for(var e=i(r),n=0;n<e.length;n++)o(e[n])||(l?l.observe(e[n]):(g(e[n]),t(e[n]),f(e[n])))},triggerLoad:function(e){o(e)||(g(e),t(e),f(e))}}}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lozad=e()}(this,function(){"use strict";function t(t){t.setAttribute("data-loaded",!0)}var e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},r=document.documentMode,n={rootMargin:"0px",threshold:0,load:function(t){if("picture"===t.nodeName.toLowerCase()){var e=document.createElement("img");r&&t.getAttribute("data-iesrc")&&(e.src=t.getAttribute("data-iesrc")),t.appendChild(e)}t.getAttribute("data-src")&&(t.src=t.getAttribute("data-src")),t.getAttribute("data-srcset")&&(t.srcset=t.getAttribute("data-srcset")),t.getAttribute("data-background-image")&&(t.style.backgroundImage="url('"+t.getAttribute("data-background-image")+"')")},loaded:function(){}},o=function(t){return"true"===t.getAttribute("data-loaded")},a=function(e,r){return function(n,a){n.forEach(function(n){n.intersectionRatio>0&&(a.unobserve(n.target),o(n.target)||(e(n.target),t(n.target),r(n.target)))})}},i=function(t){return t instanceof Element?[t]:t instanceof NodeList?t:document.querySelectorAll(t)};return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".lozad",d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=e({},n,d),c=u.rootMargin,s=u.threshold,g=u.load,f=u.loaded,l=void 0;return window.IntersectionObserver&&(l=new IntersectionObserver(a(g,f),{rootMargin:c,threshold:s})),{observe:function(){for(var e=i(r),n=0;n<e.length;n++)o(e[n])||(l?l.observe(e[n]):(g(e[n]),t(e[n]),f(e[n])))},triggerLoad:function(e){o(e)||(g(e),t(e),f(e))}}}});

@@ -5,3 +5,3 @@ {

"description": "A light-weight JS library to lazy load any HTML element such as images, ads, videos etc.",
"version": "1.3.0",
"version": "1.4.0",
"homepage": "https://github.com/ApoorvSaxena/lozad.js",

@@ -8,0 +8,0 @@ "scripts": {

@@ -199,5 +199,24 @@ # Lozad.js [![npm version](https://badge.fury.io/js/lozad.svg)](https://badge.fury.io/js/lozad) [![Build Status](https://travis-ci.org/ApoorvSaxena/lozad.js.svg?branch=master)](https://travis-ci.org/ApoorvSaxena/lozad.js) [![](https://data.jsdelivr.com/v1/package/npm/lozad/badge)](https://www.jsdelivr.com/package/npm/lozad)

## Sites using Lozad.js
## More than 3000 sites are using Lozad.js, here's few of them:
* [gis.utah.gov](https://gis.utah.gov)
* [Reitmans](https://www.reitmans.com/)
* [Black Desert Online](https://www.blackdesertonline.com/)
* [Barkers](https://www.barkersonline.co.nz/)
* [Promoda](http://www.promoda.com.mx/)
* [Dormy Golf & Fashion AB](https://www.dormy.se/)
* [L'ovedbaby](https://www.lovedbaby.com/)
* [LitNet](https://litnet.com/)
* [CARD.com](https://www.card.com/)
* [Wittchen](https://www.wittchen.com/)
* [Fiege Group](https://www.fiege.com/)
* [Kolgot](https://kolgot.net/)
* [CYSM - Colombia y su Moda](https://cysm.com/)
* [Siege Media](https://www.siegemedia.com/)
* [Hi-Fi Class](https://www.hfc.com.pl/)
* [StagonNews](http://www.stagonnews.gr/)
* [Insurance Zebra](https://www.thezebra.com/)
* [Summoners Inn](https://www.summoners-inn.de/de/start)
* [Roots](https://roots.io/)
* [Chrdk](https://chrdk.ru/)
* [Giving Assistant](https://givingassistant.org/)

@@ -208,5 +227,7 @@ * [Just A Pinch Recipe Club](https://www.justapinch.com/)

* [KickResume](https://www.kickresume.com/)
* [Paper Tiger](https://www.papertiger.com/)
* [Gmelius](https://gmelius.com/)
* [Dormy](https://www.dormy.se/)
* [Nabobil](https://nabobil.no/)
* [Atbox](https://atbox.io/)
* *[Add your site]* - See [Contributing section](./CONTRIBUTING.md)

@@ -213,0 +234,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc