AnonSec Team
Server IP : 10.131.40.8  /  Your IP : 216.73.216.37
Web Server : Apache
System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : ludmqhh ( 137773)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/ludmqhh/www/hotel-forum/wp-content/plugins/wp-hotelier/assets/js/frontend/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/ludmqhh/www/hotel-forum/wp-content/plugins/wp-hotelier/assets/js/frontend/photoswipe.init.js
jQuery(function ($) {
	'use strict';
	/* global PhotoSwipe, PhotoSwipeUI_Default, jQuery */

	var pswp = $('.pswp')[0];

	$('.room__gallery, .room-card__gallery').each(function () {
		var _this = $(this);
		var getItems = function () {
			var items = [];

			_this.find('a.room__gallery-thumbnail').each(function () {
				var href = $(this).attr('href');
				var size = $(this).data('size').split('x');
				var title = $(this).attr('title');
				var width = size[0];
				var height = size[1];

				var item = {
					src: href,
					title: title,
					w: width,
					h: height
				};

				items.push(item);
			});

			return items;
		};

		var items = getItems();

		_this.on('click', 'a.room__gallery-thumbnail, a.room__gallery-link', function (e) {
			e.preventDefault();

			var index = $(this).data('index');
			var options = {
				index: parseInt(index, 10),
				showHideOpacity: true,
				shareEl: false,
				captionEl: true
			};

			// Initialize PhotoSwipe
			var lightBox = new PhotoSwipe(pswp, PhotoSwipeUI_Default, items, options);
			lightBox.init();
		});
	});
});

AnonSec - 2021