From adbde22058c86c6816fdb63c4c346e6b32da18b9 Mon Sep 17 00:00:00 2001 From: Elio Rivero Date: Fri, 10 Feb 2017 02:05:17 -0300 Subject: [PATCH] Carousel: allow to filter EXIF tags that will be displayed in lightbox (#6352) --- modules/carousel/jetpack-carousel.css | 3 ++- modules/carousel/jetpack-carousel.js | 2 +- modules/carousel/jetpack-carousel.php | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/carousel/jetpack-carousel.css b/modules/carousel/jetpack-carousel.css index f9621525669a0..6eb89bac29d11 100644 --- a/modules/carousel/jetpack-carousel.css +++ b/modules/carousel/jetpack-carousel.css @@ -552,7 +552,8 @@ div#carousel-reblog-box { .jp-carousel-image-meta li { width: 48% !important; - float: left !important; + display: inline-block !important; + vertical-align: top !important; margin: 0 2% 15px 0 !important; color: #fff !important; font-size:13px !important; diff --git a/modules/carousel/jetpack-carousel.js b/modules/carousel/jetpack-carousel.js index b17e08f19d92e..d0cfa97133f78 100644 --- a/modules/carousel/jetpack-carousel.js +++ b/modules/carousel/jetpack-carousel.js @@ -1128,7 +1128,7 @@ jQuery(document).ready(function($) { var $ul = $( '' ); $.each( meta, function( key, val ) { - if ( 0 === parseFloat(val) || !val.length || -1 === $.inArray( key, [ 'camera', 'aperture', 'shutter_speed', 'focal_length' ] ) ) { + if ( 0 === parseFloat(val) || !val.length || -1 === $.inArray( key, $.makeArray( jetpackCarouselStrings.meta_data ) ) ) { return; } diff --git a/modules/carousel/jetpack-carousel.php b/modules/carousel/jetpack-carousel.php index 27fc5280e86d0..012b934c8c8a4 100644 --- a/modules/carousel/jetpack-carousel.php +++ b/modules/carousel/jetpack-carousel.php @@ -197,7 +197,7 @@ function check_if_shortcode_processed_and_enqueue_assets( $output ) { function enqueue_assets() { if ( $this->first_run ) { - wp_enqueue_script( 'jetpack-carousel', plugins_url( 'jetpack-carousel.js', __FILE__ ), array( 'jquery.spin' ), $this->asset_version( '20160325' ), true ); + wp_enqueue_script( 'jetpack-carousel', plugins_url( 'jetpack-carousel.js', __FILE__ ), array( 'jquery.spin' ), $this->asset_version( '20170209' ), true ); // Note: using home_url() instead of admin_url() for ajaxurl to be sure to get same domain on wpcom when using mapped domains (also works on self-hosted) // Also: not hardcoding path since there is no guarantee site is running on site root in self-hosted context. @@ -231,11 +231,13 @@ function enqueue_assets() { 'aperture' => __( 'Aperture', 'jetpack' ), 'shutter_speed' => __( 'Shutter Speed', 'jetpack' ), 'focal_length' => __( 'Focal Length', 'jetpack' ), + 'copyright' => __( 'Copyright', 'jetpack' ), 'comment_registration' => $comment_registration, 'require_name_email' => $require_name_email, /** This action is documented in core/src/wp-includes/link-template.php */ 'login_url' => wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ), 'blog_id' => (int) get_current_blog_id(), + 'meta_data' => array( 'camera', 'aperture', 'shutter_speed', 'focal_length', 'copyright' ) ); if ( ! isset( $localize_strings['jetpack_comments_iframe_src'] ) || empty( $localize_strings['jetpack_comments_iframe_src'] ) ) {