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.