PageSourceSearch

https://hopaco.com.vn/themes/default/js/shops.js?t=83

js hopaco.com.vn collected 2026-10-04 03:31:40 UTC 12,561 bytes, 403 lines download raw bytes

1/**
2 * @Project NUKEVIET 4.x
3 * @Author VINADES.,JSC ([email protected])
4 * @Copyright (C) 2017 VINADES.,JSC. All rights reserved
5 * @License GNU/GPL version 2 or any later version
6 * @Createdate 04/18/2017 09:47
7 */
8
9function sendrating(id, point, newscheckss)
10{
11	if (point == 1 || point == 2 || point == 3 || point == 4 || point == 5) {
12		$.post(nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=rating&nocache=' + new Date().getTime(), 'id=' + id + '&checkss=' + newscheckss + '&point=' + point, function(res) {
13			$("#stringrating").html(res);
14		});
15	}
16}
17
18function remove_text() {
19	document.getElementById('to_date').value = "";
20	document.getElementById('from_date').value = "";
21}
22
23function nv_del_content(id, checkss, base_adminurl) {
24	if (confirm(nv_is_del_confirm[0])) {
25		$.post(base_adminurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=del_content&nocache=' + new Date().getTime(), 'id=' + id + '&checkss=' + checkss, function(res) {
26			var r_split = res.split("_");
27			if (r_split[0] == 'OK') {
28				window.location.href = strHref;
29			} else if (r_split[0] == 'ERR') {
30				alert(r_split[1]);
31			} else {
32				alert(nv_is_del_confirm[2]);
33			}
34		});
35	}
36	return false;
37}
38
39/*javascript user*/
40function cartorder(a_ob, popup, url) {
41	var id = $(a_ob).attr("id");
42	if( popup == '0' )
43	{
44		$.ajax({
45			type : "GET",
46			url : nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=setcart' + '&id=' + id + "&nocache=" + new Date().getTime(),
47			data : '',
48			success : function(data) {
49				var s = data.split('_');
50				var strText = s[1];
51				if (strText != null) {
52					var intIndexOfMatch = strText.indexOf('#@#');
53					while (intIndexOfMatch != -1) {
54						strText = strText.replace('#@#', '_');
55						intIndexOfMatch = strText.indexOf('#@#');
56					}
57					alert_msg(strText);
58					linkloadcart = nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=loadcart';
59					$("#cart_" + nv_module_name).load(linkloadcart);
60					//window.location.href = nv_base_siteurl + "index.php?" + nv_lang_variable + "=" + nv_lang_data + "&" + nv_name_variable + "=" + nv_module_name + "&" + nv_fc_variable + "=cart";
61				}
62			}
63		});
64	}
65	else
66	{
67	        $('#idmodals').removeData('bs.modal');
68	     	$.post(url + '&popup=1', function(res) {
69			$('#idmodals .modal-body').html( res ); 
70			$('#idmodals').modal('show');
71		});
72	}
73}
74
75/**/
76function cartorder_detail(a_ob, popup, buy_now) {
77	var num = $('#pnum').val();
78	var id = $(a_ob).attr("data-id");
79	var group = '';
80	var label = '';
81
82	var i = 0;
83	$('.itemsgroup').each(function(){
84		if( $('input[name="groupid['+$(this).data('groupid')+']"]:checked' ).length == 0 )
85		{
86			i++;
87    		if( i == 1 ){
88    			label = label + $(this).data('header');
89    		}
90    		else{
91    			label = label + ', ' + $(this).data('header');
92    		}
93		}
94	});
95	if( label != '' ){
96		$('#group_error').css( 'display', 'block' );
97		$('#group_error').html( detail_error_group + ' <strong>' + label + '</strong>' );
98		return false;
99	}
100
101	i = 0;
102    $('.groupid').each(function(){
103    	if( $(this).is(':checked') )
104    	{
105    		i++;
106    		if( i == 1 )
107    		{
108    			group = group + $(this).val();
109    		}
110    		else
111    		{
112    			group = group + ',' + $(this).val();
113    		}
114    	}
115	});
116
117	$.ajax({
118		type : "POST",
119		url : nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=setcart' + '&id=' + id + "&group=" + group + "&nocache=" + new Date().getTime(),
120		data : 'num=' + num,
121		success : function(data) {
122			var s = data.split('_');
123			var strText = s[1];
124			if (strText != null) {
125				var intIndexOfMatch = strText.indexOf('#@#');
126				while (intIndexOfMatch != -1) {
127					strText = strText.replace('#@#', '_');
128					intIndexOfMatch = strText.indexOf('#@#');
129				}
130				alert_msg(strText);
131				linkloadcart = nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=loadcart';
132				$("#cart_" + nv_module_name).load(linkloadcart);
133				if( buy_now )
134				{
135					parent.location = nv_base_siteurl + "index.php?" + nv_lang_variable + "=" + nv_lang_data + "&" + nv_name_variable + "=" + nv_module_name + "&" + nv_fc_variable + "=cart";
136				}
137				else if( popup )
138				{
139					parent.location = parent.location;
140				}
141			}
142		}
143	});
144}
145
146function alert_msg(msg) {
147	$('#msgshow').html(msg);
148	$('#msgshow').show('slide').delay(3000).hide('slow');
149}
150
151function checknum() {
152	var price1 = $('#price1').val();
153	var price2 = $('#price2').val();
154	if (price2 == '') {
155		price2 = 0;
156	}
157	if (price2 < price1) {
158		document.getElementById('price2').value = '';
159	}
160	if (isNaN(price1)) {
161		alert(isnumber);
162		document.getElementById('submit').disabled = true;
163	} else if (price2 != 0 && isNaN(price2)) {
164		alert(isnumber);
165		document.getElementById('submit').disabled = true;
166	}
167}
168
169function cleartxtinput(id, txt_default) {
170	$("#" + id).focusin(function() {
171		var txt = $(this).val();
172		if (txt_default == txt) {
173			$(this).val('');
174		}
175	});
176	$("#" + id).focusout(function() {
177		var txt = $(this).val();
178		if (txt == '') {
179			$(this).val(txt_default);
180		}
181	});
182}
183
184function onsubmitsearch(module) {
185	var keyword = $('#keyword').val();
186	var price1 = $('#price1').val();
187	if (price1 == null)
188		price1 = '';
189	var price2 = $('#price2').val();
190	if (price2 == null)
191		price2 = '';
192	var typemoney = $('#typemoney').val();
193	if (typemoney == null)
194		typemoney = '';
195	var cataid = $('#cata').val();
196	if (keyword == '' && price1 == '' && price2 == '' && cataid == 0 ) {
197		return false;
198	} else {
199		window.location.href = nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + module + '&' + nv_fc_variable + '=search_result&keyword=' + rawurlencode(keyword) + '&price1=' + price1 + '&price2=' + price2 + '&typemoney=' + typemoney + '&cata=' + cataid;
200	}
201	return false;
202}
203
204function onsubmitsearch1() {
205	var keyword = $('#keyword1').val();
206	var price1 = $('#price11').val();
207	if (price1 == null)
208		price1 = '';
209	var price2 = $('#price21').val();
210	if (price2 == null)
211		price2 = '';
212	var typemoney = $('#typemoney1').val();
213	if (typemoney == null)
214		typemoney = '';
215	var cataid = $('#cata1').val();
216	if (keyword == '' && price1 == '' && price2 == '' && cataid == 0 ) {
217		return false;
218	} else {
219		window.location.href = nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=search_result&keyword=' + rawurlencode(keyword) + '&price1=' + price1 + '&price2=' + price2 + '&typemoney=' + typemoney + '&cata=' + cataid;
220	}
221	return false;
222}
223
224function nv_chang_price() {
225	var newsort = $("#sort").val();
226	$.post(nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=main&nocache=' + new Date().getTime(), 'changesprice=1&sort=' + newsort, function(res) {
227		if (res != 'OK') {
228			alert(res);
229		} else {
230			window.location.href = window.location.href;
231		}
232	});
233}
234
235function nv_chang_viewtype() {
236	var viewtype = $("#viewtype").val();
237	$.post(nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=main&nocache=' + new Date().getTime(), 'changeviewtype=1&viewtype=' + viewtype, function(res) {
238		if (res != 'OK') {
239			alert(res);
240		} else {
241			window.location.href = window.location.href;
242		}
243	});
244}
245
246function nv_compare(a) {
247	nv_settimeout_disable("compare_" + a, 5E3);
248	$.post(nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=compare&nocache=' + new Date().getTime(), 'compare=1&id=' + a, function(res) {
249		res = res.split("[NV]");
250		if (res[0] != 'OK') {
251			$("#compare_" + res[2]).removeAttr("checked");
252			alert(res[1]);
253		}
254	});
255}
256
257function nv_compare_click() {
258	$.post(nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=compare&nocache=' + new Date().getTime(), 'compareresult=1', function(res) {
259		if (res != 'OK') {
260			alert(res);
261		} else {
262			window.location.href = nv_base_siteurl + "index.php?" + nv_lang_variable + "=" + nv_lang_data + "&" + nv_name_variable + "=" + nv_module_name + "&" + nv_fc_variable + "=compare";
263		}
264	});
265	return;
266}
267
268function nv_compare_del( id, all ) {
269	if (confirm(lang_del_confirm)) {
270		$.post(nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=compare&nocache=' + new Date().getTime(), 'compare_del=1&id=' + id + '&all=' + all, function(res) {
271			if (res == 'OK') {
272				window.location.href = window.location.href;
273			}
274		});
275	}
276	return;
277}
278
279function wishlist(id, object) {
280	$.ajax({
281		type : "GET",
282		url : nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=wishlist_update' + '&id=' + id + "&ac=add&nocache=" + new Date().getTime(),
283		data : '',
284		success : function(data) {
285			var s = data.split('_');
286			if( s[0] == 'OK' )
287			{
288				$(object).addClass('disabled');
289				$('#wishlist_num_id').text( s[1] );
290			}
291			alert_msg(s[2]);
292		}
293	});
294}
295
296function wishlist_del_item(id) {
297	if (confirm(lang_del_confirm)) {
298		$.ajax({
299			type : "GET",
300			url : nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=wishlist_update' + '&id=' + id + "&ac=del&nocache=" + new Date().getTime(),
301			data : '',
302			success : function(data) {
303				var s = data.split('_');
304				if( s[0] == 'OK' )
305				{
306					$('#wishlist_num_id').text( s[1] );
307					$('#item_' + id).remove();
308					if( s[1] == '0' )
309					{
310						window.location.href = window.location.href;
311					}
312				}
313				alert_msg(s[2]);
314			}
315		});
316	}
317}
318
319function payment_point( order_id, checkss, lang_confirm )
320{
321	if (confirm(lang_confirm)) {
322		$.ajax({
323			type : "GET",
324			url : nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=point' + '&paypoint=1&checkss='+checkss+'&order_id=' + order_id + "&nocache=" + new Date().getTime(),
325			data : '',
326			success : function(data) {
327				var s = data.split('_');
328				if( s[0] == 'OK' )
329				{
330					alert( s[1] );
331					window.location.href = window.location.href;
332				}
333				else
334				{
335					alert( s[1] );
336				}
337			}
338		});
339	}
340}
341
342function check_price( id_pro, pro_unit )
343{
344	var data = [];
345    $('.groupid:checked').each(function(){
346    	var value = $(this).val();
347    	if( value != '' ){
348    		data.push( value );
349    	}
350	});
351
352	if( data.length > 0 ){
353		$.ajax({
354			method: "POST",
355			url : nv_base_siteurl + 'index.php?' + nv_lang_variable + '=' + nv_lang_data + '&' + nv_name_variable + '=' + nv_module_name + '&' + nv_fc_variable + '=detail&nocache=' + new Date().getTime(),
356			data: 'check_quantity=1&id_pro='+id_pro+'&pro_unit='+pro_unit+'&listid=' + data,
357			success : function(res) {
358				var s = res.split('_');
359				if( s[0] == 'OK' ){
360					$('#product_number').html( s[2] );
361					$('#pnum, .btn-order').attr('disabled', false);
362					$('#product_number').html( s[2] ).removeClass( 'text-danger' );
363					$('#pnum').attr('max', s[1]);
364				}
365				else{
366					$('#pnum, .btn-order').attr('disabled', true);
367					$('#product_number').html( s[2] ).addClass( 'text-danger' );
368				}
369			}
370		});
371	}
372}
373
374function fix_image_content(){
375	var news = $('.tab-content'), newsW, w, h;
376	if( news.length ){
377		var newsW = news.innerWidth();
378		$.each($('img', news), function(){
379			if( typeof $(this).data('width') == "undefined" ){
380				w = $(this).innerWidth();
381				h = $(this).innerHeight();
382				$(this).data('width', w);
383				$(this).data('height', h);
384			}else{
385				w = $(this).data('width');
386				h = $(this).data('height');
387			}
388
389			if( w > newsW ){
390				$(this).prop('width', newsW);
391				$(this).prop('height', h * newsW / w);
392			}
393		});
394	}
395}
396
397$(window).on('load', function(){
398	fix_image_content();
399});
400
401$(window).on("resize", function() {
402	fix_image_content();
403});

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.