PageSourceSearch

https://top-bankrotstvo.ru/local/templates/top-bnkr/assets/js/forms.js?1791380267

js top-bankrotstvo.ru collected 2026-10-07 13:38:03 UTC 7,087 bytes, 229 lines download raw bytes

1(function($, undefined) {
2
3	const loadScript = (url) => (new Promise((resolve, reject) => {
4		if ($.fn.styler) {
5			resolve();
6		}
7		else {
8			const script = document.createElement('script');
9			script.src = url;
10			script.onload = () => resolve(script);
11			script.onerror = () => reject(new Error(`Ошибка загрузки скрипта ${src}`));
12			document.head.append(script);
13		}
14
15	}));
16	
17	setTimeout(()=>{
18		loadScript('https://www.google.com/recaptcha/api.js?render=explicit').then(() => {
19			console.log('Recaptcha API loaded');
20		});
21	}, 1000)
22
23    $('form[name=comment_item]').submit(function (e) {
24		e.preventDefault();
25		var formData = $(this).serializeArray();
26		$.each(formData, function(k, v){
27			$('form[name=comment]').find('[name=' + v.name + ']').val(v.value);
28		});
29		grecaptcha.execute(recaptcha_comment);
30    });
31    
32    $('form[name=callback]').submit(function (e) {
33		e.preventDefault();
34		grecaptcha.execute(recaptcha_callback);
35    });
36    
37    $('form[name=question]').submit(function (e) {
38		e.preventDefault();
39		grecaptcha.execute(recaptcha_question);
40    });
41    
42    $('form[name=request]').submit(function (e) {
43		e.preventDefault();
44		grecaptcha.execute(recaptcha_request);
45    });
46    
47    $('form[name=subscribe]').submit(function (e) {
48		e.preventDefault();
49		grecaptcha.execute(recaptcha_subscribe);
50    });
51    
52    $('form[name=review]').submit(function (e) {
53		e.preventDefault();
54		grecaptcha.execute(recaptcha_review);
55    });
56    
57    $('form[name=support]').submit(function (e) {
58		e.preventDefault();
59		grecaptcha.execute(recaptcha_support);
60    });
61    
62    $('form[name=inquirer]').submit(function (e) {
63		e.preventDefault();
64		grecaptcha.execute(recaptcha_inquirer);
65    });
66    
67})(jQuery);
68
69function processForm(form, url, recaptcha) {
70	form.find('input').removeClass('invalid');
71	var data = form.serialize();
72	data = data + '&ajax=1';
73	jQuery.ajax({
74	  type: "POST",
75	  url: url,
76	  data: data,
77	  success: function(data) {
78	  	if (data.status == 'error') {
79		  	form.find('.alert-error').html(data.message).show();
80		  	console.log(data.errors);
81		  	$.each(data.errors, function( index, element ) {
82		  		var error_field = form.find('[name=' + index + ']');
83		  		error_field.addClass('invalid');
84		  		error_field.next('span').html(element);
85			});
86	  	} else if (data.status == 'ok') {
87	  		var container = form.parent();
88		  	form.remove();
89		  	container.find('.thanks').show();
90		  	ym(95589017,'reachGoal','order');
91	  	}
92	  	grecaptcha.reset(recaptcha);
93      },
94      error: function(data) {
95	      console.log(data);
96      }
97	});
98}
99
100function onSubmitReCaptchaComment(token) {
101	var form = $('form[name=comment]');
102	processForm(form, '/feedback/comment.php', recaptcha_comment);
103}
104
105function onSubmitReCaptchaCallback(token) {
106	var form = $('form[name=callback]');
107	processForm(form, '/feedback/request.php', recaptcha_callback);
108	var form_data = form.serialize();
109	form_data = addUtmToFormData(form_data);
110	jQuery.ajax({
111	  type: "POST",
112	  url: 'https://h.albato.ru/wh/38/1lfpctm/ymqv4-g3P2kzL58uu4SONFUIhz87rxbAKKuafyGbUN0/',
113	  data: form_data,
114	});
115}
116
117function onSubmitReCaptchaQuestion(token) {
118	var form = $('form[name=question]');
119	processForm(form, '/feedback/request.php', recaptcha_question);
120	var form_data = form.serialize();
121	form_data = addUtmToFormData(form_data);
122	jQuery.ajax({
123	  type: "POST",
124	  url: 'https://h.albato.ru/wh/38/1lfpctm/uRNK8BKVV1g1AyrTZOCapJwnmVMJBUB3s2R7PluHpZs/',
125	  data: form_data,
126	});
127}
128
129function onSubmitReCaptchaRequest(token) {
130	var form = $('form[name=request]');
131	processForm(form, '/feedback/request.php', recaptcha_request);
132}
133
134function onSubmitReCaptchaSubscribe(token) {
135	var form = $('form[name=subscribe]');
136	processForm(form, '/feedback/request.php', recaptcha_subscribe);
137}
138
139function onSubmitReCaptchaReview(token) {
140	var form = $('form[name=review]');
141	processForm(form, '/feedback/review.php', recaptcha_review);
142}
143
144function onSubmitReCaptchaSupport(token) {
145	var form = $('form[name=support]');
146	processForm(form, '/feedback/support.php', recaptcha_support);
147}
148
149function onSubmitReCaptchaInquirer(token) {
150	var form = $('form[name=inquirer]');
151	processForm(form, '/feedback/inquirer.php', recaptcha_inquirer);
152	var form_data = form.serialize();
153	form_data = addUtmToFormData(form_data);
154	jQuery.ajax({
155	  type: "POST",
156	  url: 'https://h.albato.ru/wh/38/1lfpctm/_OvFpRRn1pagjV1kvNRZWLXIIhi5BHXYIlbYE4vd5ps/',
157	  data: form_data,
158	});
159}
160
161function addUtmToFormData(data) {
162	var utm_param_names = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"];
163	for (var i = 0; i < utm_param_names.length; i++) {
164		if (readCookie(utm_param_names[i])) {
165			data = data + '&' + utm_param_names[i] + '=' + readCookie(utm_param_names[i]);
166		}
167	}
168	
169	return data;
170}
171
172
173var recaptcha_comment, recaptcha_callback, recaptcha_question, recaptcha_request, recaptcha_subscribe, recaptcha_review, recaptcha_support, recaptcha_inquirer;
174var onloadCallback = function() {
175
176	var mysitekey = '6LehTUcoAAAAAJLTNQlx_6sWGf6Hlg0bWR98mKHy';
177	console.log('onloadCallback');
178	
179	if ($('#recaptcha_comment').length) {
180		recaptcha_comment = grecaptcha.render('recaptcha_comment', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaComment", 'size': 'invisible'});
181	}
182	
183	if ($('#recaptcha_callback').length) {
184		recaptcha_callback = grecaptcha.render('recaptcha_callback', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaCallback", 'size': 'invisible'});
185	}
186	
187	if ($('#recaptcha_question').length) {
188		recaptcha_question = grecaptcha.render('recaptcha_question', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaQuestion", 'size': 'invisible'});
189	}
190	
191	if ($('#recaptcha_request').length) {
192		recaptcha_request = grecaptcha.render('recaptcha_request', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaRequest", 'size': 'invisible'});
193	}
194	
195	if ($('#recaptcha_subscribe').length) {
196		recaptcha_subscribe = grecaptcha.render('recaptcha_subscribe', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaSubscribe", 'size': 'invisible'});
197	}
198	
199	if ($('#recaptcha_review').length) {
200		recaptcha_review = grecaptcha.render('recaptcha_review', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaReview", 'size': 'invisible'});
201	}
202	
203	if ($('#recaptcha_support').length) {
204		recaptcha_support = grecaptcha.render('recaptcha_support', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaSupport", 'size': 'invisible'});
205	}
206	
207	if ($('#recaptcha_inquirer').length) {
208		recaptcha_inquirer = grecaptcha.render('recaptcha_inquirer', {'sitekey': mysitekey, "callback": "onSubmitReCaptchaInquirer", 'size': 'invisible'});
209	}
210};
211
212let isCaptchaLoad = false;
213setTimeout(()=>{
214	if (!isCaptchaLoad){
215		onloadCallback();
216		isCaptchaLoad = true;
217	}
218},4000);
219
220function readCookie(name) {
221    var nameEQ = name + "=";
222    var ca = document.cookie.split(';');
223    for (var i = 0; i < ca.length; i++) {
224        var c = ca[i];
225        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
226        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
227    }
228    return null;
229}

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.