PageSourceSearch

https://www.jkllamps.com/catalog/view/javascript/common.js?v=111111

js jkllamps.com collected 2026-10-04 13:31:12 UTC 5,532 bytes, 220 lines download raw bytes

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

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.