1document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".maksimer-all-posts").forEach(function(s){const t=s.querySelector(".maksimer-all-posts__posts"),e=s.querySelector(".maksimer-all-posts__load-more-btn"),a=s.querySelectorAll(".maksimer-all-posts__category-btn"),o=s.querySelectorAll(".maksimer-all-posts__view-btn");let n=1,i=0,l="grid",c=!1;const r=parseInt(s.dataset.postsPerPage||6);function p(s){c=!0,t.classList.add("loading"),e&&(e.disabled=!0);const a=new FormData;a.append("action","maksimer_posts_filter_load_more"),a.append("nonce",maksimerPostsFilter.nonce),a.append("page",n),a.append("posts_per_page",r),a.append("category",i),fetch(maksimerPostsFilter.ajaxUrl,{method:"POST",body:a}).then(function(s){return s.json()}).then(function(a){if(a.success){const o=a.data.posts,i=a.data.max_pages;s&&(t.innerHTML=""),0===o.length&&s?t.innerHTML='<div class="maksimer-all-posts__no-posts">Ingen innlegg funnet.</div>':o.forEach(function(s){console.log(s);const e=function(s){const t=document.createElement("a");t.href=s.permalink,s.display_thumbnail?(t.className="maksimer-all-posts__posts__post",t.style=`--thumb:url('${s.thumbnail||""}'); background-image: url('${s.thumbnail||""}')`):t.className=`maksimer-all-posts__posts__post no-thumbnail color-${s.color_setting}`;let e="";s.categories&&s.categories.length>0&&(e='<div class="maksimer-all-posts__posts__post__post-categories">',s.categories.forEach(function(s){e+='<span class="maksimer-all-posts__posts__post__post-category">'+s+"</span>"}),e+="</div>");let a="";s.thumbnail&&(a=`<div class="maksimer-all-posts__posts__post__thumbnail" style="background-image: url('${s.thumbnail||""}')"></div>`);let o="";return s.display_thumbnail||0==s.icon||(o=s.icon),t.innerHTML='<div class="maksimer-all-posts__posts__post__post-content">'+o+e+'<h3 class="maksimer-all-posts__posts__post__post-title">'+s.title+'</h3><div class="maksimer-all-posts__posts__post__post-excerpt">'+s.excerpt+"</div></div>"+a,t}(s);t.appendChild(e)}),e&&(e.style.display=n>=i?"none":"inline-block")}c=!1,t.classList.remove("loading"),e&&(e.disabled=!1)}).catch(function(s){console.error("Error loading posts:",s),c=!1,t.classList.remove("loading"),e&&(e.disabled=!1)})}a.forEach(function(s){s.addEventListener("click",function(){c||(a.forEach(function(s){s.classList.remove("active")}),this.classList.add("active"),i=parseInt(this.dataset.category||0),n=1,p(!0))})}),o.forEach(function(s){s.addEventListener("click",function(){c||(o.forEach(function(s){s.classList.remove("active")}),this.classList.add("active"),l=this.dataset.view,t.classList.remove("grid-view","list-view"),t.classList.add(l+"-view"))})}),e&&e.addEventListener("click",function(){c||(n++,p(!1))})})});
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.