PageSourceSearch

https://www.pingdom.com/wp-content/themes/pingdom-2018/dev/scripts/sw19p-resources.js?ver=1754550806

js pingdom.com collected 2026-09-24 06:23:42 UTC 2,768 bytes, 73 lines download raw bytes

1(function() {
2    function sw19p_resources_cards_init() {
3        function resize_card(card) {
4            var cards = document.querySelector('.sw19p-resources .cards');
5            var cards_style = window.getComputedStyle(cards);
6            var row_height = parseInt(cards_style.getPropertyValue('grid-auto-rows'));
7            var row_gap = parseInt(cards_style.getPropertyValue('grid-row-gap'));
8            var row_span = Math.ceil((card.querySelector('.card-inner').getBoundingClientRect().height + row_gap) / (row_height + row_gap));
9            card.style.gridRowEnd = "span " + row_span;
10        }
11
12        function resize_all_cards(){
13            var cards = document.querySelectorAll('.sw19p-resources .cards .sw-card');
14            cards.forEach(resize_card);
15        }
16
17        resize_all_cards();
18        window.addEventListener('resize', resize_all_cards);
19    }
20
21    function sw19p_resources_filter_init() {
22        var filter_form = document.querySelector('.sw19p-resources .filter form');
23        if (!filter_form) {
24            return;
25        }
26
27        filter_form.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
28            checkbox.addEventListener('change', function() {
29                filter_form.submit()
30            });
31        });
32    }
33
34    function sw19p_resources_mobile_init() {
35        var mobile_filter_top = document.querySelector('.sw19p-resources .sw19b-mobile-filter-top');
36        var mobile_filter = document.querySelector('.sw19p-resources .sw19b-mobile-filter-box');
37        if (!mobile_filter_top || !mobile_filter) {
38            return;
39        }
40
41        var arrow = mobile_filter_top.querySelector('svg');
42        arrow.addEventListener('click', function(e) {
43            e.preventDefault();
44            mobile_filter.classList.toggle('selected');
45            mobile_filter_top.classList.toggle('selected');
46        });
47
48        var reset = mobile_filter.querySelector('button.clear-filters');
49        if (!reset) {
50            return;
51        }
52        reset.addEventListener('click', function(e) {
53            e.preventDefault();
54            mobile_filter.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
55                checkbox.checked = false;
56            });
57        });
58    }
59
60    function sw19p_resources_filter_collapse_init() {
61        document.querySelectorAll('.sw19p-resources .filter-name').forEach(function(btn) {
62            btn.addEventListener('click', function(e) {
63                e.preventDefault();
64                btn.parentElement.classList.toggle('selected');
65            });
66        });
67    }
68
69    sw19p_resources_cards_init();
70    sw19p_resources_filter_init();
71    sw19p_resources_mobile_init();
72    sw19p_resources_filter_collapse_init();
73}())

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.