PageSourceSearch

https://allf0rdj.ru/local/templates/aspro_max_local/components/bitrix/catalog/main/script.js?162203818815864

js allf0rdj.ru collected 2026-09-26 13:10:33 UTC 15,864 bytes, 379 lines download raw bytes

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

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.