From 671e5f454b920bd9fc6c6e0371aa6a50717ac75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-David=20Collin?= Date: Mon, 6 Mar 2017 16:02:51 +0100 Subject: [PATCH 1/2] Removed hardcoded reference to "Justlazy" --- src/justlazy.js | 4 ++-- src/justlazy.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/justlazy.js b/src/justlazy.js index 651b8f6..7131dc9 100644 --- a/src/justlazy.js +++ b/src/justlazy.js @@ -161,7 +161,7 @@ var registerLazyLoadByClass = function(imgPlaceholderClass, options) { var placeholders = document.querySelectorAll("." + imgPlaceholderClass); for (var i = 0; i < placeholders.length; ++i) { - Justlazy.registerLazyLoad(placeholders[i], options); + this.registerLazyLoad(placeholders[i], options); } }; @@ -170,4 +170,4 @@ registerLazyLoad: registerLazyLoad, registerLazyLoadByClass: registerLazyLoadByClass }; -})); +})); \ No newline at end of file diff --git a/src/justlazy.min.js b/src/justlazy.min.js index 0468bab..b8a38ca 100644 --- a/src/justlazy.min.js +++ b/src/justlazy.min.js @@ -1 +1 @@ -!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof module&&module.exports?module.exports=b():a.Justlazy=b()}(this,function(){"use strict";var a=function(a,c,d){var e=document.createElement("img"),f=d.progressive||!1;e.onload=function(){d.onloadCallback&&d.onloadCallback.call(e),f||b(a,e,d.onreplaceCallback)},e.onerror=function(){d.onerrorCallback&&d.onerrorCallback.call(e),f||b(a,e,d.onreplaceCallback)},c.title&&(e.title=c.title),c.srcset&&e.setAttribute("srcset",c.srcset),e.alt=c.alt,e.src=c.src,f&&b(a,e,d.onreplaceCallback)},b=function(a,b,c){var d=a.parentNode;d&&(d.replaceChild(b,a),c&&c.call(b))},c=function(a){return{src:a.getAttribute("data-src"),alt:a.getAttribute("data-alt"),title:a.getAttribute("data-title"),srcset:a.getAttribute("data-srcset")}},d=function(a){return a||{}},e=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight,d=b||0;return a.getBoundingClientRect().top-c<=d},f=function(a,b){var c=function(d){e(a,b.threshold)&&(g(a,b),window.removeEventListener?window.removeEventListener(d.type,c,!1):window.detachEvent("on"+d.type,c))};return c},g=function(b,e){var f=c(b),g=d(e);f.src&&(f.alt||""===f.alt)&&a(b,f,g)},h=function(a,b){var c=d(b);if(e(a,c.threshold))g(a,b);else{var h=f(a,c);window.addEventListener?window.addEventListener("scroll",h,!1):window.attachEvent("onscroll",h)}},i=function(a,b){for(var c=document.querySelectorAll("."+a),d=0;d Date: Tue, 7 Mar 2017 11:20:32 +0100 Subject: [PATCH 2/2] bump version --- package.json | 70 ++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index fa7e2fe..7144727 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,36 @@ { - "name": "justlazy", - "main": "src/justlazy.js", - "author": "Fabian Hoffmann", - "description": "Lightweight javascript plugin to lazy load images", - "version": "1.6.0", - "homepage": "http://fhopeman.github.io/justlazy", - "repository": { - "type": "git", - "url": "https://github.com/fhopeman/justlazy" - }, - "bugs": { - "url": "https://github.com/fhopeman/justlazy/issues" - }, - "keywords": [ - "lazy", - "load", - "loading", - "image", - "images" - ], - "license": "MIT", - "devDependencies": { - "grunt": "~1.0.1", - "grunt-cli": "~1.2.0", - "grunt-contrib-connect": "~1.0.2", - "grunt-contrib-jasmine": "~1.0.3", - "grunt-contrib-jshint": "~1.0.0", - "grunt-contrib-uglify": "~2.0.0", - "grunt-contrib-watch": "~1.0.0", - "grunt-saucelabs": "~9.0.0" - }, - "scripts": { - "test": "grunt travis-ci" - } -} + "name": "justlazy", + "main": "src/justlazy.js", + "author": "Fabian Hoffmann", + "description": "Lightweight javascript plugin to lazy load images", + "version": "1.6.1", + "homepage": "http://fhopeman.github.io/justlazy", + "repository": { + "type": "git", + "url": "https://github.com/fhopeman/justlazy" + }, + "bugs": { + "url": "https://github.com/fhopeman/justlazy/issues" + }, + "keywords": [ + "lazy", + "load", + "loading", + "image", + "images" + ], + "license": "MIT", + "devDependencies": { + "grunt": "~1.0.1", + "grunt-cli": "~1.2.0", + "grunt-contrib-connect": "~1.0.2", + "grunt-contrib-jasmine": "~1.0.3", + "grunt-contrib-jshint": "~1.0.0", + "grunt-contrib-uglify": "~2.0.0", + "grunt-contrib-watch": "~1.0.0", + "grunt-saucelabs": "~9.0.0" + }, + "scripts": { + "test": "grunt travis-ci" + } +} \ No newline at end of file