Version Description
Download this release
Release Info
| Developer | cbaldelomar |
| Plugin | |
| Version | 1.57 |
| Comparing to | |
| See all releases | |
Code changes from version 1.56 to 1.57
- README.md +6 -0
- includes/functions.php +3 -5
- includes/js/gallery-carousel.js +108 -0
- includes/js/gallery-masonry.js +116 -0
- includes/js/gallery-popup.js +56 -0
- includes/js/gallery-slider.js +123 -0
- includes/js/woocommerce.product.js +0 -24
- includes/scripts.php +5 -15
- includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php +13 -13
- includes/vendors/wpc-settings-framework/js/options.js +1 -1
- includes/vendors/wpc-settings-framework/views/tabs.php +7 -0
- readme.txt +6 -0
- wc-gallery.php +2 -7
README.md
CHANGED
|
@@ -67,6 +67,12 @@ For more tutorials on our gallery plugin, go to our knowledge base.
|
|
| 67 |
|
| 68 |
## Changelog ##
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
### Version 1.56 ###
|
| 71 |
|
| 72 |
* More elegant loading of masonry gallery images.
|
| 67 |
|
| 68 |
## Changelog ##
|
| 69 |
|
| 70 |
+
### Version 1.57 ###
|
| 71 |
+
|
| 72 |
+
* Updated WPC Settings Framework to 1.0.5
|
| 73 |
+
* removed woocommerce product gallery option
|
| 74 |
+
* fixed bug when muliple galleries were not loading libraries in correct order.
|
| 75 |
+
|
| 76 |
### Version 1.56 ###
|
| 77 |
|
| 78 |
* More elegant loading of masonry gallery images.
|
includes/functions.php
CHANGED
|
@@ -150,8 +150,7 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 150 |
}
|
| 151 |
|
| 152 |
if ( in_array( $display, $sliders ) ) {
|
| 153 |
-
wp_enqueue_script( 'wc-gallery-
|
| 154 |
-
wp_enqueue_script( 'wc-gallery' );
|
| 155 |
|
| 156 |
$class[] = 'wc' . $display;
|
| 157 |
$class[] = 'wcflexslider';
|
|
@@ -277,8 +276,7 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 277 |
$output .= "</div>\n";
|
| 278 |
}
|
| 279 |
else if ( in_array( $display, $owlcarousel ) ) {
|
| 280 |
-
wp_enqueue_script( 'wc-gallery-
|
| 281 |
-
wp_enqueue_script( 'wc-gallery' );
|
| 282 |
|
| 283 |
$class[] = 'wc' . $display;
|
| 284 |
$class[] = 'wcowlcarousel';
|
|
@@ -344,7 +342,7 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 344 |
$output .= "</div></div>\n";
|
| 345 |
}
|
| 346 |
else {
|
| 347 |
-
wp_enqueue_script( 'wc-gallery' );
|
| 348 |
|
| 349 |
// getting rid of float
|
| 350 |
$display = 'float' == $display ? 'masonry' : $display;
|
| 150 |
}
|
| 151 |
|
| 152 |
if ( in_array( $display, $sliders ) ) {
|
| 153 |
+
wp_enqueue_script( 'wc-gallery-slider' );
|
|
|
|
| 154 |
|
| 155 |
$class[] = 'wc' . $display;
|
| 156 |
$class[] = 'wcflexslider';
|
| 276 |
$output .= "</div>\n";
|
| 277 |
}
|
| 278 |
else if ( in_array( $display, $owlcarousel ) ) {
|
| 279 |
+
wp_enqueue_script( 'wc-gallery-carousel' );
|
|
|
|
| 280 |
|
| 281 |
$class[] = 'wc' . $display;
|
| 282 |
$class[] = 'wcowlcarousel';
|
| 342 |
$output .= "</div></div>\n";
|
| 343 |
}
|
| 344 |
else {
|
| 345 |
+
wp_enqueue_script( 'wc-gallery-masonry' );
|
| 346 |
|
| 347 |
// getting rid of float
|
| 348 |
$display = 'float' == $display ? 'masonry' : $display;
|
includes/js/gallery-carousel.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @author Chris Baldelomar
|
| 3 |
+
* @website http://wordpresscanvas.com/
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
( function( $ ) {
|
| 7 |
+
"use strict";
|
| 8 |
+
|
| 9 |
+
var body = $( 'body' ),
|
| 10 |
+
_window = $( window );
|
| 11 |
+
|
| 12 |
+
var initGallery = function() {
|
| 13 |
+
if( jQuery().owlCarousel) {
|
| 14 |
+
$('.wcowlcarousel').each( function() {
|
| 15 |
+
var $this = $(this);
|
| 16 |
+
if ( $this.is(':hidden') ) {
|
| 17 |
+
return;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
if ( $this.hasClass( 'wcowlcarousel-is-active' ) ) {
|
| 21 |
+
return;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
var $owl = $this.children('.owl-carousel');
|
| 25 |
+
var columns = parseInt( $owl.data('columns') );
|
| 26 |
+
var columnsTablet = columns - 1;
|
| 27 |
+
var columnsPhone = columns - 2;
|
| 28 |
+
var gutterWidth = $owl.data('gutterWidth');
|
| 29 |
+
var hideControls = $owl.data('hideControls');
|
| 30 |
+
var showNav = hideControls ? false : true;
|
| 31 |
+
var containerWidth = $this.width();
|
| 32 |
+
|
| 33 |
+
$this.addClass('wcowlcarousel-is-active');
|
| 34 |
+
|
| 35 |
+
gutterWidth = parseInt( gutterWidth );
|
| 36 |
+
if ( 1 > columnsTablet ) {
|
| 37 |
+
columnsTablet = 1;
|
| 38 |
+
}
|
| 39 |
+
if ( 1 > columnsPhone ) {
|
| 40 |
+
columnsPhone = 1;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
if ( $this.hasClass('wcowlautowidth') ) {
|
| 44 |
+
$owl.owlCarousel({
|
| 45 |
+
margin: gutterWidth,
|
| 46 |
+
loop: true,
|
| 47 |
+
dots: false,
|
| 48 |
+
autoWidth: true,
|
| 49 |
+
responsive: {
|
| 50 |
+
0:{
|
| 51 |
+
nav: false,
|
| 52 |
+
},
|
| 53 |
+
569:{
|
| 54 |
+
nav: showNav,
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
});
|
| 58 |
+
}
|
| 59 |
+
else if ( $this.hasClass('wcowlcolumns') ) {
|
| 60 |
+
$owl.owlCarousel({
|
| 61 |
+
margin: gutterWidth,
|
| 62 |
+
loop: true,
|
| 63 |
+
dots: false,
|
| 64 |
+
items: columns,
|
| 65 |
+
responsive: {
|
| 66 |
+
0:{
|
| 67 |
+
nav: false
|
| 68 |
+
},
|
| 69 |
+
569:{
|
| 70 |
+
nav: showNav
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
});
|
| 74 |
+
}
|
| 75 |
+
else if ( $this.hasClass('wcowlslider') ) {
|
| 76 |
+
$owl.owlCarousel({
|
| 77 |
+
margin: 0,
|
| 78 |
+
loop: true,
|
| 79 |
+
dots: false,
|
| 80 |
+
items: 1,
|
| 81 |
+
autoHeight:true,
|
| 82 |
+
responsive: {
|
| 83 |
+
0:{
|
| 84 |
+
nav: false
|
| 85 |
+
},
|
| 86 |
+
569:{
|
| 87 |
+
nav: showNav
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
});
|
| 91 |
+
}
|
| 92 |
+
});
|
| 93 |
+
}
|
| 94 |
+
};
|
| 95 |
+
|
| 96 |
+
initGallery();
|
| 97 |
+
|
| 98 |
+
// Triggers re-layout on infinite scroll
|
| 99 |
+
$( document.body ).on( 'post-load', function () {
|
| 100 |
+
initGallery();
|
| 101 |
+
});
|
| 102 |
+
|
| 103 |
+
// Triggers re-layout on accordion, tabs, toggle
|
| 104 |
+
$( document.body ).on( 'wcs-toggled', function () {
|
| 105 |
+
initGallery();
|
| 106 |
+
});
|
| 107 |
+
|
| 108 |
+
} )( jQuery );
|
includes/js/gallery-masonry.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @author Chris Baldelomar
|
| 3 |
+
* @website http://wordpresscanvas.com/
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
( function( $ ) {
|
| 7 |
+
"use strict";
|
| 8 |
+
|
| 9 |
+
var body = $( 'body' ),
|
| 10 |
+
_window = $( window );
|
| 11 |
+
|
| 12 |
+
var calculateGrid = function($container) {
|
| 13 |
+
var windowWidth = _window.width();
|
| 14 |
+
var columns = parseInt( $container.data('columns') );
|
| 15 |
+
var gutterWidth = $container.data('gutterWidth');
|
| 16 |
+
// need to return exact decimal width
|
| 17 |
+
var containerWidth = Math.floor($container[0].getBoundingClientRect().width);
|
| 18 |
+
|
| 19 |
+
if ( isNaN( gutterWidth ) ) {
|
| 20 |
+
gutterWidth = 5;
|
| 21 |
+
}
|
| 22 |
+
else if ( gutterWidth > 30 || gutterWidth < 0 ) {
|
| 23 |
+
gutterWidth = 5;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if ( windowWidth <= 568 ) {
|
| 27 |
+
columns = 1
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
gutterWidth = parseInt( gutterWidth );
|
| 31 |
+
|
| 32 |
+
var allGutters = gutterWidth * ( columns - 1 );
|
| 33 |
+
var contentWidth = containerWidth - allGutters;
|
| 34 |
+
|
| 35 |
+
var columnWidth = Math.floor( contentWidth / columns );
|
| 36 |
+
|
| 37 |
+
return {columnWidth: columnWidth, gutterWidth: gutterWidth, columns: columns};
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
var runMasonry = function( duration, $container, $posts, method ) {
|
| 41 |
+
var o = calculateGrid($container);
|
| 42 |
+
|
| 43 |
+
if ( o.columns == 1 ) {
|
| 44 |
+
if ( $container.hasClass('masonry') ) {
|
| 45 |
+
$container.masonry('destroy');
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
$container.removeAttr("style");
|
| 49 |
+
$container.children().removeAttr("style");
|
| 50 |
+
$container.css('height', 'auto');
|
| 51 |
+
|
| 52 |
+
return;
|
| 53 |
+
}
|
| 54 |
+
else if ( 'layout' == method ) {
|
| 55 |
+
$container.masonry('layout');
|
| 56 |
+
|
| 57 |
+
return;
|
| 58 |
+
}
|
| 59 |
+
else {
|
| 60 |
+
$posts.css({'width':o.columnWidth+'px', 'margin-bottom':o.gutterWidth+'px', 'padding':'0'});
|
| 61 |
+
$container = $container.masonry( {
|
| 62 |
+
itemSelector: '.gallery-item',
|
| 63 |
+
columnWidth: o.columnWidth,
|
| 64 |
+
gutter: o.gutterWidth,
|
| 65 |
+
transitionDuration: duration
|
| 66 |
+
} );
|
| 67 |
+
|
| 68 |
+
return;
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
var initGallery = function() {
|
| 73 |
+
$('.gallery-masonry').each( function() {
|
| 74 |
+
var $container = $(this);
|
| 75 |
+
var $posts = $container.children('.gallery-item');
|
| 76 |
+
|
| 77 |
+
$posts.css({'visibility':'hidden','position':'relative'}).addClass('wc-gallery-loading');
|
| 78 |
+
|
| 79 |
+
$.each( $posts, function( index, value ) {
|
| 80 |
+
var $post = $(this);
|
| 81 |
+
var $imgs = $post.find('img');
|
| 82 |
+
|
| 83 |
+
if ( $imgs.length ) {
|
| 84 |
+
$post.imagesLoaded()
|
| 85 |
+
.always( function( instance ) {
|
| 86 |
+
$post.css('visibility', 'visible').removeClass('wc-gallery-loading');
|
| 87 |
+
runMasonry(0, $container, $posts, 'layout');
|
| 88 |
+
});
|
| 89 |
+
}
|
| 90 |
+
else {
|
| 91 |
+
$post.css('visibility', 'visible').removeClass('wc-gallery-loading');
|
| 92 |
+
}
|
| 93 |
+
});
|
| 94 |
+
|
| 95 |
+
runMasonry(0, $container, $posts, 'masonry');
|
| 96 |
+
|
| 97 |
+
$(window).resize(function() {
|
| 98 |
+
runMasonry(0, $container, $posts, 'masonry');
|
| 99 |
+
});
|
| 100 |
+
});
|
| 101 |
+
|
| 102 |
+
};
|
| 103 |
+
|
| 104 |
+
initGallery();
|
| 105 |
+
|
| 106 |
+
// Triggers re-layout on infinite scroll
|
| 107 |
+
$( document.body ).on( 'post-load', function () {
|
| 108 |
+
initGallery();
|
| 109 |
+
});
|
| 110 |
+
|
| 111 |
+
// Triggers re-layout on accordion, tabs, toggle
|
| 112 |
+
$( document.body ).on( 'wcs-toggled', function () {
|
| 113 |
+
initGallery();
|
| 114 |
+
});
|
| 115 |
+
|
| 116 |
+
} )( jQuery );
|
includes/js/gallery-popup.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @author Chris Baldelomar
|
| 3 |
+
* @website http://wordpresscanvas.com/
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
( function( $ ) {
|
| 7 |
+
"use strict";
|
| 8 |
+
|
| 9 |
+
var body = $( 'body' ),
|
| 10 |
+
_window = $( window );
|
| 11 |
+
|
| 12 |
+
var galleryPopup = function() {
|
| 13 |
+
if( jQuery().magnificPopup) {
|
| 14 |
+
$('.gallery-link-file').each( function() {
|
| 15 |
+
var $this = $(this);
|
| 16 |
+
|
| 17 |
+
if ( $this.hasClass( 'magnificpopup-is-active' ) ) {
|
| 18 |
+
return;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
$this.magnificPopup({
|
| 22 |
+
delegate: '.gallery-icon a',
|
| 23 |
+
gallery: {
|
| 24 |
+
enabled: true
|
| 25 |
+
},
|
| 26 |
+
type:'image',
|
| 27 |
+
image: {
|
| 28 |
+
titleSrc: function(item) {
|
| 29 |
+
var caption = $(item.el).parent().next('.gallery-caption').html();
|
| 30 |
+
if ( 'string' == typeof caption && caption.length > 0 )
|
| 31 |
+
return caption;
|
| 32 |
+
|
| 33 |
+
return '';
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
});
|
| 37 |
+
|
| 38 |
+
$this.addClass( 'magnificpopup-is-active' );
|
| 39 |
+
});
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
galleryPopup();
|
| 45 |
+
|
| 46 |
+
// Triggers re-layout on infinite scroll
|
| 47 |
+
$( document.body ).on( 'post-load', function () {
|
| 48 |
+
galleryPopup();
|
| 49 |
+
});
|
| 50 |
+
|
| 51 |
+
// Triggers re-layout on accordion, tabs, toggle
|
| 52 |
+
// $( document.body ).on( 'wcs-toggled', function () {
|
| 53 |
+
// galleryPopup();
|
| 54 |
+
// });
|
| 55 |
+
|
| 56 |
+
} )( jQuery );
|
includes/js/gallery-slider.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* @author Chris Baldelomar
|
| 3 |
+
* @website http://wordpresscanvas.com/
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
( function( $ ) {
|
| 7 |
+
"use strict";
|
| 8 |
+
|
| 9 |
+
var body = $( 'body' ),
|
| 10 |
+
_window = $( window );
|
| 11 |
+
|
| 12 |
+
var initGallery = function() {
|
| 13 |
+
if( jQuery().wcflexslider) {
|
| 14 |
+
$('.wcflexslider-container').each( function() {
|
| 15 |
+
var $this = $(this);
|
| 16 |
+
if ( $this.is(':hidden') ) {
|
| 17 |
+
return;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
if ( $this.hasClass( 'wcflexslider-is-active' ) ) {
|
| 21 |
+
return;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
var $flex = $(this).children('.gallery.wcflexslider');
|
| 25 |
+
var columns = parseInt( $flex.data('columns') );
|
| 26 |
+
var columnsTablet = columns - 1;
|
| 27 |
+
var columnsPhone = columns - 2;
|
| 28 |
+
var gutterWidth = $flex.data('gutterWidth');
|
| 29 |
+
var hideControls = $flex.data('hideControls');
|
| 30 |
+
var showNav = hideControls ? false : true;
|
| 31 |
+
var containerWidth = $this.width();
|
| 32 |
+
|
| 33 |
+
$this.addClass('wcflexslider-is-active');
|
| 34 |
+
|
| 35 |
+
gutterWidth = parseInt( gutterWidth );
|
| 36 |
+
|
| 37 |
+
imagesLoaded( $flex, function() {
|
| 38 |
+
if ( $flex.hasClass('wcslider') ) {
|
| 39 |
+
$flex.wcflexslider({
|
| 40 |
+
prevText: "",
|
| 41 |
+
nextText: "",
|
| 42 |
+
smoothHeight: true,
|
| 43 |
+
slideshow: false,
|
| 44 |
+
directionNav: showNav,
|
| 45 |
+
animation:"fade"
|
| 46 |
+
});
|
| 47 |
+
}
|
| 48 |
+
else if ( $flex.hasClass('wcslider2') ) {
|
| 49 |
+
$flex.wcflexslider({
|
| 50 |
+
prevText: "",
|
| 51 |
+
nextText: "",
|
| 52 |
+
smoothHeight: true,
|
| 53 |
+
slideshow: false,
|
| 54 |
+
directionNav: showNav,
|
| 55 |
+
animation:"slide"
|
| 56 |
+
});
|
| 57 |
+
}
|
| 58 |
+
else if ( $flex.hasClass('wcsliderauto') ) {
|
| 59 |
+
$flex.wcflexslider({
|
| 60 |
+
prevText: "",
|
| 61 |
+
nextText: "",
|
| 62 |
+
smoothHeight: true,
|
| 63 |
+
slideshow: true,
|
| 64 |
+
directionNav: showNav,
|
| 65 |
+
animation:"slide"
|
| 66 |
+
});
|
| 67 |
+
}
|
| 68 |
+
else if ( $flex.hasClass('wccarousel') ) {
|
| 69 |
+
$flex.wcflexslider({
|
| 70 |
+
prevText: "",
|
| 71 |
+
nextText: "",
|
| 72 |
+
smoothHeight: false,
|
| 73 |
+
slideshow: false,
|
| 74 |
+
directionNav: showNav,
|
| 75 |
+
animation: "slide",
|
| 76 |
+
animationLoop: false,
|
| 77 |
+
itemWidth: 270,
|
| 78 |
+
itemMargin: gutterWidth
|
| 79 |
+
});
|
| 80 |
+
}
|
| 81 |
+
else if ( $flex.hasClass('wcslider3bottomlinks') || $flex.hasClass('wcslider4bottomlinks') ) {
|
| 82 |
+
$flex.wcflexslider({
|
| 83 |
+
prevText: "",
|
| 84 |
+
nextText: "",
|
| 85 |
+
smoothHeight: true,
|
| 86 |
+
slideshow: true,
|
| 87 |
+
directionNav: showNav,
|
| 88 |
+
animation:"slide",
|
| 89 |
+
init: function() {
|
| 90 |
+
$this.find('.wc-image-links .gallery-item').each( function() {
|
| 91 |
+
var $link = $(this);
|
| 92 |
+
var $a = $link.find('.gallery-icon a');
|
| 93 |
+
if ( 0 < $a.length ) {
|
| 94 |
+
var href = $a.attr('href');
|
| 95 |
+
if ( 'string' == typeof( href ) ) {
|
| 96 |
+
var $caption = $link.find('.gallery-caption');
|
| 97 |
+
if ( 0 < $caption.length ) {
|
| 98 |
+
$caption.wrap('<a href="'+href+'"></a>');
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
});
|
| 103 |
+
}
|
| 104 |
+
});
|
| 105 |
+
}
|
| 106 |
+
});
|
| 107 |
+
});
|
| 108 |
+
}
|
| 109 |
+
};
|
| 110 |
+
|
| 111 |
+
initGallery();
|
| 112 |
+
|
| 113 |
+
// Triggers re-layout on infinite scroll
|
| 114 |
+
$( document.body ).on( 'post-load', function () {
|
| 115 |
+
initGallery();
|
| 116 |
+
});
|
| 117 |
+
|
| 118 |
+
// Triggers re-layout on accordion, tabs, toggle
|
| 119 |
+
$( document.body ).on( 'wcs-toggled', function () {
|
| 120 |
+
initGallery();
|
| 121 |
+
});
|
| 122 |
+
|
| 123 |
+
} )( jQuery );
|
includes/js/woocommerce.product.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
/**
|
| 2 |
-
* @author Chris Baldelomar
|
| 3 |
-
* @website http://wordpresscanvas.com/
|
| 4 |
-
*/
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
( function( $ ) {
|
| 8 |
-
"use strict";
|
| 9 |
-
|
| 10 |
-
if( jQuery().magnificPopup) {
|
| 11 |
-
$("a[data-rel^='prettyPhoto']").magnificPopup({
|
| 12 |
-
gallery: {
|
| 13 |
-
enabled: true
|
| 14 |
-
},
|
| 15 |
-
type:'image',
|
| 16 |
-
});
|
| 17 |
-
$("a[rel^='prettyPhoto']").magnificPopup({
|
| 18 |
-
gallery: {
|
| 19 |
-
enabled: true
|
| 20 |
-
},
|
| 21 |
-
type:'image',
|
| 22 |
-
});
|
| 23 |
-
}
|
| 24 |
-
} )( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/scripts.php
CHANGED
|
@@ -20,15 +20,13 @@ if( !function_exists ('wc_gallery_scripts') ) :
|
|
| 20 |
// jQuery
|
| 21 |
wp_enqueue_script('jquery');
|
| 22 |
|
| 23 |
-
// Masonry
|
| 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' );
|
| 31 |
-
wp_register_script( 'wc-gallery-
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
// Gallery Shortcode
|
|
@@ -37,17 +35,9 @@ if( !function_exists ('wc_gallery_scripts') ) :
|
|
| 37 |
wp_enqueue_style( 'wc-gallery-owlcarousel-theme-style', plugin_dir_url( __FILE__ ) . 'vendors/owlcarousel/assets/owl.theme.default.css', array( ), '2.1.4' );
|
| 38 |
wp_register_script( 'wc-gallery-flexslider', plugin_dir_url( __FILE__ ) . 'vendors/flexslider/jquery.flexslider-min.js', array ( 'jquery' ), '2.6.1', true );
|
| 39 |
wp_register_script( 'wc-gallery-owlcarousel', plugin_dir_url( __FILE__ ) . 'vendors/owlcarousel/owl.carousel.min.js', array ( 'jquery' ), '2.1.4', true );
|
| 40 |
-
wp_register_script( 'wc-gallery', plugin_dir_url( __FILE__ ) . 'js/gallery.js', array ( 'jquery', 'wordpresscanvas-imagesloaded' ), $ver, true );
|
| 41 |
-
wp_register_script( 'wc-gallery-
|
| 42 |
-
|
| 43 |
-
if ( WC_GALLERY_USING_WOOCOMMERCE ) {
|
| 44 |
-
$lightbox_en = get_option( 'woocommerce_enable_lightbox' ) == 'yes' ? true : false;
|
| 45 |
-
if ( ! $lightbox_en && ( is_singular( array( 'product' ) ) || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) ) {
|
| 46 |
-
wp_enqueue_script( 'wc-gallery-popup' );
|
| 47 |
-
wp_enqueue_script( 'wc-gallery-woocommerce-product' );
|
| 48 |
-
}
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
}
|
| 52 |
add_action('wp_enqueue_scripts', 'wc_gallery_scripts');
|
| 53 |
endif;
|
| 20 |
// jQuery
|
| 21 |
wp_enqueue_script('jquery');
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
// images loaded
|
| 24 |
wp_register_script( 'wordpresscanvas-imagesloaded', plugin_dir_url( __FILE__ ) . 'js/imagesloaded.pkgd.min.js', array (), '4.1.1', true );
|
| 25 |
|
| 26 |
if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) ) {
|
| 27 |
wp_enqueue_style( 'wc-gallery-popup-style', plugin_dir_url( __FILE__ ) . 'css/magnific-popup.css', array( ), '1.1.0' );
|
| 28 |
+
wp_register_script( 'wc-gallery-magnific', plugin_dir_url( __FILE__ ) . 'js/jquery.magnific-popup.min.js', array ( 'jquery' ), '1.1.0', true );
|
| 29 |
+
wp_register_script( 'wc-gallery-popup', plugin_dir_url( __FILE__ ) . 'js/gallery-popup.js', array ( 'jquery', 'wc-gallery-magnific' ), $ver, true );
|
| 30 |
}
|
| 31 |
|
| 32 |
// Gallery Shortcode
|
| 35 |
wp_enqueue_style( 'wc-gallery-owlcarousel-theme-style', plugin_dir_url( __FILE__ ) . 'vendors/owlcarousel/assets/owl.theme.default.css', array( ), '2.1.4' );
|
| 36 |
wp_register_script( 'wc-gallery-flexslider', plugin_dir_url( __FILE__ ) . 'vendors/flexslider/jquery.flexslider-min.js', array ( 'jquery' ), '2.6.1', true );
|
| 37 |
wp_register_script( 'wc-gallery-owlcarousel', plugin_dir_url( __FILE__ ) . 'vendors/owlcarousel/owl.carousel.min.js', array ( 'jquery' ), '2.1.4', true );
|
| 38 |
+
wp_register_script( 'wc-gallery-masonry', plugin_dir_url( __FILE__ ) . 'js/gallery-masonry.js', array ( 'jquery', 'wordpresscanvas-imagesloaded', 'jquery-masonry' ), $ver, true );
|
| 39 |
+
wp_register_script( 'wc-gallery-slider', plugin_dir_url( __FILE__ ) . 'js/gallery-slider.js', array ( 'jquery', 'wordpresscanvas-imagesloaded', 'wc-gallery-flexslider' ), $ver, true );
|
| 40 |
+
wp_register_script( 'wc-gallery-carousel', plugin_dir_url( __FILE__ ) . 'js/gallery-carousel.js', array ( 'jquery', 'wordpresscanvas-imagesloaded', 'wc-gallery-owlcarousel' ), $ver, true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
}
|
| 42 |
add_action('wp_enqueue_scripts', 'wc_gallery_scripts');
|
| 43 |
endif;
|
includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php
CHANGED
|
@@ -17,7 +17,7 @@
|
|
| 17 |
*/
|
| 18 |
class WC_Gallery_Settings_Framework {
|
| 19 |
|
| 20 |
-
protected $version = '1.0.
|
| 21 |
|
| 22 |
/**
|
| 23 |
* Instance of this class.
|
|
@@ -67,17 +67,17 @@ class WC_Gallery_Settings_Framework {
|
|
| 67 |
|
| 68 |
$this->set_slug_prefix();
|
| 69 |
|
| 70 |
-
add_action( 'admin_init', array(
|
| 71 |
|
| 72 |
-
add_action( 'init', array(
|
| 73 |
-
add_action( 'admin_init', array(
|
| 74 |
-
add_action( 'admin_init', array(
|
| 75 |
-
// add_action( 'admin_init', array(
|
| 76 |
-
add_action( 'after_switch_theme', array(
|
| 77 |
-
add_action( 'admin_menu', array(
|
| 78 |
|
| 79 |
// Load admin style sheet and JavaScript.
|
| 80 |
-
add_action( 'admin_enqueue_scripts', array(
|
| 81 |
}
|
| 82 |
|
| 83 |
/**
|
|
@@ -316,7 +316,7 @@ class WC_Gallery_Settings_Framework {
|
|
| 316 |
// add_settings_field( $id, $title, $callback, $page, $section, $args );
|
| 317 |
// @page should match @menu_slug from add_theme_page
|
| 318 |
// @section the section you added with add_settings_section
|
| 319 |
-
add_settings_field($oo['id'], $oo['title'], array(
|
| 320 |
}
|
| 321 |
}
|
| 322 |
else {
|
|
@@ -334,7 +334,7 @@ class WC_Gallery_Settings_Framework {
|
|
| 334 |
// add_settings_field( $id, $title, $callback, $page, $section, $args );
|
| 335 |
// @page should match @menu_slug from add_theme_page
|
| 336 |
// @section the section you added with add_settings_section
|
| 337 |
-
add_settings_field( $oo['option_name'], '<label for="'.$oo['option_name'].'">'.$oo['title'].'</label>' , array(
|
| 338 |
}
|
| 339 |
}
|
| 340 |
}
|
|
@@ -344,7 +344,7 @@ class WC_Gallery_Settings_Framework {
|
|
| 344 |
|
| 345 |
public function get_callback( &$o ) {
|
| 346 |
if ( isset( $o['callback'] ) && ! empty( $o['callback'] ) ) {
|
| 347 |
-
if (
|
| 348 |
return $o['callback'];
|
| 349 |
}
|
| 350 |
}
|
|
@@ -374,7 +374,7 @@ class WC_Gallery_Settings_Framework {
|
|
| 374 |
isset( $v['capability'] ) &&
|
| 375 |
isset( $v['option_group'] ) ) {
|
| 376 |
// add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
|
| 377 |
-
$view_hook_name = add_submenu_page( $v['parent_slug'], $v['page_title'], $v['menu_title'], $v['capability'], $menu_slug, array(
|
| 378 |
$this->views[ $view_hook_name ] = $menu_slug;
|
| 379 |
}
|
| 380 |
else if ( isset( $v['parent_slug'] ) ) {
|
| 17 |
*/
|
| 18 |
class WC_Gallery_Settings_Framework {
|
| 19 |
|
| 20 |
+
protected $version = '1.0.5';
|
| 21 |
|
| 22 |
/**
|
| 23 |
* Instance of this class.
|
| 67 |
|
| 68 |
$this->set_slug_prefix();
|
| 69 |
|
| 70 |
+
add_action( 'admin_init', array( &$this, 'set_plugin_info' ) );
|
| 71 |
|
| 72 |
+
add_action( 'init', array( &$this, 'set_options' ), 100 );
|
| 73 |
+
add_action( 'admin_init', array( &$this, 'register_settings' ) );
|
| 74 |
+
add_action( 'admin_init', array( &$this, 'options_activation' ), 200 );
|
| 75 |
+
// add_action( 'admin_init', array( &$this, 'update_options' ), 200 ); // debug
|
| 76 |
+
add_action( 'after_switch_theme', array( &$this, 'update_options' ), 200 );
|
| 77 |
+
add_action( 'admin_menu', array( &$this, 'options_admin_menu' ) );
|
| 78 |
|
| 79 |
// Load admin style sheet and JavaScript.
|
| 80 |
+
add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_admin_scripts' ) );
|
| 81 |
}
|
| 82 |
|
| 83 |
/**
|
| 316 |
// add_settings_field( $id, $title, $callback, $page, $section, $args );
|
| 317 |
// @page should match @menu_slug from add_theme_page
|
| 318 |
// @section the section you added with add_settings_section
|
| 319 |
+
add_settings_field($oo['id'], $oo['title'], array( &$this, 'display_group' ), $menu_slug, $o['id'], $oo );
|
| 320 |
}
|
| 321 |
}
|
| 322 |
else {
|
| 334 |
// add_settings_field( $id, $title, $callback, $page, $section, $args );
|
| 335 |
// @page should match @menu_slug from add_theme_page
|
| 336 |
// @section the section you added with add_settings_section
|
| 337 |
+
add_settings_field( $oo['option_name'], '<label for="'.$oo['option_name'].'">'.$oo['title'].'</label>' , array( &$this, 'display_setting' ), $menu_slug, $o['id'], $oo );
|
| 338 |
}
|
| 339 |
}
|
| 340 |
}
|
| 344 |
|
| 345 |
public function get_callback( &$o ) {
|
| 346 |
if ( isset( $o['callback'] ) && ! empty( $o['callback'] ) ) {
|
| 347 |
+
if ( is_callable( $o['callback'] ) ) {
|
| 348 |
return $o['callback'];
|
| 349 |
}
|
| 350 |
}
|
| 374 |
isset( $v['capability'] ) &&
|
| 375 |
isset( $v['option_group'] ) ) {
|
| 376 |
// add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
|
| 377 |
+
$view_hook_name = add_submenu_page( $v['parent_slug'], $v['page_title'], $v['menu_title'], $v['capability'], $menu_slug, array( &$this, 'display_page' ) );
|
| 378 |
$this->views[ $view_hook_name ] = $menu_slug;
|
| 379 |
}
|
| 380 |
else if ( isset( $v['parent_slug'] ) ) {
|
includes/vendors/wpc-settings-framework/js/options.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
/**
|
| 2 |
* @author Chris Baldelomar
|
| 3 |
-
* @website http://
|
| 4 |
*/
|
| 5 |
|
| 6 |
|
| 1 |
/**
|
| 2 |
* @author Chris Baldelomar
|
| 3 |
+
* @website http://angiemakes.com/
|
| 4 |
*/
|
| 5 |
|
| 6 |
|
includes/vendors/wpc-settings-framework/views/tabs.php
CHANGED
|
@@ -3,6 +3,13 @@ $active_tab = null;
|
|
| 3 |
$cookie_name = $this->plugin_prefix . 'wpcsf_active_tab';
|
| 4 |
|
| 5 |
// restore last tab visited
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
if ( empty( $active_tab ) && isset( $_COOKIE[ $cookie_name ] ) && ! empty( $_COOKIE[ $cookie_name ] ) ) {
|
| 7 |
$last_tab = $_COOKIE[ $cookie_name ];
|
| 8 |
if ( isset( $this->tabs[ $menu_slug ][ $last_tab ] ) ) {
|
| 3 |
$cookie_name = $this->plugin_prefix . 'wpcsf_active_tab';
|
| 4 |
|
| 5 |
// restore last tab visited
|
| 6 |
+
if ( isset( $_GET['wpcsf_active_tab'] ) && ! empty( $_GET['wpcsf_active_tab'] ) ) {
|
| 7 |
+
$tab_check = $_GET['wpcsf_active_tab'];
|
| 8 |
+
if ( isset( $this->tabs[ $menu_slug ][ $tab_check ] ) ) {
|
| 9 |
+
$active_tab = $tab_check;
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
if ( empty( $active_tab ) && isset( $_COOKIE[ $cookie_name ] ) && ! empty( $_COOKIE[ $cookie_name ] ) ) {
|
| 14 |
$last_tab = $_COOKIE[ $cookie_name ];
|
| 15 |
if ( isset( $this->tabs[ $menu_slug ][ $last_tab ] ) ) {
|
readme.txt
CHANGED
|
@@ -67,6 +67,12 @@ For more tutorials on our gallery plugin, go to our knowledge base.
|
|
| 67 |
|
| 68 |
== Changelog ==
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
= Version 1.56 =
|
| 71 |
|
| 72 |
* More elegant loading of masonry gallery images.
|
| 67 |
|
| 68 |
== Changelog ==
|
| 69 |
|
| 70 |
+
= Version 1.57 =
|
| 71 |
+
|
| 72 |
+
* Updated WPC Settings Framework to 1.0.5
|
| 73 |
+
* removed woocommerce product gallery option
|
| 74 |
+
* fixed bug when muliple galleries were not loading libraries in correct order.
|
| 75 |
+
|
| 76 |
= Version 1.56 =
|
| 77 |
|
| 78 |
* More elegant loading of masonry gallery images.
|
wc-gallery.php
CHANGED
|
@@ -5,19 +5,14 @@ Plugin URI: http://angiemakes.com/feminine-wordpress-blog-themes-women/
|
|
| 5 |
Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://angiemakes.com/
|
| 8 |
-
Version: 1.
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
-
|
| 13 |
-
return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
define( 'WC_GALLERY_VERSION', '1.56' );
|
| 17 |
define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
|
| 18 |
define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
|
| 19 |
define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 20 |
-
define( 'WC_GALLERY_USING_WOOCOMMERCE', wc_gallery_using_woocommerce() );
|
| 21 |
define( 'WC_GALLERY_CURRENT_VERSION', get_option( WC_GALLERY_PREFIX . 'current_version' ) );
|
| 22 |
define( 'WC_GALLERY_PLUGIN_BASENAME', plugin_basename( plugin_dir_path( realpath( __FILE__ ) ) . 'wc-gallery.php' ) );
|
| 23 |
|
| 5 |
Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://angiemakes.com/
|
| 8 |
+
Version: 1.57
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
+
define( 'WC_GALLERY_VERSION', '1.57' );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
|
| 14 |
define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
|
| 15 |
define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
|
|
|
| 16 |
define( 'WC_GALLERY_CURRENT_VERSION', get_option( WC_GALLERY_PREFIX . 'current_version' ) );
|
| 17 |
define( 'WC_GALLERY_PLUGIN_BASENAME', plugin_basename( plugin_dir_path( realpath( __FILE__ ) ) . 'wc-gallery.php' ) );
|
| 18 |
|
