1(function(window){ 2 'use strict'; 3 4 function Scuolastico(){ 5 var _this = {}; 6 7 var cookieName = 'scuolastico_cookies_consent'; 8 var cookieDurataConferma = 30*12; 9 var cookieDurataAnnulla = 30*6; 10 11 var googleAnalyticsId = false; 12 var webAnalyticsItaliaId = false; 13 14 var cookieBarStato = 0; 15 var cookieBarId = 'cookiebarConsensiCookie'; 16 var cookieModalId = 'modalGestioneConsensiCookie'; 17 18 var cookiebarFrase = { 19 0: 'Questo sito utilizza cookie tecnici per erogare i propri servizi.<br>\ 20 Per maggiori informazioni puoi leggere la <a href="/cookie" class="text-underline-hover header-second-text-color" target="_blank">cookie policy</a>.', 21 1: 'Questo sito utilizza cookie tecnici per erogare i propri servizi e cookie di monitoraggio in forma anonima per analizzare il traffico.<br>\ 22 Per maggiori informazioni puoi leggere la <a href="/cookie" class="text-underline-hover header-second-text-color" target="_blank">cookie policy</a>.', 23 10: 'Questo sito utilizza cookie tecnici per erogare i propri servizi e cookie di terze parti.<br>\ 24 Per maggiori informazioni puoi leggere la <a href="/cookie" class="text-underline-hover header-second-text-color" target="_blank">cookie policy</a>.', 25 11: 'Questo sito utilizza cookie tecnici per erogare i propri servizi, cookie di monitoraggio in forma anonima per analizzare il traffico e cookie di terze parti.<br>\ 26 Per maggiori informazioni puoi leggere la <a href="/cookie" class="text-underline-hover header-second-text-color" target="_blank">cookie policy</a>.', 27 } 28 29 var fraseCookieTecnici = 'Questo sito utilizza cookie tecnici per migliorare l\'esperienza di navigazione e per fornire funzionalità aggiuntive.\ 30 Si tratta di dati del tutto anonimi, utili a scopo tecnico o statistico, e nessuno di questi dati verrà utilizzato per identificarti o per contattarti.'; 31 var fraseCookieTerzeParti = 'Questo sito potrebbe fare uso di cookie di terze parti in alcune pagine.'; 32 33 var cookieBarHtml = '<div class="cookiebar show header-second-bg-color header-second-text-color" id="' + cookieBarId + '">\ 34 <p class="cookiebar-frase header-second-text-color"></p>\ 35 <div class="cookiebar-buttons cookiebar-buttons-tecnici d-none">\ 36 <button class="cookiebar-btn header-second-text-color cookiebar-preference">\ 37 Preferenze<span class="sr-only"> dei cookie</span>\ 38 </button>\ 39 <button class="cookiebar-btn header-second-text-color text-left cookiebar-confirm">\ 40 Ok\ 41 </button>\ 42 </div>\ 43 <div class="cookiebar-buttons cookiebar-buttons-terzi d-none">\ 44 <div class="">\ 45 <button class="cookiebar-btn header-second-text-color cookiebar-preference">\ 46 Preferenze<span class="sr-only"> dei cookie</span>\ 47 </button>\ 48 </div>\ 49 <hr>\ 50 <div class="">\ 51 <button class="cookiebar-btn header-second-text-color text-left cookiebar-confirm-third">\ 52 Accetto<br>tutto\ 53 </button>\ 54 <button class="cookiebar-btn header-second-text-color text-left cookiebar-confirm">\ 55 Accetto<br>i tecnici\ 56 </button>\ 57 </div>\ 58 </div>\ 59 </div>'; 60 61 var cookieModalHtml = '<div class="modal it-dialog-scrollable fade" tabindex="-1" role="dialog" id="' + cookieModalId + '">\ 62 <div class="modal-dialog modal-lg" role="document">\ 63 <div class="modal-content">\ 64 <div class="modal-header">\ 65 <h5 class="modal-title">ðª Gestione cookie</h5>\ 66 </div>\ 67 <div class="modal-body">\ 68 <p style="margin-bottom: 1rem;">\ 69 Qui di seguito puoi selezionare, se preferisci, quali tipologie di cookie ritieni accettabili.\ 70 Puoi modificare le tue preferenze relative ai cookie in qualsiasi momento, cliccando sul link presente nel footer di ogni pagina per tornare in questa schermata.\ 71 </p>\ 72 <div class="form-check form-check-group">\ 73 <input id="checkboxCookieTecnici" name="checkboxCookieTecnici" type="checkbox" aria-labelledby="checkboxCookieTecnici-help" checked="checked" disabled="disabled">\ 74 <label for="checkboxCookieTecnici">Cookie tecnici (obbligatori)</label>\ 75 <small id="checkboxCookieTecnici-help" class="form-text">' + fraseCookieTecnici + '</small>\ 76 </div>\ 77 <div class="form-check form-check-group">\ 78 <input id="checkboxCookieThird" name="checkboxCookieThird" type="checkbox" aria-labelledby="checkboxCookieThird-help">\ 79 <label for="checkboxCookieThird">Cookie di terze parti</label>\ 80 <small id="checkboxCookieThird-help" class="form-text">' + fraseCookieTerzeParti + '</small>\ 81 </div>\ 82 <div class="form-check form-check-group d-none">\ 83 <input id="checkboxCookieProfile" name="checkboxCookieProfile" type="checkbox" aria-labelledby="checkboxCookieProfile-help">\ 84 <label for="checkboxCookieProfile" class="disabled">Cookie di profilazione</label>\ 85 <small id="checkboxCookieProfile-help" class="form-text">Questo sito potrebbe fare uso di cookie di profilazione. Maggiori dettagli sono presenti sulla <a href="/privacy" class="text-underline-hover sito-text-color" target="_blank" >privacy policy</a>.</small>\ 86 </div>\ 87 <p style="margin-bottom: 1rem;">
87Cliccando su "Conferma le scelte", confermi il tuo consenso a questo sito di salvare alcuni piccoli blocchi di dati sul tuo computer, in base alle scelte selezionate.</p>\ 88 <p style="margin-bottom: 1rem;">Cliccando invece su "Rifiuta", puoi proseguire nella navigazione con le impostazioni minime (alcune parti del sito potrebbero non funzionare come previsto).</p>\ 89 <p style="margin-bottom: 1rem;">Per maggiori informazioni puoi leggere in dettaglio la <a href="/cookie" class="text-underline-hover sito-text-color" target="_blank" >cookie policy</a> e la <a href="/privacy" class="text-underline-hover sito-text-color" target="_blank" >privacy policy</a>.</p>\ 90 <p style="margin-bottom: 1rem;">Per saperne di più sui cookie, puoi visitare il sito del <a href="http://www.garanteprivacy.it/web/guest/home/docweb/-/docweb-display/docweb/3118884" class="text-underline-hover sito-text-color" target="_blank" rel="noopener noreferrer">Garante per la protezione dei dati personali</a>.</p>\ 91 </div>\ 92 <div class="modal-footer">\ 93 <button class="btnblocco btn border btn-sm" type="button" cookie-type="no">Rifiuta</button>\ 94 <button class="btn btn-primary btn-sm" type="button" cookie-type="ok">Conferma le scelte</button>\ 95 </div>\ 96 </div>\ 97 </div>\ 98 </div>'; 99 100 _this.init = function (parametri) { 101 if(typeof parametri !== 'object') parametri = {}; 102 103 if(parametri.cBanner) cookieBarStato = parseInt(parametri.cBanner) || 0; 104 105 gaInit(parametri); 106 waiInit(parametri); 107 108 switch(getCookieValue(cookieName)){ 109 case 'CookieThirdParty': 110 convertLinkToIframe(); 111 gaOptin(); 112 waiOptin(); 113 break; 114 case 'CookieTecnici': 115 convertLinkToIframe(true); 116 gaOptin(); 117 waiOptin(); 118 break; 119 default: 120 showCookieBar(); 121 convertLinkToIframe(true); 122 break; 123 } 124 } 125 126 _this.showPreference = function () { 127 showCookiePreference(); 128 } 129 130 _this.abilitaTerzeParti = function () { 131 if (confirm(fraseCookieTerzeParti + "\nAssicurati di aver letto l'informativa sui cookie.\nAbilitare l'uso dei cookie di terze parti?") == true) { 132 enableCookie(true); 133 } 134 } 135 136 function showCookieBar() { 137 if(cookieBarStato === 0) return true; 138 139 var $cookiebar = $(cookieBarHtml); 140 $cookiebar.find('p.cookiebar-frase').html( 141 cookiebarFrase[ 142 0 143 + ((googleAnalyticsId || webAnalyticsItaliaId) ? 1 : 0) 144 + ((cookieBarStato == 2) ? 10 : 0) 145 ] 146 ); 147 $cookiebar.appendTo('body'); 148 149 if(cookieBarStato == 2){ 150 $('#'+cookieBarId).find('.cookiebar-buttons-terzi').removeClass('d-none'); 151 }else{ 152 $('#'+cookieBarId).find('.cookiebar-buttons-tecnici').removeClass('d-none'); 153 } 154 155 $('#'+cookieBarId).find('button.cookiebar-preference').on('click', function(){ 156 $('#'+cookieBarId).hide(); 157 showCookiePreference(); 158 }); 159 160 $('#'+cookieBarId).find('button.cookiebar-confirm').on('click', function(){ 161 enableCookie(false); 162 }); 163 $('#'+cookieBarId).find('button.cookiebar-confirm-third').on('click', function(){ 164 enableCookie(true); 165 }); 166 } 167 168 function showCookiePreference() { 169 if($('#'+cookieModalId).length === 0){ 170 $(cookieModalHtml).appendTo('body'); 171
172 $('#'+cookieModalId).find('.modal-footer button[cookie-type=ok]').on('click', function(){ 173 enableCookie($('#'+cookieModalId).find('.modal-body input#checkboxCookieThird').is(":checked")); 174 }); 175 176 $('#'+cookieModalId).find('.modal-footer button[cookie-type=no]').on('click', function(){ 177 enableCookie(false, cookieDurataAnnulla); 178 }); 179 } 180 if(getCookieValue(cookieName) === 'CookieThirdParty') $('#'+cookieModalId).find('.modal-body input#checkboxCookieThird').prop('checked', true); 181 $('#'+cookieModalId).modal('show'); 182 } 183 184 function enableCookie(thirdParty, durata) { 185 createCookie(cookieName, (thirdParty ? 'CookieThirdParty' : 'CookieTecnici'), (durata ? durata : cookieDurataConferma)); 186 $('#'+cookieModalId).modal('hide'); 187 location.reload(); 188 } 189 190 function convertLinkToIframe(onlyCheckPreview) { 191 $("[scuolastico-iframe=true]").each(function () { 192 var $link = $(this); 193 194 var src = $link.attr('scuolastico-iframe-href'); 195 var allowed = false; 196 if (checkUrlAllowed(false, 'allow')) allowed = checkIfUserHasAllowed('allow');; 197 if (checkUrlAllowed(src, 'youtube')) { 198 allowed = checkIfUserHasAllowed('youtube'); 199 $link.addClass('iframe-youtube iframe-bloccato'); 200 $link.find('.testo-messaggio-iframe').text('Il contenuto di YouTube è stato bloccato poiché contenente elementi che potrebbero tracciare l\'utente'); 201 } 202 if (checkUrlAllowed(src, 'gmaps')){ 203 allowed = checkIfUserHasAllowed('gmaps'); 204 $link.addClass('iframe-gmaps iframe-bloccato'); 205 $link.find('.testo-messaggio-iframe').text('Il contenuto di Google Maps è stato bloccato poiché contenente elementi che potrebbero tracciare l\'utente'); 206 } 207 if (!allowed) return; 208 if (onlyCheckPreview) return; 209 210 $link.replaceWith($('<iframe>', { 211 frameborder: 0, 212 src: $link.attr('scuolastico-iframe-href'), 213 title: $link.attr('title'), 214 allow: $link.attr('scuolastico-iframe-allow'), 215 width: $link.attr('scuolastico-iframe-width'), 216 height: $link.attr('scuolastico-iframe-height'), 217 })); 218 }); 219 }; 220 221 function checkIfUserHasAllowed(sito) { 222 switch (sito) { 223 case 'youtube': return false; break; 224 case 'gmaps': return false; break; 225 // ------------------- 226 default: return true; break; 227 } 228 } 229 230 function checkUrlAllowed(url, sito) { 231 var reg = false; 232 switch (sito) { 233 case 'youtube': reg = /^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube(-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; break; 234 case 'gmaps': reg = /^https?\:\/\/(www\.)?google\.[a-z]+\/maps\b/; break; 235 // ------------------- 236 case 'allow': return true; break; 237 } 238 if (!reg) return false; 239 return url.match(reg); 240 } 241 242 function createCookie(name, value, days) { 243 name = name.replace(/[^#$&+\^`|]/g, encodeURIComponent); 244 name = name.replace(/\(/g, '%28').replace(/\)/g, '%29'); 245 value = (value + '').replace(/[^!#$&-+\--:<-\[\]-~]/g, encodeURIComponent); 246 var expires = false; 247 if (days) { 248 var date = new Date(); 249 date.setTime(date.getTime() + (days*24*60*60*1000)); 250 expires = date.toUTCString(); 251 } 252 document.cookie = name + "=" + value 253 + (expires ? ';expires=' + expires : '') 254 + (false ? ';secure' : '') 255 + ";path=/"; 256 } 257
258 function eraseCookie(name) { 259 createCookie(name,"",-1); 260 } 261 262 function getCookieValue(name) { 263 return document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || ''; 264 } 265 266 function gaInit(parametri) { 267 if(parametri.ga && parametri.ga.length === 14) googleAnalyticsId = parametri.ga; 268 if(!googleAnalyticsId) return true; 269 270 // Google: Garante privacy stop allâuso degli Analytics. Dati trasferiti negli Usa senza adeguate garanzie 271 // https://www.garanteprivacy.it/home/docweb/-/docweb-display/docweb/9782874 272 return true; 273 274 /* 275 window['ga-disable-' + googleAnalyticsId] = true; 276 277 (function(i, s, o, g, r, a, m) { 278 i['GoogleAnalyticsObject'] = r; 279 i[r] = i[r] || function() { 280 (i[r].q = i[r].q || []).push(arguments) 281 }, i[r].l = 1 * new Date(); 282 a = s.createElement(o), 283 m = s.getElementsByTagName(o)[0]; 284 a.async = 1; 285 a.src = g; 286 m.parentNode.insertBefore(a, m) 287 })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); 288 289 ga('create', googleAnalyticsId, { 290 'name': 'scuola', 291 'cookieName': 'ga_scuola' 292 }); 293 ga('scuola.set', 'anonymizeIp', true); 294 ga('scuola.set', 'forceSSL', true); 295 */ 296 } 297 298 function gaOptout() { 299 if(!googleAnalyticsId) return true; 300 window['ga-disable-' + googleAnalyticsId] = true; 301 } 302 function gaOptin() { 303 if(!googleAnalyticsId) return true; 304 window['ga-disable-' + googleAnalyticsId] = false; 305 if(typeof ga === 'function') ga('scuola.send', 'pageview'); 306 } 307 308 function waiInit(parametri) { 309 if(parametri.wai && parametri.wai.length >= 10) webAnalyticsItaliaId = parametri.wai; 310 if(!webAnalyticsItaliaId) return true; 311 312 var _paq = window._paq = window._paq || []; 313 314 // require user tracking consent before processing data 315 _paq.push(['requireConsent']); 316 317 _paq.push(['trackPageView']); 318 _paq.push(['enableLinkTracking']); 319 (function() { 320 var u="https://ingestion.webanalytics.italia.it/"; 321 _paq.push(['setTrackerUrl', u+'matomo.php']); 322 _paq.push(['setSiteId', webAnalyticsItaliaId]); 323 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; 324 g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); 325 })(); 326 } 327 328 function waiOptin() { 329 if(!webAnalyticsItaliaId) return true;// user has given consent to process their data 330 if(typeof _paq == 'object' && typeof _paq.push == 'function') _paq.push(['setConsentGiven']); 331 } 332 333 return _this; 334 } 335 336 if(typeof(window.ScuolasticoCookie) === 'undefined'){ 337 window.ScuolasticoCookie = Scuolastico(); 338 } 339})(window);
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.