SiteOrigin Widgets Bundle - Version 1.40.0

Version Description

  • 20 August 2022 =
  • Blog: Added Excerpt Length setting. The excerpt length can also be set using siteorigin_widgets_blog_excerpt_length.
  • Blog: Resolved a Portfolio template column sizing issue.
Download this release

Release Info

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

Code changes from version 1.39.0 to 1.40.0

base/inc/fields/select.class.php CHANGED
@@ -31,7 +31,7 @@ class SiteOrigin_Widget_Field_Select extends SiteOrigin_Widget_Field_Base {
31
  protected function render_field( $value, $instance ) {
32
  ?>
33
  <select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
34
- class="siteorigin-widget-input<?php if ( ! empty( $this->input_css_classes ) ) echo ' ' . implode( ' ', $this->input_css_classes ) ?>"
35
  <?php if( ! empty( $this->multiple ) ) echo 'multiple' ?>>
36
  <?php if ( empty( $this->multiple ) && isset( $this->prompt ) ) : ?>
37
  <option value="default" disabled="disabled" selected="selected"><?php echo esc_html( $this->prompt ) ?></option>
31
  protected function render_field( $value, $instance ) {
32
  ?>
33
  <select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>"
34
+ class="siteorigin-widget-input siteorigin-widget-input-select<?php if ( ! empty( $this->input_css_classes ) ) echo ' ' . implode( ' ', $this->input_css_classes ) ?>"
35
  <?php if( ! empty( $this->multiple ) ) echo 'multiple' ?>>
36
  <?php if ( empty( $this->multiple ) && isset( $this->prompt ) ) : ?>
37
  <option value="default" disabled="disabled" selected="selected"><?php echo esc_html( $this->prompt ) ?></option>
base/js/admin.js CHANGED
@@ -1447,6 +1447,7 @@ var sowbForms = window.sowbForms || {};
1447
  (
1448
  ! $$.hasClass( 'siteorigin-widget-input-color' ) &&
1449
  ! $$.hasClass( 'siteorigin-widget-input-slider' ) &&
 
1450
  ! $$.attr( 'type' ) == 'checkbox'
1451
  )
1452
  ) {
1447
  (
1448
  ! $$.hasClass( 'siteorigin-widget-input-color' ) &&
1449
  ! $$.hasClass( 'siteorigin-widget-input-slider' ) &&
1450
+ ! $$.is( 'siteorigin-widget-input-select' ) &&
1451
  ! $$.attr( 'type' ) == 'checkbox'
1452
  )
1453
  ) {
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!s.hasClass("block-editor-page")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var p={},c=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==c){var u={};for(var w in f)u[w.replace("{$repeater}",c)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===p[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var k=0;k<l.length&&!(d=n.group===t&&l[k]===r);k++);}if(d){s=f[y],n.multi||(s=[s]);for(k=0;k<s.length;k++){var F=!1;if((o=void 0!==s[k][1]&&Boolean(s[k][1])?g.find(s[k][1]):g).prop("style").length&&("show"==s[k][0]?(o.fadeIn("fast"),F=!0):"hide"==s[k][0]&&(o.fadeOut("fast"),F=!0)),F||o[s[k][0]].apply(o,void 0!==s[k][2]?s[k][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}p[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").on("click",(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),p=JSON.parse(sessionStorage.getItem(l));p&&(p._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,p),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.on("change",(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var c=n.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var u=c.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(i){("keyup"!=i.type||sowbForms.isEnter(i))&&(e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).trigger("resize"),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})))};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").on("click keyup",w).attr("tabinex",0),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").on("click keyup",w),c.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.on("change",(function(e,n){n&&n.silent||(r.slider("value",parseFloat(t.val())),i.find(".siteorigin-widget-slider-value").html(t.val()))}))})),c.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r={action:"so_widgets_search_posts",query:t.val(),postTypes:t.data("postTypes")};"string"==typeof icl_this_lang&&(r.language=icl_this_lang);var n=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,r,(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),n.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]).attr("tabindex",0));n.removeClass("loading")}))};i.find(".select-content-button, .button-close").on("click",(function(r){r.preventDefault(),e(this).trigger("blur");var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click keyup",".posts li",(function(t){if(t.preventDefault(),"keyup"!=t.type||sowbForms.isEnter(t)){var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.trigger("change"),i.find(".existing-content-selector").toggle()}}));var r=null;i.find(".content-text-search").on("keyup",(function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return i.parent().hasClass("siteorigin-widget-field-type-media")&&"conditional"==t.callback&&(s||(s=i.hasClass("media-fallback-external")?i.prev().val():fallbackField=i.next().val()),0==s&&(s="")),e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};c.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").trigger("submit"),n.find(".close").on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.on("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,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==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 r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n+"px"),i.css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().on("click keyup",(function(i){i.preventDefault(),("keyup"!=i.type||sowbForms.isEnter(i))&&r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).trigger("resize")}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").on("click",(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).trigger("resize")}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[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.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable"></div>').append(e('<div class="siteorigin-widget-field-repeater-item-top" tabindex="0" />').append(e('<div class="siteorigin-widget-field-expand" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" tabindex="0" />')).append(e("<h4></h4>").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form"></div>').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).trigger("resize")})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label"),o=r.parents(".siteorigin-widget-field-repeater").data("item-name");if(s&&(s.hasOwnProperty("selector")||s.hasOwnProperty("selectorArray"))){var d=function(){var e,i,t;if(s.hasOwnProperty("selectorArray"))for(var n=0;n<s.selectorArray.length&&(e=(t=s.selectorArray[n]).hasOwnProperty("valueMethod")&&t.valueMethod?t.valueMethod:"val",!(i=r.find(t.selector)[e]()));n++);else e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();if(i)i.length>80&&(i=i.substr(0,79)+"...");else if(i=o,s.increment){var d=r.index();d++,isNaN(d)||("before"==s.increment?i=d+" "+i:i+=" "+d)}a.find("h4").text(i)};d();var l=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.on(l,d)}a.on("click keyup",(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&("keyup"!=i.type||sowbForms.isEnter(i))&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).trigger("resize"),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").on("click keyup",(function(i,t){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var a=e(this).closest(".siteorigin-widget-field-repeater-items"),s=e(this).closest(".siteorigin-widget-field-repeater-item"),o=function(){s.remove(),a.sortable("refresh").trigger("updateFieldPositions"),e(window).trigger("resize"),n.trigger("change")};t&&t.silent?o():confirm(soWidgets.sure)&&s.slideUp("fast",o),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment&&r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change")}})),a.find(".siteorigin-widget-field-copy").on("click keyup",(function(i){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.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 g=tinymce.get(s);if(g){var f=g.getContent();_.isEmpty(f)?-1!==f.search("<")&&-1===f.search(">")&&$textarea.val(f.replace(/</g,"")):i.val(f)}}else if(i.is(".wp-color-picker")){var p=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");p.remove(),c.append(i.remove())}else{var u=s?n.find("#"+s):n.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var w,m;if(i.is('[type="radio"]')){w=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[w]){var h={};d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!h[r]&&(h[r]=!0,!0)})).length+1}var b=w+"-"+d[w];m=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else F=new RegExp("-\\d+$"),w=s.replace(F,""),d[w]||(d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").length+1),m=w+"-"+d[w]++;if(i.is(".wp-editor-area")&&(m+=Math.floor(1e3*Math.random()),i.data("tinymce-id",m)),i.attr("id",m),i.is(".wp-editor-area")){var y=i.closest(".siteorigin-widget-tinymce-container"),k=y.data("media-buttons");if(k&&k.html){var F=new RegExp(s,"g");k.html=k.html.replace(F,m),y.data("media-buttons",k)}}a.find("label[for="+s+"]").attr("for",m),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,m);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var C=n.parents(".siteorigin-widget-field-repeater").length,x=e("body");(x.hasClass("wp-customizer")||x.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(C+=1);var E=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(C-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",E),i.data("original-name",E)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).trigger("resize")})),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment?r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change"):r.trigger("change")}})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.isEnter=function(i,t=!1){if(13==i.which){if(!t)return!0;e(i.target).trigger("click")}},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),p=f.length?t:null;f.length;){var c=f.shift();p=p.hasOwnProperty(c)?p[c]:p}l=p}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").trigger("click");else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),$fields=i.find("*[name]");var o=function(e){return e.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e})),e},d=function(e,i){for(var t,n=e,a=0;a<i.length;a++){if(!n.hasOwnProperty(i[a])){if(r)continue;break}a===i.length-1?t=n[i[a]]:n=n[i[a]]}return{sub:n,value:t}},l=function(e,i){if(i){if(e!==i)return!0}else if(e)return!0;return!1},g=function(i,a){for(;i<a.length;i++){if(0!=i&&i+1<a.length&&i%20==0)return void setTimeout(g,150,i+1,a);var s=e(a[i]),f=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(s.attr("name"));if(null==f)return!0;if(!(s.hasClass("sow-measurement-select-unit")||s.attr("data-presets")||s.parent().hasClass("siteorigin-widget-field-type-posts")||"hidden"==s.attr("type"))){var p=(f=f[1]).split("][");p=o(p);var c=d(t,p);if((!r||""!=c.value)&&void 0!==c.value){var u=!1;if("checkbox"===s.attr("type")&&s.is(":checked")!=c.value)s.prop("checked",c.value),u=!0;else if("radio"===s.attr("type"))s.prop("checked",c.value===s.val()),u=!0;else if("TEXTAREA"===s.prop("tagName")&&s.hasClass("wp-editor-area")){var w=null;"undefined"!=typeof tinyMCE&&(w=tinyMCE.get(s.attr("id"))),null!==w&&"function"==typeof w.setContent&&!w.isHidden()&&s.parent().is(":visible")?l(w.getContent(),c.value)&&(w.initialized?(w.setContent(c.value),u=!0):(w.on("init",(function(){w.setContent(c.value)})),u=!0)):l(s.val(),c.value)&&(s.val(c.value),u=!0)}else if(s.is(".panels-data")){if(l(s.val(),c.value)){s.val(c.value);var m=s.data("builder");m&&(m.setDataField(s),u=!0)}}else l(s.val(),c.value)&&(s.val(c.value),u=!0);if(n&&u){if("preset"==n&&!s.hasClass("siteorigin-widget-input-color")&&!s.hasClass("siteorigin-widget-input-slider")&&"checkbox"==!s.attr("type"))continue;s.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}}}}};g(0,$fields)},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'" tabindex="0">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},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)}));var i=e("body");e(document).on("widget-added",(function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=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-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!s.hasClass("block-editor-page")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var p={},c=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==c){var u={};for(var w in f)u[w.replace("{$repeater}",c)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===p[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var k=0;k<l.length&&!(d=n.group===t&&l[k]===r);k++);}if(d){s=f[y],n.multi||(s=[s]);for(k=0;k<s.length;k++){var F=!1;if((o=void 0!==s[k][1]&&Boolean(s[k][1])?g.find(s[k][1]):g).prop("style").length&&("show"==s[k][0]?(o.fadeIn("fast"),F=!0):"hide"==s[k][0]&&(o.fadeOut("fast"),F=!0)),F||o[s[k][0]].apply(o,void 0!==s[k][2]?s[k][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}p[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").on("click",(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),p=JSON.parse(sessionStorage.getItem(l));p&&(p._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,p),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.on("change",(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var c=n.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var u=c.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(i){("keyup"!=i.type||sowbForms.isEnter(i))&&(e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).trigger("resize"),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})))};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").on("click keyup",w).attr("tabinex",0),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").on("click keyup",w),c.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.on("change",(function(e,n){n&&n.silent||(r.slider("value",parseFloat(t.val())),i.find(".siteorigin-widget-slider-value").html(t.val()))}))})),c.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r={action:"so_widgets_search_posts",query:t.val(),postTypes:t.data("postTypes")};"string"==typeof icl_this_lang&&(r.language=icl_this_lang);var n=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,r,(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),n.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]).attr("tabindex",0));n.removeClass("loading")}))};i.find(".select-content-button, .button-close").on("click",(function(r){r.preventDefault(),e(this).trigger("blur");var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click keyup",".posts li",(function(t){if(t.preventDefault(),"keyup"!=t.type||sowbForms.isEnter(t)){var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.trigger("change"),i.find(".existing-content-selector").toggle()}}));var r=null;i.find(".content-text-search").on("keyup",(function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return i.parent().hasClass("siteorigin-widget-field-type-media")&&"conditional"==t.callback&&(s||(s=i.hasClass("media-fallback-external")?i.prev().val():fallbackField=i.next().val()),0==s&&(s="")),e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};c.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").trigger("submit"),n.find(".close").on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.on("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,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==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 r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n+"px"),i.css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().on("click keyup",(function(i){i.preventDefault(),("keyup"!=i.type||sowbForms.isEnter(i))&&r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).trigger("resize")}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").on("click",(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).trigger("resize")}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[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.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable"></div>').append(e('<div class="siteorigin-widget-field-repeater-item-top" tabindex="0" />').append(e('<div class="siteorigin-widget-field-expand" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" tabindex="0" />')).append(e("<h4></h4>").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form"></div>').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).trigger("resize")})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label"),o=r.parents(".siteorigin-widget-field-repeater").data("item-name");if(s&&(s.hasOwnProperty("selector")||s.hasOwnProperty("selectorArray"))){var d=function(){var e,i,t;if(s.hasOwnProperty("selectorArray"))for(var n=0;n<s.selectorArray.length&&(e=(t=s.selectorArray[n]).hasOwnProperty("valueMethod")&&t.valueMethod?t.valueMethod:"val",!(i=r.find(t.selector)[e]()));n++);else e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();if(i)i.length>80&&(i=i.substr(0,79)+"...");else if(i=o,s.increment){var d=r.index();d++,isNaN(d)||("before"==s.increment?i=d+" "+i:i+=" "+d)}a.find("h4").text(i)};d();var l=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.on(l,d)}a.on("click keyup",(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&("keyup"!=i.type||sowbForms.isEnter(i))&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).trigger("resize"),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").on("click keyup",(function(i,t){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var a=e(this).closest(".siteorigin-widget-field-repeater-items"),s=e(this).closest(".siteorigin-widget-field-repeater-item"),o=function(){s.remove(),a.sortable("refresh").trigger("updateFieldPositions"),e(window).trigger("resize"),n.trigger("change")};t&&t.silent?o():confirm(soWidgets.sure)&&s.slideUp("fast",o),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment&&r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change")}})),a.find(".siteorigin-widget-field-copy").on("click keyup",(function(i){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.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 g=tinymce.get(s);if(g){var f=g.getContent();_.isEmpty(f)?-1!==f.search("<")&&-1===f.search(">")&&$textarea.val(f.replace(/</g,"")):i.val(f)}}else if(i.is(".wp-color-picker")){var p=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");p.remove(),c.append(i.remove())}else{var u=s?n.find("#"+s):n.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var w,m;if(i.is('[type="radio"]')){w=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[w]){var h={};d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!h[r]&&(h[r]=!0,!0)})).length+1}var b=w+"-"+d[w];m=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else F=new RegExp("-\\d+$"),w=s.replace(F,""),d[w]||(d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").length+1),m=w+"-"+d[w]++;if(i.is(".wp-editor-area")&&(m+=Math.floor(1e3*Math.random()),i.data("tinymce-id",m)),i.attr("id",m),i.is(".wp-editor-area")){var y=i.closest(".siteorigin-widget-tinymce-container"),k=y.data("media-buttons");if(k&&k.html){var F=new RegExp(s,"g");k.html=k.html.replace(F,m),y.data("media-buttons",k)}}a.find("label[for="+s+"]").attr("for",m),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,m);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var C=n.parents(".siteorigin-widget-field-repeater").length,x=e("body");(x.hasClass("wp-customizer")||x.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(C+=1);var E=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(C-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",E),i.data("original-name",E)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).trigger("resize")})),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment?r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change"):r.trigger("change")}})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.isEnter=function(i,t=!1){if(13==i.which){if(!t)return!0;e(i.target).trigger("click")}},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),p=f.length?t:null;f.length;){var c=f.shift();p=p.hasOwnProperty(c)?p[c]:p}l=p}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").trigger("click");else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),$fields=i.find("*[name]");var o=function(e){return e.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e})),e},d=function(e,i){for(var t,n=e,a=0;a<i.length;a++){if(!n.hasOwnProperty(i[a])){if(r)continue;break}a===i.length-1?t=n[i[a]]:n=n[i[a]]}return{sub:n,value:t}},l=function(e,i){if(i){if(e!==i)return!0}else if(e)return!0;return!1},g=function(i,a){for(;i<a.length;i++){if(0!=i&&i+1<a.length&&i%20==0)return void setTimeout(g,150,i+1,a);var s=e(a[i]),f=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(s.attr("name"));if(null==f)return!0;if(!(s.hasClass("sow-measurement-select-unit")||s.attr("data-presets")||s.parent().hasClass("siteorigin-widget-field-type-posts")||"hidden"==s.attr("type"))){var p=(f=f[1]).split("][");p=o(p);var c=d(t,p);if((!r||""!=c.value)&&void 0!==c.value){var u=!1;if("checkbox"===s.attr("type")&&s.is(":checked")!=c.value)s.prop("checked",c.value),u=!0;else if("radio"===s.attr("type"))s.prop("checked",c.value===s.val()),u=!0;else if("TEXTAREA"===s.prop("tagName")&&s.hasClass("wp-editor-area")){var w=null;"undefined"!=typeof tinyMCE&&(w=tinyMCE.get(s.attr("id"))),null!==w&&"function"==typeof w.setContent&&!w.isHidden()&&s.parent().is(":visible")?l(w.getContent(),c.value)&&(w.initialized?(w.setContent(c.value),u=!0):(w.on("init",(function(){w.setContent(c.value)})),u=!0)):l(s.val(),c.value)&&(s.val(c.value),u=!0)}else if(s.is(".panels-data")){if(l(s.val(),c.value)){s.val(c.value);var m=s.data("builder");m&&(m.setDataField(s),u=!0)}}else l(s.val(),c.value)&&(s.val(c.value),u=!0);if(n&&u){if("preset"==n&&!s.hasClass("siteorigin-widget-input-color")&&!s.hasClass("siteorigin-widget-input-slider")&&!s.is("siteorigin-widget-input-select")&&"checkbox"==!s.attr("type"))continue;s.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}}}}};g(0,$fields)},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'" tabindex="0">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},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)}));var i=e("body");e(document).on("widget-added",(function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=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-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
lang/so-widgets-bundle.pot CHANGED
@@ -156,7 +156,7 @@ msgstr ""
156
  msgid "Filter Widgets"
157
  msgstr ""
158
 
159
- #: admin/tpl/admin.php:17, widgets/google-map/google-map.php:366, base/inc/fields/posts.class.php:23, widgets/blog/tpl/base.php:34
160
  msgid "All"
161
  msgstr ""
162
 
@@ -328,7 +328,7 @@ msgstr ""
328
  msgid "Closed"
329
  msgstr ""
330
 
331
- #: widgets/accordion/accordion.php:111, widgets/blog/blog.php:139, widgets/contact/contact.php:396, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:101, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:350
332
  msgid "Design"
333
  msgstr ""
334
 
@@ -400,7 +400,7 @@ msgstr ""
400
  msgid "Item"
401
  msgstr ""
402
 
403
- #: widgets/anything-carousel/anything-carousel.php:108, widgets/blog/blog.php:166, widgets/blog/blog.php:193, widgets/blog/blog.php:220, widgets/blog/blog.php:257, widgets/blog/blog.php:310, widgets/blog/blog.php:342, widgets/blog/blog.php:516, widgets/button/button.php:201, widgets/contact/contact.php:450, widgets/contact/contact.php:500, widgets/features/features.php:158, widgets/features/features.php:179, widgets/features/features.php:200, widgets/headline/headline.php:88, widgets/headline/headline.php:169, base/inc/widgets/base-carousel.class.php:374
404
  msgid "Font"
405
  msgstr ""
406
 
@@ -408,7 +408,7 @@ msgstr ""
408
  msgid "Font size"
409
  msgstr ""
410
 
411
- #: widgets/anything-carousel/anything-carousel.php:116, widgets/blog/blog.php:175, widgets/blog/blog.php:202, widgets/blog/blog.php:229, widgets/blog/blog.php:266, widgets/blog/blog.php:319, widgets/blog/blog.php:359, widgets/contact/contact.php:460, widgets/contact/contact.php:584, widgets/contact/contact.php:753, widgets/features/features.php:167, widgets/features/features.php:188, widgets/features/features.php:209, widgets/google-map/google-map.php:376, widgets/headline/headline.php:80, widgets/headline/headline.php:161, widgets/headline/headline.php:231, widgets/icon/icon.php:36, widgets/taxonomy/taxonomy.php:56, base/inc/widgets/base-carousel.class.php:382
412
  msgid "Color"
413
  msgstr ""
414
 
@@ -480,7 +480,7 @@ msgstr ""
480
  msgid "Column Count"
481
  msgstr ""
482
 
483
- #: widgets/blog/blog.php:76, widgets/blog/blog.php:407
484
  msgid "Featured Image"
485
  msgstr ""
486
 
@@ -500,232 +500,236 @@ msgstr ""
500
  msgid "Full Post Content"
501
  msgstr ""
502
 
503
- #: widgets/blog/blog.php:95
504
  msgid "Post Excerpt Read More Link"
505
  msgstr ""
506
 
507
- #: widgets/blog/blog.php:96
508
  msgid "Display the Read More link below the post excerpt."
509
  msgstr ""
510
 
511
- #: widgets/blog/blog.php:104
 
 
 
 
512
  msgid "Post Date"
513
  msgstr ""
514
 
515
- #: widgets/blog/blog.php:109
516
  msgid "Post Author"
517
  msgstr ""
518
 
519
- #: widgets/blog/blog.php:114
520
  msgid "Filter Categories "
521
  msgstr ""
522
 
523
- #: widgets/blog/blog.php:126
524
  msgid "Post Categories"
525
  msgstr ""
526
 
527
- #: widgets/blog/blog.php:131
528
  msgid "Post Comment Count"
529
  msgstr ""
530
 
531
- #: widgets/blog/blog.php:144
532
  msgid "Post"
533
  msgstr ""
534
 
535
- #: widgets/blog/blog.php:149, widgets/blog/blog.php:412, widgets/blog/blog.php:491
536
  msgid "Border Color"
537
  msgstr ""
538
 
539
- #: widgets/blog/blog.php:154
540
  msgid "Background Color"
541
  msgstr ""
542
 
543
- #: widgets/blog/blog.php:161
544
  msgid "Post Title"
545
  msgstr ""
546
 
547
- #: widgets/blog/blog.php:170, widgets/blog/blog.php:197, widgets/blog/blog.php:224, widgets/blog/blog.php:261, widgets/blog/blog.php:314, widgets/blog/blog.php:350, widgets/blog/blog.php:520, widgets/button/button.php:207, widgets/headline/headline.php:93, widgets/headline/headline.php:174
548
  msgid "Font Size"
549
  msgstr ""
550
 
551
- #: widgets/blog/blog.php:180, widgets/blog/blog.php:207, widgets/blog/blog.php:271, widgets/blog/blog.php:368, widgets/headline/headline.php:84, widgets/headline/headline.php:165
552
  msgid "Hover Color"
553
  msgstr ""
554
 
555
- #: widgets/blog/blog.php:188
556
  msgid "Post Meta"
557
  msgstr ""
558
 
559
- #: widgets/blog/blog.php:215
560
  msgid "Offset Post Meta"
561
  msgstr ""
562
 
563
- #: widgets/blog/blog.php:234, widgets/blog/blog.php:324, widgets/blog/blog.php:525
564
  msgid "Link Color"
565
  msgstr ""
566
 
567
- #: widgets/blog/blog.php:239
568
  msgid "Link Color Hover"
569
  msgstr ""
570
 
571
- #: widgets/blog/blog.php:244
572
  msgid "Link Font Size"
573
  msgstr ""
574
 
575
- #: widgets/blog/blog.php:252
576
  msgid "Overlay Post Category"
577
  msgstr ""
578
 
579
- #: widgets/blog/blog.php:276, widgets/blog/blog.php:501, widgets/contact/contact.php:534, widgets/hero/hero.php:100, widgets/layout-slider/layout-slider.php:72, widgets/post-carousel/post-carousel.php:194
580
  msgid "Background"
581
  msgstr ""
582
 
583
- #: widgets/blog/blog.php:281, widgets/blog/blog.php:505
584
  msgid "Hover Background"
585
  msgstr ""
586
 
587
- #: widgets/blog/blog.php:286
588
  msgid "Background Opacity"
589
  msgstr ""
590
 
591
- #: widgets/blog/blog.php:294
592
- msgid "Background Opacity Hover"
593
  msgstr ""
594
 
595
- #: widgets/blog/blog.php:305
596
  msgid "Post Content"
597
  msgstr ""
598
 
599
- #: widgets/blog/blog.php:329, widgets/blog/blog.php:530
600
  msgid "Link Hover Color"
601
  msgstr ""
602
 
603
- #: widgets/blog/blog.php:337
604
  msgid "Filter Categories"
605
  msgstr ""
606
 
607
- #: widgets/blog/blog.php:377
608
  msgid "Capitalize Categories"
609
  msgstr ""
610
 
611
- #: widgets/blog/blog.php:386
612
  msgid "Selected Border Color"
613
  msgstr ""
614
 
615
- #: widgets/blog/blog.php:395
616
  msgid "Selected Border Thickness"
617
  msgstr ""
618
 
619
- #: widgets/blog/blog.php:417
620
  msgid "Hover Overlay Color"
621
  msgstr ""
622
 
623
- #: widgets/blog/blog.php:421
624
  msgid "Hover Overlay Opacity"
625
  msgstr ""
626
 
627
- #: widgets/blog/blog.php:430
628
  msgid "Post Title Font"
629
  msgstr ""
630
 
631
- #: widgets/blog/blog.php:434
632
  msgid "Post Title Font Size"
633
  msgstr ""
634
 
635
- #: widgets/blog/blog.php:439
636
  msgid "Post Title Color"
637
  msgstr ""
638
 
639
- #: widgets/blog/blog.php:444
640
  msgid "Divider Border Color"
641
  msgstr ""
642
 
643
- #: widgets/blog/blog.php:449
644
  msgid "Divider Border Thickness"
645
  msgstr ""
646
 
647
- #: widgets/blog/blog.php:454
648
  msgid "Divider Border Margin"
649
  msgstr ""
650
 
651
- #: widgets/blog/blog.php:459
652
  msgid "Post Meta Font"
653
  msgstr ""
654
 
655
- #: widgets/blog/blog.php:463
656
  msgid "Post Meta Font Size"
657
  msgstr ""
658
 
659
- #: widgets/blog/blog.php:468
660
  msgid "Post Meta Color"
661
  msgstr ""
662
 
663
- #: widgets/blog/blog.php:476
664
  msgid "Pagination"
665
  msgstr ""
666
 
667
- #: widgets/blog/blog.php:481
668
  msgid "Top Margin"
669
  msgstr ""
670
 
671
- #: widgets/blog/blog.php:486
672
  msgid "Link Margin"
673
  msgstr ""
674
 
675
- #: widgets/blog/blog.php:496
676
- msgid "Border Color Hover"
677
  msgstr ""
678
 
679
- #: widgets/blog/blog.php:509
680
  msgid "Border Radius"
681
  msgstr ""
682
 
683
- #: widgets/blog/blog.php:535
684
  msgid "Dots Color"
685
  msgstr ""
686
 
687
- #: widgets/blog/blog.php:540, widgets/button/button.php:121, widgets/contact/contact.php:477, widgets/contact/contact.php:707, widgets/contact/contact.php:758, widgets/google-map/google-map.php:94, base/inc/fields/image-size.class.php:69
688
  msgid "Width"
689
  msgstr ""
690
 
691
- #: widgets/blog/blog.php:546, widgets/contact/contact.php:526, widgets/google-map/google-map.php:98, widgets/hero/hero.php:187, widgets/hero/hero.php:223, widgets/layout-slider/layout-slider.php:155, widgets/layout-slider/layout-slider.php:191, widgets/slider/slider.php:142, base/inc/fields/image-size.class.php:76
692
  msgid "Height"
693
  msgstr ""
694
 
695
- #: widgets/blog/blog.php:557
696
  msgid "Posts Query"
697
  msgstr ""
698
 
699
- #: widgets/blog/blog.php:568, widgets/button/button.php:33, widgets/contact/contact.php:953, widgets/features/features.php:381, widgets/headline/headline.php:37, widgets/social-media-buttons/social-media-buttons.php:32, base/inc/widgets/base-slider.class.php:222
700
  msgid "Responsive Breakpoint"
701
  msgstr ""
702
 
703
- #: widgets/blog/blog.php:570
704
  msgid "Device width, in pixels, to collapse into a mobile view."
705
  msgstr ""
706
 
707
  #. translators: used between list items, there is a space after the comma
708
- #: widgets/blog/blog.php:930
709
  msgid ", "
710
  msgstr ""
711
 
712
- #: widgets/blog/blog.php:939
713
  msgid "Leave a comment"
714
  msgstr ""
715
 
716
- #: widgets/blog/blog.php:940
717
  msgid "One Comment"
718
  msgstr ""
719
 
720
- #: widgets/blog/blog.php:941, widgets/blog/tpl/offset.php:48
721
  msgid "% Comments"
722
  msgstr ""
723
 
724
- #: widgets/blog/blog.php:979, widgets/blog/tpl/base.php:12
725
  msgid "Continue reading"
726
  msgstr ""
727
 
728
- #: widgets/blog/blog.php:1024
729
  msgid "Post navigation"
730
  msgstr ""
731
 
156
  msgid "Filter Widgets"
157
  msgstr ""
158
 
159
+ #: admin/tpl/admin.php:17, widgets/google-map/google-map.php:366, base/inc/fields/posts.class.php:23, widgets/blog/tpl/base.php:27
160
  msgid "All"
161
  msgstr ""
162
 
328
  msgid "Closed"
329
  msgstr ""
330
 
331
+ #: widgets/accordion/accordion.php:111, widgets/blog/blog.php:152, widgets/contact/contact.php:396, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:101, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:350
332
  msgid "Design"
333
  msgstr ""
334
 
400
  msgid "Item"
401
  msgstr ""
402
 
403
+ #: widgets/anything-carousel/anything-carousel.php:108, widgets/blog/blog.php:179, widgets/blog/blog.php:206, widgets/blog/blog.php:233, widgets/blog/blog.php:270, widgets/blog/blog.php:323, widgets/blog/blog.php:355, widgets/blog/blog.php:529, widgets/button/button.php:201, widgets/contact/contact.php:450, widgets/contact/contact.php:500, widgets/features/features.php:158, widgets/features/features.php:179, widgets/features/features.php:200, widgets/headline/headline.php:88, widgets/headline/headline.php:169, base/inc/widgets/base-carousel.class.php:374
404
  msgid "Font"
405
  msgstr ""
406
 
408
  msgid "Font size"
409
  msgstr ""
410
 
411
+ #: widgets/anything-carousel/anything-carousel.php:116, widgets/blog/blog.php:188, widgets/blog/blog.php:215, widgets/blog/blog.php:242, widgets/blog/blog.php:279, widgets/blog/blog.php:332, widgets/blog/blog.php:381, widgets/contact/contact.php:460, widgets/contact/contact.php:584, widgets/contact/contact.php:753, widgets/features/features.php:167, widgets/features/features.php:188, widgets/features/features.php:209, widgets/google-map/google-map.php:376, widgets/headline/headline.php:80, widgets/headline/headline.php:161, widgets/headline/headline.php:231, widgets/icon/icon.php:36, widgets/taxonomy/taxonomy.php:56, base/inc/widgets/base-carousel.class.php:382
412
  msgid "Color"
413
  msgstr ""
414
 
480
  msgid "Column Count"
481
  msgstr ""
482
 
483
+ #: widgets/blog/blog.php:76, widgets/blog/blog.php:420
484
  msgid "Featured Image"
485
  msgstr ""
486
 
500
  msgid "Full Post Content"
501
  msgstr ""
502
 
503
+ #: widgets/blog/blog.php:99
504
  msgid "Post Excerpt Read More Link"
505
  msgstr ""
506
 
507
+ #: widgets/blog/blog.php:100
508
  msgid "Display the Read More link below the post excerpt."
509
  msgstr ""
510
 
511
+ #: widgets/blog/blog.php:108
512
+ msgid "Excerpt Length"
513
+ msgstr ""
514
+
515
+ #: widgets/blog/blog.php:117
516
  msgid "Post Date"
517
  msgstr ""
518
 
519
+ #: widgets/blog/blog.php:122
520
  msgid "Post Author"
521
  msgstr ""
522
 
523
+ #: widgets/blog/blog.php:127
524
  msgid "Filter Categories "
525
  msgstr ""
526
 
527
+ #: widgets/blog/blog.php:139
528
  msgid "Post Categories"
529
  msgstr ""
530
 
531
+ #: widgets/blog/blog.php:144
532
  msgid "Post Comment Count"
533
  msgstr ""
534
 
535
+ #: widgets/blog/blog.php:157
536
  msgid "Post"
537
  msgstr ""
538
 
539
+ #: widgets/blog/blog.php:162, widgets/blog/blog.php:425, widgets/blog/blog.php:504
540
  msgid "Border Color"
541
  msgstr ""
542
 
543
+ #: widgets/blog/blog.php:167
544
  msgid "Background Color"
545
  msgstr ""
546
 
547
+ #: widgets/blog/blog.php:174
548
  msgid "Post Title"
549
  msgstr ""
550
 
551
+ #: widgets/blog/blog.php:183, widgets/blog/blog.php:210, widgets/blog/blog.php:237, widgets/blog/blog.php:274, widgets/blog/blog.php:327, widgets/blog/blog.php:363, widgets/blog/blog.php:533, widgets/button/button.php:207, widgets/headline/headline.php:93, widgets/headline/headline.php:174
552
  msgid "Font Size"
553
  msgstr ""
554
 
555
+ #: widgets/blog/blog.php:193, widgets/blog/blog.php:220, widgets/blog/blog.php:284, widgets/blog/blog.php:390, widgets/headline/headline.php:84, widgets/headline/headline.php:165
556
  msgid "Hover Color"
557
  msgstr ""
558
 
559
+ #: widgets/blog/blog.php:201
560
  msgid "Post Meta"
561
  msgstr ""
562
 
563
+ #: widgets/blog/blog.php:228
564
  msgid "Offset Post Meta"
565
  msgstr ""
566
 
567
+ #: widgets/blog/blog.php:247, widgets/blog/blog.php:337, widgets/blog/blog.php:538
568
  msgid "Link Color"
569
  msgstr ""
570
 
571
+ #: widgets/blog/blog.php:252
572
  msgid "Link Color Hover"
573
  msgstr ""
574
 
575
+ #: widgets/blog/blog.php:257
576
  msgid "Link Font Size"
577
  msgstr ""
578
 
579
+ #: widgets/blog/blog.php:265
580
  msgid "Overlay Post Category"
581
  msgstr ""
582
 
583
+ #: widgets/blog/blog.php:289, widgets/blog/blog.php:514, widgets/contact/contact.php:534, widgets/hero/hero.php:100, widgets/layout-slider/layout-slider.php:72, widgets/post-carousel/post-carousel.php:194
584
  msgid "Background"
585
  msgstr ""
586
 
587
+ #: widgets/blog/blog.php:294, widgets/blog/blog.php:518
588
  msgid "Hover Background"
589
  msgstr ""
590
 
591
+ #: widgets/blog/blog.php:299
592
  msgid "Background Opacity"
593
  msgstr ""
594
 
595
+ #: widgets/blog/blog.php:307
596
+ msgid "Background Hover Opacity"
597
  msgstr ""
598
 
599
+ #: widgets/blog/blog.php:318
600
  msgid "Post Content"
601
  msgstr ""
602
 
603
+ #: widgets/blog/blog.php:342, widgets/blog/blog.php:543
604
  msgid "Link Hover Color"
605
  msgstr ""
606
 
607
+ #: widgets/blog/blog.php:350
608
  msgid "Filter Categories"
609
  msgstr ""
610
 
611
+ #: widgets/blog/blog.php:372
612
  msgid "Capitalize Categories"
613
  msgstr ""
614
 
615
+ #: widgets/blog/blog.php:399
616
  msgid "Selected Border Color"
617
  msgstr ""
618
 
619
+ #: widgets/blog/blog.php:408
620
  msgid "Selected Border Thickness"
621
  msgstr ""
622
 
623
+ #: widgets/blog/blog.php:430
624
  msgid "Hover Overlay Color"
625
  msgstr ""
626
 
627
+ #: widgets/blog/blog.php:434
628
  msgid "Hover Overlay Opacity"
629
  msgstr ""
630
 
631
+ #: widgets/blog/blog.php:443
632
  msgid "Post Title Font"
633
  msgstr ""
634
 
635
+ #: widgets/blog/blog.php:447
636
  msgid "Post Title Font Size"
637
  msgstr ""
638
 
639
+ #: widgets/blog/blog.php:452
640
  msgid "Post Title Color"
641
  msgstr ""
642
 
643
+ #: widgets/blog/blog.php:457
644
  msgid "Divider Border Color"
645
  msgstr ""
646
 
647
+ #: widgets/blog/blog.php:462
648
  msgid "Divider Border Thickness"
649
  msgstr ""
650
 
651
+ #: widgets/blog/blog.php:467
652
  msgid "Divider Border Margin"
653
  msgstr ""
654
 
655
+ #: widgets/blog/blog.php:472
656
  msgid "Post Meta Font"
657
  msgstr ""
658
 
659
+ #: widgets/blog/blog.php:476
660
  msgid "Post Meta Font Size"
661
  msgstr ""
662
 
663
+ #: widgets/blog/blog.php:481
664
  msgid "Post Meta Color"
665
  msgstr ""
666
 
667
+ #: widgets/blog/blog.php:489
668
  msgid "Pagination"
669
  msgstr ""
670
 
671
+ #: widgets/blog/blog.php:494
672
  msgid "Top Margin"
673
  msgstr ""
674
 
675
+ #: widgets/blog/blog.php:499
676
  msgid "Link Margin"
677
  msgstr ""
678
 
679
+ #: widgets/blog/blog.php:509
680
+ msgid "Border Hover Color"
681
  msgstr ""
682
 
683
+ #: widgets/blog/blog.php:522
684
  msgid "Border Radius"
685
  msgstr ""
686
 
687
+ #: widgets/blog/blog.php:548
688
  msgid "Dots Color"
689
  msgstr ""
690
 
691
+ #: widgets/blog/blog.php:553, widgets/button/button.php:121, widgets/contact/contact.php:477, widgets/contact/contact.php:707, widgets/contact/contact.php:758, widgets/google-map/google-map.php:94, base/inc/fields/image-size.class.php:69
692
  msgid "Width"
693
  msgstr ""
694
 
695
+ #: widgets/blog/blog.php:559, widgets/contact/contact.php:526, widgets/google-map/google-map.php:98, widgets/hero/hero.php:187, widgets/hero/hero.php:223, widgets/layout-slider/layout-slider.php:155, widgets/layout-slider/layout-slider.php:191, widgets/slider/slider.php:142, base/inc/fields/image-size.class.php:76
696
  msgid "Height"
697
  msgstr ""
698
 
699
+ #: widgets/blog/blog.php:570
700
  msgid "Posts Query"
701
  msgstr ""
702
 
703
+ #: widgets/blog/blog.php:581, widgets/button/button.php:33, widgets/contact/contact.php:953, widgets/features/features.php:381, widgets/headline/headline.php:37, widgets/social-media-buttons/social-media-buttons.php:32, base/inc/widgets/base-slider.class.php:222
704
  msgid "Responsive Breakpoint"
705
  msgstr ""
706
 
707
+ #: widgets/blog/blog.php:583
708
  msgid "Device width, in pixels, to collapse into a mobile view."
709
  msgstr ""
710
 
711
  #. translators: used between list items, there is a space after the comma
712
+ #: widgets/blog/blog.php:943
713
  msgid ", "
714
  msgstr ""
715
 
716
+ #: widgets/blog/blog.php:952
717
  msgid "Leave a comment"
718
  msgstr ""
719
 
720
+ #: widgets/blog/blog.php:953
721
  msgid "One Comment"
722
  msgstr ""
723
 
724
+ #: widgets/blog/blog.php:954, widgets/blog/tpl/offset.php:48
725
  msgid "% Comments"
726
  msgstr ""
727
 
728
+ #: widgets/blog/blog.php:990, widgets/blog/blog.php:1024
729
  msgid "Continue reading"
730
  msgstr ""
731
 
732
+ #: widgets/blog/blog.php:1072
733
  msgid "Post navigation"
734
  msgstr ""
735
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Tags: widget, button, slider, hero, google maps, image, carousel, lottie, featur
3
  Requires at least: 4.2
4
  Tested up to: 6.0
5
  Requires PHP: 5.6.20
6
- Stable tag: 1.39.0
7
- Build time: 2022-08-08T13:52:41+02:00
8
  License: GPLv3 or later
9
  Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
@@ -106,6 +106,10 @@ The Widgets Bundle global interface is available at Plugins > SiteOrigin Widgets
106
 
107
  == Changelog ==
108
 
 
 
 
 
109
  = 1.39.0 - 08 August 2022 =
110
  * New Widget! Introducing the SiteOrigin Blog Widget.
111
 
3
  Requires at least: 4.2
4
  Tested up to: 6.0
5
  Requires PHP: 5.6.20
6
+ Stable tag: 1.40.0
7
+ Build time: 2022-08-20T16:42:55+02:00
8
  License: GPLv3 or later
9
  Contributors: gpriday, braam-genis, alexgso
10
  Donate link: https://siteorigin.com/downloads/premium/
106
 
107
  == Changelog ==
108
 
109
+ = 1.40.0 - 20 August 2022 =
110
+ * Blog: Added `Excerpt Length` setting. The excerpt length can also be set using `siteorigin_widgets_blog_excerpt_length`.
111
+ * Blog: Resolved a Portfolio template column sizing issue.
112
+
113
  = 1.39.0 - 08 August 2022 =
114
  * New Widget! Introducing the SiteOrigin Blog Widget.
115
 
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
5
- Version: 1.39.0
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.39.0' );
16
  define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
17
 
18
  // Allow JS suffix to be pre-set.
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
5
+ Version: 1.40.0
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /lang
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define( 'SOW_BUNDLE_VERSION', '1.40.0' );
16
  define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
17
 
18
  // Allow JS suffix to be pre-set.
widgets/blog/blog.php CHANGED
@@ -89,6 +89,10 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
89
  'callback' => 'select',
90
  'args' => array( 'content_type' ),
91
  ),
 
 
 
 
92
  ),
93
  'read_more' => array(
94
  'type' => 'checkbox',
@@ -99,6 +103,15 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
99
  '_else[content_type]' => array( 'hide' ),
100
  ),
101
  ),
 
 
 
 
 
 
 
 
 
102
  'date' => array(
103
  'type' => 'checkbox',
104
  'label' => __( 'Post Date', 'so-widgets-bundle' ),
@@ -291,7 +304,7 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
291
  ),
292
  'background_opacity_hover' => array(
293
  'type' => 'slider',
294
- 'label' => __( 'Background Opacity Hover', 'so-widgets-bundle' ),
295
  'min' => 0,
296
  'max' => 1,
297
  'step' => 0.01,
@@ -354,6 +367,15 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
354
  'filter_categories[hide]' => array( 'hide' ),
355
  ),
356
  ),
 
 
 
 
 
 
 
 
 
357
  'color' => array(
358
  'type' => 'color',
359
  'label' => __( 'Color', 'so-widgets-bundle' ),
@@ -372,15 +394,6 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
372
  'filter_categories[hide]' => array( 'hide' ),
373
  ),
374
  ),
375
- 'text_transform' => array(
376
- 'type' => 'checkbox',
377
- 'label' => __( 'Capitalize Categories', 'so-widgets-bundle' ),
378
- 'default' => true,
379
- 'state_handler' => array(
380
- 'filter_categories[show]' => array( 'show' ),
381
- 'filter_categories[hide]' => array( 'hide' ),
382
- ),
383
- ),
384
  'selected_border_color' => array(
385
  'type' => 'color',
386
  'label' => __( 'Selected Border Color', 'so-widgets-bundle' ),
@@ -493,7 +506,7 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
493
  ),
494
  'border_color_hover' => array(
495
  'type' => 'color',
496
- 'label' => __( 'Border Color Hover', 'so-widgets-bundle' ),
497
  'default' => '#f14e4e',
498
  ),
499
  'background' => array(
@@ -970,20 +983,52 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
970
  );
971
  }
972
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973
  function alter_read_more_link( $link ) {
974
  return '<a class="sow-more-link more-link excerpt" href="' . esc_url( get_permalink() ) . '"> ' . esc_html( get_query_var( 'siteorigin_blog_read_more' ) ) . '<span class="sow-more-link-arrow">&rarr;</span></a>';
975
  }
976
 
 
 
 
 
 
 
 
 
977
  static public function generate_excerpt( $settings ) {
978
  if ( $settings['read_more'] ) {
979
  $read_more_text = ! empty( $settings['read_more_text'] ) ? $settings['read_more_text'] : __( 'Continue reading', 'so-widgets-bundle' );
980
  $read_more_text = '<a class="sow-more-link more-link excerpt" href="' . esc_url( get_permalink() ) . '">
981
  ' . esc_html( $read_more_text ) . '<span class="sow-more-link-arrow">&rarr;</span></a>';
982
  }
983
- $length = apply_filters( 'siteorigin_widgets_blog_excerpt_length', 55 );
 
984
  $excerpt = get_the_excerpt();
985
  $excerpt_add_read_more = str_word_count( $excerpt ) >= $length;
986
-
987
  if ( ! has_excerpt() ) {
988
  $excerpt = wp_trim_words( $excerpt, $length, '...' );
989
  }
@@ -996,10 +1041,13 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
996
  }
997
 
998
  function paginate_links( $settings, $posts, $instance ) {
999
- $pagination_markup = defined( 'SITEORIGIN_PREMIUM_VERSION' ) ? apply_filters( 'siteorigin_widgets_blog_pagination_markup', false, $settings, $posts, $instance ) : false;
 
 
 
1000
 
1001
  if ( empty( $pagination_markup ) ) {
1002
- if ( isset( $settings['pagination_reload'] ) && $settings['pagination_reload'] == 'ajax' ) {
1003
  $current = 99999;
1004
  $show_all_prev_next = true;
1005
  } else {
@@ -1022,7 +1070,7 @@ class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
1022
  ?>
1023
  <nav class="sow-post-navigation">
1024
  <h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'so-widgets-bundle' ); ?></h2>
1025
- <div class="sow-nav-links">
1026
  <?php echo $pagination_markup; ?>
1027
  </div>
1028
  </nav>
89
  'callback' => 'select',
90
  'args' => array( 'content_type' ),
91
  ),
92
+ 'state_handler' => array(
93
+ 'active_template[standard,masonry,grid,offset,alternate]' => array( 'slideDown' ),
94
+ '_else[active_template]' => array( 'slideUp' ),
95
+ ),
96
  ),
97
  'read_more' => array(
98
  'type' => 'checkbox',
103
  '_else[content_type]' => array( 'hide' ),
104
  ),
105
  ),
106
+ 'excerpt_length' => array(
107
+ 'type' => 'number',
108
+ 'label' => __( 'Excerpt Length', 'so-widgets-bundle' ),
109
+ 'default' => 55,
110
+ 'state_handler' => array(
111
+ 'content_type[excerpt]' => array( 'show' ),
112
+ '_else[content_type]' => array( 'hide' ),
113
+ ),
114
+ ),
115
  'date' => array(
116
  'type' => 'checkbox',
117
  'label' => __( 'Post Date', 'so-widgets-bundle' ),
304
  ),
305
  'background_opacity_hover' => array(
306
  'type' => 'slider',
307
+ 'label' => __( 'Background Hover Opacity', 'so-widgets-bundle' ),
308
  'min' => 0,
309
  'max' => 1,
310
  'step' => 0.01,
367
  'filter_categories[hide]' => array( 'hide' ),
368
  ),
369
  ),
370
+ 'text_transform' => array(
371
+ 'type' => 'checkbox',
372
+ 'label' => __( 'Capitalize Categories', 'so-widgets-bundle' ),
373
+ 'default' => true,
374
+ 'state_handler' => array(
375
+ 'filter_categories[show]' => array( 'show' ),
376
+ 'filter_categories[hide]' => array( 'hide' ),
377
+ ),
378
+ ),
379
  'color' => array(
380
  'type' => 'color',
381
  'label' => __( 'Color', 'so-widgets-bundle' ),
394
  'filter_categories[hide]' => array( 'hide' ),
395
  ),
396
  ),
 
 
 
 
 
 
 
 
 
397
  'selected_border_color' => array(
398
  'type' => 'color',
399
  'label' => __( 'Selected Border Color', 'so-widgets-bundle' ),
506
  ),
507
  'border_color_hover' => array(
508
  'type' => 'color',
509
+ 'label' => __( 'Border Hover Color', 'so-widgets-bundle' ),
510
  'default' => '#f14e4e',
511
  ),
512
  'background' => array(
983
  );
984
  }
985
 
986
+ function override_read_more( $settings, $setup = true ) {
987
+ // Read More Override.
988
+ if ( $settings['content'] == 'full' && apply_filters( 'siteorigin_widgets_blog_full_content_read_more', true ) ) {
989
+ if ( $setup ) {
990
+ set_query_var( 'siteorigin_blog_read_more', ! empty( $settings['read_more_text'] ) ? $settings['read_more_text'] : __( 'Continue reading', 'so-widgets-bundle' ) );
991
+ add_filter( 'the_content_more_link', array( $this, 'alter_read_more_link' ) );
992
+ } else {
993
+ remove_filter( 'the_content_more_link', array( $this, 'alter_read_more_link' ) );
994
+ }
995
+ }
996
+
997
+ if ( $setup ) {
998
+ set_query_var(
999
+ 'siteorigin_blog_excerpt_length',
1000
+ apply_filters( 'siteorigin_widgets_blog_excerpt_length', ! empty( $settings['excerpt_length'] ) ? $settings['excerpt_length'] : 55 )
1001
+ );
1002
+ add_filter( 'excerpt_length', array( $this, 'alter_excerpt_length' ), 1000 );
1003
+ add_filter( 'excerpt_more', array( $this, 'alter_excerpt_more_indicator' ) );
1004
+ } else {
1005
+ remove_filter( 'excerpt_length', array( $this, 'alter_excerpt_length' ), 1000 );
1006
+ remove_filter( 'the_content_more_link', array( $this, 'alter_excerpt_more_indicator' ) );
1007
+ }
1008
+ }
1009
+
1010
  function alter_read_more_link( $link ) {
1011
  return '<a class="sow-more-link more-link excerpt" href="' . esc_url( get_permalink() ) . '"> ' . esc_html( get_query_var( 'siteorigin_blog_read_more' ) ) . '<span class="sow-more-link-arrow">&rarr;</span></a>';
1012
  }
1013
 
1014
+ function alter_excerpt_more_indicator( $indicator ) {
1015
+ return '...';
1016
+ }
1017
+
1018
+ function alter_excerpt_length( $length = 55 ) {
1019
+ return get_query_var( 'siteorigin_blog_excerpt_length' );
1020
+ }
1021
+
1022
  static public function generate_excerpt( $settings ) {
1023
  if ( $settings['read_more'] ) {
1024
  $read_more_text = ! empty( $settings['read_more_text'] ) ? $settings['read_more_text'] : __( 'Continue reading', 'so-widgets-bundle' );
1025
  $read_more_text = '<a class="sow-more-link more-link excerpt" href="' . esc_url( get_permalink() ) . '">
1026
  ' . esc_html( $read_more_text ) . '<span class="sow-more-link-arrow">&rarr;</span></a>';
1027
  }
1028
+
1029
+ $length = get_query_var( 'siteorigin_blog_excerpt_length' );
1030
  $excerpt = get_the_excerpt();
1031
  $excerpt_add_read_more = str_word_count( $excerpt ) >= $length;
 
1032
  if ( ! has_excerpt() ) {
1033
  $excerpt = wp_trim_words( $excerpt, $length, '...' );
1034
  }
1041
  }
1042
 
1043
  function paginate_links( $settings, $posts, $instance ) {
1044
+ $addon_active = class_exists( 'SiteOrigin_Premium' ) && ! empty( SiteOrigin_Premium::single()->get_active_addons()['plugin/blog'] );
1045
+ if ( $addon_active ) {
1046
+ $pagination_markup = apply_filters( 'siteorigin_widgets_blog_pagination_markup', false, $settings, $posts, $instance );
1047
+ }
1048
 
1049
  if ( empty( $pagination_markup ) ) {
1050
+ if ( $addon_active && isset( $settings['pagination_reload'] ) && $settings['pagination_reload'] == 'ajax' ) {
1051
  $current = 99999;
1052
  $show_all_prev_next = true;
1053
  } else {
1070
  ?>
1071
  <nav class="sow-post-navigation">
1072
  <h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'so-widgets-bundle' ); ?></h2>
1073
+ <div class="sow-nav-links<?php if ( ! empty( $settings['pagination'] ) ) echo ' sow-post-pagination-' . esc_attr( $settings['pagination'] ); ?>">
1074
  <?php echo $pagination_markup; ?>
1075
  </div>
1076
  </nav>
widgets/blog/data/templates.json CHANGED
@@ -6,6 +6,7 @@
6
  "featured_image": true,
7
  "content": "full",
8
  "read_more": true,
 
9
  "date": true,
10
  "author": true,
11
  "categories": true,
@@ -63,6 +64,7 @@
63
  "featured_image": true,
64
  "content": "excerpt",
65
  "read_more": true,
 
66
  "date": true,
67
  "author": true,
68
  "categories": true,
@@ -119,6 +121,7 @@
119
  "featured_image": true,
120
  "content": "full",
121
  "read_more": true,
 
122
  "date": true,
123
  "author": true,
124
  "categories": true,
@@ -183,6 +186,7 @@
183
  "featured_image": true,
184
  "content": "excerpt",
185
  "read_more": true,
 
186
  "date": true,
187
  "author": true,
188
  "categories": true,
@@ -240,6 +244,7 @@
240
  "featured_image": true,
241
  "content": "excerpt",
242
  "read_more": true,
 
243
  "date": true,
244
  "author": true,
245
  "categories": true,
@@ -302,6 +307,7 @@
302
  "label": "Portfolio",
303
  "values": {
304
  "settings": {
 
305
  "columns": 3,
306
  "filter_categories": "true",
307
  "categories": true
@@ -312,9 +318,9 @@
312
  "color_hover": "#2d2d2d",
313
  "font": "default",
314
  "font_size": "11",
 
315
  "selected_border_color": "#2d2d2d",
316
- "selected_border_thickness": "2",
317
- "text_transform": "true"
318
  },
319
  "featured_image":{
320
  "border_color": "#929292",
6
  "featured_image": true,
7
  "content": "full",
8
  "read_more": true,
9
+ "excerpt_length": "55",
10
  "date": true,
11
  "author": true,
12
  "categories": true,
64
  "featured_image": true,
65
  "content": "excerpt",
66
  "read_more": true,
67
+ "excerpt_length": "55",
68
  "date": true,
69
  "author": true,
70
  "categories": true,
121
  "featured_image": true,
122
  "content": "full",
123
  "read_more": true,
124
+ "excerpt_length": "55",
125
  "date": true,
126
  "author": true,
127
  "categories": true,
186
  "featured_image": true,
187
  "content": "excerpt",
188
  "read_more": true,
189
+ "excerpt_length": "55",
190
  "date": true,
191
  "author": true,
192
  "categories": true,
244
  "featured_image": true,
245
  "content": "excerpt",
246
  "read_more": true,
247
+ "excerpt_length": "55",
248
  "date": true,
249
  "author": true,
250
  "categories": true,
307
  "label": "Portfolio",
308
  "values": {
309
  "settings": {
310
+ "content": "full",
311
  "columns": 3,
312
  "filter_categories": "true",
313
  "categories": true
318
  "color_hover": "#2d2d2d",
319
  "font": "default",
320
  "font_size": "11",
321
+ "text_transform": "true",
322
  "selected_border_color": "#2d2d2d",
323
+ "selected_border_thickness": "2"
 
324
  },
325
  "featured_image":{
326
  "border_color": "#929292",
widgets/blog/styles/portfolio.less CHANGED
@@ -1,5 +1,6 @@
1
  @categories: default;
2
  @columns: 3;
 
3
  @responsive_breakpoint: 780px;
4
 
5
  // Pagination.
@@ -93,6 +94,7 @@
93
  article {
94
  margin-bottom: 30px;
95
  padding: 0 1.1667%;
 
96
 
97
  @media (max-width: @responsive_breakpoint) {
98
  width: 100%;
1
  @categories: default;
2
  @columns: 3;
3
+ @column_width: 50%;
4
  @responsive_breakpoint: 780px;
5
 
6
  // Pagination.
94
  article {
95
  margin-bottom: 30px;
96
  padding: 0 1.1667%;
97
+ width: @column_width;
98
 
99
  @media (max-width: @responsive_breakpoint) {
100
  width: 100%;
widgets/blog/tpl/base.php CHANGED
@@ -4,15 +4,7 @@
4
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
5
  endif;
6
 
7
- // Set up moretag override when the full content is set to output.
8
- if (
9
- $settings['content'] == 'full' &&
10
- apply_filters( 'siteorigin_widgets_blog_full_content_read_more', true )
11
- ) :
12
- set_query_var( 'siteorigin_blog_read_more', ! empty( $settings['read_more_text'] ) ? $settings['read_more_text'] : __( 'Continue reading', 'so-widgets-bundle' ) );
13
-
14
- add_filter( 'the_content_more_link', array( $this, 'alter_read_more_link' ) );
15
- endif;
16
  ?>
17
  <div
18
  class="sow-blog sow-blog-layout-<?php echo esc_attr( $instance['template'] ); ?>"
@@ -23,6 +15,7 @@
23
  data-hash="<?php echo esc_attr( $storage_hash ); ?>"
24
  >
25
  <?php
 
26
  if (
27
  $instance['template'] == 'portfolio' &&
28
  $template_settings['filter_categories'] &&
@@ -47,14 +40,8 @@
47
  <?php endwhile; ?>
48
  </div>
49
  <?php $this->paginate_links( $settings, $posts, $instance ); ?>
 
50
  </div>
51
- <?php
52
- if (
53
- $settings['content'] == 'full' &&
54
- apply_filters( 'siteorigin_widgets_blog_full_content_read_more', true )
55
- ) :
56
- remove_filter( 'the_content_more_link', array( $this, 'alter_read_more_link' ) );
57
- endif;
58
- ?>
59
  <?php endif; ?>
60
  <?php wp_reset_postdata(); ?>
4
  echo $args['before_title'] . $instance['title'] . $args['after_title'];
5
  endif;
6
 
7
+ $this->override_read_more( $settings );
 
 
 
 
 
 
 
 
8
  ?>
9
  <div
10
  class="sow-blog sow-blog-layout-<?php echo esc_attr( $instance['template'] ); ?>"
15
  data-hash="<?php echo esc_attr( $storage_hash ); ?>"
16
  >
17
  <?php
18
+ do_action( 'siteorigin_widgets_blog_output_before', $settings );
19
  if (
20
  $instance['template'] == 'portfolio' &&
21
  $template_settings['filter_categories'] &&
40
  <?php endwhile; ?>
41
  </div>
42
  <?php $this->paginate_links( $settings, $posts, $instance ); ?>
43
+ <?php do_action( 'siteorigin_widgets_blog_output_after', $settings ); ?>
44
  </div>
45
+ <?php $this->override_read_more( $settings ); ?>
 
 
 
 
 
 
 
46
  <?php endif; ?>
47
  <?php wp_reset_postdata(); ?>