SiteOrigin Widgets Bundle - Version 1.9.5

Version Description

  • 25 July 2017 =
  • Fixed icon field selection.
  • TinyMCE field is initialized when quicktags is selected.
  • Autocomplete field only initialized once.
  • Posts field sanitization handles multiple post types.
Download this release

Release Info

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

Code changes from version 1.9.4 to 1.9.5

base/inc/fields/js/autocomplete-field.js CHANGED
@@ -5,6 +5,10 @@
5
  $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-autocomplete', function ( e ) {
6
  var $$ = $(this);
7
 
 
 
 
 
8
  var getSelectedItems = function() {
9
  var selectedItems = $$.find( 'input.siteorigin-widget-input' ).val();
10
  return selectedItems.length === 0 ? [] : selectedItems.split( ',' );
@@ -120,6 +124,8 @@
120
  refreshList();
121
  }, 500);
122
  } );
 
 
123
  } );
124
 
125
  })( jQuery );
5
  $( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-autocomplete', function ( e ) {
6
  var $$ = $(this);
7
 
8
+ if ( $$.data( 'initialized' ) ) {
9
+ return;
10
+ }
11
+
12
  var getSelectedItems = function() {
13
  var selectedItems = $$.find( 'input.siteorigin-widget-input' ).val();
14
  return selectedItems.length === 0 ? [] : selectedItems.split( ',' );
124
  refreshList();
125
  }, 500);
126
  } );
127
+
128
+ $$.data( 'initialized', true );
129
  } );
130
 
131
  })( jQuery );
base/inc/fields/js/autocomplete-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(t){var n=e(this),i=function(){var e=n.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},s=function(){var t=i();n.find("ul.items > li").each(function(n,i){var s=e(this);t.indexOf(s.data("value"))>-1?s.addClass("selected"):s.removeClass("selected")})},a=null,l=function(){null!==a&&a.abort();var t=n.find(".content-text-search"),i=t.val(),s=t.data("source"),l=t.data("postTypes"),o={action:"so_widgets_search_"+s};"posts"===s?(o.query=i,o.postTypes=l):"terms"===s&&(o.term=i);var d=n.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,o,function(t){t.forEach(function(t){""===t.label&&(t.label="&nbsp;"),d.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))}),d.removeClass("loading")})};n.find(".siteorigin-widget-autocomplete-input").click(function(){var t=n.find(".existing-content-selector");t.show();var i=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?i=l():i.resolve(),i.done(s)});var o=function(){n.find(".existing-content-selector").hide()};e(window).mousedown(function(e){var t=0===n.find(e.target).length;t&&o()}),n.find(".button-close").click(o),n.on("click",".items li",function(t){t.preventDefault();var s=e(this),a=i(),l=s.data("value"),o=a.indexOf(l);o>-1?(a.splice(o,1),s.removeClass("selected")):(a.push(l),s.addClass("selected"));var d=n.find("input.siteorigin-widget-input");d.val(a.join(",")),d.change()});var d=null;n.find(".content-text-search").keyup(function(){null!==d&&clearTimeout(d),d=setTimeout(function(){l()},500)})})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(t){var i=e(this);if(!i.data("initialized")){var n=function(){var e=i.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},a=function(){var t=n();i.find("ul.items > li").each(function(i,n){var a=e(this);t.indexOf(a.data("value"))>-1?a.addClass("selected"):a.removeClass("selected")})},l=null,s=function(){null!==l&&l.abort();var t=i.find(".content-text-search"),n=t.val(),a=t.data("source"),s=t.data("postTypes"),o={action:"so_widgets_search_"+a};"posts"===a?(o.query=n,o.postTypes=s):"terms"===a&&(o.term=n);var d=i.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,o,function(t){t.forEach(function(t){""===t.label&&(t.label="&nbsp;"),d.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))}),d.removeClass("loading")})};i.find(".siteorigin-widget-autocomplete-input").click(function(){var t=i.find(".existing-content-selector");t.show();var n=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?n=s():n.resolve(),n.done(a)});var o=function(){i.find(".existing-content-selector").hide()};e(window).mousedown(function(e){var t=0===i.find(e.target).length;t&&o()}),i.find(".button-close").click(o),i.on("click",".items li",function(t){t.preventDefault();var a=e(this),l=n(),s=a.data("value"),o=l.indexOf(s);o>-1?(l.splice(o,1),a.removeClass("selected")):(l.push(s),a.addClass("selected"));var d=i.find("input.siteorigin-widget-input");d.val(l.join(",")),d.change()});var d=null;i.find(".content-text-search").keyup(function(){null!==d&&clearTimeout(d),d=setTimeout(function(){s()},500)}),i.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/icon-field.js CHANGED
@@ -12,6 +12,10 @@
12
  $remove = $$.find( '.so-icon-remove' ),
13
  $search = $$.find( '.siteorigin-widget-icon-search' );
14
 
 
 
 
 
15
  // Clicking on the button should display the icon selector
16
  $b.click( function(){
17
  $is.slideToggle();
@@ -172,6 +176,8 @@
172
  rerenderIcons();
173
  }
174
  } );
 
 
175
  } );
176
 
177
  } )( jQuery );
12
  $remove = $$.find( '.so-icon-remove' ),
13
  $search = $$.find( '.siteorigin-widget-icon-search' );
14
 
15
+ if ( $$.data( 'initialized' ) ) {
16
+ return;
17
+ }
18
+
19
  // Clicking on the button should display the icon selector
20
  $b.click( function(){
21
  $is.slideToggle();
176
  rerenderIcons();
177
  }
178
  } );
179
+
180
+ $$.data( 'initialized', true );
181
  } );
182
 
183
  } )( jQuery );
base/inc/fields/js/icon-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(n){var t=i(this),o=t.find(".siteorigin-widget-icon-selector"),s=o.find(".siteorigin-widget-icon-icon"),a=t.find(".siteorigin-widget-icon-selector-current"),d=t.find(".so-icon-remove"),c=t.find(".siteorigin-widget-icon-search");a.click(function(){o.slideToggle(),c.val(""),r()}),d.click(function(i){i.preventDefault(),t.find(".siteorigin-widget-active").click()});var r=function(){var e=c.val().toLowerCase();""===e?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each(function(){var n=i(this),t=n.attr("data-value");t=t.replace(/-/," "),t.indexOf(e)===-1?n.hide():n.show()})};c.keyup(r).change(r);var g=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof e[n]){t.empty(),0===i("#siteorigin-widget-font-"+n).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+n).attr("href",e[n].style_uri).appendTo("head");for(var c in e[n].icons){var g=i('<div data-sow-icon="'+e[n].icons[c]+'"/>').attr("data-value",n+"-"+c).addClass("sow-icon-"+n).addClass("siteorigin-widget-icon-icons-icon").click(function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),s.val(""),a.find("span").hide(),d.hide()):(t.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),s.val(e.data("value")),a.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),d.show()),s.trigger("change",{isRendering:!0}),o.slideUp()});t.append(g),s.val()===n+"-"+c&&(a.find("span").show().attr("data-sow-icon",g.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),g.addClass("siteorigin-widget-active"))}t.prepend(t.find(".siteorigin-widget-active")),r()}},l=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==t&&(e[n]=t),"undefined"!=typeof n&&""!==n&&("undefined"==typeof e[n]?i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},function(i){e[n]=i,g()}):g())};l(),o.find("select.siteorigin-widget-icon-family").change(function(){o.find(".siteorigin-widget-icon-icons").empty(),l()}),s.change(function(i,e){e&&e.isRendering||g()})})}(jQuery);
1
+ !function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(n){var t=i(this),o=t.find(".siteorigin-widget-icon-selector"),a=o.find(".siteorigin-widget-icon-icon"),s=t.find(".siteorigin-widget-icon-selector-current"),d=t.find(".so-icon-remove"),c=t.find(".siteorigin-widget-icon-search");if(!t.data("initialized")){s.click(function(){o.slideToggle(),c.val(""),r()}),d.click(function(i){i.preventDefault(),t.find(".siteorigin-widget-active").click()});var r=function(){var e=c.val().toLowerCase();""===e?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each(function(){var n=i(this),t=n.attr("data-value");t=t.replace(/-/," "),t.indexOf(e)===-1?n.hide():n.show()})};c.keyup(r).change(r);var g=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof e[n]){t.empty(),0===i("#siteorigin-widget-font-"+n).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+n).attr("href",e[n].style_uri).appendTo("head");for(var c in e[n].icons){var g=i('<div data-sow-icon="'+e[n].icons[c]+'"/>').attr("data-value",n+"-"+c).addClass("sow-icon-"+n).addClass("siteorigin-widget-icon-icons-icon").click(function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),a.val(""),s.find("span").hide(),d.hide()):(t.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),a.val(e.data("value")),s.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),d.show()),a.trigger("change",{isRendering:!0}),o.slideUp()});t.append(g),a.val()===n+"-"+c&&(s.find("span").show().attr("data-sow-icon",g.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+n),g.addClass("siteorigin-widget-active"))}t.prepend(t.find(".siteorigin-widget-active")),r()}},l=function(){var n=o.find("select.siteorigin-widget-icon-family").val(),t=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==t&&(e[n]=t),"undefined"!=typeof n&&""!==n&&("undefined"==typeof e[n]?i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},function(i){e[n]=i,g()}):g())};l(),o.find("select.siteorigin-widget-icon-family").change(function(){o.find(".siteorigin-widget-icon-icons").empty(),l()}),a.change(function(i,e){e&&e.isRendering||g()}),t.data("initialized",!0)}})}(jQuery);
base/inc/fields/js/tinymce-field.js CHANGED
@@ -33,19 +33,17 @@
33
 
34
  wp.editor.remove( id );
35
 
36
- if (settings.selectedEditor === 'tmce' ) {
37
- // Add a small timeout to make sure everything is ready - mainly for customizer and widgets interface
38
- if ( $textarea.is( ':visible' ) ) {
39
- wp.editor.initialize( id, settings );
40
- }
41
- else {
42
- var intervalId = setInterval( function () {
43
- if ( $textarea.is( ':visible' ) ) {
44
- wp.editor.initialize( id, settings );
45
- clearInterval( intervalId );
46
- }
47
- }, 500);
48
- }
49
  }
50
 
51
  $$.on( 'click', function ( event ) {
33
 
34
  wp.editor.remove( id );
35
 
36
+ // Wait for textarea to be visible before initialization.
37
+ if ( $textarea.is( ':visible' ) ) {
38
+ wp.editor.initialize( id, settings );
39
+ }
40
+ else {
41
+ var intervalId = setInterval( function () {
42
+ if ( $textarea.is( ':visible' ) ) {
43
+ wp.editor.initialize( id, settings );
44
+ clearInterval( intervalId );
45
+ }
46
+ }, 500);
 
 
47
  }
48
 
49
  $$.on( 'click', function ( event ) {
base/inc/fields/js/tinymce-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(t){var i=e(this),n=i.find(".siteorigin-widget-tinymce-container"),o=n.data("editorSettings"),c=n.find("textarea"),r=c.attr("id"),s=function(e){e.on("change",function(){window.tinymce.get(r).save(),c.trigger("change")})};if(o.tinymce=e.extend({},o.tinymce,{selector:"#"+r,setup:s}),e(document).one("wp-before-tinymce-init",function(e,t){if(t.selector===o.tinymce.selector){var c=n.data("mediaButtons");i.find(".wp-editor-tabs").before(c.html)}}),e(document).one("tinymce-editor-setup",function(){i.find(".wp-editor-wrap").hasClass(o.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(r)},10)}),wp.editor.remove(r),"tmce"===o.selectedEditor)if(c.is(":visible"))wp.editor.initialize(r,o);else var a=setInterval(function(){c.is(":visible")&&(wp.editor.initialize(r,o),clearInterval(a))},500);i.on("click",function(t){var n=e(t.target);if(n.hasClass("wp-switch-editor")){var o=n.hasClass("switch-tmce")?"tmce":"html";if("tmce"===o){var s=window.tinymce.get(r);if(null!==s){var a=c.val();a.search("<")!==-1&&a.search(">")===-1&&(a=a.replace(/</g,""),c.val(a)),s.setContent(window.switchEditors.wpautop(a))}}i.find(".siteorigin-widget-tinymce-selected-editor").val(o)}})})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(t){var i=e(this),n=i.find(".siteorigin-widget-tinymce-container"),o=n.data("editorSettings"),c=n.find("textarea"),r=c.attr("id"),s=function(e){e.on("change",function(){window.tinymce.get(r).save(),c.trigger("change")})};if(o.tinymce=e.extend({},o.tinymce,{selector:"#"+r,setup:s}),e(document).one("wp-before-tinymce-init",function(e,t){if(t.selector===o.tinymce.selector){var c=n.data("mediaButtons");i.find(".wp-editor-tabs").before(c.html)}}),e(document).one("tinymce-editor-setup",function(){i.find(".wp-editor-wrap").hasClass(o.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(r)},10)}),wp.editor.remove(r),c.is(":visible"))wp.editor.initialize(r,o);else var a=setInterval(function(){c.is(":visible")&&(wp.editor.initialize(r,o),clearInterval(a))},500);i.on("click",function(t){var n=e(t.target);if(n.hasClass("wp-switch-editor")){var o=n.hasClass("switch-tmce")?"tmce":"html";if("tmce"===o){var s=window.tinymce.get(r);if(null!==s){var a=c.val();a.search("<")!==-1&&a.search(">")===-1&&(a=a.replace(/</g,""),c.val(a)),s.setContent(window.switchEditors.wpautop(a))}}i.find(".siteorigin-widget-tinymce-selected-editor").val(o)}})})}(jQuery);
base/inc/fields/posts.class.php CHANGED
@@ -170,6 +170,9 @@ class SiteOrigin_Widget_Field_Posts extends SiteOrigin_Widget_Field_Container_Ba
170
  $result = '';
171
  foreach ( $value as $key => $item ) {
172
  if ( ! empty( $item ) ) {
 
 
 
173
  $result .= ( empty( $result ) ? '' : '&' ) . $key . '=' . $item;
174
  }
175
  }
170
  $result = '';
171
  foreach ( $value as $key => $item ) {
172
  if ( ! empty( $item ) ) {
173
+ if ( is_array( $item ) ) {
174
+ $item = implode( ',', $item );
175
+ }
176
  $result .= ( empty( $result ) ? '' : '&' ) . $key . '=' . $item;
177
  }
178
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 4.2
4
  Tested up to: 4.8
5
- Stable tag: 1.9.3
6
- Build time: 2017-07-24T09:59:35+02:00
7
  License: GPLv3 or later
8
  Contributors: gpriday, braam-genis
9
  Donate link: https://siteorigin.com/downloads/contribution/
@@ -54,6 +54,12 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
57
  = 1.9.4 - 24 July 2017 =
58
  * Using new Editor JS API for TinyMCE field.
59
  * Carousel: apply static position on `.overlay`.
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 4.2
4
  Tested up to: 4.8
5
+ Stable tag: 1.9.5
6
+ Build time: 2017-07-25T10:31:10+02:00
7
  License: GPLv3 or later
8
  Contributors: gpriday, braam-genis
9
  Donate link: https://siteorigin.com/downloads/contribution/
54
 
55
  == Changelog ==
56
 
57
+ = 1.9.5 - 25 July 2017 =
58
+ * Fixed icon field selection.
59
+ * TinyMCE field is initialized when quicktags is selected.
60
+ * Autocomplete field only initialized once.
61
+ * Posts field sanitization handles multiple post types.
62
+
63
  = 1.9.4 - 24 July 2017 =
64
  * Using new Editor JS API for TinyMCE field.
65
  * Carousel: apply static position on `.overlay`.
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
- Version: 1.9.4
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
@@ -12,7 +12,7 @@ License: GPL3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
- define('SOW_BUNDLE_VERSION', '1.9.4');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
+ Version: 1.9.5
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define('SOW_BUNDLE_VERSION', '1.9.5');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set