(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/app-image/gallery"],{1019:(t,e,n)=>{"use strict";n.r(e);var s=n(144);class i extends s.Component{_initConfiguration(t){super._initConfiguration({locale:s.Locale.getSection("smb.controllers.app-image.gallery"),...t}),this._images=this._getConfigParam("images",[])}_initComponentElement(){super._initComponentElement(),this._componentElement.innerHTML='<div class="topline">'+'<span id="'.concat(this.getId(),'-close" class="close">')+'<a class="toplink" id="'.concat(this.getId(),'-close">').concat(this.lmsg("closeGallery"),"</a>")+"</span>"+'<span id="'.concat(this.getId(),'-navigation" class="navigation">')+'<a class="toplink" id="'.concat(this.getId(),'-prev">').concat(this.lmsg("prevImage"),"</a>")+"&nbsp|&nbsp;"+'<a class="toplink" id="'.concat(this.getId(),'-next">').concat(this.lmsg("nextImage"),"</a>")+"&nbsp;</span><span>"+'<span id="'.concat(this.getId(),'-current"></span> ').concat(this.lmsg("navigationOf"),' <span id="').concat(this.getId(),'-total"></span> ').concat(this.lmsg("typeScreenshot"))+"</span></div>"+'<div id="'.concat(this.getId(),'-images" class="screenshots-images">')+'<img id="'.concat(this.getId(),'-image" />')+'<div id="'.concat(this.getId(),'-image_title" class="screenshots-title"></div>')+"</div>"}_addEvents(){this._componentElement.querySelectorAll("#".concat(this.getId(),"-close")).forEach((t=>{t.addEventListener("click",this.close.bind(this))})),this._componentElement.querySelectorAll("#".concat(this.getId(),"-prev")).forEach((t=>{t.addEventListener("click",this.prev.bind(this))})),this._componentElement.querySelectorAll("#".concat(this.getId(),"-next")).forEach((t=>{t.addEventListener("click",this.next.bind(this))})),this.show(0)}getCount(){return this._images.length}show(t){this.getCount()<2&&this._componentElement.querySelectorAll('[id="'.concat(this.getId(),'-navigation"]')).forEach((t=>{t.style.display="none"})),this._componentElement.querySelectorAll('[id="'.concat(this.getId(),'-total"]')).forEach((t=>{t.innerHTML=this.getCount()})),0!==this.getCount()&&(t>=this.getCount()?t=0:t<0&&(t=this.getCount()-1),this._componentElement.querySelectorAll('img[id="'.concat(this.getId(),'-image"]')).forEach((e=>{e.src=this._images[t].href})),this._componentElement.querySelectorAll('[id="'.concat(this.getId(),'-image_title"]')).forEach((e=>{e.innerHTML=(0,s.escapeHtml)(this._images[t].name)})),this._componentElement.querySelectorAll('[id="'.concat(this.getId(),'-current"]')).forEach((e=>{e.innerHTML=t+1})),this.current=t)}next(){this.show(this.current+1)}prev(){this.show(this.current-1)}close(){window.close()}}e.default=t=>new i(t)}}]);
//# sourceMappingURL=gallery.js.map?9d5165c90fdbe6a53fc1