1/** 2 * Please read the terms of the CLUF license attached to this module(cf "licences" folder) 3 * 4 * @author LÃnea Gráfica E.C.E. S.L. 5 * @copyright Lineagrafica.es - LÃnea Gráfica E.C.E. S.L. all rights reserved. 6 * @license https://www.lineagrafica.es/licenses/license_en.pdf 7 * https://www.lineagrafica.es/licenses/license_es.pdf 8 * https://www.lineagrafica.es/licenses/license_fr.pdf 9 */ 10 11function closeinfo(accept, level) { 12 closeBanners(); 13 14 if (typeof accept != 'undefined' && accept == true) { 15 var value = ''; 16 17 switch (level) { 18 case 1: 19 var set = $('.lgcookieslaw-purpose-enabled'); 20 var length = set.length; 21 22 set.each(function(index, element) { 23 var id_lgcookieslaw_purpose = $(this).data('id-lgcookieslaw-purpose'); 24 25 if (id_lgcookieslaw_purpose != 1) { 26 value += id_lgcookieslaw_purpose + (index !== (length - 1) ? ',' : ''); 27 } 28 }); 29 30 break; 31 32 case 2: 33 var set = $('.lgcookieslaw-purpose-enabled:checked'); 34 var length = set.length; 35 36 set.each(function(index, element) { 37 var id_lgcookieslaw_purpose = $(this).data('id-lgcookieslaw-purpose'); 38 39 if (id_lgcookieslaw_purpose != 1) { 40 value += id_lgcookieslaw_purpose + (index !== (length - 1) ? ',' : ''); 41 } 42 }); 43 44 break; 45 46 case 0: 47 default: 48 value = level; 49 50 break; 51 } 52 53 setCookie(lgcookieslaw_cookie_name, value, lgcookieslaw_session_time); 54 } 55 56 if (typeof $.fancybox.open !== 'function') { 57 $('#lgcookieslaw_modal').hide(); 58 } 59 60 $.fancybox.close(); 61 62 if (lgcookieslaw_reload == true) { 63 location.reload(); 64 } 65} 66 67function showBanner() { 68 var banners = document.getElementsByClassName('lgcookieslaw-banner'); 69 70 if (banners) { 71 for (var i = 0; i < banners.length; i++) { 72 banners[i].style.display = 'table'; 73 } 74 } 75 76 if (lgcookieslaw_block) { 77 $('.lgcookieslaw-overlay').css('display', 'block'); 78 } 79} 80 81function closeBanners() { 82 var banners = document.getElementsByClassName('lgcookieslaw-banner'); 83 84 if (banners) { 85 for (var i = 0; i < banners.length; i++) { 86 banners[i].style.display = 'none'; 87 } 88 } 89 90 if (lgcookieslaw_block) { 91 $('.lgcookieslaw-overlay').css('display', 'none'); 92 } 93} 94 95function checkLGCookie(cookie_name) { 96 var regex = new RegExp("^(.*;)?\\s*" + cookie_name + "\\s*=\\s*[^;]+(.*)?$"); 97 98 return document.cookie.match(regex); 99} 100 101function deleteCookie(cname) { 102 document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; 103 document.cookie = cname + "=; domain=." + window.location.hostname + "; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; 104 document.cookie = cname + "=; domain=." + window.location.hostname.replace('www.', '') + "; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; 105} 106 107function setCookie(cname, cvalue, exdays) { 108 var d = new Date(); 109 110 d.setTime(d.getTime() + (exdays * 1000)); 111 112 var expires = "expires=" + d.toUTCString(); 113 114 document.cookie = cname + "=" + cvalue + ";" + expires + ";samesite=none;secure=true;path=/"; 115 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 116} 117 118function customizeCookies() { 119 closeBanners(); 120 121 if (typeof $.fancybox.open === 'function') { 122 $.fancybox.open($("#lgcookieslaw_modal"), { 123 autoSize : false, 124 width:700, 125 height:'auto', 126 padding: 0, 127 modal: true, 128 }); 129 } else { 130 $('#lgcookieslaw_modal').show(); 131 132 $('<a href="#lgcookieslaw_modal" />').fancybox({ 133 autoSize : false, 134 width:700, 135 height:'auto', 136 padding: 0, 137 modal: true, 138 }).click(); 139 } 140} 141 142window.addEventListener('load',function() { 143 if (checkLGCookie(lgcookieslaw_cookie_name)) { 144 closeBanners(); 145 } else { 146 showBanner(); 147 } 148 149 $('#lgcookieslaw_cancel').click(function() { 150 if (typeof $.fancybox.open !== 'function') { 151 $('#lgcookieslaw_modal').hide(); 152 } 153 154 $.fancybox.close(); 155 156 showBanner(); 157 }); 158 159 $('.lgcookieslaw-analytics-purpose').change(function() { 160 if ($(this).prop('checked')) { 161 $('.lgcookieslaw-save').addClass('lggoogleanalytics-accept') 162 } else { 163 $('.lgcookieslaw-save').removeClass('lggoogleanalytics-accept') 164 } 165 }); 166 167 $('.lgcookieslaw-slider').click(function() { 168 if ($(this).parent().find('input[type=checkbox]').is(':disabled')) { 169 return false;
170 } 171 172 if ($(this).hasClass('lgcookieslaw-slider-checked')) { 173 $(this).removeClass('lgcookieslaw-slider-checked'); 174 } else { 175 $(this).addClass('lgcookieslaw-slider-checked'); 176 } 177 }); 178});
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.