PageSourceSearch

https://www.tourisme-egletons.com/app/dist/ventadour-egletons/addo…/woody-favorites-loadmore.fd886bd5e9.mjs

js tourisme-egletons.com collected 2026-10-02 19:47:58 UTC 2,916 bytes, 1 lines download raw bytes

1const E="[data-wfav-grid] .woody_list_grid",y="[data-wfav-pager]",L="[data-wfav-pager-next]";async function F(e){if(!e||!document.querySelector(y))return;const t=e.querySelector(E);if(!t)return;const s=e.classList.contains("visited-section")?"visited-section":"favorites-section",n=document.createElement("p");n.className="show-for-sr",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),t.insertAdjacentElement("afterend",n);let o=!1;document.addEventListener("click",async r=>{const a=r.target.closest(L);if(!a||r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),o))return;o=!0;const i=a.closest(y),u={loading:a.dataset.wfavLabelLoading||"",added:a.dataset.wfavLabelAdded||"",end:a.dataset.wfavLabelEnd||"",error:a.dataset.wfavLabelError||""};x(a),w(n,u.loading);try{const d=await fetch(a.href,{credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest"}});if(!d.ok)throw new Error("HTTP "+d.status);const p=new DOMParser().parseFromString(await d.text(),"text/html"),v=p.querySelector("."+s+" "+E),g=new Set;Array.from(t.children).forEach(c=>{const l=S(c);l&&g.add(l)});const h=v?Array.from(v.children).filter(c=>{const l=S(c);return!l||!g.has(l)}):[];if(h.length===0){w(n,u.end),A(i,t);return}const f=document.createDocumentFragment();h.forEach(c=>f.appendChild(c)),document.dispatchEvent(new CustomEvent("woody:favorites-cells-added",{detail:{fragment:f}}));const m=f.firstElementChild;t.appendChild(f),q(a.dataset.wfavPage);const b=p.querySelector(y);b?i.replaceWith(b):A(i,t),w(n,C(u.added,h.length)),m&&(m.setAttribute("tabindex","-1"),m.focus({preventScroll:!0})),I(t)}catch(d){console.error(["[FAVORITES]",d]),w(n,u.error),P(a)}finally{o=!1}})}function S(e){const t=e.querySelector(".card")||e;return t.dataset?t.dataset.sheetid?"s"+t.dataset.sheetid:t.dataset.postid||null:null}function q(e){const t=parseInt(e,10);if(!t||t<1||!window.history||!window.history.replaceState)return;const[s,n]=window.location.href.split("#"),[o,r]=s.split("?"),a=(r||"").split("&").filter(i=>i!==""&&!/^favpage=/.test(i));a.push("favpage="+t),window.history.replaceState({},"",o+"?"+a.join("&")+(n?"#"+n:""))}function x(e){e.setAttribute("aria-busy","true"),e.classList.add("is-loading")}function P(e){e.removeAttribute("aria-busy"),e.classList.remove("is-loading")}function A(e,t){e&&(e.contains(document.activeElement)&&t&&(t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0})),e.remove())}function w(e,t){!e||!t||(e.textContent="",window.setTimeout(()=>{e.textContent=t},60))}function C(e,...t){let s=0;return String(e||"").replace(/%(\d+\$)?d/g,(n,o)=>{const r=o?parseInt(o,10)-1:s++;return t[r]===void 0?n:String(t[r])})}function I(e){try{window.Foundation&&typeof window.Foundation.reInit=="function"&&window.Foundation.reInit(window.jQuery?window.jQuery(e):"equalizer")}catch{}}export{F as init};

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.