PageSourceSearch

https://keskisuomenvihreat.fi/content/themes/vihreat/assets/js/search.js

js keskisuomenvihreat.fi collected 2026-10-03 01:01:59 UTC 1,808 bytes, 46 lines download raw bytes

1jQuery(document).ready(function ($) {
2    // Inject language switcher
3    function injectLanguageSwitcher() {
4        const targetContainer = $('.artcloud_mobile_menu .wp-block-navigation__responsive-container-content .wp-block-navigation__container');
5
6        if (targetContainer.length && wpData.languageSwitcherShortcode && !targetContainer.find('.language-mobile-menu').length) {
7            targetContainer.append(wpData.languageSwitcherShortcode);
8        }
9    }
10
11    // Run once on load
12    injectLanguageSwitcher();
13
14    // Also run when the menu button is clicked, in case the container is rendered dynamically
15    $(document).on('click', '.wp-block-navigation__responsive-container-open', function () {
16        setTimeout(injectLanguageSwitcher, 100);
17    });
18
19    jQuery(function ($) {
20        $('.wp-block-search__input').each(function () {
21            var $input = $(this);
22            if ($input.attr('aria-hidden') === 'true') {
23                $input.attr('tabindex', '-1');
24            }
25        });
26
27        $(document).on('click', '.wp-block-search__button', function (e) {
28            var $form = $(this).closest('.wp-block-search');
29            var $input = $form.find('.wp-block-search__input');
30
31            $form.removeClass('wp-block-search__searchfield-hidden');
32            $input.attr('aria-hidden', 'false').attr('tabindex', '0').focus();
33        });
34
35        $(document).on('click', function (e) {
36            if (!$(e.target).closest('.wp-block-search').length) {
37                var $form = $('.wp-block-search');
38                var $input = $form.find('.wp-block-search__input');
39
40                $form.addClass('wp-block-search__searchfield-hidden');
41                $input.attr('aria-hidden', 'true').attr('tabindex', '-1').blur();
42            }
43        });
44    });
45
46})

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.