Plugin Directory

Changeset 3259762


Ignore:
Timestamp:
03/21/2025 01:37:01 PM (12 months ago)
Author:
goaroundagain
Message:

Update to version 1.16 from GitHub

Location:
gallery-block-lightbox
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • gallery-block-lightbox/assets/screenshot-3.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • gallery-block-lightbox/tags/1.16/README.md

    r3218386 r3259762  
    112112```
    113113
     114### Can I change or disable the animation on image transitions?
     115
     116By default, baguetteBox.js shows a slide-in animation on image transitions. You can change it to the following filter to `'fadeIn'`:
     117```
     118add_filter( 'baguettebox_animation', function () { return 'fadeIn'; } );
     119```
     120Or disable the animation completely with `'false'`:
     121```
     122add_filter( 'baguettebox_animation', function () { return 'false'; } );
     123```
     124
    114125## Screenshots
    115126
     
    124135### 1.15
    125136
     137- Add filter baguettebox_animation to choose between 'slideIn' | 'fadeIn' | 'false' animation styles on image transitions.
     138
     139### 1.15
     140
    126141- Add filter baguettebox_captions to change the JavaScript function to get the caption of an image
    127142
  • gallery-block-lightbox/tags/1.16/gallery-block-lightbox.php

    r3156208 r3259762  
    5050    $baguettebox_captions = apply_filters( 'baguettebox_captions', 'function(t){var e=t.parentElement.classList.contains("wp-block-image")||t.parentElement.classList.contains("wp-block-media-text__media")?t.parentElement.querySelector("figcaption"):t.parentElement.parentElement.querySelector("figcaption,dd");return!!e&&e.innerHTML}' );
    5151
    52     wp_add_inline_script( 'baguettebox', 'window.addEventListener("load", function() {baguetteBox.run("' . $baguettebox_selector . '",{captions:' . $baguettebox_captions . ',filter:' . $baguettebox_filter . ',ignoreClass:"' . $baguettebox_ignoreclass . '"});});' );
     52    /**
     53     * Filters the animation attribute of baguetteBox.js
     54     *
     55     * @since 1.16
     56     *
     57     * @param string  $value  Use the given animation style on image transitions.
     58     * 'slideIn' | 'fadeIn' | 'false'
     59     */
     60    $baguettebox_animation = apply_filters( 'baguettebox_animation', 'slideIn' );
    5361
     62    $baguettebox_options = "{captions:{$baguettebox_captions},filter:{$baguettebox_filter},ignoreClass:'{$baguettebox_ignoreclass}',animation:'{$baguettebox_animation}'}";
     63
     64    wp_add_inline_script( "baguettebox", "window.addEventListener('load', function() {baguetteBox.run('{$baguettebox_selector}',{$baguettebox_options});});" );
    5465}
    5566add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\register_assets' );
  • gallery-block-lightbox/trunk/README.md

    r3218386 r3259762  
    112112```
    113113
     114### Can I change or disable the animation on image transitions?
     115
     116By default, baguetteBox.js shows a slide-in animation on image transitions. You can change it to the following filter to `'fadeIn'`:
     117```
     118add_filter( 'baguettebox_animation', function () { return 'fadeIn'; } );
     119```
     120Or disable the animation completely with `'false'`:
     121```
     122add_filter( 'baguettebox_animation', function () { return 'false'; } );
     123```
     124
    114125## Screenshots
    115126
     
    124135### 1.15
    125136
     137- Add filter baguettebox_animation to choose between 'slideIn' | 'fadeIn' | 'false' animation styles on image transitions.
     138
     139### 1.15
     140
    126141- Add filter baguettebox_captions to change the JavaScript function to get the caption of an image
    127142
  • gallery-block-lightbox/trunk/gallery-block-lightbox.php

    r3156208 r3259762  
    5050    $baguettebox_captions = apply_filters( 'baguettebox_captions', 'function(t){var e=t.parentElement.classList.contains("wp-block-image")||t.parentElement.classList.contains("wp-block-media-text__media")?t.parentElement.querySelector("figcaption"):t.parentElement.parentElement.querySelector("figcaption,dd");return!!e&&e.innerHTML}' );
    5151
    52     wp_add_inline_script( 'baguettebox', 'window.addEventListener("load", function() {baguetteBox.run("' . $baguettebox_selector . '",{captions:' . $baguettebox_captions . ',filter:' . $baguettebox_filter . ',ignoreClass:"' . $baguettebox_ignoreclass . '"});});' );
     52    /**
     53     * Filters the animation attribute of baguetteBox.js
     54     *
     55     * @since 1.16
     56     *
     57     * @param string  $value  Use the given animation style on image transitions.
     58     * 'slideIn' | 'fadeIn' | 'false'
     59     */
     60    $baguettebox_animation = apply_filters( 'baguettebox_animation', 'slideIn' );
    5361
     62    $baguettebox_options = "{captions:{$baguettebox_captions},filter:{$baguettebox_filter},ignoreClass:'{$baguettebox_ignoreclass}',animation:'{$baguettebox_animation}'}";
     63
     64    wp_add_inline_script( "baguettebox", "window.addEventListener('load', function() {baguetteBox.run('{$baguettebox_selector}',{$baguettebox_options});});" );
    5465}
    5566add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\register_assets' );
Note: See TracChangeset for help on using the changeset viewer.