PageSourceSearch

https://racot.pl/js/main.js

js racot.pl collected 2026-10-08 09:58:33 UTC 7,874 bytes, 333 lines download raw bytes

1'use scrict';
2
3$(document).ready(function () {
4
5	//obsługa wielopoziomowego menu górnego
6	$('.navbar-nav a').each(function () {
7		$(this).on('click', function () {
8			$('.navbar-nav .show').removeClass('show');
9			if ($(this).attr('href') == '#' && $(this).next('.dropdown-menu').length) {
10				if ($(this).next('.dropdown-menu').is(':visible')) {
11					$(this).next('.dropdown-menu').hide();
12				} else {
13					$(this).parent().siblings().find('.dropdown-menu').hide();
14					$(this).next('.dropdown-menu').show();
15				}
16
17				return false;
18			}
19		});
20	});
21
22	//gdy rozwinięte menu i klik poza menu
23	$(document).on('click', function () {
24		$('.navbar .dropdown-menu').hide();
25	});
26
27
28	if ($('.gal').length && $('.sub').length) {
29		AOS.init();
30	}
31	
32
33	$.stellar();
34
35	if ($('table').length) {
36		$('table').not('.akordeon table').addClass('table table-responsive');
37	}
38
39	$(window).on('load', function () {
40
41		if ($('.gal').length === 0 && $('.sub').length === 0) {
42			AOS.init();
43		}
44		
45
46		if ($('.timeline-list').length) {
47			$(window).on('scroll', function () {
48				$('.timeline-list:in-viewport').addClass('animate_this');
49			});
50		}
51	});
52
53	if ($('.sub').length && $('.main h2').length) {
54		$('.main h2').append('<hr>');
55	}
56
57	if ($('.sub .news').length) {
58		$('.sub .main').css('padding', '60px 0 0');
59	}
60
61	$(window).on('scroll', function () {
62		if ($(window).scrollTop() > 123) {
63			$('.navbar').addClass('affix');
64		} else {
65			$('.navbar').removeClass('affix');
66		}
67	});
68
69
70    $.fn.setAllToMaxHeight = function(){
71        return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height(); }) ) );
72    };
73
74
75    //$('.box p').setAllToMaxHeight();
76
77    $.fn.clickable = function () {
78        this.click(function () {
79            var link = this.find('a:first').attr('href');
80            window.location = link;
81            return false;
82        });
83    };
84
85	if ($('.media').length) {
86		$('.media').clickable();
87	}
88    
89
90	$.fn.anchorNav = function (options) {
91
92        var settings = $.extend({
93            offset: 100,
94            speed: 1000
95        }, options);
96
97        return this.find('a[href^="#"]').each(function () {
98
99            $(this).click(function () {
100				var link = $(this).attr('href');
101	            var off = $(link).offset();
102
103                $('body, html').animate({
104                    scrollTop: off.top - settings.offset
105                }, settings.speed);
106
107                window.location.hash = link;
108                console.log(link);
109                return false;
110            });
111        });
112
113    };
114
115    //$('.navbar-nav').anchorNav();
116
117
118	if ($('.akordeon').length) {
119		$('.akordeon tr, .akordeon td').css('display', 'block');
120		$('.akordeon tr:odd').addClass('odd').hide();
121		$('.akordeon h3').each(function () {
122			$(this).on('click', function () {
123				if ($(this).parent().parent().hasClass('active')) {
124					$('.active').next('tr').slideUp(300);
125					$(this).parent().parent().toggleClass('active');
126				} else {
127					$('.akordeon tr:odd').slideUp(300);
128					$('.akordeon .active').removeClass();
129
130					$(this).parent().parent().toggleClass('active');
131
132					$('.active').next('tr').slideDown(300);
133				}
134			});
135		});
136	}
137
138
139	$('.fb_slider_right').hover(function(){
140			$(this).animate({
141				right: 0,
142				height: '100%'
143			}, 'fast');
144		}, function(){
145			$(this).animate({
146				right: -320,
147				height: 100
148			}, 'fast');
149		});
150
151
152    // if ($('.fancy').length) {
153	// 	$('.fancy').fancybox({
154	// 		margin: 15,
155	// 		padding: 0
156	// 	});
157    // }
158
159
160	if ($('.datepicker').length) {
161		$(".datepicker").datepicker({
162            monthNames: ["Styczeń„", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień„", "Październik", "Listopad", "Grudzień„"],
163			monthNamesShort: ['Sty', 'Lu', 'Mar', 'Kw', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Pa', 'Lis', 'Gru'],
164			dayNames: ['Niedziela', 'Poniedział‚ek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'],
165			dayNamesShort: ['Nie', 'Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'So'],
166			dayNamesMin: ['Ni', 'Pn', 'Wt', 'ښr', 'Cz', 'Pt', 'So'],
167			dateFormat: 'yy-mm-dd',
168			firstDay: 1
169		});
170	}
171
172    if ($('#mapagoogle').length) {
173
174		map = new GMaps({
175			div: '#mapagoogle',
176			lat: 52.0875976,
177			lng: 16.6169615,
178			zoom: 15,
179			disableDefaultUI: true,
180			scrollwheel: false
181		});
182
183		map.addMarker({
184			lat: 52.0875976,
185			lng: 16.6269615,
186			title: 'Tu jesteśmy'
187		});
188
189    }
190
191
192
193	// Download list
194
195	if ($('.download').length) {
196
197	//add file type container
198		$('.download a .btn').each(function () {
199			$(this).parent().before(' <span class="col-plik col-lg-2 hidden-sm hidden-xs"><span class="plik"></span></span>');
200		});
201
202		$('.download .plik').each(function () {
203
204			var linkTxt = $(this).parent().parent().attr('href'),
205				typ_pliku = linkTxt.substring((linkTxt.lastIndexOf('.') + 1), 999999);
206
207			$(this).text(typ_pliku);
208			$(this).parent().addClass(typ_pliku);
209
210			// if pdf open in new window
211			if (typ_pliku === "pdf") {
212				$(this).parent().parent().click(function () {
213					window.open(this.href);
214					return false;
215				});
216			}
217		});
218
219	}
220
221
222
223	// blank
224
225	if ($('.blank').length) {
226		$('.blank').click(function () {
227			window.open(this.href);
228			return false;
229		});
230	}
231
232
233
234	// ajax form
235
236	function showRequest() {
237		var valid = true;
238		$('.required').click(function () {
239			$(this).parent().removeClass('has-error');
240			$('.alert-danger').fadeOut();
241		});
242		$('.required').each(function () {
243			if ($(this).val() === '') {
244				$(this).parent().addClass('has-error');
245				valid = false;
246			} else {
247				$(this).parent().removeClass('has-error');
248			}
249		});
250		if (!valid) {
251			$('.alert-danger').fadeIn();
252			return false;
253		} else {
254			$('.ajax-form .alert-warning').hide().text('Wysyłam formularz...').fadeIn(500);
255		}
256	}
257
258	function showResponse(responseText, statusText, xhr, $form)  {
259		if (statusText == 'success') {
260			$('.ajax-form .alert-warning').removeClass('alert-warning').addClass('alert-success').text(responseText).fadeIn(500);
261		} else {
262			$('.ajax-form .alert-warning').hide().text(responseText).fadeIn(500);
263		}
264	}
265
266	if ($('.ajax-form').length) {
267
268		$('.ajax-form').attr('action', 'formSend.php');
269
270		var options = {
271			beforeSubmit:  showRequest,
272			success:       showResponse
273		};
274
275		$('.ajax-form').ajaxForm(options);
276	}
277
278
279
280	if ($('.form-minimal').length) {
281		$('input, textarea').each(function () {
282			$(this).focus(function () {
283				$(this).parent().addClass('active');
284			});
285			$(this).blur(function () {
286				if ($(this).val() === '') {
287					$(this).parent().removeClass('active');
288				}
289			});
290		});
291	}
292
293
294
295
296	// Hide the element. Doing this here will prevent the elements from disappering if JS is disabled.
297	$('.fade-content > *').css({'opacity':'0', 'transform': 'translateY(' + 2 + 'em)'});
298
299	// Trigger fade in as window scrolls
300	$(window).on('scroll load', function(){
301	  $('.fade-content > *').each( function(i){
302	    var bottom_of_object = $(this).offset().top + $(this).outerHeight()/8;
303	    var bottom_of_window = $(window).scrollTop() + $(window).height();
304	    if( bottom_of_window > bottom_of_object ){
305	      $(this).css({'opacity':'1', 'transform': 'translateY(' + 0 + 'em)'});
306	    } else {
307	      $(this).css({'opacity':'0', 'transform': 'translateY(' + 2 + 'em)'});
308	    }
309	  });
310	});
311
312
313
314
315	    // $("#pages").paginate({
316		// 	count 		: <?= ceil($newsIle/$newsPerPage); ?>,
317		// 	start 		: <?= max(1, $_GET['p']); ?>,
318		// 	display     : 6,
319		// 	border				: false,
320		// 	background_hover_color: '#0E71B8',
321		// 	background_color: '#fff',
322		// 	text_color: '#666',
323		// 	text_hover_color: '#fff',
324		// 	images				: false,
325		// 	mouse				: 'press',
326		// 	onChange     			: function(page){
327		// 								window.location.href='<?= ereg_replace('&p=[0-9]$', '' , $_SERVER['REQUEST_URI']); ?><? if (strpos($_SERVER['REQUEST_URI'], '?') === false) { echo '?'; } ?>&p=' + page;
328		// 							  }
329		// });
330
331
332
333});

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.