PageSourceSearch

https://murad.co.uk/cdn/shop/t/6/assets/chunk--Ajaxinate-5BEN7YRK.vbt.js

js murad.co.uk collected 2026-09-26 01:07:12 UTC 4,736 bytes, 10 lines download raw bytes

1import"./chunk--chunk-Z7A6LSGX.vbt.js";function Ajaxinate(config){const settings=config||{},defaults={method:"scroll",container:"#AjaxinateContainer",pagination:"#AjaxinatePagination",offset:0,loadingText:"Loading",callback:null};this.settings=Object.assign(defaults,settings),this.addScrollListeners=this.addScrollListeners.bind(this),this.addClickListener=this.addClickListener.bind(this),this.checkIfPaginationInView=this.checkIfPaginationInView.bind(this),this.preventMultipleClicks=this.preventMultipleClicks.bind(this),this.removeClickListener=this.removeClickListener.bind(this),this.removeScrollListener=this.removeScrollListener.bind(this),this.removePaginationElement=this.removePaginationElement.bind(this),this.destroy=this.destroy.bind(this),this.containerElement=document.querySelector(this.settings.container),this.paginationElement=document.querySelector(this.settings.pagination),this.initialize()}Ajaxinate.prototype.initialize=function(){if(!this.containerElement)return;({click:this.addClickListener,scroll:this.addScrollListeners})[this.settings.method]()},Ajaxinate.prototype.addScrollListeners=function(){this.paginationElement&&(document.addEventListener("scroll",this.checkIfPaginationInView),window.addEventListener("resize",this.checkIfPaginationInView),window.addEventListener("orientationchange",this.checkIfPaginationInView))},Ajaxinate.prototype.addClickListener=function(){this.paginationElement&&(this.nextPageLinkElement=this.paginationElement.querySelector("a"),this.clickActive=!0,typeof this.nextPageLinkElement<"u"&&this.nextPageLinkElement!==null&&this.nextPageLinkElement.addEventListener("click",this.preventMultipleClicks))},Ajaxinate.prototype.preventMultipleClicks=function(event){event.preventDefault(),this.clickActive&&(this.nextPageLinkElement.innerText=this.settings.loadingText,this.nextPageUrl=this.nextPageLinkElement.href,this.clickActive=!1,this.loadMore())},Ajaxinate.prototype.checkIfPaginationInView=function(){const top=this.paginationElement.getBoundingClientRect().top-this.settings.offset,bottom=this.paginationElement.getBoundingClientRect().bottom+this.settings.offset;top<=window.innerHeight&&bottom>=0&&(this.nextPageLinkElement=this.paginationElement.querySelector("a"),this.removeScrollListener(),this.nextPageLinkElement&&(this.nextPageLinkElement.innerText=this.settings.loadingText,this.nextPageUrl=this.nextPageLinkElement.href,this.loadMore()))},Ajaxinate.prototype.loadMore=function(){this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){if(!this.request.responseXML||!this.request.readyState===4||!this.request.status===200)return;const newContainer=this.request.responseXML.querySelectorAll(this.settings.container)[0],newPagination=this.request.responseXML.querySelectorAll(this.settings.pagination)[0];this.containerElement.insertAdjacentHTML("beforeend",newContainer.innerHTML),typeof newPagination>"u"?this.removePaginationElement():(this.paginationElement.innerHTML=newPagination.innerHTML,this.settings.callback&&typeof this.settings.callback=="function"&&this.settings.callback(this.request.responseXML),this.initialize())}.bind(this),this.request.open("GET",this.nextPageUrl),this.request.responseType="document",this.request.send()},Ajaxinate.prototype.removeClickListener=function(){this.nextPageLinkElement.removeEventListener("click",this.preventMultipleClicks)},Ajaxinate.prototype.removePaginationElement=function(){this.paginationElement.innerHTML="",this.destroy()},Ajaxinate.prototype.removeScrollListener=function(){document.removeEventListener("scroll",this.checkIfPaginationInView),window.removeEventListener("resize",this.checkIfPaginationInView),window.removeEventListener("orientationchange",this.checkIfPaginationInView)},Ajaxinate.prototype.destroy=function(){return{click:this.removeClickListener,scroll:this.removeScrollListener}[this.settings.method](),this};var AjaxinateComponent=class{constructor(el){if(this.el=el,document.readyState!=="loading")var endlessScroll=new Ajaxinate({container:"#collection-list",pagination:"#AjaxinatePagination",method:"scroll",offset:1e3,loadingText:"Loading more..."});else document.addEventListener("DOMContentLoaded",function(){var endlessScroll2=new Ajaxinate({container:"#collection-list",pagination:"#AjaxinatePagination",method:"scroll",offset:1e3,loadingText:"Loading more..."})})}},Ajaxinate_default=AjaxinateComponent;export{Ajaxinate_default as default};/*! Bundled license information:
2
3ajaxinate/src/ajaxinate.js:
4  (* @preserve
5   * https://github.com/Elkfox/Ajaxinate
6   * Copyright (c) 2017 Elkfox Co Pty Ltd (elkfox.com)
7   * MIT License (do not remove above copyright!)
8   *)
9*/
10//# sourceMappingURL=/cdn/shop/t/6/assets/chunk--Ajaxinate-5BEN7YRK.vbt.js.map

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.