Lines Matching full:search
17 // Display inline search results under the search modal. After the user types
18 // text in the search box, results are shown underneath the text input box.
19 // The search is restarted after each keypress.
23 // Don't interfere with the default search UX on /search.html.
24 if (window.location.pathname.endsWith('/search.html')) {
27 // The template //docs/layout/page.html ensures that Search is always
30 if (!Search) {
33 // Destroy the previous search container and create a new one.
37 const searchInput = document.querySelector('#search-input');
39 // types stuff in the search modal textbox.
42 // Don't search when there's nothing in the query textbox.
46 // Don't search if there is no detectable change between
48 // Tab to start navigating the search results.
52 // The user has changed the search query. Delete the old results
55 // Debounce so that the search only starts only when the
64 Search.performSearch(query);
66 // Send the search query to Google Analytics.
67 // https://developers.google.com/analytics/devguides/collection/ga4/reference/events#search
71 gtag('event', 'search', { search_term: query });
77 // Deletes the old custom search results container and recreates a
80 // Note that Sphinx assumes that searches are always made from /search.html
81 // so there's some safeguard logic to make sure the inline search always
86 let results = document.querySelector('#search-results');
91 results.classList.add('pw-search-results');
92 results.id = 'search-results';
94 let modal = document.querySelector('.search-button__search-container');
99 // As Sphinx populates the search results, this observer makes sure that
103 document.querySelectorAll('#search-results .search a'),
119 // something into the search textbox. resultsObserver just waits for
126 const container = document.querySelector('#search-results .search');