HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/ippmt.kauko.lt/wp-content/plugins/embedpress/assets/js/gallery-justify.js
(function(){
    function justifyGallery() {
        const justify_scale = screen.height * 0.2;
        let items = document.querySelectorAll('.photos-gallery-justify .photo-item');

        items.forEach(item => {
            let image = item.querySelector('img');
            if (!image) return;

            function adjustItem() {
                let ratio = image.naturalWidth / image.naturalHeight;
                item.style.width = justify_scale * ratio + 'px';
                item.style.flexGrow = ratio;
            }

            if (image.complete) {
                adjustItem();
            } else {
                image.onload = adjustItem;
            }
        });
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', justifyGallery);
    } else {
        justifyGallery();
    }


    window.addEventListener('load', justifyGallery);
})();

console.log("checking for justifyGallery");