1if (tarteaucitron) { 2 3 var cookiesToObject = function cookiesToObject(cookies) { 4 return cookies.split('!').filter(function (cookie) { 5 return cookie !== ''; 6 }).reduce(function (current, next) { 7 var nextSplit = next.split('='), 8 key = nextSplit[0], 9 value = nextSplit[1]; 10 current[key] = value; 11 return current; 12 }, {}); 13 }; 14 15 var handleFancyboxServiceCookies = function handleFancyboxServiceCookies() { 16 var cookies = cookiesToObject(tarteaucitron.cookie.read()); 17 18 if (cookies.youtube === 'false' || cookies.vimeo === 'false' || cookies.dailymotion === 'false') { 19 tarteaucitron.cookie.create('fancybox', false); 20 } 21 }; 22 23 tarteaucitron.services.fancybox = { 24 key: 'fancybox', 25 type: 'video', 26 name: 'FancyboxService', 27 needConsent: true, 28 cookies: [], 29 js: function js() {}, 30 fallback: function fallback() { 31 tarteaucitron.fallback(['js-fancybox-check-cookies'], function (item) { 32 var id = item.href.match(/youtube|youtu|vimeo|dailymotion/ig); 33 if (id) { 34 if(id[0] === 'youtu'){ 35 id[0] = 'youtube'; 36 } 37 var service = id[0]; 38 var cookies = cookiesToObject(tarteaucitron.cookie.read()); 39 if (cookies[service] === 'true') { 40 return item; 41 } 42 43 var itemToPaste = document.createElement('button'); 44 var tempNode = document.createElement('div'); 45 46 tempNode.innerHTML = tarteaucitron.engage(service); 47 48 var childNodes = tempNode.querySelector('.tac_float').childNodes; 49 var text = childNodes[0]; 50 var button = childNodes[1]; 51 52 itemToPaste.className = `${button.className} ${item.className} cookies-denied`; 53 itemToPaste.id = button.id; 54 itemToPaste.innerHTML = ''; 55 56 itemToPaste.appendChild(text); 57 58 itemToPaste.innerHTML = `<span>${itemToPaste.innerHTML.trim()}</span>`; 59 itemToPaste.setAttribute('type', 'button'); 60 61 item.parentElement.replaceChild(itemToPaste, item); 62 63 itemToPaste.addEventListener('click', function (e) { 64 e.preventDefault(); 65 location.reload(); 66 }); 67 var galleryList = itemToPaste.classList.contains('gallery-item') ? itemToPaste.parentElement.parentElement : itemToPaste.parentElement; 68 var haveLinks = galleryList.querySelector('a'); 69 var hasBlockedElements = galleryList.querySelector('button'); 70 71 if (!haveLinks) { 72 galleryList.classList.add('no-links'); 73 } 74 75 if (hasBlockedElements) { 76 galleryList.classList.add('has-blocked-elements'); 77 } 78 79 return itemToPaste; 80 } 81 }, true); 82 }, 83 }; 84 tarteaucitron.reloadThePage = true; 85 tarteaucitron.events.load = handleFancyboxServiceCookies; 86 window.addEventListener('tac.root_available', function () { 87 var CTAButtons = [].slice.call(document.querySelectorAll('.tarteaucitronCTAButton')); 88 89 CTAButtons.forEach(function (button) { 90 button.addEventListener('click', function () { 91 location.reload(); 92 }); 93 }); 94 }); 95} 96window.addEventListener('tac.close_panel', handleFancyboxServiceCookies); 97setTimeout(() => { 98 var personalize = document.querySelector('#tarteaucitronPersonalize'); 99 100 if (!personalize) { 101 return; 102 } 103 104 personalize.addEventListener('click', () => { 105 if (jQuery && jQuery.fancybox) { 106 jQuery.fancybox.close(); 107 } 108 }); 109}, 2000); 110if (tarteaucitron.job.length) { 111 var serviceAllowButtonsHandler = function serviceAllowButtonsHandler() { 112 var tacRoot = document.getElementById('tarteaucitronRoot'); 113 114 var allowButtons = [].slice.call(document.querySelectorAll('.tarteaucitronAllow:not(.has-listener)')).filter(function (item) { 115 return item && !tacRoot.contains(item); 116 }); 117 118 allowButtons.forEach(function (button) { 119 button.classList.add('has-listener'); 120 button.addEventListener('click', function () { 121 location.reload(); 122 }); 123 }); 124 }; 125 126 tarteaucitron.job.forEach(function (serviceName) { 127 document.addEventListener("".concat(serviceName, "_added"), serviceAllowButtonsHandler); 128 }); 129} 130
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.