PageSourceSearch

https://schronisko-aniolow.pl/js/zdzislowicz-consent-1.0.js?date=20250210123725

js schronisko-aniolow.pl collected 2026-10-04 17:16:09 UTC 11,595 bytes, 288 lines download raw bytes

1/*
2         _       _       _                  _                       _
3 ____ __| | ____(_) ___ | |  ___ __      __(_)  ___  ____    _ __  | |
4|_  // _` ||_  /| |/ __|| | / _ \\ \ /\ / /| | / __||_  /   | '_ \ | |
5 / /| (_| | / / | |\__ \| || (_) |\ V  V / | || (__  / /  _ | |_) || |
6/___|\__,_|/___||_||___/|_| \___/  \_/\_/  |_| \___|/___|(_)| .__/ |_|
7                                                            |_|
8
9COOKIES SETTINGS
10www.zdzislowicz.pl
11[email protected]
12
13all rights reserved
14*/
15
16$(document).ready(function() {
17
18    // let cookiesBar = document.querySelector('.cookies');
19    let cookiesOverlay = document.querySelector('.zdzCookies');
20    let cookiesRecall = document.querySelector('.zdzCookiesRecall');
21
22    cookiesRecall.addEventListener('click', function() {
23        cookiesOverlay.style.display = "flex";
24    })    
25
26    // cookiesBar.querySelector('.openCookiesSettings').addEventListener('click', function() {
27    //     cookiesOverlay.style.display = "flex";
28    // })
29
30    let cookieSwitcher = document.querySelectorAll('.cookie-header .switch');
31    cookieSwitcher.forEach(function(item) {
32        item.nextElementSibling.tabIndex = "-1";
33        item.addEventListener('click', function() {
34            if(item.classList.contains('checked')) {
35                item.classList.remove('checked')
36                item.nextElementSibling.value = '0';
37            }
38            else {
39                item.classList.add('checked')
40                item.nextElementSibling.value = '1'; 
41                item.nextElementSibling.getAttribute('name');
42            }
43        })
44    })
45
46    // SAVE CUSTOM SETTINGS
47    let cookiesSaveButton = document.querySelector('.zdzCookies__buttons .save');
48    if(cookiesSaveButton != undefined && cookiesSaveButton != null)
49    cookiesSaveButton.addEventListener('click', function() {
50        cookieSwitcher.forEach(function(item) {
51            item.nextElementSibling.value;
52            item.nextElementSibling.getAttribute('name');
53        })
54        cookiesOverlay.style.display = "none";
55        zdzCookieLoad(cookieSwitcher);
56    });
57
58    // ACCEPT ALL AND SAVE
59    let cookiesSaveAllButton = document.querySelector('.zdzCookies__buttons .saveAll');
60    if(cookiesSaveAllButton != undefined && cookiesSaveAllButton != null)
61    cookiesSaveAllButton.addEventListener('click', function() {
62        cookieSwitcher.forEach(function(item) {
63            item.classList.add('checked');
64            item.nextElementSibling.value = 1
65            item.nextElementSibling.getAttribute('name');
66        })
67        setTimeout(() => { 
68            cookiesOverlay.style.display = "none";
69            zdzCookieLoad(cookieSwitcher);
70        }, 200); 
71    });
72
73    function zdzCookieLoad(cookieSwitcher) {
74        console.log('zapisuje');
75        let cookiesList;
76        let zdzConsentMode = [];
77
78        let analytics_storage = "denied";
79        let ad_storage = "denied";
80        let ad_user_data = "denied";
81        let ad_personalization = "denied";
82
83
84        cookieSwitcher.forEach(function(item) {
85
86                // cookiesList.push(item.nextElementSibling.getAttribute('name'));
87
88                if(item.nextElementSibling.getAttribute('name') == 'cookie-analytics')
89                {
90                    if(item.nextElementSibling.value == '1')
91                    {                     
92                        analytics_storage = "granted";
93                        // setCookie('cookies-cookie-analytics', cookiesList, 60*60*24*30, '/', '', '');
94                    }
95                    else
96                    {
97                        analytics_storage = "denied";
98                        // setCookie('cookies-cookie-analytics', cookiesList, -(60*60*24*30), '/', '', '');
99                    }
100                }
101                if(item.nextElementSibling.getAttribute('name') == 'cookie-marketing')
102                {
103                    if(item.nextElementSibling.value == '1')
104                    {                          
105                        // setCookie('cookies-cookie-marketing', cookiesList, 60*60*24*30, '/', '', '');
106                        ad_storage = "granted";            
107                        ad_user_data = "granted";
108                    }
109                    else
110                    {
111                        // setCookie('cookies-cookie-marketing', cookiesList, -(60*60*24*30), '/', '', '');
112                        ad_storage = "denied";            
113                        ad_user_data = "denied";                        
114                    }
115                }
116                if(item.nextElementSibling.getAttribute('name') == 'cookie-personalization')
117                {
118                    if(item.nextElementSibling.value == '1')
119                    {                    
120                        // setCookie('cookies-cookie-personalization', cookiesList, 60*60*24*30, '/', '', '');
121                        ad_personalization = "granted";                        
122                    }
123                    else
124                    {
125                        // setCookie('cookies-cookie-personalization', cookiesList, -(60*60*24*30), '/', '', '');
126                        ad_personalization = "denied";                           
127                    }
128                }
129
130        });
131
132
133        // alert(Object.keys(zdzConsentMode).indexOf('cookie-analytics'));
134        
135
136        // if(zdzConsentMode.includes('cookie-analytics'))
137        // {
138        //     analytics_storage = "granted";
139        //     setCookie('cookies-cookie-analytics', cookiesList, 60*60*24*30, '/', '', '');
140        //     alert('analytics granted');
141        // }
142        // if(zdzConsentMode.includes('cookie-marketing'))
143        // {
144        //     setCookie('cookies-cookie-marketing', cookiesList, 60*60*24*30, '/', '', '');
145        //     ad_storage = "granted";            
146        //     ad_user_data = "granted";
147        // }
148        // if(zdzConsentMode.includes('cookie-personalization'))
149        // {
150        //     setCookie('cookies-cookie-personalization', cookiesList, 60*60*24*30, '/', '', '');
151        //     ad_personalization = "granted";                        
152        // }
153        // alert('analytics_storage ' + analytics_storage);
154        // alert('ad_storage ' + ad_storage);
155        // alert('ad_user_data ' + ad_user_data);
156        // alert('ad_personalization ' + ad_personalization); 
157
158        /*
159        ad_storage              reklamy     Umożliwia przechowywanie danych (np. plików cookie) związanych z reklamami
160        ad_user_data            reklamy     Określa stan zgody na wysyłanie do Google danych użytkownika związanych z reklamami.  
161        ad_personalization      reklamy     Określa stan zgody na reklamy spersonalizowane.
162        analytics_storage         
163        */        
164        // setCookie('cookies', cookiesList, 60*60*24*30, '/', '', '');
165
166        cookiesList = '{"necessaryCookies":"granted","analyticCookies":"' + analytics_storage + '","marketingCookies":"' + ad_storage  + '","personalizationCookies":"' + ad_personalization + '"}';
167        setCookie('zdzislowiczCookies', cookiesList, 60*60*24*30, '/', '', '');        
168 
169        gtag('consent', 'update', {
170            'ad_storage': '' + ad_storage,
171            'ad_user_data': ad_user_data,
172            'ad_personalization': ad_personalization,
173            'analytics_storage': analytics_storage
174        });
175
176        /*
177        cookiesList = JSON.stringify(cookiesList);
178
179
180
181        /*
182
183        $.ajax( {
184            url: strona_adres_pelny  + '/ajax/cookies.php',
185            dataType: 'json',
186            type: 'POST',
187            data: "cookiesList=" + cookiesList,
188            success: function(data, status) {
189                console.log('ok');
190                head = data.head;
191                body = data.body;
192
193                $('head').append(head);
194                $('body').append(body);
195            },
196            error: function() {
197                console.log('blad');
198            } 
199        });
200        */
201
202        setTimeout(() => { 
203            cookiesRecall.style.display = "block";
204        }, 200); 
205
206        // zdzCookiesRecall()
207    }
208
209    // function zdzCookiesRecall() {
210
211    // }
212});
213
214
215
216
217/*
218         _       _       _                  _                       _
219 ____ __| | ____(_) ___ | |  ___ __      __(_)  ___  ____    _ __  | |
220|_  // _` ||_  /| |/ __|| | / _ \\ \ /\ / /| | / __||_  /   | '_ \ | |
221 / /| (_| | / / | |\__ \| || (_) |\ V  V / | || (__  / /  _ | |_) || |
222/___|\__,_|/___||_||___/|_| \___/  \_/\_/  |_| \___|/___|(_)| .__/ |_|
223                                                            |_|
224
225ACCORDION COOKIES
226www.zdzislowicz.pl
227[email protected]
228
229all rights reserved
230*/
231
232$(document).ready(function () {
233    $(".cookies-accordion .cookie-type .cookie-header button").on("click", function () {
234        (accordion = $(this).parent().parent()),
235            accordion.hasClass("active")
236                ? (accordion.removeClass("active"),
237                  accordion.find(".cookie-content").css("max-height", accordion.find(".cookie-body").css("height")),
238                  setTimeout(function () {
239                      accordion.find(".cookie-content").css("max-height", "0");
240                  }, 0))
241                : (accordion.find(".cookie-content").css("max-height", accordion.find(".cookie-body").css("height")),
242                  setTimeout(function () {
243                      accordion.find(".cookie-content").css("max-height", "initial");
244                  }, 300),
245                  accordion.addClass("active"));
246    });
247});
248
249
250
251// FOCUS IN MODAL | add all the elements inside modal which you want to make focusable
252function zdzModal(nameModalClass) {
253    const  focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
254    const modal = document.querySelector(nameModalClass); // select the modal by it's class
255
256    const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal
257    const focusableContent = modal.querySelectorAll(focusableElements);
258    const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal
259
260    document.addEventListener('keydown', function(e) {
261        let isTabPressed = e.key === 'Tab' || e.key === 9;
262
263        if (!isTabPressed) {
264        return;
265        }
266
267        if (e.shiftKey) { // if shift key pressed for shift + tab combination
268            if (document.activeElement === firstFocusableElement) {
269                lastFocusableElement.focus();
269 // add focus for the last focusable element
270                e.preventDefault();
271            }
272        } else { // if tab key is pressed
273            if (document.activeElement === lastFocusableElement) { // if focused has reached to last focusable element then focus first focusable element after pressing tab
274            firstFocusableElement.focus(); // add focus for the first focusable element
275            e.preventDefault();
276            }
277        }
278    });
279    firstFocusableElement.focus();  
280}
281
282let allModals = document.querySelectorAll('.zdzModal');
283allModals.forEach(function(el) {
284    el.classList.remove('zdzModal');
285    el.className;
286    let nameModalClass = el.className;
287    zdzModal('.' + nameModalClass);
288})

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.