PageSourceSearch

https://localcounciljobs.gov.uk/combo?browserId=chrome&minifierTyp…estion.web%2Fjs%2Fsearch.js&t=1790928354000

js localcounciljobs.gov.uk collected 2026-10-06 01:30:51 UTC 4,638 bytes, 183 lines download raw bytes

1AUI.add(
2
3	'com-placecube-cookieconsent',
4
5	function(A) {
6
7		var PPID = 'com_placecube_cookieconsent_web_portlet_CookieConsentPortlet';
8
9		var CookieConsent = {
10
11			initCookieConsentForm: function() {
12
13				$(document).on('click', '.btn-cookie-consent', function(e) {
14					event.preventDefault();
15
16					var consentResponse = $(e.target).attr('data-cookie-consent');
17
18					var selected = $('input[type="radio"][name="measure-website-use"]:checked');
19					if (selected.length > 0) {
20						consentResponse = selected.val();
21					}
22					A.CookieConsent.updateConsent(consentResponse);
23
24				});
25			},
26			
27			configureDoNotTrack: function(cookiesAccepted){
28				var doNotTrack = cookiesAccepted == 'false';
29				window['ac_client_disable_tracking'] = doNotTrack;
30			},
31
32			updateConsent: function(consentResponse) {
33
34				var url = Liferay.PortletURL.createResourceURL();
35				url.setPortletId(PPID);
36				url.setResourceId("/cookie-consent/update-consent");
37				url.setParameter("consentGiven", consentResponse);
38
39				A.io.request(url.toString(), {
40
41					on: {
42
43						success: function() {
44							A.CookieConsent.configureDoNotTrack(consentResponse);
45							if($(".cookie-consent-updated-banner").length > 0){
46								$(".cookie-consent-updated-banner").show();
47								$(window).scrollTop(0);
48							} else {
49								location.reload();
50							}
51						}
52
53					}
54
55				});
56
57			},
58
59			initCookieHideAction: function(namespace){
60				$('#' + namespace + 'cookie-consent-close').on('click', function() {
61					$('.cookie-consent__modal-mode').addClass('hide');
62					sessionStorage.setItem("isCookieModalClosed", true);
63				})
64
65				let isCookieModalClosed = (sessionStorage.getItem("isCookieModalClosed") === 'true');
66
67				if (!isCookieModalClosed) {
68					$('.cookie-consent__modal-mode').removeClass('hide');
69				}
70			}
71
72		};
73
74		A.CookieConsent = CookieConsent;
75	},
76	'',
77	{
78		requires: ['aui-io', 'liferay-portlet-url']
79	}
80);
81
82AUI().ready('aui-base','autocomplete-list','datasource-io','liferay-portlet-url',function(A){
83	
84	A.on('resize',function(event){
85		resetSearchSuggestionAutoComplete();
86	});
87	
88	Liferay.after('endNavigate',function(){
89		resetSearchSuggestionAutoComplete();
90	});
91	
92	A.all(".search-bar-keywords-input, input[name='keywords'], .keywords-input").each(function(node, index, list){
93		
94		node.on('focus',function(){
95			
96			var inputNode = "#" + this.get('id');
97				
98			if(typeof(Liferay.component(inputNode)) === "undefined"){
99			
100				
101				var TPL_BLOCK_SUGGESTION_ROW = '<div class="nameplate">' +
102												'<div class="nameplate-content">' +
103													'{term}' +
104												'</div>' +
105											'</div>';	
106				var dataSource = new A.DataSource.IO(
107						{
108						source: getResourceUrlAsString()
109						}
110					);
111				
112				var autocomplete = new A.AutoCompleteList({
113					activateFirstItem: false,
114					inputNode: inputNode,
115					maxResults: 10,
116					minQueryLength: 1,
117					on: {
118						select: function(event) {
119							var result = event.result.raw;
120							A.one(inputNode).val(result.term.replace(/(<([^>]+)>)/gi, ""));
121							var formName = A.one(inputNode).ancestor("form").get('name');
122							document.forms[formName].submit();
123						}
124					},		
125					render: 'true',
126					source: dataSource,
127					requestTemplate: '&_com_placecube_digitalplace_local_search_suggestion_web_portlet_SearchSuggestionPortlet_keywords={query}',
128					resultFormatter: function(query, results){
129			
130						var resultListEntries = A.Array.map(results, function(result){
131			
132							var resultListEntryMarkUp  = A.Lang.sub(
133											TPL_BLOCK_SUGGESTION_ROW,
134											{
135												term: result.raw.term
136											}
137										);
138			
139			
140							return resultListEntryMarkUp;
141						});
142			
143						return resultListEntries;
144					},
145					resultListLocator: function (response) {
146						return A.JSON.parse(response[0].responseText);
147					},
148					resultTextLocator: function (result) {
149						return '';
150					}		
151				});
152				
153				Liferay.component(inputNode, autocomplete);
154
155			}
156		});
157		
158		
159	});
160	
161	function getResourceUrlAsString(){
162		var resourceURL = Liferay.PortletURL.createResourceURL();
163		resourceURL.setParameter("p_p_id", 'com_placecube_digitalplace_local_search_suggestion_web_portlet_SearchSuggestionPortlet');
164		
165		return resourceURL.toString();
166	}
167
168	function resetSearchSuggestionAutoComplete(){
169		
170		A.all(".search-bar-keywords-input, input[name='keywords'], .keywords-input").each(function(node, index, list){
171			
172			var inputNode = "#" + this.get('id');
173			var component = Liferay.component(inputNode);
174			
175			if(typeof(component) != "undefined"){
176				component.destroy(true);
177				Liferay.destroyComponent(inputNode);
178			}
179			
180		});
181	}
182});
183

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.