HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/image-grid.tar
assets/banner.svg000064400000003362151542205200010034 0ustar00<svg fill="none" height="120" viewBox="0 0 120 120" width="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h120v120h-120z"/></clipPath><g clip-path="url(#a)"><path d="m0 0h120v120h-120z" fill="#1880b6"/><g stroke="#324249" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m27 61.8214h30.1786v30.1786h-30.1786z" fill="#8ed9ef"/><path d="m57.1786 92h-30.1786l16.9464-16.9465c.9286-.9285 2.3215-.9285 3.25 0l9.9822 9.9822z" fill="#f2f0da"/><path d="m36.2857 75.75c2.5642 0 4.6429-2.0787 4.6429-4.6428 0-2.5642-2.0787-4.6429-4.6429-4.6429-2.5641 0-4.6428 2.0787-4.6428 4.6429 0 2.5641 2.0787 4.6428 4.6428 4.6428z" fill="#f2f0da"/><path d="m61.8214 61.8214h30.1786v30.1786h-30.1786z" fill="#8ed9ef"/><path d="m92.0001 92h-30.1786l16.9464-16.9465c.9286-.9285 2.3215-.9285 3.25 0l9.9822 9.9822z" fill="#f2f0da"/><path d="m71.1072 75.75c2.5642 0 4.6429-2.0787 4.6429-4.6428 0-2.5642-2.0787-4.6429-4.6429-4.6429s-4.6428 2.0787-4.6428 4.6429c0 2.5641 2.0786 4.6428 4.6428 4.6428z" fill="#f2f0da"/><path d="m27 27h30.1786v30.1786h-30.1786z" fill="#8ed9ef"/><path d="m57.1786 57.1786h-30.1786l16.9464-16.9465c.9286-.9285 2.3215-.9285 3.25 0l9.9822 9.9822z" fill="#f2f0da"/><path d="m36.2857 40.9286c2.5642 0 4.6429-2.0787 4.6429-4.6429s-2.0787-4.6428-4.6429-4.6428c-2.5641 0-4.6428 2.0786-4.6428 4.6428s2.0787 4.6429 4.6428 4.6429z" fill="#f2f0da"/><path d="m61.8214 27h30.1786v30.1786h-30.1786z" fill="#8ed9ef"/><g fill="#f2f0da"><path d="m92.0001 57.1786h-30.1786l16.9464-16.9465c.9286-.9285 2.3215-.9285 3.25 0l9.9822 9.9822z"/><path d="m71.1072 40.9286c2.5642 0 4.6429-2.0787 4.6429-4.6429s-2.0787-4.6428-4.6429-4.6428-4.6428 2.0786-4.6428 4.6428 2.0786 4.6429 4.6428 4.6429z"/></g></g></g></svg>assets/icon.svg000064400000006311151542205200007514 0ustar00<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m20.1709 2.07959h-16.3418c-.96484 0-1.75.78516-1.75 1.75v16.34131c0 .96484.78516 1.75 1.75 1.75h16.3418c.96484 0 1.75-.78516 1.75-1.75v-16.34131c0-.96484-.78516-1.75-1.75-1.75zm.25 1.75v5.83252l-4.30273-3.2998c-.71582-.54932-1.72559-.46777-2.34473.19482l-1.02344 1.09723v-4.07477h7.4209c.1377 0 .25.1123.25.25zm-7.6709 7.32568v-1.30072l2.12012-2.27399c.08887-.09473.23145-.10693.33594-.02783l4.77521 3.66211h-7.23126v-.05957zm-9.1709-1.263 2.15527-2.31171c.08887-.09473.23145-.10693.33594-.02783l4.77478 3.66211h-7.26599zm0 2.82257h7.6709v6.05646l-4.2666-3.27228c-.71875-.55078-1.72656-.46875-2.3457.19434l-1.05859 1.1347v-4.11322zm9.1709 7.57618v-1.3006l2.12109-2.27362c.08691-.09375.23047-.10645.33496-.02832l4.86743 3.73242h-7.32349v-.12988zm3.36914-4.792c-.71777-.55078-1.72656-.46875-2.3457.19434l-1.02344 1.09705v-4.07556h7.6709v6.08344l-4.30176-3.29926zm-12.29004-11.91943h7.4209v6.05554l-4.26758-3.27283c-.7168-.54932-1.72559-.46777-2.34473.19482l-1.05859 1.13495v-3.86249c0-.1377.1123-.25.25-.25zm-.25 16.59131v-1.14282l2.15625-2.31128c.08691-.09375.23047-.10645.33496-.02832l4.86646 3.73242h-7.10767c-.1377 0-.25-.1123-.25-.25z"/><path d="m8.75 5.88965c.06934.07031.14941.12012.25.16016.08984.04004.18945.06006.28027.06006.09961 0 .19922-.02002.28906-.06006.09082-.04004.1709-.08984.24023-.16016.07031-.06982.12988-.15967.16992-.25.03027-.08984.05078-.18994.05078-.27979 0-.1001-.02051-.2002-.05078-.29004-.04004-.08984-.09961-.16992-.16992-.24023-.06934-.06982-.14941-.12988-.24023-.16992-.17969-.06982-.38965-.06982-.56934 0-.10059.04004-.18066.1001-.25.16992-.07031.07031-.12012.15039-.16016.24023s-.05957.18994-.05957.29004c0 .08984.01953.18994.05957.27979.04004.09033.08984.18018.16016.25z"/><path d="m9 15.17969c.08984.04004.17969.06055.28027.06055.09961 0 .19922-.02051.28906-.06055.09082-.03027.1709-.08984.24023-.16016.15039-.13965.2207-.33008.2207-.5293 0-.10059-.02051-.19043-.05078-.29004-.04004-.09082-.09961-.16992-.16992-.24023-.2002-.20996-.54004-.28027-.80957-.16016-.10059.04004-.18066.08984-.25.16016-.07031.07031-.12012.14941-.16016.24023-.04004.09961-.05957.18945-.05957.29004 0 .19922.0791.38965.21973.5293.06934.07031.14941.12988.25.16016z"/><path d="m19.10938 14.2002c-.04004-.09082-.08984-.16992-.15918-.24023-.28027-.28027-.78027-.28027-1.06055 0-.07031.07031-.12988.14941-.16016.24023-.04004.09961-.05957.18945-.05957.29004 0 .19922.08008.38965.21973.5293.07031.07031.15039.12988.24023.16016.08984.04004.18945.06055.29004.06055.09961 0 .18945-.02051.29004-.06055.08984-.03027.16992-.08984.24023-.16016.06934-.06934.11914-.14941.15918-.23926.04004-.09082.06055-.19043.06055-.29004 0-.10059-.02051-.19043-.06055-.29004z"/><path d="m17.88965 5.88965c.14062.14014.33008.20996.53027.20996.09961 0 .18945-.00977.29004-.0498.08984-.04004.16992-.08984.24023-.16016.06934-.06982.11914-.15967.15918-.25.04004-.08984.06055-.18994.06055-.27979 0-.1001-.02051-.2002-.06055-.29004s-.08984-.16992-.15918-.24023c-.07031-.06982-.15039-.12988-.24023-.16992-.19043-.06982-.40039-.06982-.58008 0-.08984.04004-.16992.1001-.24023.16992-.07031.07031-.12988.15039-.16016.24023-.04004.08984-.05957.18994-.05957.29004 0 .08984.01953.18994.05957.27979.03027.09033.08984.18018.16016.25z"/></svg>image-grid.php000064400000035365151542205200007272 0ustar00<?php
/*
Widget Name: Image Grid
Description: Showcase images in a responsive grid layout with custom size, spacing, alignment, and captions.
Author: SiteOrigin
Author URI: https://siteorigin.com
Documentation: https://siteorigin.com/widgets-bundle/image-grid/
*/

class SiteOrigin_Widgets_ImageGrid_Widget extends SiteOrigin_Widget {
	/**
	 * @var int This is used to indicate that the widget's LESS styles have changed and the CSS needs to be recompiled.
	 */
	protected $version = 2;

	public function __construct() {
		parent::__construct(
			'sow-image-grid',
			__( 'SiteOrigin Image Grid', 'so-widgets-bundle' ),
			array(
				'description' => __( 'Showcase images in a responsive grid layout with custom size, spacing, alignment, and captions.', 'so-widgets-bundle' ),
				'help' => 'https://siteorigin.com/widgets-bundle/image-grid/',
			),
			array(),
			false,
			plugin_dir_path( __FILE__ )
		);
	}

	/**
	 * Initialize the image grid, mainly to add scripts and styles.
	 */
	public function initialize() {
		$this->register_frontend_scripts( array(
			array(
				'sow-image-grid',
				plugin_dir_url( __FILE__ ) . 'js/image-grid' . SOW_BUNDLE_JS_SUFFIX . '.js',
				array( 'jquery', 'dessandro-imagesLoaded' ),
				SOW_BUNDLE_VERSION,
				true,
			),
		) );
	}

	public function get_widget_form() {
		return array(
			'images' => array(
				'type' => 'repeater',
				'label' => __( 'Images', 'so-widgets-bundle' ),
				'item_name' => __( 'Image', 'so-widgets-bundle' ),
				'item_label' => array(
					'selectorArray' => array(
						array(
							'selector' => "[id*='title']",
							'valueMethod' => 'val',
						),
						array(
							'selector' => '.media-field-wrapper .current .title',
							'valueMethod' => 'html',
						),
					),
				),
				'fields' => array(
					'image' => array(
						'type' => 'media',
						'label' => __( 'Image', 'so-widgets-bundle' ),
						'library' => 'image',
						'fallback' => true,
					),
					'title' => array(
						'type' => 'text',
						'label' => __( 'Image title', 'so-widgets-bundle' ),
					),
					'alt' => array(
						'type' => 'text',
						'label' => __( 'Alt text', 'so-widgets-bundle' ),
					),
					'url' => array(
						'type' => 'link',
						'label' => __( 'URL', 'so-widgets-bundle' ),
					),
					'new_window' => array(
						'type' => 'checkbox',
						'default' => false,
						'label' => __( 'Open in new window', 'so-widgets-bundle' ),
					),
				),
			),

			'display' => array(
				'type' => 'section',
				'label' => __( 'Settings', 'so-widgets-bundle' ),
				'fields' => array(
					'attachment_size' => array(
						'label' => __( 'Image size', 'so-widgets-bundle' ),
						'type' => 'image-size',
						'default' => 'full',
						'custom_size' => true,
						'state_emitter' => array(
							'callback' => 'select',
							'args' => array( 'size' ),
						),
					),

					'max_height' => array(
						'label' => __( 'Maximum image height', 'so-widgets-bundle' ),
						'type' => 'number',
						'state_handler' => array(
							'size[custom_size]' => array( 'hide' ),
							'_else[size]' => array( 'show' ),
						),
					),

					'max_width' => array(
						'label' => __( 'Maximum image width', 'so-widgets-bundle' ),
						'type' => 'number',
						'state_handler' => array(
							'size[custom_size]' => array( 'hide' ),
							'_else[size]' => array( 'show' ),
						),
					),

					'padding' => array(
						'label' => __( 'Image padding', 'so-widgets-bundle' ),
						'type' => 'multi-measurement',
						'autofill' => true,
						'default' => '5px 5px 5px 5px',
						'measurements' => array(
							'top' => array(
							'label' => __( 'Top', 'so-widgets-bundle' ),
							),
							'right' => array(
								'label' => __( 'Right', 'so-widgets-bundle' ),
							),
							'bottom' => array(
								'label' => __( 'Bottom', 'so-widgets-bundle' ),
							),
							'left' => array(
								'label' => __( 'Left', 'so-widgets-bundle' ),
							),
						),
					),

					'alignment_vertical' => array(
						'type' => 'select',
						'label' => __( 'Image vertical alignment', 'so-widgets-bundle' ),
						'description' => __( 'Applied if image heights differ.', 'so-widgets-bundle' ),
						'default' => 'end',
						'options' => array(
							'flex-start' => __( 'Top', 'so-widgets-bundle' ),
							'center' => __( 'Center', 'so-widgets-bundle' ),
							'flex-end' => __( 'Bottom', 'so-widgets-bundle' ),
						),
					),

					'alignment_horizontal' => array(
						'type' => 'select',
						'label' => __( 'Grid horizontal alignment', 'so-widgets-bundle' ),
						'default' => 'center',
						'options' => array(
							'flex-start' => __( 'Left', 'so-widgets-bundle' ),
							'center' => __( 'Center', 'so-widgets-bundle' ),
							'flex-end' => __( 'Right', 'so-widgets-bundle' ),
						),
					),

					'title_display' => array(
						'type' => 'checkbox',
						'label' => __( 'Display Image Title', 'so-widgets-bundle' ),
						'state_emitter' => array(
							'callback' => 'conditional',
							'args' => array(
								'title_display[show]: val',
								'title_display[hide]: ! val',
							),
						),
					),

					'title_position' => array(
						'type' => 'select',
						'label' => __( 'Title Position', 'so-widgets-bundle' ),
						'default' => 'below',
						'options' => array(
							'above' => __( 'Above Image', 'so-widgets-bundle' ),
							'below' => __( 'Below Image', 'so-widgets-bundle' ),
						),
						'state_handler' => array(
							'title_display[show]' => array( 'show' ),
							'title_display[hide]' => array( 'hide' ),
						),
					),

					'title_alignment' => array(
						'type' => 'select',
						'label' => __( 'Title Alignment', 'so-widgets-bundle' ),
						'default' => 'center',
						'options' => array(
							'left' => __( 'Left', 'so-widgets-bundle' ),
							'center' => __( 'Center', 'so-widgets-bundle' ),
							'right' => __( 'Right', 'so-widgets-bundle' ),
						),
						'state_handler' => array(
							'title_display[show]' => array( 'show' ),
							'title_display[hide]' => array( 'hide' ),
						),
					),

					'title_font' => array(
						'type' => 'font',
						'label' => __( 'Title Font', 'so-widgets-bundle' ),
						'state_handler' => array(
							'title_display[show]' => array( 'show' ),
							'title_display[hide]' => array( 'hide' ),
						),
					),

					'title_font_size' => array(
						'type' => 'measurement',
						'label' => __( 'Title Font Size', 'so-widgets-bundle' ),
						'default' => '0.9rem',
						'state_handler' => array(
							'title_display[show]' => array( 'show' ),
							'title_display[hide]' => array( 'hide' ),
						),
					),

					'title_color' => array(
						'type' => 'color',
						'label' => __( 'Title Color', 'so-widgets-bundle' ),
						'state_handler' => array(
							'title_display[show]' => array( 'show' ),
							'title_display[hide]' => array( 'hide' ),
						),
					),
					'title_padding' => array(
						'type' => 'color',
						'label' => __( 'Title Padding', 'so-widgets-bundle' ),
						'type' => 'multi-measurement',
						'autofill' => true,
						'default' => '5px 0px 10px 0px',
						'measurements' => array(
							'top' => array(
							'label' => __( 'Top', 'so-widgets-bundle' ),
							),
							'right' => array(
								'label' => __( 'Right', 'so-widgets-bundle' ),
							),
							'bottom' => array(
								'label' => __( 'Bottom', 'so-widgets-bundle' ),
							),
							'left' => array(
								'label' => __( 'Left', 'so-widgets-bundle' ),
							),
						),
						'state_handler' => array(
							'title_display[show]' => array( 'show' ),
							'title_display[hide]' => array( 'hide' ),
						),
					),
				),
			),
		);
	}

	public function get_template_variables( $instance, $args ) {
		$images = isset( $instance['images'] ) ? (array) $instance['images'] : array();

		foreach ( $images as $id => &$image ) {
			if ( empty( $image['image'] ) && empty( $image['image_fallback'] ) ) {
				unset( $images[$id] );
				continue;
			}

			$link_atts = empty( $image['link_attributes'] ) ? array() : $image['link_attributes'];
			if ( ! empty( $image['new_window'] ) ) {
				$link_atts['target'] = '_blank';
				$link_atts['rel'] = 'noopener noreferrer';
			}
			$image['link_attributes'] = $link_atts;

			$attr = array();
			$attr['title'] = $this->get_image_title( $image );
			$attr['alt'] = ! empty( $image['alt'] ) ? $image['alt'] . '"' : '';
			$attr['class'] = 'sow-image-grid-image_html';

			if ( empty( $image['image'] ) && ! empty( $image['image_fallback'] ) ) {
				$attr['src'] = esc_url( $image['image_fallback'] );
				$attr = siteorigin_loading_optimization_attributes( $attr, 'image_grid', $instance, $this );
				$image['image_html'] = '<img ';
				foreach ( $attr as $n => $v ) {
					if ( $n === 'alt' || ! empty( $v ) ) {
						$image['image_html'] .= siteorigin_sanitize_attribute_key( $n ) . '="' . esc_attr( $v ) . '" ';
					}
				}
				$image['image_html'] .= '>';
			} else {
				if (
					$instance['display']['attachment_size'] == 'custom_size' &&
					! empty( $instance['display']['attachment_size_width'] ) &&
					! empty( $instance['display']['attachment_size_height'] )
				) {
					$instance['display']['attachment_size'] = array(
						(int) $instance['display']['attachment_size_width'],
						(int) $instance['display']['attachment_size_height'],
					);

					// To prevent potential sizing issues, override the max width and height with the custom size.
					$instance['display']['max_height'] = $instance['display']['attachment_size'][0];
					$instance['display']['max_width'] = $instance['display']['attachment_size'][1];
				}

				$attr['class'] = 'sow-image-grid-image_html';

				$image['image_html'] = wp_get_attachment_image(
					$image['image'],
					$instance['display']['attachment_size'],
					false,
					siteorigin_loading_optimization_attributes(
						$attr,
						'image_grid',
						$instance,
						$this
					)
				);
			}
		}

		return array(
			'images' => $images,
			'max_height' => $instance['display']['max_height'],
			'max_width' => $instance['display']['max_width'],
			'title_position' => ! empty( $instance['display']['title_display'] ) ? $instance['display']['title_position'] : false,
		);
	}

	/**
	 * Try to figure out an image's title for display.
	 *
	 * @return string The title of the image.
	 */
	private function get_image_title( $image ) {
		if ( ! empty( $image['title'] ) ) {
			$title = $image['title'];
		} elseif ( apply_filters( 'siteorigin_widgets_auto_title', true, 'sow-image-grid' ) ) {
			$title = wp_get_attachment_caption( $image['image'] );

			if ( empty( $title ) ) {
				// We do not want to use the default image titles as they're based on the file name without the extension.
				$file_name = pathinfo( get_post_meta( $image['image'], '_wp_attached_file', true ), PATHINFO_FILENAME );
				$title = get_the_title( $image['image'] );

				if ( $title == $file_name ) {
					$title = '';
				}
			}
		} else {
			$title = '';
		}

		return $title;
	}

	public function modify_instance( $instance ) {
		if ( empty( $instance ) ) {
			return array();
		}

		if ( ! empty( $instance['display'] ) ) {
			// Revert changes to `max_width` and `max_height` back to `number` fields.
			if ( ! empty( $instance['display']['max_height'] ) ) {
				$instance['display']['max_height'] = (int) $instance['display']['max_height'];
			}

			if ( ! empty( $instance['display']['max_width'] ) ) {
				$instance['display']['max_width'] = (int) $instance['display']['max_width'];
			}

			// Migrate the Spacing setting to the Padding setting.
			if ( isset( $instance['display']['spacing'] ) ) {
				// The Spacing setting was initially a `number` field.
				if ( is_numeric( $instance['display']['spacing'] ) ) {
					$spacing = $instance['display']['spacing'] . 'px';
				} elseif ( isset( $instance['display']['spacing_unit'] ) ) {
					// Prior to the rename, it was a `measurement` field.
					$spacing = $instance['display']['spacing'];
				}

				if ( isset( $spacing ) ) {
					$instance['display']['padding'] = "0px $spacing $spacing $spacing";
				}
			}

			// If this Image Grid was created before the image title setting was added, disable it by default.
			if ( ! isset( $instance['display']['title_display'] ) ) {
				$instance['display']['title_display'] = false;
			}
		}

		return $instance;
	}

	/**
	 * Get the Less variables for the image grid.
	 *
	 * @return mixed
	 */
	public function get_less_variables( $instance ) {
		$less = array(
			'padding' => ! empty( $instance['display']['padding'] ) ? $instance['display']['padding'] : '5px 5px 5px 5px',
			'alignment_horizontal' => ! empty( $instance['display']['alignment_horizontal'] ) ? $instance['display']['alignment_horizontal'] : 'center',
			'alignment_vertical' => ! empty( $instance['display']['alignment_vertical'] ) ? $instance['display']['alignment_vertical'] : 'baseline',
		);

		if ( ! empty( $instance['display']['title_display'] ) ) {
			$less['title_alignment'] = ! empty( $instance['display']['title_display'] ) ? $instance['display']['title_alignment'] : '';
			$title_font = siteorigin_widget_get_font( $instance['display']['title_font'] );
			$less['title_font'] = $title_font['family'];

			if ( ! empty( $title_font['weight'] ) ) {
				$less['title_font_weight'] = $title_font['weight_raw'];
				$less['title_font_style'] = $title_font['style'];
			}
			$less['title_font_size'] = ! empty( $instance['display']['title_font_size'] ) ? $instance['display']['title_font_size'] : '';
			$less['title_color'] = ! empty( $instance['display']['title_color'] ) ? $instance['display']['title_color'] : '';
			$less['title_padding'] = ! empty( $instance['display']['title_padding'] ) ? $instance['display']['title_padding'] : '';
		}

		return $less;
	}

	public function get_form_teaser() {
		if ( class_exists( 'SiteOrigin_Premium' ) ) {
			return false;
		}

		return array(
			sprintf(
				__( 'Add a Lightbox to your images with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/lightbox" target="_blank" rel="noopener noreferrer">',
				'</a>'
			),
			sprintf(
				__( 'Add a beautiful and customizable text overlay with animations to your images with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/image-overlay" target="_blank" rel="noopener noreferrer">',
				'</a>'
			),
			sprintf(
				__( 'Add an image title tooltip with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/tooltip" target="_blank" rel="noopener noreferrer">',
				'</a>'
			),
			sprintf(
				__( 'Add multiple Image Grid frames in one go with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
				'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/multiple-media" target="_blank" rel="noopener noreferrer">',
				'</a>'
			),
		);
	}
}

siteorigin_widget_register( 'sow-image-grid', __FILE__, 'SiteOrigin_Widgets_ImageGrid_Widget' );
js/image-grid.js000064400000002641151542205200007522 0ustar00/* globals jQuery, sowb */
var sowb = window.sowb || {};

jQuery( function ( $ ) {
	sowb.setupImageGrids = function () {
		$( '.sow-image-grid-wrapper' ).each( function () {
			var $$ = $( this );
			$$.imagesLoaded( function () {
				var maxWidth = $$.data( 'max-width' ),
					maxHeight = $$.data( 'max-height' );
				
				if ( maxWidth !== undefined || maxHeight !== undefined ) {
					$$.find( 'img' ).each( function () {
						var $img = $( this ).css( 'opacity', 1 );
						var ratio = $img.width() / $img.height();
						
						var width = [];
						
						// Lets set the widths of the image
						if ( maxWidth !== undefined && $img.width() > maxWidth ) {
							width.push( maxWidth );
						}
						
						if ( maxHeight !== undefined && $img.height() > maxHeight ) {
							width.push( Math.round( maxHeight * ratio ) );
						}
						
						if ( width.length ) {
							width = Math.min.apply( Math, width );
							$img.css( 'max-width', width + 'px' );
						}
						
					} );
				}
				else {
					$$.find( 'img' ).css( 'opacity', 1 );
				}
				
				var alignImages = function () {
				};
				alignImages();
				
				$( window ).on( 'resize', alignImages );

				var event = document.createEvent('Event');
				event.initEvent('layoutComplete', true, true);
				$$.get(0).dispatchEvent(event);
			} );
		} );
	};
	sowb.setupImageGrids();
	
	$( sowb ).on( 'setup_widgets', sowb.setupImageGrids );
	
} );

window.sowb = sowb;
js/image-grid.min.js000064400000001355151542205200010305 0ustar00var sowb=window.sowb||{};jQuery((function(i){sowb.setupImageGrids=function(){i(".sow-image-grid-wrapper").each((function(){var t=i(this);t.imagesLoaded((function(){var a=t.data("max-width"),e=t.data("max-height");void 0!==a||void 0!==e?t.find("img").each((function(){var t=i(this).css("opacity",1),o=t.width()/t.height(),s=[];void 0!==a&&t.width()>a&&s.push(a),void 0!==e&&t.height()>e&&s.push(Math.round(e*o)),s.length&&(s=Math.min.apply(Math,s),t.css("max-width",s+"px"))})):t.find("img").css("opacity",1);var o=function(){};i(window).on("resize",o);var s=document.createEvent("Event");s.initEvent("layoutComplete",!0,!0),t.get(0).dispatchEvent(s)}))}))},sowb.setupImageGrids(),i(sowb).on("setup_widgets",sowb.setupImageGrids)})),window.sowb=sowb;styles/default.less000064400000001540151542205200010377 0ustar00@padding: default;
@alignment_horizontal: center;
@alignment_vertical: end;
@title_alignment: default;
@title_color: default;
@title_font: default;
@title_font_size: default;
@title_font_style: default;
@title_font_weight: default;
@title_padding: default;

.sow-image-grid-wrapper {
	align-items: @alignment_vertical;
	display: flex;
	flex-wrap: wrap;
	justify-content: @alignment_horizontal;
	line-height: 0;
	text-align: center;

	.sow-image-grid-image {
		display: inline-block;
		padding: @padding;

		a {
			display: block;
		}

		img {
			height: auto;
			max-width: 100%;
			opacity: 0;
		}

		.image-title {
			color: @title_color;
			font-family: @title_font;
			font-size: @title_font_size;
			font-style: @title_font_style;
			font-weight: @title_font_weight;
			line-height: 1.25;
			padding: @title_padding;
			text-align: @title_alignment;
		}
	}
}
tpl/default.php000064400000002633151542205200007500 0ustar00<?php
/**
 * @var $images array
 * @var $max_height int
 * @var $max_width int
 * @var $title_position string
 */
?>
<?php if ( ! empty( $images ) ) { ?>
	<div
		class="sow-image-grid-wrapper"
		<?php if ( ! empty( $max_width ) ) {
			echo 'data-max-width="' . (int) $max_width . '"';
		} ?>
		<?php if ( ! empty( $max_height ) ) {
			echo 'data-max-height="' . (int) $max_height . '"';
		} ?>
	>
		<?php foreach ( $images as $image ) { ?>
			<div class="sow-image-grid-image">
				<?php if ( ! empty( $title_position ) && ! empty( $image['title'] ) && $title_position == 'above' ) { ?>
					<div class="image-title">
						<?php echo wp_kses_post( $image['title'] ); ?>
					</div>
				<?php } ?>
				<?php if ( ! empty( $image['url'] ) ) { ?>
					<a href="<?php echo sow_esc_url( $image['url'] ); ?>"
					<?php foreach ( $image['link_attributes'] as $attr=> $val ) { ?>
						<?php if ( ! empty( $val ) ) { ?>
							<?php echo siteorigin_sanitize_attribute_key( $attr ) . '="' . esc_attr( $val ) . '" '; ?>
						<?php } ?>
					<?php } ?>>
				<?php } ?>
				<?php echo $image['image_html']; ?>
				<?php if ( ! empty( $image['url'] ) ) { ?>
					</a>
				<?php } ?>
				<?php if ( ! empty( $title_position ) && ! empty( $image['title'] ) && $title_position == 'below' ) { ?>
					<div class="image-title">
						<?php echo wp_kses_post( $image['title'] ); ?>
					</div>
				<?php } ?>
			</div>
		<?php } ?>
	</div>
<?php } ?>