Skip to content

Commit

Permalink
Merge pull request #999 from WPChill/2.8.15
Browse files Browse the repository at this point in the history
Release 2.8.15
  • Loading branch information
TeoAlex authored Jul 19, 2024
2 parents ecc198b + 98d4b0d commit d7f126b
Show file tree
Hide file tree
Showing 21 changed files with 229 additions and 48 deletions.
4 changes: 2 additions & 2 deletions Modula.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://wp-modula.com/
* Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
* Author: WPChill
* Version: 2.8.14
* Version: 2.8.15
* Author URI: https://www.wpchill.com/
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -47,7 +47,7 @@
* @since 2.0.2
*/

define( 'MODULA_LITE_VERSION', '2.8.14' );
define( 'MODULA_LITE_VERSION', '2.8.15' );
define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL', 'https://wp-modula.com' );
Expand Down
80 changes: 80 additions & 0 deletions assets/css/admin/modula-cpt.css
Original file line number Diff line number Diff line change
Expand Up @@ -2182,3 +2182,83 @@ Some responsive fixes
}
*/
.modula-image-licensing-radio-wrapper {
display: flex;
flex-wrap: wrap;
gap: 16px;
}

.modula-image-licensing-radio-icon {
display: flex;
align-items: center;
flex: 1 1 calc(100% / 4 - 16px);
max-width: calc(100% / 4 - 16px);
box-sizing: border-box;
background-color: white;
padding: 16px;
border-radius: 5px;
border: 1px solid #ccd0d4;
transition: border-color 0.3s ease;
cursor: pointer;
}

.modula-image-licensing-radio-icon img {
margin-right: 16px;
max-height: 70px;
max-width: 30%;
}

.modula_image_licensing_radio_input {
position: absolute;
opacity: 0;
}

.modula_image_licensing_radio_input:checked + .modula-image-licensing-radio-icon {
border: 1px solid #27be92;
box-shadow: 0 0 5px #27be92;
}

.modula-image-licensing-radio-icon:first-of-type {
justify-content: center;
text-align: center;
}

.modula-image-licensing-radio-icon:first-of-type .modula-image-licensing-radio-name {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
}

@media (max-width: 1800px) {
.modula-image-licensing-radio-icon {
flex: 1 1 calc(100% / 3 - 16px);
max-width: calc(100% / 3 - 16px);
}
#modula-image_licensing.modula-tab-content .modula-image-licensing-radio-wrapper {
position: relative;
left: -80px;
width: calc( 100% + 80px );
}
}

@media (max-width: 1600px) {
.modula-image-licensing-radio-icon {
flex: 1 1 calc(100% / 2 - 16px);
max-width: calc(100% / 2 - 16px);
}
#modula-image_licensing.modula-tab-content .modula-image-licensing-radio-wrapper {
position: relative;
left: -80px;
width: calc( 100% + 80px );
}
}

@media (max-width: 1400px) {
.modula-image-licensing-radio-icon {
flex: 1 1 100%;
max-width: 100%;
}
}


2 changes: 1 addition & 1 deletion assets/css/admin/modula-cpt.min.css

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions assets/js/admin/wp-modula-conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
child.hide();
} else {
child.css('opacity', '1');
child
.find('input, textarea, select, button')
.removeAttr('disabled');
child.setting_state(this, 'on');
child.show();
}
});
Expand All @@ -381,9 +379,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
child.hide();
} else {
child.css('opacity', '1');
child
.find('input, textarea, select, button')
.removeAttr('disabled');
child.setting_state(this, 'on');
child.show();
}
});
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/wp-modula-conditions.min.js

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions assets/js/admin/wp-modula-gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,17 @@ var ModulaGalleryImage = function ModulaGalleryImage(props) {
"data-halign": "center",
src: img.src
});
} else if (img.video_template == '1' && 'undefined' != typeof img.video_thumbnail && '' != img.video_thumbnail) {
// Return image thumbnail of video
return /*#__PURE__*/React.createElement("img", {
className: "modula-image pic",
"data-id": img.id,
"data-full": img.src,
"data-src": img.video_thumbnail,
"data-valign": "middle",
"data-halign": "center",
src: img.video_thumbnail
});
} else if (img.video_type === 'hosted') {
// Return video element if video_type is 'hosted'
return /*#__PURE__*/React.createElement("div", {
Expand Down Expand Up @@ -474,7 +485,7 @@ var ModulaItemsExtraComponent = function ModulaItemsExtraComponent(props) {
};
/* harmony default export */ const components_ModulaItemsExtraComponent = (wp.components.withFilters('modula.ModulaItemsExtraComponent')(ModulaItemsExtraComponent));
;// CONCATENATED MODULE: ./assets/src/js/components/ModulaGallery.js
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
var _wp$element = wp.element,
ModulaGallery_Fragment = _wp$element.Fragment,
ModulaGallery_useEffect = _wp$element.useEffect,
Expand Down Expand Up @@ -546,12 +557,12 @@ var ModulaGallery = function ModulaGallery(props) {
};
/* harmony default export */ const components_ModulaGallery = (wp.components.withFilters('modula.modulaGallery')(ModulaGallery));
;// CONCATENATED MODULE: ./assets/src/js/components/edit.js
function edit_extends() { return edit_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, edit_extends.apply(null, arguments); }
function edit_extends() { return edit_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, edit_extends.apply(null, arguments); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
/**
* Internal dependencies
Expand Down Expand Up @@ -886,7 +897,7 @@ var ModulaGutenberg = /*#__PURE__*/function () {
_classCallCheck(this, ModulaGutenberg);
this.registerBlock();
}
return _createClass(ModulaGutenberg, [{
_createClass(ModulaGutenberg, [{
key: "registerBlock",
value: function registerBlock() {
this.blockName = 'modula/gallery';
Expand Down Expand Up @@ -950,6 +961,7 @@ var ModulaGutenberg = /*#__PURE__*/function () {
});
}
}]);
return ModulaGutenberg;
}();
var modulaGutenberg = new ModulaGutenberg();
/******/ })()
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/wp-modula-gutenberg.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion assets/js/front/jquery-modula.js
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,9 @@ jQuery(window).on('elementor/frontend/init', function () {

jQuery(document).ready(function () {
var modulaGalleries = jQuery('.modula.modula-gallery');

if (!jQuery('body').hasClass('modula-best-grid-gallery')) {
jQuery('body').addClass('modula-best-grid-gallery');
}
jQuery.each(modulaGalleries, function () {
var modulaSettings = jQuery(this).data('config');

Expand All @@ -1259,6 +1261,9 @@ jQuery(document).on('elementor/popup/show', (event, id, instance) => {
var modulaGalleries = jQuery('#elementor-popup-modal-' + id).find(
'.modula.modula-gallery'
);
if (!jQuery('body').hasClass('modula-best-grid-gallery')) {
jQuery('body').addClass('modula-best-grid-gallery');
}
jQuery.each(modulaGalleries, function () {
var modulaSettings = jQuery(this).data('config');

Expand Down
2 changes: 1 addition & 1 deletion assets/js/front/jquery-modula.min.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions assets/src/js/components/ModulaGalleryImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ const ModulaGalleryImage = (props) => {
src={img.src}
/>
);
} else if (img.video_template == '1' && 'undefined' != typeof img.video_thumbnail && '' != img.video_thumbnail ) {
// Return image thumbnail of video
return (
<img
className="modula-image pic"
data-id={img.id}
data-full={img.src}
data-src={img.video_thumbnail}
data-valign="middle"
data-halign="center"
src={img.video_thumbnail}
/>
);
} else if (img.video_type === 'hosted') {
// Return video element if video_type is 'hosted'
return (
Expand Down
11 changes: 11 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@

= 2.8.15 - 19.07.2024 =
Changed: Update Twitter logo in share.
Changed: Removed compatibility code that was creating issues in mobile lightboxes.
Fixed: Gallery custom CSS '>' selector was html encoded and not working on front-end.
Changed: Image licensing license selector design.
Fixed: Admin menu ordering.
Changed: Captions "Title Color" & "Title Font Size" defaults.
Fixed: Captions & title child settings cannot be edited after toggling parent setting ON.
Fixed: Gallery deug metabox won't stay on.

= 2.8.14 - 08.07.2024 =
Added: Support for Modula Image SEO addon
Changed: Compatibility for Modula Slider with Fancybox Carousel & Guttenberg block
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/class-modula-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function register_submenus() {
'capability' => 'manage_options',
'menu_slug' => '#modula-albums',
'function' => array( $this, 'modula_albums' ),
'priority' => 25,
'priority' => 3,
);

$links['moduladefaults'] = array(
Expand All @@ -163,7 +163,7 @@ public function register_submenus() {
'capability' => 'manage_options',
'menu_slug' => '#gallery-defaults',
'function' => array( $this, 'modula_gallery_defaults' ),
'priority' => 22,
'priority' => 1,
);

$links['albumsdefaults'] = array(
Expand All @@ -172,7 +172,7 @@ public function register_submenus() {
'capability' => 'manage_options',
'menu_slug' => '#albums-defaults',
'function' => array( $this, 'modula_albums_defaults' ),
'priority' => 26,
'priority' => 4,
);


Expand Down
6 changes: 3 additions & 3 deletions includes/admin/class-modula-cpt-fields-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public static function get_fields( $tab ) {
"name" => esc_html__( 'Title Color', 'modula-best-grid-gallery' ),
"type" => "color",
"description" => esc_html__( 'Set the color of title.', 'modula-best-grid-gallery' ),
"default" => "",
"default" => "#ffffff",
'is_child' => true,
'priority' => 30,
'data_type' => 'text',
Expand All @@ -430,7 +430,7 @@ public static function get_fields( $tab ) {
"name" => esc_html__( 'Title Font Size', 'modula-best-grid-gallery' ),
"type" => "number",
"after" => 'px',
"default" => 0,
"default" => 16,
"description" => esc_html__( 'The title font size in pixels (set to 0 to use the theme defaults).', 'modula-best-grid-gallery' ),
'is_child' => true,
'priority' => 40,
Expand Down Expand Up @@ -804,7 +804,7 @@ public static function get_defaults() {
'lightbox' => 'fancybox',
'show_navigation' => 1,
'shuffle' => 0,
'titleColor' => '',
'titleColor' => '#ffffff',
'captionColor' => '#ffffff',
'hide_title' => 1,
'hide_description' => 0,
Expand Down
9 changes: 8 additions & 1 deletion includes/admin/class-modula-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,15 @@ public function add_debug_meta_box() {
* @since 2.7.7
*/
public function hide_meta_box( $hidden, $screen ) {
$user_id = get_current_user_id();
if ($user_id === 0) {
return $hidden;
}

$user_meta = get_user_meta( $user_id, 'metaboxhidden_modula-gallery', true );

//make sure we are dealing with the correct screen
if ( ( 'post' === $screen->base ) && ( 'modula-gallery' === $screen->id ) ) {
if ( ( 'post' === $screen->base ) && ( 'modula-gallery' === $screen->id ) && in_array( 'modula-debug', $user_meta ) ) {
$hidden[] = 'modula-debug';
}

Expand Down
54 changes: 44 additions & 10 deletions includes/admin/tabs/image-licensing.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'image_licensing' => array(
'label' => esc_html__( 'Image licensing', 'modula-best-grid-gallery' ),
'description' => esc_html__( 'Select a license for your images that are inside a gallery', 'modula-best-grid-gallery' ),
'type' => 'select',
'type' => 'icon-radio',
'values' => Modula_Helper::get_image_licenses(),
'priority' => 30,
),
Expand Down Expand Up @@ -80,15 +80,6 @@
<td>
<div class="wrap modula">
<div class="">
<?php if ('select' == $ts_field['type']) { ?>
<select data-setting="modula_image_licensing_option[<?php echo esc_attr($key); ?>]"
id="modula_image_licensing_option<?php echo esc_attr($key); ?>"
name="modula_image_licensing_option[<?php echo esc_attr($key); ?>]">
<?php foreach( $ts_field['values'] as $val_key => $val ): ?>
<option <?php echo ($val_key == $image_attrib_options[ $key ] ) ? 'selected="selected"': ''; ?> value="<?php echo esc_attr($val_key); ?>"><?php echo esc_html($val['name']); ?></option>
<?php endforeach; ?>
</select>
<?php } ?>
<!-- Checkbox Toggles -->
<?php if ('toggle' == $ts_field['type']) { ?>
<div class="modula-toggle">
Expand Down Expand Up @@ -127,6 +118,49 @@
name="modula_image_licensing_option[<?php echo esc_attr($key); ?>]"
value="<?php echo isset( $image_attrib_options[ $key ] ) ? esc_attr( $image_attrib_options[ $key ] ) : '' ; ?> " >
<?php } ?>

<!-- Text Inputs -->
<?php if ('icon-radio' == $ts_field['type']) { ?>
<?php

$ccs = Modula_Helper::get_image_licenses();

?>
<div class="modula-image-licensing-radio-wrapper">
<?php foreach( $ts_field['values'] as $val_key => $val ) : ?>

<input
<?php echo ($val_key == $image_attrib_options[ $key ] ) ? 'checked="checked"': ''; ?>
<?php
if ( ! isset( $ccs[ $val_key ] ) ) {
continue;
}


$cc = $ccs[ $val_key ];
?>
id="modula_image_licensing_license_<?php echo esc_attr($val_key); ?>"
class="modula_image_licensing_radio_input"
type="radio"
name="modula_image_licensing_option[<?php echo esc_attr($key); ?>]"
data-setting="modula_image_licensing_option[<?php echo esc_attr($key); ?>]"
value="<?php echo esc_attr($val_key); ?>">

<label class="modula-image-licensing-radio-icon" for="modula_image_licensing_license_<?php echo esc_attr($val_key); ?>">
<?php if( isset( $cc['image'] ) && '' != $cc['image'] ): ?>
<img alt="Creative Commons License" style="border-width:0" src="<?php echo esc_url( $cc['image'] ); ?>"/>
<?php endif; ?>
<?php if( isset( $cc['license'] ) && '' != $cc['license'] ): ?>
<span class="modula-image-licensing-radio-name"><?php printf( __( 'This work is licensed under a %s' ), esc_html( $cc['name'] ) ); ?></span>
<?php else: ?>
<span class="modula-image-licensing-radio-name"><?php esc_html_e( 'None', 'modula-best-grid-gallery' )?></span>
<?php endif; ?>
</label>

<?php endforeach; ?>
</div>
<?php } ?>

</div>
</div>
</td>
Expand Down
Loading

0 comments on commit d7f126b

Please sign in to comment.