aboutsummaryrefslogtreecommitdiff
path: root/js/thumbnails.min.js
blob: bca3c65efad2c4317719c66d2c29ad35edf9a171 (plain)
1
2
3
4
5
(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=0)})([function(a,b,c){'use strict';var d=c(1),e=function(a){return a&&a.__esModule?a:{default:a}}(d);(function(){new e.default})()},function(a,b,c){var d,e;/*!
  hey, [be]Lazy.js - v1.8.2 - 2016.10.25
  A fast, small and dependency free lazy load script (https://github.com/dinbror/blazy)
  (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy
*/(function(f,g){d=g,e='function'==typeof d?d.call(b,c,b,a):d,!(e!==void 0&&(a.exports=e))})(this,function(){'use strict';function a(a){var c=a._util;c.elements=o(a.options),c.count=c.elements.length,c.destroyed&&(c.destroyed=!1,a.options.container&&t(a.options.container,function(a){q(a,'scroll',c.validateT)}),q(window,'resize',c.saveViewportOffsetT),q(window,'resize',c.validateT),q(window,'scroll',c.validateT)),b(a)}function b(a){for(var b,d=a._util,e=0;e<d.count;e++)b=d.elements[e],(c(b,a.options)||m(b,a.options.successClass))&&(a.load(b),d.elements.splice(e,1),d.count--,e--);0===d.count&&a.destroy()}function c(a,b){var c=a.getBoundingClientRect();if(b.container&&y){var e=a.closest(b.containerClass);if(e){var f=e.getBoundingClientRect();if(d(f,w)){var g=f.top-b.offset,h=f.right+b.offset,i=f.bottom+b.offset,j=f.left-b.offset,k={top:g>w.top?g:w.top,right:h<w.right?h:w.right,bottom:i<w.bottom?i:w.bottom,left:j>w.left?j:w.left};return d(c,k)}return!1}}return d(c,w)}function d(a,b){return a.right>=b.left&&a.bottom>=b.top&&a.left<=b.right&&a.top<=b.bottom}function e(a,b,c){if(!m(a,c.successClass)&&(b||c.loadInvisible||0<a.offsetWidth&&0<a.offsetHeight)){var d=j(a,v)||j(a,c.src);if(d){var e=d.split(c.separator),i=e[x&&1<e.length?1:0],k=j(a,c.srcset),o=l(a,'img'),p=a.parentNode,u=p&&l(p,'picture');if(o||a.src===void 0){var w=new Image,y=function(){c.error&&c.error(a,'invalid'),n(a,c.errorClass),r(w,'error',y),r(w,'load',A)},A=function(){o?!u&&h(a,i,k):a.style.backgroundImage='url("'+i+'")',f(a,c),r(w,'load',A),r(w,'error',y)};u&&(w=a,t(p.getElementsByTagName('source'),function(a){g(a,z,c.srcset)})),q(w,'error',y),q(w,'load',A),h(w,i,k)}else a.src=i,f(a,c)}else l(a,'video')?(t(a.getElementsByTagName('source'),function(a){g(a,s,c.src)}),a.load(),f(a,c)):(c.error&&c.error(a,'missing'),n(a,c.errorClass))}}function f(a,b){n(a,b.successClass),b.success&&b.success(a),k(a,b.src),k(a,b.srcset),t(b.breakpoints,function(b){k(a,b.src)})}function g(a,b,c){var d=j(a,c);d&&(i(a,b,d),k(a,c))}function h(a,b,c){c&&i(a,z,c),a.src=b}function i(a,b,c){a.setAttribute(b,c)}function j(a,b){return a.getAttribute(b)}function k(a,b){a.removeAttribute(b)}function l(a,b){return a.nodeName.toLowerCase()===b}function m(a,b){return-1!==(' '+a.className+' ').indexOf(' '+b+' ')}function n(a,b){m(a,b)||(a.className+=' '+b)}function o(a){for(var b=[],c=a.root.querySelectorAll(a.selector),d=c.length;d--;b.unshift(c[d]));return b}function p(a){w.bottom=(window.innerHeight||document.documentElement.clientHeight)+a,w.right=(window.innerWidth||document.documentElement.clientWidth)+a}function q(a,b,c){a.attachEvent?a.attachEvent&&a.attachEvent('on'+b,c):a.addEventListener(b,c,{capture:!1,passive:!0})}function r(a,b,c){a.detachEvent?a.detachEvent&&a.detachEvent('on'+b,c):a.removeEventListener(b,c,{capture:!1,passive:!0})}function t(a,b){if(a&&b)for(var c=a.length,d=0;d<c&&!1!==b(a[d],d);d++);}function u(a,b,c){var d=0;return function(){var e=+new Date;e-d<b||(d=e,a.apply(c,arguments))}}var v,w,x,y,s='src',z='srcset';return function(c){if(!document.querySelectorAll){var d=document.createStyleSheet();document.querySelectorAll=function(b,e,c,f,g){for(g=document.all,e=[],b=b.replace(/\[for\b/gi,'[htmlFor').split(','),c=b.length;c--;){for(d.addRule(b[c],'k:v'),f=g.length;f--;)g[f].currentStyle.k&&e.push(g[f]);d.removeRule(0)}return e}}var f=this,g=f._util={};g.elements=[],g.destroyed=!0,f.options=c||{},f.options.error=f.options.error||!1,f.options.offset=f.options.offset||100,f.options.root=f.options.root||document,f.options.success=f.options.success||!1,f.options.selector=f.options.selector||'.b-lazy',f.options.separator=f.options.separator||'|',f.options.containerClass=f.options.container,f.options.container=!!f.options.containerClass&&document.querySelectorAll(f.options.containerClass),f.options.errorClass=f.options.errorClass||'b-error',f.options.breakpoints=f.options.breakpoints||!1,f.options.loadInvisible=f.options.loadInvisible||!1,f.options.successClass=f.options.successClass||'b-loaded',f.options.validateDelay=f.options.validateDelay||25,f.options.saveViewportOffsetDelay=f.options.saveViewportOffsetDelay||50,f.options.srcset=f.options.srcset||'data-srcset',f.options.src=v=f.options.src||'data-src',y=Element.prototype.closest,x=1<window.devicePixelRatio,w={},w.top=0-f.options.offset,w.left=0-f.options.offset,f.revalidate=function(){a(f)},f.load=function(a,b){var c=this.options;a&&a.length===void 0?e(a,b,c):t(a,function(a){e(a,b,c)})},f.destroy=function(){var a=f._util;f.options.container&&t(f.options.container,function(b){r(b,'scroll',a.validateT)}),r(window,'scroll',a.validateT),r(window,'resize',a.validateT),r(window,'resize',a.saveViewportOffsetT),a.count=0,a.elements.length=0,a.destroyed=!0},g.validateT=u(function(){b(f)},f.options.validateDelay,f),g.saveViewportOffsetT=u(function(){p(f.options.offset)},f.options.saveViewportOffsetDelay,f),p(f.options.offset),t(f.options.breakpoints,function(a){if(a.width>=window.screen.width)return v=a.src,!1}),setTimeout(function(){a(f)})}})}]);