/*
W Zhang For weixuanz.github.io
*/ 'use strict';const a=document.querySelector(“#loadmore-btn”);a.addEventListener(“click”,f); function f(){const b=document.querySelector(“#blog-list”),c=+b.getAttribute(“data-page”),e=+b.getAttribute(“data-totalPages”);c!=e&&(a.textContent=“Loading…”,a.disabled=!0,fetch(`/page${c+1}`,{method:“GET”,headers:{}}).then(d=>d.text()).then(d=>{(new DOMParser).parseFromString(d,“text/html”).querySelectorAll(“#blog-list a”).forEach(g=>b.appendChild(g));a.textContent=“Load more…”;a.disabled=!1;b.setAttribute(“data-page”,c+1);c+1==e&&(a.onclick=null,a.remove())}))};