PageSourceSearch

https://lkg.ru/bitrix/templates/aspro_max/components/bitrix/catalog/custom/script.js?171646553713419

js lkg.ru collected 2026-10-08 03:31:48 UTC 13,419 bytes, 323 lines download raw bytes

1function setNewHeader(obOffer){
2	var ratingHtml = priceHtml = imgHtml = skuHtml = buttonHtml = '';
3
4	if(arMaxOptions['THEME']['SHOW_HEADER_GOODS'] != 'Y')
5		return;
6
7	/*if($('.logo-row.wproducts').length)
8		return;*/
9
10	$('#headerfixed').addClass('with-product');
11
12	if($('.product-info-headnote .rating').length) //show rating
13	{
14		ratingHtml = '<div class="votes_block nstar'+(arAsproOptions['THEME']['REVIEWS_VIEW'] == 'EXTENDED' ? ' pointer' : '')+'"><div class="ratings"><div class="inner_rating"';
15		var inner =  $('.product-info-headnote .rating .inner_rating');
16		if(inner.length && inner.attr('title') !== undefined) {
17			ratingHtml += 'title="'+inner.attr('title');
18		} 
19		ratingHtml += '">';
20
21		$('.product-info-headnote .rating .inner_rating > div').each(function(index){
22			var index_title = index+1;
23			ratingHtml += '<div class="item-rating '+($(this).hasClass('filed') ? 'filed' : '');
24			if(inner.attr('title') === undefined) {
25				ratingHtml += '" title="'+index_title;
26			}
27			ratingHtml += '">'+$(this).html()+'</div>';
28		});
29
30		ratingHtml += '</div></div></div>';
31
32		if($('.product-info-headnote .rating span').length) {
33			ratingHtml += $('.product-info-headnote .rating span')[0].outerHTML;
34		}
35	}
36	if($('div *[itemprop="offers"]').length) //show price
37	{
38		/*if($('.cost.detail .js_price_wrapper').length)
39		{
40			priceHtml = $('.cost.detail .js_price_wrapper .price_matrix_wrapper').html();
41		}
42		else
43		{
44			if($('.cost.detail .price_group.min').length)
45				priceHtml = $('.cost.detail .price_group.min').html();
46			else if($('.cost.detail .price_matrix_wrapper').length)
47				priceHtml = $('.cost.detail .price_matrix_wrapper').html();
48		}*/
49
50		if(BX.util.object_search_key('ASPRO_ITEM_POPUP_PRICE',BX.message) && BX.message('ASPRO_ITEM_POPUP_PRICE') == 'Y'){
51			var obOffer = {
52				SHOW_POPUP_PRICE: false,
53				PRICES_COUNT: BX.message('ASPRO_ITEM_PRICES')
54			}
55			if(BX.util.object_search_key('ASPRO_ITEM_PRICE_MATRIX',BX.message)){
56				obOffer.USE_PRICE_COUNT = true;
57				obOffer.PRICE_MATRIX = BX.message('ASPRO_ITEM_PRICE_MATRIX');
58			}else if(BX.util.object_search_key('ASPRO_ITEM_PRICE',BX.message)){
59				obOffer.PRICES_HTML = BX.message('ASPRO_ITEM_PRICE');
60			}
61		}
62
63		if(typeof obOffer !== 'undefined'){
64			if(!obOffer.SHOW_POPUP_PRICE &&
65			 (('PRICES_COUNT' in obOffer && obOffer.PRICES_COUNT > 1) ||
66			  (('PRICES' in obOffer && Object.keys(obOffer.PRICES).length > 1) || ('ITEM_PRICES' in obOffer && Object.keys(obOffer.ITEM_PRICES).length > 1)))){
67
68				var bPriceCount = (obOffer.USE_PRICE_COUNT && obOffer.PRICE_MATRIX),
69					topPrice = '';
70
71				if(bPriceCount){
72					if($('.cost.detail .with_matrix').length){
73						topPrice = $('.cost.detail .with_matrix').html();
74					}else{
75						topPrice = '<div class="prices-wrapper">'+$('.cost.detail').html()+'</div>';
76					}
77				}else{
78					topPrice = '<div class="prices-wrapper">'+obOffer.PRICES_HTML+'</div>';
79				}
80
81				priceHtml = '<div class="with_matrix pl with_old price_matrix_wrapper">'+topPrice+'</div>';
82				priceHtml += '<div class="js_price_wrapper">';
83				priceHtml += '<div class="js-info-block rounded3">'+
84								'<div class="block_title text-upper font_xs font-bold">'+
85									BX.message('PRICES_TYPE')+
86									'<i class="svg inline  svg-inline-close" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path data-name="Rounded Rectangle 114 copy 3" class="cccls-1" d="M334.411,138l6.3,6.3a1,1,0,0,1,0,1.414,0.992,0.992,0,0,1-1.408,0l-6.3-6.306-6.3,6.306a1,1,0,0,1-1.409-1.414l6.3-6.3-6.293-6.3a1,1,0,0,1,1.409-1.414l6.3,6.3,6.3-6.3A1,1,0,0,1,340.7,131.7Z" transform="translate(-325 -130)"></path></svg></i>'+
87								'</div>'+
88							'<div class="block_wrap">'+
89								'<div class="block_wrap_inner prices srollbar-custom">';
90				
91				if(bPriceCount)
92				{
93					priceHtml += obOffer.PRICE_MATRIX;
94				}
95				else if(obOffer.PRICES_HTML)
96				{
97					priceHtml += obOffer.PRICES_HTML;
98				}
99
100				priceHtml += '<div class="more-btn text-center"></div>';
101				priceHtml += '</div></div></div>';
102				priceHtml += '<div class="js-show-info-block more-item-info rounded3 bordered-block text-center"><i class="svg inline  svg-inline-fw" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="8" height="2" viewBox="0 0 8 2"><path id="Ellipse_292_copy_3" data-name="Ellipse 292 copy 3" class="cls-1" d="M320,4558a1,1,0,1,1-1,1A1,1,0,0,1,320,4558Zm-3,0a1,1,0,1,1-1,1A1,1,0,0,1,317,4558Zm6,0a1,1,0,1,1-1,1A1,1,0,0,1,323,4558Z" transform="translate(-316 -4558)"></path></svg></i></div>';
103				priceHtml += '</div>';
104
105			}else{
106				priceHtml = $('.cost.detail').html();
107			}
108		}else{
109			priceHtml = $('.cost.detail').html();
110		}
111	}
112
113	if($('#photo-sku').length) //show img
114	{
115		imgSrc = ($('#photo-sku .product-detail-gallery__picture.one').attr('src') ? $('#photo-sku .product-detail-gallery__picture.one').attr('src') : $('#photo-sku .product-detail-gallery__picture').data('src') ? $('#photo-sku .product-detail-gallery__picture').data('src') : $('#photo-sku .product-detail-gallery__picture').attr('src'));
116	}
117	else if($('.product-detail-gallery__slider #photo-0').length)
118	{
119		imgSrc = ($('.product-detail-gallery__slider #photo-0 .product-detail-gallery__picture').data('src') ? $('.product-detail-gallery__slider #photo-0 .product-detail-gallery__picture').data('src') : $('.product-detail-gallery__slider #photo-0 .product-detail-gallery__picture').attr('src'));
120	}
121
122	if($('.slide_offer').length) //show button
123		buttonHtml = '<span class="buy_block"><span class="btn btn-default btn-sm slide_offer type_block">'+($('.product-container .buy_block .offer_buy_block .in-cart').is(':visible') ? $('.product-container .buy_block .offer_buy_block .in-cart').html() : BX.message('MORE_INFO_SKU'))+'</span></span>';
124	else if($('.buy_block .sku_props').length)
125		buttonHtml = '<span class="buy_block"><span class="btn btn-default btn-sm more type_block">'+($('.product-container .buy_block .offer_buy_block .in-cart').is(':visible') ? $('.product-container .buy_block .offer_buy_block .in-cart').html() : BX.message('MORE_INFO_SKU'))+'</span></span>';
126	else if($('.buy_block .button_block').length)
127		buttonHtml = $('.buy_block .button_block').html().replace(/btn-lg/g, 'btn-sm');
128
129	if($('.sku_props .bx_catalog_item_scu > div').length)
130	{
131		var skuHtmlTmp = '';
132		$('.product-container .sku_props .bx_catalog_item_scu > div').each(function(){
133			var _this = $(this),
134				li_block = _this.find('li.active'),
135				select_block = _this.find('select');
136			if(li_block.length)
137			{
138				skuHtmlTmp += '<div class="bx_catalog_item_scu"><div class="bx_scu"><div class="'+_this.attr('class')+'"><ul><li class="active" title="'+li_block.attr('title')+'">'+li_block.html()+'</li></ul></div></div></div>';
139			}
140			else if(select_block.length)
141			{
142				if(select_block.find('option:selected').data('img_src') !== undefined)
143				{
144					skuHtmlTmp += '<div class="bx_catalog_item_scu"><div class="bx_scu"><div class="bx_item_detail_scu"><ul><li class="active" title="'+select_block.val()+'"><span class="cnt1"><span class="cnt_item" style="background-image:url('+select_block.find('option:selected').data('img_src')+')"></span></span></li></ul></div></div></div>';
145				}
146				else
147				{
148					skuHtmlTmp += '<div class="bx_catalog_item_scu"><div class="bx_scu"><div class="'+_this.attr('class')+'"><ul><li class="active"><span class="cnt">'+select_block.val()+'</span></li></ul></div></div></div>';
149				}
150			}
151		})
152		skuHtml = skuHtmlTmp;
153	}
154	// setTimeout(function(){
155		$('#headerfixed .logo-row').html(
156		'<div class="ajax_load">'+
157			'<div class="table-view flexbox flexbox--row">'+
158				'<div class="table-view__item item main_item_wrapper">'+
159					'<div class="table-view__item-wrapper item_info catalog-adaptive flexbox flexbox--row">'+
160						'<div class="item-foto">'+
161							'<div class="item-foto__picture">'+
162								'<img src="'+imgSrc+'" />'+
163							'</div>'+
164						'</div>'+
165						'<div class="item-info">'+
166							'<div class="item-title">'+
167								'<span>'+$('#pagetitle').text()+'</span>'+
168							'</div>'+
169							'<div class="wrapp_stockers sa_block">'+
170								($('.product-info-headnote .rating').length ? '<div class="rating sm-stars">'+ratingHtml+'</div>' : '')+
171								($('.quantity_block_wrapper .item-stock').length ? '<div class="item-stock">'+$('.quantity_block_wrapper .item-stock').html()+'</div>' : '')+
172							'</div>'+
173						'</div>'+
174						'<div class="item-actions flexbox flexbox--row">'+
175							'<div class="item-price">'+
176								'<div class="cost prices">'+priceHtml+'</div>'+
177							'</div>'+
178							'<div class="item-sku">
178'+
179								'<div class="but-cell flexbox flexbox--row sku_props">'+skuHtml+'</div>'+
180							'</div>'+
181							'<div class="item-buttons">'+
182								'<div class="but-cell">'+buttonHtml+'</div>'+
183							'</div>'+
184							($('.product-info .like_icons').length ? '<div class="item-icons s_'+$('.product-info .like_icons').data('size')+'"><div class="like_icons list static icons long">'+$('.product-info .like_icons').html()+'</div></div>' : '')+
185						'</div>'+
186					'</div>'+
187				'</div>'+
188			'</div>'+
189		'</div>');
190	// },5000)
191
192	InitLazyLoad();
193	InitScrollBar();
194}
195
196$(document).on('click', '.ordered-block.goods .tabs li', function(){
197	setTimeout(
198		sliceItemBlockSlide, 5
199	);
200});
201
202$(document).on('click', ".item-stock .store_view", function(){
203	scroll_block($('.js-store-scroll'), $('a[href=#stores]'));
204});
205
206$(document).on('click', '.blog-info__rating--top-info, #headerfixed .wproducts .wrapp_stockers .rating .votes_block', function() {
207	var reviews = $('.reviews.EXTENDED');
208	if(reviews.length) {
209		scroll_block(reviews, $('.ordered-block .nav-tabs a[href="#reviews"]'));
210	}
211});
212
213$(document).on('click', ".table-view__item--has-stores .item-stock .value", function(){
214	$(this).closest('.table-view__item-wrapper').find('.stores-icons .btn').trigger('click');
215});
216
217$(document).on('click', '#headerfixed .item-buttons .more', function(){
218	if($('.product-container .buy_block .offer_buy_block .to-cart').is(':visible'))
219		$('.product-container .buy_block .offer_buy_block .to-cart').trigger('click');
220	else
221		location.href = arAsproOptions['PAGES']['BASKET_PAGE_URL'];
222})
223
224$(document).on('click', '#headerfixed .item-actions .bx_catalog_item_scu', function(){
225	var offset = 0;
226	offset = $('.product-container .sku_props .bx_catalog_item_scu').offset().top;
227		
228	$('body, html').animate({scrollTop: offset-150}, 500);
229})
230
231$(document).on('click', ".stores-title .stores-title__list", function(){
232	var _this = $(this);
233	_this.siblings().removeClass('stores-title--active');
234	_this.addClass('stores-title--active');
235
236	$('.stores_block_wrap .stores-amount-list').hide(100).removeClass('stores-amount-list--active');
237	$('.stores_block_wrap .stores-amount-list:eq('+_this.index()+')').show(100, function(){
238		if(_this.hasClass('stores-title--map'))
239		{
240			if(typeof map !== 'undefined')
241			{
242				map.container.fitToViewport();
243				if(typeof clusterer !== 'undefined' && !$(this).find('.detail_items').is(':visible'))
244				{
245					map.setBounds(clusterer.getBounds(), {
246						zoomMargin: 40,
247						// checkZoomRange: true
248					});
249				}
250			}
251		}
252	}).addClass('stores-amount-list--active');
253
254})
255
256$(document).on('click', ".info_ext_block .title", function(){
257	var _this = $(this);
258	_this.toggleClass('opened');
259	_this.next().slideToggle();
260})
261
262$(document).on('click', ".stores-icons .btn", function(){
263	var _this = $(this),
264		block = _this.closest('.table-view__item-wrapper').next(),
265		bVisibleblock = (block.is(':visible')),
266		animate = (bVisibleblock ? 'slideUp' : 'slideDown');
267
268	if(!_this.hasClass('clicked'))
269	{
270		_this.addClass('clicked');
271
272		block.velocity('stop').velocity(animate, {
273			duration: 400,
274			// delay: 250,
275			begin: function(){
276				_this.toggleClass('closed');
277			},
278			complete: function(){
279				_this.removeClass('clicked');
280				// InitLazyLoad();
281			}
282		});
283	}
284});
285
286$(document).ready(function(){
287	BX.addCustomEvent('onWindowResize', function(){
288		try {
289			var fixedMobile = arAsproOptions.THEME['FIXED_BUY_MOBILE'] == 'Y';
290
291			if(fixedMobile) {
292				var buyBlock = $('.buy_block');
293				var counterWrapp = $('.counter_wrapp');
294
295				if(buyBlock.length && counterWrapp.length && !$('.list-offers.ajax_load').length) {
296					if( window.matchMedia('(max-width: 767px)').matches ) {	
297						if(buyBlock.data('hasCatalog') === undefined) {
298							var hasCatalog = buyBlock.hasClass('catalog_block');	
299							buyBlock.data('hasCatalog', hasCatalog);
300						}
301						buyBlock.addClass('catalog_block');
302
303						if(counterWrapp.data('hasList') === undefined) {
304							var hasList = counterWrapp.hasClass('list');	
305							counterWrapp.data('hasList', hasList);
306						}
307						counterWrapp.removeClass('list').addClass('fixed');
308					} else {
309						if(buyBlock.data('hasCatalog') !== undefined && !buyBlock.data('hasCatalog')) {
310							buyBlock.removeClass('catalog_block');
311						}
312
313						if(counterWrapp.data('hasList') !== undefined && counterWrapp.data('hasList')) {
314							counterWrapp.addClass('list');
315						}
316						counterWrapp.removeClass('fixed');
317					}
318				}
319				
320			}
321		}catch(e){}
322	});
323});

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.