PageSourceSearch

https://setka-kit.ru/local/templates/citrus_aproduction2/app/js/main.js?177269376012485

js setka-kit.ru collected 2026-10-04 23:03:24 UTC 12,485 bytes, 439 lines download raw bytes

1// ;(function () {
2$(document).ready(function () {
3	$(".main-form #phone").mask("+7 (000) 000-00-00", {clearIfNotMatch: true});
4	$(".main-form  .btn-submit").click(function () {
5		let form = $(".main-form  .main-form-fields");
6		let message =  form.find("#message").val();
7		let name =  form.find("#name").val();
8		let email =  form.find("#email").val();
9		let phone =  form.find("#phone").val();
10		let page = "https://setka-kit.ru"+$(this).data("page");
11
12		if(name == ''){
13			form.find("#name").addClass("error")
14			return;
15		}else{
16			form.find("#name").removeClass("error")
17		}
18		if(phone == ''){
19			form.find("#phone").addClass("error")
20			return;
21		}else{
22			form.find("#phone").removeClass("error")
23		}
24
25		$.ajax({
26			url: '/ajax/main-form.php',
27			method: 'post',
28			data: {
29				message:message,
30				name:name,
31				email:email,
32				phone:phone,
33				page:page,
34			},
35			success: function(data){
36				$(".main-form .main-form-fields").hide()
37				$(".main-form .block-submit").hide()
38				$(".main-form .agree-block").hide()
39				$(".main-form .success").show()
40				ym(29992809, 'reachGoal', 'forma_v_futere'); return true;
41			}
42		});
43	})
44	
45	
46	
47	
48	
49	
50	$(".tab_block_main ul li a").click(function (e) {
51		var curTabContentId = $(this).attr('href');
52		$(this).parents('.tab_block_main').find('ul li a').removeClass('active');
53		$(this).addClass('active');
54
55		$(this).parents('.tab_block_main').find('.tab_content .tab_block').removeClass('active');
56		$(".tab_block"+curTabContentId).addClass('active');
57
58		e.preventDefault();
59	})
60
61
62
63	$(document).on('click', '.load_more', function () {
64		//  Контейнер, в котором хранятся элементы
65		var targetContainer =
66			$('.product-cards .row.row-grid').length
67				? $('.product-cards .row.row-grid')
68				: $('.product-table tbody');          //  Контейнер, в котором хранятся элементы
69			url = $('.load_more').attr('data-url');    //  URL, из которого будем брать элементы
70		if (url !== undefined) {
71			$.ajax({
72				type: 'GET',
73				url: url,
74				dataType: 'html',
75				success: function (data) {
76					//  Удаляем старую навигацию
77					 $('.load_more').remove();
78					// $('ul.switch').remove();
79
80					var elements =
81						$(data).find('.col-sm-6.col-md-6.col-dt-3').length
82							? $(data).find('.col-sm-6.col-md-6.col-dt-3')
83							: $(data).find('.product-table tbody tr'); //  Ищем элементы
84						pagination = $(data).find('.load_more');//  Ищем навигацию
85						switchpaging = $(data).find('ul.switch');//  Ищем навигацию
86
87					targetContainer.append(elements);   //  Добавляем посты в конец контейнера
88					 $(".section-pagen").prepend(pagination); //  добавляем навигацию следом
89					// targetContainer.append(switchpaging); //  добавляем навигацию следом
90
91				}
92			});
93		}
94
95	});
96
97	window.clickOff = function ($el, callback) {
98		if (!$el) return false;
99		$(document).on('click', function (e) {
100			if ($el.has(e.target).length === 0 && !$el.is(e.target)) {
101				callback($el);
102			}
103		});
104	};
105
106	var arAjaxAssetsUrl = [];
107	/**
108	 * Get all data parameters data-modal-... to Object
109	 * @param $item - jquery el
110	 * @return {{}}
111	 */
112	var getModalParams = function ($item) {
113		var sendDataParams = {
114			currency: typeof currency !== 'undefined' ? currency.current : ''
115		};
116
117		var dataParams = $item.data();
118		Object.keys(dataParams).forEach(function (paramName) {
119			if (paramName.indexOf('modal') === 0) {
120				var modifierParamName = paramName.replace('modal', '');
121				modifierParamName = modifierParamName.replace(modifierParamName[0], modifierParamName[0].toLowerCase());
122				sendDataParams[modifierParamName] = dataParams[paramName];
123			}
124		});
125
126		return sendDataParams;
127	};
128
129	// preload assets for ajax form
130	var preloadAjaxAssets = function ($item) {
131		var href = $item.attr('href');
132		var data = $.extend(getModalParams($item), { ASSETS: 1 });
133
134		if (arAjaxAssetsUrl.indexOf(href) > -1) return;
135		arAjaxAssetsUrl.push(href);
136
137		$.ajax({
138			url: href,
139			type: 'GET',
140			dataType: 'json',
141			data: data
142		})
143			.done(function (data) {
144				if (data) {
145					if (data.css)
146						data.css.forEach(function (css) {
147							BX.loadCSS(css);
148						});
149					if (data.js)
150						data.js.forEach(function (js) {
151							BX.loadScript(js);
152						});
153				}
154			})
155			.fail(function () {
156				console.log('error preload');
157			});
158	};
159
160	// bind magnific-popup links
161	window.bindModalLinks = function ($link) {
162		var $link = $link || $('[data-toggle="modal"]');
163
164		$link.each(function () {
165			var $linkItem = $(this);
166			if ($linkItem.data('href'))
167				$linkItem.attr('href', $linkItem.data('href'));
168
169			preloadAjaxAssets($linkItem);
170			$linkItem.magnificPopup({
171				type: 'ajax',
172				preloader: true,
173				mainClass: 'mfp-fade',
174				focus: 'input[type="text"], textarea, select',
175				fixedContentPos: true,
176				showCloseBtn: false,
177				ajax: {
178					settings: {
179						data: {
180							href: window.location.href
181						}
182					}
183				},
184				callbacks: {
185					beforeOpen: function () {
186						this.st.ajax.settings.data = $.extend(
187							this.st.ajax.settings.data,
188							getModalParams($linkItem)
189						);
190						$('html').addClass('mfp-helper');
191					},
192					close: function () {
193						$('html').removeClass('mfp-helper');
194					}
195				}
196			});
197		});
198	};
199
200	// todo simple jquery plugin for 2 function
201	// split in rows by bottom position and equal height
202	window.equalHeightBot = function ($items) {
203		var calc = function ($items) {
204			var rows = {};
205			$items.each(function () {
206				var offsetBot = $(this).offset().top + $(this).height();
207				if (!rows[offsetBot]) rows[offsetBot] = $([]);
208				rows[offsetBot] = rows[offsetBot].add($(this));
209			});
210
211			for (var rowKey in rows) {
212				var $rows = rows[rowKey];
213				$rows.css('min-height', '0');
214
215				if ($rows.length < 2) return;
216
217				var maxHeight = 0;
218				$rows.each(function () {
219					if ($(this).height() > maxHeight) maxHeight = $(this).height();
220				});
221				$rows.css('min-height', maxHeight + 'px');
222			}
223		};
224		calc($items);
225
226		$(window).resize(function () {
227			calc($items);
228		});
229	};
230
231	// split in rows by top position and equal height
232	window.equalHeightTop = function ($items) {
233		var calc = function ($items) {
234			var rows = {};
235			$items.each(function () {
236				var offsetTop = $(this).offset().top;
237				if (!rows[offsetTop]) rows[offsetTop] = $([]);
238				rows[offsetTop] = rows[offsetTop].add($(this));
239			});
240
241			for (var rowKey in rows) {
242				var $rows = rows[rowKey];
243				$rows.css('height', 'auto');
244
245				if ($rows.length < 2) return;
246
247				var maxHeight = 0;
248				$rows.each(function () {
249					if ($(this).outerHeight() > maxHeight) maxHeight = $(this).outerHeight();
250				});
251				$rows.css('height', maxHeight + 'px');
252			}
253		};
254		calc($items);
255
256		$(window).resize(function () {
257			calc($items);
258		});
259	};
260
261	window.loadImages = function (arImagesSrc, callback) {
262		var count = arImagesSrc.length;
263
264		arImagesSrc.forEach(function (src) {
265			var tmp = new Image();
266			tmp.src = src;
267			if (tmp.complete && !--count) callback();
268			tmp.onload = function () {
269				if (!--count) callback();
270			};
271		});
272	};
273})
274
275// }());
276
277$(function () {
278	InitSoutSlider();
279	bindModalLinks();
280	if ($('.timer-container').length) {
281		initTimer();
282	}
283	var $overlay = $('.main-overlay'),
284		$mobileSidebar = $('.mobile-sidebar'),
285		$humburger = $('.js-open-menu');
286	$humburger.on('click', function (event) {
287		event.preventDefault();
288		$mobileSidebar.addClass('_active');
289		$overlay.addClass('_active');
290		$('body').addClass('_overflow');
291	});
292	$overlay.on('click', function (event) {
293		event.preventDefault();
294		$mobileSidebar.removeClass('_active');
295		$overlay.removeClass('_active');
296		$('body').removeClass('_overflow');
297	});
298
299	$(document)
300		.on('click', '[data-dismiss="modal"]', function (e) {
301			e.preventDefault();
302			$.magnificPopup.close();
303		});
304});
305
306function SendMetrika (code) {
307	if (typeof yaCounter29992809 != 'undefined') {
308		yaCounter29992809.reachGoal(code);
309		console.log(code)
310	}
311}
312
313function SendGa (eventLabel, eventCategory, eventAction) {
314	gtag('event', eventAction, {
315		'event_category': eventCategory
316	});
317	console.log("send")
318}
319
320function InitSoutSlider () {
321	$('[data-fancybox="sout_gallery"]').fancybox({
322		loop: true
323	});
324	$('[data-fancybox="sert_gallery"]').fancybox({
325		loop: true
326	});
327}
328
329Date.prototype.getNextWeekDay = function (d) {
330	if (d) {
331		var next = this;
332		next.setDate(this.getDate() - this.getDay() + 7 + d);
333		return next;
334	}
335};
336
337function initTimer () {
338	var d = new Date();
339	var month = new Array();
340	month[0] = 'Jan';
341	month[1] = 'Feb';
342	month[2] = 'Mar';
343	month[3] = 'Apr';
344	month[4] = 'May';
345	month[5] = 'Jun';
346	month[6] = 'Jul';
347	month[7] = 'Aug';
348	month[8] = 'Sep';
349	month[9] = 'Oct';
350	month[10] = 'Nov';
351	month[11] = 'Dec';
352	var n = d.getMonth();
353	var y = d.getFullYear();
354	if (n == 11) {
355		y++;
356		n = month[0];
357	} else {
358		n = month[n + 1];
359	}
360	//var countDownDate = new Date(n+" 1, "+y+" 00:00:00").getTime();
361	let nextMonday = (new Date()).getNextWeekDay(1);
362	let countDownDate = (new Date(nextMonday.getFullYear(), nextMonday.getMonth(), nextMonday.getDate())).getTime();
363	var x = setInterval(function () {
364		var now = new Date().getTime();
365
366		var distance = countDownDate - now;
367
368		var days = Math.floor(distance / (1000 * 60 * 60 * 24));
369		var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
370		var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
371		var seconds = Math.floor((distance % (1000 * 60)) / 1000);
372
373		var dayText = '<div class=\'number\'>' + days + '</div>';
374		if (days.toString().slice(-1) >= 5 || days.toString().slice(-1) == 0) dayText += '<span class=\'timer-mark\'>Дней</span>';
375		if (days.toString().slice(-1) >= 2 && days.toString().slice(-1) <= 4) dayText += '<span class=\'timer-mark\'>Дня</span>';
376		if (days.toString().slice(-1) == 1) dayText += '<span class=\'timer-mark\'>День</span>';
377		$('#timer .day').html(dayText);
378		var hourText = '<div class=\'number\'>' + hours + '</div>';
379		if (hours.toString().slice(-1) >= 5 || hours.toString().slice(-1) == 0) hourText += '<span class=\'timer-mark\'>Часов</span>';
380		if (hours.toString().slice(-1) >= 2 && hours.toString().slice(-1) <= 4) hourText += '<span class=\'timer-mark\'>Часа</span>';
381		if (hours.toString().slice(-1) == 1) hourText += '<span class=\'timer-mark\'>Час</span>';
382		$('#timer .hour').html(hourText);
383		var minText = '<div class=\'number\'>' + minutes + '</div>';
384		if (minutes.toString().slice(-1) >= 5 || minutes.toString().slice(-1) == 0) minText += '<span class=\'timer-mark\'>Мин</span>';
385		if (minutes.toString().slice(-1) >= 2 && minutes.toString().slice(-1) <= 4) minText += '<span class=\'timer-mark\'>Мин</span>';
386		if (minutes.toString().slice(-1) == 1) minText += '<span class=\'timer-mark\'>Мин</span>';
387		$('#timer .min').html(minText);
388		var secText = '<div class=\'number\'>' + seconds + '</div>';
389		if (seconds.toString().slice(-1) >= 5 || seconds.toString().slice(-1) == 0) secText += '<span class=\'timer-mark\'>Сек</span>';
390		if (seconds.toString().slice(-1) >= 2 && seconds.toString().slice(-1) <= 4) secText += '<span class=\'timer-mark\'>Сек</span>';
391		if (seconds.toString().slice(-1) == 1) secText += '<span class=\'timer-mark\'>Сек</span>';
392		$('#timer .sec').html(secText);
393
394		// If the count down is over, write some text
395
396		if (distance < 0) {
397			clearInterval(x);
398		}
399	}, 1000);
400}
401
402function CloseAlert () {
403	$('.index-alert').hide();
404	sessionStorage.setItem('isAlertVisible', '0');
405}
406
407function ShowAlert () {
408	if (sessionStorage.getItem('isAlertVisible') != 0) {
409		$('.index-alert').show();
410	}
411}
412
413$(document).ready(function () {
414	ShowAlert();
415});
416// var swiper = new Swiper('.swiper-container', {
417// 			slidesPerView: 3,
418// 			spaceBetween: 30,
419// 			loop: true,
420//
421// 			pagination: {
422// 				el: '.swiper-pagination'
423// 			}
424//
425// 			,
426// 			navigation: {
427// 				nextEl: '.swiper-custom-next',
428// 				prevEl: '.swiper-custom-prev'
429// 			}
430//
431// 		});
432$(document).on('click', '.tab_block_main ul li a', function (e) {
433			var curTabContentId = $(this).attr('href');
434			(this).parents('.tab_block_main').find('ul li a').removeClass('active');
435			$(this).addClass('active');
436			$(this).parents('.tab_block_main').find('.tab_content .tab_block').removeClass('active');
437			$(curTabContentId).addClass('active');
438			e.preventDefault();
439		});

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.