PageSourceSearch

https://www.hancockhealth.org/wp-content/themes/hancockhealth/src/js/tribe-events-override.js

js hancockhealth.org collected 2026-09-26 03:17:11 UTC 2,028 bytes, 54 lines download raw bytes

1(function() {
2
3    let pagePath = window.location.pathname;
4
5    if(document.querySelector('body').classList.contains('post-type-archive-tribe_events') ||
6       document.querySelector('body').classList.contains('single-tribe_event_series') || 
7       pagePath.includes('/wellness-education/classes/')) {
8
9        function overRideTribe() {
10            if (document.querySelector('.custom-search-header')) {
11                return;
12            }
13
14            let tribeEventsHeader = document.querySelector('.tribe-events-header__events-bar');
15            if (!tribeEventsHeader) {
16                return; 
17            }
18            
19            let wrapper = document.createElement('div');
20            wrapper.classList.add('custom-search-header');
21        
22            tribeEventsHeader.parentNode.insertBefore(wrapper, tribeEventsHeader);
23            wrapper.appendChild(tribeEventsHeader);
24        
25            let newHeader = document.createElement('h1');
26            newHeader.classList.add('h2');
27            newHeader.innerText = 'Classes & Support Groups';
28        
29            let newParagraph = document.createElement('p');
30            newParagraph.innerText = 'Search by Keywords';
31        
32            wrapper.insertBefore(newHeader, tribeEventsHeader);
33            wrapper.insertBefore(newParagraph, tribeEventsHeader);
34        }
35      
36        overRideTribe();
37
38        var origOpen = XMLHttpRequest.prototype.open;
39        XMLHttpRequest.prototype.open = function() {
40
41            document.querySelector('.tribe-common').classList.add('FOUC-40');
42            this.addEventListener('load', function() {
43                setTimeout(function() {
44                    if (!document.querySelector('.custom-search-header')) {
45                        overRideTribe(); // Only run if not already applied
46                    }
47                    document.querySelector('.tribe-common').classList.remove('FOUC-40');
48                }, 10);
49            });
50
51            origOpen.apply(this, arguments);
52        };
53    }
54})();

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.