PageSourceSearch

https://weart.it/wp-content/cache/min/1/wp-content/plugins/embedpress/assets/js/lazy-load.js?ver=1776959361

js weart.it collected 2026-10-03 19:58:43 UTC 2,277 bytes, 11 lines download raw bytes

1(function(){'use strict';if(!('IntersectionObserver' in window)){console.warn('EmbedPress Lazy Load: IntersectionObserver not supported, loading all iframes immediately');loadAllIframes();return}
2function getObserverConfig(){const viewportHeight=window.innerHeight;const margin=Math.min(200,Math.max(50,viewportHeight*0.25));return{rootMargin:margin+'px 0px',threshold:0.01}}
3const observerConfig=getObserverConfig();function onIntersection(entries,observer){entries.forEach(function(entry){if(entry.isIntersecting){const placeholder=entry.target;loadIframe(placeholder);observer.unobserve(placeholder)}})}
4function loadIframe(placeholder){const iframeSrc=placeholder.getAttribute('data-ep-lazy-src');if(!iframeSrc){console.warn('EmbedPress Lazy Load: No data-ep-lazy-src found on placeholder');return}
5const iframe=document.createElement('iframe');iframe.src=iframeSrc;const iframeStyle=placeholder.getAttribute('data-ep-iframe-style');if(iframeStyle){iframe.setAttribute('style',iframeStyle)}
6Array.from(placeholder.attributes).forEach(function(attr){if(attr.name.startsWith('data-ep-iframe-')){const iframeAttr=attr.name.replace('data-ep-iframe-','');if(iframeAttr!=='style'){iframe.setAttribute(iframeAttr,attr.value)}}});if(placeholder.hasAttribute('class')){const classes=placeholder.getAttribute('class').replace(/ep-lazy-iframe-placeholder/g,'').trim();if(classes){iframe.setAttribute('class',classes)}}['data-emid','data-embedpress-content','data-embed-type','title'].forEach(function(attr){if(placeholder.hasAttribute(attr)){iframe.setAttribute(attr,placeholder.getAttribute(attr))}});if(placeholder.parentNode){placeholder.parentNode.replaceChild(iframe,placeholder)}}
7function loadAllIframes(){const placeholders=document.querySelectorAll('.ep-lazy-iframe-placeholder');placeholders.forEach(function(placeholder){loadIframe(placeholder)})}
8function initLazyLoad(){const placeholders=document.querySelectorAll('.ep-lazy-iframe-placeholder');if(placeholders.length===0){return}
9const observer=new IntersectionObserver(onIntersection,observerConfig);placeholders.forEach(function(placeholder){observer.observe(placeholder)})}
10if(document.readyState==='loading'){setTimeout(initLazyLoad,1000)}else{setTimeout(initLazyLoad,1000)}
11window.epReinitLazyLoad=initLazyLoad})()

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.