Version Description
- 07/19/2019
- Add "with Zoom" style to the Gutenberg image block
Download this release
Release Info
Developer | diana_burduja |
Plugin | WP Image Zoom |
Version | 1.35 |
Comparing to | |
See all releases |
Code changes from version 1.34 to 1.35
- assets/js/gutenberg-zoom-style.js +6 -0
- assets/js/image_zoom-init.js +5 -0
- image-zoooom.php +3 -3
- includes/admin-side.php +40 -0
- readme.txt +5 -1
assets/js/gutenberg-zoom-style.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
wp.domReady( function() {
|
2 |
+
wp.blocks.registerBlockStyle( 'core/image', {
|
3 |
+
name: 'zoooom',
|
4 |
+
label: 'with Zoom'
|
5 |
+
} );
|
6 |
+
});
|
assets/js/image_zoom-init.js
CHANGED
@@ -22,6 +22,11 @@ jQuery(document).ready(function( $ ){
|
|
22 |
$(this).attr('data-zoom-image', $(this).data('lazy-src'));
|
23 |
});
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
// Get the image url from data-large_image
|
26 |
$("img[data-large_image]").each(function(){
|
27 |
$(this).attr('data-zoom-image', $(this).data('large_image'));
|
22 |
$(this).attr('data-zoom-image', $(this).data('lazy-src'));
|
23 |
});
|
24 |
|
25 |
+
// Add "zoooom" for the "is-style-zoooom" images added with Gutenberg
|
26 |
+
$(".is-style-zoooom").each(function(){
|
27 |
+
$(this).addClass('zoooom');
|
28 |
+
});
|
29 |
+
|
30 |
// Get the image url from data-large_image
|
31 |
$("img[data-large_image]").each(function(){
|
32 |
$(this).attr('data-zoom-image', $(this).data('large_image'));
|
image-zoooom.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP Image Zoom
|
4 |
* Plugin URI: https://wordpress.org/plugins/wp-image-zoooom/
|
5 |
* Description: Add zoom effect over the an image, whether it is an image in a post/page or the featured image of a product in a WooCommerce shop
|
6 |
-
* Version: 1.
|
7 |
* Author: SilkyPress
|
8 |
* Author URI: https://www.silkypress.com
|
9 |
* License: GPL2
|
@@ -12,7 +12,7 @@
|
|
12 |
* Domain Path: /languages/
|
13 |
*
|
14 |
* WC requires at least: 2.3.0
|
15 |
-
* WC tested up to: 3.
|
16 |
*/
|
17 |
|
18 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -27,7 +27,7 @@ if ( ! class_exists( 'ImageZoooom' ) ) :
|
|
27 |
*/
|
28 |
final class ImageZoooom {
|
29 |
public $plugin;
|
30 |
-
public $version = '1.
|
31 |
public $theme = '';
|
32 |
protected static $_instance = null;
|
33 |
|
3 |
* Plugin Name: WP Image Zoom
|
4 |
* Plugin URI: https://wordpress.org/plugins/wp-image-zoooom/
|
5 |
* Description: Add zoom effect over the an image, whether it is an image in a post/page or the featured image of a product in a WooCommerce shop
|
6 |
+
* Version: 1.35
|
7 |
* Author: SilkyPress
|
8 |
* Author URI: https://www.silkypress.com
|
9 |
* License: GPL2
|
12 |
* Domain Path: /languages/
|
13 |
*
|
14 |
* WC requires at least: 2.3.0
|
15 |
+
* WC tested up to: 3.7
|
16 |
*/
|
17 |
|
18 |
if ( ! defined( 'ABSPATH' ) ) {
|
27 |
*/
|
28 |
final class ImageZoooom {
|
29 |
public $plugin;
|
30 |
+
public $version = '1.35';
|
31 |
public $theme = '';
|
32 |
protected static $_instance = null;
|
33 |
|
includes/admin-side.php
CHANGED
@@ -29,6 +29,8 @@ class ImageZoooom_Admin {
|
|
29 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
30 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
31 |
add_action( 'admin_head', array( $this, 'iz_add_tinymce_button' ) );
|
|
|
|
|
32 |
$this->plugin = wp_image_zoooom_settings('plugin');
|
33 |
$this->warnings();
|
34 |
}
|
@@ -110,6 +112,22 @@ class ImageZoooom_Admin {
|
|
110 |
return false;
|
111 |
}
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
/**
|
114 |
* Output the admin page
|
115 |
* @access public
|
@@ -439,6 +457,28 @@ class ImageZoooom_Admin {
|
|
439 |
}
|
440 |
|
441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
/**
|
443 |
* Show admin warnings
|
444 |
*/
|
29 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
30 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
31 |
add_action( 'admin_head', array( $this, 'iz_add_tinymce_button' ) );
|
32 |
+
add_action( 'admin_head', array( $this, 'gutenberg_style' ) );
|
33 |
+
add_action( 'enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets' ) );
|
34 |
$this->plugin = wp_image_zoooom_settings('plugin');
|
35 |
$this->warnings();
|
36 |
}
|
112 |
return false;
|
113 |
}
|
114 |
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Add "with Image Zoom" style for the Image block in Gutenberg
|
118 |
+
* @access public
|
119 |
+
*/
|
120 |
+
public function enqueue_block_editor_assets() {
|
121 |
+
wp_enqueue_script(
|
122 |
+
'gutenberg-zoom-style',
|
123 |
+
IMAGE_ZOOM_URL . 'assets/js/gutenberg-zoom-style.js',
|
124 |
+
array( 'wp-blocks', 'wp-dom' ),
|
125 |
+
filemtime( IMAGE_ZOOM_PATH . '/assets/js/gutenberg-zoom-style.js' ),
|
126 |
+
true
|
127 |
+
);
|
128 |
+
}
|
129 |
+
|
130 |
+
|
131 |
/**
|
132 |
* Output the admin page
|
133 |
* @access public
|
457 |
}
|
458 |
|
459 |
|
460 |
+
/**
|
461 |
+
* Image style in the Gutenberg editor
|
462 |
+
*/
|
463 |
+
function gutenberg_style() {
|
464 |
+
echo '<style type="text/css">
|
465 |
+
.edit-post-layout__content figure.is-style-zoooom::before{
|
466 |
+
content: "\f179 Zoom applied to the image. Check on the frontend";
|
467 |
+
position: absolute;
|
468 |
+
margin-top: 12px;
|
469 |
+
text-align: right;
|
470 |
+
background-color: white;
|
471 |
+
padding: 0 10px 6px;
|
472 |
+
right: 0;
|
473 |
+
font-family: dashicons;
|
474 |
+
font-size: 0.9em;
|
475 |
+
font-style: italic;
|
476 |
+
z-index: 20;
|
477 |
+
}
|
478 |
+
</style>';
|
479 |
+
}
|
480 |
+
|
481 |
+
|
482 |
/**
|
483 |
* Show admin warnings
|
484 |
*/
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Email: diana@burduja.eu
|
|
5 |
Tags: e-commerce, featured image, hover over image zoom, image, image zoom, image zoom plugin, image magnification, image magnifier, jquery picture zoom, magnifier, magnify image, magnifying glass, mouse over image zoom, panorama, picture zoom, product image, product zoom, product magnification, product magnifier, responsive, woocommerce product zoom, woocommerce zoom, woocommerce magnifying glass, zoom, zoom image, zoom plugin, woocommerce image zoom, woocommerce product image zoom, woocommerce zoom magnifier
|
6 |
Requires at least: 3.0.1
|
7 |
Tested up to: 5.2
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
Requires PHP: 5.2.4
|
@@ -152,6 +152,10 @@ Alternatively you can upgrade to the Pro version, as there the zoom lens is buil
|
|
152 |
|
153 |
== Changelog ==
|
154 |
|
|
|
|
|
|
|
|
|
155 |
= 1.34 =
|
156 |
* 06/22/2019
|
157 |
* Fix: zoom wasn't initialized for post/page images served by the ShortPixel CDN
|
5 |
Tags: e-commerce, featured image, hover over image zoom, image, image zoom, image zoom plugin, image magnification, image magnifier, jquery picture zoom, magnifier, magnify image, magnifying glass, mouse over image zoom, panorama, picture zoom, product image, product zoom, product magnification, product magnifier, responsive, woocommerce product zoom, woocommerce zoom, woocommerce magnifying glass, zoom, zoom image, zoom plugin, woocommerce image zoom, woocommerce product image zoom, woocommerce zoom magnifier
|
6 |
Requires at least: 3.0.1
|
7 |
Tested up to: 5.2
|
8 |
+
Stable tag: 1.35
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
Requires PHP: 5.2.4
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
+
= 1.35 =
|
156 |
+
* 07/19/2019
|
157 |
+
* Add "with Zoom" style to the Gutenberg image block
|
158 |
+
|
159 |
= 1.34 =
|
160 |
* 06/22/2019
|
161 |
* Fix: zoom wasn't initialized for post/page images served by the ShortPixel CDN
|