PageSourceSearch

https://ed-era.com/wp-content/themes/edera/build/blog.min.js?ver=1790850744

js ed-era.com collected 2026-10-01 10:33:30 UTC 5,742 bytes, 159 lines download raw bytes

1!(function () {
2    "use strict";
3    jQuery(function (t) {
4        t(".filter-button").click(function () {
5            t(".filter-box").slideToggle();
6        }),
7            t(".cat-item:not(.all) a").click(function (a) {
8                a.preventDefault();
9                var e = decodeURIComponent(window.location.search.replace("?s=", ""));
10                t(this).parents(".blog-category-filter").find(".cat-item").removeClass("current-cat"),
11                    t(this).parents(".cat-item").addClass("current-cat");
12                var o = t('.current-cat [name="categoryfilter"]').attr("value"),
13                    n = t('.current-cat [name="tagfilter"]').attr("value");
14                return (
15                    t(".button_loadmore").attr("data-cat", o).attr("data-tag", n),
16                    t.ajax({
17                        url: "/wp-admin/admin-ajax.php",
18                        data: { action: "myfilter", tag: n, cat: o, keyword: e },
19                        dataType: "json",
20                        type: "POST",
21                        beforeSend: function (t) {
22                            console.log("load");
23                        },
24                        success: function (a) {
25                            t(".blog-articles").html(a.content),
26                                t(".button_loadmore").attr("data-paged", 1).attr("data-max_pages", a.max_page),
27                                a.max_page < 2 ? t(".button_loadmore").hide() : t(".button_loadmore").show();
28                        },
29                    }),
30                    !1
31                );
32            }),
33            t(".blog-section").on("click", ".tag-item", function (a) {
34                a.preventDefault();
35                var e = t(this).attr("tag-slug");
36                t('.cat-item a[value="' + e + '"] ').click(), t(".filter-box").slideDown();
37            }),
38            t(".button_loadmore").on("click", (function(a) {
39    a.preventDefault();
40    var e = t(this),
41        o = e.attr("data-paged"),
42        n = e.attr("data-max_pages"),
43        r = e.attr("data-tag"),
44        c = e.attr("data-cat"),
45        i = decodeURIComponent(window.location.search.replace("?s=", "")),
46        d = e.data("term"),
47        l = e.data("post_type"),
48        u = e.data("newest_ids"),
49        s = +o + 1;
50
51    t.ajax({
52        type: "POST",
53        url: "/wp-admin/admin-ajax.php",
54        dataType: "json",
55        data: {
56            paged:      o,
57            action:     "loadposts",
58            tag:        r,
59            cat:        c,
60            type:       l,
61            term:       d,
62            keyword:    i,
63            newest_ids: u
64        },
65        beforeSend: function() {
66            e.text("Завантажуємо...");
67        },
68        success: function(a) {
69            e.attr("data-paged", s);
70            t(".blog-section").find(".blog-articles").append(a.content);
71            t(".section-courses-grid").find(".courses-articles").append(a.content);
72            e.text("Переглянути більше");
73
74            if (!a.has_more) {
75                e.hide();
76            }
77        }
78    });
79}));
80    });
81})();
82
83
84
85window.addEventListener('scroll', function() {
86	if (document.querySelector('.blog-functions')) {
87    const svg = document.querySelector('.two-columns svg');
88    const container = document.querySelector('.two-columns');
89    
90    const svgRect = svg.getBoundingClientRect();
91    const containerRect = container.getBoundingClientRect();
92
93    // When the top of the container reaches 100px from the top of the viewport
94    if (containerRect.top <= 100 && containerRect.bottom > svgRect.height + 100) {
95        svg.style.position = 'fixed';
96        svg.style.top = '100px';
97        svg.style.bottom = 'auto';
98    }
99    // When the bottom of the container reaches the bottom of the SVG
100    else if (containerRect.bottom <= svgRect.height + 100) {
101        svg.style.position = 'absolute';
102        svg.style.top = 'auto';
103        svg.style.bottom = '0';
104    }
105    // When scrolling up and the SVG reaches 100px from the top of the viewport
106    else if (containerRect.top > 100) {
107        svg.style.position = 'absolute';
108        svg.style.top = '0';
109        svg.style.bottom = 'auto';
110    }
111	}
112});
113
114document.addEventListener('DOMContentLoaded', () => {
115		if (document.querySelector('.blog-functions')) {
116    const svg = document.querySelector('.two-columns svg');
117    const cards = document.querySelectorAll('.content-column .column-card');
118    const svgElements = svg.querySelectorAll('.scroll-item');
119
120		function getMidpoints(elements) {
121        return Array.from(elements).map(el => {
122            const rect = el.getBoundingClientRect();
123            return rect.top + rect.height / 2 + window.scrollY;
124        });
125    }
126
127    function updateSVG(closestIndex) {
128        svgElements.forEach((el, index) => {
129            if (index <= closestIndex) {
130                el.classList.add('active');
131            } else {
132                el.classList.remove('active');
133            }
134        });
135    }
136
137    function onScroll() {
138        const svgRect = svg.getBoundingClientRect();
139        const svgMidpoint = svgRect.top + svgRect.height / 2 + window.scrollY;
140        const cardMidpoints = getMidpoints(cards);
141
142        let closestIndex = 0;
143        let minDistance = Infinity;
144
145        cardMidpoints.forEach((midpoint, index) => {
146            const distance = Math.abs(midpoint - svgMidpoint);
147            if (distance < minDistance) {
148                minDistance = distance;
149                closestIndex = index;
150            }
151        });
152
153        updateSVG(closestIndex);
154    }
155
156    window.addEventListener('scroll', onScroll);
157    onScroll();
158		}// Run initially in case the page is already scrolled
159});

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.