PageSourceSearch

https://www.progressiveautomations.com/cdn/shop/t/120/assets/ajaxinate.js?v=12037356163371213811711639986

js progressiveautomations.com collected 2026-09-25 23:57:06 UTC 5,042 bytes, 6 lines download raw bytes

1/* @preserve
2 * https://github.com/Elkfox/Ajaxinate
3 * Copyright (c) 2017 Elkfox Co Pty Ltd (elkfox.com)
4 * MIT License (do not remove above copyright!)
5 */function Ajaxinate(config){var 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){var initializers={click:this.addClickListener,scroll:this.addScrollListeners};initializers[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.nextPageLinkTextElement=this.nextPageLinkElement.querySelector("span"),this.clickActive=!0,typeof this.nextPageLinkElement!="undefined"&&this.nextPageLinkElement!==null&&this.nextPageLinkElement.addEventListener("click",this.preventMultipleClicks))},Ajaxinate.prototype.preventMultipleClicks=function(event){event.preventDefault(),this.clickActive&&(this.nextPageLinkTextElement&&(this.nextPageLinkTextElement.innerText=this.settings.loadingText),this.nextPageUrl=this.nextPageLinkElement.href,this.clickActive=!1,this.loadMore())},Ajaxinate.prototype.checkIfPaginationInView=function(){var 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.nextPageLinkTextElement&&(this.nextPageLinkTextElement.innerText=this.settings.loadingText),this.nextPageUrl=this.nextPageLinkElement.href,this.loadMore()))},Ajaxinate.prototype.loadMore=function(){var _this=this;fetch(_this.nextPageUrl,{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){var tempElement=document.createElement("div");tempElement.innerHTML=content;var newContainer=tempElement.querySelectorAll(_this.settings.container)[0],newPagination=tempElement.querySelectorAll(_this.settings.pagination)[0],childNodes=newContainer.childNodes;childNodes.length&&childNodes.forEach(function(item,index){item.tagName=="DIV"&&item.classList.add("just_added")}),_this.containerElement.insertAdjacentHTML("beforeend",newContainer.innerHTML),typeof newPagination=="undefined"?_this.removePaginationElement():(_this.paginationElement.innerHTML=newPagination.innerHTML,_this.settings.callback&&typeof _this.settings.callback=="function"&&_this.settings.callback(),_this.initialize())})}),this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){if(this.request.responseXML&&!(!this.request.readyState===4||!this.request.status===200)){var 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=="undefined"?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)},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(){var destroyers={click:this.removeClickListener,scroll:this.removeScrollListener};return destroyers[this.settings.method](),this};
6//# sourceMappingURL=/cdn/shop/t/120/assets/ajaxinate.js.map?v=12037356163371213811711639986

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.