PageSourceSearch

https://d205tm.org/wp-content/themes/d57tm.org/functions.js

js d205tm.org collected 2026-09-29 17:50:01 UTC 1,326 bytes, 30 lines download raw bytes

1window.addEventListener('DOMContentLoaded', (event) => {
2    // Open external links in a new tab/window
3    document.querySelectorAll('#brx-content a').forEach(link => {
4        // Adds a notice for screen readers to external links
5        if (link.getAttribute('href') && link.hostname.indexOf(location.hostname.replace('www.', '')) == -1) {
6            link.target = '_blank';
7
8            if (!link.querySelector('.visually-hidden')) {
9                link.insertAdjacentHTML('beforeend', '<span class="visually-hidden"> (opens a new window)</span>');
10            }
11
12            // See https://codersblock.com/blog/external-links-new-tabs-and-accessibility/
13            let linkTypes = (link.getAttribute('rel') || '').split(' ');
14            if ( !linkTypes.includes( 'noopener' ) ) {
15                linkTypes.push( 'noopener' );
16            }
17            link.setAttribute('rel', linkTypes.join(' ').trim());
18        }
19    } );
20
21    // Back to Top
22    const backToTopButton = document.getElementById('brxe-backtotop-button');
23    window.onscroll = () => {
24        if (document.body.scrollTop > 900 || document.documentElement.scrollTop > 600) {
25            backToTopButton.classList.add('active');
26        } else {
27            backToTopButton.classList.remove('active');
28        }
29    }
30} );

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.