PageSourceSearch

https://lesenka-market.ru/bitrix/templates/80bitnew/js/calc.js

js lesenka-market.ru collected 2026-10-08 14:56:54 UTC 5,424 bytes, 173 lines download raw bytes

1 $(function(){	
2	$(document).on("focus", ".paramsArea__input", function(){
3		$(".schemes").removeClass("schemes--active");
4		$($(this).data("scheme")).addClass("schemes--active");
5	});
6
7	$(document).on("focusout", ".paramsArea__input", function(){
8		$(".schemes").removeClass("schemes--active");
9	});
10
11   $(document).on('click', '.configsStair__box', function(){
12	 $(this).toggleClass('configsStair__box--active');
13	 $('.configsStair__box').find("input").val("");
14	 $('.configsStair__box--active').each(function (index, element){
15		$(element).find("input").val($(element).data("id"));
16	 });
17   });
18   
19    $('body').on('input', '.paramsArea__input', function(){
20		this.value = this.value.replace(/[^0-9]/g, '');
21		$(this).siblings('.paramsArea__input__error').css({'opacity': 0, 'visibility': 'hidden'});
22		
23	});
24
25    $('body').on('focusout', '.paramsArea__input', function(){
26		if($(this).val().length > 0 && $(this).val().length < 3) {
27			$(this).siblings('.paramsArea__input__error').css({'opacity': 1, 'visibility': 'visible'});
28			$(this).addClass('paramsArea__input-error');
29		} else {
30			$(this).removeClass('paramsArea__input-error');
31		}
32	});
33   
34   /*
35   $(document).on('change', '.product__change .filter__checkbox', function(){
36		let tempText, variant = 0;
37		tempText = $(this).next().text();
38		$(this).next().text($(this).next().data("value"));
39		$(this).next().data("value", tempText);
40		$(".configsStair__product__item").removeClass("configsStair__product__item--change");
41		$('.product__change .filter__checkbox:checked').each(function (index) {
42			$(this).closest(".configsStair__product__item").addClass("configsStair__product__item--change");
43			variant++;
44		});
45		
46		if(variant >= 6){
47			$(".configsStair__product__item").addClass("configsStair__product__item--hidden");
48			$(".configsStair__product__item--change").removeClass("configsStair__product__item--hidden");
49			$(".configsStair__product__filter").css("display", "none");
50		} else {
51			$(".configsStair__product__item").removeClass("configsStair__product__item--hidden");
52			$(".configsStair__product__filter").css("display", "grid");
53		}
54   });
55   */
56   
57   $(document).on('change', '.configsStair__product__filter .filter__checkbox', function(){
58		let type, val, selector;
59		type = $(this).data('type');
60		val = $(this).val();
61		selector = 'data-'+type+'='+val;
62		if($(this).is(':checked')){
63			$(".configsStair__product__item["+selector+"]").addClass("configsStair__product__item--active");
64		} else {
65			$(".configsStair__product__item["+selector+"]").removeClass("configsStair__product__item--active");
66		}
67			
68		if($(".configsStair__product__item--active").length > 0){
69			$(".paramsArea__error").removeClass("paramsArea__error--active");
70		} else {
71			$(".paramsArea__error").addClass("paramsArea__error--active");
72		}
73   });
74   
75   
76   
77	$(document).on('submit', '#finalForm', function(){
78		let dataSend = $(this).serialize();
79		$.ajax({
80			type: "POST",
81			url: "/bitrix/templates/80bitnew/calc/form.php",
82			data: dataSend,
83			beforeSend: function() {
84				$(".load--new").css("display","block");
85			},
86			success: function(html) {
87			  $(".orderFinal__right").removeClass("modal__success--none");
88			  $("#finalForm").empty();
89			  $(".load--new").css("display","none");		
90			  $("#finalForm").css("display","none");	
91			}
92		});
93		return false;
94	});
95	
96	
97					 
98   $(document).on('submit', '.form_paramsArea', function(e){
99		if($('.form_paramsArea').find('.paramsArea__input-error').length > 0){
100			e.preventDefault();
101			return false;
102		}
103		let dataSend = $(this).serialize();
104		let block = $(".ajax");
105		let file = $(this).data("file");
106		
107		if(file == "product"){
108			let next = false;
109			$('.configsStair__list .configsStair__box').each(function(i,elem){
110				if($(elem).hasClass('configsStair__box--active')){
111					next = true;
112				}
113			});
114			
115			if(!next){
116				$(".paramsArea__error").addClass("paramsArea__error--active");
117				return false;
118			}
119		}
120		
121		
122		$($(this).data("step")).addClass("orderStair__etap--active");
123		$.ajax({
124			type: "POST",
125			url: "/bitrix/templates/80bitnew/calc/"+file+".php",
126			data: dataSend,
127			beforeSend: function() {
128				$(".load--new").css("display","block");
129			},
130			success: function(html) {
131			  $(".load--new").css("display","none");
132			  block.empty();
133			  block.append(html);
134			  $('html, body').stop().animate({
135			    scrollTop: $('.orderStair').offset().top
136			  }, 500);
137			  $("input[type=tel]").mask("+7 (999) 999-99-99");
138			  updateParams();
139			}
140		});
141		return false;
142	});
143	
144	$(document).on('click', '.paramsArea__button--back', function(){
145		let block = $(".ajax");
146		let file = $(this).data("file");
147		$($(this).data("step")).removeClass("orderStair__etap--active");
148		$.ajax({
149			type: "POST",
150			url: "/bitrix/templates/80bitnew/calc/"+file+".php",
151			beforeSend: function() {
152				$(".load--new").css("display","block");
153			},
154			success: function(html) {
155			  $(".load--new").css("display","none");
156			  block.empty();
157			  block.append(html);
158			  updateParams();
159			}
160		});
161		return false;
162	});
163	
164	function updateParams(){
165		$.ajax({
166			success: function(html) {
167			  $(".orderStair__data").empty();
168			  $(".orderStair__data").append($(html).find(".orderStair__data__result"));
169			}
170		});
171	}
172	
173});

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.