PageSourceSearch

https://28lo.pl/szablony/public/js/main.js

js 28lo.pl collected 2026-10-06 00:04:29 UTC 18,848 bytes, 552 lines download raw bytes

1//add class when use mouse
2document.body.addEventListener('mousedown', function() {
3    document.body.classList.add('using-mouse');
4});
5//remove class when use keyboard
6document.body.addEventListener('keydown', function(event) {
7    if (event.keyCode === 9) {
8        document.body.classList.remove('using-mouse');
9    }
10});
11
12$(document).ready(function() {
13
14
15    var navbar = $(".header");
16    var sticky = navbar[0].offsetTop + 100;
17
18    function addFixedMenu() {
19        if (window.pageYOffset >= sticky) {
20            navbar.addClass("fixed-menu");
21        } else {
22            navbar.removeClass("fixed-menu");
23        }
24    }
25
26    if ($("body").height() > ($(window).height() + 400)) {
27        window.onscroll = function() { addFixedMenu() };
28    }
29
30    isMobile = false;
31    if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) ||
32        /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
32substr(0, 4))) {
33        isMobile = true;
34
35    }
36
37    if (isMobile) {
38        $("body").addClass("is--mobile");
39        $("body").removeClass("is--desktop");
40    } else {
41        $("body").removeClass("is--mobile");
42        $("body").addClass("is--desktop");
43    }
44
45    function windowWidth() {
46        if ($(window).width() < 576) {
47            $("body").addClass("is--mobile");
48            $("body").removeClass("is--desktop");
49        } else {
50            $("body").removeClass("is--mobile");
51            $("body").addClass("is--desktop");
52
53        }
54        if ($(window).width() < 1149) {
55            $("body").addClass("nav-is--mobile");
56            $("body").removeClass("nav-is--desktop");
57        } else {
58            $("body").removeClass("nav-is--mobile");
59            $("body").addClass("nav-is--desktop");
60        }
61    }
62    windowWidth();
63    $(window).resize(function() {
64        windowWidth();
65    })
66
67
68    function msieversion() {
69
70        var ua = window.navigator.userAgent;
71        var msie = ua.indexOf("MSIE ");
72        console.log(msie);
73        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number
74        {
75            $("body").addClass("onmsie");
76
77            $("img").each(function() {
78                $(this).attr("src", $(this).attr("srcset"));
79            })
80
81
82
83        } else // If another browser, return 0
84        {
85            $("body").addClass("noonmsie");
86        }
87
88
89    }
90    msieversion();
91
92
93    // $("img").each(function() {
94    //     let src = $(this).attr("srcset");
95    //     $(this).attr("src", src);
96    // })
97
98    $('.nav__toggle').click(function() {
99        $(this).toggleClass('open');
100        $(".nav").toggleClass('open').slideToggle();
101
102
103        if ($(".nav").hasClass("open")) {
104            // $("body").addClass("body-fixed");
105            $(this).attr("aria-expanded", "true");
106        } else {
107            // $("body").removeClass("body-fixed");
108            $(".has-children>a").removeClass("is--open");
109            $(".has-children ul").slideUp();
110            $(this).attr("aria-expanded", "false");
111        }
112    });
113
114
115    $(".nav>ul li").each(function() {
116        if ($(this).children("ul").length > 0) {
117            $(this).addClass("has-children");
118            $(this).find(">a").attr("aria-expanded", "false");
119            console.log($(this).find(">a"));
120        }
121    })
122
123    function slideMenu(btn) {
124
125        if (btn.hasClass("is--open")) {
126            btn.siblings("ul").slideUp();
127            btn.parents(".has-children").removeClass("is--active");
128            btn.removeClass("is--open");
129            btn.find(">a").attr("aria-expanded", "true");
130        } else {
131            btn.siblings("ul").slideDown();
132            btn.addClass("is--open");
133            btn.parents(".has-children").addClass("is--active");
134            btn.find(">a").attr("aria-expanded", "false");
135        }
136    }
137
138    $(".nav-is--desktop .has-children").hover(function() {
139        $(this).children("ul").css("display", "block");
140        $(this).children(">a").addClass("is--open");
141        $(this).addClass("is--active");
142        //$("body").addClass("body-fixed");
143        $(this).find(">a").attr("aria-expanded", "true");
144    }, function() {
145        $(this).children("ul").css("display", "none");
146        $(this).children(">a").removeClass("is--open");
147        $(this).removeClass("is--active");
148        // $("body").removeClass("body-fixed");
149        $(this).find(">a").attr("aria-expanded", "false");
150    })
151
152    $(".nav-is--desktop .has-children>a").focus(function() {
153        $(this).parents("li").mouseover();
154    })
155
156    $(".nav-is--desktop .nav>ul>.has-children>ul>li:last-child a").focusout(function() {
157        $(this).parents(".has-children").mouseout();
158
159    })
160
161
162    // $(".has-children>a").click(function(e) {
163    //     e.preventDefault();
164    // })
165
166    $(".nav-is--mobile .has-children>a").on("click", function(e) {
167        e.preventDefault();
168        e.stopPropagation();
169        slideMenu($(this));
170
171    })
172
173
174
175    $("[data-src]").each(function() {
176        let src = $(this).attr("data-src");
177        $(this).attr("style", "background-image:url(" + src + ")");
178    })
179
180    $(".nav-left__btn--mobile").click(function() {
181        $(this).siblings("#form__nav-left").slideToggle();
182    })
183
184
185
186    //
187    $(".btn-more").click(function(e) {
188        e.preventDefault();
189        $(this).siblings(".card-more").slideToggle();
190    })
191
192
193    // zaznaczanie checkboxa/radio
194    $("form.check-radio label").click(function() {
195        $(this).siblings("input").click();
196    })
197
198    $(".form-input input, .form-input textarea").focusin(function() {
199        $(this).siblings("label").toggleClass("focus");
200    })
201    $(".form-input input, .form-input textarea").focusout(function() {
202        $(this).siblings("label").toggleClass("focus");
203    })
204
205
206    $("body.is--desktop").on("click", ".accordion__btn.open", function(e) {
207        e.preventDefault();
208        $(this).next(".accordion__content").slideUp();
209        $(this).removeClass("open");
210        $(this).addClass("close");
211    })
212    $("body.is--desktop").on("click", " .accordion__btn.close", function(e) {
213        e.preventDefault();
214        $(this).next(".accordion__content").slideDown();
215        $(this).addClass("open");
216        $(this).removeClass("close");
217    })
218    $(".is--desktop .accordion__btn.open-start").click();
219
220
221    $(".js--adElements-start").click();
222
223
224
225    $(".tab__container").each(function() {
226        tab($(this));
227    })
228
229    $(".nav-left__btn").click(function() {
230        if ($(this).hasClass("is--open")) {
231            $(this).removeClass("is--open");
232            $(this).siblings(".nav-lef").removeClass("is--open");
233        } else {
234            $(this).addClass("is--open");
235            $(this).siblings(".nav-lef").addClass("is--open");
236        }
237    })
238
239    $(".nav-left__btn--close").click(function() {
240        if ($(this).siblings(".nav-left__btn").hasClass("is--open")) {
241            $(this).siblings(".nav-left__btn").removeClass("is--open");
242            $(this).siblings(".nav-lef").removeClass("is--open");
243        }
244    })
245
246
247
248
249    $('input[type="tel"]').bind('keypress', function(e) {
250        return (e.which != 8 && e.keyCode != 189 && e.which != 45 && e.
250which != 32 && e.which != 0 && (e.which < 48 || e.which > 57)) ? false : true;
251    })
252
253
254
255    let checkInputValidate = function(input) {
256
257        if (input.parents("form").hasClass("afterFirstValidate")) {
258            let error = "error" + input.attr("id");
259            console.log(input[0].validationMessage);
260            input.siblings(".form-input__error").remove();
261            if (input[0].validity.valid) {
262                input.parents(".form-input").addClass("is--valid");
263                input.parents(".form-input").removeClass("is--invalid");
264
265                input.removeAttr("aria-describedby");
266            } else {
267                input.parents(".form-input").removeClass("is--valid");
268                input.parents(".form-input").addClass("is--invalid");
269
270                input.attr("aria-describedby", error);
271                input.after('<span id="' + error + '" class="form-input__error">' + input[0].validationMessage + '</span>')
272            }
273        }
274    }
275    let checkBoxValidate = function(input) {
276        let error = "error" + input.attr("id");
277        if (input.parents("form").hasClass("afterFirstValidate")) {
278            input.siblings(".form-input__error").remove();
279            if (input.is(":checked")) {
280                input.parents(".form-checkbox").addClass("is--valid");
281                input.parents(".form-checkbox").removeClass("is--invalid");
282                input.removeAttr("aria-describedby");
283            } else {
284                input.parents(".form-checkbox").removeClass("is--valid");
285                input.parents(".form-checkbox").addClass("is--invalid");
286                input.attr("aria-describedby", error);
287                input.after("<span id=" + error + "' class='form-input__error'>" + input[0].validationMessage + "</span>")
288            }
289        }
290    }
291
292
293    let isEmpty = function(el) {
294        ;
295        if (el.val() == "") {
296            el.parents(".form-input").addClass("empty");
297            el.parents(".form-input").removeClass("noempty");
298        } else {
299            el.parents(".form-input").removeClass("empty")
300            el.parents(".form-input").addClass("noempty")
301            if (!el[0].validity.valid) {
302                el.parents(".form-input").addClass("noempty");
303                el.parents(".form-input").removeClass("empty");
304            }
305        }
306    }
307
308
309    $('.form-input textarea, .form-input input').bind('focus keyup change', function() {
310        checkInputValidate($(this));
311        isEmpty($(this));
312        $(".form-invalid-info").css("display", "none");
313    });
314    $('.form-input textarea, .form-input input').each(function() {
315        isEmpty($(this));
316    });
317
318    $('.form-checkbox input').bind('change', function() {
319        checkBoxValidate($(this));
320        $(".form-invalid-info").css("display", "none");
321
322    });
323
324
325    if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
326        setTimeout(function() {
327            $("input::-webkit-autofill").each(function() {
328                $(this).addClass("noempty");
329                $(this).removeClass("empty");
330            })
331        }, 300)
332    } else {
333        setTimeout(function() {
334            $("input:-webkit-autofill").each(function() {
335                $(this).addClass("noempty");
336                $(this).removeClass("empty");
337            })
338        }, 300)
339    }
340
341
342    function isCaptchaChecked() {
343        return grecaptcha && grecaptcha.getResponse().length !== 0;
344    }
345
346
347    let formValidate = function(form, namefunction) {
348
349        const $form = form;
350        const $btnSubmitt = form.find('[type="submit"]');
351        const inputsRequired = form.find(".form-input input, .form-input textarea");
352
353        const checkBoxRequired = form.find(".form-checkbox input:required");
354
355        $btnSubmitt.click(function(e) {
356
357            e.preventDefault();
358            $form.addClass("afterFirstValidate");
359
360
361            inputsRequired.each(function() {
362                checkInputValidate($(this));
363            });
364
365
366            checkBoxRequired.each(function() {
367                checkBoxValidate($(this));
368
369            });
370
371
372            if ($(".is--invalid").length == 0) {
373                if (namefunction == 1) {
374                    form.submit();
375                } else {
376                    namefunction(form);
377                }
378            } else {
379                $(".form-invalid-info").css("display", "block");
380                console.log(form.find(".is--invalid")[0]);
381                form.find(".is--invalid input")[0].focus();
382
383            }
384        })
385    }
386
387    $(".contact__form").each(function() {
388        formValidate($(this), 1);
389    })
390
391    function modalForm(form) {
392        formData = new FormData(form[0]);;
393        $.ajax({
394            url: '/a/',
395            type: "POST",
396            data: formData,
397            async: false,
398            success: function(data) {
399                form.after('<div class="info-1">Dziękujemy za zgłoszenie</div>')
400                form.css("display", "none");
401
402            },
403            cache: false,
404            contentType: false,
405            processData: false
406
407        })
408    }
409    $(".modal__form").each(function() {
410        formValidate($(this), modalForm);
411    })
412
413    $(".mpNews__item").click(function() {
414        window.location.href = $(this).find("a").attr("href");
415    })
416    $(".sacra__txt").click(function() {
417        window.location.href = $(this).find("a").attr("href");
418    })
419
420
421
422    function changeCalenfarHref() {
423        setTimeout(function() {
424            let dataOnCalendar = $(".calendar-month-header .header-calendar-date span").html();
425
426            let month;
427            if (dataOnCalendar.indexOf("Styczeń") >= 0) month = "01";
428            if (dataOnCalendar.indexOf("Luty") >= 0) month = "02";
429            if (dataOnCalendar.indexOf("Marzec") >= 0) month = "03";
430            if (dataOnCalendar.indexOf("Kwiecień") >= 0) month = "04";
431            if (dataOnCalendar.indexOf("Maj") >= 0) month = "05";
432            if (dataOnCalendar.indexOf("Czerwiec") >= 0) month = "06";
433            if (dataOnCalendar.indexOf("Lipiec") >= 0) month = "07";
434            if (dataOnCalendar.indexOf("Sierpień") >= 0) month = "08";
435            if (dataOnCalendar.indexOf("Wrzesień") >= 0) month = "09";
436            if (dataOnCalendar.indexOf("Październik") >= 0) month = "10";
437            if (dataOnCalendar.indexOf("Listopad") >= 0) month = "11";
438            if (dataOnCalendar.indexOf("Grudzień") >= 0) month = "12";
439
440            let year = dataOnCalendar.split(" ").pop();
441            let hrefToCalendar = "/kalendarz/?data=" + year + "-" + month;
442            $("#pokazmiesiac").attr("href", hrefToCalendar);
443        }, 1000)
444    }
445
446
447    $("body").on("click ", ".calendar-month-navigation", function(e) {
448        onmouseleave.log("dddd");
449    })
450
451
452
453
454
455
456    if ($("#my-calendar").length > 0) {
457        let zabutoMonth = $("#my-calendar").data("month");
458        let zabutoYear = $("#my-calendar").data("year");
459        let zabutoDay = $("#my-calendar").data("day");
460        let zabutoData = zabutoYear + "-" + zabutoMonth + "-" + zabutoDay
461        let eventData = [
462            { "date": zabutoData, "badge": true, "title": "" },
463        ];
464        if (zabutoMonth) {
465            console.log("cccc");
466            $("#my-calendar").zabuto_calendar({
467                language: "pl",
468                month: zabutoMonth,
469                year: zabutoYear,
470                action_nav: function() { changeCalenfarHref() },
471                data: eventData,
472            });
473        } else {
474            $("#my-calendar").zabuto_calendar({ language: "pl", action_nav: true });
475        }
476
477    }
478
479
480    // if ($("#my-calendar").length) {
481
482    //     let urlEvents = "/a/?jezyk=" + langA + "&akcja=wydarzeniaKalendarz"
483    //     $("#my-calendar").zabuto_calendar({
484    //         language: langA,
485    //         ajax: {
486    //             url: urlEvents,
487    //             modal: true
488    //         }
489    //     });
490
491    //     $(".calendar-month-navigation").click(function() {
492
493    //         const month = $('.calendar-month-header td[colspan="5"] span').html();
494    //         $("#my-calendar").zabuto_calendar({
495    //             language: langA,
496    //             ajax: {
497    //                 url: urlEvents,
498    //                 miesiac: month,
499    //                 modal: true
500    //             }
501    //         });
502    //     });
503    // }
504
505
506    function setCookie(cname, cvalue, exdays) {
507        var d = new Date();
508        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
509        var expires = "expires=" + d.toUTCString();
510        document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
511    }
512
513    function getCookie(cname) {
514        var name = cname + "=";
515        var ca = document.cookie.split(';');
516        for (var i = 0; i < ca.length; i++) {
517            var c = ca[i];
518            while (c.charAt(0) == ' ') {
519                c = c.substring(1);
520            }
521            if (c.indexOf(name) == 0) {
522                return c.substring(name.length, c.length);
523            }
524        }
525        return "";
526    }
527
528
529
530    $(".settings__option--contrast button").click(function(e) {
531        $(".settings__option--contrast button").removeAttr("aria-pressed");
532        $("head link[href*='contrast']").remove();
533        e.preventDefault();
534        let cssName = $(this).data("css");
535        $(this).attr("aria-pressed", "true")
536        if (cssName != "contrast-1") {
537            let styleTag = '<link rel="stylesheet" href="/szablony/public/css/' + cssName + '.css">';
538            $("head").append(styleTag);
539        }
540        setCookie("contrast", cssName, 365);
541    })
542
543
544    if (getCookie('contrast') != "") {
545        let cookieFont = 'button' + "[data-css='" + getCookie('contrast') + "']";
546        $(cookieFont)[0].click();
547    }
548
549
550
551
552})

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.