PageSourceSearch

https://birdsrussia.ru/bitrix/templates/rosip_template/js/main.js?17478356456365

js birdsrussia.ru collected 2026-10-02 10:27:01 UTC 6,365 bytes, 223 lines download raw bytes

1$(function ($) {
2	$(".fancybox").swipebox();
3	$('.swipebox-img').click(function (e) {
4		e.preventDefault();
5		$.swipebox([{
6			href: this.src,
7			title: this.title
8		}]);
9	});
10	$(".box .login ul li a.login_link").click(function () {
11		ShowAuth();
12		return false;
13	})
14
15	$(".login-box a.close").click(function () {
16		CloseAuth();
17		return false;
18	})
19
20	$(".not_authorized a[href='/membership/']").click(function () {
21		ShowAuth();
22		return false;
23	})
24
25	$(".photo-show-more").hide(); //wtf?
26
27	$(".news-archive li.y").children("a").click(function () {
28		$(".news-archive li.y").removeClass("opened");
29		$(this).parent().addClass("opened");
30		$(".news-archive li.y").not(".opened").children("ul").slideUp();
31		$(this).parent().children("ul").slideDown();
32	});
33	$(".news-archive li.m").children("a").click(function () {
34		$(this).parent().siblings().removeClass("opened");
35		$(this).parent().addClass("opened");
36		$(this).closest("li.y").find("li.m").not(".opened").children("ul").slideUp();
37		$(this).parent().children("ul").slideDown();
38	});
39
40	$(".nav.lop li").each(function () {
41		if ($(this).height() > 37) {
42			$(this).css("line-height", "26px").css("padding-top", "5px");
43		}
44	});
45})
46
47function ajaxRegisterAgree() {
48	if ($('#registeragree').prop('checked') === true) {
49		var settings = {
50			type: "GET",
51			url: "/ajax/registeragree.php"
52		};
53		$.ajax(settings).done(function (data) {
54			$("#popup_register_wrap").html(data);
55			initInputs("register");
56		});
57	} else {
58		$("#popup_register_wrap .rules_err").show();
59	}
60}
61
62//Устанавливаем последний элемент хлебных крошек
63function setLastBreadCump(text) {
64	$(".breadcrumbs li").last().remove();
65	$(".breadcrumbs").append("<li>" + text + "</li>");
66	$("title").text(text);
67
68}
69
70function ShowAuth() {
71	$("#header .login-box").fadeIn(300);
72}
73
74function CloseAuth() {
75	$("#header .login-box").fadeOut(300);
76}
77
78
79function checkInputs(s_type) {
80	var flag = true;
81	$("input[s_type='" + s_type + "'], textarea[s_type='" + s_type + "']").each(function () {
82		if (!checkInput(this)) flag = false;
83	})
84	return flag;
85}
86
87function setLabel(s_type) {
88	$("input[s_type='" + s_type + "'], textarea[s_type='" + s_type + "']").each(function () {
89		var text = $(this).attr("d_value");
90		if (text != undefined && !this.value) {
91			$(this).wrap("<div class='input-wrapper'>");
92			var parent = $(this).parent();
93			var width = $(this).width();
94			var height = $(this).height();
95			var left = $(this).position().left;
96			var top = $(this).position().top;
97			var label = $("<div class='label' s_type='" + s_type + "'>" + text + "</div>");
98
99			$(parent).append(label);
100			$(label).click(function () {
101				$(this).hide();
102				$(this).parent().find("input").focus();
103			});
104			$(label).css("left", left);
105			$(label).css("top", top);
106			$(label).css("width", width);
107			$(label).css("height", height);
108			$(label).css("margin-top", height * (-1));
109			$(label).css("text-align", $(this).css("text-align"));
110			$(label).css("color", $(this).css("color"));
111		}
112	})
113
114	$(".input-wrapper input[s_type='" + s_type + "']").on("click", function () {
115		$(this).parent().find(".label").hide();
116	})
117
118	$(".input-wrapper input[s_type='" + s_type + "']").on("focus", function () {
119		$(this).parent().find(".label").hide();
120	})
121
122	$(".input-wrapper input[s_type='" + s_type + "']").on("focusout", function () {
123		if ($(this).val() == "") {
124			$(this).parent().find(".label").show();
125		}
126	})
127
128
129}
130
131//Инициализируем input
132function initInputs(s_type) {
133	setLabel(s_type);
134
135
136	$("input[s_type='" + s_type + "'], textarea[s_type='" + s_type + "']").on("focusout", function () {
137		checkInput(this);
138		var value = $(this).val();
139	})
140
141	$("input[s_type='" + s_type + "'], textarea[s_type='" + s_type + "']").keyup(function () {
142		if ($(this).attr("num") == "Y") onlyNum(this);
143	})
144
145}
146//--------------------
147//Функция проверки Email
148function checkmail(email) {
149	return (/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email);
150}
151//-----------------------------------
152
153//Только цифры  в поле ввода
154function onlyNum(input) {
155	input.value = input.value.replace(/[^\d+]/g, '');
156};
157//---------------
158//Проверка пароля
159function checkPass(input) {
160	var flag = true;
161	if (input.value.length < 6) flag = false;
162	return flag;
163}
164//-------------
165//Проверка подтверждения пароля
166function checkrePass(input) {
167	var flag = false;
168	var val = $("input[pass='Y']").val();
169	if (input.value == val) flag = true;
170	return flag;
171}
172
173//Проверка корректности ввода логина
174function checkLogin(input) {
175	flag = false;
176	if (input.value.length >= 3) flag = true;
177	return flag;
178}
179
180//Проверка полей определённого типа
181function checkInput(oThis) {
182	var flag = true;
183
184	if (
185		$(oThis).attr("req") &&
186		(
187			$(oThis).val() == "" ||
188			$(oThis).val() == $(oThis).attr("d_value") ||
189			$(oThis).attr("email") == "Y" && !checkmail($(oThis).val()) ||
190			$(oThis).attr("repass") == "Y" && !checkrePass(oThis) ||
191			$(oThis).attr("pass") == "Y" && !checkPass(oThis) ||
192			$(oThis).attr("login") == "Y" && !checkLogin(oThis)
193		)
194	) {
195		$(oThis).addClass("error-input");
196		flag = false;
197	} else {
198		$(oThis).removeClass("error-input");
199	}
200
201	//if (!flag) error_func()
202	//else success_func();
203	return flag;
204
205}
206document.addEventListener('DOMContentLoaded', function() {
207    const cookieBanner = document.getElementById('cookie-consent-banner');
208    const acceptButton = document.getElementById('accept-cookies');
209    const consentGiven = localStorage.getItem('cookieConsent'); // Проверяем наличие согласия в localStorage
210
211    // Если согласие еще не дано, показываем баннер
212    if (!consentGiven) {
213        cookieBanner.style.display = 'flex'; // Показываем баннер (или 'block'/'grid' в зависимости от CSS)
214    }
215
216    // Обработчик нажатия на кнопку "Согласен"
217    if (acceptButton) {
218        acceptButton.addEventListener('click', function() {
219            localStorage.setItem('cookieConsent', 'given'); // Записываем согласие в localStorage
220            cookieBanner.style.display = 'none'; // Скрываем баннер
221        });
222    }
223});

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.