PageSourceSearch

https://www.forbesindustries.com/wp-content/themes/forbes-astra/js/scripts.js?ver=1.1.33

js forbesindustries.com collected 2026-10-08 05:47:30 UTC 5,642 bytes, 131 lines download raw bytes

1jQuery(document).ready(function($) {
2  if ($('body').is('.woocommerce-cart')) {
3      // Check if the current page is the cart page
4      $('.tm-clear-cart-button').val('Empty quote list');
5      $('.button[name="update_cart"]').val('Update quote list');
6  }
7});
8
9jQuery(document).ready(function($) {
10  // Unbind the plugin's event handlers
11  $(document).off('click', '.bapf_ocolaps .bapf_colaps_togl, .bapf_ccolaps .bapf_colaps_togl');
12  $(document).off('bapf_ocolaps', '.bapf_sfilter.bapf_ocolaps, .bapf_sfilter.bapf_ccolaps');
13  $(document).off('bapf_ccolaps', '.bapf_sfilter.bapf_ocolaps, .bapf_sfilter.bapf_ccolaps');
14
15  // Your event handlers here
16  // SHOW/HIDE FILTERS WITH EASED ANIMATION
17  $(document).on('click', '.bapf_ocolaps .bapf_colaps_togl, .bapf_ccolaps .bapf_colaps_togl', function(e) {
18    e.preventDefault();
19    if ($(this).closest('.bapf_ocolaps, .bapf_ccolaps').is('.bapf_ocolaps')) {
20        $(this).closest('.bapf_ocolaps, .bapf_ccolaps').trigger('bapf_ocolaps');
21    } else {
22        $(this).closest('.bapf_ocolaps, .bapf_ccolaps').trigger('bapf_ccolaps');
23    }
24  });
25
26  $(document).on('bapf_ocolaps', '.bapf_sfilter.bapf_ocolaps, .bapf_sfilter.bapf_ccolaps', function(e) {
27    $(this).removeClass('bapf_ocolaps').addClass('bapf_ccolaps');
28    $(this).find('.bapf_body').first().slideDown(350, 'swing');
29  });
30
31  $(document).on('bapf_ccolaps', '.bapf_sfilter.bapf_ocolaps, .bapf_sfilter.bapf_ccolaps', function(e) {
32    $(this).addClass('bapf_ocolaps').removeClass('bapf_ccolaps');
33    $(this).find('.bapf_body').first().slideUp(350, 'swing');
34  });
35});
36
37window.addEventListener('load', function() {
38  var subcatGridOuter = document.querySelector('.subcat_grid_outer');
39  var subcatGrid = document.querySelector('.subcat_grid');
40
41  // Only proceed if both elements exist
42  if (subcatGridOuter && subcatGrid) {
43    function checkScroll() {
44      var scrollLeft = subcatGrid.scrollLeft;
45      var scrollWidth = subcatGrid.scrollWidth;
46      var clientWidth = subcatGrid.clientWidth;
47
48      subcatGridOuter.classList.remove('scroll-left', 'scroll-right');
49
50      if (scrollLeft > 0) {
51        subcatGridOuter.classList.add('scroll-left');
52      }
53
54      if (scrollWidth - scrollLeft > clientWidth) {
55        subcatGridOuter.classList.add('scroll-right');
56      }
57    }
58
59    subcatGrid.addEventListener('scroll', checkScroll);
60    window.addEventListener('resize', checkScroll);
61
62    // Check initial scroll position
63    checkScroll();
64  }
65});
66
67// Add dark overlay to content area when mega menu is open
68jQuery(document).ready(function($) {
69  $('#mega-menu-primary > li.mega-menu-megamenu').hover(
70      function() { // Mouse enter
71          $('#content').addClass('dim');
72      }, 
73      function() { // Mouse leave
74          $('#content').removeClass('dim');
75      }
76  );
77});
78
79jQuery(document).ready(function ($) {
80    function animateOnScroll() {
81        $('.anim-fade-up, .anim-fade-in, .anim-zoom-in, .anim-slide-left, .anim-slide-right').each(function () {
82            var $el = $(this);
83            var elementTop = $el.offset().top;
84            var windowBottom = $(window).scrollTop() + $(window).height();
85
86            if (elementTop < windowBottom - 60 && !$el.hasClass('in-view')) {
87                let delay = $el.data('delay') || 0;
88                $el.css('--delay', delay + 's');
89
90                setTimeout(() => {
91                    $el.addClass('in-view');
92                }, delay * 1000);
93            }
94        });
95    }
96
97    $(window).on('scroll resize', animateOnScroll);
98    animateOnScroll();
99});
100
101// Embed search form at top of mobile menu and remove legacy trigger item
102jQuery(function($) {
103  var $menu = $('#ast-hf-mobile-menu');
104  if ($menu.length) {
105    // Remove legacy search trigger item if present
106    $menu.find('li.mobile-search-trigger').remove();
107
108    // Build search form item
109    var searchLi = document.createElement('li');
110    searchLi.className = 'menu-item mobile-search-item';
111    searchLi.setAttribute('style', 'padding:0 20px;');
112    searchLi.innerHTML = (
113      '<form role="search" method="get" class="mobile-menu-search-form" action="' + window.location.origin + '/" style="width:100%;">
113' +
114        '<label class="screen-reader-text" for="ast-mobile-menu-search">Search for:</label>' +
115        '<div class="mobile-menu-search-fields" style="position:relative;width:100%;">' +
116          '<input type="search" id="ast-mobile-menu-search" class="search-field" placeholder="Search products" value="" name="s" autocomplete="off" style="width:100%;padding-right:42px;height:44px; background-color: #f5f5f5; border-radius: 4px; margin-top: 10px;" />' +
117          '<input type="hidden" name="post_type" value="product" />' +
118          '<button type="submit" class="search-submit" aria-label="Search" style="position:absolute;right:8px;top:56%;transform:translateY(-50%);background:none;border:0;padding:4px;cursor:pointer;line-height:0;color:#3a3a3a;display:flex;align-items:center;justify-content:center;">' +
119            '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="display:block;">' +
120              '<circle cx="11" cy="11" r="8"></circle>' +
121              '<line x1="21" y1="21" x2="16.65" y2="16.65"></line>' +
122            '</svg>' +
123          '</button>' +
124        '</div>' +
125      '</form>'
126    );
127
128    // Prepend to the start of the menu
129    $menu.prepend(searchLi);
130  }
131});

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.