PageSourceSearch

https://wisconsinsbdc.org/wp-content/themes/understrap/assets/js/custom.js?ver=1.0.2

js wisconsinsbdc.org collected 2026-10-02 04:06:40 UTC 1,919 bytes, 71 lines download raw bytes

1/* SEARCH */
2jQuery(document).ready(function($) {
3
4    $('.widget_search').remove();
5
6    $('#search-window').hide();
7
8    let searchWindowOpened = false;
9
10    function isSearchPage() {
11        return window.location.search.includes("s=");
12    }
13
14    function openSearchWindow() {
15        searchWindowOpened = true;
16        $('#search-window').stop(true, true).fadeIn(function() {
17            $('#search-input').focus();
18        });
19    }
20
21    $('.search-global .search a').click(function(e) {
22        e.preventDefault(); 
23        openSearchWindow();  
24    });
25
26    $('#search-window').on('click', '.close', function(e) {
27        e.preventDefault();
28        searchWindowOpened = false;
29        $('#search-window').fadeOut(function() {
30        });
31    });
32
33    $(document).keydown(function(event) {
34        if (event.key === "Escape") {
35            searchWindowOpened = false;
36            $('#search-window').fadeOut(function() {
37            });
38            focusOnNav(); // Ensure this function is defined elsewhere
39        }
40    });
41
42    $(document).on('click', function(e) {
43        var target = $(e.target);
44
45        if (searchWindowOpened && !target.closest('.search-global').length && !target.closest('#search-window').length) {
46            console.log("Click detected outside search window, closing it");
47            $('#search-window').fadeOut(function() {
48                searchWindowOpened = false;
49            });
50        }
51    });
52
53    $('#search-button').click(function(e) {
54        e.preventDefault();
55
56        var searchQuery = $('#search-input').val();
57        if (searchQuery !== '') {
58            window.location.href = '/?s=' + encodeURIComponent(searchQuery);
59        }
60    });
61
62    // Special logic for the search results page
63    if (isSearchPage()) {
64
65        $('.search-global .search a').click(function(e) {
66            e.preventDefault();
67            openSearchWindow();
68        });
69    }
70
71});

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.