PageSourceSearch

https://www.prevost.eu/modules/custom/prevost_search/libraries/js/ajax.js?v=0.2

js prevost.eu collected 2026-10-08 07:15:28 UTC 1,890 bytes, 70 lines download raw bytes

1(function ($, Drupal, drupalSettings) {
2  let result_search = $('#__result-search');
3  let overlay_search = $('#__search_overlay');
4  let listProducts = $('.__listProducts');
5  let listDocs = $('.__listDocs');
6  let searchWrap = $('.__searchWrap');
7  let searchTop = $('.__searchTop');
8  result_search.hide();
9
10  $('.__headerSearchBtn').on('click', function () {
11    searchWrap.toggleClass('active');
12  });
13
14  $('#__search_api').keyup(_.debounce(function () {
15    let val = $(this).val();
16    $.ajax({
17      url: $(this).data('path-ajax'),
18      dataType: "json",
19      type: "GET",
20      async: true,
21      data: {
22        'search_words': Drupal.checkPlain(val)
23      },
24      success: function (data) {
25        $('#__result-search .__product').remove();
26        $('#__result-search .__documentation').remove();
27        let ok = false;
28
29        if (data.docs !== undefined) {
30          ok = true;
31          listDocs.prepend(data.docs);
32        }
33
34        if (data.products !== undefined) {
35          ok = true;
36          listProducts.prepend(data.products);
37        }
38
39        if (ok) {
40          result_search.show();
41          result_search.addClass('active');
42          // searchWrap.addClass('active');
43          searchTop.addClass('searchOpen');
44
45          overlay_search.show();
46        } else {
47          result_search.hide();
48          result_search.removeClass('active');
49          // searchWrap.removeClass('active');
50          searchTop.removeClass('searchOpen');
51
52          overlay_search.hide();
53        }
54
55      },
56      error: function (xhr, exception) {
57        console.error(xhr);
58      }
59    });
60  }, 800));
61
62  $(overlay_search).on('click', function () {
63    result_search.hide();
64    result_search.removeClass('active');
65    searchWrap.removeClass('active');
66    searchTop.removeClass('searchOpen');
67    overlay_search.hide();
68  });
69
70})(jQuery, Drupal, drupalSettings);

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.