PageSourceSearch

https://gorod-engels.ru/media/templates/site/jdevelop4/js/jdvshop.js?8071c9

js gorod-engels.ru collected 2026-10-02 23:19:34 UTC 6,009 bytes, 233 lines download raw bytes

1/* mod shop */
2	
3var bw = jQuery( window ).width();
4var otstup = 220;
5jQuery(window).scroll(function(){
6	
7	
8	var bo = jQuery(this).scrollTop();
9	
10	if(bw <= 979){
11		//otstup = 70;
12		//jQuery(".jdvshopcart-cart-mini").css('top', otstup);
13	}
14
15	if ( bo >= 10 && bw >= 979) {
16		var top = bo + otstup + 'px';
17		// var top = 200 + 'px';
18		jQuery(".jdvshopcart-cart-mini").stop().css('display', 'block').animate({'top':top},400);
19	}
20	
21	if ( bo >= 10 && bw >= 979) {
22		var top = bo + 230 + 'px';
23		// var top = 200 + 'px';
24		jQuery(".combticket").stop().css('display', 'block').animate({'top':top},500);
25	}
26
27});
28
29/* end mod shop */
30	
31/*
32 *  jdvShop
33 */
34jQuery(document).ready(function(jQuery) {
35	
36	
37	
38	
39	
40	
41	
42
43
44	//jQuery('.item-image').append('<a href="#" class="addbutton">Add</a>');
45
46	/*clearcart-button for tbody*/
47	jQuery('.jdvshop-clearcart-button').click(function(){
48		jQuery.removeCookie('jdvshop', { path: '/' });
49		jQuery('.jdvshopcart-cart-items tbody').animate({opacity: 0},500,function() {jQuery(this).remove()});
50		shopAjaxTotal();
51	});	
52
53
54	/*del-button for tr*/
55	jQuery('.jdvshop-del-button').click(function(){
56
57		jQuery.cookie.json = true; //!
58
59		var cookieValue = jQuery.cookie('jdvshop');
60	 	//if (cookieValue == undefined) cookieValue = {};
61
62		var articleId =  jQuery(this).parent().children('.item_id').val();
63
64		var rowKey = 'row'+articleId;
65
66		delete cookieValue[rowKey];
67
68		jQuery.cookie('jdvshop', cookieValue, { path: '/' });
69
70		jQuery(this).parent().parent().animate({opacity: 0},500,function() {jQuery(this).remove()});
71
72		shopAjaxTotal();
73	});
74
75	/*Calc*/
76	function total(){		
77		
78		var totalSum = 0;
79		jQuery('.shopping-cart-items .cost-number').each(function(key, value) {
80			totalSum += Number(jQuery(value).text());
81		});
82		jQuery('.total-cost').text(totalSum);
83
84		jQuery('.mod-total-cost').text(totalSum);
85	}
86
87	/*Calc*/
88	function shopAjaxTotal(){		
89		
90		jQuery.ajax({
91			/* url: 'index.php?tmpl=component&option=com_jdvshop&task=getCostTotal', */
92			url: '?tmpl=component&option=com_jdvshop&task=getCostTotal',
93			success: function(data){
94				//alert(data);
95				jQuery('.total-cost').text(data);
96
97				jQuery('.jdvshop-mod-total-cost').text(data);
98			}
99		});
100	}
101
102
103
104	/*Save Cookie*/
105	function saveShopCookie(articleId, count){
106		jQuery.cookie.json = true; //!
107		
108		//alert(articleId); 
109
110	 	var cookieValue = jQuery.cookie('jdvshop');
111	 	if (cookieValue == undefined) cookieValue = {  };
112
113	 	var rowKey = 'row'+articleId;
114	 	//alert(rowKey);
115	 	cookieValue[rowKey] = {'id': articleId, 'count': count};
116
117	 	jQuery.cookie('jdvshop', cookieValue, { path: '/' });
118
119	 	shopAjaxTotal();
120	}
121
122
123	/*buy-button item*/
124	jQuery('.jdvshop-buy-button').click(function(){
125
126
127
128	 	//var articleId =  jQuery(this).parent().children('.item_id').val();
129		
130		var articleId =  jQuery(this).attr('for');
131	 	var count =  jQuery(this).parent().children('.item-count').val();
132		//var fields =  jQuery(this).parent().children('.tovar-cart-field');
133		
134		//alert(articleId); 
135		/* 
136		jQuery(fields).each(function(){
137			alert(jQuery(this).val());
138		});
139 */
140//alert(count);
141
142		saveShopCookie(articleId, count);
143
144		//jQuery.each( jQuery.cookie('jdvshop'), function( rowKey, row ) {
145			//alert( rowKey + ": " + row );
146			// jQuery.each( row, function( key, value ) {
147			// 	alert( key + ": " + value );
148			// });
149
150		//});
151		
152		
153		
154		
155		id = jQuery(this).attr("for");
156 
157        /* jQuery("#product"+id)
158            .clone()
159            .css({'position' : 'absolute', 'z-index' : '11100', 'width': '100', 'height': 'auto', top: jQuery(this).offset().top-300, left:jQuery(this).offset().left-100})
160            .appendTo("body")
161            .animate({opacity: 0.05,
162                left: jQuery(".shopping-cart-mini").offset()['left'],
163                top: jQuery(".shopping-cart-mini").offset()['top'],
164                width: 20}, 1000, function() {
165                jQuery(this).remove();
166            }); */
167		
168		jQuery("#product"+id)
169            .clone()
170            .css({'position' : 'absolute', 'z-index' : '11100', 'width': '100', 'height': 'auto', top: jQuery("#product"+id).offset().top, left:jQuery("#product"+id).offset().left})
171            .appendTo("body")
172            .animate({opacity: 0.05,
173                left: jQuery(".jdvshopcart-cart-mini").offset()['left'],
174                top: jQuery(".jdvshopcart-cart-mini").offset()['top'],
175                width: 20}, 1000, function() {
176                jQuery(this).remove();
177            });
178
179		return false;
180	});
181
182
183	/*minus*/
184	jQuery('.jdvshop-btn-number[data-type="minus"]').click(function(){
185		var dataMin = jQuery('.item-count').attr('data-min');
186		var dataCookie = jQuery(this).attr('data-cookie');
187		var price =  jQuery(this).parent().parent().children('.price').children('.price-number-value').val();
188		var count =  jQuery(this).parent().children('.item-count').val();
189		
190		//alert(price);
191
192		if(dataMin < count){
193			count--;
194		}
195		
196		jQuery(this).parent().children('.item-count').val(count);
197
198
199		if (dataCookie == "true"){
200			var articleId =  jQuery(this).parent().parent().children('.remove').children('.item_id').val();
201			
202			
203			saveShopCookie(articleId, count);
204			jQuery(this).parent().parent().children('.cost').children('.cost-number').text(count * price);
205			//total();
206			//shopAjaxTotal();
207		}
208
209		return false;
210	});
211
212	/*plus*/
213	jQuery('.jdvshop-btn-number[data-type="plus"]').click(function(){
214		var dataCookie = jQuery(this).attr('data-cookie');
215		var price =  jQuery(this).parent().parent().children('.price').children('.price-number-value').val();
216		var count =  jQuery(this).parent().children('.item-count').val();
217		count++;
218
219		jQuery(this).parent().children('.item-count').val(count);
220	 	
221	 	if (dataCookie == "true"){
222			var articleId =  jQuery(this).parent().parent().children('.remove').children('.item_id').val();
223			//alert(articleId);
224			saveShopCookie(articleId, count);
225			jQuery(this).parent().parent().children('.cost').children('.cost-number').text(count * price);
226			//total();
227			//shopAjaxTotal();
228		}
229		
230		return false;
231	});
232	
233});

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.