1// config.js - shared functions 2 3const UTILS_CONFIG = { 4 URLS: { 5 SEARCH: '/search/results' 6 } 7}; 8 9export const searchUtils = { 10 handleSearchCancel: (input, cancel, hideButton) => { 11 input.value = ''; 12 if (hideButton) { 13 cancel.style.display = 'none'; 14 } 15 }, 16 17 handleSearchInput: (input, cancel) => { 18 cancel.style.display = input.value.trim() ? 'block' : 'none'; 19 }, 20 21 handleSearchSubmit: (form, input) => { 22 const pathSegments = window.location.pathname.split('/'); 23 const potentialLang = pathSegments[1]; 24 const langPrefix = (potentialLang && potentialLang.length === 2) ? `/${potentialLang}` : ''; 25 26 // Build the full search URL. 27 const finalURL = `${langPrefix}${UTILS_CONFIG.URLS.SEARCH}?q=${encodeURIComponent(input.value)}`; 28 form.action = finalURL; 29 }, 30};
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.