1// This file will be run in the footer on every page. 2// It should be used for content that relates 3// to your site as a whole, it should not be used for 4// plugin-specific js 5 6require(["jquery", "site_gtm", "sv_load!plugins_dynamic_content", "sv_siteFoundation", "domReady!", "plugins_common_custom_intersectionobserver"], function($, gtm, dynamic) { 7 $(document).foundation(); 8 gtm.sendCustomPageview({ tClient_pageview: {}, tCore_pageview : {}}, "shared_footerJs"); 9 gtm.update(); 10 11 // CRM FORM STYLING HELPER JS. This should exist in footer JS file. 12 if (location.search.indexOf('action=popupCal') > -1 && document.body.querySelectorAll('.lookup-calHolder')) { 13 $('.lookup-calHolder').parents().show().addClass('crm-calendar-parent'); 14 } 15 16 //lazyloading logic 17 function lazyLoader(){ 18 var targets = document.querySelectorAll("[data-sv-lazy-img]"); 19 var options = { 20 root : null, 21 rootMargin : "100px", 22 threshold: 0.1 23 } 24 25 //polyfill should support IE, but fallback to immediately loading images if not 26 if(!("IntersectionObserver" in window)){ 27 for(var i=0; i<targets.length; i++){ 28 var src = targets[i].dataset.src; 29 targets[i].setAttribute("src", src); 30 } 31 }else{ 32 var io = new IntersectionObserver(onObserve, options); 33 34 function onObserve(entries){ 35 entries.forEach(function(entry){ 36 if(entry.isIntersecting){ 37 var src = entry.target.dataset.src; 38 entry.target.setAttribute("src", src); 39 entry.target.unobserve; 40 } 41 }); 42 } 43 44 for(var i=0; i<targets.length; i++){ 45 io.observe(targets[i]); 46 } 47 } 48 } 49 lazyLoader(); 50 51});
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.