PageSourceSearch

https://we-bird.com/assets/js/order/search-bar.js?v=nxewDAFbfktn1RlKnE2d_U38VfmJOOd5aN9xXvT6VZE

js we-bird.com collected 2026-10-02 01:48:25 UTC 6,184 bytes, 127 lines download raw bytes

1//const parser = new DOMParser();
2
3$(function () {
4    populateSearchFromLocalStorage();
5
6    //$('body').on('click', 'a.open-search-filters', function (e) {
7    //    $("#filterModal").modal('show');
8    //});
9
10    $(document).on("click", "button#desktop_header_search_button,button#mobile_header_search_button", function () {
11        if ($("#desktop_location_name").val().trim() == '') {
12            ToastManager.danger({
13                title: "Search",
14                message: "Enter text to search for a Guide or Place.",
15                bgGradient: true
16            });
17            return;
18        }
19        if ($(this).attr('id') == 'desktop_header_search_button' && ($("#desktop_search_form_checkInDate").val().trim() == '' || $("#desktop_search_form_checkOutDate").val().trim() == '')) {
20            ToastManager.danger({
21                title: "Search",
22                message: "Select dates to search for a Guide or Place.",
23                bgGradient: true
24            });
25            return;
26        }
27        currentPage = 0;
28        isFetching = false; // Prevents multiple clicks
29        hasMoreData = true;
30        $(".desktop-clear-search-button").show();
31        if (window.location.pathname.toLowerCase() == "/") {
32            loadPopularGuides(true);
33        }
34        else {
35            if (!isNullOrWhiteSpace($("#desktop_location_name").val().trim()))
36                sessionStorage.setItem("search_location_name", $("#desktop_location_name").val().trim());
37
38            if (!isNullOrWhiteSpace($("#search_value").val().trim()))
39                sessionStorage.setItem("search_location_value", $("#search_value").val().trim());
40
41            if (!isNullOrWhiteSpace($("#search_location_latitude").val().trim()))
42                sessionStorage.setItem("search_location_latitude", $("#search_location_latitude").val().trim());
43
44            if (!isNullOrWhiteSpace($("#search_location_longitude").val().trim()))
45                sessionStorage.setItem("search_location_longitude", $("#search_location_longitude").val().trim());
46
47            if (!isNullOrWhiteSpace($("#desktop_search_form_checkInDate").val().trim()))
48                sessionStorage.setItem("search_location_checkInDate", $("#desktop_search_form_checkInDate").val().trim());
49
50            if (!isNullOrWhiteSpace($("#desktop_search_form_checkOutDate").val().trim()))
51                sessionStorage.setItem("search_location_checkOutDate", $("#desktop_search_form_checkOutDate").val().trim());
52
53            window.location.href = baseUrl + '/';
54        }
55    });
56
57
58    $('body').on('click', '#sf_search_button', function () {
59        if (window.location.pathname.toLowerCase() == "/") {
60            currentPage = 0;
61            isFetching = false; // Prevents multiple clicks
62            hasMoreData = true;
63            loadPopularGuides(true, true);
64        }
65        else {
66            if (!isNullOrWhiteSpace($("input[name='sf_sort_by']:checked").val()))
67                sessionStorage.setItem(("search_location_sort_by"), $("input[name='sf_sort_by']:checked").val());
68
69            if (!isNullOrWhiteSpace($("input[name='sf_guide_rating']:checked").val()))
70                sessionStorage.setItem(("search_location_guide_rating"), $("input[name='sf_guide_rating']:checked").val());
71
72            var selectedServices = [];
73            $("input[name='sf_guide_service']:checked").each(function () {
74                selectedServices.push($(this).val());
75            });
76            sessionStorage.setItem(("search_location_services"), selectedServices);
77
78            var selectedExpertises = [];
79            $("input[name='sf_guide_expertise']:checked").each(function () {
80                selectedExpertises.push($(this).val());
81            });
82            sessionStorage.setItem(("search_location_expertise"), selectedExpertises);
83
84            if (!isNullOrWhiteSpace($("#sf_guide_name").val().trim()))
85                sessionStorage.setItem(("search_location_guide_name"), $("#sf_guide_name").val().trim());
86
87            if (!isNullOrWhiteSpace($("input[name='sf_guide_gender']:checked").val()))
88                sessionStorage.setItem(("search_location_gender"), $("input[name='sf_guide_gender']:checked").val());
89
90            if (!isNullOrWhiteSpace($("#desktop_search_form_checkInDate").val().trim()))
91                sessionStorage.setItem(("search_location_checkInDate"), $("#mobile_search_form_checkInDate").val().trim());
92
93            if (!isNullOrWhiteSpace($("#desktop_search_form_checkOutDate").val().trim()))
94                sessionStorage.setItem(("search_location_checkOutDate"), $("#mobile_search_form_checkOutDate").val().trim());
95
96            window.location.href = baseUrl + '/';
97        }
98    });
99
100    $('body').on('click', 'a.clear-search-filters,#desktop_clear_search_button', function (e) {
101        if (isMobileDevice) {
102            $("#desktop_location_name").val('');
103            $("#mobile_location_name").val('');
104            $("#search_value").val('');
105            $("#search_location_latitude").val('0');
106            $("#search_location_longitude").val('0');
107            $("#desktop_search_form_checkInDate").val('');
108            $("#mobile_search_form_checkInDate").val('');
109            $("#desktop_search_form_checkOutDate").val('');
110            $("#mobile_search_form_checkOutDate").val('');
111        }
112        clearFilterLocalStorage();
113        clearSearchLocalStorage();
114        dateRangeBtn(moment(), moment(), '#desktop_search_form_daterange', '#desktop_search_form_checkInDate', '#desktop_search_form_checkOutDate');
115        dateRangeBtn(moment(), moment(), '#mobile_search_form_daterange', '#mobile_search_form_checkInDate', '#mobile_search_form_checkOutDate');
116        if (window.location.pathname.toLowerCase() == "/") {
117            currentPage = 0;
118            isFetching = false; // Prevents multiple clicks
119            hasMoreData = true;
120            $(".desktop-clear-search-button").hide();
121            loadPopularGuides(true, true);
122        }
123        else {
124            window.location.href = baseUrl + '/';
125        }
126    });
127});

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.