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

2 lines
20 KiB
JavaScript
Raw Normal View History

2025-06-09 09:58:01 +02:00
"use strict";(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c){return c(i,!0)}if(u){return u(i,!0)}var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i+=1){o(t[i])}return o}return r})()({1:[function(require,module,exports){const Lightbox=require("./lightbox")},{"./lightbox":2}],2:[function(require,module,exports){const Lightbox=require("./lightbox/Lightbox");(function($){$.fn.lightbox={};$.fn.lightbox.parseJsonData=function(data){var imageArray=[];$.each(data,function(){imageArray.push([this.url,this.title])});return imageArray};$.fn.lightbox.defaults={adminBarHeight:28,overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null,followScroll:false,isIE8:false };$(document).ready(function($){var haveConf=(typeof JQLBSettings=='object');if(haveConf&&JQLBSettings.resizeSpeed){JQLBSettings.resizeSpeed=parseInt(JQLBSettings.resizeSpeed)}if(haveConf&&JQLBSettings.marginSize){JQLBSettings.marginSize=parseInt(JQLBSettings.marginSize)}var default_strings={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'};new Lightbox($('a[rel^="lightbox"]'),{adminBarHeight:$('#wpadminbar').height()||0,linkTarget:(haveConf&&JQLBSettings.linkTarget.length)?JQLBSettings.linkTarget:'_self',displayHelp:(haveConf&&JQLBSettings.help.length)?true:false,marginSize:(haveConf&&JQLBSettings.marginSize)?JQLBSettings.marginSize:0,fitToScreen:(haveConf&&JQLBSettings.fitToScreen=='1')?true:false,resizeSpeed:(haveConf&&JQLBSettings.resizeSpeed>=0)?JQLBSettings.resizeSpeed:400,displayDownloadLink:(haveConf&&JQLBSettings.displayDownloadLink=='0')?false:true,navbarOnTop:(haveConf&&JQLBSettings.navbarOnTop=='0')?false:true,strings:(haveConf&&typeof JQLBSettings.help=='string')?JQLBSettings:default_strings})})})(jQuery)},{"./lightbox/Lightbox":6}],3:[function(require,module,exports){const $=window.jQuery;class Display{constructor(config,helper){this.config=config;this.helper=helper}changeImage(imageNum){if(this.config.inprogress==false){this.config.inprogress=true;this.config.activeImage=imageNum;const loading=document.getElementById('loading');const lightboxImage=document.getElementById('lightboxImage');const hoverNav=document.getElementById('hoverNav');const prevLink=document.getElementById('prevLink');const nextLink=document.getElementById('nextLink');if(loading){this.helper.show(loading)}if(lightboxImage){this.helper.hide(lightboxImage)}if(hoverNav){this.helper.hide(hoverNav)}if(prevLink){this.helper.hide(prevLink)}if(nextLink){this.helper.hide(nextLink)}this.doChangeImage()}};doChangeImage(){this.config.imgPreloader=new Image();this.config.imgPreloader.onload=_=>{const lightboxImage=document.getElementById('lightboxImage');if(lightboxImage){lightboxImage.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 overlay=document.getElementById('overlay');if(!overlay||!this.config.imgPreloader){return}var newWidth=this.config.imgPreloader.width;var newHeight=this.config.imgPreloader.height;var arrayPageSize=this.helper.getPageSize();var noScrollWidth=(arrayPageSize.pageWindowWidth<arrayPageSize.pageDocumentWidth)?arrayPageSize.pageDocumentWidth:arrayPageSize.pageWindowWidth;overlay.style.width=noScrollWidth+'px';overlay.style.height=arrayPageSize.pageDocumentHeight+'px';const imageDataContainer=d