PageSourceSearch

https://www.testingxperts.com/wp-content/themes/testing-xperts/assets/js/developer.js

js testingxperts.com collected 2026-09-24 10:22:22 UTC 2,644 bytes, 85 lines download raw bytes

1
2function adjustBannerPadding() {
3    var headerHeight = $('#header').outerHeight();
4    $('.banner-section').css('padding-top', headerHeight + 'px');
5}
6
7
8if (!$(".slider_banner_component_tx").length) {
9    adjustBannerPadding();
10    $(window).on('resize', function() {
11        adjustBannerPadding();
12    });   
13}
14
15
16    $(document).ready(function() {
17    
18    /*
19    $('#search-button').click(function (event) {
20            event.stopPropagation();
21            $('.drop-opn').toggle();
22    });
23    */
24
25    $(document).click(function (event) {
26        if (!$(event.target).closest('.tx-global-search').length) {
27            $('.drop-opn').hide();
28        }
29    });
30        
31
32    $('#global-search-input').on('keyup', function() {
33        var searchTerm = $(this).val();
34        
35        if (searchTerm.length <1) {
36            $('#search-suggestions').empty().hide();
37            return;
38        }
39        
40        $.ajax({
41            url: search_suggestions.ajax_url,
42            type: 'POST',
43            data: {
44                action: 'get_search_suggestions',
45                search_term: searchTerm,
46                nonce: search_suggestions.nonce
47            },
48            success: function(response) {
49                if(response.success) {
50                    $('#search-suggestions').html(response.data).show();
51                } else {
52                    $('#search-suggestions').empty().hide();
53                }
54            }
55        });
56    });
57
58  // Prevent form submission if no suggestions found
59    $('#global-search-form').on('submit', function(e) {
60        var searchTerm = $('#global-search-input').val();
61            
62        // Check if suggestions are available or if search term is not empty
63        if ($('#search-suggestions').is(':empty') || searchTerm.length < 1) {
64            e.preventDefault();  // Prevent form submission if no suggestions or empty search term
65            alert('No search suggestions found or the search term is too short.');
66        }
67    });
68
69    // Hide search suggestions when clicking outside of it
70    $(document).on('click', function(event) {
71        // If the clicked element is outside the search input and suggestions
72        if (!$(event.target).closest('#global-search-input').length && 
73            !$(event.target).closest('#search-suggestions').length) {
74            $('#search-suggestions').empty().hide();
75        }
76    });
77
78    // // Optional: Clicking on a suggestion fills the input
79    // $(document).on('click', '.suggestion', function() {
80    //     $('#global-search-input').val($(this).text());
81    //     $('#search-suggestions').empty().hide();
82    // })
83    
84
85});

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.