1jQuery(document).ready(function($){const newsWrapper=$('.newsCardWrapper');const resultCount=$('.result-count');const paginationWrapper=$('.pagination');const filterYearWrapper=$('.dropdownWrapper');const dropdown=filterYearWrapper.find('.dropdown');const itemsWrapper=filterYearWrapper.find('.itemsWrapper');const searchKeyword=$('#search-keyword');let currentPage=1;function populateYears(){$.ajax({url:newsAndEvents.ajax_url,type:'POST',data:{action:'get_filter_years'},success:function(response){if(response.success&&response.data.years){dropdown.text(newsAndEvents.translations.filterByYear||'Filter by year');itemsWrapper.html('');response.data.years.forEach(function(year){const li=$('<li>',{class:'items'});const anchor=$('<a>',{href:'javascript:',text:year,});li.append(anchor);itemsWrapper.append(li)});itemsWrapper.find('.items').on('click',function(){const selectedYear=$(this).find('a').text();dropdown.text(selectedYear);currentPage=1;fetchPosts(selectedYear);filterYearWrapper.removeClass('open')})}},})} 2function fetchPosts(selectedYear=''){const keyword=searchKeyword.val();const year=selectedYear||dropdown.text();const yearFilter=year===newsAndEvents.translations.filterByYear?'':year;$.ajax({url:newsAndEvents.ajax_url,type:'POST',data:{action:'filter_news_and_events',keyword:keyword,year:yearFilter,page:currentPage,},success:function(response){if(response.success){newsWrapper.html(response.data.posts);paginationWrapper.html(response.data.pagination);resultCount.text(response.data.result_count)}else{newsWrapper.html(`<p>${newsAndEvents.translations.noItemsFound}</p>`);paginationWrapper.html('');resultCount.text('')}},})} 3searchKeyword.on('input',function(){currentPage=1;fetchPosts()});$(document).on('click','.pagination a',function(e){e.preventDefault();const href=$(this).attr('href');const page=href.match(/http:\/\/(\d+)/)[1];if(page){currentPage=parseInt(page,10);fetchPosts()}});populateYears();fetchPosts()})
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.