Version Description
Download this release
Release Info
| Developer | cbaldelomar |
| Plugin | |
| Version | 1.55 |
| Comparing to | |
| See all releases | |
Code changes from version 1.54 to 1.55
- README.md +5 -0
- includes/functions.php +1 -1
- includes/js/gallery.js +12 -4
- includes/js/imagesloaded.pkgd.min.js +2 -2
- includes/scripts.php +1 -1
- readme.txt +5 -0
- wc-gallery.php +2 -2
README.md
CHANGED
|
@@ -62,6 +62,11 @@ For more tutorials on our gallery plugin, go to our knowledge base.
|
|
| 62 |
|
| 63 |
## Changelog ##
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
### Version 1.54 ###
|
| 66 |
|
| 67 |
* removed ellipsis
|
| 62 |
|
| 63 |
## Changelog ##
|
| 64 |
|
| 65 |
+
### Version 1.55 ###
|
| 66 |
+
|
| 67 |
+
* Fixed bug with large galleries stacking images
|
| 68 |
+
* Updated imagesLoaded Package to version 4.1.1
|
| 69 |
+
|
| 70 |
### Version 1.54 ###
|
| 71 |
|
| 72 |
* removed ellipsis
|
includes/functions.php
CHANGED
|
@@ -472,7 +472,7 @@ function wc_gallery_get_attachment_link( $id = 0, $size = 'thumbnail', $permalin
|
|
| 472 |
if ( $text )
|
| 473 |
$link_text = $text;
|
| 474 |
elseif ( $size && 'none' != $size )
|
| 475 |
-
$link_text = wp_get_attachment_image( $id, $size, $icon );
|
| 476 |
else
|
| 477 |
$link_text = '';
|
| 478 |
|
| 472 |
if ( $text )
|
| 473 |
$link_text = $text;
|
| 474 |
elseif ( $size && 'none' != $size )
|
| 475 |
+
$link_text = wp_get_attachment_image( $id, $size, $icon, array( 'data-attachment-id' => $id ) );
|
| 476 |
else
|
| 477 |
$link_text = '';
|
| 478 |
|
includes/js/gallery.js
CHANGED
|
@@ -74,16 +74,24 @@
|
|
| 74 |
$('.gallery-masonry').each( function() {
|
| 75 |
var $container = $(this);
|
| 76 |
var $posts = $container.children('.gallery-item');
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
// keeps the media elements from calculating for the full width of the post
|
| 79 |
$(document).ready(function(){
|
| 80 |
// we are going to append masonry items as the images load
|
| 81 |
runMasonry(0, $container, $posts, 'masonry');
|
| 82 |
|
| 83 |
-
$container.imagesLoaded()
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
});
|
| 88 |
|
| 89 |
$(window).resize(function() {
|
| 74 |
$('.gallery-masonry').each( function() {
|
| 75 |
var $container = $(this);
|
| 76 |
var $posts = $container.children('.gallery-item');
|
| 77 |
+
var attachmentId;
|
| 78 |
+
|
| 79 |
+
$posts.css('visibility', 'hidden');
|
| 80 |
|
| 81 |
// keeps the media elements from calculating for the full width of the post
|
| 82 |
$(document).ready(function(){
|
| 83 |
// we are going to append masonry items as the images load
|
| 84 |
runMasonry(0, $container, $posts, 'masonry');
|
| 85 |
|
| 86 |
+
$container.imagesLoaded()
|
| 87 |
+
.always( function( instance ) {
|
| 88 |
+
$posts.css('visibility', 'visible');
|
| 89 |
+
})
|
| 90 |
+
.progress( function( instance, image ) {
|
| 91 |
+
attachmentId = image.img.dataset.attachmentId;
|
| 92 |
+
$container.children('.gallery-item-attachment-' + attachmentId ).css('visibility', 'visible')
|
| 93 |
+
runMasonry(0, $container, $posts, 'layout');
|
| 94 |
+
});
|
| 95 |
});
|
| 96 |
|
| 97 |
$(window).resize(function() {
|
includes/js/imagesloaded.pkgd.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
/*!
|
| 2 |
-
* imagesLoaded PACKAGED v4.1.
|
| 3 |
* JavaScript is all like "You images are done yet or what?"
|
| 4 |
* MIT License
|
| 5 |
*/
|
| 6 |
|
| 7 |
-
!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||
|
| 1 |
/*!
|
| 2 |
+
* imagesLoaded PACKAGED v4.1.1
|
| 3 |
* JavaScript is all like "You images are done yet or what?"
|
| 4 |
* MIT License
|
| 5 |
*/
|
| 6 |
|
| 7 |
+
!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e}function o(t,e,r){return this instanceof o?("string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=n(t),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(function(){this.check()}.bind(this))):new o(t,e,r)}function r(t){this.img=t}function s(t,e){this.url=t,this.element=e,this.img=new Image}var h=t.jQuery,a=t.console;o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&d[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var d={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,t),n=i.exec(e.backgroundImage)}},o.prototype.addImage=function(t){var e=new r(t);this.images.push(e)},o.prototype.addBackground=function(t,e){var i=new s(t,e);this.images.push(i)},o.prototype.check=function(){function t(t,i,n){setTimeout(function(){e.progress(t,i,n)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},o.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,t,e)},o.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},r.prototype=Object.create(e.prototype),r.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},o.makeJQueryPlugin=function(e){e=e||t.jQuery,e&&(h=e,h.fn.imagesLoaded=function(t,e){var i=new o(this,t,e);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});
|
includes/scripts.php
CHANGED
|
@@ -24,7 +24,7 @@ if( !function_exists ('wc_gallery_scripts') ) :
|
|
| 24 |
wp_enqueue_script( 'jquery-masonry' );
|
| 25 |
|
| 26 |
// images loaded
|
| 27 |
-
wp_register_script( 'wordpresscanvas-imagesloaded', plugin_dir_url( __FILE__ ) . 'js/imagesloaded.pkgd.min.js', array (), '4.1.
|
| 28 |
|
| 29 |
if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) ) {
|
| 30 |
wp_enqueue_style( 'wc-gallery-popup-style', plugin_dir_url( __FILE__ ) . 'css/magnific-popup.css', array( ), '1.1.0' );
|
| 24 |
wp_enqueue_script( 'jquery-masonry' );
|
| 25 |
|
| 26 |
// images loaded
|
| 27 |
+
wp_register_script( 'wordpresscanvas-imagesloaded', plugin_dir_url( __FILE__ ) . 'js/imagesloaded.pkgd.min.js', array (), '4.1.1', true );
|
| 28 |
|
| 29 |
if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) ) {
|
| 30 |
wp_enqueue_style( 'wc-gallery-popup-style', plugin_dir_url( __FILE__ ) . 'css/magnific-popup.css', array( ), '1.1.0' );
|
readme.txt
CHANGED
|
@@ -62,6 +62,11 @@ For more tutorials on our gallery plugin, go to our knowledge base.
|
|
| 62 |
|
| 63 |
== Changelog ==
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
= Version 1.54 =
|
| 66 |
|
| 67 |
* removed ellipsis
|
| 62 |
|
| 63 |
== Changelog ==
|
| 64 |
|
| 65 |
+
= Version 1.55 =
|
| 66 |
+
|
| 67 |
+
* Fixed bug with large galleries stacking images
|
| 68 |
+
* Updated imagesLoaded Package to version 4.1.1
|
| 69 |
+
|
| 70 |
= Version 1.54 =
|
| 71 |
|
| 72 |
* removed ellipsis
|
wc-gallery.php
CHANGED
|
@@ -5,7 +5,7 @@ Plugin URI: http://wordpresscanvas.com/features/gallery/
|
|
| 5 |
Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
-
Version: 1.
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
|
@@ -13,7 +13,7 @@ function wc_gallery_using_woocommerce() {
|
|
| 13 |
return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
|
| 14 |
}
|
| 15 |
|
| 16 |
-
define( 'WC_GALLERY_VERSION', '1.
|
| 17 |
define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
|
| 18 |
define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
|
| 19 |
define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 5 |
Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
+
Version: 1.55
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 13 |
return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
|
| 14 |
}
|
| 15 |
|
| 16 |
+
define( 'WC_GALLERY_VERSION', '1.55' );
|
| 17 |
define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
|
| 18 |
define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
|
| 19 |
define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
