SiteOrigin Widgets Bundle - Version 1.31.0

Version Description

  • 05 March 2022 =
  • Post Carousel: Updates to allow for themes to be added.
  • Post Carousel: Fixed Responsive > Tablet > Landscape settings.
  • Post Carousel: Added support for the Default Thumbnail: External URL field.
  • Developer: Added preset field support for state emitters when reopening widgets.
  • Developer: Added siteorigin_widgets_accordion_scrollto_offset filter.
Download this release

Release Info

Developer SiteOrigin
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.31.0
Comparing to
See all releases

Code changes from version 1.30.1 to 1.31.0

base/inc/fields/js/presets-field.js CHANGED
@@ -11,6 +11,7 @@
11
  var $undoLink = $presetSelect.find( '+ .sowb-presets-field-undo' );
12
  $undoLink.hide();
13
 
 
14
  var addingDefault = false;
15
  var presets = $presetSelect.data( 'presets' );
16
  $presetSelect.on( 'change', function() {
@@ -18,9 +19,9 @@
18
  if ( selectedPreset && presets.hasOwnProperty( selectedPreset ) ) {
19
  var presetValues = presets[ selectedPreset ].values;
20
  var $formContainer = $presetSelect.closest( '.siteorigin-widget-form-main' );
21
-
22
  // If we're adding defaults, don't show undo.
23
- if ( ! addingDefault) {
24
  var previousValues = $presetSelect.data( 'previousValues' );
25
  if ( ! previousValues ) {
26
  var presetClone = JSON.parse( JSON.stringify( presetValues ) );
@@ -57,9 +58,9 @@
57
  $presetSelect.val( '' );
58
  } );
59
  }
 
60
  }
61
-
62
- sowbForms.setWidgetFormValues( $formContainer, presetValues, true );
63
  }
64
  } );
65
 
@@ -70,9 +71,10 @@
70
  if ( $presetSelect.val() == 'default' ) {
71
  addingDefault = true;
72
  $presetSelect.val( $presetSelect.data( 'default-preset' ) );
73
- $presetSelect.trigger( 'change' );
74
  }
75
  }
 
 
76
 
77
  $presetSelect.data( 'initialized', true );
78
  } );
11
  var $undoLink = $presetSelect.find( '+ .sowb-presets-field-undo' );
12
  $undoLink.hide();
13
 
14
+ var onLoadTrigger = false;
15
  var addingDefault = false;
16
  var presets = $presetSelect.data( 'presets' );
17
  $presetSelect.on( 'change', function() {
19
  if ( selectedPreset && presets.hasOwnProperty( selectedPreset ) ) {
20
  var presetValues = presets[ selectedPreset ].values;
21
  var $formContainer = $presetSelect.closest( '.siteorigin-widget-form-main' );
22
+
23
  // If we're adding defaults, don't show undo.
24
+ if ( ! addingDefault && ! onLoadTrigger) {
25
  var previousValues = $presetSelect.data( 'previousValues' );
26
  if ( ! previousValues ) {
27
  var presetClone = JSON.parse( JSON.stringify( presetValues ) );
58
  $presetSelect.val( '' );
59
  } );
60
  }
61
+ sowbForms.setWidgetFormValues( $formContainer, presetValues, true );
62
  }
63
+ onLoadTrigger = false;
 
64
  }
65
  } );
66
 
71
  if ( $presetSelect.val() == 'default' ) {
72
  addingDefault = true;
73
  $presetSelect.val( $presetSelect.data( 'default-preset' ) );
 
74
  }
75
  }
76
+ onLoadTrigger = true;
77
+ $presetSelect.trigger( 'change' );
78
 
79
  $presetSelect.data( 'initialized', true );
80
  } );
base/inc/fields/js/presets-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var a=t.find("+ .sowb-presets-field-undo");a.hide();var s=!1,r=t.data("presets");t.on("change",(function(){var e=t.val();if(e&&r.hasOwnProperty(e)){var i=r[e].values,o=t.closest(".siteorigin-widget-form-main");if(!s){var n=t.data("previousValues");if(!n){var l=JSON.parse(JSON.stringify(i)),u=sowbForms.getWidgetFormValues(o),d=0,f=function(e,i){if(++d>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var a=e[t],s=i[t];null!==a&&null!==s&&"object"==typeof a?f(a,s):i[t]=a}return i};n=f(u,l),t.data("previousValues",n)}a.not(":visible")&&(a.show(),a.on("click",(function(e){e.preventDefault(),a.hide(),sowbForms.setWidgetFormValues(o,n,!0),t.removeData("previousValues"),t.val("")})))}sowbForms.setWidgetFormValues(o,i,!0)}})),""!=t.data("default-preset")&&(e(this).find('select[class="siteorigin-widget-input"] option[value="default"]').remove(),"default"==t.val()&&(s=!0,t.val(t.data("default-preset")),t.trigger("change"))),t.data("initialized",!0)}}))}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var a=t.find("+ .sowb-presets-field-undo");a.hide();var s=!1,r=!1,o=t.data("presets");t.on("change",(function(){var e=t.val();if(e&&o.hasOwnProperty(e)){var i=o[e].values,n=t.closest(".siteorigin-widget-form-main");if(!r&&!s){var l=t.data("previousValues");if(!l){var u=JSON.parse(JSON.stringify(i)),d=sowbForms.getWidgetFormValues(n),f=0,v=function(e,i){if(++f>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var a=e[t],s=i[t];null!==a&&null!==s&&"object"==typeof a?v(a,s):i[t]=a}return i};l=v(d,u),t.data("previousValues",l)}a.not(":visible")&&(a.show(),a.on("click",(function(e){e.preventDefault(),a.hide(),sowbForms.setWidgetFormValues(n,l,!0),t.removeData("previousValues"),t.val("")}))),sowbForms.setWidgetFormValues(n,i,!0)}s=!1}})),""!=t.data("default-preset")&&(e(this).find('select[class="siteorigin-widget-input"] option[value="default"]').remove(),"default"==t.val()&&(r=!0,t.val(t.data("default-preset")))),s=!0,t.trigger("change"),t.data("initialized",!0)}}))}(jQuery);
base/inc/widgets/base-carousel.class.php CHANGED
@@ -35,6 +35,14 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
35
  )
36
  );
37
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  /**
@@ -78,7 +86,14 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
78
  'tablet_portrait' => true,
79
  'mobile' => true,
80
  ),
81
- 'navigation_label' => __( 'Display navigation arrows', 'so-widgets-bundle' ),
 
 
 
 
 
 
 
82
  )
83
  );
84
  }
@@ -136,11 +151,27 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
136
  );
137
  }
138
 
139
- if ( isset( $field['navigation'] ) ) {
140
  $section['fields']['navigation'] = array(
141
  'type' => 'checkbox',
142
  'label' => $carousel_settings['navigation_label'],
143
  'default' => $field['navigation'],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  );
145
  }
146
  }
@@ -160,6 +191,7 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
160
  'label' => __( 'Desktop', 'so-widgets-bundle' ),
161
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['desktop'],
162
  'navigation' => $carousel_settings['navigation']['desktop'],
 
163
  ),
164
  'tablet' => array(
165
  'label' => __( 'Tablet', 'so-widgets-bundle' ),
@@ -169,12 +201,14 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
169
  'breakpoint' => $carousel_settings['breakpoints']['tablet_landscape'],
170
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['tablet_landscape'],
171
  'navigation' => $carousel_settings['navigation']['tablet_landscape'],
 
172
  ),
173
  'portrait' => array(
174
  'label' => __( 'Portrait', 'so-widgets-bundle' ),
175
  'breakpoint' => $carousel_settings['breakpoints']['tablet_portrait'],
176
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['tablet_portrait'],
177
  'navigation' => $carousel_settings['navigation']['tablet_portrait'],
 
178
  ),
179
  ),
180
  ),
@@ -183,6 +217,7 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
183
  'breakpoint' => $carousel_settings['breakpoints']['mobile'],
184
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['mobile'],
185
  'navigation' => $carousel_settings['navigation']['mobile'],
 
186
  ),
187
  );
188
 
@@ -208,7 +243,8 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
208
  }
209
 
210
  function carousel_settings_form_fields() {
211
- return array(
 
212
  'type' => 'section',
213
  'label' => __( 'Settings', 'so-widgets-bundle' ),
214
  'hide' => true,
@@ -222,6 +258,26 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
222
  'dots' => array(
223
  'type' => 'checkbox',
224
  'label' => __( 'Navigation dots', 'so-widgets-bundle' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  ),
226
  'animation' => array(
227
  'type' => 'select',
@@ -268,6 +324,16 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
268
  ),
269
  ),
270
  );
 
 
 
 
 
 
 
 
 
 
271
  }
272
 
273
 
@@ -351,17 +417,24 @@ abstract class SiteOrigin_Widget_Base_Carousel extends SiteOrigin_Widget {
351
 
352
  function responsive_less_variables( $less_vars, $instance ) {
353
  $carousel_settings = $this->get_carousel_settings();
354
- // Breakpoint
 
355
  $less_vars['breakpoint_tablet_landscape'] = ( ! empty( $instance['responsive']['tablet_landscape']['breakpoint'] ) ? $instance['responsive']['tablet_landscape']['breakpoint'] : $carousel_settings['breakpoints']['tablet_landscape'] ) .'px';
356
  $less_vars['breakpoint_tablet_portrait'] = ( ! empty( $instance['responsive']['tablet_portrait']['breakpoint'] ) ? $instance['responsive']['tablet_portrait']['breakpoint'] : $carousel_settings['breakpoints']['tablet_portrait'] ) .'px';
357
  $less_vars['breakpoint_mobile'] = ( ! empty( $instance['responsive']['mobile']['breakpoint'] ) ? $instance['responsive']['mobile']['breakpoint'] : $carousel_settings['breakpoints']['mobile'] ) .'px';
358
 
359
- // Navigation
360
  $less_vars['navigation_desktop'] = isset( $instance['responsive']['desktop']['navigation'] ) ? ! empty( $instance['responsive']['desktop']['navigation'] ) : $carousel_settings['navigation']['desktop'];
361
  $less_vars['navigation_tablet_landscape'] = isset( $instance['responsive']['tablet']['landscape']['navigation'] ) ? ! empty( $instance['responsive']['tablet']['landscape']['navigation'] ) : $carousel_settings['navigation']['tablet_landscape'];
362
  $less_vars['navigation_tablet_portrait'] = isset( $instance['responsive']['tablet']['portrait']['navigation'] ) ? ! empty( $instance['responsive']['tablet']['portrait']['navigation'] ) : $carousel_settings['navigation']['tablet_portrait'];
363
  $less_vars['navigation_mobile'] = isset( $instance['responsive']['mobile']['navigation'] ) ? ! empty( $instance['responsive']['mobile']['navigation'] ) : $carousel_settings['navigation']['mobile'];
364
 
 
 
 
 
 
 
365
  return $less_vars;
366
  }
367
 
35
  )
36
  );
37
 
38
+ add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
39
+ }
40
+
41
+ /**
42
+ * Allow widgets and other plugins to register assets for this slider.
43
+ */
44
+ function register_assets() {
45
+ do_action( 'siteorigin_widgets_carousel_register_assets', $this );
46
  }
47
 
48
  /**
86
  'tablet_portrait' => true,
87
  'mobile' => true,
88
  ),
89
+ 'navigation_label' => __( 'Navigation arrows', 'so-widgets-bundle' ),
90
+ 'navigation_dots' => array(
91
+ 'desktop' => true,
92
+ 'tablet_landscape' => true,
93
+ 'tablet_portrait' => true,
94
+ 'mobile' => true,
95
+ ),
96
+ 'navigation_dots_label' => __( 'Navigation dots', 'so-widgets-bundle' ),
97
  )
98
  );
99
  }
151
  );
152
  }
153
 
154
+ if ( isset( $field['navigation'] ) && ! empty( $carousel_settings['navigation_label'] ) ) {
155
  $section['fields']['navigation'] = array(
156
  'type' => 'checkbox',
157
  'label' => $carousel_settings['navigation_label'],
158
  'default' => $field['navigation'],
159
+ 'state_handler' => array(
160
+ 'nav_arrows[show]' => array( 'show' ),
161
+ 'nav_arrows[hide]' => array( 'hide' ),
162
+ ),
163
+ );
164
+ }
165
+
166
+ if ( isset( $field['navigation_dots'] ) && ! empty( $carousel_settings['navigation_dots_label'] ) ) {
167
+ $section['fields']['navigation_dots'] = array(
168
+ 'type' => 'checkbox',
169
+ 'label' => $carousel_settings['navigation_dots_label'],
170
+ 'default' => $field['navigation'],
171
+ 'state_handler' => array(
172
+ 'nav_dots[show]' => array( 'show' ),
173
+ 'nav_dots[hide]' => array( 'hide' ),
174
+ ),
175
  );
176
  }
177
  }
191
  'label' => __( 'Desktop', 'so-widgets-bundle' ),
192
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['desktop'],
193
  'navigation' => $carousel_settings['navigation']['desktop'],
194
+ 'navigation_dots' => $carousel_settings['navigation_dots']['desktop'],
195
  ),
196
  'tablet' => array(
197
  'label' => __( 'Tablet', 'so-widgets-bundle' ),
201
  'breakpoint' => $carousel_settings['breakpoints']['tablet_landscape'],
202
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['tablet_landscape'],
203
  'navigation' => $carousel_settings['navigation']['tablet_landscape'],
204
+ 'navigation_dots' => $carousel_settings['navigation_dots']['tablet_landscape'],
205
  ),
206
  'portrait' => array(
207
  'label' => __( 'Portrait', 'so-widgets-bundle' ),
208
  'breakpoint' => $carousel_settings['breakpoints']['tablet_portrait'],
209
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['tablet_portrait'],
210
  'navigation' => $carousel_settings['navigation']['tablet_portrait'],
211
+ 'navigation_dots' => $carousel_settings['navigation_dots']['tablet_portrait'],
212
  ),
213
  ),
214
  ),
217
  'breakpoint' => $carousel_settings['breakpoints']['mobile'],
218
  'slides_to_scroll' => $carousel_settings['slides_to_scroll']['mobile'],
219
  'navigation' => $carousel_settings['navigation']['mobile'],
220
+ 'navigation_dots' => $carousel_settings['navigation_dots']['mobile'],
221
  ),
222
  );
223
 
243
  }
244
 
245
  function carousel_settings_form_fields() {
246
+ $carousel_settings = $this->get_carousel_settings();
247
+ $fields = array(
248
  'type' => 'section',
249
  'label' => __( 'Settings', 'so-widgets-bundle' ),
250
  'hide' => true,
258
  'dots' => array(
259
  'type' => 'checkbox',
260
  'label' => __( 'Navigation dots', 'so-widgets-bundle' ),
261
+ 'default' => true,
262
+ 'state_emitter' => array(
263
+ 'callback' => 'conditional',
264
+ 'args' => array(
265
+ 'nav_dots[show]: val',
266
+ 'nav_dots[hide]: ! val',
267
+ ),
268
+ )
269
+ ),
270
+ 'arrows' => array(
271
+ 'type' => 'checkbox',
272
+ 'label' => __( 'Navigation arrows', 'so-widgets-bundle' ),
273
+ 'default' => true,
274
+ 'state_emitter' => array(
275
+ 'callback' => 'conditional',
276
+ 'args' => array(
277
+ 'nav_arrows[show]: val',
278
+ 'nav_arrows[hide]: ! val',
279
+ ),
280
+ )
281
  ),
282
  'animation' => array(
283
  'type' => 'select',
324
  ),
325
  ),
326
  );
327
+
328
+ if ( ! isset( $carousel_settings['navigation'] ) || empty( $carousel_settings['navigation_label'] ) ) {
329
+ unset( $fields['fields']['arrows'] );
330
+ }
331
+
332
+ if ( ! isset( $carousel_settings['navigation_dots'] ) || empty( $carousel_settings['navigation_dots_label'] ) ) {
333
+ unset( $fields['fields']['dots'] );
334
+ }
335
+
336
+ return $fields;
337
  }
338
 
339
 
417
 
418
  function responsive_less_variables( $less_vars, $instance ) {
419
  $carousel_settings = $this->get_carousel_settings();
420
+
421
+ // Breakpoint.
422
  $less_vars['breakpoint_tablet_landscape'] = ( ! empty( $instance['responsive']['tablet_landscape']['breakpoint'] ) ? $instance['responsive']['tablet_landscape']['breakpoint'] : $carousel_settings['breakpoints']['tablet_landscape'] ) .'px';
423
  $less_vars['breakpoint_tablet_portrait'] = ( ! empty( $instance['responsive']['tablet_portrait']['breakpoint'] ) ? $instance['responsive']['tablet_portrait']['breakpoint'] : $carousel_settings['breakpoints']['tablet_portrait'] ) .'px';
424
  $less_vars['breakpoint_mobile'] = ( ! empty( $instance['responsive']['mobile']['breakpoint'] ) ? $instance['responsive']['mobile']['breakpoint'] : $carousel_settings['breakpoints']['mobile'] ) .'px';
425
 
426
+ // Navigation.
427
  $less_vars['navigation_desktop'] = isset( $instance['responsive']['desktop']['navigation'] ) ? ! empty( $instance['responsive']['desktop']['navigation'] ) : $carousel_settings['navigation']['desktop'];
428
  $less_vars['navigation_tablet_landscape'] = isset( $instance['responsive']['tablet']['landscape']['navigation'] ) ? ! empty( $instance['responsive']['tablet']['landscape']['navigation'] ) : $carousel_settings['navigation']['tablet_landscape'];
429
  $less_vars['navigation_tablet_portrait'] = isset( $instance['responsive']['tablet']['portrait']['navigation'] ) ? ! empty( $instance['responsive']['tablet']['portrait']['navigation'] ) : $carousel_settings['navigation']['tablet_portrait'];
430
  $less_vars['navigation_mobile'] = isset( $instance['responsive']['mobile']['navigation'] ) ? ! empty( $instance['responsive']['mobile']['navigation'] ) : $carousel_settings['navigation']['mobile'];
431
 
432
+ // Navigation dots.
433
+ $less_vars['navigation_dots_desktop'] = isset( $instance['responsive']['desktop']['navigation_dots'] ) ? ! empty( $instance['responsive']['desktop']['navigation_dots'] ) : $carousel_settings['navigation_dots']['desktop'];
434
+ $less_vars['navigation_dots_tablet_landscape'] = isset( $instance['responsive']['tablet']['landscape']['navigation_dots'] ) ? ! empty( $instance['responsive']['tablet']['landscape']['navigation_dots'] ) : $carousel_settings['navigation_dots']['tablet_landscape'];
435
+ $less_vars['navigation_dots_tablet_portrait'] = isset( $instance['responsive']['tablet']['portrait']['navigation_dots'] ) ? ! empty( $instance['responsive']['tablet']['portrait']['navigation_dots'] ) : $carousel_settings['navigation_dots']['tablet_portrait'];
436
+ $less_vars['navigation_dots_mobile'] = isset( $instance['responsive']['mobile']['navigation_dots'] ) ? ! empty( $instance['responsive']['mobile']['navigation_dots'] ) : $carousel_settings['navigation_dots']['mobile'];
437
+
438
  return $less_vars;
439
  }
440
 
base/inc/widgets/tpl/carousel.php CHANGED
@@ -4,7 +4,7 @@
4
  echo $args['before_title'] . esc_html( $settings['title'] ) . $args['after_title'];
5
  }
6
 
7
- if ( $settings['navigation'] == 'title' ) {
8
  ?>
9
  <div class="sow-carousel-navigation">
10
  <?php $this->render_navigation( 'both' ); ?>
@@ -14,19 +14,20 @@
14
 
15
  <div class="sow-carousel-container <?php echo ! empty( $container_classes ) ? esc_attr( $container_classes ) : ''; ?>">
16
  <?php
17
- if ( $settings['navigation'] == 'side' ) {
18
  $this->render_navigation( 'prev' );
19
  }
20
  ?>
21
  <div class="sow-carousel-wrapper"
22
- data-dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"
23
- <?php
24
- foreach ( $settings['attributes'] as $n => $v ) {
25
- if ( ! empty( $n ) ) {
26
- echo 'data-' . $n . '="' . esc_attr( $v ) . '" ';
27
- }
28
- }
29
- ?>
 
30
  >
31
  <div
32
  class="sow-carousel-items"
@@ -34,10 +35,19 @@
34
  >
35
  <?php include $settings['item_template']; ?>
36
  </div>
 
 
 
 
 
 
 
 
 
37
  </div>
38
 
39
  <?php
40
- if ( $settings['navigation'] == 'side' ) {
41
  $this->render_navigation( 'next' );
42
  }
43
  ?>
4
  echo $args['before_title'] . esc_html( $settings['title'] ) . $args['after_title'];
5
  }
6
 
7
+ if ( $settings['navigation'] == 'title' && $settings['navigation_arrows'] ) {
8
  ?>
9
  <div class="sow-carousel-navigation">
10
  <?php $this->render_navigation( 'both' ); ?>
14
 
15
  <div class="sow-carousel-container <?php echo ! empty( $container_classes ) ? esc_attr( $container_classes ) : ''; ?>">
16
  <?php
17
+ if ( $settings['navigation'] == 'side' && $settings['navigation_arrows'] ) {
18
  $this->render_navigation( 'prev' );
19
  }
20
  ?>
21
  <div class="sow-carousel-wrapper"
22
+ data-dir="<?php echo is_rtl() ? 'rtl' : 'ltr'; ?>"
23
+ style="opacity: 0;"
24
+ <?php
25
+ foreach ( $settings['attributes'] as $n => $v ) {
26
+ if ( ! empty( $n ) ) {
27
+ echo 'data-' . $n . '="' . esc_attr( $v ) . '" ';
28
+ }
29
+ }
30
+ ?>
31
  >
32
  <div
33
  class="sow-carousel-items"
35
  >
36
  <?php include $settings['item_template']; ?>
37
  </div>
38
+ <?php if ( $settings['navigation'] == 'container' ) : ?>
39
+ <div class="sow-carousel-nav">
40
+ <?php if ( $settings['navigation_arrows'] ) : ?>
41
+ <div class="sow-carousel-nav-arrows">
42
+ <?php $this->render_navigation( 'both' ); ?>
43
+ </div>
44
+ <?php endif; ?>
45
+ </div>
46
+ <?php endif; ?>
47
  </div>
48
 
49
  <?php
50
+ if ( $settings['navigation'] == 'side' && $settings['navigation_arrows'] ) {
51
  $this->render_navigation( 'next' );
52
  }
53
  ?>
base/siteorigin-widget.class.php CHANGED
@@ -1369,7 +1369,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1369
  *
1370
  * @return array $fields with any state_handler's applied.
1371
  */
1372
- protected function dynamic_preset_state_handler( $state_name, $preset_data, $fields ) {
1373
  // Build an array of all the adjusted fields by the preset data, and note which presets adjust them.
1374
  $adjusted_fields = array();
1375
  foreach ( $preset_data as $preset_id => $preset ) {
@@ -1386,7 +1386,8 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1386
  return $this->dynamic_preset_add_state_handler(
1387
  $state_name,
1388
  $adjusted_fields,
1389
- $fields
 
1390
  );
1391
  }
1392
 
@@ -1406,6 +1407,8 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1406
  $extracted_fields[ $field_key ] = $this->dynamic_preset_extract_fields( $field, $preset_id );
1407
  } else {
1408
  $extracted_fields[ $field_key ][] = $preset_id;
 
 
1409
  }
1410
  }
1411
 
@@ -1419,10 +1422,11 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1419
  * @param string $state_name
1420
  * @param array $preset_adjusted_fields
1421
  * @param array $fields The fields to apply state handlers too.
 
1422
  *
1423
  * @return array $fields with any state_handler's applied.
1424
  */
1425
- private function dynamic_preset_add_state_handler( $state_name, $adjusted_fields, $fields ) {
1426
  foreach ( $adjusted_fields as $field => $field_value ) {
1427
  // Skip field if it's not adjusted by of the presets, or if the field has a state_handler already.
1428
  if (
@@ -1432,6 +1436,8 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1432
  continue;
1433
  }
1434
 
 
 
1435
  // If this is a section field, we need to apply the state handlers for sub fields.
1436
  if ( $fields[ $field ]['type'] == 'section' ) {
1437
  $fields[ $field ]['fields'] = $this->dynamic_preset_add_state_handler(
@@ -1439,8 +1445,15 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1439
  $field_value,
1440
  $fields[ $field ]['fields']
1441
  );
 
 
 
 
1442
  } else {
1443
  $used_by = implode( ',', $field_value );
 
 
 
1444
  $fields[ $field ]['state_handler'] = array(
1445
  $state_name . '[' . $used_by . ']' => array( 'show' ),
1446
  '_else[' . $state_name . ']' => array( 'hide' ),
1369
  *
1370
  * @return array $fields with any state_handler's applied.
1371
  */
1372
+ public function dynamic_preset_state_handler( $state_name, $preset_data, $fields ) {
1373
  // Build an array of all the adjusted fields by the preset data, and note which presets adjust them.
1374
  $adjusted_fields = array();
1375
  foreach ( $preset_data as $preset_id => $preset ) {
1386
  return $this->dynamic_preset_add_state_handler(
1387
  $state_name,
1388
  $adjusted_fields,
1389
+ $fields,
1390
+ true
1391
  );
1392
  }
1393
 
1407
  $extracted_fields[ $field_key ] = $this->dynamic_preset_extract_fields( $field, $preset_id );
1408
  } else {
1409
  $extracted_fields[ $field_key ][] = $preset_id;
1410
+ // Add a key that contains all of the presets that adjust this section.
1411
+ $extracted_fields['key'][ $preset_id ] = $preset_id;
1412
  }
1413
  }
1414
 
1422
  * @param string $state_name
1423
  * @param array $preset_adjusted_fields
1424
  * @param array $fields The fields to apply state handlers too.
1425
+ * @param array false $exclude_section Whether to add state emitter to the current section.
1426
  *
1427
  * @return array $fields with any state_handler's applied.
1428
  */
1429
+ private function dynamic_preset_add_state_handler( $state_name, $adjusted_fields, $fields, $exclude_section = false ) {
1430
  foreach ( $adjusted_fields as $field => $field_value ) {
1431
  // Skip field if it's not adjusted by of the presets, or if the field has a state_handler already.
1432
  if (
1436
  continue;
1437
  }
1438
 
1439
+ $used_by = null;
1440
+
1441
  // If this is a section field, we need to apply the state handlers for sub fields.
1442
  if ( $fields[ $field ]['type'] == 'section' ) {
1443
  $fields[ $field ]['fields'] = $this->dynamic_preset_add_state_handler(
1445
  $field_value,
1446
  $fields[ $field ]['fields']
1447
  );
1448
+
1449
+ if ( isset( $field_value['key'] ) ) {
1450
+ $used_by = implode( ',', $field_value['key'] );
1451
+ }
1452
  } else {
1453
  $used_by = implode( ',', $field_value );
1454
+ }
1455
+
1456
+ if ( ! $exclude_section && ! empty( $used_by ) ) {
1457
  $fields[ $field ]['state_handler'] = array(
1458
  $state_name . '[' . $used_by . ']' => array( 'show' ),
1459
  '_else[' . $state_name . ']' => array( 'hide' ),
js/carousel.js CHANGED
@@ -18,6 +18,10 @@ jQuery( function ( $ ) {
18
  $item.slick( 'slickSetOption', 'slidesToScroll', slidesToScroll );
19
  };
20
 
 
 
 
 
21
  // The carousel widget
22
  $( '.sow-carousel-wrapper' ).each( function () {
23
  var $$ = $( this ),
@@ -28,6 +32,7 @@ jQuery( function ( $ ) {
28
  $items.not( '.slick-initialized' ).slick( {
29
  arrows: false,
30
  dots: carouselSettings.dots,
 
31
  rows: 0,
32
  rtl: $$.data( 'dir' ) == 'rtl',
33
  touchThreshold: 20,
@@ -86,10 +91,17 @@ jQuery( function ( $ ) {
86
  complete = numItems >= $$.data( 'item_count' ),
87
  numVisibleItems = Math.ceil( $items.outerWidth() / $items.find( '.sow-carousel-item' ).outerWidth( true ) ),
88
  slidesToScroll = $items.slick( 'slickGetOption', 'slidesToScroll' ),
89
- lastPosition = numItems - numVisibleItems;
 
90
 
91
  // Post Carousel has a loading indicator so we need to pad the lastPosition.
92
- if ( $$.data( 'widget' ) == 'post' ) {
 
 
 
 
 
 
93
  lastPosition++;
94
  }
95
 
@@ -101,6 +113,7 @@ jQuery( function ( $ ) {
101
  $items.slick( 'slickCurrentSlide' ) + slidesToScroll > lastPosition
102
  ) {
103
  $( sowb ).trigger( 'carousel_load_new_items', [ $$, $items, refocus ] );
 
104
  }
105
  }
106
 
@@ -111,7 +124,7 @@ jQuery( function ( $ ) {
111
  // The Slick Infinite setting has a positioning bug that can result in the first item
112
  // being hidden so we need to manually handle that
113
  // https://github.com/kenwheeler/slick/issues/3567
114
- if ( $( this ).hasClass( 'sow-carousel-next' ) ) {
115
  // Check if this is the last slide, and we need to loop
116
  if (
117
  complete &&
@@ -133,13 +146,21 @@ jQuery( function ( $ ) {
133
  $items.slick( 'slickPrev' );
134
  }
135
  }
 
 
 
 
 
 
136
  } );
137
 
138
- if ( carouselSettings.dots && $$.data( 'variable_width' ) ) {
139
  // Unbind base Slick Dot Navigation as we use a custom event to prevent blank spaces.
140
  $$.find( '.slick-dots li' ).off( 'click.slick' );
141
- $$.find( '.slick-dots li' ).on( 'click touchend', function() {
 
142
  var targetItem = $( this ).index(),
 
143
  numItems = $items.find( '.sow-carousel-item' ).length,
144
  numVisibleItems = Math.ceil( $items.outerWidth() / $items.find( '.sow-carousel-item' ).outerWidth( true ) ),
145
  lastPosition = numItems - numVisibleItems;
@@ -152,9 +173,34 @@ jQuery( function ( $ ) {
152
  $dots = $( this ).parent();
153
  $dots.find( '.slick-active' ).removeClass( 'slick-active' );
154
  $dots.children().eq( targetItem ).addClass( 'slick-active' );
 
155
  } else {
 
 
 
 
156
  $items.slick( 'slickGoTo', targetItem );
157
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  } );
159
  }
160
  } );
@@ -211,7 +257,7 @@ jQuery( function ( $ ) {
211
  .prop( 'tabindex', 0 );
212
  } );
213
 
214
- $( window ).on( 'resize load', function() {
215
  $( '.sow-carousel-wrapper' ).each( function() {
216
  var currentCarousel = $( this ),
217
  $items = currentCarousel.find( '.sow-carousel-items.slick-initialized' ),
@@ -227,17 +273,21 @@ jQuery( function ( $ ) {
227
  $items.slick( 'slickSetOption', 'touchMove', true );
228
  $items.slick( 'slickSetOption', 'draggable', true );
229
  }
 
230
  // Change Slick Settings on iPad Pro while Landscape
231
  var responsiveSettings = currentCarousel.data( 'responsive' );
232
  if ( window.matchMedia( '(min-width: ' + responsiveSettings.tablet_portrait_breakpoint + 'px) and (max-width: ' + responsiveSettings.tablet_landscape_breakpoint + 'px) and (orientation: landscape)' ).matches ) {
233
- $items.slick( 'slickSetOption', 'slidesToShow', responsiveSettings.tablet_landscape_slides );
234
- $items.slick( 'slickSetOption', 'slidesToScroll', responsiveSettings.tablet_landscape_slides );
235
  }
236
 
237
  } );
238
 
239
  $( '.sow-carousel-item:first-of-type' ).prop( 'tabindex', 0 );
240
- } );
 
 
 
241
  };
242
 
243
  sowb.setupCarousel();
18
  $item.slick( 'slickSetOption', 'slidesToScroll', slidesToScroll );
19
  };
20
 
21
+ $( '.sow-carousel-wrapper' ).on( 'init', function( e, slick ) {
22
+ $( this ).css( 'opacity', 1 );
23
+ } );
24
+
25
  // The carousel widget
26
  $( '.sow-carousel-wrapper' ).each( function () {
27
  var $$ = $( this ),
32
  $items.not( '.slick-initialized' ).slick( {
33
  arrows: false,
34
  dots: carouselSettings.dots,
35
+ appendDots: carouselSettings.appendDots ? $$.find( '.sow-carousel-nav' ) : $$,
36
  rows: 0,
37
  rtl: $$.data( 'dir' ) == 'rtl',
38
  touchThreshold: 20,
91
  complete = numItems >= $$.data( 'item_count' ),
92
  numVisibleItems = Math.ceil( $items.outerWidth() / $items.find( '.sow-carousel-item' ).outerWidth( true ) ),
93
  slidesToScroll = $items.slick( 'slickGetOption', 'slidesToScroll' ),
94
+ lastPosition = numItems - numVisibleItems,
95
+ loading = false;
96
 
97
  // Post Carousel has a loading indicator so we need to pad the lastPosition.
98
+ if (
99
+ $$.data( 'widget' ) == 'post' &&
100
+ (
101
+ $$.data( 'carousel_settings' ).theme != 'undefined' &&
102
+ complete
103
+ )
104
+ ) {
105
  lastPosition++;
106
  }
107
 
113
  $items.slick( 'slickCurrentSlide' ) + slidesToScroll > lastPosition
114
  ) {
115
  $( sowb ).trigger( 'carousel_load_new_items', [ $$, $items, refocus ] );
116
+ loading = true;
117
  }
118
  }
119
 
124
  // The Slick Infinite setting has a positioning bug that can result in the first item
125
  // being hidden so we need to manually handle that
126
  // https://github.com/kenwheeler/slick/issues/3567
127
+ if ( $( this ).hasClass( 'sow-carousel-next' ) && ! loading ) {
128
  // Check if this is the last slide, and we need to loop
129
  if (
130
  complete &&
146
  $items.slick( 'slickPrev' );
147
  }
148
  }
149
+
150
+ // Post Carousel update dot navigation active item.
151
+ if ( carouselSettings.dots && $$.data( 'widget' ) == 'post' ) {
152
+ $$.find( 'li.slick-active' ).removeClass( 'slick-active' );
153
+ $$.find( '.slick-dots li' ).eq( Math.ceil( $( '.sow-carousel-items' ).slick( 'slickCurrentSlide' ) / slidesToScroll ) ).addClass( 'slick-active' );
154
+ }
155
  } );
156
 
157
+ if ( carouselSettings.dots && ( $$.data( 'variable_width' ) || $$.data( 'carousel_settings' ).theme ) ) {
158
  // Unbind base Slick Dot Navigation as we use a custom event to prevent blank spaces.
159
  $$.find( '.slick-dots li' ).off( 'click.slick' );
160
+ var carouselDotNavigation = function() {
161
+ $items = $$.find( '.sow-carousel-items' );
162
  var targetItem = $( this ).index(),
163
+ slidesToScroll = $items.slick( 'slickGetOption', 'slidesToScroll' ),
164
  numItems = $items.find( '.sow-carousel-item' ).length,
165
  numVisibleItems = Math.ceil( $items.outerWidth() / $items.find( '.sow-carousel-item' ).outerWidth( true ) ),
166
  lastPosition = numItems - numVisibleItems;
173
  $dots = $( this ).parent();
174
  $dots.find( '.slick-active' ).removeClass( 'slick-active' );
175
  $dots.children().eq( targetItem ).addClass( 'slick-active' );
176
+
177
  } else {
178
+ if ( $$.data( 'widget' ) == 'post' ) {
179
+ // We need to account for an empty item.
180
+ targetItem = Math.ceil( $( this ).index() * slidesToScroll );
181
+ }
182
  $items.slick( 'slickGoTo', targetItem );
183
  }
184
+
185
+ // Is this a Post Carousel? If so, let's check if we need to load more posts.
186
+ if ( $$.data( 'widget' ) == 'post' ) {
187
+ var complete = numItems >= $$.data( 'item_count' );
188
+
189
+ // Check if all items are displayed
190
+ if ( ! complete ) {
191
+ if (
192
+ $items.slick( 'slickCurrentSlide' ) + numVisibleItems >= numItems - 1 ||
193
+ $items.slick( 'slickCurrentSlide' ) + slidesToScroll > lastPosition
194
+ ) {
195
+ $( sowb ).trigger( 'carousel_load_new_items', [ $$, $items, false ] );
196
+ }
197
+ }
198
+ }
199
+ };
200
+ $$.find( '.slick-dots li' ).on( 'click touchend', carouselDotNavigation );
201
+ // Setup Slick Dot Navigation again when new posts are added.
202
+ $( sowb ).on( 'carousel_posts_added', function() {
203
+ $$.find( '.slick-dots li' ).on( 'click touchend', carouselDotNavigation );
204
  } );
205
  }
206
  } );
257
  .prop( 'tabindex', 0 );
258
  } );
259
 
260
+ var carousel_resizer = function() {
261
  $( '.sow-carousel-wrapper' ).each( function() {
262
  var currentCarousel = $( this ),
263
  $items = currentCarousel.find( '.sow-carousel-items.slick-initialized' ),
273
  $items.slick( 'slickSetOption', 'touchMove', true );
274
  $items.slick( 'slickSetOption', 'draggable', true );
275
  }
276
+
277
  // Change Slick Settings on iPad Pro while Landscape
278
  var responsiveSettings = currentCarousel.data( 'responsive' );
279
  if ( window.matchMedia( '(min-width: ' + responsiveSettings.tablet_portrait_breakpoint + 'px) and (max-width: ' + responsiveSettings.tablet_landscape_breakpoint + 'px) and (orientation: landscape)' ).matches ) {
280
+ $items.slick( 'slickSetOption', 'slidesToShow', responsiveSettings.tablet_landscape_slides_to_show );
281
+ $items.slick( 'slickSetOption', 'slidesToScroll', responsiveSettings.tablet_landscape_slides_to_scroll );
282
  }
283
 
284
  } );
285
 
286
  $( '.sow-carousel-item:first-of-type' ).prop( 'tabindex', 0 );
287
+ };
288
+
289
+ carousel_resizer();
290
+ $( window ).on( 'resize load', carousel_resizer );
291
  };
292
 
293
  sowb.setupCarousel();
js/carousel.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(i){sowb.setupCarousel=function(){i.fn.setSlideTo=function(s){$item=i(this);var e=$item.slick("slickGetOption","slidesToShow"),o=$item.slick("slickGetOption","slidesToScroll");$item.slick("slickSetOption","slidesToShow",1),$item.slick("slickSetOption","slidesToScroll",1),$item.slick("slickGoTo",s),$item.slick("slickSetOption","slidesToShow",e),$item.slick("slickSetOption","slidesToScroll",o)},i(".sow-carousel-wrapper").each((function(){var s=i(this),e=s.find(".sow-carousel-items"),o=s.data("responsive"),t=s.data("carousel_settings");e.not(".slick-initialized").slick({arrows:!1,dots:t.dots,rows:0,rtl:"rtl"==s.data("dir"),touchThreshold:20,infinite:!s.data("ajax-url")&&s.data("carousel_settings").loop,variableWidth:s.data("variable_width"),accessibility:!1,cssEase:t.animation,speed:t.animation_speed,autoplay:t.autoplay,autoplaySpeed:t.autoplaySpeed,pauseOnHover:t.pauseOnHover,slidesToScroll:o.desktop_slides_to_scroll,slidesToShow:void 0===o.desktop_slides_to_show?o.desktop_slides_to_scroll:o.desktop_slides_to_show,responsive:[{breakpoint:o.tablet_portrait_breakpoint,settings:{slidesToScroll:o.tablet_portrait_slides_to_scroll,slidesToShow:void 0===o.tablet_portrait_slides_to_show?o.tablet_portrait_slides_to_scroll:o.tablet_portrait_slides_to_show}},{breakpoint:o.mobile_breakpoint,settings:{slidesToScroll:o.mobile_slides_to_scroll,slidesToShow:void 0===o.mobile_slides_to_show?o.mobile_slides_to_scroll:o.mobile_slides_to_show}}]}),t.item_overflow&&(e.css("width",""),e.css("opacity","")),e.on("swipe",(function(i,e,o){s.parent().parent().find(".sow-carousel-"+("left"==o?"next":"prev")).trigger("touchend")})),s.parent().parent().find(".sow-carousel-previous, .sow-carousel-next").on("click touchend",(function(e,o){e.preventDefault();var t=s.find(".sow-carousel-items"),l=t.find(".sow-carousel-item").length,a=l>=s.data("item_count"),c=Math.ceil(t.outerWidth()/t.find(".sow-carousel-item").outerWidth(!0)),r=t.slick("slickGetOption","slidesToScroll"),n=l-c;"post"==s.data("widget")&&n++,a||(t.slick("slickCurrentSlide")+c>=l-1||t.slick("slickCurrentSlide")+r>n)&&i(sowb).trigger("carousel_load_new_items",[s,t,o]),i(this).hasClass("sow-carousel-next")?a&&t.slick("slickCurrentSlide")>=n?s.data("carousel_settings").loop&&t.slick("slickGoTo",0):t.slick("slickCurrentSlide")+r>n?t.setSlideTo(n):t.slick("slickNext"):i(this).hasClass("sow-carousel-previous")&&(s.data("carousel_settings").loop&&0==t.slick("slickCurrentSlide")?t.slick("slickGoTo",n):t.slick("slickPrev"))})),t.dots&&s.data("variable_width")&&(s.find(".slick-dots li").off("click.slick"),s.find(".slick-dots li").on("click touchend",(function(){var s=i(this).index(),o=e.find(".sow-carousel-item").length,t=Math.ceil(e.outerWidth()/e.find(".sow-carousel-item").outerWidth(!0)),l=o-t;s+t>=o?(e.slick("slickGoTo",l),$dots=i(this).parent(),$dots.find(".slick-active").removeClass("slick-active"),$dots.children().eq(s).addClass("slick-active")):e.slick("slickGoTo",s)})))})),i(sowb).trigger("carousel_setup"),i(document).on("keydown",".sow-carousel-navigation a",(function(s){13!=s.keyCode&&32!=s.keyCode||(s.preventDefault(),i(this).trigger("click"))})),i(document).on("keyup",".sow-carousel-item",(function(s){if(13==s.keyCode&&i(this).find("h3 a")[0].click(),37==s.keyCode||39==s.keyCode){var e=i(this).parents(".sow-carousel-wrapper"),o=e.find(".sow-carousel-items"),t=o.find(".sow-carousel-item").length,l=i(this).data("slick-index"),a=t-(t===e.data("item_count")?0:1);if(37==s.keyCode)--l<0&&(l=a);else if(39==s.keyCode&&++l>=a){if(e.data("fetching"))return;e.parent().find(".sow-carousel-next").trigger("click",!0)}o.slick("slickGoTo",l,!0),e.find(".sow-carousel-item").prop("tabindex",-1),e.find('.sow-carousel-item[data-slick-index="'+l+'"]').trigger("focus").prop("tabindex",0)}})),i(window).on("resize load",(function(){i(".sow-carousel-wrapper").each((function(){var s=i(this),e=s.find(".sow-carousel-items.slick-initialized"),o=Math.ceil(e.outerWidth()/e.find(".sow-carousel-item").outerWidth(!0)),t=s.parent().parent().find(".sow-carousel-navigation");o>=s.data("item_count")?(t.hide(),e.slick("slickSetOption","touchMove",!1),e.slick("slickSetOption","draggable",!1)):t.not(":visible")&&(t.show(),e.slick("slickSetOption","touchMove",!0),e.slick("slickSetOption","draggable",!0));var l=s.data("responsive");window.matchMedia("(min-width: "+l.tablet_portrait_breakpoint+"px) and (max-width: "+l.tablet_landscape_breakpoint+"px) and (orientation: landscape)").matches&&(e.slick("slickSetOption","slidesToShow",l.tablet_landscape_slides),e.slick("slickSetOption","slidesToScroll",l.tablet_landscape_slides))})),i(".sow-carousel-item:first-of-type").prop("tabindex",0)}))},sowb.setupCarousel(),i(sowb).on("setup_widgets",sowb.setupCarousel)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(s){sowb.setupCarousel=function(){s.fn.setSlideTo=function(i){$item=s(this);var e=$item.slick("slickGetOption","slidesToShow"),t=$item.slick("slickGetOption","slidesToScroll");$item.slick("slickSetOption","slidesToShow",1),$item.slick("slickSetOption","slidesToScroll",1),$item.slick("slickGoTo",i),$item.slick("slickSetOption","slidesToShow",e),$item.slick("slickSetOption","slidesToScroll",t)},s(".sow-carousel-wrapper").on("init",(function(i,e){s(this).css("opacity",1)})),s(".sow-carousel-wrapper").each((function(){var i=s(this),e=i.find(".sow-carousel-items"),t=i.data("responsive"),o=i.data("carousel_settings");if(e.not(".slick-initialized").slick({arrows:!1,dots:o.dots,appendDots:o.appendDots?i.find(".sow-carousel-nav"):i,rows:0,rtl:"rtl"==i.data("dir"),touchThreshold:20,infinite:!i.data("ajax-url")&&i.data("carousel_settings").loop,variableWidth:i.data("variable_width"),accessibility:!1,cssEase:o.animation,speed:o.animation_speed,autoplay:o.autoplay,autoplaySpeed:o.autoplaySpeed,pauseOnHover:o.pauseOnHover,slidesToScroll:t.desktop_slides_to_scroll,slidesToShow:void 0===t.desktop_slides_to_show?t.desktop_slides_to_scroll:t.desktop_slides_to_show,responsive:[{breakpoint:t.tablet_portrait_breakpoint,settings:{slidesToScroll:t.tablet_portrait_slides_to_scroll,slidesToShow:void 0===t.tablet_portrait_slides_to_show?t.tablet_portrait_slides_to_scroll:t.tablet_portrait_slides_to_show}},{breakpoint:t.mobile_breakpoint,settings:{slidesToScroll:t.mobile_slides_to_scroll,slidesToShow:void 0===t.mobile_slides_to_show?t.mobile_slides_to_scroll:t.mobile_slides_to_show}}]}),o.item_overflow&&(e.css("width",""),e.css("opacity","")),e.on("swipe",(function(s,e,t){i.parent().parent().find(".sow-carousel-"+("left"==t?"next":"prev")).trigger("touchend")})),i.parent().parent().find(".sow-carousel-previous, .sow-carousel-next").on("click touchend",(function(e,t){e.preventDefault();var l=i.find(".sow-carousel-items"),a=l.find(".sow-carousel-item").length,c=a>=i.data("item_count"),d=Math.ceil(l.outerWidth()/l.find(".sow-carousel-item").outerWidth(!0)),n=l.slick("slickGetOption","slidesToScroll"),r=a-d,u=!1;"post"==i.data("widget")&&"undefined"!=i.data("carousel_settings").theme&&c&&r++,c||(l.slick("slickCurrentSlide")+d>=a-1||l.slick("slickCurrentSlide")+n>r)&&(s(sowb).trigger("carousel_load_new_items",[i,l,t]),u=!0),s(this).hasClass("sow-carousel-next")&&!u?c&&l.slick("slickCurrentSlide")>=r?i.data("carousel_settings").loop&&l.slick("slickGoTo",0):l.slick("slickCurrentSlide")+n>r?l.setSlideTo(r):l.slick("slickNext"):s(this).hasClass("sow-carousel-previous")&&(i.data("carousel_settings").loop&&0==l.slick("slickCurrentSlide")?l.slick("slickGoTo",r):l.slick("slickPrev")),o.dots&&"post"==i.data("widget")&&(i.find("li.slick-active").removeClass("slick-active"),i.find(".slick-dots li").eq(Math.ceil(s(".sow-carousel-items").slick("slickCurrentSlide")/n)).addClass("slick-active"))})),o.dots&&(i.data("variable_width")||i.data("carousel_settings").theme)){i.find(".slick-dots li").off("click.slick");var l=function(){e=i.find(".sow-carousel-items");var t=s(this).index(),o=e.slick("slickGetOption","slidesToScroll"),l=e.find(".sow-carousel-item").length,a=Math.ceil(e.outerWidth()/e.find(".sow-carousel-item").outerWidth(!0)),c=l-a;(t+a>=l?(e.slick("slickGoTo",c),$dots=s(this).parent(),$dots.find(".slick-active").removeClass("slick-active"),$dots.children().eq(t).addClass("slick-active")):("post"==i.data("widget")&&(t=Math.ceil(s(this).index()*o)),e.slick("slickGoTo",t)),"post"==i.data("widget"))&&(l>=i.data("item_count")||(e.slick("slickCurrentSlide")+a>=l-1||e.slick("slickCurrentSlide")+o>c)&&s(sowb).trigger("carousel_load_new_items",[i,e,!1]))};i.find(".slick-dots li").on("click touchend",l),s(sowb).on("carousel_posts_added",(function(){i.find(".slick-dots li").on("click touchend",l)}))}})),s(sowb).trigger("carousel_setup"),s(document).on("keydown",".sow-carousel-navigation a",(function(i){13!=i.keyCode&&32!=i.keyCode||(i.preventDefault(),s(this).trigger("click"))})),s(document).on("keyup",".sow-carousel-item",(function(i){if(13==i.keyCode&&s(this).find("h3 a")[0].click(),37==i.keyCode||39==i.keyCode){var e=s(this).parents(".sow-carousel-wrapper"),t=e.find(".sow-carousel-items"),o=t.find(".sow-carousel-item").length,l=s(this).data("slick-index"),a=o-(o===e.data("item_count")?0:1);if(37==i.keyCode)--l<0&&(l=a);else if(39==i.keyCode&&++l>=a){if(e.data("fetching"))return;e.parent().find(".sow-carousel-next").trigger("click",!0)}t.slick("slickGoTo",l,!0),e.find(".sow-carousel-item").prop("tabindex",-1),e.find('.sow-carousel-item[data-slick-index="'+l+'"]').trigger("focus").prop("tabindex",0)}}));var i=function(){s(".sow-carousel-wrapper").each((function(){var i=s(this),e=i.find(".sow-carousel-items.slick-initialized"),t=Math.ceil(e.outerWidth()/e.find(".sow-carousel-item").outerWidth(!0)),o=i.parent().parent().find(".sow-carousel-navigation");t>=i.data("item_count")?(o.hide(),e.slick("slickSetOption","touchMove",!1),e.slick("slickSetOption","draggable",!1)):o.not(":visible")&&(o.show(),e.slick("slickSetOption","touchMove",!0),e.slick("slickSetOption","draggable",!0));var l=i.data("responsive");window.matchMedia("(min-width: "+l.tablet_portrait_breakpoint+"px) and (max-width: "+l.tablet_landscape_breakpoint+"px) and (orientation: landscape)").matches&&(e.slick("slickSetOption","slidesToShow",l.tablet_landscape_slides_to_show),e.slick("slickSetOption","slidesToScroll",l.tablet_landscape_slides_to_scroll))})),s(".sow-carousel-item:first-of-type").prop("tabindex",0)};i(),s(window).on("resize load",i)},sowb.setupCarousel(),s(sowb).on("setup_widgets",sowb.setupCarousel)})),window.sowb=sowb;
lang/so-widgets-bundle.pot CHANGED
@@ -180,7 +180,7 @@ msgstr ""
180
  msgid "Deactivate"
181
  msgstr ""
182
 
183
- #: admin/tpl/admin.php:90, widgets/contact/contact.php:59, widgets/google-map/google-map.php:60, widgets/testimonial/testimonial.php:101, base/inc/widgets/base-carousel.class.php:213
184
  msgid "Settings"
185
  msgstr ""
186
 
@@ -296,87 +296,87 @@ msgstr ""
296
  msgid "When opening the panel, scroll the user to the top of the panel."
297
  msgstr ""
298
 
299
- #: widgets/accordion/accordion.php:71, widgets/accordion/accordion.php:84, widgets/anything-carousel/anything-carousel.php:52, widgets/anything-carousel/anything-carousel.php:68, widgets/contact/contact.php:48, widgets/cta/cta.php:64, widgets/editor/editor.php:35, widgets/features/features.php:140, widgets/icon/icon.php:68, widgets/post-carousel/post-carousel.php:230, widgets/price-table/price-table.php:42, widgets/price-table/price-table.php:61, widgets/simple-masonry/simple-masonry.php:44, widgets/simple-masonry/simple-masonry.php:85, widgets/social-media-buttons/social-media-buttons.php:54, widgets/tabs/tabs.php:71, widgets/tabs/tabs.php:84, widgets/taxonomy/taxonomy.php:34, widgets/testimonial/testimonial.php:41, widgets/video/video.php:33, base/inc/fields/posts.class.php:108
300
  msgid "Title"
301
  msgstr ""
302
 
303
- #: widgets/accordion/accordion.php:75, widgets/accordion/accordion.php:153, widgets/tabs/tabs.php:169
304
  msgid "Panels"
305
  msgstr ""
306
 
307
- #: widgets/accordion/accordion.php:88, widgets/anything-carousel/anything-carousel.php:72, widgets/hero/hero.php:73, widgets/layout-slider/layout-slider.php:67, widgets/tabs/tabs.php:88
308
  msgid "Content"
309
  msgstr ""
310
 
311
- #: widgets/accordion/accordion.php:94, widgets/editor/editor.php:45
312
  msgid "Automatically add paragraphs"
313
  msgstr ""
314
 
315
- #: widgets/accordion/accordion.php:98
316
  msgid "Initial state"
317
  msgstr ""
318
 
319
- #: widgets/accordion/accordion.php:99
320
  msgid "Whether this panel should be open or closed when the page first loads."
321
  msgstr ""
322
 
323
- #: widgets/accordion/accordion.php:101
324
  msgid "Open"
325
  msgstr ""
326
 
327
- #: widgets/accordion/accordion.php:102
328
  msgid "Closed"
329
  msgstr ""
330
 
331
- #: widgets/accordion/accordion.php:110, widgets/contact/contact.php:336, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:100, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:277
332
  msgid "Design"
333
  msgstr ""
334
 
335
- #: widgets/accordion/accordion.php:115
336
  msgid "Headings"
337
  msgstr ""
338
 
339
- #: widgets/accordion/accordion.php:120, widgets/accordion/accordion.php:158, widgets/contact/contact.php:346, widgets/contact/contact.php:584, widgets/cta/cta.php:78, widgets/hero/hero.php:133, widgets/layout-slider/layout-slider.php:101, widgets/slider/slider.php:87, widgets/social-media-buttons/social-media-buttons.php:86, widgets/tabs/tabs.php:110, widgets/tabs/tabs.php:130, widgets/tabs/tabs.php:174
340
  msgid "Background color"
341
  msgstr ""
342
 
343
- #: widgets/accordion/accordion.php:125, widgets/social-media-buttons/social-media-buttons.php:98, widgets/tabs/tabs.php:134
344
  msgid "Background hover color"
345
  msgstr ""
346
 
347
- #: widgets/accordion/accordion.php:130, widgets/cta/cta.php:88, widgets/tabs/tabs.php:139
348
  msgid "Title color"
349
  msgstr ""
350
 
351
- #: widgets/accordion/accordion.php:135, widgets/tabs/tabs.php:144
352
  msgid "Title hover color"
353
  msgstr ""
354
 
355
- #: widgets/accordion/accordion.php:139, widgets/accordion/accordion.php:167, widgets/contact/contact.php:356, widgets/contact/contact.php:478, widgets/contact/contact.php:594, widgets/cta/cta.php:83, widgets/tabs/tabs.php:115, widgets/tabs/tabs.php:149, widgets/tabs/tabs.php:183
356
  msgid "Border color"
357
  msgstr ""
358
 
359
- #: widgets/accordion/accordion.php:143, widgets/tabs/tabs.php:154
360
  msgid "Border hover color"
361
  msgstr ""
362
 
363
- #: widgets/accordion/accordion.php:147, widgets/accordion/accordion.php:171, widgets/contact/contact.php:361, widgets/contact/contact.php:483, widgets/contact/contact.php:610, widgets/tabs/tabs.php:119, widgets/tabs/tabs.php:159, widgets/tabs/tabs.php:187
364
  msgid "Border width"
365
  msgstr ""
366
 
367
- #: widgets/accordion/accordion.php:163, widgets/tabs/tabs.php:179
368
  msgid "Font color"
369
  msgstr ""
370
 
371
- #: widgets/accordion/accordion.php:175, widgets/anything-carousel/anything-carousel.php:83
372
  msgid "Bottom margin"
373
  msgstr ""
374
 
375
- #: widgets/accordion/accordion.php:268
376
  msgid "Get more customization options and the ability to use widgets and layouts as your accordion content with %sSiteOrigin Premium%s"
377
  msgstr ""
378
 
379
- #: widgets/accordion/accordion.php:273
380
  msgid "Use Google Fonts right inside the Accordion Widget with %sSiteOrigin Premium%s"
381
  msgstr ""
382
 
@@ -396,15 +396,15 @@ msgstr ""
396
  msgid "Item"
397
  msgstr ""
398
 
399
- #: widgets/anything-carousel/anything-carousel.php:95, widgets/button/button.php:203, widgets/contact/contact.php:390, widgets/contact/contact.php:440, widgets/features/features.php:145, widgets/features/features.php:166, widgets/features/features.php:187, widgets/headline/headline.php:88, widgets/headline/headline.php:169, base/inc/widgets/base-carousel.class.php:301
400
  msgid "Font"
401
  msgstr ""
402
 
403
- #: widgets/anything-carousel/anything-carousel.php:99, widgets/button/button.php:209, widgets/contact/contact.php:395, widgets/contact/contact.php:445, widgets/contact/contact.php:627, base/inc/widgets/base-carousel.class.php:305
404
  msgid "Font size"
405
  msgstr ""
406
 
407
- #: widgets/anything-carousel/anything-carousel.php:103, widgets/contact/contact.php:400, widgets/contact/contact.php:524, widgets/contact/contact.php:693, widgets/features/features.php:154, widgets/features/features.php:175, widgets/features/features.php:196, widgets/google-map/google-map.php:368, widgets/headline/headline.php:80, widgets/headline/headline.php:161, widgets/headline/headline.php:231, widgets/icon/icon.php:36, widgets/taxonomy/taxonomy.php:56, base/inc/widgets/base-carousel.class.php:309
408
  msgid "Color"
409
  msgstr ""
410
 
@@ -428,7 +428,7 @@ msgstr ""
428
  msgid "Left"
429
  msgstr ""
430
 
431
- #: widgets/anything-carousel/anything-carousel.php:133, widgets/post-carousel/post-carousel.php:169
432
  msgid "Navigation"
433
  msgstr ""
434
 
@@ -456,7 +456,7 @@ msgstr ""
456
  msgid "Dots selected and hover color"
457
  msgstr ""
458
 
459
- #: widgets/anything-carousel/anything-carousel.php:264
460
  msgid "Add widgets and layouts to your carousel items with %sSiteOrigin Premium%s."
461
  msgstr ""
462
 
@@ -1313,27 +1313,27 @@ msgstr ""
1313
  msgid "Title text HTML tag"
1314
  msgstr ""
1315
 
1316
- #: widgets/features/features.php:233, widgets/headline/headline.php:69, widgets/headline/headline.php:150, base/inc/widgets/base-carousel.class.php:290
1317
  msgid "H1"
1318
  msgstr ""
1319
 
1320
- #: widgets/features/features.php:234, widgets/headline/headline.php:70, widgets/headline/headline.php:151, base/inc/widgets/base-carousel.class.php:291
1321
  msgid "H2"
1322
  msgstr ""
1323
 
1324
- #: widgets/features/features.php:235, widgets/headline/headline.php:71, widgets/headline/headline.php:152, base/inc/widgets/base-carousel.class.php:292
1325
  msgid "H3"
1326
  msgstr ""
1327
 
1328
- #: widgets/features/features.php:236, widgets/headline/headline.php:72, widgets/headline/headline.php:153, base/inc/widgets/base-carousel.class.php:293
1329
  msgid "H4"
1330
  msgstr ""
1331
 
1332
- #: widgets/features/features.php:237, widgets/headline/headline.php:73, widgets/headline/headline.php:154, base/inc/widgets/base-carousel.class.php:294
1333
  msgid "H5"
1334
  msgstr ""
1335
 
1336
- #: widgets/features/features.php:238, widgets/headline/headline.php:74, widgets/headline/headline.php:155, base/inc/widgets/base-carousel.class.php:295
1337
  msgid "H6"
1338
  msgstr ""
1339
 
@@ -1852,11 +1852,11 @@ msgstr ""
1852
  msgid "Headline"
1853
  msgstr ""
1854
 
1855
- #: widgets/headline/headline.php:66, widgets/headline/headline.php:147, base/inc/widgets/base-carousel.class.php:287
1856
  msgid "HTML Tag"
1857
  msgstr ""
1858
 
1859
- #: widgets/headline/headline.php:75, widgets/headline/headline.php:156, base/inc/widgets/base-carousel.class.php:296
1860
  msgid "Paragraph"
1861
  msgstr ""
1862
 
@@ -1988,7 +1988,7 @@ msgstr ""
1988
  msgid "Layout"
1989
  msgstr ""
1990
 
1991
- #: widgets/hero/hero.php:183, widgets/layout-slider/layout-slider.php:151, base/inc/widgets/base-carousel.class.php:160
1992
  msgid "Desktop"
1993
  msgstr ""
1994
 
@@ -2012,7 +2012,7 @@ msgstr ""
2012
  msgid "Maximum container width"
2013
  msgstr ""
2014
 
2015
- #: widgets/hero/hero.php:219, widgets/layout-slider/layout-slider.php:187, base/inc/widgets/base-carousel.class.php:182
2016
  msgid "Mobile"
2017
  msgstr ""
2018
 
@@ -2272,87 +2272,83 @@ msgstr ""
2272
  msgid "SiteOrigin Post Carousel"
2273
  msgstr ""
2274
 
2275
- #: widgets/post-carousel/post-carousel.php:174
2276
  msgid "Navigation arrow color"
2277
  msgstr ""
2278
 
2279
- #: widgets/post-carousel/post-carousel.php:179
2280
  msgid "Navigation arrow hover color"
2281
  msgstr ""
2282
 
2283
- #: widgets/post-carousel/post-carousel.php:183
2284
  msgid "Navigation background"
2285
  msgstr ""
2286
 
2287
- #: widgets/post-carousel/post-carousel.php:188
2288
  msgid "Navigation hover background"
2289
  msgstr ""
2290
 
2291
- #: widgets/post-carousel/post-carousel.php:197
2292
  msgid "Post title"
2293
  msgstr ""
2294
 
2295
- #: widgets/post-carousel/post-carousel.php:205
2296
  msgid "Post thumbnail"
2297
  msgstr ""
2298
 
2299
- #: widgets/post-carousel/post-carousel.php:210
2300
  msgid "Thumbnail overlay hover color"
2301
  msgstr ""
2302
 
2303
- #: widgets/post-carousel/post-carousel.php:215
2304
  msgid "Thumbnail overlay hover opacity"
2305
  msgstr ""
2306
 
2307
- #: widgets/post-carousel/post-carousel.php:236
 
 
 
 
2308
  msgid "Default Thumbnail"
2309
  msgstr ""
2310
 
2311
- #: widgets/post-carousel/post-carousel.php:237
2312
  msgid "Choose Thumbnail"
2313
  msgstr ""
2314
 
2315
- #: widgets/post-carousel/post-carousel.php:238
2316
  msgid "Set Thumbnail"
2317
  msgstr ""
2318
 
2319
- #: widgets/post-carousel/post-carousel.php:244
2320
  msgid "Featured Image size"
2321
  msgstr ""
2322
 
2323
- #: widgets/post-carousel/post-carousel.php:250
2324
  msgid "Link target"
2325
  msgstr ""
2326
 
2327
- #: widgets/post-carousel/post-carousel.php:251
2328
  msgid "Choose where to open each carousel item."
2329
  msgstr ""
2330
 
2331
- #: widgets/post-carousel/post-carousel.php:253
2332
  msgid "Same window "
2333
  msgstr ""
2334
 
2335
- #: widgets/post-carousel/post-carousel.php:254
2336
  msgid "New window "
2337
  msgstr ""
2338
 
2339
- #: widgets/post-carousel/post-carousel.php:259
2340
- msgid "Loop posts"
2341
- msgstr ""
2342
-
2343
- #: widgets/post-carousel/post-carousel.php:260
2344
- msgid "Automatically return to the first post after the last post."
2345
- msgstr ""
2346
-
2347
- #: widgets/post-carousel/post-carousel.php:266
2348
  msgid "Posts query"
2349
  msgstr ""
2350
 
2351
- #: widgets/post-carousel/post-carousel.php:270
2352
  msgid "Posts per load"
2353
  msgstr ""
2354
 
2355
- #: widgets/post-carousel/post-carousel.php:271
2356
  msgid "Set the number of posts preloaded in the background when clicking next. The default is 10."
2357
  msgstr ""
2358
 
@@ -2704,11 +2700,11 @@ msgstr ""
2704
  msgid "Testimonials per row"
2705
  msgstr ""
2706
 
2707
- #: widgets/testimonial/testimonial.php:115, base/inc/widgets/base-carousel.class.php:204
2708
  msgid "Responsive"
2709
  msgstr ""
2710
 
2711
- #: widgets/testimonial/testimonial.php:120, base/inc/widgets/base-carousel.class.php:165
2712
  msgid "Tablet"
2713
  msgstr ""
2714
 
@@ -2836,7 +2832,7 @@ msgstr ""
2836
  msgid "Video Playback"
2837
  msgstr ""
2838
 
2839
- #: widgets/video/video.php:101, base/inc/widgets/base-carousel.class.php:242, base/inc/widgets/base-slider.class.php:61, base/inc/widgets/base-slider.class.php:201
2840
  msgid "Autoplay"
2841
  msgstr ""
2842
 
@@ -3169,91 +3165,91 @@ msgstr ""
3169
  msgid "%s is not a SiteOrigin Widget"
3170
  msgstr ""
3171
 
3172
- #: base/inc/widgets/base-carousel.class.php:81
3173
- msgid "Display navigation arrows"
3174
  msgstr ""
3175
 
3176
- #: base/inc/widgets/base-carousel.class.php:112
 
 
 
 
3177
  msgid "Breakpoint"
3178
  msgstr ""
3179
 
3180
- #: base/inc/widgets/base-carousel.class.php:119
3181
  msgid "Slides to scroll"
3182
  msgstr ""
3183
 
3184
- #: base/inc/widgets/base-carousel.class.php:121
3185
  msgid "Set the number of slides to scroll per navigation click or swipe on %s"
3186
  msgstr ""
3187
 
3188
- #: base/inc/widgets/base-carousel.class.php:130
3189
  msgid "Slides to show "
3190
  msgstr ""
3191
 
3192
- #: base/inc/widgets/base-carousel.class.php:132
3193
  msgid "The number of slides to show on %s."
3194
  msgstr ""
3195
 
3196
- #: base/inc/widgets/base-carousel.class.php:168
3197
  msgid "Landscape"
3198
  msgstr ""
3199
 
3200
- #: base/inc/widgets/base-carousel.class.php:174
3201
  msgid "Portrait"
3202
  msgstr ""
3203
 
3204
- #: base/inc/widgets/base-carousel.class.php:218
3205
  msgid "Loop Items"
3206
  msgstr ""
3207
 
3208
- #: base/inc/widgets/base-carousel.class.php:219
3209
  msgid "Automatically return to the first item after the last item."
3210
  msgstr ""
3211
 
3212
- #: base/inc/widgets/base-carousel.class.php:224
3213
- msgid "Navigation dots"
3214
- msgstr ""
3215
-
3216
- #: base/inc/widgets/base-carousel.class.php:228
3217
  msgid "Animation"
3218
  msgstr ""
3219
 
3220
- #: base/inc/widgets/base-carousel.class.php:231
3221
  msgid "Ease"
3222
  msgstr ""
3223
 
3224
- #: base/inc/widgets/base-carousel.class.php:232
3225
  msgid "Linear"
3226
  msgstr ""
3227
 
3228
- #: base/inc/widgets/base-carousel.class.php:237, base/inc/widgets/base-slider.class.php:84
3229
  msgid "Animation speed"
3230
  msgstr ""
3231
 
3232
- #: base/inc/widgets/base-carousel.class.php:253, base/inc/widgets/base-slider.class.php:75
3233
  msgid "Autoplay pause on hover"
3234
  msgstr ""
3235
 
3236
- #: base/inc/widgets/base-carousel.class.php:262, base/inc/widgets/base-slider.class.php:91
3237
  msgid "Timeout"
3238
  msgstr ""
3239
 
3240
- #: base/inc/widgets/base-carousel.class.php:282
3241
  msgid "Item title"
3242
  msgstr ""
3243
 
3244
- #: base/inc/widgets/base-carousel.class.php:390
3245
  msgid "Next"
3246
  msgstr ""
3247
 
3248
- #: base/inc/widgets/base-carousel.class.php:390
3249
  msgid "Next Posts"
3250
  msgstr ""
3251
 
3252
- #: base/inc/widgets/base-carousel.class.php:396
3253
  msgid "Previous"
3254
  msgstr ""
3255
 
3256
- #: base/inc/widgets/base-carousel.class.php:396
3257
  msgid "Previous Posts"
3258
  msgstr ""
3259
 
180
  msgid "Deactivate"
181
  msgstr ""
182
 
183
+ #: admin/tpl/admin.php:90, widgets/contact/contact.php:59, widgets/google-map/google-map.php:60, widgets/testimonial/testimonial.php:101, base/inc/widgets/base-carousel.class.php:249
184
  msgid "Settings"
185
  msgstr ""
186
 
296
  msgid "When opening the panel, scroll the user to the top of the panel."
297
  msgstr ""
298
 
299
+ #: widgets/accordion/accordion.php:72, widgets/accordion/accordion.php:85, widgets/anything-carousel/anything-carousel.php:52, widgets/anything-carousel/anything-carousel.php:68, widgets/contact/contact.php:48, widgets/cta/cta.php:64, widgets/editor/editor.php:35, widgets/features/features.php:140, widgets/icon/icon.php:68, widgets/post-carousel/post-carousel.php:245, widgets/price-table/price-table.php:42, widgets/price-table/price-table.php:61, widgets/simple-masonry/simple-masonry.php:44, widgets/simple-masonry/simple-masonry.php:85, widgets/social-media-buttons/social-media-buttons.php:54, widgets/tabs/tabs.php:71, widgets/tabs/tabs.php:84, widgets/taxonomy/taxonomy.php:34, widgets/testimonial/testimonial.php:41, widgets/video/video.php:33, base/inc/fields/posts.class.php:108
300
  msgid "Title"
301
  msgstr ""
302
 
303
+ #: widgets/accordion/accordion.php:76, widgets/accordion/accordion.php:154, widgets/tabs/tabs.php:169
304
  msgid "Panels"
305
  msgstr ""
306
 
307
+ #: widgets/accordion/accordion.php:89, widgets/anything-carousel/anything-carousel.php:72, widgets/hero/hero.php:73, widgets/layout-slider/layout-slider.php:67, widgets/tabs/tabs.php:88
308
  msgid "Content"
309
  msgstr ""
310
 
311
+ #: widgets/accordion/accordion.php:95, widgets/editor/editor.php:45
312
  msgid "Automatically add paragraphs"
313
  msgstr ""
314
 
315
+ #: widgets/accordion/accordion.php:99
316
  msgid "Initial state"
317
  msgstr ""
318
 
319
+ #: widgets/accordion/accordion.php:100
320
  msgid "Whether this panel should be open or closed when the page first loads."
321
  msgstr ""
322
 
323
+ #: widgets/accordion/accordion.php:102
324
  msgid "Open"
325
  msgstr ""
326
 
327
+ #: widgets/accordion/accordion.php:103
328
  msgid "Closed"
329
  msgstr ""
330
 
331
+ #: widgets/accordion/accordion.php:111, widgets/contact/contact.php:336, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:100, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:343
332
  msgid "Design"
333
  msgstr ""
334
 
335
+ #: widgets/accordion/accordion.php:116
336
  msgid "Headings"
337
  msgstr ""
338
 
339
+ #: widgets/accordion/accordion.php:121, widgets/accordion/accordion.php:159, widgets/contact/contact.php:346, widgets/contact/contact.php:584, widgets/cta/cta.php:78, widgets/hero/hero.php:133, widgets/layout-slider/layout-slider.php:101, widgets/slider/slider.php:87, widgets/social-media-buttons/social-media-buttons.php:86, widgets/tabs/tabs.php:110, widgets/tabs/tabs.php:130, widgets/tabs/tabs.php:174
340
  msgid "Background color"
341
  msgstr ""
342
 
343
+ #: widgets/accordion/accordion.php:126, widgets/social-media-buttons/social-media-buttons.php:98, widgets/tabs/tabs.php:134
344
  msgid "Background hover color"
345
  msgstr ""
346
 
347
+ #: widgets/accordion/accordion.php:131, widgets/cta/cta.php:88, widgets/tabs/tabs.php:139
348
  msgid "Title color"
349
  msgstr ""
350
 
351
+ #: widgets/accordion/accordion.php:136, widgets/tabs/tabs.php:144
352
  msgid "Title hover color"
353
  msgstr ""
354
 
355
+ #: widgets/accordion/accordion.php:140, widgets/accordion/accordion.php:168, widgets/contact/contact.php:356, widgets/contact/contact.php:478, widgets/contact/contact.php:594, widgets/cta/cta.php:83, widgets/tabs/tabs.php:115, widgets/tabs/tabs.php:149, widgets/tabs/tabs.php:183
356
  msgid "Border color"
357
  msgstr ""
358
 
359
+ #: widgets/accordion/accordion.php:144, widgets/tabs/tabs.php:154
360
  msgid "Border hover color"
361
  msgstr ""
362
 
363
+ #: widgets/accordion/accordion.php:148, widgets/accordion/accordion.php:172, widgets/contact/contact.php:361, widgets/contact/contact.php:483, widgets/contact/contact.php:610, widgets/tabs/tabs.php:119, widgets/tabs/tabs.php:159, widgets/tabs/tabs.php:187
364
  msgid "Border width"
365
  msgstr ""
366
 
367
+ #: widgets/accordion/accordion.php:164, widgets/tabs/tabs.php:179
368
  msgid "Font color"
369
  msgstr ""
370
 
371
+ #: widgets/accordion/accordion.php:176, widgets/anything-carousel/anything-carousel.php:83
372
  msgid "Bottom margin"
373
  msgstr ""
374
 
375
+ #: widgets/accordion/accordion.php:269
376
  msgid "Get more customization options and the ability to use widgets and layouts as your accordion content with %sSiteOrigin Premium%s"
377
  msgstr ""
378
 
379
+ #: widgets/accordion/accordion.php:274
380
  msgid "Use Google Fonts right inside the Accordion Widget with %sSiteOrigin Premium%s"
381
  msgstr ""
382
 
396
  msgid "Item"
397
  msgstr ""
398
 
399
+ #: widgets/anything-carousel/anything-carousel.php:95, widgets/button/button.php:203, widgets/contact/contact.php:390, widgets/contact/contact.php:440, widgets/features/features.php:145, widgets/features/features.php:166, widgets/features/features.php:187, widgets/headline/headline.php:88, widgets/headline/headline.php:169, base/inc/widgets/base-carousel.class.php:367
400
  msgid "Font"
401
  msgstr ""
402
 
403
+ #: widgets/anything-carousel/anything-carousel.php:99, widgets/button/button.php:209, widgets/contact/contact.php:395, widgets/contact/contact.php:445, widgets/contact/contact.php:627, base/inc/widgets/base-carousel.class.php:371
404
  msgid "Font size"
405
  msgstr ""
406
 
407
+ #: widgets/anything-carousel/anything-carousel.php:103, widgets/contact/contact.php:400, widgets/contact/contact.php:524, widgets/contact/contact.php:693, widgets/features/features.php:154, widgets/features/features.php:175, widgets/features/features.php:196, widgets/google-map/google-map.php:368, widgets/headline/headline.php:80, widgets/headline/headline.php:161, widgets/headline/headline.php:231, widgets/icon/icon.php:36, widgets/taxonomy/taxonomy.php:56, base/inc/widgets/base-carousel.class.php:375
408
  msgid "Color"
409
  msgstr ""
410
 
428
  msgid "Left"
429
  msgstr ""
430
 
431
+ #: widgets/anything-carousel/anything-carousel.php:133, widgets/post-carousel/post-carousel.php:180
432
  msgid "Navigation"
433
  msgstr ""
434
 
456
  msgid "Dots selected and hover color"
457
  msgstr ""
458
 
459
+ #: widgets/anything-carousel/anything-carousel.php:265
460
  msgid "Add widgets and layouts to your carousel items with %sSiteOrigin Premium%s."
461
  msgstr ""
462
 
1313
  msgid "Title text HTML tag"
1314
  msgstr ""
1315
 
1316
+ #: widgets/features/features.php:233, widgets/headline/headline.php:69, widgets/headline/headline.php:150, base/inc/widgets/base-carousel.class.php:356
1317
  msgid "H1"
1318
  msgstr ""
1319
 
1320
+ #: widgets/features/features.php:234, widgets/headline/headline.php:70, widgets/headline/headline.php:151, base/inc/widgets/base-carousel.class.php:357
1321
  msgid "H2"
1322
  msgstr ""
1323
 
1324
+ #: widgets/features/features.php:235, widgets/headline/headline.php:71, widgets/headline/headline.php:152, base/inc/widgets/base-carousel.class.php:358
1325
  msgid "H3"
1326
  msgstr ""
1327
 
1328
+ #: widgets/features/features.php:236, widgets/headline/headline.php:72, widgets/headline/headline.php:153, base/inc/widgets/base-carousel.class.php:359
1329
  msgid "H4"
1330
  msgstr ""
1331
 
1332
+ #: widgets/features/features.php:237, widgets/headline/headline.php:73, widgets/headline/headline.php:154, base/inc/widgets/base-carousel.class.php:360
1333
  msgid "H5"
1334
  msgstr ""
1335
 
1336
+ #: widgets/features/features.php:238, widgets/headline/headline.php:74, widgets/headline/headline.php:155, base/inc/widgets/base-carousel.class.php:361
1337
  msgid "H6"
1338
  msgstr ""
1339
 
1852
  msgid "Headline"
1853
  msgstr ""
1854
 
1855
+ #: widgets/headline/headline.php:66, widgets/headline/headline.php:147, base/inc/widgets/base-carousel.class.php:353
1856
  msgid "HTML Tag"
1857
  msgstr ""
1858
 
1859
+ #: widgets/headline/headline.php:75, widgets/headline/headline.php:156, base/inc/widgets/base-carousel.class.php:362
1860
  msgid "Paragraph"
1861
  msgstr ""
1862
 
1988
  msgid "Layout"
1989
  msgstr ""
1990
 
1991
+ #: widgets/hero/hero.php:183, widgets/layout-slider/layout-slider.php:151, base/inc/widgets/base-carousel.class.php:191
1992
  msgid "Desktop"
1993
  msgstr ""
1994
 
2012
  msgid "Maximum container width"
2013
  msgstr ""
2014
 
2015
+ #: widgets/hero/hero.php:219, widgets/layout-slider/layout-slider.php:187, base/inc/widgets/base-carousel.class.php:216
2016
  msgid "Mobile"
2017
  msgstr ""
2018
 
2272
  msgid "SiteOrigin Post Carousel"
2273
  msgstr ""
2274
 
2275
+ #: widgets/post-carousel/post-carousel.php:185
2276
  msgid "Navigation arrow color"
2277
  msgstr ""
2278
 
2279
+ #: widgets/post-carousel/post-carousel.php:190
2280
  msgid "Navigation arrow hover color"
2281
  msgstr ""
2282
 
2283
+ #: widgets/post-carousel/post-carousel.php:194
2284
  msgid "Navigation background"
2285
  msgstr ""
2286
 
2287
+ #: widgets/post-carousel/post-carousel.php:199
2288
  msgid "Navigation hover background"
2289
  msgstr ""
2290
 
2291
+ #: widgets/post-carousel/post-carousel.php:208
2292
  msgid "Post title"
2293
  msgstr ""
2294
 
2295
+ #: widgets/post-carousel/post-carousel.php:216
2296
  msgid "Post thumbnail"
2297
  msgstr ""
2298
 
2299
+ #: widgets/post-carousel/post-carousel.php:221
2300
  msgid "Thumbnail overlay hover color"
2301
  msgstr ""
2302
 
2303
+ #: widgets/post-carousel/post-carousel.php:226
2304
  msgid "Thumbnail overlay hover opacity"
2305
  msgstr ""
2306
 
2307
+ #: widgets/post-carousel/post-carousel.php:239
2308
+ msgid "Automatically return to the first post after the last post."
2309
+ msgstr ""
2310
+
2311
+ #: widgets/post-carousel/post-carousel.php:251
2312
  msgid "Default Thumbnail"
2313
  msgstr ""
2314
 
2315
+ #: widgets/post-carousel/post-carousel.php:252
2316
  msgid "Choose Thumbnail"
2317
  msgstr ""
2318
 
2319
+ #: widgets/post-carousel/post-carousel.php:253
2320
  msgid "Set Thumbnail"
2321
  msgstr ""
2322
 
2323
+ #: widgets/post-carousel/post-carousel.php:259
2324
  msgid "Featured Image size"
2325
  msgstr ""
2326
 
2327
+ #: widgets/post-carousel/post-carousel.php:265
2328
  msgid "Link target"
2329
  msgstr ""
2330
 
2331
+ #: widgets/post-carousel/post-carousel.php:266
2332
  msgid "Choose where to open each carousel item."
2333
  msgstr ""
2334
 
2335
+ #: widgets/post-carousel/post-carousel.php:268
2336
  msgid "Same window "
2337
  msgstr ""
2338
 
2339
+ #: widgets/post-carousel/post-carousel.php:269
2340
  msgid "New window "
2341
  msgstr ""
2342
 
2343
+ #: widgets/post-carousel/post-carousel.php:277
 
 
 
 
 
 
 
 
2344
  msgid "Posts query"
2345
  msgstr ""
2346
 
2347
+ #: widgets/post-carousel/post-carousel.php:281
2348
  msgid "Posts per load"
2349
  msgstr ""
2350
 
2351
+ #: widgets/post-carousel/post-carousel.php:282
2352
  msgid "Set the number of posts preloaded in the background when clicking next. The default is 10."
2353
  msgstr ""
2354
 
2700
  msgid "Testimonials per row"
2701
  msgstr ""
2702
 
2703
+ #: widgets/testimonial/testimonial.php:115, base/inc/widgets/base-carousel.class.php:239
2704
  msgid "Responsive"
2705
  msgstr ""
2706
 
2707
+ #: widgets/testimonial/testimonial.php:120, base/inc/widgets/base-carousel.class.php:197
2708
  msgid "Tablet"
2709
  msgstr ""
2710
 
2832
  msgid "Video Playback"
2833
  msgstr ""
2834
 
2835
+ #: widgets/video/video.php:101, base/inc/widgets/base-carousel.class.php:298, base/inc/widgets/base-slider.class.php:61, base/inc/widgets/base-slider.class.php:201
2836
  msgid "Autoplay"
2837
  msgstr ""
2838
 
3165
  msgid "%s is not a SiteOrigin Widget"
3166
  msgstr ""
3167
 
3168
+ #: base/inc/widgets/base-carousel.class.php:89, base/inc/widgets/base-carousel.class.php:272
3169
+ msgid "Navigation arrows"
3170
  msgstr ""
3171
 
3172
+ #: base/inc/widgets/base-carousel.class.php:96, base/inc/widgets/base-carousel.class.php:260
3173
+ msgid "Navigation dots"
3174
+ msgstr ""
3175
+
3176
+ #: base/inc/widgets/base-carousel.class.php:127
3177
  msgid "Breakpoint"
3178
  msgstr ""
3179
 
3180
+ #: base/inc/widgets/base-carousel.class.php:134
3181
  msgid "Slides to scroll"
3182
  msgstr ""
3183
 
3184
+ #: base/inc/widgets/base-carousel.class.php:136
3185
  msgid "Set the number of slides to scroll per navigation click or swipe on %s"
3186
  msgstr ""
3187
 
3188
+ #: base/inc/widgets/base-carousel.class.php:145
3189
  msgid "Slides to show "
3190
  msgstr ""
3191
 
3192
+ #: base/inc/widgets/base-carousel.class.php:147
3193
  msgid "The number of slides to show on %s."
3194
  msgstr ""
3195
 
3196
+ #: base/inc/widgets/base-carousel.class.php:200
3197
  msgid "Landscape"
3198
  msgstr ""
3199
 
3200
+ #: base/inc/widgets/base-carousel.class.php:207
3201
  msgid "Portrait"
3202
  msgstr ""
3203
 
3204
+ #: base/inc/widgets/base-carousel.class.php:254
3205
  msgid "Loop Items"
3206
  msgstr ""
3207
 
3208
+ #: base/inc/widgets/base-carousel.class.php:255
3209
  msgid "Automatically return to the first item after the last item."
3210
  msgstr ""
3211
 
3212
+ #: base/inc/widgets/base-carousel.class.php:284
 
 
 
 
3213
  msgid "Animation"
3214
  msgstr ""
3215
 
3216
+ #: base/inc/widgets/base-carousel.class.php:287
3217
  msgid "Ease"
3218
  msgstr ""
3219
 
3220
+ #: base/inc/widgets/base-carousel.class.php:288
3221
  msgid "Linear"
3222
  msgstr ""
3223
 
3224
+ #: base/inc/widgets/base-carousel.class.php:293, base/inc/widgets/base-slider.class.php:84
3225
  msgid "Animation speed"
3226
  msgstr ""
3227
 
3228
+ #: base/inc/widgets/base-carousel.class.php:309, base/inc/widgets/base-slider.class.php:75
3229
  msgid "Autoplay pause on hover"
3230
  msgstr ""
3231
 
3232
+ #: base/inc/widgets/base-carousel.class.php:318, base/inc/widgets/base-slider.class.php:91
3233
  msgid "Timeout"
3234
  msgstr ""
3235
 
3236
+ #: base/inc/widgets/base-carousel.class.php:348
3237
  msgid "Item title"
3238
  msgstr ""
3239
 
3240
+ #: base/inc/widgets/base-carousel.class.php:463
3241
  msgid "Next"
3242
  msgstr ""
3243
 
3244
+ #: base/inc/widgets/base-carousel.class.php:463
3245
  msgid "Next Posts"
3246
  msgstr ""
3247
 
3248
+ #: base/inc/widgets/base-carousel.class.php:469
3249
  msgid "Previous"
3250
  msgstr ""
3251
 
3252
+ #: base/inc/widgets/base-carousel.class.php:469
3253
  msgid "Previous Posts"
3254
  msgstr ""
3255
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Tags: widget, button, slider, hero, google maps, image, carousel, features, icon
3
  Requires at least: 4.2
4
  Tested up to: 5.9
5
  Requires PHP: 5.6.20
6
- Stable tag: 1.30.1
7
- Build time: 2022-02-22T21:33:13+02:00
8
  License: GPLv3 or later
9
  Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
@@ -100,6 +100,13 @@ The Widgets Bundle global interface is available at Plugins > SiteOrigin Widgets
100
 
101
  == Changelog ==
102
 
 
 
 
 
 
 
 
103
  = 1.30.1 - 22 February 2022 =
104
  * Widgets Block: Prevented a potential notice within the WP admin.
105
 
3
  Requires at least: 4.2
4
  Tested up to: 5.9
5
  Requires PHP: 5.6.20
6
+ Stable tag: 1.31.0
7
+ Build time: 2022-03-05T14:48:12+02:00
8
  License: GPLv3 or later
9
  Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
100
 
101
  == Changelog ==
102
 
103
+ = 1.31.0 - 05 March 2022 =
104
+ * Post Carousel: Updates to allow for themes to be added.
105
+ * Post Carousel: Fixed `Responsive > Tablet > Landscape` settings.
106
+ * Post Carousel: Added support for the Default Thumbnail: External URL field.
107
+ * Developer: Added preset field support for state emitters when reopening widgets.
108
+ * Developer: Added `siteorigin_widgets_accordion_scrollto_offset` filter.
109
+
110
  = 1.30.1 - 22 February 2022 =
111
  * Widgets Block: Prevented a potential notice within the WP admin.
112
 
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
5
- Version: 1.30.1
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
@@ -12,7 +12,7 @@ License: GPL3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
- define( 'SOW_BUNDLE_VERSION', '1.30.1' );
16
  define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
17
 
18
  // Allow JS suffix to be pre-set.
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
5
+ Version: 1.31.0
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define( 'SOW_BUNDLE_VERSION', '1.31.0' );
16
  define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
17
 
18
  // Allow JS suffix to be pre-set.
widgets/accordion/accordion.php CHANGED
@@ -59,6 +59,7 @@ class SiteOrigin_Widget_Accordion_Widget extends SiteOrigin_Widget {
59
  'sowAccordion',
60
  array(
61
  'scrollto_after_change' => ! empty( $global_settings['scrollto_after_change'] ),
 
62
  )
63
  );
64
  }
59
  'sowAccordion',
60
  array(
61
  'scrollto_after_change' => ! empty( $global_settings['scrollto_after_change'] ),
62
+ 'scrollto_offset' => (int) apply_filters( 'siteorigin_widgets_accordion_scrollto_offset', 80 ),
63
  )
64
  );
65
  }
widgets/accordion/js/accordion.js CHANGED
@@ -19,7 +19,8 @@ jQuery( function ( $ ) {
19
  };
20
 
21
  var scrollToPanel = function ( $panel, smooth ) {
22
- var navOffset = 90;// Add some magic number offset to make space for possible nav menus etc.
 
23
  var scrollTop = $panel.offset().top - navOffset;
24
  if ( smooth ) {
25
  $( 'body,html' ).animate( {
19
  };
20
 
21
  var scrollToPanel = function ( $panel, smooth ) {
22
+ // Add some magic number offset to make space for possible nav menus etc.
23
+ var navOffset = sowAccordion.scrollto_offset ? sowAccordion.scrollto_offset : 80;
24
  var scrollTop = $panel.offset().top - navOffset;
25
  if ( smooth ) {
26
  $( 'body,html' ).animate( {
widgets/accordion/js/accordion.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(o){sowb.setupAccordion=function(){o(".sow-accordion").each((function(n,e){var a=o(this).closest(".so-widget-sow-accordion");if(a.data("initialized"))return o(this);var i=o(e).find("> .sow-accordion-panel"),t=i.filter(".sow-accordion-panel-open").toArray(),c=function(){},r=function(n,e){var a=n.offset().top-90;e?o("body,html").animate({scrollTop:a},200):window.scrollTo(0,a)},s=function(n,e,a){var i=o(n);if(!i.is(".sow-accordion-panel-open")){i.find("> .sow-accordion-panel-content").slideDown({start:function(){o(window).trigger("resize"),o(sowb).trigger("setup_widgets")},complete:function(){a&&sowAccordion.scrollto_after_change&&(i.offset().top<window.scrollY||i.offset().top+i.height()>window.scrollY)&&r(i,!0),o(this).trigger("show")}}),i.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").attr("aria-expanded",!0),i.addClass("sow-accordion-panel-open"),t.push(n);var d=o(n).parents(".sow-accordion-panel");d.length&&!d.hasClass("sow-accordion-panel-open")&&s(d.get(0),!0),e||c()}},d=function(n,e){var a=o(n);a.is(".sow-accordion-panel-open")&&(a.find("> .sow-accordion-panel-content").slideUp((function(){o(this).trigger("hide")})),a.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").attr("aria-expanded",!1),a.removeClass("sow-accordion-panel-open"),t.splice(t.indexOf(n),1),e||c())};if(i.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").on("click keydown",(function(n){if("keydown"==n.type){if(13!==n.keyCode&&32!==n.keyCode)return;n.preventDefault()}var e=o(this),i=a.data("maxOpenPanels"),c=e.closest(".sow-accordion-panel");if(c.is(".sow-accordion-panel-open")?d(c.get(0)):s(c.get(0),!1,!0),!isNaN(i)&&i>0&&t.length>i){var r=0;o.each(t.reverse(),(function(o,n){r!==i?r++:d(t[o])}))}})),a.data("useAnchorTags")){var l;c=function(){l&&clearTimeout(l),l=setTimeout((function(){for(var n=[],e=o(".sow-accordion-panel-open").toArray(),a=0;a<e.length;a++){var i=o(e[a]).data("anchor");if(i){var t=o(e[a]).parents(".sow-accordion-panel");(!t.length||t.length&&t.hasClass("sow-accordion-panel-open"))&&(n[a]=i)}}n&&n.length?window.location.hash=n.join(","):window.location.hash&&window.history.pushState("",document.title,window.location.pathname+window.location.search)}),100)};var w=function(){for(var n=i.toArray(),e=window.location.hash.substring(1).split(","),a=0;a<n.length;a++){var t=n[a],c=o(t).data("anchor");e.some((function(o){return decodeURI(c)===decodeURI(o)}))?s(t,!0,!0):d(t,!0)}};o(window).on("hashchange",w),window.location.hash?w():c();var p=a.data("initialScrollPanel");if(window.location.hash&&t.length)setTimeout((function(){r(o(t[0]))}),500);else if(p>0){var h=p>i.length?i.last():i.eq(p-1);setTimeout((function(){r(h)}),500)}}a.data("initialized",!0)}))},sowb.setupAccordion(),o(sowb).on("setup_widgets",sowb.setupAccordion)})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(o){sowb.setupAccordion=function(){o(".sow-accordion").each((function(n,e){var a=o(this).closest(".so-widget-sow-accordion");if(a.data("initialized"))return o(this);var i=o(e).find("> .sow-accordion-panel"),t=i.filter(".sow-accordion-panel-open").toArray(),c=function(){},s=function(n,e){var a=sowAccordion.scrollto_offset?sowAccordion.scrollto_offset:80,i=n.offset().top-a;e?o("body,html").animate({scrollTop:i},200):window.scrollTo(0,i)},r=function(n,e,a){var i=o(n);if(!i.is(".sow-accordion-panel-open")){i.find("> .sow-accordion-panel-content").slideDown({start:function(){o(window).trigger("resize"),o(sowb).trigger("setup_widgets")},complete:function(){a&&sowAccordion.scrollto_after_change&&(i.offset().top<window.scrollY||i.offset().top+i.height()>window.scrollY)&&s(i,!0),o(this).trigger("show")}}),i.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").attr("aria-expanded",!0),i.addClass("sow-accordion-panel-open"),t.push(n);var d=o(n).parents(".sow-accordion-panel");d.length&&!d.hasClass("sow-accordion-panel-open")&&r(d.get(0),!0),e||c()}},d=function(n,e){var a=o(n);a.is(".sow-accordion-panel-open")&&(a.find("> .sow-accordion-panel-content").slideUp((function(){o(this).trigger("hide")})),a.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").attr("aria-expanded",!1),a.removeClass("sow-accordion-panel-open"),t.splice(t.indexOf(n),1),e||c())};if(i.find("> .sow-accordion-panel-header-container > .sow-accordion-panel-header").on("click keydown",(function(n){if("keydown"==n.type){if(13!==n.keyCode&&32!==n.keyCode)return;n.preventDefault()}var e=o(this),i=a.data("maxOpenPanels"),c=e.closest(".sow-accordion-panel");if(c.is(".sow-accordion-panel-open")?d(c.get(0)):r(c.get(0),!1,!0),!isNaN(i)&&i>0&&t.length>i){var s=0;o.each(t.reverse(),(function(o,n){s!==i?s++:d(t[o])}))}})),a.data("useAnchorTags")){var l;c=function(){l&&clearTimeout(l),l=setTimeout((function(){for(var n=[],e=o(".sow-accordion-panel-open").toArray(),a=0;a<e.length;a++){var i=o(e[a]).data("anchor");if(i){var t=o(e[a]).parents(".sow-accordion-panel");(!t.length||t.length&&t.hasClass("sow-accordion-panel-open"))&&(n[a]=i)}}n&&n.length?window.location.hash=n.join(","):window.location.hash&&window.history.pushState("",document.title,window.location.pathname+window.location.search)}),100)};var w=function(){for(var n=i.toArray(),e=window.location.hash.substring(1).split(","),a=0;a<n.length;a++){var t=n[a],c=o(t).data("anchor");e.some((function(o){return decodeURI(c)===decodeURI(o)}))?r(t,!0,!0):d(t,!0)}};o(window).on("hashchange",w),window.location.hash?w():c();var p=a.data("initialScrollPanel");if(window.location.hash&&t.length)setTimeout((function(){s(o(t[0]))}),500);else if(p>0){var h=p>i.length?i.last():i.eq(p-1);setTimeout((function(){s(h)}),500)}}a.data("initialized",!0)}))},sowb.setupAccordion(),o(sowb).on("setup_widgets",sowb.setupAccordion)})),window.sowb=sowb;
widgets/anything-carousel/anything-carousel.php CHANGED
@@ -238,6 +238,7 @@ class SiteOrigin_Widget_Anything_Carousel_Widget extends SiteOrigin_Widget_Base_
238
  'title' => $instance['title'],
239
  'item_template' => plugin_dir_path( __FILE__ ) . 'tpl/item.php',
240
  'navigation' => 'side',
 
241
  'item_title_tag' => $instance['design']['item_title']['tag'],
242
  'items' => ! empty( $instance['items'] ) ? $instance['items'] : array(),
243
  'attributes' => array(
238
  'title' => $instance['title'],
239
  'item_template' => plugin_dir_path( __FILE__ ) . 'tpl/item.php',
240
  'navigation' => 'side',
241
+ 'navigation_arrows' => isset( $instance['carousel_settings']['arrows'] ) ? $instance['carousel_settings']['arrows'] : true,
242
  'item_title_tag' => $instance['design']['item_title']['tag'],
243
  'items' => ! empty( $instance['items'] ) ? $instance['items'] : array(),
244
  'attributes' => array(
widgets/anything-carousel/styles/base.less CHANGED
@@ -28,6 +28,10 @@
28
  @navigation_tablet_landscape: default;
29
  @navigation_tablet_portrait: default;
30
  @navigation_mobile: default;
 
 
 
 
31
 
32
  .sow-carousel-container {
33
  a.sow-carousel-next {
@@ -84,7 +88,7 @@
84
  }
85
  }
86
 
87
- & when not ( isnumber( @navigation_mobile ) ) {
88
  @media (max-width: @breakpoint_mobile) {
89
  display: none;
90
  }
@@ -116,6 +120,29 @@
116
  }
117
 
118
  .slick-dots {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  li {
120
 
121
  &.slick-active button:before {
28
  @navigation_tablet_landscape: default;
29
  @navigation_tablet_portrait: default;
30
  @navigation_mobile: default;
31
+ @navigation_dots_desktop: default;
32
+ @navigation_dots_tablet_landscape: default;
33
+ @navigation_dots_tablet_portrait: default;
34
+ @navigation_dots_mobile: default;
35
 
36
  .sow-carousel-container {
37
  a.sow-carousel-next {
88
  }
89
  }
90
 
91
+ & when not ( isnumber( @navigation_mobile ) ) {
92
  @media (max-width: @breakpoint_mobile) {
93
  display: none;
94
  }
120
  }
121
 
122
  .slick-dots {
123
+ & when not ( isnumber( @navigation_dots_desktop ) ) {
124
+ @media (min-width: @breakpoint_tablet_landscape) {
125
+ display: none !important;
126
+ }
127
+ }
128
+
129
+ & when not ( isnumber( @navigation_dots_tablet_landscape ) ) {
130
+ @media (min-width: @breakpoint_tablet_portrait) and (max-width: @breakpoint_tablet_landscape) {
131
+ display: none !important;
132
+ }
133
+ }
134
+
135
+ & when not ( isnumber( @navigation_dots_tablet_portrait ) ) {
136
+ @media (min-width: @breakpoint_mobile) and (max-width: @breakpoint_tablet_portrait) {
137
+ display: none !important;
138
+ }
139
+ }
140
+
141
+ & when not ( isnumber( @navigation_dots_mobile ) ) {
142
+ @media (max-width: @breakpoint_mobile) {
143
+ display: none !important;
144
+ }
145
+ }
146
  li {
147
 
148
  &.slick-active button:before {
widgets/post-carousel/css/base.css ADDED
@@ -0,0 +1 @@
 
1
+ @font-face{font-family:'post-carousel-arrows';src:url('fonts/carousel-arrows.eot?-95vnmw');src:url('fonts/carousel-arrows.eot?#iefix-95vnmw') format('embedded-opentype'),url('fonts/carousel-arrows.woff?-95vnmw') format('woff'),url('fonts/carousel-arrows.ttf?-95vnmw') format('truetype'),url('fonts/carousel-arrows.svg?-95vnmw#carousel-arrows') format('svg');font-weight:normal;font-style:normal;font-display:block}.sow-post-carousel-theme-base .sow-carousel-title.has-title{align-items:baseline;display:flex}.sow-post-carousel-theme-base .sow-carousel-title.has-title .sow-carousel-navigation{margin-left:auto}body.rtl .sow-post-carousel-theme-base .sow-carousel-title.has-title .sow-carousel-navigation{margin-right:auto;margin-left:initial}.sow-post-carousel-theme-base .sow-carousel-title .widget-title{display:inline-block;padding-right:15px}.sow-post-carousel-theme-base .sow-carousel-title .sow-carousel-navigation{float:right}body.rtl .sow-post-carousel-theme-base .sow-carousel-title .sow-carousel-navigation{float:left}body.rtl .sow-post-carousel-theme-base .sow-carousel-title .sow-carousel-navigation a{margin-left:0;margin-right:2px}.sow-post-carousel-theme-base a.sow-carousel-next,.sow-post-carousel-theme-base a.sow-carousel-previous{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;border-radius:2px;display:block;float:right;font-family:'post-carousel-arrows';font-size:8px;font-style:normal;font-variant:normal;font-weight:normal;line-height:18px;margin-left:2px;margin-top:3px;text-align:center;text-decoration:none;text-transform:none;width:18px}.sow-post-carousel-theme-base a.sow-carousel-previous:before{content:"\e600"}.sow-post-carousel-theme-base a.sow-carousel-next:before{content:"\e601"}.sow-post-carousel-theme-base .sow-carousel-wrapper{left:0;overflow:hidden;position:relative;right:0}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items{zoom:1;margin:0;padding:0;transition:all .45s ease}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items:before{content:'';display:block}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items:after{clear:both;content:'';display:table}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item{display:block;margin-right:15px}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-thumbnail{line-height:0}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-thumbnail:focus{outline:none}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-thumbnail a{display:block;background-position:center center}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-thumbnail a,.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-thumbnail a span.overlay{transition:all .35s ease}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-thumbnail a span.overlay{display:block;width:100%;height:100%;opacity:0;position:static}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-item .sow-carousel-default-thumbnail{display:block;background:#E8E8E8;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #E0E0E0), color-stop(1, #E8E8E8));background:-ms-linear-gradient(bottom, #E0E0E0, #E8E8E8);background:-moz-linear-gradient(center bottom, #E0E0E0 0%, #E8E8E8 100%);background:-o-linear-gradient(#E8E8E8, #E0E0E0)}.sow-post-carousel-theme-base .sow-carousel-wrapper .sow-carousel-items .sow-carousel-loading{display:block;background:url(images/carousel-loader.gif) #F6F6F6 center center no-repeat;margin:0}
widgets/post-carousel/js/script.js CHANGED
@@ -26,6 +26,8 @@ jQuery( function ( $ ) {
26
  if ( refocus ) {
27
  $items.find( '.sow-carousel-item[tabindex="0"]' ).trigger( 'focus' );
28
  }
 
 
29
  }
30
  );
31
  }
26
  if ( refocus ) {
27
  $items.find( '.sow-carousel-item[tabindex="0"]' ).trigger( 'focus' );
28
  }
29
+
30
+ $( sowb ).trigger( 'carousel_posts_added' );
31
  }
32
  );
33
  }
widgets/post-carousel/js/script.min.js CHANGED
@@ -1 +1 @@
1
- var sowb=window.sowb||{};jQuery((function(a){a(sowb).on("carousel_load_new_items",(function(i,o,s,e){if("post"==o.data("widget")&&!o.data("fetching")){o.data("fetching",!0);var n=o.data("page")+1;s.slick("slickAdd",'<div class="sow-carousel-item sow-carousel-loading"></div>'),a.get(o.data("ajax-url"),{action:"sow_carousel_load",paged:n,instance_hash:o.parent().parent().find('input[name="instance_hash"]').val()},(function(a){s.find(".sow-carousel-loading").remove(),s.slick("slickAdd",a.html),o.data("fetching",!1),o.data("page",n),e&&s.find('.sow-carousel-item[tabindex="0"]').trigger("focus")}))}}))})),window.sowb=sowb;
1
+ var sowb=window.sowb||{};jQuery((function(a){a(sowb).on("carousel_load_new_items",(function(o,s,e,i){if("post"==s.data("widget")&&!s.data("fetching")){s.data("fetching",!0);var t=s.data("page")+1;e.slick("slickAdd",'<div class="sow-carousel-item sow-carousel-loading"></div>'),a.get(s.data("ajax-url"),{action:"sow_carousel_load",paged:t,instance_hash:s.parent().parent().find('input[name="instance_hash"]').val()},(function(o){e.find(".sow-carousel-loading").remove(),e.slick("slickAdd",o.html),s.data("fetching",!1),s.data("page",t),i&&e.find('.sow-carousel-item[tabindex="0"]').trigger("focus"),a(sowb).trigger("carousel_posts_added")}))}}))})),window.sowb=sowb;
widgets/post-carousel/post-carousel.php CHANGED
@@ -75,7 +75,7 @@ function sow_carousel_get_next_posts_page() {
75
  // Don't output anything if there are no posts to return;
76
  if ( ! empty( $settings['posts']->posts ) ) {
77
  ob_start();
78
- include 'tpl/item.php';
79
  $result = array( 'html' => ob_get_clean() );
80
  header( 'content-type: application/json' );
81
  echo json_encode( $result );
@@ -98,7 +98,8 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
98
  array(
99
  'description' => __('Gives you a widget to display your posts as a carousel.', 'so-widgets-bundle'),
100
  'instance_storage' => true,
101
- 'help' => 'https://siteorigin.com/widgets-bundle/post-carousel-widget/'
 
102
  ),
103
  array(
104
 
@@ -123,42 +124,52 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
123
  ),
124
  )
125
  );
 
 
126
 
127
- $this->register_frontend_styles(
 
 
128
  array(
129
- array(
130
- 'sow-carousel-basic',
131
- plugin_dir_url( __FILE__ ) . 'css/style.css',
 
 
 
 
 
 
 
 
 
 
132
  ),
 
 
 
 
 
 
 
 
133
  )
134
  );
135
  }
136
 
137
- function override_carousel_settings() {
138
- return array(
139
- 'breakpoints' => apply_filters(
140
- 'siteorigin_widgets_post_carousel_breakpoints',
141
- array(
142
- 'tablet_landscape' => 1366,
143
- 'tablet_portrait' => 1025,
144
- 'mobile' => 480,
145
- )
146
- ),
147
- 'slides_to_scroll' => array(
148
- 'desktop' => 1,
149
- 'tablet_landscape' => 2,
150
- 'tablet_portrait' => 2,
151
- 'mobile' => 1,
152
- ),
153
- 'navigation' => array(
154
- 'desktop' => true,
155
- 'tablet_landscape' => true,
156
- 'tablet_portrait' => true,
157
- 'mobile' => false,
158
- ),
159
- // Remove slides_to_show.
160
- 'slides_to_show' => array(),
161
- );
162
  }
163
 
164
  function get_widget_form() {
@@ -193,7 +204,7 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
193
  )
194
  );
195
 
196
- // Overide defaults.
197
  $design_settings['fields']['item_title']['label'] = __( 'Post title', 'so-widgets-bundle' );
198
  $design_settings['fields']['item_title']['fields']['tag']['default'] = 'h3';
199
 
@@ -224,6 +235,10 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
224
  $design_settings['fields']
225
  );
226
 
 
 
 
 
227
  return array(
228
  'title' => array(
229
  'type' => 'text',
@@ -254,12 +269,8 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
254
  'new' => __( 'New window ', 'so-widgets-bundle' ),
255
  ),
256
  ),
257
- 'loop_posts' => array(
258
- 'type' => 'checkbox',
259
- 'label' => __( 'Loop posts', 'so-widgets-bundle' ),
260
- 'description' => __( 'Automatically return to the first post after the last post.', 'so-widgets-bundle' ),
261
- 'default' => true,
262
- ),
263
 
264
  'posts' => array(
265
  'type' => 'posts',
@@ -294,13 +305,12 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
294
  'navigation_background' => $instance['design']['navigation_background'],
295
  'navigation_hover_background' => $instance['design']['navigation_hover_background'],
296
  );
 
297
 
298
- unset( $instance['design']['thumbnail_overlay_hover_color'] );
299
- unset( $instance['design']['thumbnail_overlay_hover_opacity'] );
300
- unset( $instance['design']['navigation_color'] );
301
- unset( $instance['design']['navigation_color_hover'] );
302
- unset( $instance['design']['navigation_background'] );
303
- unset( $instance['design']['navigation_hover_background'] );
304
  }
305
 
306
  return $instance;
@@ -323,6 +333,7 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
323
  $thumb_hover_width = $size['width'];
324
  $thumb_hover_height = $size['height'];
325
  }
 
326
  $less_vars = array(
327
  'thumbnail_width' => $thumb_width . 'px',
328
  'thumbnail_height'=> $thumb_height . 'px',
@@ -343,9 +354,17 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
343
  return $less_vars;
344
  }
345
 
 
 
 
 
346
  public function get_template_variables( $instance, $args ) {
347
- if ( ! empty( $instance['default_thumbnail'] ) ) {
348
- $default_thumbnail = wp_get_attachment_image_src( $instance['default_thumbnail'], 'sow-carousel-default' );
 
 
 
 
349
  }
350
 
351
  $query = siteorigin_widget_post_selector_process_query( wp_parse_args(
@@ -356,18 +375,32 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
356
  ) );
357
  $posts = new WP_Query( $query );
358
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  return array(
360
  'settings' => array(
361
  'args' => $args,
362
  'title' => $instance['title'],
 
363
  'posts' => sow_carousel_handle_post_limit( $posts ),
364
- 'default_thumbnail' => ! empty( $default_thumbnail ) ? $default_thumbnail[0] : '',
365
  'image_size' => $instance['image_size'],
366
  'link_target' => ! empty( $instance['link_target'] ) ? $instance['link_target'] : 'same',
367
  'item_template' => plugin_dir_path( __FILE__ ) . 'tpl/item.php',
368
  'navigation' => 'title',
 
 
369
  'item_title_tag' => ! empty( $instance['design']['item_title']['tag'] ) ? $instance['design']['item_title']['tag'] : 'h3',
370
- 'item_overflow' => true,
371
  'attributes' => array(
372
  'widget' => 'post',
373
  'fetching' => 'false',
@@ -376,12 +409,7 @@ class SiteOrigin_Widget_PostCarousel_Widget extends SiteOrigin_Widget_Base_Carou
376
 
377
  // Base carousel specific settings.
378
  'item_count' => get_query_var( 'sow-total_posts' ),
379
- 'carousel_settings' => json_encode(
380
- array(
381
- 'loop' => ! empty( $instance['loop_posts'] ),
382
- 'item_overflow' => true,
383
- )
384
- ),
385
  'responsive' => $this->responsive_template_variables( $instance['responsive'] ),
386
  'variable_width' => 'true',
387
  ),
75
  // Don't output anything if there are no posts to return;
76
  if ( ! empty( $settings['posts']->posts ) ) {
77
  ob_start();
78
+ include apply_filters( 'siteorigin_post_carousel_ajax_item_template', 'tpl/item.php', $instance );
79
  $result = array( 'html' => ob_get_clean() );
80
  header( 'content-type: application/json' );
81
  echo json_encode( $result );
98
  array(
99
  'description' => __('Gives you a widget to display your posts as a carousel.', 'so-widgets-bundle'),
100
  'instance_storage' => true,
101
+ 'help' => 'https://siteorigin.com/widgets-bundle/post-carousel-widget/',
102
+ 'has_preview' => false,
103
  ),
104
  array(
105
 
124
  ),
125
  )
126
  );
127
+ add_action( 'wp_enqueue_scripts', array( $this, 'register_theme_assets' ) );
128
+ }
129
 
130
+ function override_carousel_settings() {
131
+ return apply_filters(
132
+ 'siteorigin_widgets_post_carousel_settings_form',
133
  array(
134
+ 'breakpoints' => apply_filters(
135
+ 'siteorigin_widgets_post_carousel_breakpoints',
136
+ array(
137
+ 'tablet_landscape' => 1366,
138
+ 'tablet_portrait' => 1025,
139
+ 'mobile' => 480,
140
+ )
141
+ ),
142
+ 'slides_to_scroll' => array(
143
+ 'desktop' => 1,
144
+ 'tablet_landscape' => 2,
145
+ 'tablet_portrait' => 2,
146
+ 'mobile' => 1,
147
  ),
148
+ 'navigation' => array(
149
+ 'desktop' => true,
150
+ 'tablet_landscape' => true,
151
+ 'tablet_portrait' => true,
152
+ 'mobile' => false,
153
+ ),
154
+ 'slides_to_show' => array(),
155
+ 'navigation_dots_label' => '',
156
  )
157
  );
158
  }
159
 
160
+ function register_theme_assets() {
161
+ wp_register_style( 'sow-post-carousel-base', plugin_dir_url( __FILE__ ) . 'css/base.css' );
162
+ do_action( 'siteorigin_widgets_post_carousel_theme_assets' );
163
+ }
164
+
165
+ function get_style_name( $instance ) {
166
+ $theme = self::get_theme( $instance );
167
+ // If this theme has a dedicated stylesheet load it.
168
+ if ( wp_style_is( 'sow-post-carousel-' . $theme, 'registered' ) ) {
169
+ wp_enqueue_style( 'sow-post-carousel-' . $theme );
170
+ }
171
+
172
+ return $theme;
 
 
 
 
 
 
 
 
 
 
 
 
173
  }
174
 
175
  function get_widget_form() {
204
  )
205
  );
206
 
207
+ // Override defaults.
208
  $design_settings['fields']['item_title']['label'] = __( 'Post title', 'so-widgets-bundle' );
209
  $design_settings['fields']['item_title']['fields']['tag']['default'] = 'h3';
210
 
235
  $design_settings['fields']
236
  );
237
 
238
+ $carousel_settings = $this->carousel_settings_form_fields();
239
+ $carousel_settings['fields']['loop']['description'] = __( 'Automatically return to the first post after the last post.', 'so-widgets-bundle' );
240
+ unset( $carousel_settings['fields']['animation'] );
241
+
242
  return array(
243
  'title' => array(
244
  'type' => 'text',
269
  'new' => __( 'New window ', 'so-widgets-bundle' ),
270
  ),
271
  ),
272
+
273
+ 'carousel_settings' => $carousel_settings,
 
 
 
 
274
 
275
  'posts' => array(
276
  'type' => 'posts',
305
  'navigation_background' => $instance['design']['navigation_background'],
306
  'navigation_hover_background' => $instance['design']['navigation_hover_background'],
307
  );
308
+ }
309
 
310
+ // Migrate settings to the Settings section.
311
+ if ( isset( $instance['loop_posts'] ) ) {
312
+ $instance['carousel_settings']['loop'] = $instance['loop_posts'];
313
+ unset( $instance['loop_posts'] );
 
 
314
  }
315
 
316
  return $instance;
333
  $thumb_hover_width = $size['width'];
334
  $thumb_hover_height = $size['height'];
335
  }
336
+
337
  $less_vars = array(
338
  'thumbnail_width' => $thumb_width . 'px',
339
  'thumbnail_height'=> $thumb_height . 'px',
354
  return $less_vars;
355
  }
356
 
357
+ static public function get_theme( $instance ) {
358
+ return empty( $instance['design']['theme'] ) || ! class_exists( 'SiteOrigin_Premium_Plugin_Carousel' ) ? 'base' : $instance['design']['theme'];
359
+ }
360
+
361
  public function get_template_variables( $instance, $args ) {
362
+ $theme = self::get_theme( $instance );
363
+ if (
364
+ ! empty( $instance['default_thumbnail'] ) ||
365
+ ! empty( $instance['default_thumbnail_fallback'] )
366
+ ) {
367
+ $default_thumbnail = siteorigin_widgets_get_attachment_image_src( $instance['default_thumbnail'], $instance['image_size'], $instance['default_thumbnail_fallback'] );
368
  }
369
 
370
  $query = siteorigin_widget_post_selector_process_query( wp_parse_args(
375
  ) );
376
  $posts = new WP_Query( $query );
377
 
378
+ $carousel_settings = $this->carousel_settings_template_variables( $instance['carousel_settings'], false );
379
+ // The base theme doesn't support dot noviation so let's remove it.
380
+ if ( $theme == 'base' ) {
381
+ unset( $carousel_settings['dots'] );
382
+ }
383
+
384
+ $carousel_settings['loop'] = ! empty( $instance['carousel_settings']['loop'] );
385
+ $carousel_settings['item_overflow'] = true;
386
+ $carousel_settings = apply_filters( 'siteorigin_widgets_post_carousel_settings_frontend', $carousel_settings, $instance );
387
+
388
+ $size = siteorigin_widgets_get_image_size( $instance['image_size'] );
389
+
390
  return array(
391
  'settings' => array(
392
  'args' => $args,
393
  'title' => $instance['title'],
394
+ 'theme' => $theme,
395
  'posts' => sow_carousel_handle_post_limit( $posts ),
396
+ 'default_thumbnail' => ! empty( $default_thumbnail ) ? $default_thumbnail[0] : false,
397
  'image_size' => $instance['image_size'],
398
  'link_target' => ! empty( $instance['link_target'] ) ? $instance['link_target'] : 'same',
399
  'item_template' => plugin_dir_path( __FILE__ ) . 'tpl/item.php',
400
  'navigation' => 'title',
401
+ 'navigation_arrows' => isset( $instance['carousel_settings']['arrows'] ) ? $instance['carousel_settings']['arrows'] : true,
402
+ 'height' => ! empty( $size['height'] ) ? 'min-height: ' . $size['height'] . 'px' : '',
403
  'item_title_tag' => ! empty( $instance['design']['item_title']['tag'] ) ? $instance['design']['item_title']['tag'] : 'h3',
 
404
  'attributes' => array(
405
  'widget' => 'post',
406
  'fetching' => 'false',
409
 
410
  // Base carousel specific settings.
411
  'item_count' => get_query_var( 'sow-total_posts' ),
412
+ 'carousel_settings' => json_encode( $carousel_settings ),
 
 
 
 
 
413
  'responsive' => $this->responsive_template_variables( $instance['responsive'] ),
414
  'variable_width' => 'true',
415
  ),
widgets/post-carousel/styles/base.less ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @thumbnail_width: default;
2
+ @thumbnail_height: default;
3
+
4
+ @thumbnail_hover_width: default;
5
+ @thumbnail_hover_height: default;
6
+
7
+ @thumbnail_overlay_hover_opacity: 0.5;
8
+ @thumbnail_overlay_hover_color: #3279BB;
9
+ @navigation_color: #fff;
10
+ @navigation_color_hover: default;
11
+ @navigation_background: #333;
12
+ @navigation_hover_background: #444;
13
+
14
+ @breakpoint_tablet_landscape: default;
15
+ @breakpoint_tablet_portrait: default;
16
+ @breakpoint_mobile: default;
17
+ @navigation_desktop: default;
18
+ @navigation_tablet_landscape: default;
19
+ @navigation_tablet_portrait: default;
20
+ @navigation_mobile: default;
21
+ @item_title_tag: default;
22
+ @item_title_font_size: 15px;
23
+ @item_title_color: #474747;
24
+
25
+ .sow-carousel-title {
26
+
27
+ a.sow-carousel-next,
28
+ a.sow-carousel-previous {
29
+ background: @navigation_background;
30
+ color: @navigation_color;
31
+
32
+ &:focus,
33
+ &:hover {
34
+ background: @navigation_hover_background;
35
+ color: @navigation_color_hover;
36
+ }
37
+
38
+ & when not ( isnumber( @navigation_desktop ) ) {
39
+ @media (min-width: @breakpoint_tablet_landscape) {
40
+ display: none;
41
+ }
42
+ }
43
+
44
+ & when not ( isnumber( @navigation_tablet_landscape ) ) {
45
+ @media (min-width: @breakpoint_tablet_portrait) and (max-width: @breakpoint_tablet_landscape) {
46
+ display: none;
47
+ }
48
+ }
49
+
50
+ & when not ( isnumber( @navigation_tablet_portrait ) ) {
51
+ @media (min-width: @breakpoint_mobile) and (max-width: @breakpoint_tablet_portrait) {
52
+ display: none;
53
+ }
54
+ }
55
+
56
+ & when not ( isnumber( @navigation_mobile ) ) {
57
+ @media (max-width: @breakpoint_mobile) {
58
+ display: none;
59
+ }
60
+ }
61
+ }
62
+
63
+ }
64
+
65
+ .sow-carousel-wrapper {
66
+
67
+ .sow-carousel-items {
68
+ .sow-carousel-item {
69
+ width: @thumbnail_width;
70
+
71
+ .sow-carousel-thumbnail a {
72
+ background-repeat: no-repeat;
73
+ background-size: @thumbnail_width @thumbnail_height;
74
+
75
+ &, span.overlay {
76
+ width: @thumbnail_width;
77
+ height: @thumbnail_height;
78
+ }
79
+
80
+ span.overlay {
81
+ background: @thumbnail_overlay_hover_color;
82
+ }
83
+ }
84
+
85
+ @{item_title_tag}.sow-carousel-item-title {
86
+ color: @item_title_color;
87
+ font-size: @item_title_font_size;
88
+ font-weight: 500;
89
+ margin: 10px 0 0 0;
90
+ text-align: center;
91
+
92
+ a {
93
+ text-decoration: none;
94
+ color: inherit;
95
+ }
96
+ }
97
+
98
+ &:focus,
99
+ &:hover {
100
+ .sow-carousel-thumbnail a {
101
+ background-size: @thumbnail_hover_width @thumbnail_hover_height;
102
+
103
+ span.overlay {
104
+ opacity: @thumbnail_overlay_hover_opacity;
105
+ }
106
+ }
107
+ }
108
+
109
+ .sow-carousel-default-thumbnail {
110
+ width: @thumbnail_width;
111
+ height: @thumbnail_height;
112
+ }
113
+ }
114
+
115
+ .sow-carousel-loading {
116
+ width: @thumbnail_width;
117
+ height: @thumbnail_height;
118
+ }
119
+ }
120
+ }
widgets/post-carousel/tpl/base.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php if ( ! empty( $settings['posts'] ) && $settings['posts']->have_posts() ) : ?>
2
- <div class="sow-post-carousel-wrapper" style="overflow: hidden; max-width: 100%;">
 
 
 
3
  <?php $this->render_template( $settings, $args ); ?>
4
  <input type="hidden" name="instance_hash" value="<?php echo esc_attr( $storage_hash ); ?>"/>
5
  </div>
1
  <?php if ( ! empty( $settings['posts'] ) && $settings['posts']->have_posts() ) : ?>
2
+ <div
3
+ class="sow-post-carousel-wrapper <?php echo ! empty( $settings['theme'] ) ? 'sow-post-carousel-theme-' . esc_attr( $settings['theme'] ) : ''; ?>"
4
+ style="overflow: hidden; max-width: 100%; <?php echo ! empty( $settings['height'] ) ? esc_attr( $settings['height'] ) : ''; ?>"
5
+ >
6
  <?php $this->render_template( $settings, $args ); ?>
7
  <input type="hidden" name="instance_hash" value="<?php echo esc_attr( $storage_hash ); ?>"/>
8
  </div>
widgets/post-carousel/tpl/item.php CHANGED
@@ -6,7 +6,7 @@ while( $settings['posts']->have_posts() ) :
6
  <div class="sow-carousel-thumbnail">
7
  <?php
8
  if ( has_post_thumbnail() ) :
9
- $img = wp_get_attachment_image_src( get_post_thumbnail_id(), $settings['image_size'] );
10
  ?>
11
  <a
12
  href="<?php the_permalink() ?>"
6
  <div class="sow-carousel-thumbnail">
7
  <?php
8
  if ( has_post_thumbnail() ) :
9
+ $img = siteorigin_widgets_get_attachment_image_src( get_post_thumbnail_id(), $settings['image_size'], $settings['default_thumbnail'] );
10
  ?>
11
  <a
12
  href="<?php the_permalink() ?>"