<?php
// Copyright 1999-2024. WebPros International GmbH. All rights reserved.
?>
<div id="screenshot">
    <div class="package-img">
        <a href="#"><img src="<?php echo $this->escape($this->image['href']); ?>" alt="<?php echo $this->escape($this->image['name']);?>"/></a>
    </div>
</div>
<script>
Jsw.namespace('Smb.ImageGallery');
Smb.ImageGallery.openHandler = function (event) {
    new Jsw.PopupSlider({
        title: <?= $this->jsEscape($this->packageName) ?>,
        slides: ['<img class="slider__image" src="<?= $this->escape($this->image['href']) ?>"><div class="slider__content"><?= $this->escape($this->image['name']) ?></div>']
    });

    event.preventDefault();
    event.stopPropagation();
};

document.querySelectorAll('.package-img a').forEach(function (el) {
    el.addEventListener('click', Smb.ImageGallery.openHandler);
});

new Jsw.SmallButton({
    renderTo: 'screenshot',
    title: <?= $this->jsLmsg('smb.components.aps.package.enlangeScreenShot'); ?>,
    addCls: 'sb-preview',
    handler: Smb.ImageGallery.openHandler
});
</script>
