PageSourceSearch

https://plainecommune.fr/_assets/cffc4cc2cab56e8b9611d2e1ccda4d2e/…/JavaScript/solrSearchQuery.js?1765808892

js plainecommune.fr collected 2026-10-01 11:49:07 UTC 1,597 bytes, 68 lines download raw bytes

1(function() {
2	'use strict';
3	
4	function getQueryFromUrl() {
5		var urlParams = new URLSearchParams(window.location.search);
6		return urlParams.get('tx_solr[q]') || urlParams.get('q') || null;
7	}
8	
9	function updateSearchQuery() {
10		var searchQuerySpan = document.getElementById('tx-solr-search-query');
11		if (!searchQuerySpan) {
12			return false;
13		}
14		
15		if (searchQuerySpan.textContent && searchQuerySpan.textContent.trim()) {
16			return true;
17		}
18		
19		var queryValue = null;
20		
21		var searchInput = document.getElementById('searchform_results');
22		if (searchInput && searchInput.value) {
23			queryValue = searchInput.value;
24		}
25		
26		if (!queryValue) {
27			queryValue = getQueryFromUrl();
28			if (queryValue) {
29				queryValue = decodeURIComponent(queryValue);
30			}
31		}
32		
33		if (!queryValue && searchInput && searchInput.getAttribute('data-search-query')) {
34			queryValue = searchInput.getAttribute('data-search-query');
35		}
36		
37		if (queryValue) {
38			searchQuerySpan.textContent = queryValue;
39			return true;
40		}
41		
42		return false;
43	}
44	
45	if (updateSearchQuery()) {
46		return; // Success, we're done
47	}
48	
49	if (document.readyState === 'loading') {
50		var attempts = 0;
51		var maxAttempts = 20; 
52		
53		var intervalId = setInterval(function() {
54			attempts++;
55			if (updateSearchQuery() || attempts >= maxAttempts) {
56				clearInterval(intervalId);
57			}
58		}, 5);
59		
60		document.addEventListener('DOMContentLoaded', function() {
61			clearInterval(intervalId);
62			updateSearchQuery();
63		});
64	} else {
65		setTimeout(updateSearchQuery, 10);
66	}
67})();
68

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.