PageSourceSearch

https://www.zenith-amiens.fr/_assets/d435b072ff30cc3dab54430e6df3ccc0/JavaScript/fields.js?1753344773

js zenith-amiens.fr collected 2026-10-05 02:41:33 UTC 1,190 bytes, 34 lines download raw bytes

1document.addEventListener('DOMContentLoaded', () => {
2  const form = document.querySelector('.search--section');
3  if (!form) return;
4
5  const suggestions = [...form.querySelectorAll('#solr_suggestions option')].map(opt => opt.value);
6
7  const fields = form.querySelectorAll('.autocomplete-solr_suggestions');
8  fields.forEach(input => {
9      new autoComplete({
10          selector: () => input,
11          data: { src: suggestions },
12          threshold: 1,
13          resultItem: { highlight: true },
14          events: {
15              input: {
16                  selection(event) {
17                      input.value = event.detail.selection.value;
18                  }
19              }
20          },
21          resultsList : {
22              element: (list, data) => {
23                  if (!data.results.length) {
24                      const message = document.createElement("div");
25                      message.setAttribute("class", "no_result");
26                      message.innerHTML = `Aucun résultat trouvé pour <mark>${data.query}</mark>`;
27                      list.prepend(message);
28                  }
29              },
30              noResults: true,
31          },
32      });
33  });
34});

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.