PageSourceSearch

https://www.bpmuziejus.lt/js/cookie.js?v=2

js bpmuziejus.lt collected 2026-09-24 21:41:59 UTC 7,133 bytes, 267 lines download raw bytes

1var shown = false;
2function cookiesAgree() {
3
4    function LoadGoogleAnalytics() {
5
6        $.post('/ajax.php', {
7            action: 'GoogleAnalytics'
8        }, function (data) {
9            if (data.status) {
10
11                $('head').append(data.return.head);
12                $('body').prepend(data.return.body);
13
14            }
15        }, 'json')
16
17    }
18    function savelog(value) {
19
20        $.ajax({
21            type: 'POST',
22            url: '/cookie-save/',
23            async: false,
24            data: {val: value},
25            dataType: 'json',
26            success: function (data) {
27
28
29            }
30        });
31    }
32
33    function createCookie(name, value, days) {
34
35        var expires = "";
36        if (days) {
37            var date = new Date();
38            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
39            expires = "; expires=" + date.toUTCString();
40        }
41
42
43        if (location.protocol === 'https:') {
44
45            document.cookie = name + "=" + value + expires + "; path=/;SameSite=Lax;secure ";
46
47        } else {
48
49            document.cookie = name + "=" + value + expires + "; path=/;SameSite=Lax ";
50
51        }
52
53    }
54
55    function eraseCookie(name) {
56        var date = new Date();
57        date.setTime(date.getTime() + (-1 * 24 * 60 * 60 * 1000));
58        var expires = "; expires=" + date.toUTCString();
59
60
61        var host1 = location.host;
62        var host2 = host1.replace('www', '');
63
64        if (location.protocol === 'https:') {
65            document.cookie = name + "=" + expires + "; domain=" + host1 + "; path=/;SameSite=Lax;secure ";
66            document.cookie = name + "=" + expires + "; domain=" + host2 + "; path=/;SameSite=Lax;secure ";
67        } else {
68            document.cookie = name + "=" + expires + "; domain=" + host1 + "; path=/;SameSite=Lax ";
69            document.cookie = name + "=" + expires + "; domain=" + host2 + "; path=/;SameSite=Lax ";
70        }
71    }
72
73    function eraseCookies() {
74        //var nameEQ = name + "=";
75        var ca = document.cookie.split(';');
76        for (var i = 0; i < ca.length; i++) {
77
78            var n = ca[i].split('=');
79
80            var name = $.trim(n[0]);
81
82            var subname = name.substring(0, 9);
83
84            if (name != 'uniq_param' && subname != 'CMSSESSID') {
85                eraseCookie($.trim(n[0]));
86            }
87
88        }
89
90
91        return null;
92    }
93
94    function getCookie(cname) {
95        let name = cname + "=";
96        let decodedCookie = decodeURIComponent(document.cookie);
97        let ca = decodedCookie.split(';');
98        for (let i = 0; i < ca.length; i++) {
99            let c = ca[i];
100            while (c.charAt(0) == ' ') {
101                c = c.substring(1);
102            }
103            if (c.indexOf(name) == 0) {
104                return c.substring(name.length, c.length);
105            }
106        }
107        return "";
108    }
109
110    var html = $('html');
111
112    html.on('click', '.submit-cookie', function (event) {
113
114        event.preventDefault();
115        $('.cookie-section').removeClass('visible');
116
117        // localStorage.setItem('cookiesAgree', 'true');
118        // localStorage.setItem('cookiesLevel1', 1);
119        // localStorage.setItem('cookiesLevel2', 1);
120        // localStorage.setItem('cookiesLevel3', 1);
121        createCookie('cookiesAgree', 'true', 99999);
122        createCookie('cookiesLevel1', 1, 99999);
123        createCookie('cookiesLevel2', 1, 99999);
124        createCookie('cookiesLevel3', 1, 99999);
125        savelog('cookiesLevel1,cookiesLevel2,cookiesLevel3');
126
127        LoadGoogleAnalytics();
128
129        //$('body').append('
vendor: 84 bytes, line 129
129<script src="https://www.google.com/recaptcha/api.js?onload=the_call_back"></script>
129');
130    });
131
132    $('.submit-none-cookie').on('click', function (event) {
133
134        event.preventDefault();
135        $('.cookie-section').removeClass('visible');
136
137        eraseCookies();
138        savelog('no-cookies');
139        createCookie('cookiesDisAgree', 'true', 99999);
140        // localStorage.setItem('cookiesDisAgree', 'true');
141
142    });
143
144
145    html.on('click', '.submit-part-cookie', function (event) {
146        event.preventDefault();
147
148        var cookie_policy_1 = $(this).parents('.descr2').find('input[name="cookie_policy_1"]:checked').val();
149        var cookie_policy_2 = $(this).parents('.descr2').find('input[name="cookie_policy_2"]:checked').val();
150        var cookie_policy_3 = $(this).parents('.descr2').find('input[name="cookie_policy_3"]:checked').val();
151
152        eraseCookies();
153
154        // localStorage.setItem('cookiesAgree', 'true');
155        createCookie('cookiesAgree', 'true', 99999);
156
157        //cookie_policy_1
158        // localStorage.setItem('cookiesLevel1', 1);
159        createCookie('cookiesLevel1', 1, 99999);
160        var cs = 'cookiesLevel1';
161
162        if (typeof cookie_policy_2 != 'undefined') {
163            // localStorage.setItem('cookiesLevel2', 1);
164            createCookie('cookiesLevel2', 1, 99999);
165            cs = cs + ',cookiesLevel2';
166        }
167        if (typeof cookie_policy_3 != 'undefined') {
168            // localStorage.setItem('cookiesLevel3', 1);
169            createCookie('cookiesLevel3', 1, 99999);
170            cs = cs + ',cookiesLevel3';
171        }
172
173        savelog(cs);
174
175        $('.cookie-section').removeClass('visible');
176        $.fancybox.close();
177
178        LoadGoogleAnalytics();
179        //$('body').append('
vendor: 85 bytes, line 179
179<script src="https://www.google.com/recaptcha/api.js?onload=the_call_back2"></script>
179');
180    });
181
182    html.on('click', '.cookie-cancel', function (e) {
183        e.preventDefault();
184
185        $.fancybox.close();
186
187    });
188
189    html.on('click', '.cookie-table tr', function (e) {
190        if (!$(e.target).is('input') && $(this).find('input[type="checkbox"]:not(input:disabled)').length > 0) {
191
192            var ckb = $(this).find('input[type="checkbox"]');
193            if (ckb.prop('checked')) {
194                $(this).find('input[type="checkbox"]').prop('checked', false);
195            } else {
196                $(this).find('input[type="checkbox"]').prop('checked', true);
197            }
198        }
199
200
201    });
202
203
204    if (getCookie('cookiesAgree')) {
205
206
207    } else {
208
209        eraseCookies();
210    }
211
212    if (!getCookie('cookiesAgree') && !getCookie('cookiesDisAgree')) {
213
214
215        var fs = window.RequestFileSystem || window.webkitRequestFileSystem;
216        if (!fs) {
217            addVisible();
218        } else {
219            fs(window.TEMPORARY,
220                100,
221                function () {
222                    addVisible();
223                },
224                function () {
225
226                }
227            );
228        }
229    }
230
231     function addVisible() {
232
233        $(window).on('scroll', function (e) {
234
235            if (!shown && $(window).scrollTop() >= 50) {
236
237                shown = true;
238                $('.cookie-section').addClass('visible');
239                LoadGoogleAnalytics();
240
241            }
242
243        });
244
245
246
247    }
248
249}
250
251function focus() {
252
253
254    $('.cookie_no a').click(function (e) {
255        e.preventDefault();
256        $('.fancy2').trigger('click');
257    });
258
259    $('.fancy2').fancybox({helpers: {media: {}, overlay: {locked: false}}});
260
261
262}
263
264$(document).ready(function () {
265    cookiesAgree();
266    focus();
267});

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.