PageSourceSearch

https://lomza.so.gov.pl/js/app.js?v=7

js lomza.so.gov.pl collected 2026-10-04 23:02:38 UTC 7,322 bytes, 202 lines download raw bytes

1/* Skrypt serwisu. Wymaga jQuery (jquery-3.7.1.min.js).
2   jquery.validate.min.js i jquery.creaseFont.js sa opcjonalne - kod ponizej
3   sprawdza ich obecnosc, zeby brak jednego pliku nie wywracal calej reszty. */
4
5/* Okienko "wyslij znajomym" - wolane z wiadomosc.tpl przez javascript:pop(...) */
6function pop(plik, w, h) {
7    var aw = window.screen ? screen.availWidth : 640;
8    var ah = window.screen ? screen.availHeight : 480;
9
10    var dane = "width=" + w + ",height=" + h
11        + ",left=" + (aw - w) / 2
12        + ",top=" + (ah - h) / 2
13        + ",toolbar=no,location=no,directories=no,"
14        + "status=no,menubar=no,"
15        + "scrollbars=auto,resizable=yes";
16
17    return window.open(plik, 'pop', dane);
18}
19
20$(document).ready(function () {
21
22    /* Klasy menu bocznego - markup przychodzi z bazy, wiec dokladamy je tutaj */
23    $('.gz-menu > li').addClass('pierwsza');
24    $('a.aktywna').parent().addClass('zaznaczone');
25    $('.gz-menu').find('ul').parent().addClass('aktywny-dzial');
26    $('.pierwsza > a.aktywna').removeClass('aktywna');
27    $('#mapa-strony > ul > li').addClass('menu-root');
28    $('#mkat49, #mkat7, #mkat8, #mkat9').next('ul').prev('a').addClass('jednosta-podlegla');
29
30    /* Przelacznik rozmiaru czcionki - przyciski pochodza z bloku "przybornik" w bazie */
31    if ($.creaseFont) {
32        $.creaseFont({
33            content: ['html'],
34            defaultSize: 100,
35            maxSize: 200,
36            minSize: 80,
37            stepSize: 10,
38            unit: '%',
39            bFontLarge: '#fontLarge',
40            bFontDefault: '#fontDefault',
41            bFontSmall: '#fontSmall',
42            animate: true,
43            animateSpeed: 200,
44            cookieName: 'creaseFont',
45            cookiePath: '/',
46            cookieLifetime: 60
47        });
48    }
49
50    /* Przyciski „Drukuj” (<button data-drukuj>) - w stopce artykułu i w przyborniku */
51    $(document).on('click', '[data-drukuj]', function () {
52        window.print();
53    });
54
55    /* Po odrzuceniu formularza przez serwer fokus na podsumowanie błędów */
56    $('#bledy-formularza').trigger('focus');
57
58    /* Skiplink do wirtualnego asystenta. Widżet (zewnętrzny skrypt intelix) dokłada
59       #ix-chat-bubble do body asynchronicznie - przycisk pokazujemy dopiero wtedy,
60       a klik tylko przekazujemy do dymka widżetu */
61    var $asystent = $('.skiplinki__asystent');
62    if ($asystent.length) {
63        var pokazAsystenta = function () {
64            if (!document.getElementById('ix-chat-bubble')) {
65                return false;
66            }
67            $asystent.parent().prop('hidden', false);
68            return true;
69        };
70
71        if (!pokazAsystenta()) {
72            var obserwator = new MutationObserver(function () {
73                if (pokazAsystenta()) {
74                    obserwator.disconnect();
75                }
76            });
77            obserwator.observe(document.body, { childList: true });
78        }
79
80        $asystent.on('click', function () {
81            document.getElementById('ix-chat-bubble').click();
82            /* fokus do pola wiadomości, gdy okno się rozwinie */
83            setTimeout(function () {
84                var pole = document.getElementById('ix-chat-input');
85                if (pole) {
86                    pole.focus();
87                }
88            }, 400);
89        });
90    }
91
92    /* Fokus wewnątrz ramki z innej domeny (reCAPTCHA) nie ustawia :focus na <iframe>,
93       więc obwódkę (default.css, iframe.fokus-w-ramce) włączamy klasą. Okno traci
94       fokus, a activeElement to ramka = fokus jest w ramce. */
95    $(window).on('blur', function () {
96        setTimeout(function () {
97            var el = document.activeElement;
98            if (el && el.tagName === 'IFRAME') {
99                $(el).addClass('fokus-w-ramce');
100            }
101        }, 0);
102    }).on('focus', function () {
103        $('iframe.fokus-w-ramce').removeClass('fokus-w-ramce');
104    });
105
106    /* Linki otwierane w nowej karcie (także te wklejane w treści w CMS) - informacja
107       dla czytników ekranu, jeśli link jeszcze jej nie ma (WCAG 3.2.5). Pomijamy widżet
108       asystenta (#ix-*, .ix-*) - to zewnętrzny skrypt. */
109    var NOWA_KARTA = 'otwiera się w nowej karcie';
110    var maInformacje = /nowej karcie|nowym oknie|nowej zakładce|nowym okienku/i;
111
112    $('a[target="_blank"]').each(function () {
113        var $link = $(this);
114        if ($link.closest('[id^="ix-"], [class*="ix-"]').length) {
115            return;
116        }
117
118        var nazwa = [
119            $link.text(),
120            $link.attr('aria-label') || '',
121            $link.find('img').map(function () { return this.alt; }).get().join(' ')
122        ].join(' ');
123        if (maInformacje.test(nazwa)) {
124            return;
125        }
126
127        /* aria-label zastępuje treść linku, więc dopisujemy do niego, a nie do treści */
128        if ($link.attr('aria-label')) {
129            $link.attr('aria-label', $link.attr('aria-label') + ' (' + NOWA_KARTA + ')');
130        } else {
131            $link.append('<span class="show-for-sr"> (' + NOWA_KARTA + ')</span>');
132        }
133    });
134
135    if (!$.fn.validate) {
136        return;
137    }
138
139    /* Formularz kontaktowy - błędy na bieżąco, przy opuszczeniu pola (WCAG 3.3.1).
140       Komunikaty takie same jak w Formularz_Kontaktowy::waliduj() */
141    $('#form-kontakt').validate({
142        errorElement: 'span',
143        errorClass: 'blad-pola',
144        onfocusout: function (element) {
145            this.element(element);
146        },
147        messages: {
148            mail: {
149                required: 'Podaj adres e-mail.',
150                email: 'Podaj prawidłowy adres e-mail, np. [email protected].'
151            },
152            tres_wiadomosci: {
153                required: 'Wpisz treść wiadomości.'
154            }
155        }
156    });
157
158    $('#rezerwacja').validate({
159        rules: {
160            imie: "required",
161            sygnatura: "required",
162            data: "required",
163            przegladanie: "required",
164            mail: "required"
165        },
166        messages: {
167            imie: "Proszę podać imię i nazwisko",
168            mail: "Proszę podać prawidłowy adres e-mail lub numer telefonu",
169            sygnatura: "Proszę podać sygnaturę",
170            data: "Prosze podać datę",
171            przegladanie: "Proszę wybrać sposób przeglądania"
172        }
173    });
174
175    $('#ankieta-sadu').validate({
176        errorLabelContainer: $('#ankieta-sadu div.errorlabel'),
177        rules: {
178            pyt1: "required",
179            pyt2: "required",
180            pyt3: "required",
181            pyt4: "required",
182            pyt51: "required",
183            pyt52: "required",
184            pyt53: "required",
185            pyt54: "required",
186            pyt55: "required",
187            pyt6: "required"
188        },
189        messages: {
190            pyt1: "Proszę wypełnić pytanie 1",
191            pyt2: "Proszę wypełnić punkt 2",
192            pyt3: "Proszę wypełnić punkt 3",
193            pyt4: "Proszę wypełnić punkt 4",
194            pyt51: "Proszę wypełnić punkt 5.1",
195            pyt52: "Proszę wypełnić punkt 5.2",
196            pyt53: "Proszę wypełnić punkt 5.3",
197            pyt54: "Proszę wypełnić pytanie 5.4",
198            pyt55: "Proszę wypełnić pytanie 5.5",
199            pyt6: "Proszę wypełnić pytanie 6"
200        }
201    });
202});

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.