1(function () { 2 var safetyTimer; 3 var showTimer; 4 var pagePattern = /\/(?:artiste|liste_artistes)[0-9]*\.cfm(?:\/|$)/i; 5 6 function loader() { 7 return document.getElementById('site-loading'); 8 } 9 10 function show() { 11 var element = loader(); 12 if (!element) return; 13 window.clearTimeout(showTimer); 14 window.clearTimeout(safetyTimer); 15 showTimer = window.setTimeout(function () { 16 element.classList.add('is-active'); 17 element.setAttribute('aria-hidden', 'false'); 18 safetyTimer = window.setTimeout(hide, 15000); 19 }, 120); 20 } 21 22 function hide() { 23 var element = loader(); 24 window.clearTimeout(showTimer); 25 window.clearTimeout(safetyTimer); 26 if (!element) return; 27 element.classList.remove('is-active'); 28 element.setAttribute('aria-hidden', 'true'); 29 } 30 31 function eligibleLink(event, anchor) { 32 if (!anchor || event.defaultPrevented || event.button !== 0) return false; 33 if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return false; 34 if (anchor.target === '_blank' || anchor.hasAttribute('download')) return false; 35 var rawHref = anchor.getAttribute('href') || ''; 36 if (!anchor.href || /^javascript:/i.test(rawHref)) return false; 37 if (rawHref.charAt(0) === '#') return false; 38 if (anchor.classList.contains('inline') || anchor.classList.contains('inline2') || anchor.classList.contains('inline-photo')) return false; 39 40 var destination = new URL(anchor.href, window.location.href); 41 return destination.origin === window.location.origin && pagePattern.test(destination.pathname); 42 } 43 44 function loadListingPhoto(element) { 45 var url = element.getAttribute('data-background-image'); 46 if (!url) return; 47 element.style.backgroundImage = 'url("' + url.replace(/"/g, '%22') + '")'; 48 element.style.backgroundRepeat = 'no-repeat'; 49 element.removeAttribute('data-background-image'); 50 element.classList.remove('lazy-listing-photo'); 51 } 52 53 function observeListingPhotos(root) { 54 var photos = (root || document).querySelectorAll('.lazy-listing-photo[data-background-image]'); 55 if (!('IntersectionObserver' in window)) { 56 Array.prototype.forEach.call(photos, loadListingPhoto); 57 return; 58 } 59 60 var observer = new IntersectionObserver(function (entries) { 61 entries.forEach(function (entry) { 62 if (!entry.isIntersecting) return; 63 loadListingPhoto(entry.target); 64 observer.unobserve(entry.target); 65 }); 66 }, { rootMargin: '500px 0px' }); 67 68 Array.prototype.forEach.call(photos, function (photo) { 69 observer.observe(photo); 70 }); 71 } 72 73 document.addEventListener('click', function (event) { 74 var anchor = event.target.closest ? event.target.closest('a') : null; 75 if (eligibleLink(event, anchor)) show(); 76 }, true); 77 78 if (window.jQuery && pagePattern.test(window.location.pathname)) { 79 window.jQuery(document).ajaxStart(show).ajaxStop(hide); 80 } 81 82 window.addEventListener('pageshow', hide); 83 document.addEventListener('DOMContentLoaded', function () { 84 observeListingPhotos(document); 85 }); 86 document.addEventListener('ajaxComplete', function () { 87 observeListingPhotos(document); 88 }); 89 if (window.jQuery) { 90 window.jQuery(document).ajaxComplete(function () { 91 observeListingPhotos(document); 92 }); 93 } 94 window.SiteLoading = { show: show, hide: hide }; 95}());
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.