PageSourceSearch

https://dof-vlg.ru/local/templates/aspro_max_34web/components/bitr…/catalog_block_redesign2025/script.js

js dof-vlg.ru collected 2026-10-03 00:27:18 UTC 8,316 bytes, 288 lines download raw bytes

1if(!funcDefined("sliceItemBlock")){
2	sliceItemBlock = function(){
3		$('.cur .catalog_block .catalog_item_wrapp.catalog_item:visible').sliceHeight({
4			classNull: '.footer_button', 
5			item:'.cur .catalog_block .catalog_item_wrapp.catalog_item:visible', 
6			classes: [
7				'.item_info .item-title',
8				'.item_info .sa_block',
9				'.item_info .cost.prices',
10			],
11			mobile: true,
12			blockNull: {
13				class: 'big',
14				width: 2,
15			},
16			breakpoint: {
17				'(max-width: 600px)': {
18					blockNull: {
19						width: 1,
20					},
21					autoslicecount: false, 
22					slice: 999,
23				}
24			},
25		});
26
27		InitCustomScrollBar();
28	}
29}
30if(!funcDefined("sliceItemBlockSlide")){
31	sliceItemBlockSlide = function(options){
32		var settings = 
33		{
34			classNull: '.footer_button', 
35			item:'.cur .catalog_block.owl-carousel .catalog_item:not(.big)', 
36			classes: [
37				'.item_info .item-title',
38				'.item_info .sa_block',
39				'.item_info .cost.prices',
40			],
41			mobile: true,
42			autoslicecount: false, 
43			slice: 999,
44		};
45
46		if(options !== undefined) {
47			settings = Object.assign(settings, options);
48		}
49		$('.cur .catalog_block.owl-carousel .catalog_item_wrapp.catalog_item').sliceHeight(settings);
50
51		InitCustomScrollBar();
52	}
53}
54
55$(document).ready(function(){
56	if(!('SelectOfferProp' in window) && typeof window.SelectOfferProp != 'function')
57	{
58		SelectOfferProp1 = function(){
59			// return false;
60			var _this = $(this),
61				obParams = {},
62				obSelect = {},
63				objUrl = parseUrlQuery(),
64				add_url = '',
65				container = _this.closest('.bx_catalog_item_scu');
66
67			/* request params */
68			obParams = {
69				'PARAMS': _this.closest('.js_wrapper_items').data('params'),
70				'ID': container.data('offer_id'),
71				'SITE_ID': container.data('site_id'),
72				'LINK_ID': container.data('id')+'_block',
73				'IBLOCK_ID': container.data('offer_iblockid'),
74				'PROPERTY_ID': container.data('propertyid'),
75				'DEPTH': _this.closest('.item_wrapper').index(),
76				'VALUE': _this.data('onevalue'),
77				'CLASS': 'inner_content',
78				'PICTURE': _this.closest('.catalog_item_wrapp').find('.thumb img').attr('src'),
79				'ARTICLE_NAME': _this.closest('.catalog_item_wrapp').find('.article_block').data('name'),
80				'ARTICLE_VALUE': _this.closest('.catalog_item_wrapp').find('.article_block').data('value'),
81			}
82			/**/
83
84			if("clear_cache" in objUrl)
85			{
86				if(objUrl.clear_cache == "Y")
87					add_url += "?clear_cache=Y";
88			}
89
90			/* save selected values */
91			for (i = 0; i < obParams.DEPTH+1; i++)
92			{
93				strName = 'PROP_'+container.find('.item_wrapper:eq('+i+') > div').data('id');
94				obSelect[strName] = container.find('.item_wrapper:eq('+i+') li.item.active').data('onevalue');
95				obParams[strName] = container.find('.item_wrapper:eq('+i+') li.item.active').data('onevalue');
96			}
97
98			// obParams.SELECTED = JSON.stringify(obSelect);
99			/**/
100			
101			_this.siblings().removeClass('active');
102			_this.addClass('active');
103
104			if(_this.attr('title'))
105			{
106				var skuVal = _this.attr('title').split(':')[1];
107				_this.closest('.item_wrapper').find('.show_class .val').text(skuVal);
108			}
109			else
110			{
111				var img_row = _this.find(' > i');
112				if(img_row.length && img_row.attr('title')) {
113					var skuVal = img_row.attr('title').split(':')[1];
114					_this.closest('.item_wrapper').find('.show_class .val').text(skuVal);
115				}
116			}
117
118			/* get sku */
119			$.ajax({
120				url: arMaxOptions['SITE_DIR']+'ajax/js_item_detail.php'+add_url,
121				type: 'POST',
122				data: obParams,
123			}).success(function(html){
124				var ob = BX.processHTML(html);BX.ajax.processScripts(ob.SCRIPT);
125			})
126		}
127		$(document).on('click', '.bx_catalog_item_scu li.item', SelectOfferProp)
128	}
129});
130
131(function (window) {
132if (!window.JCCatalogSectionOnlyElement)
133{
134
135	window.JCCatalogSectionOnlyElement = function (arParams)
136	{
137		if (typeof arParams === 'object')
138		{
139			this.params = arParams;
140
141			this.obProduct = null;
142			this.set_quantity = 1;
143
144			this.currentPriceMode = '';
145			this.currentPrices = [];
146			this.currentPriceSelected = 0;
147			this.currentQuantityRanges = [];
148			this.currentQuantityRangeSelected = 0;
149
150			if (this.params.MESS)
151			{
152				this.mess = this.params.MESS;
153			}
154
155			this.init();
156		}
157	}
158	window.JCCatalogSectionOnlyElement.prototype = {
159		init: function()
160		{
161			var i = 0,
162				j = 0,
163				treeItems = null;
164
165			this.obProduct = BX(this.params.ID);
166
167			if(!!this.obProduct)
168			{
169				$(this.obProduct).find('.counter_wrapp .counter_block input').data('product', 'ob'+this.obProduct.id+'el');
170				this.currentPriceMode = this.params.ITEM_PRICE_MODE;
171				this.currentPrices = this.params.ITEM_PRICES;
172				this.currentQuantityRanges = this.params.ITEM_QUANTITY_RANGES;
173			}
174
175		},
176
177		setPriceAction: function()
178		{
179			this.set_quantity = this.params.MIN_QUANTITY_BUY;			
180			if($(this.obProduct).find('input[name=quantity]').length)
181				this.set_quantity = $(this.obProduct).find('input[name=quantity]').val();
182			
183			this.checkPriceRange(this.set_quantity);
184
185			$(this.obProduct).find('.not_matrix').hide();
186			$(this.obProduct).find('.with_matrix .price_value_block').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_PRICE));
187
188			if($(this.obProduct).find('.with_matrix .discount'))
189			{
190				$(this.obProduct).find('.with_matrix .discount').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].BASE_PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_BASE_PRICE));
191			}
192
193			if(this.params.SHOW_DISCOUNT_PERCENT_NUMBER == 'Y')
194			{
195				if(this.currentPrices[this.currentPriceSelected].PERCENT > 0 && this.currentPrices[this.currentPriceSelected].PERCENT < 100)
196				{
197					if(!$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length)
198						$('<div class="value"></div>').insertBefore($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .text'));
199
200					$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').html('-<span>'+this.currentPrices[this.currentPriceSelected].PERCENT+'</span>%');
201				}
202				else
203				{
204					if($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length)
205						$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').remove();
206				}
207			}
208			$(this.obProduct).find('.with_matrix .sale_block .text .values_wrapper').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].DISCOUNT, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_DISCOUNT));
209			
210			if('NOT_SHOW' in this.params && this.params.NOT_SHOW != 'Y')
211				$(this.obProduct).find('.with_matrix').show();			
212
213			if(arMaxOptions['THEME']['SHOW_TOTAL_SUMM'] == 'Y')
214			{
215				if(typeof this.currentPrices[this.currentPriceSelected] !== 'undefined')
216					setPriceItem($(this.obProduct), this.set_quantity, this.currentPrices[this.currentPriceSelected].PRICE);
217			}
218		},
219
220		checkPriceRange: function(quantity)
221		{
222			if (typeof quantity === 'undefined'|| this.currentPriceMode != 'Q')
223				return;
224
225			var range, found = false;
226			
227			for (var i in this.currentQuantityRanges)
228			{
229				if (this.currentQuantityRanges.hasOwnProperty(i))
230				{
231					range = this.currentQuantityRanges[i];
232
233					if (
234						parseInt(quantity) >= parseInt(range.SORT_FROM)
235						&& (
236							range.SORT_TO == 'INF'
237							|| parseInt(quantity) <= parseInt(range.SORT_TO)
238						)
239					)
240					{
241						found = true;
242						this.currentQuantityRangeSelected = range.HASH;
243						break;
244					}
245				}
246			}
247
248			if (!found && (range = this.getMinPriceRange()))
249			{
250				this.currentQuantityRangeSelected = range.HASH;
251			}
252
253			for (var k in this.currentPrices)
254			{
255				if (this.currentPrices.hasOwnProperty(k))
256				{
257					if (this.currentPrices[k].QUANTITY_HASH == this.currentQuantityRangeSelected)
258					{
259						this.currentPriceSelected = k;
260						break;
261					}
262				}
263			}
264		},
265
266		getMinPriceRange: function()
267		{
268			var range;
269
270			for (var i in this.currentQuantityRanges)
271			{
272				if (this.currentQuantityRanges.hasOwnProperty(i))
273				{
274					if (
275						!range
276						|| parseInt(this.currentQuantityRanges[i].SORT_FROM) < parseInt(range.SORT_FROM)
277					)
278					{
279						range = this.currentQuantityRanges[i];
280					}
281				}
282			}
283
284			return range;
285		}
286	}
287}
288})(window);

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.