D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
hrfiudwx
/
enterpriseuplift.com
/
wp-content
/
themes
/
themify-ultra
/
themify
/
js
/
modules
/
Filename :
infinite.js
back
Copy
(($,t,e,l,o)=>{"use strict";let i=null;const n=new Set,a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=t=>new IntersectionObserver(((e,l)=>{for(let o=e.length-1;o>-1;--o)!0===e[o].isIntersecting&&(null===t.button?l.disconnect():d(t))}),{threshold:.1}),f=(t,l=location.href)=>{null===i&&(i=new IntersectionObserver((t=>{for(let l=t.length-1;l>-1;--l)if(!0===t[l].isIntersecting){let o=t[l].target.dataset.tfHistory,i=location.hash;i&&"#"!==i&&(o+=i),e.history.replaceState(null,null,o);break}}),{rootMargin:"100% 0px -100% 0px"}));const o=new URL(l,location);t.dataset.tfHistory=s(o.href.replace(o.hash,"")),i.observe(t)},s=e=>t.updateQueryString("tf-scroll",null,e),c=e=>t.updateQueryString("tf-scroll",1,e),d=i=>{if(!0===i.isWorking)return;i.isWorking=!0,i.status.classList.add("tf_scroll_request");let r,d,u="GET";if(i.filter){const t=i.filter.hasAttribute("data-sort"),e=i.filter.querySelector(".cat-item.active");if(e){i.ajax_loading=e;const l=i.filter.dataset;if(d={action:"themify_ajax_load_more",module:l.el,id:l.id,page:e.dataset.p},!e.classList.contains("cat-item-all")){const t=e.className.replace(/(current-cat)|(cat-item)|(-)|(active)/g,"").replace(" ","");d.tax=t.trim()}if(t){const t=i.filter.querySelector(".tf_ajax_sort_order.active"),e=i.filter.querySelector(".tf_ajax_sort_order_by .active");t&&(d.order=t.dataset.type),e&&(d.orderby=e.dataset.orderBy)}u="POST",r=themify_vars.ajax_url}}i.ajax_loading||(r=c(i.button.href)),t.fetch(d,"html",{method:u},r).then((r=>{const d=r.querySelector(i.id),u=s(i.button.href),_=i.container;let m,h=null;if(null!==d){((l,o,i)=>{if(t.lazyScroll(t.selectWithParent("[data-lazy]",l),!0),!i){const o=e.Isotope?.data(l);if(o){const e=l.previousElementSibling;if(e?.classList.contains("post-filter")){const l=e.querySelector(".cat-item.active:not(.cat-item-all)");null!==l&&t.triggerEvent(t.click,l)}}}t.triggerEvent(l,"infinitebeforeloaded",{d:o}).trigger("infinitebeforeloaded",[l,o])})(_,r,!!i.ajax_loading);const n=l.createDocumentFragment(),s=t.convert(d.children);if(h=d.tfClass("load-more-button")[0]||d.nextElementSibling,h&&(h.classList.contains("load-more-button")||(h=h.children[0]),h?.classList.contains("load-more-button")||(h=null)),h&&"A"!==h.tagName&&(h=h.children[0],h&&"A"===h.tagName||(h=null)),s[0]!==o){for(let t=0;t<s.length;++t)n.appendChild(s[t]);_.appendChild(n),i.history&&(m=!0,f(s[0],u)),((o,i,n)=>{const r=o.length,f=e.Isotope?.data(i);o[0].className+=" tf_firstitem";var s=0;for(let e=0;e<r;++e)o[e].style.opacity=0,t.imagesLoad(o[e]).then((e=>{if(a){const t=e.querySelector("img[srcset]");null!==t&&(t.outerHTML=t.outerHTML)}if(++s,f?.appended(e),e.style.opacity="",s===r){if(f||i.classList.contains("auto_tiles")){if(!n.ajax_loading){const e=i.previousElementSibling;e?.classList.contains("post-filter")&&t.trigger("themify_isotop_filter",[e])}i.classList.contains("auto_tiles")&&t.autoTiles(i)}for(let e=0;e<r;++e)t.lazyScroll(t.convert(t.selectWithParent("[data-lazy]",o[e])).reverse(),!0);if(t.triggerEvent(i,"infiniteloaded",{items:o}).trigger("infiniteloaded",[i,o]),"scroll"===n.scrollToNewOnLoad){let e=i.tfClass("tf_firstitem");e=e[e.length-1];let o=$(e).offset().top;const a=o>=800?800+Math.abs(o/10):800,r=l.tfId("headerwrap");null!==r&&(r.classList.contains("fixed-header")||l.body.classList.contains("fixed-header"))&&(o-=$(r).outerHeight(!0)),(!1===n.scrollThreshold||o-l.docElement.scrollTop>n.scrollThreshold)&&t.scrollTo(o,a)}t.fonts(),t.wpEmbed(l.tfClass("wp-embedded-content")),t.largeImages()}}))})(s,_,i)}else h=null;i.ajax_loading&&null===h&&(i.ajax_loading.dataset.done=!0,i.filter.parentNode.classList.add("tb_hide_loadmore"))}if(i.ajax_loading)i.ajax_loading.dataset.p=1+~~i.ajax_loading.dataset.p,i.isWorking=null;else{if(null===h)i.button.remove(),i.button=null;else{const t=c(h.href);i.prefetchBtn===o||n.has(t)||(n.add(t),i.prefetchBtn.setAttribute("href",t)),i.button.href=t,e.tfOn("scroll",(()=>{i.isWorking=null}),{passive:!0,once:!0})}if(e.ga!==o){const t=l.createElement("a");t.href=u,ga("set","page",t.pathname),ga("send","pageview")}!m&&i.history&&e.history.replaceState(null,null,u)}return i.status.classList.remove("tf_scroll_request"),d})).catch((t=>{console.warn("InfiniteScroll error.",t)}))};t.on("tf_infinite_init",((i,a)=>{const s=i.length!==o?i:[i];for(let o=s.length-1;o>-1;--o){let i=s[o],u=i.tfClass("load-more-button")[0]||i.nextElementSibling,_=l.createElement("div");if(u){let o=u;if(!u.classList.contains("load-more-button")&&(u=u.children[0],!u?.classList.contains("load-more-button")))continue;if("A"!==u.tagName&&(u=u.children[0],!u||"A"!==u.tagName))continue;if(a.id||(a.id=i.id,a.id=a.id?"#"+a.id:"."+i.className.split(" ").join(".")),_.className="tf_load_status tf_loader tf_clear tf_hide",i.after(_),a.status=_,a.button=u,a.container=i,i.classList.contains("tb_ajax_pagination")){const t=i.previousElementSibling;t?.classList.contains("post-filter")&&(a.filter=t)}!1!==a.scrollThreshold?e.tfOn("scroll",(()=>{const t=l.createElement("link"),e=c(a.button.getAttribute("href"));t.setAttribute("as","document"),t.rel="prefetch",t.href=e,a.button.after(t),a.prefetchBtn=t,n.add(e),f(a.container.children[0]),r(a).observe(o)}),{passive:!0,once:!0}):(f(i.children[0]),u.tfOn(t.click,(t=>{t.preventDefault(),delete a.ajax_loading,d(a)})).style.display="inline-block")}}})).loadCss("infinite","tf_infinite")})(jQuery,Themify,window,document,void 0);