PageSourceSearch

https://konveyt.ru/bitrix/templates/aspro_max/components/bitrix/catalog/main/script.js?160016109315800

js konveyt.ru collected 2026-10-02 19:12:44 UTC 15,800 bytes, 371 lines download raw bytes

1function setNewHeader(obOffer){
2	var ratingHtml = priceHtml = imgHtml = skuHtml = buttonHtml = '';
3
4	if(arMaxOptions['THEME']['SHOW_HEADER_GOODS'] != 'Y' || !$('.main-catalog-wrapper.details').length)
5		return;
6
7	$('#headerfixed').addClass('with-product');
8
9	if($('.product-info-headnote .rating').length) //show rating
10	{
11		ratingHtml = '<div class="votes_block nstar'+(arAsproOptions['THEME']['REVIEWS_VIEW'] == 'EXTENDED' ? ' pointer' : '')+'"><div class="ratings"><div class="inner_rating"';
12		var inner =  $('.product-info-headnote .rating .inner_rating');
13		if(inner.length && inner.attr('title') !== undefined) {
14			ratingHtml += 'title="'+inner.attr('title');
15		} 
16		ratingHtml += '">';
17
18		$('.product-info-headnote .rating .inner_rating > div').each(function(index){
19			var index_title = index+1;
20			ratingHtml += '<div class="item-rating '+($(this).hasClass('filed') ? 'filed' : '');
21			if(inner.attr('title') === undefined) {
22				ratingHtml += '" title="'+index_title;
23			}
24			ratingHtml += '">'+$(this).html()+'</div>';
25		});
26
27		ratingHtml += '</div></div></div>';
28
29		if($('.product-info-headnote .rating span').length) {
30			ratingHtml += $('.product-info-headnote .rating span')[0].outerHTML;
31		}
32	}
33	if($('div *[itemprop="offers"]').length) //show price
34	{
35		/*if($('.cost.detail .js_price_wrapper').length)
36		{
37			priceHtml = $('.cost.detail .js_price_wrapper .price_matrix_wrapper').html();
38		}
39		else
40		{
41			if($('.cost.detail .price_group.min').length)
42				priceHtml = $('.cost.detail .price_group.min').html();
43			else if($('.cost.detail .price_matrix_wrapper').length)
44				priceHtml = $('.cost.detail .price_matrix_wrapper').html();
45		}*/
46
47		if(BX.util.object_search_key('ASPRO_ITEM_POPUP_PRICE',BX.message) && BX.message('ASPRO_ITEM_POPUP_PRICE') == 'Y'){
48			var obOffer = {
49				SHOW_POPUP_PRICE: false,
50				PRICES_COUNT: BX.message('ASPRO_ITEM_PRICES')
51			}
52			if(BX.util.object_search_key('ASPRO_ITEM_PRICE_MATRIX',BX.message)){
53				obOffer.USE_PRICE_COUNT = true;
54				obOffer.PRICE_MATRIX = BX.message('ASPRO_ITEM_PRICE_MATRIX');
55			}else if(BX.util.object_search_key('ASPRO_ITEM_PRICE',BX.message)){
56				obOffer.PRICES_HTML = BX.message('ASPRO_ITEM_PRICE');
57			}
58		}
59
60		if(typeof obOffer !== 'undefined'){
61			if(!obOffer.SHOW_POPUP_PRICE &&
62			 (('PRICES_COUNT' in obOffer && obOffer.PRICES_COUNT > 1) ||
63			  (('PRICES' in obOffer && Object.keys(obOffer.PRICES).length > 1) || ('ITEM_PRICES' in obOffer && Object.keys(obOffer.ITEM_PRICES).length > 1)))){
64
65				var bPriceCount = (obOffer.USE_PRICE_COUNT && obOffer.PRICE_MATRIX),
66					topPrice = '';
67
68				if(bPriceCount){
69					if($('.cost.detail .with_matrix').length){
70						topPrice = $('.cost.detail .with_matrix').html();
71					}else{
72						topPrice = '<div class="prices-wrapper">'+$('.cost.detail').html()+'</div>';
73					}
74				}else{
75					topPrice = '<div class="prices-wrapper">'+obOffer.PRICES_HTML+'</div>';
76				}
77
78				priceHtml = '<div class="with_matrix pl with_old price_matrix_wrapper">'+topPrice+'</div>';
79				priceHtml += '<div class="js_price_wrapper">';
80				priceHtml += '<div class="js-info-block rounded3">'+
81								'<div class="block_title text-upper font_xs font-bold">'+
82									BX.message('PRICES_TYPE')+
83									'<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>'+
84								'</div>'+
85							'<div class="block_wrap">'+
86								'<div class="block_wrap_inner prices srollbar-custom">';
87				
88				if(bPriceCount)
89				{
90					priceHtml += obOffer.PRICE_MATRIX;
91				}
92				else if(obOffer.PRICES_HTML)
93				{
94					priceHtml += obOffer.PRICES_HTML;
95				}
96
97				priceHtml += '<div class="more-btn text-center"></div>';
98				priceHtml += '</div></div></div>';
99				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>';
100				priceHtml += '</div>';
101
102			}else{
103				priceHtml = $('.cost.detail').html();
104			}
105		}else{
106			priceHtml = $('.cost.detail').html();
107		}
108	}
109
110	if($('#photo-sku').length) //show img
111	{
112		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'));
113	}
114	else if($('.product-detail-gallery__slider #photo-0').length)
115	{
116		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'));
117	}
118	//show button
119	if ($('.slide_offer').length) {
120		buttonHtml = '<span class="buy_block"><span class="btn btn-default btn-sm slide_offer more type_block'+($('.product-container .buy_block .offer_buy_block .btn').hasClass('has_prediction') ? ' has_prediction' : '')+'">'+($('.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>';
121	} else if ($('.buy_block .sku_props').length) {
122		buttonHtml = '<span class="buy_block"><span class="btn btn-default btn-sm more type_block'+($('.product-container .buy_block .offer_buy_block .btn').hasClass('has_prediction') ? ' has_prediction' : '')+'">'+($('.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>';
123		// buttonHtml = $('.buy_block .button_block').html().replace(/btn-lg/g, 'btn-sm more ww');
124	} else if ($('.buy_block .button_block').length) {
125		buttonHtml = $('.buy_block .button_block').html().replace(/btn-lg/g, 'btn-sm');
126	}
127
128	if($('.sku_props .bx_catalog_item_scu > div').length)
129	{
130		var skuHtmlTmp = '';
131		$('.product-container .sku_props .bx_catalog_item_scu > div').each(function(){
132			var _this = $(this),
133				li_block = _this.find('li.active'),
134				select_block = _this.find('select');
135			if(li_block.length)
136			{
137				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>';
138			}
139			else if(select_block.length)
140			{
141				if(select_block.find('option:selected').data('img_src') !== undefined)
142				{
143					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>';
144				}
145				else
146				{
147					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>';
148				}
149			}
150		})
151		skuHtml = skuHtmlTmp.replace(/mCustomScrollbar/g, '');
152	}
153	// setTimeout(function(){
154		$('#headerfixed .logo-row').html(
155		'<div class="ajax_load">'+
156			'<div class="table-view flexbox flexbox--row">'+
157				'<div class="table-view__item item main_item_wrapper">'+
158					'<div class="table-view__item-wrapper item_info catalog-adaptive flexbox flexbox--row">'+
159						'<div class="item-foto">'+
160							'<div class="item-foto__picture">'+
161								'<img src="'+imgSrc+'" />'+
162							'</div>'+
163						'</div>'+
164						'<div class="item-info">'+
165							'<div class="item-title">'+
166								'<span>'+$('#pagetitle').text()+'</span>'+
167							'</div>'+
168							'<div class="wrapp_stockers sa_block">'+
169								($('.product-info-headnote .rating').length ? '<div class="rating sm-stars">'+ratingHtml+'</div>' : '')+
170								($('.quantity_block_wrapper .item-stock').length ? '<div class="item-stock">'+$('.quantity_block_wrapper .item-stock').html()+'</div>' : '')+
171							'</div>'+
172						'</div>'+
173						'<div class="item-actions flexbox flexbox--row">'+
174							'<div class="item-price">'+
175								'<div class="cost prices">'+priceHtml+'</div>'+
176							'</div>'+
177							'<div class="item-sku">
177'+
178								'<div class="but-cell flexbox flexbox--row sku_props">'+skuHtml+'</div>'+
179							'</div>'+
180							'<div class="item-buttons">'+
181								'<div class="but-cell">'+buttonHtml+'</div>'+
182							'</div>'+
183							($('.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>' : '')+
184						'</div>'+
185					'</div>'+
186				'</div>'+
187			'</div>'+
188		'</div>');
189	// },5000)
190
191	InitLazyLoad();
192	InitScrollBar();
193
194	if(typeof obMaxPredictions === 'object'){
195		obMaxPredictions.showAll();
196	}
197}	
198
199BX.addCustomEvent('onWindowResize', function(eventdata){
200	if( window.predictionWindow && typeof window.predictionWindow.close === 'function' ) {
201		window.predictionWindow.close();
202	}
203});
204
205$(document).on('click', '.ordered-block.goods .tabs li', function(){
206	setTimeout(
207		sliceItemBlockSlide, 5
208	);
209});
210
211$(document).on('click', ".item-stock .store_view", function(){
212	scroll_block($('.js-store-scroll'), $('a[href=#stores]'));
213});
214
215$(document).on('click', '.blog-info__rating--top-info, #headerfixed .wproducts .wrapp_stockers .rating .votes_block', function() {
216	var reviews = $('.reviews.EXTENDED');
217	if(reviews.length) {
218		//scroll_block($('.js-store-scroll'), $('.ordered-block .nav-tabs a[href="#reviews"]'));
219		var tabsBlock = $('.ordered-block.tabs-block');
220		var blockToScroll = tabsBlock.length ? tabsBlock : reviews;
221		scroll_block(blockToScroll, $('.ordered-block .nav-tabs a[href="#reviews"]'));
222	}
223});
224
225$(document).on('click', ".table-view__item--has-stores .item-stock .value", function(){
226	$(this).closest('.table-view__item-wrapper').find('.stores-icons .btn').trigger('click');
227});
228
229$(document).on('click', '#headerfixed .item-buttons .more', function(){
230	if ($('.product-container .buy_block .offer_buy_block .to-cart').is(':visible')) {
231		$('.product-container .buy_block .offer_buy_block .to-cart').trigger('click');
232	} else if ($('.middle-info-wrapper .to-cart').is(':visible')) {
233		$('.middle-info-wrapper .to-cart').trigger('click')
234	} else if ($('.product-side .to-cart').is(':visible')) {
235		$('.product-side .to-cart').trigger('click')
236	} else {
237		location.href = arAsproOptions['PAGES']['BASKET_PAGE_URL'];
238	}
239})
240
241$(document).on('click', '#headerfixed .item-actions .bx_catalog_item_scu', function(){
242	var offset = 0;
243	offset = $('.product-container .sku_props .bx_catalog_item_scu').offset().top;
244		
245	$('body, html').animate({scrollTop: offset-150}, 500);
246})
247
248$(document).on('click', ".stores-title .stores-title__list", function(){
249	var _this = $(this);
250	_this.siblings().removeClass('stores-title--active');
251	_this.addClass('stores-title--active');
252
253	$('.stores_block_wrap .stores-amount-list').hide(100).removeClass('stores-amount-list--active');
254	$('.stores_block_wrap .stores-amount-list:eq('+_this.index()+')').show(100, function(){
255		if(_this.hasClass('stores-title--map'))
256		{
257			if(typeof map !== 'undefined')
258			{
259				map.container.fitToViewport();
260				if(typeof clusterer !== 'undefined' && !$(this).find('.detail_items').is(':visible'))
261				{
262					map.setBounds(clusterer.getBounds(), {
263						zoomMargin: 40,
264						// checkZoomRange: true
265					});
266				}
267			}
268		}
269	}).addClass('stores-amount-list--active');
270
271})
272
273$(document).on('click', ".info_ext_block .title", function(){
274	var _this = $(this);
275	_this.toggleClass('opened');
276	_this.next().slideToggle();
277})
278
279$(document).on('click', ".stores-icons .btn", function(){
280	var _this = $(this),
281		block = _this.closest('.table-view__item-wrapper').next(),
282		bVisibleblock = (block.is(':visible')),
283		animate = (bVisibleblock ? 'slideUp' : 'slideDown');
284
285	if(!_this.hasClass('clicked'))
286	{
287		_this.addClass('clicked');
288
289		block.velocity('stop').velocity(animate, {
290			duration: 400,
291			// delay: 250,
292			begin: function(){
293				_this.toggleClass('closed');
294			},
295			complete: function(){
296				_this.removeClass('clicked');
297				// InitLazyLoad();
298			}
299		});
300	}
301});
302
303var checkFilterLandgings = function(){
304	if ($('.top-content-block .with-filter .with-filter-wrapper').length) {
305		var bActiveClass = false;
306		if ($("#mobilefilter .with-filter-wrapper").length) {
307			if ($("#mobilefilter .with-filter-wrapper .bx_filter_parameters_box").hasClass('active')) {
308				bActiveClass = true;
309			}
310			$("#mobilefilter .with-filter-wrapper").empty()
311			$('.top-content-block .with-filter .with-filter-wrapper').prependTo($("#mobilefilter .with-filter-wrapper"))
312		} else {
313			$('.top-content-block .with-filter .with-filter-wrapper').prependTo($("#mobilefilter .bx_filter_parameters"))
314		}
315		if ($("#mobilefilter .bx_filter_parameters .landings-list__item--active").length || bActiveClass) {
316			$("#mobilefilter .with-filter-wrapper .bx_filter_parameters_box").addClass('active')
317		}
318		$('#mobilefilter .scrollbar').scrollTop(0)
319		if ($('#mobilefilter .bx_filter_parameters.scroll-init').length) {
320			$('#mobilefilter .bx_filter_parameters.scroll-init').mCustomScrollbar('scrollTo', 0)
321		}
322	}
323}
324
325
326$(document).ready(function(){
327	lazyLoadPagenBlock();
328	BX.addCustomEvent('onWindowResize', function(){
329		try {
330			var fixedMobile = arAsproOptions.THEME['FIXED_BUY_MOBILE'] == 'Y';
331
332			if(fixedMobile) {
333				var buyBlock = $('.product-action .buy_block');
334				var counterWrapp = $('.product-action .counter_wrapp');
335
336				if(buyBlock.length && counterWrapp.length && !$('.list-offers.ajax_load').length) {
337					if( window.matchMedia('(max-width: 767px)').matches ) {	
338						if(buyBlock.data('hasCatalog') === undefined) {
339							var hasCatalog = buyBlock.hasClass('catalog_block');	
340							buyBlock.data('hasCatalog', hasCatalog);
341						}
342						buyBlock.addClass('catalog_block');
343
344						if(counterWrapp.data('hasList') === undefined) {
345							var hasList = counterWrapp.hasClass('list');	
346							counterWrapp.data('hasList', hasList);
347						}
348						counterWrapp.removeClass('list').addClass('fixed');
349					} else {
350						if(buyBlock.data('hasCatalog') !== undefined && !buyBlock.data('hasCatalog')) {
351							buyBlock.removeClass('catalog_block');
352						}
353
354						if(counterWrapp.data('hasList') !== undefined && counterWrapp.data('hasList')) {
355							counterWrapp.addClass('list');
356						}
357						counterWrapp.removeClass('fixed');
358					}
359				}
360				
361			}
362		}catch(e){}
363	});
364
365	$(document).find('.catalog_detail [class^=bx_item_detail] [class*=_scroller_container]').mCustomScrollbar({
366		mouseWheel: {
367			scrollAmount: 150,
368			preventDefault: true
369		}
370	});
371});

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.