PageSourceSearch

https://outofthebox.pl/app/themes/inpost/js/theme.js

js outofthebox.pl collected 2026-10-05 05:17:02 UTC 4,829 bytes, 108 lines download raw bytes

1/*--------------------------------------------------------------
2Theme JS
3--------------------------------------------------------------*/
4
5jQuery(function($) {
6    // Close offcanvas on click a, keep .dropdown-menu open
7    /**
8    $('.offcanvas a:not(.dropdown-toggle, .remove_from_cart_button)').on('click', function () {
9        $('.offcanvas').offcanvas('hide');
10    });
11    **/
12
13    // Search collapse button hide if empty
14    if ($('#collapse-search').children().length === 0) {
15        $('.top-nav-search-md, .top-nav-search-lg').remove();
16    }
17
18    // Searchform focus
19    $('#collapse-search').on('shown.bs.collapse', function() {
20        $('.top-nav-search input:first-of-type').trigger('focus');
21    });
22
23    // Close collapse if searchform loses focus
24    $('.top-nav-search input:first-of-type').on('focusout', function() {
25        $('#collapse-search').collapse('hide');
26    });
27
28    // Scroll to top Button
29    const scrollBtn = document.querySelector('.top-button');
30    const btnVisibility = () => {
31        if (window.scrollY > 500) {
32            scrollBtn.style.visibility = 'visible';
33            scrollBtn.classList.add('visible');
34        } else {
35            scrollBtn.style.visibility = 'hidden';
36            scrollBtn.classList.remove('visible');
37        }
38    };
39    document.addEventListener('scroll', () => scrollBtn && btnVisibility());
40
41    // div height, add class to your content
42    $('.height-50').css('height', 0.5 * $(window).height());
43    $('.height-75').css('height', 0.75 * $(window).height());
44    $('.height-85').css('height', 0.85 * $(window).height());
45    $('.height-100').css('height', 1.0 * $(window).height());
46
47    // IE Warning
48    if (window.document.documentMode) {
49        let IEWarningDiv = document.createElement('div');
50        IEWarningDiv.setAttribute('class', 'position-fixed top-0 end-0 bottom-0 start-0 d-flex justify-content-center align-items-center');
51        IEWarningDiv.setAttribute('style', 'background:white;z-index:1999');
52        IEWarningDiv.innerHTML = '<div style="max-width: 90vw;">' + '<h1>' + bootscore.ie_title + '</h1>' + '<p className="lead">' + bootscore.ie_limited_functionality + '</p>' + '<p className="lead">' + bootscore.ie_modern_browsers_1 + bootscore.ie_modern_browsers_2 + bootscore.ie_modern_browsers_3 + bootscore.ie_modern_browsers_4 + bootscore.ie_modern_browsers_5 + '</p>' + '</div>';
53        document.body.appendChild(IEWarningDiv);
54    }
55    // IE Warning End
56});
57
58jQuery(function($) {
59
60    // Review Checkbox Products
61    $('.comment-form-cookies-consent').addClass('form-check');
62    $('#wp-comment-cookies-consent').addClass('form-check-input');
63    $('.comment-form-cookies-consent label').addClass('form-check-label');
64
65    // Checkout Form Validation
66    /**
67    $('body').on('blur change', '.form-row input', function () {
68        $('.woocommerce form .form-row.woocommerce-validated .select2-container, .woocommerce form .form-row.woocommerce-validated input.input-text, .woocommerce form .form-row.woocommerce-validated select, .woocommerce form .form-row.woocommerce-validated .form-check-input[type=checkbox]').removeClass('is-invalid').addClass('is-valid');
69        $('.woocommerce form .form-row.woocommerce-invalid .select2-container, .woocommerce form .form-row.woocommerce-invalid input.input-text, .woocommerce form .form-row.woocommerce-invalid select, .woocommerce form .form-row.woocommerce-invalid .form-check-input[type=checkbox]').removeClass('is-valid').addClass('is-invalid');
70    });
71    **/
72
73    // Single-product Tabs
74    // First item active
75    $('.wc-tabs .nav-item:first-child a').addClass('active');
76
77    // Set active class to nav-link
78    $('body').on('click', '.wc-tabs li a', function (e) {
79        e.preventDefault();
80        var $tab = $(this);
81        var $tabs_wrapper = $tab.closest('.wc-tabs-wrapper, .woocommerce-tabs');
82        var $tabs = $tabs_wrapper.find('.wc-tabs');
83
84        $tabs.find('li a').removeClass('active');
85        $tabs_wrapper.find('.wc-tab, .panel:not(.panel .panel)').hide();
86
87        $tab.closest('li a').addClass('active');
88        $tabs_wrapper.find($tab.attr('href')).show();
89    });
90    // Single-product Tabs End
91
92    // eslint-disable-next-line camelcase
93    jQuery(document.body).on('removed_from_cart',
94        // eslint-disable-next-line camelcase
95        function(e, response, cart_hash, button) {
96            if (button.hasClass('checkout-review__remove-button')) {
97                $(document.body).trigger('update_checkout', {
98                    update_shipping_method: false,
99                });
100            }
101        }
102    );
103}); // jQuery End
104
105document.addEventListener('DOMContentLoaded', () => {
106    let orderButton = document.querySelector('.style-ordering__select');
107    orderButton && NiceSelect.bind(orderButton, { searchable: false });
108});

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.