PageSourceSearch

https://www.thevaluable500.com/wp-content/themes/v500/build/js/news-filter.js?ver=1789735394

js thevaluable500.com collected 2026-09-24 15:19:08 UTC 4,490 bytes, 1 lines download raw bytes

1"use strict";!function($){$(".latest-news .article-list").html();let filterQuery="",newsPage=1,insightsPage=1,newsLoading=!1,insightsLoading=!1,$newsAnnouncer=$("#load-news-announcer"),$insightsAnnouncer=$("#load-insights-announcer");$(".latest-news .filter-form");const ignoreID=$(".news-page.latest-news").data("ignore");$((()=>{const $newsFilters=$(".news-filter");function filterChange(){let toShow=[];$newsFilters.each(((i,e)=>{const $label=$(e).next().find(".v500-button");e.checked?(toShow.push(`${e.dataset.filter}`),$label.addClass("button-primary"),$label.removeClass("button-secondary")):($label.addClass("button-secondary"),$label.removeClass("button-primary"))})),newsPage=1,filterQuery="page_size=5",toShow.length&&(filterQuery+=`&post_types=${toShow.join(",")}`);let newQuery=`?page=${newsPage}`;filterQuery&&(newQuery=`${newQuery}&${filterQuery}`),$(".latest-news .article-list").empty(),$("#load-more-news").css("visibility","hidden"),$.get(`/wp-json/v500/v1/latest-news${newQuery}&not_in=${ignoreID}`).then((result=>{newsLoading=!1,$(".latest-news .article-list").append($(result.html)),$(".latest-news .article-list").children().length>=result.total_results?$("#load-more-news").css("visibility","hidden"):$("#load-more-news").css("visibility","visible"),toShow.length?$(".latest-news").addClass("filtered"):$(".latest-news").removeClass("filtered");let news_remaining=(result.total_results||0)-$(".latest-news .news-link").length;news_remaining>=3?$("#load-more-news").html("Load 3 more news"):news_remaining>0?$("#load-more-news").html(`Load ${news_remaining} more news`):$("#load-more-news").hide(),$newsAnnouncer.text($newsAnnouncer.data("template").replace("XXX",$(".latest-news .news-link").length).replace("YYY",result.total_results))}))}$newsFilters.on("keypress",(function(event){13==(event.keyCode?event.keyCode:event.which)&&(this.checked=!this.checked),filterChange()})),$newsFilters.on("change",(function(){filterChange()})),$("#load-more-news").on("click",(function(){const $spinner=$("#spinner_news");if($spinner.css("display","inline"),newsLoading)return;newsLoading=!0,newsPage+=1,$(this).attr("disabled",!0);let newQuery=`?page=${newsPage}`;newQuery=filterQuery?`${newQuery}&${filterQuery}`:`${newQuery}&post_types=v500_video,v500_audio,v500_article,v500_event,v500_press_release,v500_update`;let $last=$(".latest-news .news-link").last();$.get(`/wp-json/v500/v1/latest-news${newQuery}&not_in=${ignoreID}`).then((result=>{$(this).removeAttr("disabled"),newsLoading=!1,$(".latest-news .article-list").append($(result.html)),$(".latest-news .article-list").children().length>=result.total_results&&$("#load-more-news").css("visibility","hidden");let news_remaining=(result.total_results||0)-$(".latest-news .news-link").length;news_remaining>=3?$("#load-more-news").html("Load 3 more news"):news_remaining>0?$("#load-more-news").html(`Load ${news_remaining} more news`):$("#load-more-news").hide(),$newsAnnouncer.text($newsAnnouncer.data("template").replace("XXX",$(".latest-news .news-link").length).replace("YYY",result.total_results)),$last.next().find(".heading-link").get(0).focus({preventScroll:!0}),v500ScrollIntoView($last.next().get(0)),$spinner.hide()}))})),$("#load-more-insights").on("click",(function(){const $spinner=$("#spinner_insights");if($spinner.css("display","inline"),insightsLoading)return;insightsLoading=!0,$(this).attr("disabled",!0),insightsPage+=1;const lastPart=window.location.pathname.split("/").pop();let newQuery=`?page=${insightsPage}&post_types=v500_insight&download_links=1&referrer=${lastPart}&offset=0`,$last=$(".latest-insights .news-link").last();$.get(`/wp-json/v500/v1/latest-news${newQuery}`).then((result=>{insightsLoading=!1,$(this).removeAttr("disabled"),$(".latest-insights .article-list").append($(result.html)),$(".latest-insights .article-list").children().length>=result.total_results&&$("#load-more-insights").css("visibility","hidden");let insights_remaining=(result.total_results||0)-$(".latest-insights .news-link").length;insights_remaining>=3?$("#load-more-insights").html("Load 3 more reports"):insights_remaining>0?$("#load-more-insights").html(`Load ${insights_remaining} more reports`):$("#load-more-insights").hide(),$insightsAnnouncer.text($insightsAnnouncer.data("template").replace("XXX",$(".latest-insights .news-link").length).replace("YYY",result.total_results)),$last.next().find(".heading-link").get(0).focus(),v500ScrollIntoView($last.next().get(0)),$spinner.hide()}))}))}))}(jQuery);

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.