diff --git a/CHANGELOG.md b/CHANGELOG.md index 722c80b..2f77615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.3.6 +- Added filter to override the post values for the gallery item (`hogan/module/gallery/item`) +- Use innerHTML instead of textContent to fetch the content of figcaption. This way html `
` can be used to create line breaks. +- PR [#34](https://github.com/DekodeInteraktiv/hogan-gallery/pull/34) + +## 1.3.5 +- Fixed problem with lots of space under galleries: [https://prosjekt.dekode.no/desk/#/tickets/3444695](https://prosjekt.dekode.no/desk/#/tickets/3444695) + ## 1.3.4 - Fixed offset vertical margins for grid layout [#22](https://github.com/DekodeInteraktiv/hogan-gallery/pull/22) diff --git a/README.md b/README.md index 56a8c01..1861e83 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,4 @@ Install the module using Composer `composer require dekodeinteraktiv/hogan-galle - `hogan/module/gallery/inner_wrapper_classes` for inner HTML `
` wrapper classes. - `hogan/module/gallery/heading/enabled` for enabling heading field, default true. - `hogan/module/gallery/slider/flickity` flickity options. See https://flickity.metafizzy.co/options.html +- `hogan/module/gallery/item` for overriding the post values for the gallery item. diff --git a/assets/js/hogan-photoswipe.js b/assets/js/hogan-photoswipe.js index 9d5b34e..2a8f0f9 100644 --- a/assets/js/hogan-photoswipe.js +++ b/assets/js/hogan-photoswipe.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=n,this.gallery=t,this.uid=this.gallery.getAttribute("data-pswp-uid"),this.items=this.getItems(),this.handleClick=this.handleClick.bind(this),this.getThumbBoundsFn=this.getThumbBoundsFn.bind(this),t.addEventListener("click",this.handleClick)}var t,n,o;return t=e,(n=[{key:"getItems",value:function(){for(var e=this.gallery.querySelectorAll(".hogan-gallery-cell"),t=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=n,this.gallery=t,this.uid=this.gallery.getAttribute("data-pswp-uid"),this.items=this.getItems(),this.handleClick=this.handleClick.bind(this),this.getThumbBoundsFn=this.getThumbBoundsFn.bind(this),t.addEventListener("click",this.handleClick)}var t,n,o;return t=e,(n=[{key:"getItems",value:function(){for(var e=this.gallery.querySelectorAll(".hogan-gallery-cell"),t=[],n=0;nitems as $item ) : + $item = apply_filters( 'hogan/module/gallery/item', $item ); + $classnames = hogan_classnames( 'hogan-gallery-cell', [ 'hogan-gallery-cell-hidden' => $index >= 6 && $is_masonry, ] ); diff --git a/hogan-gallery.php b/hogan-gallery.php index a48709d..680cc89 100644 --- a/hogan-gallery.php +++ b/hogan-gallery.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/dekodeinteraktiv/hogan-gallery * GitHub Plugin URI: https://github.com/dekodeinteraktiv/hogan-gallery * Description: Image Gallery Module for Hogan - * Version: 1.3.4 + * Version: 1.3.6 * Author: Dekode * Author URI: https://en.dekode.no * License: GPL-3.0-or-later @@ -24,7 +24,7 @@ exit; // Exit if accessed directly. } -define( 'HOGAN_GALLERY_VERSION', '1.3.4' ); +define( 'HOGAN_GALLERY_VERSION', '1.3.6' ); add_action( 'plugins_loaded', __NAMESPACE__ . '\\hogan_load_textdomain' ); add_action( 'hogan/include_modules', __NAMESPACE__ . '\\hogan_register_module', 10, 1 ); diff --git a/src/shared/photoswipe.js b/src/shared/photoswipe.js index 9d66b57..3420d35 100644 --- a/src/shared/photoswipe.js +++ b/src/shared/photoswipe.js @@ -39,7 +39,7 @@ class HoganPhotoSwipe { }; if ( caption ) { - item.title = caption.textContent; + item.title = caption.innerHTML; } item.el = images[ i ];