PageSourceSearch

https://expert.ru/js/GalleryController.js

js expert.ru collected 2026-09-24 07:50:11 UTC 1,367 bytes, 1 lines download raw bytes

1var n=Object.defineProperty;var i=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var o=(r,e,t)=>(i(r,typeof e!="symbol"?e+"":e,t),t);const m="[data-js-gallery]";class u{constructor(e){o(this,"rootElement");o(this,"cards");o(this,"selectors",{card:"[data-js-gallery-card]",vkFrame:"[data-js-card-gallery-video]"});this.rootElement=e,this.cards=this.rootElement.querySelectorAll(this.selectors.card),this.init()}init(){this.cards.forEach(e=>{const t=e.querySelector("video");t&&(e.addEventListener("mouseenter",()=>{t.currentTime=0,t.play().catch(()=>{})}),e.addEventListener("mouseleave",()=>{t.pause(),t.currentTime=0}));const a=e.querySelector(this.selectors.vkFrame);if(a){const c=a.getAttribute("src");if(c)try{const s=new URL(c);s.searchParams.has("autoplay")||s.searchParams.set("autoplay","1"),s.searchParams.has("muted")||s.searchParams.set("muted","1");const l=s.toString();e.addEventListener("mouseenter",()=>{a.src!==l&&(a.src=l)}),e.addEventListener("mouseleave",()=>{a.src&&(a.src="")})}catch(s){console.log("Ошибка синтаксического анализа URL-адреса iframe",c,s)}}})}}class h{constructor(){this.init()}init(){document.querySelectorAll(m).forEach(t=>{if(!(t instanceof HTMLElement))throw new Error(`Gallery element is not HTMLElement: ${t}`);new u(t)})}}export{h as GalleryController};

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.