1/*! lozad.js - v1.3.0 - 2018-02-16 2* https://github.com/ApoorvSaxena/lozad.js 3* Copyright (c) 2018 Apoorv Saxena; Licensed MIT */ 4!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 6const observer = lozad(); // lazy loads elements with default selector as '.lozad' 7observer.observe(); 8 9lozad('.lozad', { 10 loaded: function(el) { 11 // Custom implementation on a loaded element 12 el.classList.add('loaded'); 13 } 14}); 15 16document.addEventListener("DOMContentLoaded", function() { 17 var lazyImages = [].slice.call(document.querySelectorAll("img.lazy")); 18 19 if ("IntersectionObserver" in window) { 20 let lazyImageObserver = new IntersectionObserver(function(entries, observer) { 21 entries.forEach(function(entry) { 22 if (entry.isIntersecting) { 23 let lazyImage = entry.target; 24 lazyImage.src = lazyImage.dataset.src; 25 lazyImage.srcset = lazyImage.dataset.srcset; 26 lazyImage.classList.remove("lazy"); 27 lazyImageObserver.unobserve(lazyImage); 28 } 29 }); 30 }); 31 32 lazyImages.forEach(function(lazyImage) { 33 lazyImageObserver.observe(lazyImage); 34 }); 35 } else { 36 // Possibly fall back to a more compatible method here 37 } 38}); 39 40 41 42 43 44/*! 45 * jQuery Cookie Plugin v1.4.1 46 * https://github.com/carhartl/jquery-cookie 47 * 48 * Copyright 2006, 2014 Klaus Hartl 49 * Released under the MIT license 50 */ 51(function (factory) { 52 if (typeof define === 'function' && define.amd) { 53 // AMD (Register as an anonymous module) 54 define(['jquery'], factory); 55 } else if (typeof exports === 'object') { 56 // Node/CommonJS 57 module.exports = factory(require('jquery')); 58 } else { 59 // Browser globals 60 factory(jQuery); 61 } 62}(function ($) { 63 64 var pluses = /\+/g; 65 66 function encode(s) { 67 return config.raw ? s : encodeURIComponent(s); 68 } 69 70 function decode(s) { 71 return config.raw ? s : decodeURIComponent(s); 72 } 73 74 function stringifyCookieValue(value) { 75 return encode(config.json ? JSON.stringify(value) : String(value)); 76 } 77 78 function parseCookieValue(s) { 79 if (s.indexOf('"') === 0) { 80 // This is a quoted cookie as according to RFC2068, unescape... 81 s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 82 } 83 84 try { 85 // Replace server-side written pluses with spaces. 86 // If we can't decode the cookie, ignore it, it's unusable. 87 // If we can't parse the cookie, ignore it, it's unusable. 88 s = decodeURIComponent(s.replace(pluses, ' ')); 89 return config.json ? JSON.parse(s) : s; 90 } catch(e) {} 91 } 92 93 function read(s, converter) { 94 var value = config.raw ? s : parseCookieValue(s); 95 return $.isFunction(converter) ? converter(value) : value; 96 } 97 98 var config = $.cookie = function (key, value, options) { 99 100 // Write 101 102 if (arguments.length > 1 && !$.isFunction(value)) { 103 options = $.extend({}, config.defaults, options); 104 105 if (typeof options.expires === 'number') { 106 var days = options.expires, t = options.expires = new Date(); 107 t.setMilliseconds(t.getMilliseconds() + days * 864e+5); 108 } 109 110 return (document.cookie = [ 111 encode(key), '=', stringifyCookieValue(value), 112 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 113 options.path ? '; path=' + options.path : '', 114 options.domain ? '; domain=' + options.domain : '', 115 options.secure ? '; secure' : '' 116 ].join('')); 117 } 118 119 // Read 120 121 var result = key ? undefined : {}, 122 // To prevent the for loop in the first place assign an empty array 123 // in case there are no cookies at all. Also prevents odd result when 124 // calling $.cookie(). 125 cookies = document.cookie ? document.cookie.split('; ') : [], 126 i = 0, 127 l = cookies.length; 128 129 for (; i < l; i++) { 130 var parts = cookies[i].split('='), 131 name = decode(parts.shift()), 132 cookie = parts.join('='); 133 134 if (key === name) { 135 // If second argument (value) is a function it's a converter... 136 result = read(cookie, value); 137 break; 138 } 139 140 // Prevent storing a cookie that we couldn't decode. 141 if (!key && (cookie = read(cookie)) !== undefined) { 142 result[name] = cookie; 143 } 144 } 145 146 return result; 147 }; 148 149 config.defaults = {}; 150 151 $.removeCookie = function (key, options) {
152 // Must not alter options, thus extending a fresh object... 153 $.cookie(key, '', $.extend({}, options, { expires: -1 })); 154 return !$.cookie(key); 155 }; 156 157})); 158 159 160$(document).ready(function () { 161 if ($.cookie('cookie-info') !== '1') { 162 $('.cookie-info').fadeIn(); 163 164 $('.cookie-info .close-outer').click(function () { 165 $.cookie('cookie-info', '1', {expires: 31}); 166 $('.cookie-info').remove(); 167 }); 168 } else { 169 $('.cookie-info').remove(); 170 } 171});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.