PageSourceSearch

https://kostum66.ru/design/kostum66_1/js/window.js

js kostum66.ru collected 2026-09-28 13:59:47 UTC 6,644 bytes, 205 lines download raw bytes

1function showWindow(title, text) {
2	$('#windowtitle').html(title);
3	$('#windowtext').html(text);
4	$('#windowback').css('display', 'block');
5}
6
7function getCall() {
8	var name = $('#feedbackname').val();
9	var phone = $('#feedbackphone').val();
10	
11	if (name == null || name.length < 1) {
12		showWindow('Ошибка!', '<span class="red">Поле ИМЯ не должно быть пустым!</span'); 
13		return;
14	}
15	if (phone == null || phone.length < 1) {
16		showWindow('Ошибка!', '<span class="red">Поле ТЕЛЕФОН не должно быть пустым!</span');
17		return; 
18	}
19	
20	$.ajax({
21		url: "ajax/getcall.php",
22		data: {name: name, phone: phone},
23		dataType: 'text',
24		success: function(data){
25			showWindow('Спасибо!', '<span class="green">В ближайшее время наши менеджеры свяжутся с Вами.</span');
26		}
27	});
28}
29
30function clearForms() {
31	$('#feedbackname').val('');
32	$('#feedbackphone').val('');
33	$('#popupfeedbackname').val('');
34	$('#popupfeedbackphone').val('');
35	$('#popupresult').html('');
36	$('.popupform').show();
37}
38
39function clearCartWindow() {
40	// $('#cartwindow').html('');
41}
42
43function getCallPopup() {
44	var name = $('#popupcallname').val();
45	var phone = $('#popupcallphone').val();
46	//var email = $('#popupcallemail').val();
47	var privacy = $('#privacyCall').prop('checked');
48	var captcha = $('#popupcallcaptcha').val();
49	
50	if (!privacy) {
51		$('.popupresult').html('<span class="red">Подтвердите согласие с политикой конфиденциальности!</span');
52		return;
53	}
54	
55	if (name == null || name.length < 1) {
56		$('.popupresult').html('<span class="red">Поле ИМЯ не должно быть пустым!</span');
57		return;
58	}
59	if (phone == null || phone.length < 1) {
60		$('.popupresult').html('<span class="red">Поле ТЕЛЕФОН не должно быть пустым!</span');
61		return; 
62	}
63	if (captcha == null || captcha.length < 1) {
64		$('.popupresult').html('<span class="red">Поле КОД не должно быть пустым!</span');
65		return; 
66	}
67	/*if (!email || email.length < 1) {
68		$('.popupresult').html('<span class="red">Укажите EMAIL</span>');
69		return;
70	} else {
71		if (!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email)) {
72			$('.popupresult').html('<span class="red">Указан не верный EMAIL</span>');
73			return;
74		}
75	}*/
76	
77	$.post('ajax/getcall_captcha.php', {name: name, phone: phone, captcha: captcha}, function(response) {
78		switch(response.status)
79		{
80			case 'success':
81				$('.popupresult').html('<span style="color: green; font-size: 18px;">'+response.message+'</span');
82				$('.popupform').hide();
83			break;
84			
85			case 'error':
86				$('.popupresult').html('<span style="color: red;">'+response.message+'</span');
87			break;
88			
89			default:
90				alert(response.status+': '+response.message);
91			break;
92		}
93	}, 'json').fail(function(){
94		alert('При отправке возникла ошибка.');
95	});
96	
97	
98}
99
100function getFeedbackPopup() {
101	var name = $('#popupfeedbackname').val();
102	var phone = $('#popupfeedbackphone').val();
103	var email = $('#popupfeedbackemail').val();
104	var text = $('#popupfeedbackemail').val();
105	var file = $('input[name=\'feedbackfile\']').val();
106	
107	if (name == null || name.length < 1) {
108		$('.popupresult').html('<span class="red">Поле ИМЯ не должно быть пустым!</span'); 
109		return;
110	}
111	if (phone == null || phone.length < 1) {
112		$('.popupresult').html('<span class="red">Поле ТЕЛЕФОН не должно быть пустым!</span'); 
113		return; 
114	}
115	if (!email || email.length < 1) {
116		$('.popupresult').html('<span class="red">Укажите EMAIL</span>');
117		return;
118	} else {
119		if (!(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email)) {
120			$('.popupresult').html('<span class="red">Указан не верный EMAIL</span>');
121			return;
122		}
123	}
124	
125	var element = document.getElementById('feedback_window_form');
126	var xhr = new XMLHttpRequest();
127	xhr.onload = xhr.onerror = function() {
128		if (this.status != 200) {
129			$('.popupresult').html('<span style="color: red;">Ошибка отправки</span');
130			return;
131		}
132	
133		result = this.responseText;
134		$('#feedback_window_form').hide();
135		$('.popupresult').html('<span style="color: green; font-size: 18px;">'+result+'</span');
136		$('.popupform').hide();
137	}
138
139	xhr.upload.onprogress = function(event) {
140		$('.popupresult').html('<span style="color: green;">Подождите...</span');
141	}
142
143	var formData = new FormData(element);
144	xhr.open('POST', '/ajax/getfeedback.php', true);
145	xhr.send(formData);
146}
147
148function getOnebuyPopup() {
149	var name = $('#popuponename').val();
150	var phone = $('#popuponephone').val();
151	var text = $('#popuponemessage').val();
152	var privacy = $('#privacyOneBuy').prop('checked');
153
154	if (!privacy) {
155		$('.popupresult').html('<span class="red">Подтвердите согласие с политикой конфиденциальности!</span');
156		return;
157	}
158	
159	if (name == null || name.length < 1) {
160		$('.popupresult').html('<span class="red">Поле ИМЯ не должно быть пустым!</span'); 
161		return;
162	}
163	if (phone == null || phone.length < 1) {
164		$('.popupresult').html('<span class="red">Поле ТЕЛЕФОН не должно быть пустым!</span'); 
165		return; 
166	}
167	
168	$.ajax({
169		url: "ajax/getonebuy.php",
170		data: {name: name, phone: phone, text: text},
171		dataType: 'text',
172		success: function(data){
173			$('.popupresult').html('<span style="color: green; font-size: 18px;">'+data+'</span');
174			$('.popupform').hide();
175		}
176	});
177}
178
179function getFeedback() {
180	var name = $('#footer-form-name').val();
181	var phone = $('#footer-form-phone').val();
182	var message = $('#footer-form-text').val();
183	
184	if (name == null || name.length < 1) {
185		$.modal('<h2>Ошибка</h2><span class="red">Поле ИМЯ не должно быть пустым!</span>');
186		return;
187	}
188	if (phone == null || phone.length < 1) {
189		$.modal('<h2>Ошибка</h2><span class="red">Поле ТЕЛЕФОН не должно быть пустым!</span>');
190		return; 
191	}
192	if (message == null || message.length < 1) {
193		message = '';
194	}
195	
196	$.ajax({
197		url: "ajax/getfeedback.php",
198		data: {name: name, phone: phone, message: message},
199		type: 'POST',
200		dataType: 'text',
201		success: function(data){
202			$.modal(data);
203		}
204	});
205}

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.