PageSourceSearch

https://www.finemedia.pl/wp-content/themes/finemedia/includes/js/functions.js?ver=5.4.10

js finemedia.pl collected 2026-10-07 00:39:34 UTC 16,787 bytes, 576 lines download raw bytes

1(function($){
2	
3	$(document).ready(function() {
4		$('.columns-contact-list select').change(function() {
5			var target = '.'+$(this).val();
6			$('.columns_contact_list-item').removeClass('active');
7			$('.columns-contact-text '+target).addClass('active');
8
9			
10			function changeForm(x) { //Change the form - its depends on select
11				if (x === '.item-1' || x === '.item-2') {
12					$('#wpcf7-f2164-p743-o2').removeClass('active');
13					$('#wpcf7-f1077-p743-o1').addClass('active');
14				} else if (x === '.item-3') {
15					$('#wpcf7-f1077-p743-o1').removeClass('active');
16					$('#wpcf7-f2164-p743-o2').addClass('active');
17				}
18			};
19			changeForm(target); //taking the target value
20		});
21		$('#wpcf7-f1077-p743-o1').addClass('active'); //It should be active for first time
22	});
23	
24	$(document).ready(function() {
25		$('.wifi').click(function() {
26			$('#rangeModal').modal('show');
27		});
28	});
29	
30	$(document).ready(function() {
31		if($('.wpcf7-radio .wpcf7-list-item, .wpcf7-checkbox .wpcf7-list-item').length > 0)
32		{
33			$(".wpcf7-radio .wpcf7-list-item .wpcf7-list-item-label, .wpcf7-checkbox .wpcf7-list-item .wpcf7-list-item-label").each(function() {
34				var text = $(this).text();
35				text = text.replace("(", "<span>(");
36				text = text.replace(")", ")</span>");
37				$(this).html(text);
38			});
39		}
40	});
41	
42	
43	
44	// Visible and hide specific dropdown menu, when dropdown toggle was clicked - only in mobile device
45	// works on a few-level menu
46	$(document).ready(function() {
47		if( $(document).width() < 768 ) {
48			$( '.dropdown-toggle' ).click(function() {
49				var data_toggle = $( this ).attr('data-toggle');
50				$( this ).siblings('.dropdown-menu').toggleClass('show');
51				$('.' + data_toggle).toggleClass('show');
52			});
53		}
54	});
55	
56	if ( $('#counter').length ) {
57		var year = $('#counter').attr('year');
58		var month = $('#counter').attr('month');
59		var day = $('#counter').attr('day');
60
61		var hour = $('#counter').attr('hour');
62		var minute = $('#counter').attr('minute');
63
64		// Adding of a words for signatures of countdown
65		$.syotimerLang.pl = {
66			second: ['SEK', 'SEK', 'SEK'],
67			minute: ['MIN', 'MIN', 'MIN'],
68			hour: ['GODZ', 'GODZ', 'GODZ'],
69			day: ['DNI', 'DNI', 'DNI'],
70			handler: 'plNumeral'
71		};
72		// Adding of the handler that selects an index from the list of words based on ahead the going number
73		$.syotimerLang.plNumeral = function(number) {
74			var lastDigit = number % 10;
75			if ( lastDigit === 1 ) {
76				return 0;
77			} else if ( lastDigit === 5) {
78				return 1;
79			} else {
80				return 2;
81			}
82		};
83		$('#counter').syotimer({
84			year: year,
85			month: month,
86			day: day,
87			hour: hour,
88			minute: minute,
89			layout: 'dhms',
90			periodic: true,
91			periodInterval: 168,
92			periodUnit: 'h',
93			lang: 'pl'
94		});
95	}
96
97	// Preloader
98	$(document).ready(function() {
99		$(window).load(function(){
100			$('#preloader').fadeOut('slow',function(){$(this).remove();});
101		});
102	});
103
104	$('.carousel').carousel({
105		pause: "false",
106		interval: 10000
107	});
108
109	$('.section-with-sidebar').css('min-height', $('.sidebar-section__container').css('height'));
110
111	/* VIDEO options */
112	$('.bg-video-click').click(function(){
113  	$(this).get(0).play();
114  });
115
116	var figure = $(".bg-video-hover").hover( hoverVideo, hideVideo );
117	function hoverVideo(e) {
118	    $('.bg-video-hover').get(0).play();
119	}
120	function hideVideo(e) {
121	    $('.bg-video-hover').get(0).pause();
122	}
123	$('.bg-video-mute').prop('muted', true);
124
125	// Style table
126	$('table').addClass('table');
127	$('table').addClass('table-hover');
128	$('table').wrap('<div class="table-responsive"></div>');
129
130  //
131	// var $video  = $('video'),
132	//     $window = $(window);
133  //
134	// $(window).resize(function(){
135  //
136	//     var height = $window.height();
137	//     $video.css('height', height);
138  //
139	//     var videoWidth = $video.width(),
140	//         windowWidth = $window.width(),
141	//     marginLeftAdjust =   (windowWidth - videoWidth) / 2;
142  //
143	//     $video.css({
144	//         'height': height,
145	//         'marginLeft' : marginLeftAdjust
146	//     });
147	// }).resize();
148
149	// Affix options
150	$(document).ready(function() {
151      var toggleAffix = function(affixElement, scrollElement, wrapper) {
152      var height = affixElement.outerHeight(),
153          top = wrapper.offset().top;
154      if (scrollElement.scrollTop() >= top){
155          wrapper.height(height);
156          affixElement.addClass("affix");
157          affixElement.addClass("container");
158      }
159      else {
160          affixElement.removeClass("affix");
161          affixElement.removeClass("container");
162          wrapper.height('auto');
163      }
164      };
165      $('[data-toggle="affix"]').each(function() {
166      var ele = $(this),
167          wrapper = $('<div></div>');
168      ele.before(wrapper);
169      $(window).on('scroll resize', function() {
170          toggleAffix(ele, $(this), wrapper);
171      });
172      // init
173      toggleAffix(ele, $(window), wrapper);
174      });
175  });
176
177	// Smooth scrolling
178	$('#go-top').on('click', scrollToTop);
179	function scrollToTop() {
180		verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
181		element = $('body');
182		offset = element.offset();
183		offsetTop = offset.top;
184		$('html, body').animate({scrollTop: offsetTop}, 500, 'linear');
185	}
186
187	// Isotope
188	var $grid = $('.grid').imagesLoaded( function() {
189		$grid.isotope({
190			itemSelector: '.grid-item',
191			percentPosition: true,
192			layoutMode:'masonry',
193			masonry:{
194				columnWidth: '.grid-sizer',
195				gutter: '.gutter-sizer',
196				horizontalOrder: true
197			}
198		});
199	});
200	var $isogrid = $('.isotope-grid').imagesLoaded( function() {
201		$isogrid.isotope({
202			itemSelector: '.grid-item',
203			percentPosition: true,
204			layoutMode:'masonry',
205			masonry:{
206				columnWidth: '.grid-sizer',
207				gutter: '.gutter-sizer',
208				horizontalOrder: true
209			}
210		});
211		$('.filters a').click(function(){
212			var $this = $(this);
213
214			if ( $this.hasClass('selected') ) {
215				return;
216			}
217
218			$('.filters a').filter('.selected').removeClass('selected');
219			$this.addClass('selected');
220			selector = $this.data('filter');
221
222			$isogrid.isotope({
223				filter: selector
224			});
225		});
226	});
227
228	// Animated Counter
229	// $('.count').each(function () {
230	// 	$(this).prop('Counter',0).animate({
231	// 		Counter: $(this).text()
232	// 	}, {
233	// 		duration: 5000,
234	// 		easing: 'swing',
235	// 		step: function (now) {
236	// 			$(this).text(Math.ceil(now));
237	// 		}
238	// 	});
239	// });
240	$('.count').counterUp({
241      delay: 10,
242      time: 1000
243  });
244
245	// Features on slider
246	$('section.slider-with-features + section').each(function () {
247		$elementheight = $('section.slider-with-features + section').height();
248		$('section.slider-with-features').next().css('margin-top', '-' + $elementheight + 'px');
249	});
250
251	// if($( document ).width() >= 768){
252	// 	// Check each slider item hight to display vertical align text
253	// 	$(".slider_section .carousel-inner").each(function () {
254	// 		$carouselheight = $(this).height();
255	// 		//$(this).children(".caption-img").css("height", $carouselheight + "px");
256	// 		$(this).find(".caption-box").css("height", $carouselheight + "px");
257	// 	});
258	// }
259
260	// Absolute positioning of footer
261	window.addRule = function (selector, styles, sheet) {
262    styles = (function (styles) {
263        if (typeof styles === "string") return styles;
264        var clone = "";
265        for (var p in styles) {
266            if (styles.hasOwnProperty(p)) {
267                var val = styles[p];
268                p = p.replace(/([A-Z])/g, "-$1").toLowerCase(); // convert to dash-case
269                clone += p + ":" + (p === "content" ? '"' + val + '"' : val) + "; ";
270            }
271        }
272        return clone;
273    }(styles));
274    sheet = sheet || document.styleSheets[document.styleSheets.length - 1];
275    if (sheet.insertRule) sheet.insertRule(selector + " {" + styles + "}", sheet.cssRules.length);
276    else if (sheet.addRule) sheet.addRule(selector, styles);
277
278    return this;
279    };
280    if ($) $.fn.addRule = function (styles, sheet) {
281        addRule(this.selector, styles, sheet);
282        return this;
283    };
284	if($( document ).width() >= 768){
285		$footerheight = $(".footer-box").height() - 10;
286		$("body:after").addRule({
287			height: $footerheight + "px"
288		});
289
290	}
291
292	// Back to top of site
293	$('.go-top').click(function (e) {
294	  e.preventDefault();
295	  $('html, body').animate({scrollTop: 0}, 800);
296	});
297
298	// Covering photo - compare two photos
299	// $('.photo-vertical').coveringBad({
300	// 	setX  : 200,
301	// 	setY  : 100 ,
302	// 	direction   : "vertical"
303	// });
304  //
305	// $('.photo-horizontal').coveringBad({
306	// 	setX  : 210,
307	// 	setY  : 140 ,
308	// 	direction   : "horizontal"
309	// });
310
311	// Add lightbox rel to woocommerce img
312	$('.woocommerce-product-gallery__image a').attr('rel', 'lightbox');
313
314	// Popup
315	// $(function () {
316	// 	Popup.init({
317	// 		popupOverlayEl: $('.popup-overlay'),
318	// 		popupEl: $('.popup'),
319	// 		closeEl: $('.popup').find('.close')
320	// 	});
321	// });
322
323	// Stop playing video when modal is closed
324	$('.modal').on('hidden.bs.modal', function () {
325		$(".modal iframe").attr("src", $(".modal iframe").attr("src"));
326	});
327
328	/*
329	 * Replace all SVG images with inline SVG
330	 */
331	jQuery('img.svg').each(function(){
332		var $img = jQuery(this);
333		var imgID = $img.attr('id');
334		var imgClass = $img.attr('class');
335		var imgURL = $img.attr('src');
336
337		jQuery.get(imgURL, function(data) {
338			// Get the SVG tag, ignore the rest
339			var $svg = jQuery(data).find('svg');
340
341			// Add replaced image's ID to the new SVG
342			if(typeof imgID !== 'undefined') {
343				$svg = $svg.attr('id', imgID);
344			}
345			// Add replaced image's classes to the new SVG
346			if(typeof imgClass !== 'undefined') {
347				$svg = $svg.attr('class', imgClass+' replaced-svg');
348			}
349			// Remove any invalid XML tags as per http://validator.w3.org
350			$svg = $svg.removeAttr('xmlns:a');
351			// Check if the viewport is set, if the viewport is not set the SVG wont't scale.
352			if(!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
353				$svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
354			}
355			// Replace image with new SVG
356			$img.replaceWith($svg);
357		}, 'xml');
358
359	});
360
361	$('.navbar-toggle').on('click', function() {
362	  $('.navbar-collapse').collapse('toggle');
363		$(this).toggleClass('active-toggle');
364		$('.site-navigation').toggleClass('toggle-nav');
365	});
366
367	/* Orphans - kill'em'all by typographer*/
368	// $(document).ready(function() {
369  //   $('section').typographer({
370  //       modules: ['orphan']
371  //   });
372	// });
373
374
375	// Cookies
376	function createCookie(name,value,days) {
377		var expires = "";
378		if (days) {
379			var date = new Date();
380			date.setTime(date.getTime() + (days*24*60*60*1000));
381			expires = "; expires=" + date.toUTCString();
382		} else {
383			var expires = "";
384		}
385		document.cookie = name + "=" + value + expires + "; path=/";
386	}
387	function deleteCookie(name) {
388		document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
389	}
390	function showCookie(name) {
391		if (document.cookie!="") {
392			var cookies=document.cookie.split("; ");
393			for (var i=0; i<cookies.length; i++) {
394				var cookieName=cookies[i].split("=")[0];
395				var cookieVal=cookies[i].split("=")[1];
396				if (cookieName===name) {
397					return decodeURI(cookieVal)
398				}
399			}
400		}
401	}
402
403	// DEVELOPER
404	// Cookies
405	$( ".btn-apartments-list" ).click(function() {
406		$( this ).siblings().removeClass("active");
407		$( this ).addClass("active");
408		$( ".apartments-list" ).removeClass("result-table");
409		$( "#resultsHeader" ).removeClass("result__header--table");
410		$( ".apartments-list" ).addClass("result-list");
411		createCookie('cookie_grid','list');
412	});
413	$( ".btn-apartments-table" ).click(function() {
414		$( this ).siblings().removeClass("active");
415		$( this ).addClass("active");
416		$( ".apartments-list" ).removeClass("result-list");
417		$( ".apartments-list" ).addClass("result-table");
418		$( "#resultsHeader" ).addClass("result__header--table");
419		createCookie('cookie_grid','table');
420	});
421
422	// CUSTOM FUNCTIONS
423	// new fullpage('#fullpage', {});
424	// $('#fullpage').fullpage({
425	// 	responsiveWidth: 900
426	// });
427	// new pagepiling('#fullpage', {});
428
429	// $('#fullpage').pagepiling({
430	//     menu: null,
431  //       direction: 'vertical',
432  //       verticalCentered: true,
433  //       sectionsColor: [],
434  //       anchors: [],
435  //       scrollingSpeed: 700,
436  //       easing: 'swing',
437  //       loopBottom: false,
438  //       loopTop: false,
439  //       css3: true,
440  //       navigation: {
441  //           'textColor': '#000',
442  //           'bulletsColor': '#000',
443  //           'position': 'right',
444  //           'tooltips': ['section1', 'section2', 'section3', 'section4']
445  //       },
446  //      	normalScrollElements: null,
447  //       normalScrollElementTouchThreshold: 5,
448  //       touchSensitivity: 5,
449  //       keyboardScrolling: true,
450  //       sectionSelector: '.section',
451  //       animateAnchor: false,
452	//
453	// 	//events
454	// 	onLeave: function(index, nextIndex, direction){},
455	// 	afterLoad: function(anchorLink, index){},
456	// 	afterRender: function(){},
457	// });
458
459	// var parallax1 = new Parallax($('#scene1').get(0));
460
461	/*
462	 * CHECK AVAIBILITY
463	 */
464
465	$('#check-availability').on('click', function() {
466
467		var city = $('#my-city').val();
468		var street = $('#my-street').val();
469		var number = $('#my-number').val();
470
471		$.ajax({
472			type: 'post',
473			url: ajax_object.ajax_url,
474			dataType: 'json',
475			data: {
476				'city': city,
477				'street': street,
478				'number': number,
479				action: 'checkavaibility'
480			},
481			success:function(response) {
482
483				$('#availability-respone-dot').removeClass('is-avaible');
484				$('#availability-respone-dot').removeClass('not-avaible');
485				$('#availability-respone-dot').removeClass('later-avaible');
486				$('#avaibility-status').text('Wpisz adres');
487
488				var status = parseInt(response.status);
489
490				if(status == 1) {
491					$('#availability-respone-dot').addClass('is-avaible');
492					$('#avaibility-status').text('Super! Jesteś w zasięgu FineMEDIA.')
493				} else if (status == 0) {
494					$('#availability-respone-dot').addClass('not-avaible');
495					$('#avaibility-status').html('Obecnie pod Twoim adresem FineMEDIA nie świadczy usług. Nie szkodzi, poinformujemy Cię kiedy będziemy dostępni - <a href="/kontakt">ZOSTAW KONTAKT</a>');
496				} else if (status == 2) {
497					$('#availability-respone-dot').addClass('later-avaible');
498					$('#avaibility-status').html('Obecnie pod Twoim adresem FineMEDIA nie świadczy usług. <b>Będą one jednak dostępne w przyszłości!</b> - <a href="/kontakt">ZOSTAW KONTAKT</a>');
499				}
500			}
501		});
502	});
503
504	$('#my-city, #my-street, #my-number').on('change keyup', function() {
505		var city = $('#my-city').val();
506		var street = $('#my-street').val();
507		var number = $('#my-number').val();
508
509		if(city && street && number) {
510			$('#check-availability').removeClass('button-not-avaible');
511			$('#check-availability').removeAttr('disabled');
512		} else {
513			$('#check-availability').addClass('button-not-avaible');
514		}
515	});
516
517	//**************************************
518
519	$('#check-availability-2').on('click', function() {
520
521		var city = $('#my-city-2').val();
522		var street = $('#my-street-2').val();
523		var number = $('#my-number-2').val();
524
525		$.ajax({
526			type: 'post',
527			url: ajax_object.ajax_url,
528			dataType: 'json',
529			data: {
530				'city': city,
531				'street': street,
532				'number': number,
533				action: 'checkavaibility'
534			},
535			success:function(response) {
536
537				$('#availability-respone-dot-2').removeClass('is-avaible');
538				$('#availability-respone-dot-2').removeClass('not-avaible');
539				$('#availability-respone-dot-2').removeClass('later-avaible');
540				$('#avaibility-status-2').text('Wpisz adres');
541
542				var status = parseInt(response.status);
543
544				if(status == 1) {
545					$('#availability-respone-dot-2').addClass('is-avaible');
546					$('#avaibility-status-2').text('Super! Jesteś w zasięgu FineMEDIA.')
547				} else if (status == 0) {
548					$('#availability-respone-dot-2').addClass('not-avaible');
549					$('#avaibility-status-2').html('Obecnie pod Twoim adresem FineMEDIA nie świadczy usług. Nie szkodzi, poinformujemy Cię kiedy będziemy dostępni - <a href="/kontakt">ZOSTAW KONTAKT</a>');
550				} else if (status == 2) {
551					$('#availability-respone-dot-2').addClass('later-avaible');
552					$('#avaibility-status-2').html('Obecnie pod Twoim adresem FineMEDIA nie świadczy usług. <b>Będą one jednak dostępne w przyszłości!</b> - <a href="/kontakt">ZOSTAW KONTAKT</a>');
553				}
554			}
555		});
556	});
557
558	$('#my-city-2, #my-street-2, #my-number-2').on('change keyup', function() {
559		var city = $('#my-city-2').val();
560		var street = $('#my-street-2').val();
561		var number = $('#my-number-2').val();
562
563		if(city && street && number) {
564			$('#check-availability-2').removeClass('button-not-avaible');
565			$('#check-availability-2').removeAttr('disabled');
566		} else {
567			$('#check-availability-2').addClass('button-not-avaible');
568		}
569	})
570
571	/*
572	 * END OF CHECK AVAIBILITY
573	 */
574
575
576})(jQuery);

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.