PageSourceSearch

https://www.thomascoram.camden.sch.uk/_site/js/ecocycle.v2.min.js?cache=sdfsdf

js thomascoram.camden.sch.uk collected 2026-10-02 18:55:05 UTC 4,176 bytes, 1 lines download raw bytes

1var ecoCycle=function(target,opts){var ecoClass="ecocycle";this.defaults={childNodes:"",dots:!1,dotsChild:"<span></span>",dotsContainer:".ecocycle__dots",groupBy:1,log:!1,nav:!1,navChild:["<button>Prev</button>","<button>Next</button>"],navContainer:"ecocycle.__nav",onChange:function(intNext,intCount,opts){},onReady:function(opts){},pauseOnHover:!1,shuffle:!1,timeout:7e3};var blnTarget=null!=document.querySelector(target);if(blnTarget){for(var property in opts)opts.hasOwnProperty(property)&&(this.defaults[property]=opts[property]);var opts=this.defaults,blnMouseover=!1,intSlideIndex=0,trCurrentDir="next",ecoInterval,ecoTimer,slideItems;target=document.querySelector(target),slideItems=target.children,""!=opts.childNodes&&(opts.shuffle=!1,slideItems=target.querySelectorAll(opts.childNodes));var intItems=slideItems.length;opts.shuffle&&shuffleList(slideItems)}function runSlide(int,dir){opts.log&&console.log("ecocycle slide "+int),switchClasses(int,(function(){intItems>1&&opts.timeout&&(ecoTimer=function(){ecoInterval=setInterval((function(){setSlide(dir),switchClasses(intSlideIndex,(function(){}))}),opts.timeout)})()}))}function setSlide(direction){"prev"==direction?0==intSlideIndex?intSlideIndex=(Math.ceil(intItems/opts.groupBy)-1)*opts.groupBy:intSlideIndex-=opts.groupBy:intSlideIndex>=intItems-opts.groupBy?intSlideIndex=0:intSlideIndex+=opts.groupBy}function switchClasses(intSlideIndex,callback){function toggleActive(strEl,type){for(var i=0;i<intItems;i++)null!=strEl[i]&&strEl[i].classList.remove("active");switch(type){case"dots":null!=strEl[intSlideIndex/opts.groupBy]&&strEl[intSlideIndex/opts.groupBy].classList.add("active");break;default:for(var i=intSlideIndex;i<intSlideIndex+opts.groupBy;i++)null!=strEl[i]&&strEl[i].classList.add("active")}}opts.onChange(intSlideIndex,intItems-1,opts),null!=slideItems[intSlideIndex]&&imgLoadCheck(slideItems[intSlideIndex].querySelector("[data-src]"),!1,(function(){})),toggleActive(slideItems,""),opts.dots&&toggleActive(opts.dotsContainer.children,"dots"),callback()}function shuffleList(strEl){for(var temp=document.createDocumentFragment();strEl.length;)temp.appendChild(strEl[Math.floor(Math.random()*strEl.length)]);target.appendChild(temp)}this.init=function(){if(blnTarget){opts.log&&console.log("initialized ecocycle"),target.classList.add(ecoClass);for(var i=0;i<intItems;i++)slideItems[i].classList.add("ecocycle__item");if(opts.nav&&(opts.navContainer=document.querySelector(opts.navContainer),intItems>1&&(opts.navContainer.classList.add("ecocycle__nav"),appendNav("prev",opts.navContainer,opts.navChild[0],""),appendNav("next",opts.navContainer,opts.navChild[1],""))),opts.dots){opts.dotsContainer=document.querySelector(opts.dotsContainer),opts.dotsContainer.classList.add("ecocycle__dots");for(var i=0;i<intItems;i+=opts.groupBy)appendNav("dots",opts.dotsContainer,opts.dotsChild,i)}if(opts.pauseOnHover){var thisCycle=this;target.addEventListener("mouseenter",(function(){thisCycle.pause()})),target.addEventListener("mouseleave",(function(){thisCycle.play()}))}function createElementFromHTML(htmlString){var div=document.createElement("div");return div.innerHTML=htmlString.trim(),div.firstChild}function appendNav(strNavType,strContainer,navBtn,index){var navControl=createElementFromHTML(navBtn);navControl.addEventListener("click",(function(){clearInterval(ecoInterval),ecoInterval=null,"dots"==strNavType?intSlideIndex=index:setSlide(strNavType),runSlide(intSlideIndex,"next")}),!1),strContainer.appendChild(navControl)}opts.onReady(opts),this.play()}},this.play=function(){opts.log&&console.log("play ecocycle"),runSlide(intSlideIndex,"next")},this.pause=function(){blnTarget&&(opts.log&&console.log("pause ecocycle"),clearInterval(ecoInterval),ecoInterval=null)},this.prev=function(){setSlide("prev")},this.next=function(){setSlide("next")},this.destroy=function(){if(opts.log&&console.log("destroy ecocycle"),blnTarget){clearInterval(ecoInterval),ecoInterval=null,target.classList.remove(ecoClass);for(var i=0;i<intItems;i++)slideItems[i].classList.remove("ecocycle__item"),slideItems[i].classList.remove("active");opts.navContainer.innerHTML="",opts.dotsContainer.innerHTML=""}}};

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.