PageSourceSearch

https://www.enjoyprepaid.com/js/common/search-products.js?1281

js enjoyprepaid.com collected 2026-10-02 08:04:34 UTC 5,448 bytes, 140 lines download raw bytes

1
2
3
4	//this function replicates the functionality of com.nobelglobe.common.view.function.JstlFunction.chooseUrl(String, String, Region, Region)
5	function selectURL(urlDomestic, urlInternational, defaultSourceRegionId, sourceRegionId) {
6		if (defaultSourceRegionId == sourceRegionId) {
7			return urlDomestic;
8		} else {
9			return urlInternational;
10		}
11	};
12	
13	function doOnSubmitSearchForm(defaultSourceRegion) {
14
15		var searchForm = $('[name=searchForm]')[0];
16		searchForm.action = selectURL('/eshop/product/redirect/viewProducts.htm', '/eshop/product/redirect/international/viewProducts.htm', defaultSourceRegion, $("#sourceRegion\\.id").val());
17		
18		setInputValueFromSelectOptionTitle("sourceRegion.name", $("#sourceRegion\\.id")[0]);
19		setInputValueFromSelectOptionTitle("destinationRegion.name", $("#destinationRegion\\.id")[0]);
20		
21    	searchForm.submit();
22    };
23    
24	function doOnSubmitSearchFormWithTabsSelection(defaultSourceRegion, tabParameter) {
25
26		var searchForm = $('[name=searchForm]')[0];
27		searchForm.action = selectURL('/eshop/product/redirect/viewProducts.htm' + '\#' + tabParameter, '/eshop/product/redirect/international/viewProducts.htm'  + '\#' + tabParameter, defaultSourceRegion, $("#sourceRegion\\.id").val());
28		
29		setInputValueFromSelectOptionTitle("sourceRegion.name", $("#sourceRegion\\.id")[0]);
30		setInputValueFromSelectOptionTitle("destinationRegion.name", $("#destinationRegion\\.id")[0]);
31		
32    	searchForm.submit();
33    };
34    
35    function doOnSubmitSearchFormDefault() {
36
37		var searchForm = $('[name=searchForm]')[0];
38		
39		setInputValueFromSelectOptionTitle("sourceRegion.name", $("#sourceRegion\\.id")[0]);
40		setInputValueFromSelectOptionTitle("destinationRegion.name", $("#destinationRegion\\.id")[0]);
41		
42    	searchForm.submit();
43    };
44    
45    function formatNamesAndSubmitSearchForm(defaultSourceRegion){
46    	var sourceRegionId = $("#sourceRegion\\.id").val();
47		var destinationRegionId = $("#destinationRegion\\.id").val();
48    	
49    	var sourceRegionName = getAsyncEscapedName($("#sourceRegion\\.id option:selected").text());
50    	var destinationRegionName = getAsyncEscapedName($("#destinationRegion\\.id option:selected").text());
51    	if (sourceRegionName.indexOf("----") >= 0 || destinationRegionName.indexOf("----") >= 0) {
52    		return;
53    	}
54    	
55    	//set the source and destination region names
56    	$("#sourceRegion\\.name").val(sourceRegionName);
57    	$("#destinationRegion\\.name").val(destinationRegionName);
58    	
59    	document.searchForm.action = selectURL('/eshop/product/redirect/viewProducts.htm', '/eshop/product/redirect/international/viewProducts.htm', defaultSourceRegion, $("#sourceRegion\\.id").val());
60    	document.searchForm.submit();
61    }
62  
63    function formatNamesAndSubmitSearchFormRedirect(actionUrl){
64    	var sourceRegionId = $( "[name='sourceRegion\\.id']" ).val();
65		var destinationRegionId = $( "[name='destinationRegion\\.id']" ).val();
66    	
67		$.ajax({
68			   async: false,
69			   type: "GET",
70			   url: actionUrl,
71			   data: ({ "sourceRegion.id": sourceRegionId,
72				   		"destinationRegion.id": destinationRegionId,
73				   		"encodeUrl": true
74			   		}),
75			   success: function(data){
76				   document.searchForm.action = data['encodedUrl'];
77			   }
78			 });
79
80    	document.searchForm.submit();
81    }
82
83    function formatNamesAndSubmitSearchFormCookieRedirect(actionUrl, sourceRegionCookieName){
84    	var sourceRegionId = $( "[name='sourceRegion\\.id']" ).val();
85    	document.cookie = sourceRegionCookieName + "=" + sourceRegionId + "; path=/";
86
87    	var destinationRegionId = $( "[name='destinationRegion\\.id']" ).val();
88    	
89		$.ajax({
90			   async: false,
91			   type: "GET",
92			   url: actionUrl,
93			   data: ({ "destinationRegion.id": destinationRegionId,
94				   		"encodeUrl": true
95			   		}),
96			   success: function(data){
97				   document.searchForm.action = data['encodedUrl'];
98			   }
99			 });
100
101    	document.searchForm.submit();
102    }
103
104    
105    function formatNamesAndSubmitSearchForm(defaultSourceRegion, url1, url2){
106    	var sourceRegionId = $("#sourceRegion\\.id").val();
107		var destinationRegionId = $("#destinationRegion\\.id").val();
108    	
109    	var sourceRegionName = getAsyncEscapedName($("#sourceRegion\\.id option:selected").text());
110    	var destinationRegionName = getAsyncEscapedName($("#destinationRegion\\.id option:selected").text());
111    	if (sourceRegionName.indexOf("----") >= 0 || destinationRegionName.indexOf("----") >= 0) {
112    		return;
113    	}
114    	
115    	//set the source and destination region names
116    	$("#sourceRegion\\.name").val(sourceRegionName);
117    	$("#destinationRegion\\.name").val(destinationRegionName);
118    	
119    	document.searchForm.action = selectURL(url1, url2, defaultSourceRegion, $("#sourceRegion\\.id").val());
120    	document.searchForm.submit();
121    }
122    
123    function formatNamesAndSubmitSearchFormCookie(sourceRegionCookieName){
124    	var sourceRegionId = $("#sourceRegionId").val();
125    	document.cookie = sourceRegionCookieName + "=" + sourceRegionId + "; path=/";
126
127    	var destinationRegionId = $("#destinationRegion\\.id").val();
128    	
129    	var destinationRegionName = getAsyncEscapedName($("#destinationRegion\\.id option:selected").text());
130    	if (destinationRegionName.indexOf("----") >= 0) {
131    		return;
132    	}
133    	
134    	//set the source and destination region names
135    	$("#destinationRegion\\.name").val(destinationRegionName);
136    	document.searchForm.submit();
137    }
138
139    
140    

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.