Файловый менеджер - Редактировать - /home/harasnat/www/horse/wp-content/plugins/web-stories/assets/js/chunk-web-stories-glider.js
Назад
(globalThis.webpackChunkweb_stories_wp=globalThis.webpackChunkweb_stories_wp||[]).push([[307],{443:(t,e,i)=>{var o,s;void 0===(s="function"==typeof(o=function(){var t="undefined"!=typeof window?window:this,e=t.Glider=function(e,i){var o=this;if(e._glider)return e._glider;if(o.ele=e,o.ele.classList.add("glider"),o.ele._glider=o,o.opt=Object.assign({},{slidesToScroll:1,slidesToShow:1,resizeLock:!0,duration:.5,passiveListeners:!1,easing:function(t,e,i,o,s){return o*(e/=s)*e+i}},i),o.animate_id=o.page=o.slide=0,o.arrows={},o._opt=o.opt,o.opt.skipTrack)o.track=o.ele.children[0];else for(o.track=document.createElement("div"),o.ele.appendChild(o.track);1!==o.ele.children.length;)o.track.appendChild(o.ele.children[0]);o.track.classList.add("glider-track"),o.init(),o.resize=o.init.bind(o,!0),o.event(o.ele,"add",{scroll:o.updateControls.bind(o)},{passive:o.opt.passiveListeners}),o.event(t,"add",{resize:o.resize})},i=e.prototype;return i.init=function(t,e){var i=this,o=0,s=0;i.slides=i.track.children,[].forEach.call(i.slides,(function(t,e){t.classList.add("glider-slide"),t.setAttribute("data-gslide",e)})),i.containerWidth=i.ele.clientWidth;var r=i.settingsBreakpoint();if(e||(e=r),"auto"===i.opt.slidesToShow||void 0!==i.opt._autoSlide){var l=i.containerWidth/i.opt.itemWidth;i.opt._autoSlide=i.opt.slidesToShow=i.opt.exactWidth?l:Math.max(1,Math.floor(l))}"auto"===i.opt.slidesToScroll&&(i.opt.slidesToScroll=Math.floor(i.opt.slidesToShow)),i.itemWidth=i.opt.exactWidth?i.opt.itemWidth:i.containerWidth/i.opt.slidesToShow,[].forEach.call(i.slides,(function(t){t.style.height="auto",t.style.width=i.itemWidth+"px",o+=i.itemWidth,s=Math.max(t.offsetHeight,s)})),i.track.style.width=o+"px",i.trackWidth=o,i.isDrag=!1,i.preventClick=!1,i.move=!1,i.opt.resizeLock&&i.scrollTo(i.slide*i.itemWidth,0),(r||e)&&(i.bindArrows(),i.buildDots(),i.bindDrag()),i.updateControls(),i.emit(t?"refresh":"loaded")},i.bindDrag=function(){var t=this;t.mouse=t.mouse||t.handleMouse.bind(t);var e=function(){t.mouseDown=void 0,t.ele.classList.remove("drag"),t.isDrag&&(t.preventClick=!0),t.isDrag=!1};const i=function(){t.move=!0};var o={mouseup:e,mouseleave:e,mousedown:function(e){e.preventDefault(),e.stopPropagation(),t.mouseDown=e.clientX,t.ele.classList.add("drag"),t.move=!1,setTimeout(i,300)},touchstart:function(e){t.ele.classList.add("drag"),t.move=!1,setTimeout(i,300)},mousemove:t.mouse,click:function(e){t.preventClick&&t.move&&(e.preventDefault(),e.stopPropagation()),t.preventClick=!1,t.move=!1}};t.ele.classList.toggle("draggable",!0===t.opt.draggable),t.event(t.ele,"remove",o),t.opt.draggable&&t.event(t.ele,"add",o,{passive:t.opt.passiveListeners})},i.buildDots=function(){var t=this;if(t.opt.dots){if("string"==typeof t.opt.dots?t.dots=document.querySelector(t.opt.dots):t.dots=t.opt.dots,t.dots){t.dots.innerHTML="",t.dots.setAttribute("role","tablist"),t.dots.classList.add("glider-dots");for(var e=0;e<Math.ceil(t.slides.length/t.opt.slidesToShow);++e){var i=document.createElement("button");i.dataset.index=e,i.setAttribute("aria-label","Page "+(e+1)),i.setAttribute("role","tab"),i.className="glider-dot "+(e?"":"active"),t.event(i,"add",{click:t.scrollItem.bind(t,e,!0)}),t.dots.appendChild(i)}}}else t.dots&&(t.dots.innerHTML="")},i.bindArrows=function(){var t=this;t.opt.arrows?["prev","next"].forEach((function(e){var i=t.opt.arrows[e];i&&("string"==typeof i&&(i=document.querySelector(i)),i&&(i._func=i._func||t.scrollItem.bind(t,e),t.event(i,"remove",{click:i._func}),t.event(i,"add",{click:i._func}),t.arrows[e]=i))})):Object.keys(t.arrows).forEach((function(e){var i=t.arrows[e];t.event(i,"remove",{click:i._func})}))},i.updateControls=function(t){var e=this;t&&!e.opt.scrollPropagate&&t.stopPropagation();var i=e.containerWidth>=e.trackWidth;e.opt.rewind||(e.arrows.prev&&(e.arrows.prev.classList.toggle("disabled",e.ele.scrollLeft<=0||i),e.arrows.prev.setAttribute("aria-disabled",e.arrows.prev.classList.contains("disabled"))),e.arrows.next&&(e.arrows.next.classList.toggle("disabled",Math.ceil(e.ele.scrollLeft+e.containerWidth)>=Math.floor(e.trackWidth)||i),e.arrows.next.setAttribute("aria-disabled",e.arrows.next.classList.contains("disabled")))),e.slide=Math.round(e.ele.scrollLeft/e.itemWidth),e.page=Math.round(e.ele.scrollLeft/e.containerWidth);var o=e.slide+Math.floor(Math.floor(e.opt.slidesToShow)/2),s=Math.floor(e.opt.slidesToShow)%2?0:o+1;1===Math.floor(e.opt.slidesToShow)&&(s=0),e.ele.scrollLeft+e.containerWidth>=Math.floor(e.trackWidth)&&(e.page=e.dots?e.dots.children.length-1:0),[].forEach.call(e.slides,(function(t,i){var r=t.classList,l=r.contains("visible"),a=e.ele.scrollLeft,n=e.ele.scrollLeft+e.containerWidth,d=e.itemWidth*i,c=d+e.itemWidth;[].forEach.call(r,(function(t){/^left|right/.test(t)&&r.remove(t)})),r.toggle("active",e.slide===i),o===i||s&&s===i?r.add("center"):(r.remove("center"),r.add([i<o?"left":"right",Math.abs(i-(i<o?o:s||o))].join("-")));var h=Math.ceil(d)>=Math.floor(a)&&Math.floor(c)<=Math.ceil(n);r.toggle("visible",h),h!==l&&e.emit("slide-"+(h?"visible":"hidden"),{slide:i})})),e.dots&&[].forEach.call(e.dots.children,(function(t,i){t.classList.toggle("active",e.page===i)})),t&&e.opt.scrollLock&&(clearTimeout(e.scrollLock),e.scrollLock=setTimeout((function(){clearTimeout(e.scrollLock),Math.abs(e.ele.scrollLeft/e.itemWidth-e.slide)>.02&&(e.mouseDown||e.trackWidth>e.containerWidth+e.ele.scrollLeft&&e.scrollItem(e.getCurrentSlide()))}),e.opt.scrollLockDelay||250))},i.getCurrentSlide=function(){var t=this;return t.round(t.ele.scrollLeft/t.itemWidth)},i.scrollItem=function(t,e,i){i&&i.preventDefault();var o=this,s=t;++o.animate_id;var r,l=o.slide;if(!0===e)r=(t=Math.round(t*o.containerWidth/o.itemWidth))*o.itemWidth;else{if("string"==typeof t){var a="prev"===t;if(t=o.opt.slidesToScroll%1||o.opt.slidesToShow%1?o.getCurrentSlide():o.slide,a?t-=o.opt.slidesToScroll:t+=o.opt.slidesToScroll,o.opt.rewind){var n=o.ele.scrollLeft;t=a&&!n?o.slides.length:!a&&n+o.containerWidth>=Math.floor(o.trackWidth)?0:t}}t=Math.max(Math.min(t,o.slides.length),0),o.slide=t,r=o.itemWidth*t}return o.emit("scroll-item",{prevSlide:l,slide:t}),o.scrollTo(r,o.opt.duration*Math.abs(o.ele.scrollLeft-r),(function(){o.updateControls(),o.emit("animated",{value:s,type:"string"==typeof s?"arrow":e?"dot":"slide"})})),!1},i.settingsBreakpoint=function(){var e=this,i=e._opt.responsive;if(i){i.sort((function(t,e){return e.breakpoint-t.breakpoint}));for(var o=0;o<i.length;++o){var s=i[o];if(t.innerWidth>=s.breakpoint)return e.breakpoint!==s.breakpoint&&(e.opt=Object.assign({},e._opt,s.settings),e.breakpoint=s.breakpoint,!0)}}var r=0!==e.breakpoint;return e.opt=Object.assign({},e._opt),e.breakpoint=0,r},i.scrollTo=function(e,i,o){var s=this,r=(new Date).getTime(),l=s.animate_id,a=function(){var n=(new Date).getTime()-r;s.ele.scrollLeft=s.ele.scrollLeft+(e-s.ele.scrollLeft)*s.opt.easing(0,n,0,1,i),n<i&&l===s.animate_id?t.requestAnimationFrame(a):(s.ele.scrollLeft=e,o&&o.call(s))};t.requestAnimationFrame(a)},i.removeItem=function(t){var e=this;e.slides.length&&(e.track.removeChild(e.slides[t]),e.refresh(!0),e.emit("remove"))},i.addItem=function(t){var e=this;e.track.appendChild(t),e.refresh(!0),e.emit("add")},i.handleMouse=function(t){var e=this;e.mouseDown&&(e.isDrag=!0,e.ele.scrollLeft+=(e.mouseDown-t.clientX)*(e.opt.dragVelocity||3.3),e.mouseDown=t.clientX)},i.round=function(t){var e=1/(this.opt.slidesToScroll%1||1);return Math.round(t*e)/e},i.refresh=function(t){this.init(!0,t)},i.setOption=function(t,e){var i=this;i.breakpoint&&!e?i._opt.responsive.forEach((function(e){e.breakpoint===i.breakpoint&&(e.settings=Object.assign({},e.settings,t))})):i._opt=Object.assign({},i._opt,t),i.breakpoint=0,i.settingsBreakpoint()},i.destroy=function(){var e=this,i=e.ele.cloneNode(!0),o=function(t){t.removeAttribute("style"),[].forEach.call(t.classList,(function(e){/^glider/.test(e)&&t.classList.remove(e)}))};e.opt.skipTrack||(i.children[0].outerHTML=i.children[0].innerHTML),o(i),[].forEach.call(i.getElementsByTagName("*"),o),e.ele.parentNode.replaceChild(i,e.ele),e.event(t,"remove",{resize:e.resize}),e.emit("destroy")},i.emit=function(e,i){var o=this,s=new t.CustomEvent("glider-"+e,{bubbles:!o.opt.eventPropagate,detail:i});o.ele.dispatchEvent(s)},i.event=function(t,e,i){var o=t[e+"EventListener"].bind(t);Object.keys(i).forEach((function(t){o(t,i[t])}))},e})?o.call(e,i,e,t):o)||(t.exports=s)},744:(t,e,i)=>{"use strict";i.d(e,{default:()=>r});var o=i(443),s=i.n(o);s().prototype.scrollItem=function(t,e,i){if(void 0===i&&e?.target&&(i=e,e=!1),void 0===i)return!1;if(i&&i.preventDefault(),this.opt.slidesToScroll=Math.max(1,this.opt.slidesToScroll),this.opt.slidesToShow=Math.max(1,this.opt.slidesToShow),this.itemWidth===Number.POSITIVE_INFINITY){const t=i.target.parentElement?.querySelector(".web-stories-list__carousel"),e=window.getComputedStyle(t.querySelector(".web-stories-list__story"));this.itemWidth=Number.parseFloat(e.width)+(Number.parseFloat(e.marginLeft)+Number.parseFloat(e.marginRight))}const o=t;if(++this.animate_id,!0===e)t*=this.containerWidth,t=Math.round(t/this.itemWidth)*this.itemWidth;else{if("string"==typeof t){const e="prev"===t;if(t=this.opt.slidesToScroll%1||this.opt.slidesToShow%1?this.getCurrentSlide():isNaN(this.slide)?0:this.slide,e?t-=this.opt.slidesToScroll:t+=this.opt.slidesToScroll,this.opt.rewind){const i=this.ele.scrollLeft;t=e&&!i?this.slides.length:!e&&i+this.containerWidth>=Math.floor(this.trackWidth)?0:t}}t=Math.min(t,this.slides.length),this.slide=t,t=this.itemWidth*t}return this.scrollTo(t,this.opt.duration*Math.abs(this.ele.scrollLeft-t),(function(){this.updateControls(),this.emit("animated",{value:o,type:"string"==typeof o?"arrow":e?"dot":"slide"})})),!1};const r=s()}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка