PageSourceSearch

https://chartbeat.com/wp-content/plugins/colab-alert//js/main.js?ver=1

js chartbeat.com collected 2026-09-24 07:29:46 UTC 1,771 bytes, 44 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2    const closeAlertButton = document.querySelector('.colab-alert-bar-exit');
3    const colabAlertBar = document.querySelector('.colab-alert-bar');
4
5    if (!colabAlertBar){
6        return;
7    } else {
8        
9        //if sessionStorage is already populated, that means it's been dismissed -- dont display.
10        if(sessionStorage.getItem('disableAlert')){
11            colabAlertBar.classList.add('hidden')
12        } else {
13            colabAlertBar.style.display = 'flex';
14        }
15
16        colabAlertBar.style.maxHeight = colabAlertBar.scrollHeight + 'px';
17
18        //Listen for window resize because height must be caclulated dynamically for animation
19        window.addEventListener("resize", () => {
20            if ( !colabAlertBar.classList.contains('hidden') ){
21                //not sure why, but scrollheight isn't accounting for the padding on resize, compensating by adding 16 to height.
22                colabAlertBar.style.maxHeight = (colabAlertBar.scrollHeight + 16) + "px";
23                colabAlertBar.offsetHeight;
24            }      
25        })
26
27        //When closed: reduce padding, max-height, and translate upward. Apply hidden class after short delay.
28        if(closeAlertButton != null){
29            closeAlertButton.addEventListener('click', ()=>{
30                sessionStorage.setItem("disableAlert", "true");
31                colabAlertBar.style.padding = 0;
32                colabAlertBar.style.maxHeight = 0;
33                colabAlertBar.style.transform = 'translateY(-' +  colabAlertBar.scrollHeight * 3 + 'px)';
34                setTimeout(() => {
35                    colabAlertBar.classList.add('hidden')
36                }, "750") 
37            })
38        }
39    }
40
41  
42});
43
44

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.