PageSourceSearch

https://blickpunkt-brandenburg.de/wp-content/themes/wochenblaetter-theme/js/js_ajax_file.js?ver=7.1.2

js blickpunkt-brandenburg.de collected 2026-10-02 07:21:24 UTC 3,049 bytes, 87 lines download raw bytes

1$(document).ready(function () {
2    $('.btn-start-search').on('click', function () {
3        const query = $('#search-text').val().trim();
4
5        if (query === '') {
6            $('#search-text').addClass('is-invalid');
7            return;
8        }
9
10        window.location.href = '/?s=' + encodeURIComponent(query);
11    });
12
13    $('#search-text').on('keydown', function (e) {
14        if (e.key === 'Enter') {
15            e.preventDefault();
16            $('.btn-start-search').trigger('click');
17        }
18    });
19});
20
21(function () {
22    'use strict';
23
24    var headerArea = document.getElementById('headerArea');
25    if (!headerArea) {
26        return;
27    }
28
29    var lastScrollY = window.pageYOffset || document.documentElement.scrollTop || 0;
30    var ticking = false;
31    var threshold = 120; // ab dieser Scrolltiefe werden Hide/Show-Effekte aktiv
32    var upScrollBuffer = 30; // Mindest-Abstand in Pixeln, den der Nutzer nach oben scrollen muss, bevor der Header eingeblendet wird (leicht änderbar)
33    var isFixed = false;
34
35    function updateHeader(currentScrollY) {
36        // 1. GANZ OBEN → alles zurück in den Normalzustand
37        if (currentScrollY === 0) {
38            headerArea.classList.remove('is-fixed', 'is-hidden');
39            document.body.classList.remove('has-fixed-header');
40            isFixed = false;
41            lastScrollY = currentScrollY;
42            ticking = false;
43            return;
44        }
45
46        // 2. Scrollrichtung bestimmen (aber erst ab einer gewissen Tiefe „aggressiv“ werden)
47        if (currentScrollY > lastScrollY + 5 && currentScrollY > threshold) {
48            // Runterscrollen → Header ausblenden
49            headerArea.classList.add('is-hidden');
50            // Weißes Loch vermeiden: Padding oben weg-animieren
51            if (isFixed) {
52                document.body.classList.remove('has-fixed-header');
53            }
54        } else if (currentScrollY < lastScrollY - upScrollBuffer && currentScrollY > threshold) {
55            // Hochscrollen → Header einblenden
56
57            // Beim ersten Mal fixieren + Body-Offset setzen
58            if (!isFixed) {
59                headerArea.classList.add('is-fixed');
60                document.body.classList.add('has-fixed-header');
61
62                var height = headerArea.offsetHeight;
63                document.documentElement.style.setProperty('--header-area-height', height + 'px');
64
65                isFixed = true;
66            }
67
68            headerArea.classList.remove('is-hidden');
69        }
70
71        lastScrollY = currentScrollY;
72        ticking = false;
73    }
74
75    function onScroll() {
76        var currentScrollY = window.pageYOffset || document.documentElement.scrollTop || 0;
77
78        if (!ticking) {
79            window.requestAnimationFrame(function () {
80                updateHeader(currentScrollY);
81            });
82            ticking = true;
83        }
84    }
85
86    window.addEventListener('scroll', onScroll, { passive: true });
87})();

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.