PageSourceSearch

https://www.datafeedwatch.com/hubfs/hub_generated/template_assets/…/1783501002365/template_latest-posts.min.js

js datafeedwatch.com collected 2026-09-24 15:16:03 UTC 3,055 bytes, 2 lines download raw bytes

1class LatestPosts{constructor(postList,loadBtn){this.postList=postList,this.loadBtn=loadBtn,this.fetchedPosts=[],this._currentPage=1,this.isLoading=!1,this._allFetched=!1,this.loadAfterFetch=!1,this.loadMore=this.loadMore.bind(this),this.fetchMore=this.fetchMore.bind(this),this._registerEvents(),this._formatPostList()}set isLoading(isLoading){this._isLoading=isLoading,isLoading||(this.loadBtn.disabled=!1,this.loadBtn.classList.remove("dfw-btn--loading")),!isLoading&&this.loadAfterFetch&&(this.loadMore(),this.loadAfterFetch=!1)}get isLoading(){return this._isLoading}_registerEvents(){this.loadBtn.addEventListener("click",this.loadMore)}_formatPostList(){const amountToShow=window.matchMedia("(min-width: 1240px)").matches?3:4;[...this.postList.children].forEach((post,index)=>{this.fetchedPosts.push(post),index>amountToShow-1&&post.remove()}),this.postList.classList.remove("latest-container--appear")}hideLoadMoreBtn(){document.querySelector("#load-more-latest").style.display="none"}loadMore(e){e&&e.preventDefault();const amountToAdd=window.matchMedia("(min-width: 1240px)").matches?6:4,postsLength=this.postList.children.length;if(!this.fetchedPosts[postsLength]&&this._allFetched)return void this.hideLoadMoreBtn();if(this.fetchedPosts.length===this.postList.children.length&&this._isLoading)return this.loadBtn.disabled=!0,this.loadBtn.classList.add("dfw-btn--loading"),void(this.loadAfterFetch=!0);const postsHeight=this.postList.scrollHeight;this.postList.style.height=`${postsHeight}px`,this.postList.style.overflow="hidden";for(let i=0;i<amountToAdd;i++)this.fetchedPosts[i+postsLength]?this.postList.appendChild(this.fetchedPosts[i+postsLength]):this._allFetched&&this.hideLoadMoreBtn();requestAnimationFrame(()=>{if(this.postList.scrollHeight===postsHeight)return this.postList.style.height="auto",void(this.postList.style.overflow="visible");this.postList.style.height=`${this.postList.scrollHeight}px`,this.postList.addEventListener("transitionend",()=>{this.postList.style.height="auto",this.postList.style.overflow="visible",this.postList.children[postsLength].scrollIntoView({block:"center"})},{once:!0})}),this.fetchMore()}shouldFetchMore(){return this.fetchedPosts.length-this.postList.children.length<=6}fetchMore(){!1===this.shouldFetchMore()||this.isLoading||this._allFetched||(this.isLoading=!0,this._currentPage+=1,fetch(`${window.location.origin}${window.location.pathname}/page/${this._currentPage}`).then(async res=>{const textHTML=await res.text();[...(new DOMParser).parseFromString(textHTML,"text/html").querySelector(".latest-container--appear").children].forEach(post=>{post.querySelectorAll("img[loading=lazy]").forEach(img=>{img.src=img.dataset.src}),this.fetchedPosts.push(post)}),this.isLoading=!1}).catch(()=>{this._allFetched=!0,this.isLoading=!1}))}}new LatestPosts(document.querySelector("#latest"),document.querySelector("#load-more-latest"));
2//# sourceURL=https://246436727.fs1.hubspotusercontent-na2.net/hubfs/246436727/hub_generated/template_assets/1/366650500847/1783501002365/template_latest-posts.js

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.