PageSourceSearch

https://avtoprostavka.ru/t/v7911/images/js/products_load.js

js avtoprostavka.ru collected 2026-10-08 17:07:47 UTC 7,992 bytes, 243 lines download raw bytes

1// 862 start
2
3shop2.queue.product = function(){
4	shop2.product._reload = function(node) {
5  		var $node = $(node);
6		var kinds = shop2.product.getNodeData(node, 'kinds', true);
7		var paramName = shop2.product.getNodeData(node, 'name');
8		var paramValue = shop2.product.getNodeData(node, 'value');
9		var $form = $node.closest('form');
10		var form = $form.get(0);
11		var meta;
12		var kind_id;
13		var product_id;
14		var keys = {};
15  
16		if (kinds && $.type(paramName) !== 'undefined' && $.type(paramValue) !== 'undefined' && form) {
17	
18			meta = $form.find('input[name=meta]').val();		
19			product_id = $form.find('input[name=product_id]').val();
20			$form.find('[name=submit]').prop('disabled', true);
21			$form.find('select.shop2-cf>option, li.shop2-cf, li.shop2-color-ext-selected, ul.shop2-color-ext-list>li, .option-body.select>span').each(function() {
22				var name = $(this).data('name');
23				if (name) {
24					keys[name] = true;
25				}
26			});
27
28			kind_id = shop2.product.findKindId(product_id, kinds, paramName, paramValue, meta, keys);
29
30			if (shop2.mode == 'product') {
31				var link,
32					content = $('.product-wrapper.card_page');
33				
34				if (shop2.uri) {
35					link = shop2.uri + '/product/' + kind_id;
36					
37				} else {
38					link = document.location.href.replace(/\/product\/.+/, '/product/' + kind_id);
39					
40				};
41				$.ajax({
42					url: link,
43					async: false,
44					type: 'get',
45					beforeSend: function(){
46						content.addClass('ajax-loading');
47					},
48					success: function(data) {
49						content.html($(data).find('.product-wrapper.card_page').html());
50						console.log('oko1')
51						shop2.queue.hs();
52						history.pushState(null, null, link);
53						
54						setTimeout(function() {
55							var $tabs = $('#product_tabs'),
56								$win = $(window),
57								winHeight = $(window).height();
58								$doc = $(document),
59								isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
60								click = 'click',
61								srchIsOpen = false;
62								
63							
64							$tabs.responsiveTabs({
65								rotate: false,
66								startCollapsed: 'accordion',
67								collapsible: 'accordion',
68								animation: 'slide',
69								setHash: true,
70								scrollToAccordion: true,
71								scrollToAccordionOffset: 0
72							});
73							
74							$('.buy-one-click').on('touchstart click', function(e){
75								
76								$('.oneclick-form-wrapper').addClass('active');
77								var productName = $(this).find('.product_name').val()+(', Количество:' + $(this).closest('.product-side-r').find('.shop2-product-amount input[type="text"]').val()),
78									productLink = $(this).find('.product_link').val();
79								setTimeout(function() {
80									$('.oneclick-form-wrapper input.productName').val(productName);
81									$('.oneclick-form-wrapper input.productLink').val(productLink);
82								}, 800);
83								
84								if (/iPod|iPad|iPhone/i.test(navigator.userAgent)) {
85									$(document.documentElement).removeClass('overflow-visible');
86									$('body').addClass('overflow-hidden');
87								} else {
88									$(document.documentElement).addClass('overflow-visible');
89									$('body').addClass('overflow-hidden');				
90								}
91								e.preventDefault();
92							});
93							
94							$(document).on('click', '.close-form', function (){
95								$('.oneclick-form-wrapper').removeClass('active');
96								removeHidden();
97							});		
98							$(document).on("keydown", function (e) {
99								if (e.keyCode===27) {
100									$('.oneclick-form-wrapper').removeClass('active');
101									$('html, body').removeClass('overflowHidden');
102									
103								};
104							});
105							
106							$('form .tpl-stars').each(function() {
107								var $this = $(this),
108									selected = null,
109									stars = $this.children('span'),
110									input = $this.children('input');
111				
112								function choose(elem) {
113									elem = $(elem);
114									stars.removeClass('tpl-active');
115									elem.addClass('tpl-active').prevAll().addClass('tpl-active');	
116								}
117								
118								$this.on({
119									click: function(e) {
120										selected = e.target;
121										input.val($(selected).index() + 1);
122									},
123									mousemove: function(e) {
124										choose(e.target);
125									},
126									mouseleave: function(e) {
127										choose(selected);
128									}
129								});
130				
131							});
132							
133					    	var owl_3 = $('.desc-area .shop2-group-kinds').owlCarousel({
134					    		items: 1,
135							    autoplay: $('.desc-area .shop2-group-kinds').data('autoplay') || 0,
136							    slideSpeed: 300,
137							    loop: $('.desc-area .shop2-group-kinds').data('autoplay') || 0,
138							    margin: 20,
139							    autoplayHoverPause: true,
140							    dots: true,
141					            responsive: {
142				                0: {
143				                		margin: 10,
144				                        items: 1
145				                    },	
146				                420: {
147				                		margin: 10,	
148				                        items: 2
149				                    },		                    
150				                571: {
151				                		margin: 10,	
152				                        items: 3
153				                    },	                     
154				                701: {
155				                		margin: 20,	
156				                        items: 3
157				                    },	                               	
158				                1000: {
159				                		margin: 20,
160				                        items: 3
161				                    }
162				                }
163				            });	
164				
165					    	var owl_3 = $('.collections-wrap-in1 .shop2-group-kinds').owlCarousel({
166					    		items: 1,
167							    autoplay: $('.collections-wrap-in1 .shop2-group-kinds').data('autoplay') || 0,
168							    slideSpeed: 300,
169							    loop: $('.collections-wrap-in1 .shop2-group-kinds').data('autoplay') || 0,
170							    margin: 20,
171							    autoplayHoverPause: true,
172							    dots: true,
173					            responsive: {
174				                0: {
175				                		margin: 10,
176				                        items: 1
177				                    },	
178				                420: {
179				                		margin: 10,	
180				                        items: 2
181				                    },		                    
182				                571: {
183				                		margin: 10,	
184				                        items: 2
185				                    },	                     
186				                701: {
187				                		margin: 20,	
188				                        items: 2
189				                    },	                               	
190				                1000: {
191				                		margin: 20,
192				                        items: 2
193				                    }
194				                }
195				            });
196				            
197				            
198								window.ifpluso = 1;
199								var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
200								s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
201								s.src = ('https:' == window.location.protocol ? 'https' : 'http') + '://share.pluso.ru/pluso-like.js';
202								var h=d[g]('body')[0];
203								h.appendChild(s);
204						}, 100);
205						
206					}
207				});
208			} else {
209				shop2.product.getProductListItem(product_id, kind_id, function(d, status) {
210					var cont, newCont, body;
211					if (status === 'success') {
212						cont = $node.closest('.shop2-product-item');
213						cont.hide();
214						body = $.trim(d.data.body);
215						newCont = $(body).insertBefore(cont);
216						cont.remove();
217						shop2.queue.heights();
218					}
219				});
220			}
221		}
222	};
223};
224
225$.on('select.shop2-cf', {
226	change: function() {
227		shop2.product._reload(this);
228	}
229});
230
231$.on('li.shop2-cf:not(.active-color, .active-texture)', {
232	click: function() {
233		shop2.product._reload(this);
234	}
235});
236
237$.on('.option-body.select>span', {
238	click: function() {
239		shop2.product._reload(this);
240	}
241});
242
243// 862 end

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.