PageSourceSearch

https://silina-elena.ru/js/main.js

js silina-elena.ru collected 2026-10-05 00:34:11 UTC 9,381 bytes, 276 lines download raw bytes

1var image_aspect = function() {
2	targets = $('.block .uss_eshop_block_item');
3	targets.each(function(index, el) {
4		_width = $(el).outerWidth();
5		image = $(el).find('.img');
6		$(image).css({
7			'width': _width,
8			"height": _width
9		});
10	});
11};
12jQuery(document).ready(function($) {
13	var window_width, window_top;
14	window_width = $(window).outerWidth();
15	window_top = $(window).scrollTop();
16	var revert_opened_menu = function() {
17		if (window_width >= 900) {
18			$('.mobile-top-menu').removeClass('open');
19			$('.aside-catalog').each(function(index, el) {
20				$(el).css('max-height', '0');
21			});
22		}
23	};
24	var addToTitle = function(target, element) {
25		if (!$(target).parent('div').parent('div').parent('div.news-block').hasClass('clear')){
26			title_span = $('<span></span>').text($(target).text())
27			$(target).text('');
28			title_span.appendTo(target);
29			$(element).prependTo(target);
30		}
31	}
32	var calc_aside_catalog_height = function() {
33		$('.aside-catalog').each(function(index, el) {
34			$(el).attr('max-height', $(el).children('ul').height());
35		});
36	};
37	var revert_opened_aside = function() {
38		if (window_width > 1000) {
39			$('.aside .open').removeClass('open');
40		}
41	};
42	var uss_shop_block_buy_btn = function(block_type) {
43		if (!block_type) {
44			block_type = '.uss_shop_blocks_view .uss_eshop_item';
45		}
46		elems = $(block_type);
47		$(elems).each(function(index, ell) {
48			$('<div class="uss_price_buy_btn_block"></div>').appendTo(ell);
49			$(ell).addClass('asd');
50			_compare = $(ell).find('.uss_compare_by');
51			_put = $(ell).find('.uss_shop_put_wrap');
52			if (_compare.length !== 0 || _put.length !== 0) {
53				$('<div class="uss_shop_btns"></div>').appendTo(ell);
54				$(ell).find('.buy_one_click').each(function(index, el) {
55					$(el).parent('.uss_shop_by').prependTo($(el).parent('.uss_shop_by').siblings('.uss_shop_btns'));
56				});
57				$(_put).appendTo($(ell).find('.uss_shop_btns'));
58				$(ell).addClass('with_btns');
59			}
60			$(ell).children('.uss_shop_price').appendTo($(ell).find('.uss_price_buy_btn_block'));
61			$(ell).children('.uss_shop_by').appendTo($(ell).find('.uss_price_buy_btn_block'));
62			$(ell).children('a.add_to_cart').appendTo($(ell).find('.uss_price_buy_btn_block'));
63			$($(ell).find('.uss_compare_by'), $(ell).find('.uss_shop_put_wrap')).each(function(index, el) {
64				$(el).prependTo($(el).siblings('.uss_shop_btns'));
65			});
66		});
67	};
68	var uss_shop_list_buy_btn = function() {
69		$('.uss_shop_list_view .uss_shop_technical_data ').append('<div class="uss_shop_btns"></div>');
70		$('.uss_shop_btns').each(function(index, el) {
71			$(this).append($(this).siblings('.uss_compare_by'));
72			$(this).append($(this).siblings('.uss_shop_put_wrap'));
73			$(this).append($(this).siblings('.uss_shop_buy_one_click'));
74		});
75	};
76	var submenu_click = function(e) {
77		in_submenu = false;
78		$(e.target).parents().each(function(index, el) {
79			if ($(el).hasClass('submenu')) {
80				in_submenu = true;
81			}
82		});
83		if (in_submenu) {
84			$(e.target).removeClass('first-click');
85		} else if ($(e.target).hasClass('first-click')) {
86			$(e.target).removeClass('first-click');
87		} else {
88			$(e.target).addClass('first-click');
89			return false;
90		}
91	};
92	var top_menu_move = function() {
93		if (window_width < 901) {
94			$('#wrap').addClass('tablet-pda');
95			$('<div class="menu_place"></div>').insertAfter('.menu:not(.footer-menu) .in_menu');
96			$('.menu_place').css('display', 'none');
97			$('.menu:not(.footer-menu) .in_menu').wrap('<div class="mobile-top-menu"></div>');
98			$('.mobile-top-menu').prependTo('#wrap');
99			$('<div class="close"></div>').appendTo('.mobile-top-menu');
100			$('.mobile-top-menu').find('li').each(function(index, el) {
101				if ($(el).children('.submenu').length !== 0) {
102					$(el).children('a').live('click', submenu_click);
103				}
104			});
105		} else {
106			$('#wrap').removeClass('tablet-pda');
107			$('.mobile-top-menu').find('.in_menu').insertBefore('.menu_place');
108			$('.menu_place').remove();
109			$('.mobile-top-menu').remove();
110		}
111	};
112	var basket_move = function() {
113		if (window_width < 901) {
114			$('<div class="basket_holder"></div>').insertAfter('.menu:not(.footer-menu) .basket');
115			$('.menu:not(.footer-menu) .basket').insertAfter('.header .burger');
116			$('<div class="search-holder"></div>').insertAfter('.header .left .search');
117			$('<div class="search-holder"></div>').insertAfter('.header .right .search');
118			$('.header .left .search').appendTo('.header .center');
119			$('.header .right .search').appendTo('.header .center');
120		} else {
121			$('.header .basket').insertAfter('.menu:not(.footer-menu) .basket_holder');
122			$('.menu:not(.footer-menu) .basket_holder').remove();
123			if ($('.header').find('.search-holder').length > 0) {
124				$('.header .center .search').insertBefore('.header  .search-holder');
125				$('.header .search-holder').remove();
126			}
127		}
128	};
129	var wrap_catalog_category_info = function() {
130		$('.uss_catalog_category').each(function(index, el) {
131			$(el).children('*:not(.uss_catalog_img_wrap)').wrapAll('<div class="uss_catalog_info"></div>');
132		});
133	};
134	var block_elems_show = function(target) {
135		if ($(target).length !== 0) {
136			elems = $(target).find('.items').children('*');
137			target_height = $(target).outerHeight();
138			target_from_top = $(target).offset().top;
139			elems.addClass('scale');
140			if ((window_top + ($(window).height() - 250) >= target_from_top && !$(target).hasClass('already_animate')) || target_from_top <= $(window).height()) {
141				elems.addClass('scale1');
142				$(target).addClass('already_animate');
143			} else if (window_top + ($(window).height() - 250) < target_from_top && !$(target).hasClass('already_animate')) {
144				elems.addClass('scale0');
145			}
146		}
147	};
148	$('.header .burger').on('click', function() {
149		$('.mobile-top-menu').addClass('open');
150	});
151	$('.mobile-top-menu .close').live('click', function(event) {
152		$('.mobile-top-menu').toggleClass('open');
153		$('.mobile-top-menu').find('a').removeClass('first-click');
154	});
155	$('.aside_opener').click(function(e) {
156		if ($(e.target).next('div').hasClass('open')) {
157			$(this).next('.aside-catalog').removeClass('open');
158			$(this).next('.aside-catalog').each(function(index, el) {
159				$(el).css('max-height', '0');
160			});
161		} else {
162			$(this).next('.aside-catalog').addClass('open');
163			$(this).next('.aside-catalog').each(function(index, el) {
164				$(el).css('max-height', $(el).attr('max-height') + 'px');
165			});
166		}
167	});
168	wrap_catalog_category_info();
169	uss_shop_block_buy_btn();
170	uss_shop_block_buy_btn('.position.block .items .uss_eshop_block_item ');
171	calc_aside_catalog_height();
172	top_menu_move();
173	basket_move();
174	block_elems_show('.news-block');
175	image_aspect();
176	addToTitle('.aside .aside-form .h3', '<em></em>');
177	addToTitle('.news-block .h3', '<div class="title-menu"> <a href="/news/" class="watch-all">Все новости</a> <a href="/subscribe/" class="subscribe">Подписка на новости</a> </div>');
178	$('.slider .slides')
179	.sliderHeight()
180	.slick({
181		slidesToShow: 1,
182		slidesToScroll: 1,
183		arrows: true,
184		dots: false,
185		touchMove: false,
186		autoplay: true,
187		// adaptiveHeight: true,
188		autoplaySpeed: 4500,
189	});
190	var aside_position;
191	if ($(".aside-position .uss_widget_outer_content").length > 0) {aside_position = $(".aside-position .uss_widget_outer_content");}
192	else {aside_position = $(".aside-position .items");}
193	aside_position.slick({
194	    slidesToShow: 3,
195	    slidesToScroll: 1,
196	    arrows: true,
197	    dots: false,
198	    touchMove: false,
199	    autoplay: true,
200	    autoplaySpeed: 4500,
201	    vertical: true,
202	    verticalSwiping: true,
203	});
204	var position;
205	if ($(".position.block .uss_widget_outer_content").length > 0) {position = $(".position.block .uss_widget_outer_content");}
206	else {position = $(".position .items");}
207	position.slick({
208	    slidesToShow: 3,
209	    slidesToScroll: 3,
210	    arrows: true,
211	    dots: false,
212	    touchMove: false,
213	    autoplay: true,
214	    autoplaySpeed: 4500,
215	    variableWidth: true,
216	    responsive: [{
217	        breakpoint: 650,
218	        settings: {
219	            slidesToShow: 2,
220	            slidesToScroll: 2,
221	        }
222	    }, {
223	        breakpoint: 500,
224	        settings: {
225	            slidesToShow: 1,
226	            slidesToScroll: 1
227	        }
228	    }]
229	});
230	$('.photoalbum.block .uss_images_block ').slick({
231		slidesToShow: 4,
232		slidesToScroll: 1,
233		arrows: true,
234		dots: false,
235		touchMove: false,
236		autoplay: true,
237		autoplaySpeed: 4500,
238		variableWidth: true,
239		prevArrow: $('.block.photoalbum .slick-prev'),
240		nextArrow: $('.block.photoalbum .slick-next'),
241		responsive: [{
242			breakpoint: 1000,
243			settings: {
244				slidesToShow: 3,
245			}
246		}, {
247			breakpoint: 650,
248			settings: {
249				slidesToShow: 2,
250			}
251		}, {
252			breakpoint: 500,
253			settings: {
254				slidesToShow: 1,
255			}
256		}]
257	});
258	$(window).scroll(function() {
259		window_top = $(window).scrollTop();
260		block_elems_show('.news-block');
261	});
262	$(window).resize(function() {
263		window_width = $(window).outerWidth();
264		//
265		revert_opened_menu();
266		revert_opened_aside();
267		calc_aside_catalog_height();
268		top_menu_move();
269		basket_move();
270		image_aspect();
271		detect_menu_height();
272	});
273});
274$(window).load(function() {
275	image_aspect();
276});

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.