PageSourceSearch

https://cc.bibbiaedu.it/init-cookie-js/project/1

js bibbiaedu.it collected 2026-09-24 09:16:55 UTC 18,318 bytes, 385 lines download raw bytes

1//<script type="text/javascript">
2       
3 window.addEventListener("load", function() {
4
5        function loadScriptSync(url) {
6            var xhr = new XMLHttpRequest();
7            xhr.open('GET', url, false); // Terzo parametro "false" per rendere la richiesta sincrona
8            xhr.send(null);
9
10            if (xhr.status === 200) {
11              var script = document.createElement('script');
12              script.text = xhr.responseText; // Inserisce il contenuto dello script nella pagina
13              document.head.appendChild(script);
14            } else {
15              throw new Error('Impossibile caricare lo script: ' + url);
16            }
17          }
18
19          // Esempio di utilizzo
20        loadScriptSync('https://cc.bibbiaedu.it/js/cookieconsent.js?pipo');
21        
22        
23        
24        if (typeof(iandu_cookieconsent_obj) == "undefined"){
25            var iandu_cookieconsent_obj = {
26                "ajaxUrl" : "https://cc.bibbiaedu.it/api/project/1/register",
27                "security" : "//todo",                
28                "autorun" : true,
29            };
30        }
31        var blocks = iandu_define_block();
32        var cc = initCookieConsent();
33        cc.run({
34            autoclear_cookies: true, // default: false
35            delay: 0, // default: 0
36            autorun: true, // default: true
37            hide_from_bots: false, // default: false
38            remove_cookie_tables: false, // default: false
39            cookie_name: 'iandu_cc_cookie', // default: 'cc_cookie'
40            cookie_data: 'iandu_cc_cookie', // default: 'cc_cookie'
41            cookie_expiration: 182, // default: 182 (days)
42            cookie_necessary_only_expiration: 'disabled', // default: disabled
43            cookie_domain: location.hostname, // default: current domain
44            cookie_path: '/', // default: root
45            cookie_same_site: 'Lax', // default: 'Lax'
46            use_rfc_cookie: false, // default: false
47            current_lang: 'it',
48            theme_css: 'https://cc.bibbiaedu.it/css/cookieconsent.css', // replace with a valid path
49            page_scripts: true, // default: false
50            auto_language: null, // default: null; could also be 'browser' or 'document'
51            mode: 'opt-in', // default: 'opt-in'; value: 'opt-in' or 'opt-out'
52            revision: 1, // default: 0
53            force_consent: 1, // default: false            
54            gui_options: {
55                consent_modal: {
56                    layout: 'bar', // box/cloud/bar
57                    position: 'bottom center', // bottom/middle/top + left/right/center
58                    transition: 'slide', // zoom/slide
59                    swap_buttons: true            // enable to invert buttons
60                },
61                settings_modal: {
62                    layout: 'box', // box/bar
63                    //position: 'left',           // left/right
64                    transition: 'slide'            // zoom/slide
65                }
66            },
67            onFirstAction: function (user_preferences, cookie) {
68                var date = new Date();
69                cc.set("data", {"value": date.iandu_format_cookie()});
70                ianduOnCookieSaved(cookie);
71            },
72            onAccept: function (cookie) {
73                console.log("onAccept event");
74                iandu_push_to_datalayer(cookie);
75            },
76            onChange: function (cookie, changed_preferences) {
77                console.log("onChange event");
78                if (cc.get('data') != "undefined") {
79                    var date = new Date();
80                    cc.set("data", {"value": date.iandu_format_cookie()});
81                }
82                iandu_push_to_datalayer(cookie);
83                ianduOnCookieSaved(cookie);
84               
85            },
86            languages: {
87                it: {
88                    consent_modal: {
89                        title: 'Bibbia Edu',
90                        description: 'Utilizziamo cookie o tecnologie simili per finalità tecniche e, con il tuo consenso, anche per altre finalità ("interazioni e funzionalità semplici", "miglioramento dell\'esperienza", "misurazione" e "targeting e pubblicità") come specificato nella cookie policy. Cliccando su "accetta" acconsenti all\'utilizzo dei cookie. Cliccando su "personalizza" puoi avere maggiori informazioni sui cookie utilizzati e personalizzare le tue preferenze. Cliccando su "rifiuta" o chiudendo questa informativa proseguirai la navigazione installando i soli cookie tecnici. Ulteriori informazioni sono disponibili nella cookie policy completa.',
91                        primary_btn: {
92                            text: 'Accetta',
93                            role: 'accept_all'              // 'accept_selected' or 'accept_all'
94                        },
95                        secondary_btn: {
96                            text: 'Rifiuta',
97                            role: 'accept_necessary'        // 'settings' or 'accept_necessary'
98                        }
99                    },
100                    settings_modal: {
101                        title: 'Le tue preferenze relative al consenso',
102                        save_settings_btn: 'Salva preferenze',
103                        accept_all_btn: 'Accetta tutti',
104                        reject_all_btn: 'Accetta necessari',
105                        close_btn_label: 'Close',
106                        cookie_table_headers: [
107                            {col1: 'Nome'},
108                            {col2: 'Dominio'},
109                            {col3: 'Scadenza'},
110                                    /*{col4: 'Description'}*/
111                        ],
112                        blocks: blocks
113                    }
114                }
115            }
116        });
117        function iandu_push_to_datalayer(cookie){
118            if( typeof cookie !== "undefined" && Array.isArray(cookie['level']) ){
119                for( i = 0; i < cookie['level'].length; i++){
120                    console.log(cookie['level'][i]);
121                    /* Qui da inviare push al dataLayer di Google TAG Manager*/
122                    if (typeof dataLayer !== 'undefined') {
123                        dataLayer.push({
124                            event: "cc_" + cookie['level'][i]
125                        });
126                    }
127                }
128            }
129        }
130        function iandu_define_block() {
131            blocks = [
132                {
133                    title: '',
134                    description: 'Il seguente pannello ti consente di esprimere le tue preferenze di consenso alle tecnologie di tracciamento che adottiamo per offrire le funzionalità e svolgere le attività sotto descritte. Per ottenere ulteriori informazioni in merito all\'utilità e al funzionamento di tali strumenti di tracciamento, fai riferimento alla <a href="https://www.bibbiaedu.it/site/twig/templates/v3/html/notelegali/" class="cc-link">cookie policy</a>. Puoi rivedere e modificare le tue scelte in qualsiasi momento.'
135                }
136            ];
137            var cookie_table = [];
138                        var tablerow = {};
139                    tablerow.col1 = '_ga_E8K302ZP5K';
140                    tablerow.col2 = '.bibbiaedu.it';
141                    tablerow.col3 = '2anni';
142                    if (typeof cookie_table['analytics'] == "undefined") {
143                        cookie_table['analytics'] = [];
144                    }
145                    cookie_table['analytics'].push(tablerow);
146                                var tablerow = {};
147                    tablerow.col1 = 'PHPSESSID';
148                    tablerow.col2 = '.bibbiaedu.it';
149                    tablerow.col3 = 'Sessione';
150                    if (typeof cookie_table['necessary'] == "undefined") {
151                        cookie_table['necessary'] = [];
152                    }
153                    cookie_table['necessary'].push(tablerow);
154                                var tablerow = {};
155                    tablerow.col1 = 'iandu_cc_cookie';
156                    tablerow.col2 = '.bibbiaedu.it';
157                    tablerow.col3 = '182giorni';
158                    if (typeof cookie_table['necessary'] == "undefined") {
159                        cookie_table['necessary'] = [];
160                    }
161                    cookie_table['necessary'].push(tablerow);
162                                var tablerow = {};
163                    tablerow.col1 = '_pk_id*';
164                    tablerow.col2 = '.bibbiaedu.it';
165                    tablerow.col3 = '13mesi';
166                    if (typeof cookie_table['analytics'] == "undefined") {
167                        cookie_table['analytics'] = [];
168                    }
169                    cookie_table['analytics'].push(tablerow);
170                                var tablerow = {};
171                    tablerow.col1 = '_pk_ses*';
172                    tablerow.col2 = '.bibbiaedu.it';
173                    tablerow.col3 = '30minuti';
174                    if (typeof cookie_table['analytics'] == "undefined") {
175                        cookie_table['analytics'] = [];
176                    }
177                    cookie_table['analytics'].push(tablerow);
178                                var tablerow = {};
179                    tablerow.col1 = '_gat_gtag_UA_117987844_2';
180                    tablerow.col2 = '.bibbiaedu.it';
181                    tablerow.col3 = '1minuto';
182                    if (typeof cookie_table['analytics'] == "undefined") {
183                        cookie_table['analytics'] = [];
184                    }
185                    cookie_table['analytics'].push(tablerow);
186                                var tablerow = {};
187                    tablerow.col1 = '_gid';
188                    tablerow.col2 = '.bibbiaedu.it';
189                    tablerow.col3 = '1giorno';
190                    if (typeof cookie_table['analytics'] == "undefined") {
191                        cookie_table['analytics'] = [];
192                    }
193                    cookie_table['analytics'].push(tablerow);
194                                var tablerow = {};
195                    tablerow.col1 = '_ga';
196                    tablerow.col2 = '.bibbiaedu.it';
197                    tablerow.col3 = '2anni';
198                    if (typeof cookie_table['analytics'] == "undefined") {
199                        cookie_table['analytics'] = [];
200                    }
201                    cookie_table['analytics'].push(tablerow);
202                                        if (typeof cookie_table['necessary'] == "undefined") {
203                    cookie_table['necessary'] = [];
204                }
205                if(cookie_table['necessary'].length > 0){
206                     blocks.push({
207                        title: "Tecnici",
208                        description: "Questi cookie sono essenziali per il corretto funzionamento del sito web. Senza questi cookie, il sito Web non funzionerebbe correttamente.",
209                        toggle: {
210                            value: 'necessary',
211                            enabled: 0,
212                            readonly: 1          // cookie categories with readonly=true are all treated as "necessary cookies"
213                        },
214                        cookie_table: cookie_table['necessary']
215
216                    });
217                }
218               
219                    if (typeof cookie_table['analytics'] == "undefined") {
220                    cookie_table['analytics'] = [];
221                }
222                if(cookie_table['analytics'].length > 0){
223                     blocks.push({
224                        title: "Analitici",
225                        description: "Questi cookie consentono al sito web di ricordare le scelte che hai fatto in passato.",
226                        toggle: {
227                            value: 'analytics',
228                            enabled: 0,
229                            readonly: 0          // cookie categories with readonly=true are all treated as "necessary cookies"
230                        },
231                        cookie_table: cookie_table['analytics']
232
233                    });
234                }
235               
236                    if (typeof cookie_table['advertisement'] == "undefined") {
237                    cookie_table['advertisement'] = [];
238                }
239                if(cookie_table['advertisement'].length > 0){
240                     blocks.push({
241                        title: "Profilazione",
242                        description: "Questi cookie raccolgono informazioni su come utilizzi il sito web, quali pagine hai visitato e quali link hai cliccato. Tutti i dati sono resi anonimi e non possono essere utilizzati per identificarti.",
243                        toggle: {
244                            value: 'advertisement',
245                            enabled: 0,
246                            readonly: 0          // cookie categories with readonly=true are all treated as "necessary cookies"
247                        },
248                        cookie_table: cookie_table['advertisement']
249
250                    });
251                }
252               
253                    if (typeof cookie_table['others'] == "undefined") {
254                    cookie_table['others'] = [];
255                }
256                if(cookie_table['others'].length > 0){
257                     blocks.push({
258                        title: "Cookie non ancora classificati in una categoria.",
259                        description: "Altri cookie di Terze parti.",
260                        toggle: {
261                            value: 'others',
262                            enabled: 0,
263                            readonly: 0          // cookie categories with readonly=true are all treated as "necessary cookies"
264                        },
265                        cookie_table: cookie_table['others']
266
267                    });
268                }
269               
270    
271    
272
273            blocks.push({'title': 'Maggiori informazioni',
274                'description': 'Per qualsiasi domanda in relazione alla nostra politica sui cookie e alle tue scelte, per favore <a class="cc-link" href="https://www.bibbiaedu.it/site/twig/templates/v3/PHP/segnalazione/?url_prov=~CEI2008~~~">contattaci</a>.'
275            });
276            return blocks;
277        }
278
279        Date.prototype.iandu_format_cookie = function () {
280            var mm = this.getMonth() + 1; // getMonth() is zero-based
281            var dd = this.getDate();
282            var hh = this.getHours();
283            var ii = this.getMinutes();
284            var ss = this.getSeconds();
285            var ms = this.getMilliseconds();
286            ms = (ms > 9 ? '' : '0') + ms;
287            return [this.getFullYear(),
288                (mm > 9 ? '' : '0') + mm,
289                (dd > 9 ? '' : '0') + dd,
290                (hh > 9 ? '' : '0') + hh,
291                (ii > 9 ? '' : '0') + ii,
292                (ss > 9 ? '' : '0') + ss,
293                (ms > 99 ? '' : '0') + ms,
294                '-',
295                iandu_get_random_digits(4)
296            ].join('');
297        };
298        function iandu_get_random_digits(lenght) {
299            min = 0;
300            max = 9;
301            digits = '';
302            for (i = 0; i < lenght; i++) {
303                digits += Math.floor(Math.random() * (max - min + 1) + min);
304            }
305            return digits; //The maximum is inclusive and the minimum is inclusive
306        }
307        function ianduCloseBanner(){
308          cc.hideSettings();
309          cc.hide();
310          cc.accept([]);
311        }
312
313        function ianduSaveConsent(cookie){
314            const formData = new FormData();
315            formData.append("action", "iandu_register_cookie_consent");
316            formData.append("security", iandu_cookieconsent_obj.security); 
317            formData.append("page_referer", document.location.href); 
318            formData.append("html_form", JSON.stringify(document.querySelector("#s-bl").innerHTML)); 
319            formData.append("data", JSON.stringify(cookie)); 
320            let request = new XMLHttpRequest();
321            request.addEventListener("load", iandu_cc_success);
322            request.addEventListener("error", iandu_cc_error);
323            request.addEventListener("abort", iandu_cc_abort);
324            request.open("POST", iandu_cookieconsent_obj.ajaxUrl);
325            request.send(formData);
326        }
327        
328        function ianduOnCookieSaved(cookie){
329             
330                ianduSaveConsent(cookie);
331                    }
332        
333        function iandu_cc_success(evt) {
334                    }
335
336        function iandu_cc_error(evt) {
337          console.warn("Error");
338        }
339
340        function iandu_cc_abort(evt) {
341          console.warn("Abort");
342        }
343        
344                let closeBtn = document.createElement("button");
345                closeBtn.className = "c-bn"; 
346                closeBtn.setAttribute('type','button');
347                closeBtn.setAttribute('id','iandu-close-banner');
348                closeBtn.setAttribute('aria-label','Close');
349                closeBtn.onclick = function(){
350                    ianduCloseBanner();
351                };
352                let customizeBtn = document.createElement("button");
353                customizeBtn.innerHTML = "Personalizza";
354                customizeBtn.className = "c-bn"; 
355                customizeBtn.setAttribute('type','button');
356                customizeBtn.onclick = function(){
357                    cc.showSettings();
358                  };
359                if(document.querySelector('#cm') != null){   
360                    document.querySelector('#cm').prepend(closeBtn);
361                }  
362                if(document.querySelector('#c-bns') != null){   
363                   document.querySelector('#c-bns').prepend(customizeBtn);
364                }  
365          
366
367        // Crea un nuovo bottone
368        let bottone = document.createElement('button');
369
370        // Imposta il testo del bottone
371        bottone.textContent = 'Preferenze Cookie';
372
373        // Puoi anche aggiungere un ID o altre proprietà al bottone
374        bottone.setAttribute('id', 'iandu-fixed-edit-preferences');
375        bottone.setAttribute('class', 'iandu-edit-preferences');
376        bottone.setAttribute('data-cc', 'c-settings');
377
378        // Appendi il bottone all'elemento scelto (in questo caso il div con id 'contenitore')
379        document.body.appendChild(bottone);
380
381      
382        });
383        
384        //</script>
385    

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.