PageSourceSearch

https://vvmarket.in.ua/catalog/view/javascript/common.js

js vvmarket.in.ua collected 2026-10-05 00:03:56 UTC 4,922 bytes, 182 lines download raw bytes

1$(document).ready(function() {
2	/* Search */
3	$('.button-search').bind('click', function() {
4		url = $('base').attr('href') + 'index.php?route=product/search';
5				 
6		var search = $('input[name=\'search\']').attr('value');
7		
8		if (search) {
9			url += '&search=' + encodeURIComponent(search);
10		}
11		
12		location = url;
13	});
14	
15	$('#header input[name=\'search\']').bind('keydown', function(e) {
16		if (e.keyCode == 13) {
17			url = $('base').attr('href') + 'index.php?route=product/search';
18			 
19			var search = $('input[name=\'search\']').attr('value');
20			
21			if (search) {
22				url += '&search=' + encodeURIComponent(search);
23			}
24			
25			location = url;
26		}
27	});
28	
29	/* Ajax Cart */
30	$('#cart > .heading a').live('click', function() {
31		$('#cart').addClass('active');
32		
33		$('#cart').load('index.php?route=module/cart #cart > *');
34		
35		$('#cart').live('mouseleave', function() {
36			$(this).removeClass('active');
37		});
38	});
39	
40	/* Mega Menu */
41	$('#menu ul > li > a + div').each(function(index, element) {
42		// IE6 & IE7 Fixes
43		if ($.browser.msie && ($.browser.version == 7 || $.browser.version == 6)) {
44			var category = $(element).find('a');
45			var columns = $(element).find('ul').length;
46			
47			$(element).css('width', (columns * 143) + 'px');
48			$(element).find('ul').css('float', 'left');
49		}		
50		
51		var menu = $('#menu').offset();
52		var dropdown = $(this).parent().offset();
53		
54		i = (dropdown.left + $(this).outerWidth()) - (menu.left + $('#menu').outerWidth());
55		
56		if (i > 0) {
57			$(this).css('margin-left', '-' + (i + 5) + 'px');
58		}
59	});
60
61	// IE6 & IE7 Fixes
62	if ($.browser.msie) {
63		if ($.browser.version <= 6) {
64			$('#column-left + #column-right + #content, #column-left + #content').css('margin-left', '195px');
65			
66			$('#column-right + #content').css('margin-right', '195px');
67		
68			$('.box-category ul li a.active + ul').css('display', 'block');	
69		}
70		
71		if ($.browser.version <= 7) {
72			$('#menu > ul > li').bind('mouseover', function() {
73				$(this).addClass('active');
74			});
75				
76			$('#menu > ul > li').bind('mouseout', function() {
77				$(this).removeClass('active');
78			});	
79		}
80	}
81	
82	$('.success img, .warning img, .attention img, .information img').live('click', function() {
83		$(this).parent().fadeOut('slow', function() {
84			$(this).remove();
85		});
86	});	
87});
88
89function getURLVar(key) {
90	var value = [];
91	
92	var query = String(document.location).split('?');
93	
94	if (query[1]) {
95		var part = query[1].split('&');
96
97		for (i = 0; i < part.length; i++) {
98			var data = part[i].split('=');
99			
100			if (data[0] && data[1]) {
101				value[data[0]] = data[1];
102			}
103		}
104		
105		if (value[key]) {
106			return value[key];
107		} else {
108			return '';
109		}
110	}
111} 
112
113function addToCart(product_id, quantity) {
114	quantity = typeof(quantity) != 'undefined' ? quantity : 1;
115
116	$.ajax({
117		url: 'index.php?route=checkout/cart/add',
118		type: 'post',
119		data: 'product_id=' + product_id + '&quantity=' + quantity,
120		dataType: 'json',
121		success: function(json) {
122			$('.success, .warning, .attention, .information, .error').remove();
123			
124			if (json['redirect']) {
125				location = json['redirect'];
126			}
127			
128			if (json['success']) {
129				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
130				
131				$('.success').fadeIn('slow');
132				
133				$('#cart-total').html(json['total']);
134				
135				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
136			}	
137		}
138	});
139}
140function addToWishList(product_id) {
141	$.ajax({
142		url: 'index.php?route=account/wishlist/add',
143		type: 'post',
144		data: 'product_id=' + product_id,
145		dataType: 'json',
146		success: function(json) {
147			$('.success, .warning, .attention, .information').remove();
148						
149			if (json['success']) {
150				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
151				
152				$('.success').fadeIn('slow');
153				
154				$('#wishlist-total').html(json['total']);
155				
156				$('html, body').animate({ scrollTop: 0 }, 'slow');
157			}	
158		}
159	});
160}
161
162function addToCompare(product_id) { 
163	$.ajax({
164		url: 'index.php?route=product/compare/add',
165		type: 'post',
166		data: 'product_id=' + product_id,
167		dataType: 'json',
168		success: function(json) {
169			$('.success, .warning, .attention, .information').remove();
170						
171			if (json['success']) {
172				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
173				
174				$('.success').fadeIn('slow');
175				
176				$('#compare-total').html(json['total']);
177				
178				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
179			}	
180		}
181	});
182}

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.