PageSourceSearch

https://neilsflowers.com/cdn/shop/t/38/assets/ajaxinate.min.js?v=108565611856585667051790758604

js neilsflowers.com collected 2026-10-08 23:05:02 UTC 4,949 bytes, 20 lines download raw bytes

1"use strict";/* ===================================================================================== @preserve =
2Ajaxinate
3version v2.0.11
4https://github.com/Elkfox/Ajaxinate
5Copyright (c) 2017 Elkfox Co Pty Ltd
6https://elkfox.com
7MIT License
8================================================================================================= */var Ajaxinate=function(a){/*
9    pagination: Selector of pagination container
10    method: [options are 'scroll', 'click']
11    container: Selector of repeating content
12    offset: 0, offset the number of pixels before the bottom to start loading more on scroll
13    loadingText: 'Loading', The text changed during loading
14    callback: null, function to callback after a new page is loaded
15  */ // Merge configs
16// Bind 'this' to applicable prototype functions
17// Set up our element selectors
18this.settings=Object.assign({pagination:"#paginate-on-scroll",method:"scroll",container:"#product-grid",offset:100,loadingText:"",callback:null,hideOnScroll:".pagination-wrapper"},a||{}),this.checkIfPaginationInView=this.checkIfPaginationInView.bind(this),this.addScrollListeners=this.addScrollListeners.bind(this),this.addClickListener=this.addClickListener.bind(this),this.removeScrollListener=this.removeScrollListener.bind(this),this.removeClickListener=this.removeClickListener.bind(this),this.stopMultipleClicks=this.stopMultipleClicks.bind(this),this.destroy=this.destroy.bind(this),this.containerElement=document.querySelector(this.settings.container),this.paginationElement=document.querySelector(this.settings.pagination),this.initialize()};function setLoading(a){var b=document.querySelector("#paginate-on-scroll .paginate_on_scroll");b&&(b.style.display=a?"block":"none")}Ajaxinate.prototype.initialize=function(){if(setLoading(!1),ftd.Helpers.injectShopperApprovedScript(),this.checkIfPaginationInView(),this.containerElement){var a={click:this.addClickListener,scroll:this.addScrollListeners};a[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,null!==this.nextPageLinkElement&&this.nextPageLinkElement.addEventListener("click",this.stopMultipleClicks))},Ajaxinate.prototype.stopMultipleClicks=function(a){a.preventDefault(),this.clickActive&&(this.nextPageLinkElement.innerHTML=this.settings.loadingText,this.nextPageUrl=this.nextPageLinkElement.href,this.clickActive=!1,this.loadMore())},Ajaxinate.prototype.checkIfPaginationInView=function(){if(this.paginationElement=document.querySelector(this.settings.pagination),this.containerElement=document.querySelector(this.settings.container),this.paginationElement){var a=this.paginationElement.getBoundingClientRect().top-this.settings.offset,b=this.paginationElement.getBoundingClientRect().bottom+this.settings.offset;if(a<=window.innerHeight&&0<=b){this.nextPageLinkElement=this.paginationElement.querySelector("a");var c=document.querySelector(this.settings.hideOnScroll);c&&c.setAttribute("aria-hidden","true"),this.removeScrollListener(),this.nextPageLinkElement&&(this.nextPageLinkElement.innerHTML=this.settings.loadingText,this.nextPageUrl=this.nextPageLinkElement.href,this.loadMore())}}},Ajaxinate.prototype.loadMore=function(){this.request=new XMLHttpRequest,setLoading(!0),this.request.onreadystatechange=function(){if(4===this.request.readyState&&200===this.request.status){var a=this.request.responseXML.querySelectorAll(this.settings.container)[0],b=this.request.responseXML.querySelectorAll(this.settings.pagination)[0];this.containerElement.insertAdjacentHTML("beforeend",a.innerHTML),setLoading(!1),b&&(ftd.Helpers.injectShopperApprovedScript(),this.paginationElement.innerHTML=b.innerHTML,this.settings.callback&&"function"==typeof this.settings.callback&&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.stopMultipleClicks)},Ajaxinate.prototype.removeScrollListener=function(){document.removeEventListener("scroll",this.checkIfPaginationInView),window.removeEventListener("resize",this.checkIfPaginationInView),window.removeEventListener("orientationchange",this.checkIfPaginationInView)},Ajaxinate.prototype.destroy=function(){// This method is used to unbind event listeners from the DOM
19// This function is called manually to destroy "this" Ajaxinate instance
20var a={click:this.removeClickListener,scroll:this.removeScrollListener};return a[this.settings.method](),this};

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.