1 2var $JQAttivaCookie = jQuery.noConflict(); 3 4$JQAttivaCookie(document).ready(function() { 5 CookieAttivaScript(); 6}); 7 8 9function CookieAttivaScript() 10 { 11 var consensoString=''; 12 13 $JQAttivaCookie.post("https://www.cstrevigliese.it/cookiebanner.php", { azione: "checkcookieconsenso" } , function( data ) { 14 15 if(data!='OK') 16 { 17 //annullo il cookie del consenso 18 document.cookie = 'CookieConsensoInfo' + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; 19 20 RemoveCookie(); 21 22 //resettare le checkbox 23 $JQCookie("input:not([disabled])[name^='consensocookie']").prop('checked',false); 24 25 $JQAttivaCookie("#area-cookie2021-promemoria").hide(); 26 $JQAttivaCookie("#area-cookie2021-sfondo").show(); 27 $JQAttivaCookie("#area-cookie2021").show(); 28 } 29 30 31 consensoString=getCookie('CookieConsensoInfo'); 32 console.log(consensoString) 33 34 var consensoArray= new Array(); 35 if(consensoString) 36 { 37 consensoArray=JSON.parse(consensoString); 38 } 39 40 delete consensoArray["dataora"]; // vecchio valore 41 delete consensoArray["timestamp"]; 42 delete consensoArray["stamp"]; 43 delete consensoArray["id"]; 44 delete consensoArray["version"]; 45 delete consensoArray["country"]; 46 47 48 49 50 51 52 //TAG HTML DA CORREGGERE 53 54 // script 55 $JQAttivaCookie("script[data-cookiecategory]").each(function() { 56 57 var dataCookieCategory=$JQAttivaCookie(this).attr("data-cookiecategory").split(','); 58 59 var consensoTrovato=true; 60 61 $JQAttivaCookie.each(dataCookieCategory, function(categoria, valore) { 62 63 if(valore!='necessary') 64 { 65 if(consensoArray[valore]!==true) 66 { 67 consensoTrovato=false; 68 } 69 } 70 }); 71 72 73 if(consensoTrovato) 74 { 75 var questo=$JQAttivaCookie(this); 76 77 var text=$JQAttivaCookie(this).text(); 78 79 if(text!='') 80 { 81 $JQAttivaCookie.globalEval($JQAttivaCookie(this).text()); 82 } 83 else 84 { 85 var srcscript=$JQAttivaCookie(this).attr("src"); 86 87 if(srcscript!='') 88 { 89 var newscript = document.createElement('script'); 90 newscript.type = 'text/javascript'; 91 92 newscript.onload = function(){ 93 //console.log("Script loaded and ready"); 94 }; 95 96 var num=this.attributes.length; 97 98 var i=0; 99 $JQAttivaCookie.each(this.attributes, function() { 100 101 i++; 102 103 if(this.specified && this.name!='type') 104 { 105 $JQAttivaCookie(newscript).attr(this.name, this.value); 106 } 107 108 if(i == num) 109 { 110 var body= document.getElementsByTagName('body')[0]; 111 body.appendChild(newscript); 112 } 113 }); 114 } 115 } 116 } 117 }); 118 119 120 121 122 123 124 // iframe 125 $JQAttivaCookie("iframe[data-cookiecategory]").each(function() { 126 127 var dataCookieCategory=$JQAttivaCookie(this).attr("data-cookiecategory").split(','); 128 129 var consensoTrovato=true; 130 131 $JQAttivaCookie.each(dataCookieCategory, function(categoria, valore) { 132 133 if(valore!='necessary') 134 { 135 if(consensoArray[valore]!==true && valore!='necessary') 136 { 137 consensoTrovato=false; 138 } 139 } 140 }); 141 142 143 if(consensoTrovato) 144 { 145 $JQAttivaCookie(this).attr('src', $JQAttivaCookie(this).attr('cookieIframe-src')); 146 } 147 else 148 { 149 $JQAttivaCookie(this).attr('src', ''); 150 151 $JQAttivaCookie(this).load(function(event){ 152 $JQAttivaCookie(this).contents().find('body').html('<div class="area-cookie2021-avviso-blocco" style="text-align: center; font-family: \'Arial\';">Accetta i cookies per visualizzare questo contenuto.<BR>Clicca l\'icona in basso a sinistra per accettare tutti i cookies.</div>'); 153 }); 154 } 155 }); 156 157 158 159 160 161 162 // img 163 $JQAttivaCookie("img[data-cookiecategory]").each(function() { 164 165 var dataCookieCategory=$JQAttivaCookie(this).attr("data-cookiecategory").split(','); 166 167 var consensoTrovato=true; 168 169 $JQAttivaCookie.each(dataCookieCategory, function(categoria, valore) { 170 171 if(valore!='necessary') 172 { 173 if(consensoArray[valore]!==true && valore!='necessary') 174 { 175 consensoTrovato=false; 176 } 177 } 178 }); 179 180 181 if(consensoTrovato) 182 {
183 $JQAttivaCookie(this).attr('src', $JQAttivaCookie(this).attr('cookieImg-src')); 184 185 $JQAttivaCookie("+ .area-cookie2021-avviso-blocco", $JQAttivaCookie(this)).remove(); 186 } 187 else 188 { 189 $JQAttivaCookie(this).attr('src', ''); 190 191 $JQAttivaCookie('<div class="area-cookie2021-avviso-blocco" style="text-align: center; font-family: \'Arial\';">Accetta i cookies per visualizzare questo contenuto.<BR>Clicca l\'icona in basso a sinistra per accettare tutti i cookies.</div>').insertAfter(this); 192 } 193 }); 194 195 196 197 198 199 }); 200 201 } 202 203var $JQCookie = jQuery.noConflict(); 204 205$JQCookie(document).ready(function() { 206 207 $JQCookie("#area-cookie2021-chiudi").unbind("click"); 208 $JQCookie("#area-cookie2021-necessari").unbind("click"); 209 $JQCookie("#area-cookie2021-selezionati").unbind("click"); 210 $JQCookie("#area-cookie2021-tutti").unbind("click"); 211 $JQCookie("#area-cookie2021-promemoria").unbind("click"); 212 $JQCookie("#area-cookie2021-impostazioni").unbind("click"); 213 214 215 $JQCookie("div[id^='area-cookie2021'][role='button'], span[id^='area-cookie2021'][role='button']").keydown(function(e){ 216 if (e.which === 13 || e.which === 32) { 217 e.preventDefault(); 218 $JQCookie(this).trigger("click"); 219 } 220 }); 221 222 var ScreenHeight=window.innerHeight; 223 224 var bottomAreaCookie=$JQCookie("#area-cookie2021").css("bottom").replace('px',''); 225 if(bottomAreaCookie==0) 226 { 227 bottomAreaCookie=$JQCookie(".area-cookie2021-contenuto").css("bottom").replace('px',''); 228 } 229 if(bottomAreaCookie<0 || bottomAreaCookie=='auto') 230 { 231 bottomAreaCookie=0; 232 } 233 234 var heightAreaCookie=$JQCookie("#area-cookie2021").outerHeight(true); 235 if(heightAreaCookie==0) 236 { 237 heightAreaCookie=$JQCookie(".area-cookie2021-contenuto").outerHeight(true); 238 } 239 240 var heightDettagliCookie=0; 241 if($JQCookie(".area-cookie2021-contenuto-dettagli-cookie").css('display')!='none') 242 { 243 heightDettagliCookie=$JQCookie(".area-cookie2021-contenuto-dettagli-cookie").outerHeight(true); 244 } 245 var heightAreaCookie2=heightAreaCookie-heightDettagliCookie; 246 247 var maxHeight=ScreenHeight-heightAreaCookie2-(bottomAreaCookie*2); 248 249 $JQCookie(".area-cookie2021-contenuto-dettagli-cookie").css({"max-height":maxHeight+"px"}); 250 251 252 //consenso solo ai necessari + chiusura banner 253 $JQCookie("#area-cookie2021-chiudi, #area-cookie2021-necessari").click(function(){ 254 255 $JQCookie("input:not([disabled])[name^='consensocookie']").prop('checked',false); 256 setCookieConsensoInfo(); 257 258 }); 259 260 //consenso solo ai selezionati 261 $JQCookie("#area-cookie2021-selezionati").click(function(){ 262 263 setCookieConsensoInfo(); 264 265 }); 266 267 //consenso tutti 268 $JQCookie("#area-cookie2021-tutti").click(function(){ 269 270 $JQCookie("input:not([disabled])[name^='consensocookie']").prop('checked',true); 271 272 setCookieConsensoInfo(); 273 274 }); 275 276 277 // bannerino promemoria 278 $JQCookie("#area-cookie2021-promemoria").click(function(){ 279 280 $JQCookie("#area-cookie2021-sfondo").show(); 281 $JQCookie("#area-cookie2021").show(); 282 $JQCookie("#area-cookie2021-promemoria").hide(); 283 284 }); 285 286 287 288 $JQCookie("#area-cookie2021-impostazioni").click(function(e, first){ 289 290 e.preventDefault(); 291 292 $JQCookie(".area-cookie2021-contenuto-dettagli-cookie").slideToggle(first ? 0 : 400); 293 294 $JQCookie(".area-cookie2021-contenuto-dettagli-cookie").css({"overflow-y":"auto"}); 295 296 $JQCookie("#area-cookie2021-impostazioni").hide(); 297 $JQCookie("#area-cookie2021-selezionati").show(); 298 299 return false; 300 }); 301 302}); 303 304function setCookieConsensoInfo(txtconsenso='') 305 { 306 RemoveCookie(); 307 308 var arrayConsenso=new Array(); 309 310 var index=0; 311 $JQCookie("input[name^='consensocookie']").each(function() { 312 313 arrayConsenso[index]='"'+$JQCookie(this).attr('data-category')+'":'+$JQCookie(this).prop('checked'); 314 315 index++; 316 }); 317 318 319 var registra=false; 320 var scadenza=0; 321 var consenso=txtconsenso; 322 if(consenso=='') 323 { 324 registra=true; 325 scadenza=''; 326 consenso='{'+arrayConsenso.join(', ')+'}'; 327 } 328 329 $JQCookie.post("https://www.cstrevigliese.it/cookiebanner.php", {"azione": "setcookie", "consenso": consenso, "registra": registra, "scadenza": scadenza} , function( data ) { 330 331 if(txtconsenso=='') 332 { 333 $JQCookie("#area-cookie2021").fadeOut(300); 334 $JQCookie("#area-cookie2021-sfondo").hide(); 335 $JQCookie("#area-cookie2021-promemoria").show(); 336 } 337 338 339 if($JQCookie("#statoconsensocookiepagina").length>0 || $JQCookie("#statoconsensocookiebanner").length>0) 340 {
341 $JQAttivaCookie.post("https://www.cstrevigliese.it/cookiebanner.php", { azione: "statoconsenso" } , function( data2 ) { 342 if($JQCookie("#statoconsensocookiepagina").length>0) 343 { 344 $JQCookie("#statoconsensocookiepagina").html(data2) 345 } 346 347 if($JQCookie("#statoconsensocookiebanner").length>0) 348 { 349 $JQCookie("#statoconsensocookiebanner").html(data2) 350 } 351 }); 352 } 353 354 355 CookieAttivaScript(); 356 357 }); 358 } 359 360function RemoveCookie() 361 { 362 var cookies = document.cookie.split("; "); 363 for (var i = 0; i < cookies.length; i++) 364 { 365 var cookie = cookies[i]; 366 var eqPos = cookie.indexOf("="); 367 var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; 368 369 //console.log(cookie) 370 //console.log(eqPos) 371 //console.log(name) 372 373 if(name!='PHPSESSID') 374 { 375 document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; 376 } 377 } 378 } 379
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.