SiteOrigin Widgets Bundle - Version 1.8

Version Description

  • 31 January 2017 =
  • Introduced compatibility system.
  • Added compatibility with Elementor and Beaver Builder.
  • Ensure radio inputs in repeaters have their checked property set correctly.
  • Various Call to Action widget improvements.
  • Use text-align: center; for features icons.
  • Always use HTTPS for Google Webfonts.
  • Post Selector: Exclude current post id
  • Post Selector: Add filter returned query
  • Post Carousel: Prevent empty title output.
  • Google Maps: Add ability to set link for Static Map.
  • Social Links: Add title field and title attributes for links.
  • Features: Add title text field for features
  • Button Widget: Add Font setting
  • Contact: Add radio field Type
  • Taxonomy: New Window Setting
  • Added a way of specifying post types for link field.
  • Introduced a global widget setup action.
Download this release

Release Info

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

Code changes from version 1.7.2 to 1.8

Files changed (68) hide show
  1. base/base.php +2 -2
  2. base/inc/actions.php +8 -2
  3. base/inc/fields/css/icon-field.css +2 -3
  4. base/inc/fields/css/media-field.css +1 -1
  5. base/inc/fields/icon.class.php +1 -1
  6. base/inc/fields/js/tinymce-field.js +19 -9
  7. base/inc/fields/js/tinymce-field.min.js +1 -1
  8. base/inc/fields/link.class.php +16 -7
  9. base/inc/fields/media.class.php +5 -0
  10. base/inc/fields/radio.class.php +5 -4
  11. base/inc/lessc.inc.php +1 -1
  12. base/inc/post-selector.php +7 -2
  13. base/inc/widget-manager.class.php +1 -0
  14. base/js/admin.js +62 -8
  15. base/js/admin.min.js +1 -1
  16. base/siteorigin-widget.class.php +41 -14
  17. compat/beaver-builder/beaver-builder.php +97 -0
  18. compat/beaver-builder/sowb-beaver-builder.js +114 -0
  19. compat/beaver-builder/sowb-beaver-builder.min.js +1 -0
  20. compat/beaver-builder/styles.css +190 -0
  21. compat/builders.php +11 -0
  22. compat/compat.php +51 -0
  23. compat/elementor/elementor.php +102 -0
  24. compat/elementor/styles.css +225 -0
  25. js/slider/jquery.slider.js +243 -231
  26. js/slider/jquery.slider.min.js +1 -1
  27. readme.txt +23 -3
  28. so-widgets-bundle.php +6 -2
  29. widgets/button/button.php +22 -1
  30. widgets/button/styles/atom.less +6 -0
  31. widgets/button/styles/flat.less +6 -0
  32. widgets/button/styles/wire.less +6 -0
  33. widgets/contact/contact.php +4 -3
  34. widgets/contact/fields/checkboxes.class.php +13 -13
  35. widgets/contact/fields/radio.class.php +19 -0
  36. widgets/contact/styles/default.less +1 -1
  37. widgets/cta/css/style.css +4 -4
  38. widgets/cta/cta.php +10 -0
  39. widgets/cta/styles/default.less +15 -2
  40. widgets/cta/tpl/default.php +3 -3
  41. widgets/features/css/style.css +1 -3
  42. widgets/features/features.php +5 -0
  43. widgets/features/tpl/default.php +50 -47
  44. widgets/google-map/google-map.php +23 -4
  45. widgets/google-map/js/js-map.js +73 -47
  46. widgets/google-map/js/js-map.min.js +1 -1
  47. widgets/google-map/tpl/static-map.php +7 -0
  48. widgets/headline/headline.php +32 -0
  49. widgets/headline/styles/default.less +16 -0
  50. widgets/headline/tpl/default.php +20 -2
  51. widgets/image-grid/js/image-grid.js +38 -32
  52. widgets/image-grid/js/image-grid.min.js +1 -1
  53. widgets/image/image.php +12 -1
  54. widgets/layout-slider/layout-slider.php +13 -0
  55. widgets/post-carousel/tpl/base.php +2 -2
  56. widgets/simple-masonry/js/simple-masonry.js +71 -65
  57. widgets/simple-masonry/js/simple-masonry.min.js +1 -1
  58. widgets/simple-masonry/simple-masonry.php +1 -1
  59. widgets/simple-masonry/tpl/default.php +29 -17
  60. widgets/social-media-buttons/js/social-media-buttons-admin.js +13 -11
  61. widgets/social-media-buttons/js/social-media-buttons-admin.min.js +1 -1
  62. widgets/social-media-buttons/social-media-buttons.php +8 -0
  63. widgets/social-media-buttons/tpl/default.php +3 -1
  64. widgets/taxonomy/taxonomy.php +6 -0
  65. widgets/taxonomy/tpl/default.php +1 -2
  66. widgets/video/js/so-video-widget.js +11 -4
  67. widgets/video/js/so-video-widget.min.js +1 -1
  68. widgets/video/video.php +18 -16
base/base.php CHANGED
@@ -105,7 +105,7 @@ function siteorigin_widget_get_font($font_value) {
105
$font['weight'] = $font_parts[1];
106
$font_url_param .= ':' . $font_parts[1];
107
}
108
- $font['css_import'] = '@import url(http' . ( is_ssl() ? 's' : '' ) . '://fonts.googleapis.com/css?family=' . $font_url_param . ');';
109
}
110
else {
111
$font['family'] = $font_value;
@@ -232,4 +232,4 @@ function siteorigin_widgets_get_measurements_list() {
232
233
// Allow themes and plugins to trim or enhance the list.
234
return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
235
- }
105
$font['weight'] = $font_parts[1];
106
$font_url_param .= ':' . $font_parts[1];
107
}
108
+ $font['css_import'] = '@import url(https://fonts.googleapis.com/css?family=' . $font_url_param . ');';
109
}
110
else {
111
$font['family'] = $font_value;
232
233
// Allow themes and plugins to trim or enhance the list.
234
return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
235
+ }
base/inc/actions.php CHANGED
@@ -65,9 +65,15 @@ function siteorigin_widget_search_posts_action(){
65
66
// Get all public post types, besides attachments
67
$post_types = (array) get_post_types( array(
68
- 'public' => true
69
) );
70
- unset($post_types['attachment']);
71
72
$post_types = apply_filters( 'siteorigin_widgets_search_posts_post_types', $post_types );
73
65
66
// Get all public post types, besides attachments
67
$post_types = (array) get_post_types( array(
68
+ 'public' => true,
69
+ 'publicly_queryable' => true
70
) );
71
+
72
+ if ( ! empty( $_REQUEST['postTypes'] ) ) {
73
+ $post_types = array_intersect( explode( ',', $_REQUEST['postTypes'] ), $post_types );
74
+ } else {
75
+ unset( $post_types['attachment'] );
76
+ }
77
78
$post_types = apply_filters( 'siteorigin_widgets_search_posts_post_types', $post_types );
79
base/inc/fields/css/icon-field.css CHANGED
@@ -12,7 +12,7 @@
12
-webkit-border-radius: 3px;
13
-moz-border-radius: 3px;
14
border-radius: 3px;
15
- float: left;
16
border: 1px solid #bbbbbb;
17
height: 35px;
18
}
@@ -59,9 +59,8 @@
59
}
60
.siteorigin-widget-form .siteorigin-widget-field-type-icon .so-icon-remove {
61
cursor: pointer;
62
- display: block;
63
text-decoration: none;
64
- float: left;
65
color: #AAA;
66
font-size: 11px;
67
line-height: 1em;
12
-webkit-border-radius: 3px;
13
-moz-border-radius: 3px;
14
border-radius: 3px;
15
+ vertical-align: middle;
16
border: 1px solid #bbbbbb;
17
height: 35px;
18
}
59
}
60
.siteorigin-widget-form .siteorigin-widget-field-type-icon .so-icon-remove {
61
cursor: pointer;
62
+ display: inline-block;
63
text-decoration: none;
64
color: #AAA;
65
font-size: 11px;
66
line-height: 1em;
base/inc/fields/css/media-field.css CHANGED
@@ -118,7 +118,7 @@
118
padding: 4px 8px;
119
margin-top: 2px !important;
120
margin-left: 25px !important;
121
- width: 320px !important;
122
}
123
#so-widgets-image-search-frame {
124
position: absolute;
118
padding: 4px 8px;
119
margin-top: 2px !important;
120
margin-left: 25px !important;
121
+ max-width: 320px;
122
}
123
#so-widgets-image-search-frame {
124
position: absolute;
base/inc/fields/icon.class.php CHANGED
@@ -18,7 +18,7 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
18
<label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
19
</div>
20
21
- <a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
22
23
<div class="clear"></div>
24
18
<label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
19
</div>
20
21
+ <a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
22
23
<div class="clear"></div>
24
base/inc/fields/js/tinymce-field.js CHANGED
@@ -21,9 +21,9 @@
21
if (id.indexOf('__i__') > -1) return;
22
var mceSettings = $container.data('mceSettings');
23
var widgetIdBase = $container.data('widgetIdBase');
24
- var name = $textarea.attr('name').replace(/\[\d+\]/g, '');
25
var fieldName = /[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(name)[1];
26
- var idPattern = new RegExp('widget-' + widgetIdBase + '-.*-' + fieldName.replace(/\]\[/g, '-') + '[-\d]*');
27
for (var initId in tinyMCEPreInit.mceInit) {
28
if (initId.match(idPattern)) {
29
mceSettings = $.extend({}, tinyMCEPreInit.mceInit[initId], mceSettings);
@@ -50,11 +50,6 @@
50
}
51
}
52
);
53
- $textarea.on('keyup',
54
- function () {
55
- editor.setContent(window.switchEditors.wpautop($textarea.val()));
56
- }
57
- );
58
};
59
mceSettings = $.extend({}, mceSettings, {selector: '#' + id, setup: setupEditor});
60
tinyMCEPreInit.mceInit[id] = mceSettings;
@@ -81,10 +76,25 @@
81
quicktags(tinyMCEPreInit.qtInit[id]);
82
83
$(this).on( 'click', function(event) {
84
-
85
var $target = $(event.target);
86
if ( $target.hasClass( 'wp-switch-editor' ) ) {
87
- mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
88
$(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
89
}
90
});
21
if (id.indexOf('__i__') > -1) return;
22
var mceSettings = $container.data('mceSettings');
23
var widgetIdBase = $container.data('widgetIdBase');
24
+ var name = $textarea.attr('name').replace(/\[\d*\]/g, '');
25
var fieldName = /[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(name)[1];
26
+ var idPattern = new RegExp('widget-' + widgetIdBase + '-?.*-' + fieldName.replace(/\]\[/g, '-') + '[-\d]*');
27
for (var initId in tinyMCEPreInit.mceInit) {
28
if (initId.match(idPattern)) {
29
mceSettings = $.extend({}, tinyMCEPreInit.mceInit[initId], mceSettings);
50
}
51
}
52
);
53
};
54
mceSettings = $.extend({}, mceSettings, {selector: '#' + id, setup: setupEditor});
55
tinyMCEPreInit.mceInit[id] = mceSettings;
76
quicktags(tinyMCEPreInit.qtInit[id]);
77
78
$(this).on( 'click', function(event) {
79
+
80
var $target = $(event.target);
81
if ( $target.hasClass( 'wp-switch-editor' ) ) {
82
+ mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
83
+ if ( mode == 'tmce') {
84
+ // Quick bit of sanitization to prevent catastrophic backtracking in TinyMCE HTML parser regex
85
+ var editor = tinymce.get(id);
86
+ if (editor != null) {
87
+ var content = $textarea.val();
88
+ if (content.search('<') != -1) {
89
+ if (content.search('>') == -1) {
90
+ content = content.replace(/</g, '');
91
+ $textarea.val(content);
92
+ }
93
+ }
94
+ editor.setContent(window.switchEditors.wpautop(content));
95
+ }
96
+ }
97
+
98
$(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
99
}
100
});
base/inc/fields/js/tinymce-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),o=r.attr("id");if("undefined"!=typeof tinymce){if(o.indexOf("__i__")>-1)return;var d=n.data("mceSettings"),s=n.data("widgetIdBase"),a=r.attr("name").replace(/\[\d+\]/g,""),c=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(a)[1],f=new RegExp("widget-"+s+"-.*-"+c.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(d=e.extend({},tinyMCEPreInit.mceInit[g],d));var m,l=tinymce.get(o);null!=l&&(m=l.getContent(),l.remove());var u=function(e){e.on("change",function(){tinymce.get(o).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){m&&e.setContent(m)}),r.on("keyup",function(){e.setContent(window.switchEditors.wpautop(r.val()))})};d=e.extend({},d,{selector:"#"+o,setup:u}),tinyMCEPreInit.mceInit[o]=d;var y=n.find("div#wp-"+o+"-wrap");if(y.hasClass("tmce-active"))if(e("#"+o).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[o]);else var p=setInterval(function(){e("#"+o).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[o]),clearInterval(p))},500)}var I=n.data("qtSettings");I=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],I,{id:o}),tinyMCEPreInit.qtInit[o]=I,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[o]),e(this).on("click",function(t){var i=e(t.target);i.hasClass("wp-switch-editor")&&(mode=i.hasClass("switch-tmce")?"tmce":"html",e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(mode))})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
1
+ !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var o=n.data("mceSettings"),s=n.data("widgetIdBase"),d=r.attr("name").replace(/\[\d*\]/g,""),c=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(d)[1],f=new RegExp("widget-"+s+"-?.*-"+c.replace(/\]\[/g,"-")+"[-d]*");for(var m in tinyMCEPreInit.mceInit)m.match(f)&&(o=e.extend({},tinyMCEPreInit.mceInit[m],o));var g,l=tinymce.get(a);null!=l&&(g=l.getContent(),l.remove());var u=function(e){e.on("change",function(){tinymce.get(a).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){g&&e.setContent(g)})};o=e.extend({},o,{selector:"#"+a,setup:u}),tinyMCEPreInit.mceInit[a]=o;var y=n.find("div#wp-"+a+"-wrap");if(y.hasClass("tmce-active"))if(e("#"+a).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[a]);else var p=setInterval(function(){e("#"+a).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[a]),clearInterval(p))},500)}var I=n.data("qtSettings");I=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],I,{id:a}),tinyMCEPreInit.qtInit[a]=I,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[a]),e(this).on("click",function(t){var i=e(t.target);if(i.hasClass("wp-switch-editor")){if(mode=i.hasClass("switch-tmce")?"tmce":"html","tmce"==mode){var n=tinymce.get(a);if(null!=n){var o=r.val();o.search("<")!=-1&&o.search(">")==-1&&(o=o.replace(/</g,""),r.val(o)),n.setContent(window.switchEditors.wpautop(o))}}e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(mode)}})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
base/inc/fields/link.class.php CHANGED
@@ -5,19 +5,28 @@
5
*/
6
class SiteOrigin_Widget_Field_Link extends SiteOrigin_Widget_Field_Text_Input_Base {
7
8
protected function render_before_field( $value, $instance ) {
9
parent::render_before_field( $value, $instance );
10
?>
11
- <a href="#" class="select-content-button button-secondary"><?php esc_html_e('Select Content', 'so-widgets-bundle') ?></a>
12
<div class="existing-content-selector">
13
14
<input type="text" class="content-text-search"
15
- placeholder="<?php esc_attr_e('Search Content', 'so-widgets-bundle') ?>"/>
16
17
<ul class="posts"></ul>
18
19
<div class="buttons">
20
- <a href="#" class="button-close button-secondary"><?php esc_html_e('Close', 'so-widgets-bundle') ?></a>
21
</div>
22
</div>
23
<div class="url-input-wrapper">
@@ -33,14 +42,14 @@ class SiteOrigin_Widget_Field_Link extends SiteOrigin_Widget_Field_Text_Input_Ba
33
34
protected function sanitize_field_input( $value, $instance ) {
35
$sanitized_value = trim( $value );
36
- if( preg_match( '/^post\: *([0-9]+)/', $sanitized_value, $matches ) ) {
37
$sanitized_value = 'post: ' . $matches[1];
38
- }
39
- else {
40
$sanitized_value = sow_esc_url_raw( $sanitized_value );
41
}
42
return $sanitized_value;
43
}
44
45
46
- }
5
*/
6
class SiteOrigin_Widget_Field_Link extends SiteOrigin_Widget_Field_Text_Input_Base {
7
8
+ /**
9
+ * An array of post types to use in the query for posts when the 'Select Content' button is clicked.
10
+ *
11
+ * @access protected
12
+ * @var array
13
+ */
14
+ protected $post_types;
15
+
16
protected function render_before_field( $value, $instance ) {
17
parent::render_before_field( $value, $instance );
18
?>
19
+ <a href="#" class="select-content-button button button-small"><?php esc_html_e('Select Content', 'so-widgets-bundle') ?></a>
20
<div class="existing-content-selector">
21
22
<input type="text" class="content-text-search"
23
+ data-post-types="<?php echo esc_attr( implode( ',', $this->post_types ) ) ?>"
24
+ placeholder="<?php esc_attr_e( 'Search Content', 'so-widgets-bundle' ) ?>"/>
25
26
<ul class="posts"></ul>
27
28
<div class="buttons">
29
+ <a href="#" class="button-close button"><?php esc_html_e('Close', 'so-widgets-bundle') ?></a>
30
</div>
31
</div>
32
<div class="url-input-wrapper">
42
43
protected function sanitize_field_input( $value, $instance ) {
44
$sanitized_value = trim( $value );
45
+ if ( preg_match( '/^post\: *([0-9]+)/', $sanitized_value, $matches ) ) {
46
$sanitized_value = 'post: ' . $matches[1];
47
+ } else {
48
$sanitized_value = sow_esc_url_raw( $sanitized_value );
49
}
50
+
51
return $sanitized_value;
52
}
53
54
55
+ }
base/inc/fields/media.class.php CHANGED
@@ -83,6 +83,11 @@ class SiteOrigin_Widget_Field_Media extends SiteOrigin_Widget_Field_Base {
83
else{
84
$src = array( '', 0, 0 );
85
}
86
?>
87
<div class="media-field-wrapper">
88
<div class="current">
83
else{
84
$src = array( '', 0, 0 );
85
}
86
+
87
+ // If library is set to all, convert it to a wildcard as all isn't valid
88
+ if( $this->library == 'all' ){
89
+ $this->library = '*';
90
+ }
91
?>
92
<div class="media-field-wrapper">
93
<div class="current">
base/inc/fields/radio.class.php CHANGED
@@ -14,15 +14,16 @@ class SiteOrigin_Widget_Field_Radio extends SiteOrigin_Widget_Field_Base {
14
15
protected function render_field( $value, $instance ) {
16
if ( ! isset( $this->options ) || empty( $this->options ) ) return;
17
-
18
foreach( $this->options as $k => $v ) {
19
?>
20
- <label for="<?php echo esc_attr( $this->element_id . '-' . $k ) ?>">
21
<input type="radio" name="<?php echo esc_attr( $this->element_name ) ?>"
22
- id="<?php echo esc_attr( $this->element_id . '-' . $k ) ?>" class="siteorigin-widget-input"
23
value="<?php echo esc_attr( $k ) ?>" <?php checked( $k, $value ) ?>> <?php echo esc_html( $v ) ?>
24
</label>
25
<?php
26
}
27
}
28
@@ -33,4 +34,4 @@ class SiteOrigin_Widget_Field_Radio extends SiteOrigin_Widget_Field_Base {
33
return $sanitized_value;
34
}
35
36
- }
14
15
protected function render_field( $value, $instance ) {
16
if ( ! isset( $this->options ) || empty( $this->options ) ) return;
17
+ $i = 0;
18
foreach( $this->options as $k => $v ) {
19
?>
20
+ <label for="<?php echo esc_attr( $this->element_id . '-' . $i ) ?>">
21
<input type="radio" name="<?php echo esc_attr( $this->element_name ) ?>"
22
+ id="<?php echo esc_attr( $this->element_id . '-' . $i ) ?>" class="siteorigin-widget-input"
23
value="<?php echo esc_attr( $k ) ?>" <?php checked( $k, $value ) ?>> <?php echo esc_html( $v ) ?>
24
</label>
25
<?php
26
+ $i += 1;
27
}
28
}
29
34
return $sanitized_value;
35
}
36
37
+ }
base/inc/lessc.inc.php CHANGED
@@ -51,7 +51,7 @@ class lessc {
51
public $parentSelector = '&';
52
53
public $importDisabled = false;
54
- public $importDir = '';
55
56
protected $numberPrecision = null;
57
51
public $parentSelector = '&';
52
53
public $importDisabled = false;
54
+ public $importDir = array();
55
56
protected $numberPrecision = null;
57
base/inc/post-selector.php CHANGED
@@ -93,6 +93,11 @@ function siteorigin_widget_post_selector_process_query($query){
93
}
94
unset( $query['sticky'] );
95
}
96
97
if ( ! empty( $query['additional'] ) ) {
98
$query = wp_parse_args( $query['additional'], $query );
@@ -105,7 +110,7 @@ function siteorigin_widget_post_selector_process_query($query){
105
}
106
}
107
108
- return $query;
109
}
110
111
function siteorigin_widget_post_selector_form_fields(){
@@ -128,7 +133,7 @@ function siteorigin_widget_post_selector_form_fields(){
128
$return['post__in'] = '';
129
$return['post__in'] .= '<label><span>' . __('Post in', 'so-widgets-bundle') . '</span>';
130
$return['post__in'] .= '<input type="text" name="post__in" class="" />';
131
- $return['post__in'] .= ' <a href="#" class="sow-select-posts button button-secondary">' . __('Select posts', 'so-widgets-bundle') . '</a>';
132
$return['post__in'] .= '</label>';
133
134
// The taxonomy field
93
}
94
unset( $query['sticky'] );
95
}
96
+
97
+ // Exclude the current post (if applicable) to avoid any issues associated with showing the same post again
98
+ if( get_the_id() != false ){
99
+ $query['post__not_in'][] = get_the_id();
100
+ }
101
102
if ( ! empty( $query['additional'] ) ) {
103
$query = wp_parse_args( $query['additional'], $query );
110
}
111
}
112
113
+ return apply_filters( 'siteorigin_widgets_posts_selector_query', $query );
114
}
115
116
function siteorigin_widget_post_selector_form_fields(){
133
$return['post__in'] = '';
134
$return['post__in'] .= '<label><span>' . __('Post in', 'so-widgets-bundle') . '</span>';
135
$return['post__in'] .= '<input type="text" name="post__in" class="" />';
136
+ $return['post__in'] .= ' <a href="#" class="sow-select-posts button button-small">' . __('Select posts', 'so-widgets-bundle') . '</a>';
137
$return['post__in'] .= '</label>';
138
139
// The taxonomy field
base/inc/widget-manager.class.php CHANGED
@@ -117,6 +117,7 @@ class SiteOrigin_Widgets_Widget_Manager {
117
* @return mixed
118
*/
119
function get_class_from_path( $path ) {
120
foreach( $this->registered as $id => $r ) {
121
if( $r->path == $path ) return $r->class;
122
}
117
* @return mixed
118
*/
119
function get_class_from_path( $path ) {
120
+ $path = realpath( $path );
121
foreach( $this->registered as $id => $r ) {
122
if( $r->path == $path ) return $r->class;
123
}
base/js/admin.js CHANGED
@@ -175,7 +175,13 @@
175
$el.find('.siteorigin-widget-field-repeater-item').sowSetupRepeaterItems();
176
177
// Set up any color fields
178
- $fields.find('> .siteorigin-widget-input-color').wpColorPicker();
179
180
///////////////////////////////////////
181
// Handle the sections
@@ -203,6 +209,7 @@
203
value: parseInt( $input.val() ),
204
slide: function( event, ui ) {
205
$input.val( parseInt(ui.value) );
206
$.find('.siteorigin-widget-slider-value').html( ui.value );
207
}
208
});
@@ -221,12 +228,14 @@
221
request.abort();
222
}
223
224
- var query = $.find('.content-text-search').val();
225
226
var $ul = $.find('ul.posts').empty().addClass('loading');
227
$.get(
228
soWidgets.ajaxurl,
229
- { action: 'so_widgets_search_posts', query: query },
230
function(data){
231
for( var i = 0; i < data.length; i++ ) {
232
if( data[i].post_title === '' ) {
@@ -521,6 +530,16 @@
521
$in.attr('name', newName);
522
}
523
});
524
525
//Setup scrolling.
526
var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
@@ -704,11 +723,46 @@
704
}
705
}
706
if(id) {
707
- var idBase = id.replace(/-\d+#x2F;, '');
708
- if (!newIds[idBase]) {
709
- newIds[idBase] = $form.find('.siteorigin-widget-input[id^=' + idBase + ']').not('[id*=_id_]').length + 1;
710
- }
711
- var newId = idBase + '-' + newIds[idBase]++;
712
$inputElement.attr('id', newId);
713
$copyItem.find('label[for=' + id + ']').attr('for', newId);
714
$copyItem.find('[id*=' + id + ']').each(function() {
175
$el.find('.siteorigin-widget-field-repeater-item').sowSetupRepeaterItems();
176
177
// Set up any color fields
178
+ $fields.find('> .siteorigin-widget-input-color').wpColorPicker( {
179
+ change: function(event, ui) {
180
+ setTimeout(function() {
181
+ $(event.target).trigger('change');
182
+ }, 100);
183
+ }
184
+ } );
185
186
///////////////////////////////////////
187
// Handle the sections
209
value: parseInt( $input.val() ),
210
slide: function( event, ui ) {
211
$input.val( parseInt(ui.value) );
212
+ $input.trigger( 'change' );
213
$.find('.siteorigin-widget-slider-value').html( ui.value );
214
}
215
});
228
request.abort();
229
}
230
231
+ var $contentSearchInput = $.find('.content-text-search');
232
+ var query = $contentSearchInput.val();
233
+ var postTypes = $contentSearchInput.data('postTypes');
234
235
var $ul = $.find('ul.posts').empty().addClass('loading');
236
$.get(
237
soWidgets.ajaxurl,
238
+ { action: 'so_widgets_search_posts', query: query, postTypes: postTypes },
239
function(data){
240
for( var i = 0; i < data.length; i++ ) {
241
if( data[i].post_title === '' ) {
530
$in.attr('name', newName);
531
}
532
});
533
+
534
+ if( ! $.data('initialSetup') ) {
535
+ // Setup default checked values, now that we've updated input names.
536
+ // Without this radio inputs in repeaters will be rendered as if they all belong to the same group.
537
+ $.find('.siteorigin-widget-input').each(function(i, input) {
538
+ var $in = $(input);
539
+ $in.prop('checked', $in.prop('defaultChecked'));
540
+ });
541
+ $.data('initialSetup', true);
542
+ }
543
544
//Setup scrolling.
545
var scrollCount = $el.data('scroll-count') ? parseInt($el.data('scroll-count')) : 0;
723
}
724
}
725
if(id) {
726
+ var idRegExp;
727
+ var idBase;
728
+ var newId;
729
+
730
+ // Radio inputs are slightly different because there are multiple `input` elements for
731
+ // a single field, i.e. multiple `inputs` for selecting a single value.
732
+ if( $inputElement.is('[type="radio"]') ) {
733
+ // Radio inputs have their position appended to the id.
734
+ idBase = id.replace(/-\d+-\d+#x2F;, '');
735
+ var radioIdBase = id.replace(/-\d+#x2F;, '');
736
+ if (!newIds[idBase]) {
737
+ var radioNames = {};
738
+ newIds[idBase] = $form
739
+ // find all inputs containing idBase in their id attribute
740
+ .find('.siteorigin-widget-input[id^=' + idBase + ']')
741
+ // exclude inputs from templates
742
+ .not('[id*=_id_]')
743
+ // reduce to one element per radio input group.
744
+ .filter(function(index, element) {
745
+ var eltName = $(element).attr('name');
746
+ if(radioNames[eltName]) {
747
+ return false;
748
+ } else {
749
+ radioNames[eltName] = true;
750
+ return true;
751
+ }
752
+ }).length + 1;
753
+ }
754
+ var newRadioIdBase = idBase + '-' + newIds[idBase];
755
+ newId = newRadioIdBase + id.match(/-\d+#x2F;)[0];
756
+ $copyItem.find('label[for=' + radioIdBase + ']').attr('for', newRadioIdBase);
757
+ } else {
758
+ idRegExp = new RegExp('-\\d+#x27;);
759
+ idBase = id.replace(idRegExp, '');
760
+ if (!newIds[idBase]) {
761
+ newIds[idBase] = $form.find('.siteorigin-widget-input[id^=' + idBase + ']').not('[id*=_id_]').length + 1;
762
+ }
763
+ newId = idBase + '-' + newIds[idBase]++;
764
+ }
765
+
766
$inputElement.attr('id', newId);
767
$copyItem.find('label[for=' + id + ']').attr('for', newId);
768
$copyItem.find('[id*=' + id + ']').each(function() {
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,r,a=e(t),s=!0,o=a.find("input[name]");if(o.length&&o.attr("name").indexOf("__i__")!==-1)return this;if(a.is(".siteorigin-widget-form-main")){if(a.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!a.is(":visible")&&0===a.closest(".panel-dialog").length)return!0;a.on("sowstatechange",function(i,t,n){a.find("[data-state-handler]").each(function(){var i=e(this),r=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(r).length)return!0;var a,o,d,l,f,g,p={},c=window.sowForms.getRepeaterId(i);if(c!==!1){var u={};for(var w in r)u[w.replace("{$repeater}",c)]=r[w];r=u}for(var w in r)if(f=!1,a=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?#x2F;),null!==a){if(o={group:"default",name:"",multi:!1},void 0!==a[2]?(o.group=a[1],o.name=a[3]):o.name=a[0],o.multi=void 0!==a[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof p[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var m=0;m<g.length&&!(f=o.group===t&&g[m]===n);m++);}if(f){d=r[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][2]:[]);p[o.group]=!0}}})}),a.sowSetupPreview(),n=a;var d=a.find(".siteorigin-widget-teaser");d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),console.log(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})})}else n=a.closest(".siteorigin-widget-form-main");r=n.find("> .siteorigin-widgets-form-id").val();var l=a.find("> .siteorigin-widget-field");l.find("> .siteorigin-widget-section").sowSetupForm(),l.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),l.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),l.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),a.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),l.find("> .siteorigin-widget-input-color").wpColorPicker(),l.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})}),l.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),l.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search").val(),r=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title="&nbsp;"),r.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));r.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var r=i.find(".existing-content-selector");r.toggle(),r.is(":visible")&&0===r.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var r=null;i.find(".content-text-search").keyup(function(){null!==r&&clearTimeout(r),r=setTimeout(function(){n()},500)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&l.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var r=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var r=window.sowForms.getRepeaterId(i);return r!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",r)})),e.extend(n,sowEmitters[t.callback](i.val(),t.args))},a={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=r(t[s],a);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in a)"undefined"!=typeof o[d]&&a[d]===o[d]||(o[d]=a[d],n.trigger("sowstatechange",[d,a[d]]));n.data("states",o)}};l.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),a.trigger("sowsetupform",l).data("sow-form-setup",!0),l.trigger("sowsetupformfield"),a.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var r=t.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var a=n,s=0;s<r.length;s++)if(s===r.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?a[r[s]]=""===i.val()||i.val():a[r[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(a[r[s]]=""===i.val()||i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?a[r[s]]=i.val():a[r[s]]=o.getContent()}else a[r[s]]=i.val();else"undefined"==typeof a[r[s]]&&(a[r[s]]={}),a=a[r[s]]});var r=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");r.find('input[name="data"]').val(JSON.stringify(n)),r.find('input[name="class"]').val(i.data("class")),r.find("iframe").on("load",function(){e(this).css("visibility","visible")}),r.find("form").submit(),r.find(".close").click(function(){r.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),r=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");r.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var r=e(n).data("repeater-positions");"undefined"==typeof r&&(r={}),r[a]=i,e(n).data("repeater-positions",r)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),r=e(t);if("undefined"!=typeof n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}});var r=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(r>0&&t.length>r){var s=t.first().outerHeight();i.css("max-height",s*r).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),r.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){r.trigger("updateFieldPositions")}}),r.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),r=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=a.html().replace(/_id_/g,r),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var r=n.closest(".siteorigin-widget-field-repeater"),a=n.find("> .siteorigin-widget-field-repeater-item-top"),s=r.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=r.clone(),s=r.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),p=i.closest(".siteorigin-widget-field");g.remove(),p.append(i.remove())}else{var c=r.find('[name="'+l+'"]');c.length&&null!=c.val()&&i.val(c.val())}if(s){var u=s.replace(/-\d+#x2F;,"");d[u]||(d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").length+1);var w=u+"-"+d[u]++;i.attr("id",w),a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var m=r.parents(".siteorigin-widget-field-repeater").length,h=e("body");(h.hasClass("wp-customizer")||h.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(m+=1);var v=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",v),i.data("original-name",v)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var r=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=r.split("]["),s=a.length?n:null;a.length;)s=s[a.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *quot;),n=t.exec(e);if(null===n)return!1;var r="",a="default";return void 0!==n[3]?(a=n[1],r=n[3]):r=n[1],{match:n[4].trim(),group:a,state:r}},_checker:function(e,i,t,n){var r={};"undefined"==typeof i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)a=sowEmitters._match(i[s],t),a!==!1&&("_true"===a.match||n(e,i,a.match))&&(r[a.group]=a.state);return r},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};
1
+ !function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,r,a=e(t),s=!0,o=a.find("input[name]");if(o.length&&o.attr("name").indexOf("__i__")!==-1)return this;if(a.is(".siteorigin-widget-form-main")){if(a.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!a.is(":visible")&&0===a.closest(".panel-dialog").length)return!0;a.on("sowstatechange",function(i,t,n){a.find("[data-state-handler]").each(function(){var i=e(this),r=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(r).length)return!0;var a,o,d,l,f,g,p={},c=window.sowForms.getRepeaterId(i);if(c!==!1){var u={};for(var w in r)u[w.replace("{$repeater}",c)]=r[w];r=u}for(var w in r)if(f=!1,a=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?#x2F;),null!==a){if(o={group:"default",name:"",multi:!1},void 0!==a[2]?(o.group=a[1],o.name=a[3]):o.name=a[0],o.multi=void 0!==a[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof p[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var m=0;m<g.length&&!(f=o.group===t&&g[m]===n);m++);}if(f){d=r[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][2]:[]);p[o.group]=!0}}})}),a.sowSetupPreview(),n=a;var d=a.find(".siteorigin-widget-teaser");d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),console.log(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})})}else n=a.closest(".siteorigin-widget-form-main");r=n.find("> .siteorigin-widgets-form-id").val();var l=a.find("> .siteorigin-widget-field");l.find("> .siteorigin-widget-section").sowSetupForm(),l.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),l.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),l.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),a.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),l.find("> .siteorigin-widget-input-color").wpColorPicker({change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}}),l.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})}),l.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),l.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search"),r=n.val(),a=n.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title="&nbsp;"),s.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var r=i.find(".existing-content-selector");r.toggle(),r.is(":visible")&&0===r.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var r=null;i.find(".content-text-search").keyup(function(){null!==r&&clearTimeout(r),r=setTimeout(function(){n()},500)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&l.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var r=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var r=window.sowForms.getRepeaterId(i);return r!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",r)})),e.extend(n,sowEmitters[t.callback](i.val(),t.args))},a={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=r(t[s],a);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in a)"undefined"!=typeof o[d]&&a[d]===o[d]||(o[d]=a[d],n.trigger("sowstatechange",[d,a[d]]));n.data("states",o)}};l.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),a.trigger("sowsetupform",l).data("sow-form-setup",!0),l.trigger("sowsetupformfield"),a.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var r=t.split("][");r=r.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var a=n,s=0;s<r.length;s++)if(s===r.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?a[r[s]]=""===i.val()||i.val():a[r[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(a[r[s]]=""===i.val()||i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?a[r[s]]=i.val():a[r[s]]=o.getContent()}else a[r[s]]=i.val();else"undefined"==typeof a[r[s]]&&(a[r[s]]={}),a=a[r[s]]});var r=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");r.find('input[name="data"]').val(JSON.stringify(n)),r.find('input[name="class"]').val(i.data("class")),r.find("iframe").on("load",function(){e(this).css("visibility","visible")}),r.find("form").submit(),r.find(".close").click(function(){r.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),r=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");r.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var r=e(n).data("repeater-positions");"undefined"==typeof r&&(r={}),r[a]=i,e(n).data("repeater-positions",r)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),r=e(t);if("undefined"!=typeof n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t);n.prop("checked",n.prop("defaultChecked"))}),i.data("initialSetup",!0));var r=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(r>0&&t.length>r){var s=t.first().outerHeight();i.css("max-height",s*r).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),r.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){r.trigger("updateFieldPositions")}}),r.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),r=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=a.html().replace(/_id_/g,r),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var r=n.closest(".siteorigin-widget-field-repeater"),a=n.find("> .siteorigin-widget-field-repeater-item-top"),s=r.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(window).resize(),e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),r=e(this).closest(".siteorigin-widget-field-repeater-item"),a=r.clone(),s=r.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),p=i.closest(".siteorigin-widget-field");g.remove(),p.append(i.remove())}else{var c=r.find('[name="'+l+'"]');c.length&&null!=c.val()&&i.val(c.val())}if(s){var u,w,m;if(i.is('[type="radio"]')){w=s.replace(/-\d+-\d+#x2F;,"");var h=s.replace(/-\d+#x2F;,"");if(!d[w]){var v={};d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").filter(function(i,t){var n=e(t).attr("name");return!v[n]&&(v[n]=!0,!0)}).length+1}var y=w+"-"+d[w];m=y+s.match(/-\d+#x2F;)[0],a.find("label[for="+h+"]").attr("for",y)}else u=new RegExp("-\\d+quot;),w=s.replace(u,""),d[w]||(d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").length+1),m=w+"-"+d[w]++;i.attr("id",m),a.find("label[for="+s+"]").attr("for",m),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,m);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var b=r.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(b+=1);var k=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(b-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",k),i.data("original-name",k)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var r=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=r.split("]["),s=a.length?n:null;a.length;)s=s[a.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *quot;),n=t.exec(e);if(null===n)return!1;var r="",a="default";return void 0!==n[3]?(a=n[1],r=n[3]):r=n[1],{match:n[4].trim(),group:a,state:r}},_checker:function(e,i,t,n){var r={};"undefined"==typeof i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)a=sowEmitters._match(i[s],t),a!==!1&&("_true"===a.match||n(e,i,a.match))&&(r[a.group]=a.state);return r},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};
base/siteorigin-widget.class.php CHANGED
@@ -228,7 +228,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
228
/**
229
* Generate the CSS for this widget and display it in the appropriate way
230
*
231
- * @param $instance The instance array
232
*
233
* @return string The CSS name
234
*/
@@ -426,7 +426,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
426
<?php $this->scripts_loading_message() ?>
427
</div>
428
429
- <?php if( $this->widget_options['has_preview'] && ! $this->is_customize_preview() ) : ?>
430
<div class="siteorigin-widget-preview" style="display: none">
431
<a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e('Preview', 'so-widgets-bundle') ?></a>
432
</div>
@@ -454,7 +454,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
454
</script>
455
<?php
456
457
- $this->enqueue_scripts( );
458
}
459
460
/**
@@ -465,6 +465,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
465
method_exists( $this, 'get_form_teaser' ) &&
466
( $teaser = $this->get_form_teaser() )
467
) {
468
$dismissed = get_user_meta( get_current_user_id(), 'teasers_dismissed', true );
469
if( empty( $dismissed[ $this->id_base ] ) ) {
470
$dismiss_url = add_query_arg( array(
@@ -505,7 +509,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
505
*
506
* @param bool|string $form_type Should we enqueue the field scripts too?
507
*/
508
- function enqueue_scripts( $form_type = false ){
509
510
if( ! wp_script_is('siteorigin-widget-admin') ) {
511
wp_enqueue_style( 'wp-color-picker' );
@@ -785,7 +789,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
785
//handle less @import statements
786
$less = preg_replace_callback( '/^@import\s+".*?\/?([\w-\.]+)";/m', array( $this, 'get_less_import_contents' ), $less );
787
788
- $vars = $this->get_less_variables($instance);
789
if( !empty( $vars ) ){
790
foreach($vars as $name => $value) {
791
// Ignore empty string, false and null values (but keep '0')
@@ -922,6 +926,8 @@ abstract class SiteOrigin_Widget extends WP_Widget {
922
if( empty( $instance ) ) return;
923
924
$fonts = $this->get_google_font_fields($instance);
925
$font_imports = array();
926
927
foreach ( $fonts as $font ) {
@@ -934,10 +940,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
934
}
935
936
// Remove empty and duplicate items from the array
937
- $import_strings = array_filter($import_strings);
938
- $import_strings = array_unique($import_strings);
939
940
- return implode("\n", $import_strings);
941
}
942
943
/**
@@ -960,7 +966,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
960
*/
961
public function so_get_field_name( $field_name, $container = array() ) {
962
if( empty($container) ) {
963
- return $this->get_field_name( $field_name );
964
}
965
else {
966
// We also need to add the container fields
@@ -975,8 +981,12 @@ abstract class SiteOrigin_Widget extends WP_Widget {
975
976
$name = $this->get_field_name( '{{{FIELD_NAME}}}' );
977
$name = str_replace('[{{{FIELD_NAME}}}]', $container_extras.'[' . esc_attr($field_name) . ']', $name);
978
- return $name;
979
}
980
}
981
982
/**
@@ -1032,7 +1042,11 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1032
* @return string
1033
*/
1034
function get_style_hash( $instance ) {
1035
- $vars = method_exists($this, 'get_style_hash_variables') ? $this->get_style_hash_variables( $instance ) : $this->get_less_variables( $instance );
1036
$version = property_exists( $this, 'version' ) ? $this->version : '';
1037
1038
return substr( md5( json_encode( $vars ) . $version ), 0, 12 );
@@ -1204,7 +1218,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1204
* rather register scripts and styles using register_frontend_scripts() and register_frontend_styles(). This function
1205
* will then ensure that the scripts are not enqueued more than once.
1206
*/
1207
- function enqueue_frontend_scripts( $instance ){
1208
$this->enqueue_registered_scripts();
1209
$this->enqueue_registered_styles();
1210
@@ -1224,16 +1238,29 @@ abstract class SiteOrigin_Widget extends WP_Widget {
1224
*
1225
* @return bool
1226
*/
1227
- function is_preview( $instance = array() ){
1228
// Check if the instance is a preview
1229
if( !empty( $instance[ 'is_preview' ] ) ) return true;
1230
1231
// Check if the general request is a preview
1232
- return
1233
is_preview() || // is this a standard preview
1234
$this->is_customize_preview() || // Is this a customizer preview
1235
!empty( $_GET['siteorigin_panels_live_editor'] ) || // Is this a Page Builder live editor request
1236
( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'so_panels_builder_content' ); // Is this a Page Builder content ajax request
1237
}
1238
1239
/**
228
/**
229
* Generate the CSS for this widget and display it in the appropriate way
230
*
231
+ * @param $instance array The instance array
232
*
233
* @return string The CSS name
234
*/
426
<?php $this->scripts_loading_message() ?>
427
</div>
428
429
+ <?php if( $this->show_preview_button() ) : ?>
430
<div class="siteorigin-widget-preview" style="display: none">
431
<a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e('Preview', 'so-widgets-bundle') ?></a>
432
</div>
454
</script>
455
<?php
456
457
+ $this->enqueue_scripts( $form_type );
458
}
459
460
/**
465
method_exists( $this, 'get_form_teaser' ) &&
466
( $teaser = $this->get_form_teaser() )
467
) {
468
+ if ( ! is_admin() ) {
469
+ wp_enqueue_style( 'dashicons' );
470
+ }
471
+
472
$dismissed = get_user_meta( get_current_user_id(), 'teasers_dismissed', true );
473
if( empty( $dismissed[ $this->id_base ] ) ) {
474
$dismiss_url = add_query_arg( array(
509
*
510
* @param bool|string $form_type Should we enqueue the field scripts too?
511
*/
512
+ function enqueue_scripts( $form_type = false ) {
513
514
if( ! wp_script_is('siteorigin-widget-admin') ) {
515
wp_enqueue_style( 'wp-color-picker' );
789
//handle less @import statements
790
$less = preg_replace_callback( '/^@import\s+".*?\/?([\w-\.]+)";/m', array( $this, 'get_less_import_contents' ), $less );
791
792
+ $vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
793
if( !empty( $vars ) ){
794
foreach($vars as $name => $value) {
795
// Ignore empty string, false and null values (but keep '0')
926
if( empty( $instance ) ) return;
927
928
$fonts = $this->get_google_font_fields($instance);
929
+ if( empty( $fonts ) || ! is_array( $fonts ) ) return '';
930
+
931
$font_imports = array();
932
933
foreach ( $fonts as $font ) {
940
}
941
942
// Remove empty and duplicate items from the array
943
+ $import_strings = array_filter( $import_strings );
944
+ $import_strings = array_unique( $import_strings );
945
946
+ return implode( "\n", $import_strings );
947
}
948
949
/**
966
*/
967
public function so_get_field_name( $field_name, $container = array() ) {
968
if( empty($container) ) {
969
+ $name = $this->get_field_name( $field_name );
970
}
971
else {
972
// We also need to add the container fields
981
982
$name = $this->get_field_name( '{{{FIELD_NAME}}}' );
983
$name = str_replace('[{{{FIELD_NAME}}}]', $container_extras.'[' . esc_attr($field_name) . ']', $name);
984
}
985
+
986
+ $name = apply_filters( 'siteorigin_widgets_get_field_name', $name );
987
+ $name = apply_filters( 'siteorigin_widgets_get_field_name_' . $this->id_base, $name );
988
+
989
+ return $name;
990
}
991
992
/**
1042
* @return string
1043
*/
1044
function get_style_hash( $instance ) {
1045
+ if( method_exists( $this, 'get_style_hash_variables' ) ) {
1046
+ $vars = apply_filters( 'siteorigin_widgets_hash_variables_' . $this->id_base, $this->get_style_hash_variables( $instance ), $instance, $this );
1047
+ } else {
1048
+ $vars = apply_filters( 'siteorigin_widgets_less_variables_' . $this->id_base, $this->get_less_variables( $instance ), $instance, $this );
1049
+ }
1050
$version = property_exists( $this, 'version' ) ? $this->version : '';
1051
1052
return substr( md5( json_encode( $vars ) . $version ), 0, 12 );
1218
* rather register scripts and styles using register_frontend_scripts() and register_frontend_styles(). This function
1219
* will then ensure that the scripts are not enqueued more than once.
1220
*/
1221
+ function enqueue_frontend_scripts( $instance ) {
1222
$this->enqueue_registered_scripts();
1223
$this->enqueue_registered_styles();
1224
1238
*
1239
* @return bool
1240
*/
1241
+ function is_preview( $instance = array() ) {
1242
// Check if the instance is a preview
1243
if( !empty( $instance[ 'is_preview' ] ) ) return true;
1244
1245
// Check if the general request is a preview
1246
+ $is_preview =
1247
is_preview() || // is this a standard preview
1248
$this->is_customize_preview() || // Is this a customizer preview
1249
!empty( $_GET['siteorigin_panels_live_editor'] ) || // Is this a Page Builder live editor request
1250
( !empty( $_REQUEST['action'] ) && $_REQUEST['action'] == 'so_panels_builder_content' ); // Is this a Page Builder content ajax request
1251
+
1252
+ return apply_filters( 'siteorigin_widgets_is_preview', $is_preview, $this );
1253
+ }
1254
+
1255
+ /**
1256
+ * Whether or not so show the 'Preview' button
1257
+ *
1258
+ * @return bool
1259
+ */
1260
+ function show_preview_button(){
1261
+ $show_preview = $this->widget_options['has_preview'] && ! $this->is_customize_preview();
1262
+ $show_preview = apply_filters( 'siteorigin_widgets_form_show_preview_button', $show_preview, $this );
1263
+ return $show_preview;
1264
}
1265
1266
/**
compat/beaver-builder/beaver-builder.php ADDED
@@ -0,0 +1,97 @@
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Beaver_Builder {
4
+
5
+ /**
6
+ * Get the singleton instance
7
+ *
8
+ * @return SiteOrigin_Widgets_Bundle_Beaver_Builder
9
+ */
10
+ public static function single() {
11
+ static $single;
12
+ return empty( $single ) ? $single = new self() : $single;
13
+ }
14
+
15
+ function __construct() {
16
+ add_action('wp', array( $this, 'init' ), 9 );
17
+ }
18
+
19
+ function init() {
20
+ if ( ! FLBuilderModel::is_builder_active() ) {
21
+ return;
22
+ }
23
+
24
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ) );
25
+ add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
26
+
27
+ add_filter( 'siteorigin_widgets_get_field_name', array( $this, 'bb_get_field_name' ) );
28
+
29
+ // Don't want to show the form preview button when using Beaver Builder
30
+ add_filter( 'siteorigin_widgets_form_show_preview_button', '__return_false' );
31
+ }
32
+
33
+ function enqueue_active_widgets_scripts() {
34
+ global $wp_widget_factory;
35
+
36
+ // Beaver Builder does it's editing in the front end so enqueue required form scripts for active widgets.
37
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
38
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
39
+ ob_start();
40
+ $widget_obj->form( array() );
41
+ ob_clean();
42
+ }
43
+ }
44
+
45
+ if ( ! wp_script_is( 'wp-color-picker' ) ) {
46
+ // wp-color-picker hasn't been registered because we're in the front end, so enqueue with full args.
47
+ wp_enqueue_script( 'iris', '/wp-admin/js/iris.min.js', array(
48
+ 'jquery-ui-draggable',
49
+ 'jquery-ui-slider',
50
+ 'jquery-touch-punch'
51
+ ), '1.0.7', 1 );
52
+
53
+ wp_enqueue_script( 'wp-color-picker', '/wp-admin/js/color-picker' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'iris' ), false, 1 );
54
+
55
+ wp_enqueue_style( 'wp-color-picker' );
56
+
57
+ // Localization args for when wp-color-picker script hasn't been registered.
58
+ wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', array(
59
+ 'clear' => __( 'Clear', 'so-widgets-bundle' ),
60
+ 'defaultString' => __( 'Default', 'so-widgets-bundle' ),
61
+ 'pick' => __( 'Select Color', 'so-widgets-bundle' ),
62
+ 'current' => __( 'Current Color', 'so-widgets-bundle' ),
63
+ ) );
64
+ }
65
+
66
+ wp_enqueue_style( 'dashicons' );
67
+ wp_enqueue_media();
68
+
69
+ wp_enqueue_style( 'sowb-styles-for-beaver', plugin_dir_url( __FILE__ ) . 'styles.css' );
70
+
71
+ wp_enqueue_script(
72
+ 'sowb-js-for-beaver',
73
+ plugin_dir_url( __FILE__ ) . 'sowb-beaver-builder' . SOW_BUNDLE_JS_SUFFIX . '.js',
74
+ array( 'jquery', 'fl-builder' )
75
+ );
76
+
77
+ wp_enqueue_style( 'siteorigin-widget-admin', plugin_dir_url(SOW_BUNDLE_BASE_FILE).'base/css/admin.css', array( 'media-views' ), SOW_BUNDLE_VERSION );
78
+
79
+ }
80
+
81
+ function print_footer_templates() {
82
+ global $wp_widget_factory;
83
+
84
+ // Beaver Builder does it's editing in the front end so print required footer templates for active widgets.
85
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
86
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
87
+ $widget_obj->footer_admin_templates();
88
+ }
89
+ }
90
+ }
91
+
92
+ function bb_get_field_name( $name ) {
93
+ return preg_replace( '/\[[^\]]*\]/', '[]', $name, 1 );
94
+ }
95
+ }
96
+
97
+ SiteOrigin_Widgets_Bundle_Beaver_Builder::single();
compat/beaver-builder/sowb-beaver-builder.js ADDED
@@ -0,0 +1,114 @@
1
+ var sowb = window.sowb || {};
2
+
3
+ ( function($){
4
+ if( typeof FLBuilder !== 'undefined') {
5
+ sowb.orig_FLBuilder_getSettings = FLBuilder._getSettings;
6
+
7
+ /**
8
+ * Replace Beaver Builder's form data collection function with our modified version.
9
+ */
10
+ FLBuilder._getSettings = function(form) {
11
+ FLBuilder._updateEditorFields();
12
+ form.find('.siteorigin-widget-input');
13
+ var data = form.serializeArray(),
14
+ i = 0,
15
+ k = 0,
16
+ value = '',
17
+ name = '',
18
+ key = '',
19
+ keys = [],
20
+ matches = [],
21
+ settings = {};
22
+
23
+ // Loop through the form data.
24
+ for ( i = 0; i < data.length; i++ ) {
25
+
26
+ value = data[ i ].value.replace( /\r/gm, '' );
27
+
28
+ // Don't save text editor textareas.
29
+ if ( data[ i ].name.indexOf( 'flrich' ) > -1 ) {
30
+ continue;
31
+ }
32
+ // Support foo[]... setting keys.
33
+ else if ( data[ i ].name.indexOf( '[' ) > -1 ) {
34
+
35
+ name = data[ i ].name.replace( /\[(.*)\]/, '' );
36
+ key = data[ i ].name.replace( name, '' );
37
+ keys = [];
38
+ matches = key.match( /\[[^\]]*\]/g );
39
+
40
+ // Remove [] from the keys.
41
+ for ( k = 0; k < matches.length; k++ ) {
42
+
43
+ if ( '[]' == matches[ k ] ) {
44
+ continue;
45
+ }
46
+
47
+ keys.push( matches[ k ].replace( /\[|\]/g, '' ) );
48
+ }
49
+
50
+
51
+ var f = function(object, val, head, tail) {
52
+ if( tail.length == 0) {
53
+ object[ head ] = val;
54
+ } else {
55
+ if( 'undefined' == typeof object [ head ] ) {
56
+ object [ head ] = {};
57
+ }
58
+ f(object[ head ], val, tail.shift(), tail);
59
+ }
60
+ };
61
+
62
+ if(keys.length > 0) {
63
+
64
+ var keysCopy = keys.slice();
65
+ if ( 'undefined' == typeof settings[ name ] ) {
66
+ settings[ name ] = {};
67
+ }
68
+ f(settings[ name ], value, keysCopy.shift(), keysCopy);
69
+ } else {
70
+
71
+ if ( 'undefined' == typeof settings[ name ] ) {
72
+ settings[ name ] = [];
73
+ }
74
+
75
+ settings[ name ].push( value );
76
+ }
77
+ }
78
+ // Standard name/value pair.
79
+ else {
80
+ settings[ data[ i ].name ] = value;
81
+ }
82
+ }
83
+
84
+ // Update auto suggest values.
85
+ for ( key in settings ) {
86
+
87
+ if ( 'undefined' != typeof settings[ 'as_values_' + key ] ) {
88
+
89
+ settings[ key ] = $.grep(
90
+ settings[ 'as_values_' + key ].split( ',' ),
91
+ function( n ) {
92
+ return n !== '';
93
+ }
94
+ ).join( ',' );
95
+
96
+ try {
97
+ delete settings[ 'as_values_' + key ];
98
+ }
99
+ catch( e ) {}
100
+ }
101
+ }
102
+
103
+ // Return the settings.
104
+ return settings;
105
+ }
106
+ }
107
+
108
+ // To ensure necessary scripts are executed again when settings are changed
109
+ $( document ).on( 'fl-builder.preview-rendered fl-builder.layout-rendered', '.fl-builder-content', function() {
110
+ // Trigger Widgets Bundle widgets to setup
111
+ $( sowb ).trigger( 'setup_widgets' );
112
+ } );
113
+
114
+ })(jQuery);
compat/beaver-builder/sowb-beaver-builder.min.js ADDED
@@ -0,0 +1 @@
1
+ var sowb=window.sowb||{};!function(e){"undefined"!=typeof FLBuilder&&(sowb.orig_FLBuilder_getSettings=FLBuilder._getSettings,FLBuilder._getSettings=function(i){FLBuilder._updateEditorFields(),i.find(".siteorigin-widget-input");var n=i.serializeArray(),t=0,r=0,d="",l="",u="",f=[],a=[],o={};for(t=0;t<n.length;t++)if(d=n[t].value.replace(/\r/gm,""),!(n[t].name.indexOf("flrich")>-1))if(n[t].name.indexOf("[")>-1){for(l=n[t].name.replace(/\[(.*)\]/,""),u=n[t].name.replace(l,""),f=[],a=u.match(/\[[^\]]*\]/g),r=0;r<a.length;r++)"[]"!=a[r]&&f.push(a[r].replace(/\[|\]/g,""));var s=function(e,i,n,t){0==t.length?e[n]=i:("undefined"==typeof e[n]&&(e[n]={}),s(e[n],i,t.shift(),t))};if(f.length>0){var g=f.slice();"undefined"==typeof o[l]&&(o[l]={}),s(o[l],d,g.shift(),g)}else"undefined"==typeof o[l]&&(o[l]=[]),o[l].push(d)}else o[n[t].name]=d;for(u in o)if("undefined"!=typeof o["as_values_"+u]){o[u]=e.grep(o["as_values_"+u].split(","),function(e){return""!==e}).join(",");try{delete o["as_values_"+u]}catch(p){}}return o}),e(document).on("fl-builder.preview-rendered fl-builder.layout-rendered",".fl-builder-content",function(){e(sowb).trigger("setup_widgets")})}(jQuery);
compat/beaver-builder/styles.css ADDED
@@ -0,0 +1,190 @@
1
+ /* Styles required for icons, otherwise they are overridden by Beaver Builder's form styles */
2
+ /* Unfortunately a lot of `!important`s necessary to override beaver's `!important`s. :/ */
3
+ .fl-lightbox .siteorigin-widget-form,
4
+ .siteorigin-widgets-query-builder.media-modal {
5
+ /* Button styles copied from wp-core for default UI look. */
6
+ }
7
+ .fl-lightbox .siteorigin-widget-form.siteorigin-widget-form-main,
8
+ .siteorigin-widgets-query-builder.media-modal.siteorigin-widget-form-main {
9
+ min-width: inherit;
10
+ }
11
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-teaser .dashicons,
12
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-teaser .dashicons {
13
+ font-family: dashicons;
14
+ }
15
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field input,
16
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field input {
17
+ margin: 0 !important;
18
+ }
19
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field input[type="checkbox"],
20
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field input[type="checkbox"] {
21
+ vertical-align: middle;
22
+ }
23
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field input.siteorigin-widget-input-color,
24
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field input.siteorigin-widget-input-color {
25
+ margin: 5px !important;
26
+ }
27
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field input.siteorigin-widget-input-measurement,
28
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field input.siteorigin-widget-input-measurement {
29
+ margin: 1px !important;
30
+ height: inherit;
31
+ }
32
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field select.siteorigin-widget-input,
33
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field select.siteorigin-widget-input {
34
+ height: inherit;
35
+ padding: 3px;
36
+ }
37
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"],
38
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"] {
39
+ display: none !important;
40
+ }
41
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field .clear,
42
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field .clear {
43
+ clear: both;
44
+ }
45
+ .fl-lightbox .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-media .media-fallback-external,
46
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-media .media-fallback-external {
47
+ margin-top: 4px !important;
48
+ margin-left: 15px !important;
49
+ max-width: 220px;
50
+ }
51
+ .fl-lightbox .siteorigin-widget-form .sow-icon-elegantline,
52
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-elegantline,
53
+ .fl-lightbox .siteorigin-widget-form .sow-icon-fontawesome,
54
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-fontawesome,
55
+ .fl-lightbox .siteorigin-widget-form .sow-icon-genericons,
56
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-genericons,
57
+ .fl-lightbox .siteorigin-widget-form .sow-icon-icomoon,
58
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-icomoon,
59
+ .fl-lightbox .siteorigin-widget-form .sow-icon-ionicons,
60
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-ionicons,
61
+ .fl-lightbox .siteorigin-widget-form .sow-icon-typicons,
62
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-typicons {
63
+ display: inline-block;
64
+ speak: none;
65
+ font-style: normal;
66
+ font-weight: normal;
67
+ font-variant: normal;
68
+ text-transform: none;
69
+ line-height: 1;
70
+ -webkit-font-smoothing: antialiased;
71
+ -moz-osx-font-smoothing: grayscale;
72
+ }
73
+ .fl-lightbox .siteorigin-widget-form .sow-icon-elegantline,
74
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-elegantline {
75
+ font-family: 'sow-elegantline';
76
+ }
77
+ .fl-lightbox .siteorigin-widget-form .sow-icon-fontawesome,
78
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-fontawesome {
79
+ font-family: 'sow-fontawesome';
80
+ }
81
+ .fl-lightbox .siteorigin-widget-form .sow-icon-genericons,
82
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-genericons {
83
+ font-family: 'sow-genericons';
84
+ }
85
+ .fl-lightbox .siteorigin-widget-form .sow-icon-icomoon,
86
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-icomoon {
87
+ font-family: 'sow-icomoon';
88
+ }
89
+ .fl-lightbox .siteorigin-widget-form .sow-icon-ionicons,
90
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-ionicons {
91
+ font-family: 'sow-ionicons';
92
+ }
93
+ .fl-lightbox .siteorigin-widget-form .sow-icon-typicons,
94
+ .siteorigin-widgets-query-builder.media-modal .sow-icon-typicons {
95
+ font-family: 'sow-typicons';
96
+ }
97
+ .fl-lightbox .siteorigin-widget-form .button,
98
+ .siteorigin-widgets-query-builder.media-modal .button,
99
+ .fl-lightbox .siteorigin-widget-form .button-secondary,
100
+ .siteorigin-widgets-query-builder.media-modal .button-secondary {
101
+ display: inline-block;
102
+ text-decoration: none;
103
+ font-size: 13px;
104
+ line-height: 26px;
105
+ height: 28px;
106
+ margin: 0;
107
+ padding: 0 10px 1px;
108
+ cursor: pointer;
109
+ border: 1px solid #cccccc;
110
+ border-radius: 3px;
111
+ white-space: nowrap;
112
+ box-sizing: border-box;
113
+ font-family: inherit;
114
+ font-weight: normal;
115
+ text-transform: capitalize;
116
+ color: #555;
117
+ background: #f7f7f7;
118
+ }
119
+ .fl-lightbox .siteorigin-widget-form .button:hover,
120
+ .siteorigin-widgets-query-builder.media-modal .button:hover,
121
+ .fl-lightbox .siteorigin-widget-form .button-secondary:hover,
122
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:hover,
123
+ .fl-lightbox .siteorigin-widget-form .button:focus,
124
+ .siteorigin-widgets-query-builder.media-modal .button:focus,
125
+ .fl-lightbox .siteorigin-widget-form .button-secondary:focus,
126
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:focus {
127
+ background: #fafafa;
128
+ border-color: #999;
129
+ color: #23282d;
130
+ }
131
+ .fl-lightbox .siteorigin-widget-form .button:active,
132
+ .siteorigin-widgets-query-builder.media-modal .button:active,
133
+ .fl-lightbox .siteorigin-widget-form .button-secondary:active,
134
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:active,
135
+ .fl-lightbox .siteorigin-widget-form .button:focus,
136
+ .siteorigin-widgets-query-builder.media-modal .button:focus,
137
+ .fl-lightbox .siteorigin-widget-form .button-secondary:focus,
138
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:focus {
139
+ outline: none;
140
+ }
141
+ .fl-lightbox .siteorigin-widget-form .button.hidden,
142
+ .siteorigin-widgets-query-builder.media-modal .button.hidden,
143
+ .fl-lightbox .siteorigin-widget-form .button-secondary.hidden,
144
+ .siteorigin-widgets-query-builder.media-modal .button-secondary.hidden {
145
+ display: none;
146
+ }
147
+ .fl-lightbox .siteorigin-widget-form .button.button-small,
148
+ .siteorigin-widgets-query-builder.media-modal .button.button-small {
149
+ height: 23px;
150
+ line-height: 22px;
151
+ padding: 0 8px 1px;
152
+ font-size: 11px;
153
+ }
154
+ .fl-lightbox .siteorigin-widget-form select,
155
+ .siteorigin-widgets-query-builder.media-modal select,
156
+ .fl-lightbox .siteorigin-widget-form input[type=text],
157
+ .siteorigin-widgets-query-builder.media-modal input[type=text] {
158
+ margin: 1px;
159
+ border-radius: 0;
160
+ font-weight: inherit;
161
+ border: 1px solid #ddd;
162
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
163
+ background-color: #fff;
164
+ color: #32373c;
165
+ outline: 0;
166
+ transition: 50ms border-color ease-in-out;
167
+ }
168
+ .fl-lightbox .siteorigin-widget-form .ui-autocomplete,
169
+ .siteorigin-widgets-query-builder.media-modal .ui-autocomplete {
170
+ padding: 0;
171
+ margin: 0;
172
+ list-style: none;
173
+ position: absolute;
174
+ z-index: 10000;
175
+ border: 1px solid #5b9dd9;
176
+ box-shadow: 0 1px 2px rgba(30, 140, 190, 0.8);
177
+ background-color: #fff;
178
+ }
179
+ .fl-lightbox .siteorigin-widget-form .ui-autocomplete li,
180
+ .siteorigin-widgets-query-builder.media-modal .ui-autocomplete li {
181
+ margin-bottom: 0;
182
+ padding: 4px 10px;
183
+ white-space: nowrap;
184
+ text-align: left;
185
+ }
186
+ .fl-lightbox .siteorigin-widget-form .ui-autocomplete li.ui-state-focus,
187
+ .siteorigin-widgets-query-builder.media-modal .ui-autocomplete li.ui-state-focus {
188
+ background-color: #ddd;
189
+ cursor: pointer;
190
+ }
compat/builders.php ADDED
@@ -0,0 +1,11 @@
1
+ <?php
2
+ return array(
3
+ 'beaver_builder' => array(
4
+ 'name' => __( 'Beaver Builder', 'so-widgets-bundle' ),
5
+ 'file_path' => plugin_dir_path( __FILE__ ) . 'beaver-builder/beaver-builder.php',
6
+ ),
7
+ 'elementor' => array(
8
+ 'name' => __( 'Elementor', 'so-widgets-bundle' ),
9
+ 'file_path' => plugin_dir_path( __FILE__ ) . 'elementor/elementor.php',
10
+ ),
11
+ );
compat/compat.php ADDED
@@ -0,0 +1,51 @@
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Compatibility {
4
+
5
+ const BEAVER_BUILDER = 'Beaver Builder';
6
+ const ELEMENTOR = 'Elementor';
7
+
8
+ /**
9
+ * Get the singleton instance
10
+ *
11
+ * @return SiteOrigin_Widgets_Bundle_Compatibility
12
+ */
13
+ public static function single() {
14
+ static $single;
15
+ return empty( $single ) ? $single = new self() : $single;
16
+ }
17
+
18
+ function __construct() {
19
+ $builder = $this->get_active_builder();
20
+ if ( ! empty( $builder ) ) {
21
+ require_once $builder['file_path'];
22
+ }
23
+ }
24
+
25
+ function get_active_builder() {
26
+
27
+ $builders = include_once 'builders.php';
28
+
29
+ foreach ( $builders as $builder ) {
30
+ if ( $this->is_active( $builder ) ) {
31
+ return $builder;
32
+ }
33
+ }
34
+
35
+ return null;
36
+ }
37
+
38
+ function is_active( $builder ) {
39
+ switch ( $builder[ 'name' ] ) {
40
+ case self::BEAVER_BUILDER:
41
+ return class_exists( 'FLBuilderModel', false );
42
+ break;
43
+ case self::ELEMENTOR:
44
+ return class_exists( 'Elementor\\Plugin', false );
45
+ break;
46
+ }
47
+ }
48
+
49
+ }
50
+
51
+ SiteOrigin_Widgets_Bundle_Compatibility::single();
compat/elementor/elementor.php ADDED
@@ -0,0 +1,102 @@
1
+ <?php
2
+
3
+ class SiteOrigin_Widgets_Bundle_Elementor {
4
+
5
+ /**
6
+ * Get the singleton instance
7
+ *
8
+ * @return SiteOrigin_Widgets_Bundle_Elementor
9
+ */
10
+ public static function single() {
11
+ static $single;
12
+
13
+ return empty( $single ) ? $single = new self() : $single;
14
+ }
15
+
16
+ private $plugin;
17
+
18
+ function __construct() {
19
+ add_action( 'template_redirect', [ $this, 'init' ] );
20
+
21
+ add_action( 'wp_ajax_elementor_render_widget', [ $this, 'ajax_render_widget_preview' ] );
22
+ add_action( 'wp_ajax_elementor_editor_get_wp_widget_form', [ $this, 'ajax_render_widget_form' ] );
23
+ }
24
+
25
+ function init() {
26
+ $this->plugin = Elementor\Plugin::instance();
27
+ if ( !empty( $this->plugin->preview ) && method_exists( $this->plugin->preview, 'is_preview_mode' ) && $this->plugin->preview->is_preview_mode() ) {
28
+ add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_frontend_scripts' ] );
29
+ }
30
+
31
+ $elementor_editor = $this->plugin->editor;
32
+ if( ! is_admin() && method_exists( $elementor_editor, 'is_edit_mode' ) && $elementor_editor->is_edit_mode() ) {
33
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_active_widgets_scripts' ), 9999999 );
34
+ add_action( 'wp_print_footer_scripts', array( $this, 'print_footer_templates' ) );
35
+ }
36
+ }
37
+
38
+ function enqueue_frontend_scripts() {
39
+
40
+ $post_id = get_the_ID();
41
+
42
+ if( defined( 'Elementor\\DB::STATUS_DRAFT' ) && ! empty( $this->plugin->db ) && method_exists( $this->plugin->db, 'get_builder' ) ) {
43
+ // This is necessary to ensure styles and scripts are enqueued. Not sure why this is enough, but I assume
44
+ // Elementor is calling widgets' `widget` method with instance data in the process of retrieving editor data.
45
+ $this->plugin->db->get_builder( $post_id, Elementor\DB::STATUS_DRAFT );
46
+ }
47
+ }
48
+
49
+ function enqueue_active_widgets_scripts() {
50
+
51
+ global $wp_widget_factory;
52
+
53
+ // Elementor does it's editing in it's own front end so enqueue required form scripts for active widgets.
54
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
55
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
56
+ /* @var $widget_obj SiteOrigin_Widget */
57
+ ob_start();
58
+ $widget_obj->form( array() );
59
+ ob_clean();
60
+ }
61
+ }
62
+
63
+ wp_enqueue_style( 'sowb-styles-for-elementor', plugin_dir_url( __FILE__ ) . 'styles.css' );
64
+
65
+ }
66
+
67
+ function print_footer_templates() {
68
+ global $wp_widget_factory;
69
+
70
+ // Elementor does it's editing in the front end so print required footer templates for active widgets.
71
+ foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
72
+ if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
73
+ /* @var $widget_obj SiteOrigin_Widget */
74
+ $widget_obj->footer_admin_templates();
75
+ }
76
+ }
77
+ }
78
+
79
+ function ajax_render_widget_preview() {
80
+
81
+ add_filter( 'elementor/widget/render_content', array( $this, 'render_widget_preview' ) );
82
+ }
83
+
84
+ function render_widget_preview( $widget_output ) {
85
+
86
+ $wp_scripts = wp_scripts();
87
+ $wp_styles = wp_styles();
88
+
89
+ // Print any scripts and styles we may have enqueued for live preview.
90
+ wp_print_scripts( $wp_scripts->queue );
91
+ wp_print_styles( $wp_styles->queue );
92
+
93
+ return $widget_output;
94
+ }
95
+
96
+ function ajax_render_widget_form() {
97
+ // Don't want to show the form preview button when using Elementor
98
+ add_filter( 'siteorigin_widgets_form_show_preview_button', array( $this, '__return_false' ) );
99
+ }
100
+ }
101
+
102
+ SiteOrigin_Widgets_Bundle_Elementor::single();
compat/elementor/styles.css ADDED
@@ -0,0 +1,225 @@
1
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form,
2
+ .siteorigin-widgets-query-builder,
3
+ .siteorigin-widgets-query-builder.media-modal {
4
+ min-width: inherit;
5
+ /* Button styles copied from wp-core for default UI look. */
6
+ }
7
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container,
8
+ .siteorigin-widgets-query-builder .wp-picker-container,
9
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container {
10
+ float: none;
11
+ }
12
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container.wp-picker-active,
13
+ .siteorigin-widgets-query-builder .wp-picker-container.wp-picker-active,
14
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container.wp-picker-active {
15
+ transform: none;
16
+ float: none;
17
+ position: relative;
18
+ padding: 0;
19
+ border: none;
20
+ background: none;
21
+ }
22
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container.wp-picker-active .wp-color-result,
23
+ .siteorigin-widgets-query-builder .wp-picker-container.wp-picker-active .wp-color-result,
24
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container.wp-picker-active .wp-color-result {
25
+ float: none;
26
+ margin: 0;
27
+ }
28
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container.wp-picker-active .wp-picker-input-wrap,
29
+ .siteorigin-widgets-query-builder .wp-picker-container.wp-picker-active .wp-picker-input-wrap,
30
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container.wp-picker-active .wp-picker-input-wrap {
31
+ padding: 0;
32
+ float: none;
33
+ }
34
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container.wp-picker-active .iris-picker.iris-border,
35
+ .siteorigin-widgets-query-builder .wp-picker-container.wp-picker-active .iris-picker.iris-border,
36
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container.wp-picker-active .iris-picker.iris-border {
37
+ background: none;
38
+ }
39
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container.wp-picker-active .iris-picker.iris-border .iris-picker-inner,
40
+ .siteorigin-widgets-query-builder .wp-picker-container.wp-picker-active .iris-picker.iris-border .iris-picker-inner,
41
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container.wp-picker-active .iris-picker.iris-border .iris-picker-inner {
42
+ left: 0;
43
+ right: 0;
44
+ }
45
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .wp-picker-container.wp-picker-active .wp-picker-clear,
46
+ .siteorigin-widgets-query-builder .wp-picker-container.wp-picker-active .wp-picker-clear,
47
+ .siteorigin-widgets-query-builder.media-modal .wp-picker-container.wp-picker-active .wp-picker-clear {
48
+ height: 28px;
49
+ }
50
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-link .existing-content-selector,
51
+ .siteorigin-widgets-query-builder .siteorigin-widget-field.siteorigin-widget-field-type-link .existing-content-selector,
52
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-link .existing-content-selector {
53
+ width: inherit;
54
+ }
55
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-input-color,
56
+ .siteorigin-widgets-query-builder .siteorigin-widget-field .siteorigin-widget-input-color,
57
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field .siteorigin-widget-input-color {
58
+ width: 120px;
59
+ margin: 0 3px;
60
+ }
61
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-measurement .siteorigin-widget-input-measurement,
62
+ .siteorigin-widgets-query-builder .siteorigin-widget-field.siteorigin-widget-field-type-measurement .siteorigin-widget-input-measurement,
63
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-measurement .siteorigin-widget-input-measurement,
64
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit,
65
+ .siteorigin-widgets-query-builder .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit,
66
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit {
67
+ max-width: inherit;
68
+ height: 28px;
69
+ margin: 0;
70
+ }
71
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-measurement .siteorigin-widget-input-measurement,
72
+ .siteorigin-widgets-query-builder .siteorigin-widget-field.siteorigin-widget-field-type-measurement .siteorigin-widget-input-measurement,
73
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-measurement .siteorigin-widget-input-measurement {
74
+ width: 66%;
75
+ margin-right: 1px;
76
+ }
77
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit,
78
+ .siteorigin-widgets-query-builder .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit,
79
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-measurement .sow-measurement-select-unit {
80
+ width: 33%;
81
+ margin-left: 1px;
82
+ }
83
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"],
84
+ .siteorigin-widgets-query-builder .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"],
85
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field .siteorigin-widget-field-type-slider input[type="number"] {
86
+ display: none !important;
87
+ }
88
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field .clear,
89
+ .siteorigin-widgets-query-builder .siteorigin-widget-field .clear,
90
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field .clear {
91
+ clear: both;
92
+ }
93
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-media .media-fallback-external,
94
+ .siteorigin-widgets-query-builder .siteorigin-widget-field.siteorigin-widget-field-type-media .media-fallback-external,
95
+ .siteorigin-widgets-query-builder.media-modal .siteorigin-widget-field.siteorigin-widget-field-type-media .media-fallback-external {
96
+ margin-top: 4px !important;
97
+ margin-left: 15px !important;
98
+ max-width: 220px;
99
+ }
100
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button,
101
+ .siteorigin-widgets-query-builder .button,
102
+ .siteorigin-widgets-query-builder.media-modal .button,
103
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button-secondary,
104
+ .siteorigin-widgets-query-builder .button-secondary,
105
+ .siteorigin-widgets-query-builder.media-modal .button-secondary {
106
+ display: inline-block;
107
+ text-decoration: none;
108
+ font-size: 13px;
109
+ line-height: 26px;
110
+ height: 28px;
111
+ margin: 0;
112
+ padding: 0 10px 1px;
113
+ cursor: pointer;
114
+ border: 1px solid #cccccc;
115
+ border-radius: 3px;
116
+ white-space: nowrap;
117
+ box-sizing: border-box;
118
+ font-family: inherit;
119
+ font-weight: normal;
120
+ text-transform: capitalize;
121
+ color: #555;
122
+ background: #f7f7f7;
123
+ }
124
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button:hover,
125
+ .siteorigin-widgets-query-builder .button:hover,
126
+ .siteorigin-widgets-query-builder.media-modal .button:hover,
127
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button-secondary:hover,
128
+ .siteorigin-widgets-query-builder .button-secondary:hover,
129
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:hover,
130
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button:focus,
131
+ .siteorigin-widgets-query-builder .button:focus,
132
+ .siteorigin-widgets-query-builder.media-modal .button:focus,
133
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button-secondary:focus,
134
+ .siteorigin-widgets-query-builder .button-secondary:focus,
135
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:focus {
136
+ background: #fafafa;
137
+ border-color: #999;
138
+ color: #23282d;
139
+ }
140
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button:active,
141
+ .siteorigin-widgets-query-builder .button:active,
142
+ .siteorigin-widgets-query-builder.media-modal .button:active,
143
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button-secondary:active,
144
+ .siteorigin-widgets-query-builder .button-secondary:active,
145
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:active,
146
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button:focus,
147
+ .siteorigin-widgets-query-builder .button:focus,
148
+ .siteorigin-widgets-query-builder.media-modal .button:focus,
149
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button-secondary:focus,
150
+ .siteorigin-widgets-query-builder .button-secondary:focus,
151
+ .siteorigin-widgets-query-builder.media-modal .button-secondary:focus {
152
+ outline: none;
153
+ }
154
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button.hidden,
155
+ .siteorigin-widgets-query-builder .button.hidden,
156
+ .siteorigin-widgets-query-builder.media-modal .button.hidden,
157
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button-secondary.hidden,
158
+ .siteorigin-widgets-query-builder .button-secondary.hidden,
159
+ .siteorigin-widgets-query-builder.media-modal .button-secondary.hidden {
160
+ display: none;
161
+ }
162
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .button.button-small,
163
+ .siteorigin-widgets-query-builder .button.button-small,
164
+ .siteorigin-widgets-query-builder.media-modal .button.button-small {
165
+ height: 25px;
166
+ line-height: 23px;
167
+ padding: 0 8px;
168
+ font-size: 11px;
169
+ }
170
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form select,
171
+ .siteorigin-widgets-query-builder select,
172
+ .siteorigin-widgets-query-builder.media-modal select,
173
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form input[type=text],
174
+ .siteorigin-widgets-query-builder input[type=text],
175
+ .siteorigin-widgets-query-builder.media-modal input[type=text] {
176
+ width: inherit;
177
+ margin: 1px;
178
+ border-radius: 0;
179
+ font-weight: inherit;
180
+ border: 1px solid #ddd;
181
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
182
+ background-color: #fff;
183
+ color: #32373c;
184
+ outline: 0;
185
+ transition: 50ms border-color ease-in-out;
186
+ }
187
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .ui-autocomplete,
188
+ .siteorigin-widgets-query-builder .ui-autocomplete,
189
+ .siteorigin-widgets-query-builder.media-modal .ui-autocomplete {
190
+ padding: 0;
191
+ margin: 0;
192
+ list-style: none;
193
+ position: absolute;
194
+ z-index: 10000;
195
+ border: 1px solid #5b9dd9;
196
+ box-shadow: 0 1px 2px rgba(30, 140, 190, 0.8);
197
+ background-color: #fff;
198
+ }
199
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .ui-autocomplete li,
200
+ .siteorigin-widgets-query-builder .ui-autocomplete li,
201
+ .siteorigin-widgets-query-builder.media-modal .ui-autocomplete li {
202
+ margin-bottom: 0;
203
+ padding: 4px 10px;
204
+ white-space: nowrap;
205
+ text-align: left;
206
+ }
207
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .ui-autocomplete li.ui-state-focus,
208
+ .siteorigin-widgets-query-builder .ui-autocomplete li.ui-state-focus,
209
+ .siteorigin-widgets-query-builder.media-modal .ui-autocomplete li.ui-state-focus {
210
+ background-color: #ddd;
211
+ cursor: pointer;
212
+ }
213
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .media-toolbar-primary,
214
+ .siteorigin-widgets-query-builder .media-toolbar-primary,
215
+ .siteorigin-widgets-query-builder.media-modal .media-toolbar-primary {
216
+ margin-top: 15px;
217
+ }
218
+ .elementor-panel #elementor-panel-page-editor .elementor-control-content .siteorigin-widget-form .query-builder-content .query-builder-form-field small,
219
+ .siteorigin-widgets-query-builder .query-builder-content .query-builder-form-field small,
220
+ .siteorigin-widgets-query-builder.media-modal .query-builder-content .query-builder-form-field small {
221
+ margin-top: 5px;
222
+ }
223
+ .elementor-panel {
224
+ width: 400px;
225
+ }
js/slider/jquery.slider.js CHANGED
@@ -1,239 +1,251 @@
1
/**
2
* SiteOrigin Slider Javascript.
3
*
4
- * Copyright 2014, Greg Priday
5
* Released under GPL 2.0 - see http://www.gnu.org/licenses/gpl-2.0.html
6
*/
7
8
- var siteoriginSlider = {};
9
- jQuery( function($){
10
11
- var playSlideVideo = siteoriginSlider.playSlideVideo = function(el) {
12
- $(el).find('video').each(function(){
13
- if(typeof this.play !== 'undefined') {
14
- this.play();
15
- }
16
- });
17
- };
18
-
19
- var pauseSlideVideo = siteoriginSlider.pauseSlideVideo = function(el) {
20
- $(el).find('video').each(function(){
21
- if(typeof this.pause !== 'undefined') {
22
- this.pause();
23
- }
24
- });
25
- };
26
-
27
- var setupActiveSlide = siteoriginSlider.setupActiveSlide = function(slider, newActive, speed){
28
- // Start by setting up the active sentinel
29
- var
30
- sentinel = $(slider).find('.cycle-sentinel'),
31
- active = $(newActive),
32
- video = active.find('video.sow-background-element');
33
-
34
- if( speed == undefined ) {
35
- sentinel.css( 'height', active.outerHeight() );
36
- }
37
- else {
38
- sentinel.animate( {height: active.outerHeight()}, speed );
39
- }
40
-
41
- if( video.length ) {
42
-
43
- // Resize the video so it fits in the current slide
44
- var
45
- slideRatio = active.outerWidth() / active.outerHeight(),
46
- videoRatio = video.outerWidth() / video.outerHeight();
47
-
48
- if( slideRatio > videoRatio ) {
49
- video.css( {
50
- 'width' : '100%',
51
- 'height' : 'auto'
52
- } );
53
- }
54
- else {
55
- video.css( {
56
- 'width' : 'auto',
57
- 'height' : '100%'
58
- } );
59
- }
60
-
61
- video.css( {
62
- 'margin-left' : -Math.ceil(video.width()/2),
63
- 'margin-top' : -Math.ceil(video.height()/2)
64
- } );
65
- }
66
- };
67
-
68
- $('.sow-slider-images').each(function(){
69
- var $ = $(this);
70
- var $p = $.siblings('.sow-slider-pagination');
71
- var $base = $.closest('.sow-slider-base');
72
- var $n = $base.find('.sow-slide-nav');
73
- var $slides = $.find('.sow-slider-image');
74
- var settings = $.data('settings');
75
-
76
- $slides.each(function( index, el) {
77
- var $slide = $(el);
78
- var urlData = $slide.data('url');
79
-
80
- $slide.click(function(event) {
81
-
82
- if( urlData !== undefined ) {
83
- var $t = $(event.target);
84
- // If this isn't a link, we'll use the URL of the frame
85
- if( $t.prop("tagName") !== 'A' ) {
86
- event.preventDefault();
87
- window.open(urlData.url, urlData.new_window ? '_blank' : '_self');
88
- }
89
- }
90
- } );
91
- });
92
-
93
- var setupSlider = function(){
94
- // Show everything for this slider
95
- $base.show();
96
-
97
- // Setup each of the slider frames
98
- $.find('.sow-slider-image').each( function(){
99
- var $i = $(this);
100
-
101
- $(window)
102
- .on('resize panelsStretchRows', function(){
103
- $i.css( 'height', $i.find('.sow-slider-image-wrapper').outerHeight() );
104
- })
105
- .resize();
106
- } );
107
-
108
- // Set up the Cycle with videos
109
- $
110
- .on({
111
- 'cycle-after' : function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag){
112
- var $ = $(this);
113
- playSlideVideo(incomingSlideEl);
114
- setupActiveSlide( $, incomingSlideEl );
115
- $( incomingSlideEl ).trigger('sowSlideCycleAfter');
116
- },
117
-
118
- 'cycle-before' : function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag) {
119
- var $ = $(this);
120
- $p.find('> li').removeClass('sow-active').eq(optionHash.slideNum-1).addClass('sow-active');
121
- pauseSlideVideo(outgoingSlideEl);
122
- setupActiveSlide($, incomingSlideEl, optionHash.speed);
123
- $( incomingSlideEl ).trigger('sowSlideCycleBefore');
124
- },
125
-
126
- 'cycle-initialized' : function(event, optionHash){
127
- playSlideVideo( $(this).find('.cycle-slide-active') );
128
- setupActiveSlide( $, optionHash.slides[0] );
129
-
130
- $p.find('>li').removeClass('sow-active').eq(0).addClass('sow-active');
131
- $( this ).find('.cycle-slide-active').trigger( 'sowSlideInitial' );
132
-
133
- if(optionHash.slideCount <= 1) {
134
- // Special case when there is only one slide
135
- $p.hide();
136
- $n.hide();
137
- }
138
-
139
- $(window).resize();
140
- }
141
- })
142
- .cycle( {
143
- 'slides' : '> .sow-slider-image',
144
- 'speed' : settings.speed,
145
- 'timeout' : settings.timeout,
146
- 'swipe' : settings.swipe,
147
- 'swipe-fx' : 'scrollHorz'
148
- } );
149
-
150
- $ .find('video.sow-background-element').on('loadeddata', function(){
151
- setupActiveSlide( $, $.find( '.cycle-slide-active' ) );
152
- } );
153
-
154
- // Set up showing and hiding navs
155
- $p.add($n).hide();
156
- if( !$base.hasClass('sow-slider-is-mobile') && $slides.length > 1 ) {
157
-
158
- var toHide = false;
159
- $base
160
- .mouseenter(function(){
161
- $p.add($n).clearQueue().fadeIn(150);
162
- toHide = false;
163
- })
164
- .mouseleave(function(){
165
- toHide = true;
166
- setTimeout(function(){
167
- if( toHide ) {
168
- $p.add($n).clearQueue().fadeOut(150);
169
- }
170
- toHide = false;
171
- }, 750);
172
- });
173
- }
174
-
175
- // Resize the sentinel when ever the window is resized
176
- $( window ).resize( function(){
177
- setupActiveSlide( $, $.find( '.cycle-slide-active' ) );
178
- } );
179
-
180
- // Setup clicks on the pagination
181
- $p.find( '> li > a' ).click( function(e){
182
- e.preventDefault();
183
- $.cycle( 'goto', $(this).data('goto') );
184
- } );
185
-
186
- // Clicking on the next and previous navigation buttons
187
- $n.find( '> a' ).click( function(e){
188
- e.preventDefault();
189
- $.cycle( $(this).data('action') );
190
- } );
191
-
192
- $base.keydown(
193
- function(event) {
194
- if(event.which === 37) {
195
- //left
196
- $.cycle('prev');
197
- }
198
- else if (event.which === 39) {
199
- //right
200
- $.cycle('next');
201
- }
202
- }
203
- );
204
- };
205
-
206
- var images = $.find('img');
207
- var imagesLoaded = 0;
208
- var sliderLoaded = false;
209
-
210
- // Preload all the images, when they're loaded, then display the slider
211
- images.each( function(){
212
- var $i = $(this);
213
- if( this.complete ) {
214
- imagesLoaded++;
215
- }
216
- else {
217
- $(this).one('load', function(){
218
- imagesLoaded++;
219
-
220
- if(imagesLoaded === images.length && !sliderLoaded) {
221
- setupSlider();
222
- sliderLoaded = true;
223
- }
224
- })
225
- // Reset src attribute to force 'load' event for cached images in IE9 and IE10.
226
- .attr('src', $(this).attr('src'));
227
- }
228
-
229
- if(imagesLoaded === images.length && !sliderLoaded) {
230
- setupSlider();
231
- sliderLoaded = true;
232
- }
233
- } );
234
-
235
- if(images.length === 0) {
236
- setupSlider();
237
- }
238
- });
239
} );
1
/**
2
* SiteOrigin Slider Javascript.
3
*
4
+ * Copyright 2014, SiteOrigin
5
* Released under GPL 2.0 - see http://www.gnu.org/licenses/gpl-2.0.html
6
*/
7
8
+ var sowb = window.sowb || {};
9
+
10
+ sowb.SiteOriginSlider = function($) {
11
+ return {
12
+ playSlideVideo: function(el) {
13
+ $(el).find('video').each(function(){
14
+ if(typeof this.play !== 'undefined') {
15
+ this.play();
16
+ }
17
+ });
18
+ },
19
+
20
+ pauseSlideVideo: function(el) {
21
+ $(el).find('video').each(function(){
22
+ if(typeof this.pause !== 'undefined') {
23
+ this.pause();
24
+ }
25
+ });
26
+ },
27
+
28
+ setupActiveSlide: function(slider, newActive, speed){
29
+ // Start by setting up the active sentinel
30
+ var
31
+ sentinel = $(slider).find('.cycle-sentinel'),
32
+ active = $(newActive),
33
+ video = active.find('video.sow-background-element');
34
+
35
+ if( speed == undefined ) {
36
+ sentinel.css( 'height', active.outerHeight() );
37
+ }
38
+ else {
39
+ sentinel.animate( {height: active.outerHeight()}, speed );
40
+ }
41
+
42
+ if( video.length ) {
43
+
44
+ // Resize the video so it fits in the current slide
45
+ var
46
+ slideRatio = active.outerWidth() / active.outerHeight(),
47
+ videoRatio = video.outerWidth() / video.outerHeight();
48
+
49
+ if( slideRatio > videoRatio ) {
50
+ video.css( {
51
+ 'width' : '100%',
52
+ 'height' : 'auto'
53
+ } );
54
+ }
55
+ else {
56
+ video.css( {
57
+ 'width' : 'auto',
58
+ 'height' : '100%'
59
+ } );
60
+ }
61
+
62
+ video.css( {
63
+ 'margin-left' : -Math.ceil(video.width()/2),
64
+ 'margin-top' : -Math.ceil(video.height()/2)
65
+ } );
66
+ }
67
+ },
68
+ };
69
+ };
70
+
71
72
+ jQuery( function($){
73
+ sowb.setupSliders = sowb.setupSlider = function() {
74
+ var siteoriginSlider = new sowb.SiteOriginSlider($);
75
+
76
+ $('.sow-slider-images').each(function(){
77
+ var $ = $(this);
78
+ var $p = $.siblings('.sow-slider-pagination');
79
+ var $base = $.closest('.sow-slider-base');
80
+ var $n = $base.find('.sow-slide-nav');
81
+ var $slides = $.find('.sow-slider-image');
82
+ var settings = $.data('settings');
83
+
84
+ $slides.each(function( index, el) {
85
+ var $slide = $(el);
86
+ var urlData = $slide.data('url');
87
+
88
+ $slide.click(function(event) {
89
+
90
+ if( urlData !== undefined ) {
91
+ var $t = $(event.target);
92
+ // If this isn't a link, we'll use the URL of the frame
93
+ if( $t.prop("tagName") !== 'A' ) {
94
+ event.preventDefault();
95
+ window.open(urlData.url, urlData.new_window ? '_blank' : '_self');
96
+ }
97
+ }
98
+ } );
99
+ });
100
+
101
+ var setupSlider = function(){
102
+ // Show everything for this slider
103
+ $base.show();
104
+
105
+ // Setup each of the slider frames
106
+ $.find('.sow-slider-image').each( function(){
107
+ var $i = $(this);
108
+
109
+ $(window)
110
+ .on('resize panelsStretchRows', function(){
111
+ $i.css( 'height', $i.find('.sow-slider-image-wrapper').outerHeight() );
112
+ })
113
+ .resize();
114
+ } );
115
+
116
+ // Set up the Cycle with videos
117
+ $
118
+ .on({
119
+ 'cycle-after' : function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag){
120
+ var $ = $(this);
121
+ siteoriginSlider.playSlideVideo(incomingSlideEl);
122
+ siteoriginSlider.setupActiveSlide( $, incomingSlideEl );
123
+ $( incomingSlideEl ).trigger('sowSlideCycleAfter');
124
+ },
125
+
126
+ 'cycle-before' : function(event, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag) {
127
+ var $ = $(this);
128
+ $p.find('> li').removeClass('sow-active').eq(optionHash.slideNum-1).addClass('sow-active');
129
+ siteoriginSlider.pauseSlideVideo(outgoingSlideEl);
130
+ siteoriginSlider.setupActiveSlide($, incomingSlideEl, optionHash.speed);
131
+ $( incomingSlideEl ).trigger('sowSlideCycleBefore');
132
+ },
133
+
134
+ 'cycle-initialized' : function(event, optionHash){
135
+ siteoriginSlider.playSlideVideo( $(this).find('.cycle-slide-active') );
136
+ siteoriginSlider.setupActiveSlide( $, optionHash.slides[0] );
137
+
138
+ $p.find('>li').removeClass('sow-active').eq(0).addClass('sow-active');
139
+ $( this ).find('.cycle-slide-active').trigger( 'sowSlideInitial' );
140
+
141
+ if(optionHash.slideCount <= 1) {
142
+ // Special case when there is only one slide
143
+ $p.hide();
144
+ $n.hide();
145
+ }
146
+
147
+ $(window).resize();
148
+ }
149
+ })
150
+ .cycle( {
151
+ 'slides' : '> .sow-slider-image',
152
+ 'speed' : settings.speed,
153
+ 'timeout' : settings.timeout,
154
+ 'swipe' : settings.swipe,
155
+ 'swipe-fx' : 'scrollHorz'
156
+ } ) ;
157
+
158
+ $ .find('video.sow-background-element').on('loadeddata', function(){
159
+ siteoriginSlider.setupActiveSlide( $, $.find( '.cycle-slide-active' ) );
160
+ } );
161
+
162
+ // Set up showing and hiding navs
163
+ $p.add($n).hide();
164
+ if( !$base.hasClass('sow-slider-is-mobile') && $slides.length > 1 ) {
165
+
166
+ var toHide = false;
167
+ $base
168
+ .mouseenter(function(){
169
+ $p.add($n).clearQueue().fadeIn(150);
170
+ toHide = false;
171
+ })
172
+ .mouseleave(function(){
173
+ toHide = true;
174
+ setTimeout(function(){
175
+ if( toHide ) {
176
+ $p.add($n).clearQueue().fadeOut(150);
177
+ }
178
+ toHide = false;
179
+ }, 750);
180
+ });
181
+ }
182
+
183
+ // Resize the sentinel when ever the window is resized
184
+ $( window ).resize( function(){
185
+ siteoriginSlider.setupActiveSlide( $, $.find( '.cycle-slide-active' ) );
186
+ } );
187
+
188
+ // Setup clicks on the pagination
189
+ $p.find( '> li > a' ).click( function(e){
190
+ e.preventDefault();
191
+ $.cycle( 'goto', $(this).data('goto') );
192
+ } );
193
+
194
+ // Clicking on the next and previous navigation buttons
195
+ $n.find( '> a' ).click( function(e){
196
+ e.preventDefault();
197
+ $.cycle( $(this).data('action') );
198
+ } );
199
+
200
+ $base.keydown(
201
+ function(event) {
202
+ if(event.which === 37) {
203
+ //left
204
+ $.cycle('prev');
205
+ }
206
+ else if (event.which === 39) {
207
+ //right
208
+ $.cycle('next');
209
+ }
210
+ }
211
+ );
212
+ };
213
+
214
+ var images = $.find('img');
215
+ var imagesLoaded = 0;
216
+ var sliderLoaded = false;
217
+
218
+ // Preload all the images, when they're loaded, then display the slider
219
+ images.each( function(){
220
+ var $i = $(this);
221
+ if( this.complete ) {
222
+ imagesLoaded++;
223
+ }
224
+ else {
225
+ $(this).one('load', function(){
226
+ imagesLoaded++;
227
+
228
+ if(imagesLoaded === images.length && !sliderLoaded) {
229
+ setupSlider();
230
+ sliderLoaded = true;
231
+ }
232
+ })
233
+ // Reset src attribute to force 'load' event for cached images in IE9 and IE10.
234
+ .attr('src', $(this).attr('src'));
235
+ }
236
+
237
+ if(imagesLoaded === images.length && !sliderLoaded) {
238
+ setupSlider();
239
+ sliderLoaded = true;
240
+ }
241
+ } );
242
+
243
+ if(images.length === 0) {
244
+ setupSlider();
245
+ }
246
+ });
247
+ };
248
+ sowb.setupSliders();
249
+
250
+ $( sowb ).on( 'setup_widgets', sowb.setupSliders );
251
} );
js/slider/jquery.slider.min.js CHANGED
@@ -1 +1 @@
1
- var siteoriginSlider={};jQuery(function(e){var i=siteoriginSlider.playSlideVideo=function(i){e(i).find("video").each(function(){"undefined"!=typeof this.play&&this.play()})},t=siteoriginSlider.pauseSlideVideo=function(i){e(i).find("video").each(function(){"undefined"!=typeof this.pause&&this.pause()})},n=siteoriginSlider.setupActiveSlide=function(i,t,n){var s=e(i).find(".cycle-sentinel"),o=e(t),d=o.find("video.sow-background-element");if(void 0==n?s.css("height",o.outerHeight()):s.animate({height:o.outerHeight()},n),d.length){var a=o.outerWidth()/o.outerHeight(),c=d.outerWidth()/d.outerHeight();a>c?d.css({width:"100%",height:"auto"}):d.css({width:"auto",height:"100%"}),d.css({"margin-left":-Math.ceil(d.width()/2),"margin-top":-Math.ceil(d.height()/2)})}};e(".sow-slider-images").each(function(){var s=e(this),o=s.siblings(".sow-slider-pagination"),d=s.closest(".sow-slider-base"),a=d.find(".sow-slide-nav"),c=s.find(".sow-slider-image"),l=s.data("settings");c.each(function(i,t){var n=e(t),s=n.data("url");n.click(function(i){if(void 0!==s){var t=e(i.target);"A"!==t.prop("tagName")&&(i.preventDefault(),window.open(s.url,s.new_window?"_blank":"_self"))}})});var r=function(){if(d.show(),s.find(".sow-slider-image").each(function(){var i=e(this);e(window).on("resize panelsStretchRows",function(){i.css("height",i.find(".sow-slider-image-wrapper").outerHeight())}).resize()}),s.on({"cycle-after":function(t,s,o,d,a){var c=e(this);i(d),n(c,d),e(d).trigger("sowSlideCycleAfter")},"cycle-before":function(i,s,d,a,c){var l=e(this);o.find("> li").removeClass("sow-active").eq(s.slideNum-1).addClass("sow-active"),t(d),n(l,a,s.speed),e(a).trigger("sowSlideCycleBefore")},"cycle-initialized":function(t,d){i(e(this).find(".cycle-slide-active")),n(s,d.slides[0]),o.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),e(this).find(".cycle-slide-active").trigger("sowSlideInitial"),d.slideCount<=1&&(o.hide(),a.hide()),e(window).resize()}}).cycle({slides:"> .sow-slider-image",speed:l.speed,timeout:l.timeout,swipe:l.swipe,"swipe-fx":"scrollHorz"}),s.find("video.sow-background-element").on("loadeddata",function(){n(s,s.find(".cycle-slide-active"))}),o.add(a).hide(),!d.hasClass("sow-slider-is-mobile")&&c.length>1){var r=!1;d.mouseenter(function(){o.add(a).clearQueue().fadeIn(150),r=!1}).mouseleave(function(){r=!0,setTimeout(function(){r&&o.add(a).clearQueue().fadeOut(150),r=!1},750)})}e(window).resize(function(){n(s,s.find(".cycle-slide-active"))}),o.find("> li > a").click(function(i){i.preventDefault(),s.cycle("goto",e(this).data("goto"))}),a.find("> a").click(function(i){i.preventDefault(),s.cycle(e(this).data("action"))}),d.keydown(function(e){37===e.which?s.cycle("prev"):39===e.which&&s.cycle("next")})},f=s.find("img"),h=0,u=!1;f.each(function(){e(this);this.complete?h++:e(this).one("load",function(){h++,h!==f.length||u||(r(),u=!0)}).attr("src",e(this).attr("src")),h!==f.length||u||(r(),u=!0)}),0===f.length&&r()})});
1
+ var sowb=window.sowb||{};sowb.SiteOriginSlider=function(e){return{playSlideVideo:function(i){e(i).find("video").each(function(){"undefined"!=typeof this.play&&this.play()})},pauseSlideVideo:function(i){e(i).find("video").each(function(){"undefined"!=typeof this.pause&&this.pause()})},setupActiveSlide:function(i,t,s){var n=e(i).find(".cycle-sentinel"),o=e(t),d=o.find("video.sow-background-element");if(void 0==s?n.css("height",o.outerHeight()):n.animate({height:o.outerHeight()},s),d.length){var c=o.outerWidth()/o.outerHeight(),l=d.outerWidth()/d.outerHeight();c>l?d.css({width:"100%",height:"auto"}):d.css({width:"auto",height:"100%"}),d.css({"margin-left":-Math.ceil(d.width()/2),"margin-top":-Math.ceil(d.height()/2)})}}}},jQuery(function(e){sowb.setupSliders=sowb.setupSlider=function(){var i=new sowb.SiteOriginSlider(e);e(".sow-slider-images").each(function(){var t=e(this),s=t.siblings(".sow-slider-pagination"),n=t.closest(".sow-slider-base"),o=n.find(".sow-slide-nav"),d=t.find(".sow-slider-image"),c=t.data("settings");d.each(function(i,t){var s=e(t),n=s.data("url");s.click(function(i){if(void 0!==n){var t=e(i.target);"A"!==t.prop("tagName")&&(i.preventDefault(),window.open(n.url,n.new_window?"_blank":"_self"))}})});var l=function(){if(n.show(),t.find(".sow-slider-image").each(function(){var i=e(this);e(window).on("resize panelsStretchRows",function(){i.css("height",i.find(".sow-slider-image-wrapper").outerHeight())}).resize()}),t.on({"cycle-after":function(t,s,n,o,d){var c=e(this);i.playSlideVideo(o),i.setupActiveSlide(c,o),e(o).trigger("sowSlideCycleAfter")},"cycle-before":function(t,n,o,d,c){var l=e(this);s.find("> li").removeClass("sow-active").eq(n.slideNum-1).addClass("sow-active"),i.pauseSlideVideo(o),i.setupActiveSlide(l,d,n.speed),e(d).trigger("sowSlideCycleBefore")},"cycle-initialized":function(n,d){i.playSlideVideo(e(this).find(".cycle-slide-active")),i.setupActiveSlide(t,d.slides[0]),s.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),e(this).find(".cycle-slide-active").trigger("sowSlideInitial"),d.slideCount<=1&&(s.hide(),o.hide()),e(window).resize()}}).cycle({slides:"> .sow-slider-image",speed:c.speed,timeout:c.timeout,swipe:c.swipe,"swipe-fx":"scrollHorz"}),t.find("video.sow-background-element").on("loadeddata",function(){i.setupActiveSlide(t,t.find(".cycle-slide-active"))}),s.add(o).hide(),!n.hasClass("sow-slider-is-mobile")&&d.length>1){var l=!1;n.mouseenter(function(){s.add(o).clearQueue().fadeIn(150),l=!1}).mouseleave(function(){l=!0,setTimeout(function(){l&&s.add(o).clearQueue().fadeOut(150),l=!1},750)})}e(window).resize(function(){i.setupActiveSlide(t,t.find(".cycle-slide-active"))}),s.find("> li > a").click(function(i){i.preventDefault(),t.cycle("goto",e(this).data("goto"))}),o.find("> a").click(function(i){i.preventDefault(),t.cycle(e(this).data("action"))}),n.keydown(function(e){37===e.which?t.cycle("prev"):39===e.which&&t.cycle("next")})},a=t.find("img"),r=0,u=!1;a.each(function(){e(this);this.complete?r++:e(this).one("load",function(){r++,r!==a.length||u||(l(),u=!0)}).attr("src",e(this).attr("src")),r!==a.length||u||(l(),u=!0)}),0===a.length&&l()})},sowb.setupSliders(),e(sowb).on("setup_widgets",sowb.setupSliders)});
readme.txt CHANGED
@@ -1,11 +1,12 @@
1
=== SiteOrigin Widgets Bundle ===
2
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
Requires at least: 3.9
4
- Tested up to: 4.7
5
- Stable tag: 1.7.2
6
- Build time: 2016-11-10T09:26:59+02:00
7
License: GPLv3 or later
8
Contributors: gpriday, braam-genis
9
10
== Description ==
11
@@ -51,6 +52,25 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
51
52
== Changelog ==
53