kollapsminoriteten/wp-content/plugins/wp-lightbox-2/js/dist/wp-lightbox-2.min.js

1 line
15 KiB
JavaScript
Raw Permalink Normal View History

2026-03-31 11:30:59 +02:00
!function e(t,i,n){function o(s,r){if(!i[s]){if(!t[s]){var g="function"==typeof require&&require;if(!r&&g)return g(s,!0);if(a)return a(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var l=i[s]={exports:{}};t[s][0].call(l.exports,function(e){return o(t[s][1][e]||e)},l,l.exports,e,t,i,n)}return i[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t,i){e("./lightbox")},{"./lightbox":2}],2:[function(e,t,i){const n=e("./lightbox/Lightbox");var o;(o=jQuery).fn.lightbox={},o.fn.lightbox.parseJsonData=function(e){var t=[];return o.each(e,function(){t.push(new Array(this.url,this.title))}),t},o.fn.lightbox.defaults={adminBarHeight:28,overlayOpacity:.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:!1,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:!0,disableNavbarLinks:!0,loopImages:!0,imageClickClose:!0,jsonData:null,jsonDataParser:null,followScroll:!1,isIE8:!1},o(document).ready(function(e){var t="object"==typeof JQLBSettings;t&&JQLBSettings.resizeSpeed&&(JQLBSettings.resizeSpeed=parseInt(JQLBSettings.resizeSpeed)),t&&JQLBSettings.marginSize&&(JQLBSettings.marginSize=parseInt(JQLBSettings.marginSize)),new n(e('a[rel^="lightbox"]'),{adminBarHeight:e("#wpadminbar").height()||0,linkTarget:t&&JQLBSettings.linkTarget.length?JQLBSettings.linkTarget:"_self",displayHelp:!(!t||!JQLBSettings.help.length),marginSize:t&&JQLBSettings.marginSize?JQLBSettings.marginSize:0,fitToScreen:!(!t||"1"!=JQLBSettings.fitToScreen),resizeSpeed:t&&JQLBSettings.resizeSpeed>=0?JQLBSettings.resizeSpeed:400,displayDownloadLink:!t||"0"!=JQLBSettings.displayDownloadLink,navbarOnTop:!t||"0"!=JQLBSettings.navbarOnTop,strings:t&&"string"==typeof JQLBSettings.help?JQLBSettings:{help:" Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Download"}})})},{"./lightbox/Lightbox":6}],3:[function(e,t,i){const n=window.jQuery;t.exports=class{constructor(e,t){this.config=e,this.helper=t}changeImage(e){if(0==this.config.inprogress){this.config.inprogress=!0,this.config.activeImage=e;const t=document.getElementById("loading"),i=document.getElementById("lightboxImage"),n=document.getElementById("hoverNav"),o=document.getElementById("prevLink"),a=document.getElementById("nextLink");t&&this.helper.show(t),i&&this.helper.hide(i),n&&this.helper.hide(n),o&&this.helper.hide(o),a&&this.helper.hide(a),this.doChangeImage()}}doChangeImage(){this.config.imgPreloader=new Image,this.config.imgPreloader.onload=e=>{const t=document.getElementById("lightboxImage");t&&(t.src=this.config.imageArray[this.config.activeImage][0]),this.doScale(),this.preloadNeighborImages()},this.config.imgPreloader.src=this.config.imageArray[this.config.activeImage][0]}doScale(){this.updateDetails();const e=document.getElementById("overlay");if(!e||!this.config.imgPreloader)return;var t=this.config.imgPreloader.width,i=this.config.imgPreloader.height,n=this.helper.getPageSize(),o=n.pageWindowWidth<n.pageDocumentWidth?n.pageDocumentWidth:n.pageWindowWidth;e.style.width=o+"px",e.style.height=n.pageDocumentHeight+"px";const a=document.getElementById("imageDataContainer");var s=n.viewportHeight-(a.offsetHeight+2*this.config.borderSize),r=n.pageWindowWidth-2*this.config.borderSize;if(this.config.fitToScreen){var g=s-this.config.marginSize,h=r-this.config.marginSize,l=1;i>g&&(l=g/i),t*=l,i*=l,l=1,t>h&&(l=h/t),t=Math.round(t*l),i=Math.round(i*l)}var c=this.helper.getPageScroll(),d=c.yScroll+.5*s-.5*i,m=c.xScroll;const f=document.getElementById("lightboxImage");f.style.width=t,f.style.height=i,this.resizeImageContainer(t,i,d,m)}resizeImageContainer(e,t,i,o){const a=document.getElementById("outerImageContainer"),s=document.getElementById("imageDataContainer");if(a&&s){this.config.widthCurrent=a.offsetWidth,this.config.heightCurrent=a.offsetHeight;var r=Math.max(350,e+2*(this.co