Galleries by Angie Makes - Version 1.20

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Galleries by Angie Makes
Version 1.20
Comparing to
See all releases

Code changes from version 1.19 to 1.20

README.md CHANGED
@@ -36,7 +36,7 @@ Yes, I do accept donations. If you want to buy me a sandwich or something, you
36
  1. Uzip the `wc-gallery.zip` folder.
37
  2. Upload the `wc-gallery` folder to your `/wp-content/plugins` directory.
38
  3. In your WordPress dashboard, head over to the *Plugins* section.
39
- 4. Activate *WP Canvas Gallery*.
40
 
41
  ## Frequently Asked Questions ##
42
 
@@ -46,6 +46,14 @@ Insert a gallery through your dashboard. You will see extra dropdown settings wh
46
 
47
  ## Changelog ##
48
 
 
 
 
 
 
 
 
 
49
  ### Version 1.19
50
 
51
  * Updated image popup library
36
  1. Uzip the `wc-gallery.zip` folder.
37
  2. Upload the `wc-gallery` folder to your `/wp-content/plugins` directory.
38
  3. In your WordPress dashboard, head over to the *Plugins* section.
39
+ 4. Activate *WP Canvas - Gallery*.
40
 
41
  ## Frequently Asked Questions ##
42
 
46
 
47
  ## Changelog ##
48
 
49
+ ### Version 1.20
50
+
51
+ * Galleries now work inside WC Shortcodes accordion, tabs, and toggle shortcodes
52
+ * Added gallery support for infinite scroll
53
+ * caption only display on one line now.
54
+ * Gallery now defaults to show captions on image hover
55
+ * removed duplicate call to admin.js
56
+
57
  ### Version 1.19
58
 
59
  * Updated image popup library
includes/css/style.css CHANGED
@@ -95,6 +95,10 @@
95
  margin: 0;
96
  padding: 0;
97
  text-align: center;
 
 
 
 
98
  }
99
 
100
  .wc-gallery .gallery-caption p {
95
  margin: 0;
96
  padding: 0;
97
  text-align: center;
98
+ text-overflow: ellipsis;
99
+ width: 100%;
100
+ white-space: nowrap;
101
+ overflow: hidden;
102
  }
103
 
104
  .wc-gallery .gallery-caption p {
includes/functions.php CHANGED
@@ -80,7 +80,7 @@ function wc_gallery_shortcode($blank, $attr) {
80
  'order' => 'ASC',
81
  'orderby' => 'menu_order ID',
82
  'id' => $post ? $post->ID : 0,
83
- 'captions' => 'show',
84
  'captiontype' => 'p',
85
  'columns' => 3,
86
  'gutterwidth' => '5',
@@ -546,9 +546,9 @@ function wc_gallery_print_media_templates() {
546
 
547
  <?php
548
  $captions = array(
 
549
  'show' => __( 'Show Below Image', 'wc_gallery' ),
550
  'showon' => __( 'Show On Image', 'wc_gallery' ),
551
- 'onhover' => __( 'On Image Hover', 'wc_gallery' ),
552
  'hide' => __( 'Hide', 'wc_gallery' )
553
  );
554
  ?>
@@ -556,7 +556,7 @@ function wc_gallery_print_media_templates() {
556
  <span><?php _e( 'Captions', 'wc_gallery' ); ?></span>
557
  <select class="captions" name="captions" data-setting="captions">
558
  <?php foreach ( $captions as $key => $value ) : ?>
559
- <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, 'show' ); ?>><?php echo esc_html( $value ); ?></option>
560
  <?php endforeach; ?>
561
  </select>
562
  </label>
80
  'order' => 'ASC',
81
  'orderby' => 'menu_order ID',
82
  'id' => $post ? $post->ID : 0,
83
+ 'captions' => 'onhover',
84
  'captiontype' => 'p',
85
  'columns' => 3,
86
  'gutterwidth' => '5',
546
 
547
  <?php
548
  $captions = array(
549
+ 'onhover' => __( 'On Image Hover', 'wc_gallery' ),
550
  'show' => __( 'Show Below Image', 'wc_gallery' ),
551
  'showon' => __( 'Show On Image', 'wc_gallery' ),
 
552
  'hide' => __( 'Hide', 'wc_gallery' )
553
  );
554
  ?>
556
  <span><?php _e( 'Captions', 'wc_gallery' ); ?></span>
557
  <select class="captions" name="captions" data-setting="captions">
558
  <?php foreach ( $captions as $key => $value ) : ?>
559
+ <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, 'onhover' ); ?>><?php echo esc_html( $value ); ?></option>
560
  <?php endforeach; ?>
561
  </select>
562
  </label>
includes/js/admin.js CHANGED
@@ -19,11 +19,11 @@
19
  media.gallery.defaults.display = 'masonry'; // lil hack that lets media know there's a layout attribute.
20
  media.gallery.defaults.size = 'thumbnail'; // lil hack that lets media know there's a layout attribute.
21
  media.gallery.defaults.targetsize = 'large'; // lil hack that lets media know there's a layout attribute.
22
- media.gallery.defaults.captions = 'show'; // lil hack that lets media know there's a layout attribute.
23
  media.gallery.defaults.captiontype = 'p'; // lil hack that lets media know there's a layout attribute.
24
  media.gallery.defaults.customlink = false; // lil hack that lets media know there's a layout attribute.
25
  media.gallery.defaults.bottomspace = 'default'; // lil hack that lets media know there's a layout attribute.
26
- media.gallery.defaults.gutterwidth = '0.005'; // lil hack that lets media know there's a layout attribute.
27
  media.gallery.defaults.hidecontrols = false; // lil hack that lets media know there's a layout attribute.
28
  media.gallery.defaults.newtab = false; // lil hack that lets media know there's a layout attribute.
29
  media.gallery.defaults.class = ''; // lil hack that lets media know there's a layout attribute.
19
  media.gallery.defaults.display = 'masonry'; // lil hack that lets media know there's a layout attribute.
20
  media.gallery.defaults.size = 'thumbnail'; // lil hack that lets media know there's a layout attribute.
21
  media.gallery.defaults.targetsize = 'large'; // lil hack that lets media know there's a layout attribute.
22
+ media.gallery.defaults.captions = 'onhover'; // lil hack that lets media know there's a layout attribute.
23
  media.gallery.defaults.captiontype = 'p'; // lil hack that lets media know there's a layout attribute.
24
  media.gallery.defaults.customlink = false; // lil hack that lets media know there's a layout attribute.
25
  media.gallery.defaults.bottomspace = 'default'; // lil hack that lets media know there's a layout attribute.
26
+ media.gallery.defaults.gutterwidth = '5'; // lil hack that lets media know there's a layout attribute.
27
  media.gallery.defaults.hidecontrols = false; // lil hack that lets media know there's a layout attribute.
28
  media.gallery.defaults.newtab = false; // lil hack that lets media know there's a layout attribute.
29
  media.gallery.defaults.class = ''; // lil hack that lets media know there's a layout attribute.
includes/js/gallery.js CHANGED
@@ -64,10 +64,18 @@
64
  }
65
 
66
 
67
- $(document).ready(function(){
68
  $('.gallery-masonry').each( function() {
69
  var $container = $(this);
70
 
 
 
 
 
 
 
 
 
71
  imagesLoaded( $container, function() {
72
  runMasonry(0, $container);
73
 
@@ -82,7 +90,13 @@
82
 
83
  if( jQuery().magnificPopup) {
84
  $('.gallery-link-file').each( function() {
85
- $(this).magnificPopup({
 
 
 
 
 
 
86
  delegate: '.gallery-icon a',
87
  gallery: {
88
  enabled: true
@@ -94,78 +108,96 @@
94
  }
95
  }
96
  });
 
 
97
  });
98
  }
99
 
100
  if( jQuery().wcflexslider) {
101
- $(window).load(function() {
102
- $('.wcflexslider-container').each( function() {
103
- var $this = $(this);
104
- var $flex = $(this).children('.gallery.wcflexslider');
105
- var columns = parseInt( $flex.data('columns') );
106
- var columnsTablet = columns - 1;
107
- var columnsPhone = columns - 2;
108
- var gutterWidth = $flex.data('gutterWidth');
109
- var hideControls = $flex.data('hideControls');
110
- var showNav = hideControls ? false : true;
111
- var containerWidth = $this.width();
112
-
113
- gutterWidth = parseInt( gutterWidth );
114
-
115
- if ( $flex.hasClass('wcslider') ) {
116
- $flex.wcflexslider({
117
- prevText: "",
118
- nextText: "",
119
- smoothHeight: false,
120
- slideshow: false,
121
- animation:"fade"
122
- });
123
- }
124
- else if ( $flex.hasClass('wcslider2') ) {
125
- $flex.wcflexslider({
126
- prevText: "",
127
- nextText: "",
128
- smoothHeight: true,
129
- slideshow: false,
130
- animation:"slide"
131
- });
132
- }
133
- else if ( $flex.hasClass('wcsliderauto') ) {
134
- $flex.wcflexslider({
135
- prevText: "",
136
- nextText: "",
137
- smoothHeight: true,
138
- slideshow: true,
139
- animation:"slide"
140
- });
141
- }
142
- else if ( $flex.hasClass('wccarousel') ) {
143
- $flex.wcflexslider({
144
- prevText: "",
145
- nextText: "",
146
- smoothHeight: false,
147
- slideshow: false,
148
- animation: "slide",
149
- animationLoop: false,
150
- itemWidth: 270,
151
- itemMargin: gutterWidth
152
- });
153
- }
154
- else if ( $flex.hasClass('wcslider3bottomlinks') || $flex.hasClass('wcslider4bottomlinks') ) {
155
- $flex.wcflexslider({
156
- prevText: "",
157
- nextText: "",
158
- smoothHeight: false,
159
- slideshow: true,
160
- animation:"slide"
161
- });
162
- }
163
- });
 
 
 
 
 
 
 
 
164
  });
165
  }
166
  if( jQuery().owlCarousel) {
167
  $('.wcowlcarousel').each( function() {
168
  var $this = $(this);
 
 
 
 
 
 
 
 
169
  var $owl = $this.children('.owl-carousel');
170
  var columns = parseInt( $owl.data('columns') );
171
  var columnsTablet = columns - 1;
@@ -175,6 +207,8 @@
175
  var showNav = hideControls ? false : true;
176
  var containerWidth = $this.width();
177
 
 
 
178
  gutterWidth = parseInt( gutterWidth );
179
  if ( 1 > columnsTablet ) {
180
  columnsTablet = 1;
@@ -233,7 +267,19 @@
233
  });
234
  }
235
  });
236
-
237
  }
238
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  } )( jQuery );
64
  }
65
 
66
 
67
+ var initGallery = function() {
68
  $('.gallery-masonry').each( function() {
69
  var $container = $(this);
70
 
71
+ if ( $container.is(':hidden') ) {
72
+ return;
73
+ }
74
+
75
+ if ( $container.hasClass( 'masonry' ) ) {
76
+ return;
77
+ }
78
+
79
  imagesLoaded( $container, function() {
80
  runMasonry(0, $container);
81
 
90
 
91
  if( jQuery().magnificPopup) {
92
  $('.gallery-link-file').each( function() {
93
+ var $this = $(this);
94
+
95
+ if ( $this.hasClass( 'magnificpopup-is-active' ) ) {
96
+ return;
97
+ }
98
+
99
+ $this.magnificPopup({
100
  delegate: '.gallery-icon a',
101
  gallery: {
102
  enabled: true
108
  }
109
  }
110
  });
111
+
112
+ $this.addClass( 'magnificpopup-is-active' );
113
  });
114
  }
115
 
116
  if( jQuery().wcflexslider) {
117
+ $('.wcflexslider-container').each( function() {
118
+ var $this = $(this);
119
+ if ( $this.is(':hidden') ) {
120
+ return;
121
+ }
122
+
123
+ if ( $this.hasClass( 'wcflexslider-is-active' ) ) {
124
+ return;
125
+ }
126
+
127
+ var $flex = $(this).children('.gallery.wcflexslider');
128
+ var columns = parseInt( $flex.data('columns') );
129
+ var columnsTablet = columns - 1;
130
+ var columnsPhone = columns - 2;
131
+ var gutterWidth = $flex.data('gutterWidth');
132
+ var hideControls = $flex.data('hideControls');
133
+ var showNav = hideControls ? false : true;
134
+ var containerWidth = $this.width();
135
+
136
+ $this.addClass('wcflexslider-is-active');
137
+
138
+ gutterWidth = parseInt( gutterWidth );
139
+
140
+ if ( $flex.hasClass('wcslider') ) {
141
+ $flex.wcflexslider({
142
+ prevText: "",
143
+ nextText: "",
144
+ smoothHeight: false,
145
+ slideshow: false,
146
+ animation:"fade"
147
+ });
148
+ }
149
+ else if ( $flex.hasClass('wcslider2') ) {
150
+ $flex.wcflexslider({
151
+ prevText: "",
152
+ nextText: "",
153
+ smoothHeight: true,
154
+ slideshow: false,
155
+ animation:"slide"
156
+ });
157
+ }
158
+ else if ( $flex.hasClass('wcsliderauto') ) {
159
+ $flex.wcflexslider({
160
+ prevText: "",
161
+ nextText: "",
162
+ smoothHeight: true,
163
+ slideshow: true,
164
+ animation:"slide"
165
+ });
166
+ }
167
+ else if ( $flex.hasClass('wccarousel') ) {
168
+ $flex.wcflexslider({
169
+ prevText: "",
170
+ nextText: "",
171
+ smoothHeight: false,
172
+ slideshow: false,
173
+ animation: "slide",
174
+ animationLoop: false,
175
+ itemWidth: 270,
176
+ itemMargin: gutterWidth
177
+ });
178
+ }
179
+ else if ( $flex.hasClass('wcslider3bottomlinks') || $flex.hasClass('wcslider4bottomlinks') ) {
180
+ $flex.wcflexslider({
181
+ prevText: "",
182
+ nextText: "",
183
+ smoothHeight: false,
184
+ slideshow: true,
185
+ animation:"slide"
186
+ });
187
+ }
188
  });
189
  }
190
  if( jQuery().owlCarousel) {
191
  $('.wcowlcarousel').each( function() {
192
  var $this = $(this);
193
+ if ( $this.is(':hidden') ) {
194
+ return;
195
+ }
196
+
197
+ if ( $this.hasClass( 'wcowlcarousel-is-active' ) ) {
198
+ return;
199
+ }
200
+
201
  var $owl = $this.children('.owl-carousel');
202
  var columns = parseInt( $owl.data('columns') );
203
  var columnsTablet = columns - 1;
207
  var showNav = hideControls ? false : true;
208
  var containerWidth = $this.width();
209
 
210
+ $this.addClass('wcowlcarousel-is-active');
211
+
212
  gutterWidth = parseInt( gutterWidth );
213
  if ( 1 > columnsTablet ) {
214
  columnsTablet = 1;
267
  });
268
  }
269
  });
 
270
  }
271
+ };
272
+
273
+ $(document).ready( initGallery );
274
+
275
+ // Triggers re-layout on infinite scroll
276
+ $( document.body ).on( 'post-load', function () {
277
+ initGallery();
278
+ });
279
+
280
+ // Triggers re-layout on accordion, tabs, toggle
281
+ $( document.body ).on( 'wcs-toggled', function () {
282
+ initGallery();
283
+ });
284
+
285
  } )( jQuery );
includes/scripts.php CHANGED
@@ -58,6 +58,9 @@ function wc_gallery_enqueue_admin_scripts() {
58
  if ( 'post' == $screen->base ) {
59
  wp_register_script( 'wc-gallery-admin-js', plugin_dir_url( __FILE__ ) . 'js/admin.js', array ( 'jquery' ), WC_GALLERY_VERSION, true );
60
  wp_enqueue_script( 'wc-gallery-admin-js' );
 
 
 
61
  }
62
  }
63
  add_action('admin_enqueue_scripts', 'wc_gallery_enqueue_admin_scripts' );
58
  if ( 'post' == $screen->base ) {
59
  wp_register_script( 'wc-gallery-admin-js', plugin_dir_url( __FILE__ ) . 'js/admin.js', array ( 'jquery' ), WC_GALLERY_VERSION, true );
60
  wp_enqueue_script( 'wc-gallery-admin-js' );
61
+ wp_register_style( 'wc-gallery-admin', WC_GALLERY_PLUGIN_URL . 'includes/css/admin.css', array(), WC_GALLERY_VERSION, 'all' );
62
+ wp_enqueue_style( 'wc-gallery-admin' );
63
+
64
  }
65
  }
66
  add_action('admin_enqueue_scripts', 'wc_gallery_enqueue_admin_scripts' );
includes/settings.php CHANGED
@@ -1,13 +1,4 @@
1
  <?php
2
- function wc_gallery_options_enqueue_scripts() {
3
- wp_register_style( 'wc-gallery-options', WC_GALLERY_PLUGIN_URL . 'includes/css/admin.css', array(), WC_GALLERY_VERSION, 'all' );
4
- wp_enqueue_style( 'wc-gallery-options' );
5
-
6
- wp_register_script( 'wc-gallery-options-js', WC_GALLERY_PLUGIN_URL . 'includes/js/admin.js', array('jquery'), WC_GALLERY_VERSION, true );
7
- wp_enqueue_script( 'wc-gallery-options-js' );
8
- }
9
- add_action('admin_enqueue_scripts', 'wc_gallery_options_enqueue_scripts' );
10
-
11
  function wc_gallery_options_init() {
12
  global $wc_gallery_options;
13
 
1
  <?php
 
 
 
 
 
 
 
 
 
2
  function wc_gallery_options_init() {
3
  global $wc_gallery_options;
4
 
readme.txt CHANGED
@@ -46,6 +46,14 @@ Insert a gallery through your dashboard. You will see extra dropdown settings wh
46
 
47
  == Changelog ==
48
 
 
 
 
 
 
 
 
 
49
  ### Version 1.19
50
 
51
  * Updated image popup library
46
 
47
  == Changelog ==
48
 
49
+ ### Version 1.20
50
+
51
+ * Galleries now work inside WC Shortcodes accordion, tabs, and toggle shortcodes
52
+ * Added gallery support for infinite scroll
53
+ * caption only display on one line now.
54
+ * Gallery now defaults to show captions on image hover
55
+ * removed duplicate call to admin.js
56
+
57
  ### Version 1.19
58
 
59
  * Updated image popup library
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.19
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.19' );
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.20
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.20' );
17
  define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
18
  define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
19
  define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );