Content Aware Sidebars – Unlimited Widget Areas - Version 3.11.1

Version Description

  • Fixed: conditions would not always be auto-saved
Download this release

Release Info

Developer intoxstudio
Plugin Icon 128x128 Content Aware Sidebars – Unlimited Widget Areas
Version 3.11.1
Comparing to
See all releases

Code changes from version 3.11 to 3.11.1

app.php CHANGED
@@ -11,7 +11,7 @@ defined('ABSPATH') || exit;
11
  final class CAS_App
12
  {
13
  const PLUGIN_VERSION_KEY = 'cas_db_version';
14
- const PLUGIN_VERSION = '3.11';
15
 
16
  /**
17
  * Prefix for sidebar id
11
  final class CAS_App
12
  {
13
  const PLUGIN_VERSION_KEY = 'cas_db_version';
14
+ const PLUGIN_VERSION = '3.11.1';
15
 
16
  /**
17
  * Prefix for sidebar id
content-aware-sidebars.php CHANGED
@@ -9,7 +9,7 @@
9
  Plugin Name: Content Aware Sidebars
10
  Plugin URI: https://dev.institute/wordpress-sidebars/
11
  Description: Unlimited custom sidebars and widget areas for any post, page, category etc.
12
- Version: 3.11
13
  Author: Joachim Jensen - DEV Institute
14
  Author URI: https://dev.institute
15
  Text Domain: content-aware-sidebars
9
  Plugin Name: Content Aware Sidebars
10
  Plugin URI: https://dev.institute/wordpress-sidebars/
11
  Description: Unlimited custom sidebars and widget areas for any post, page, category etc.
12
+ Version: 3.11.1
13
  Author: Joachim Jensen - DEV Institute
14
  Author URI: https://dev.institute
15
  Text Domain: content-aware-sidebars
lib/wp-content-aware-engine/assets/js/condition_groups.js CHANGED
@@ -425,10 +425,10 @@ var CAE = CAE || {};
425
  data.post_type = WPCA.post_type;
426
  data.conditions = {};
427
 
428
- var hasChanges = !!this.model.unsavedAttributes();
429
 
430
  this.model.conditions.each(function(model) {
431
- hasChanges = hasChanges || !!model.unsavedAttributes();
432
  if(model.get('values').length) {
433
  data.conditions[model.get('module')] = model.get('values').map(function(model) {
434
  return model.id;
@@ -438,10 +438,10 @@ var CAE = CAE || {};
438
  }
439
  });
440
 
441
- if(!hasChanges) {
442
- console.log("group view: save aborted - no changes");
443
- return;
444
- }
445
 
446
  $save.attr("disabled", true);
447
  $spinner.addClass('is-active');
425
  data.post_type = WPCA.post_type;
426
  data.conditions = {};
427
 
428
+ //var hasChanges = !!this.model.unsavedAttributes();
429
 
430
  this.model.conditions.each(function(model) {
431
+ //hasChanges = hasChanges || !!model.unsavedAttributes();
432
  if(model.get('values').length) {
433
  data.conditions[model.get('module')] = model.get('values').map(function(model) {
434
  return model.id;
438
  }
439
  });
440
 
441
+ // if(!hasChanges) {
442
+ // console.log("group view: save aborted - no changes");
443
+ // return;
444
+ // }
445
 
446
  $save.attr("disabled", true);
447
  $spinner.addClass('is-active');
lib/wp-content-aware-engine/assets/js/condition_groups.min.js CHANGED
@@ -4,4 +4,4 @@
4
  * @license GPLv3
5
  * @copyright 2019 by Joachim Jensen
6
  */
7
- var CAE=CAE||{};!function($,CAE){"use strict";CAE.settings={views:{}},CAE.Models={},CAE.Models.Alert=Backbone.Model.extend({defaults:{text:"",success:!0},sync:function(){return!1},url:"",reset:function(){this.set(this.defaults)}}),CAE.Models.Condition=Backbone.Model.extend({unsaved:{prompt:WPCA.unsaved,unloadWindowPrompt:!0},defaults:{module:null,label:"",placeholder:"",values:[],default_value:null},initialize:function(){this.startTracking(),this.on("destroy",this.stopTracking,this)},sync:function(){return!1},url:""}),CAE.Models.Group=Backbone.Model.extend({unsaved:{prompt:WPCA.unsaved,unloadWindowPrompt:!0},defaults:function(){var e=WPCA.meta_default;return e.id=null,e.status="publish",e.exposure=1,e},initialize:function(){this.startTracking(),this.on("destroy",this.stopTracking,this),this.conditions||(this.conditions=new CAE.Models.ConditionCollection)},parse:function(e){var t=[];if(_.has(e,"conditions")){for(var n in e.conditions)if(e.conditions.hasOwnProperty(n)){var i=[],o=e.conditions[n];for(var s in o.data)o.data.hasOwnProperty(s)&&i.push({text:"object"==typeof o.data[s]?o.data[s].text:o.data[s],id:s});delete o.data,o.module=n,o.values=i,t.push(o)}delete e.conditions}return this.conditions=new CAE.Models.ConditionCollection(t),e},sync:function(){return!1},url:""}),CAE.Models.GroupCollection=Backbone.Collection.extend({model:CAE.Models.Group,parse:function(e){return e}}),CAE.Models.ConditionCollection=Backbone.Collection.extend({model:CAE.Models.Condition}),CAE.Views={},CAE.Views.Alert=Backbone.Epoxy.View.extend({bindings:"data-vm",tagName:"div",className:"wpca-alert",template:"<div data-vm=\"classes:{'wpca-success':success,'wpca-error':not(success)},text:text\"></div>",timer:4e3,success:function(e){this.model.set({text:e,success:!0})},failure:function(e){this.model.set({text:e,success:!1})},dismiss:function(){var e=this;this.$el.fadeOut("slow",function(){e.model.reset()})},initialize:function(){this.listenTo(this.model,"change:text",this.show),this.$el.appendTo("body").hide().html(this.template)},show:function(){if(""!==this.model.get("text")){this.$el.fadeIn("slow");var e=this;setTimeout(function(){e.dismiss()},this.timer)}}}),CAE.Views.Condition=Backbone.Epoxy.View.extend({bindings:"data-vm",model:CAE.Models.Condition,tagName:"div",className:"cas-condition",templateName:"#wpca-template-condition",events:{"click .js-wpca-condition-remove":"removeModel"},initialize:function(){this.listenTo(this.model,"destroy",this.remove);var e=$(this.templateName);e.length?(this.template=e.html(),this.$el.append(this.template),this.createSuggestInput()):this.model.destroy()},removeModel:function(e){var t=this;this.$el.slideUp(300,function(){t.model.destroy()})},createSuggestInput:function(){var n=this.$el.find(".js-wpca-suggest");if(n.length){var i=this.model,e=this.model.get("values"),t=$("<div></div>").html(i.get("placeholder")).text();n.select2({cachedResults:{},quietMillis:400,searchTimer:null,type:i.get("module"),theme:"wpca",dir:WPCA.text_direction,placeholder:t,minimumInputLength:0,closeOnSelect:!0,width:"100%",language:{noResults:function(){return WPCA.noResults},searching:function(){return WPCA.searching+"..."},loadingMore:function(){return WPCA.loadingMore+"..."}},nextSearchTerm:function(e,t){return t},templateResult:function(e){return e.level?$('<span class="wpca-level-'+e.level+'">'+e.text+"</span>"):e.text},data:e,dataAdapter:l.wpcaDataAdapter,ajax:{}}).on("select2:selecting",function(e){n.data("forceOpen",!0)}).on("select2:closing",function(e){n.data("forceOpen")&&(e.preventDefault(),n.data("forceOpen",!1))}),e.length&&n.val(_.map(e,function(e){return e.id})).trigger("change"),n.on("change",function(e){var t=n.select2("data");i.set("values",t)})}}}),CAE.Views.Group=Backbone.Epoxy.View.extend({bindings:"data-vm",model:CAE.Models.Group,tagName:"li",className:"cas-group-single",template:$("#wpca-template-group").html(),itemView:function(e){if(CAE.Views[e.model.get("module")])var t=new(CAE.Views[e.model.get("module")])(e);else t=new CAE.Views.Condition(e);return t},events:{"click .js-wpca-save-group":"saveGroup","click .js-wpca-options":"showOptions"},computeds:{statusNegated:{deps:["status"],get:function(e){return"negated"==e},set:function(e){var t=e?"negated":"publish";this.setBinding("status",t)}}},bindingFilters:{int:{get:function(e){return e?1:0},set:function(e){return e?1:0}},binary:{get:function(e){return e?1:0},set:function(e){return e?1:0}},hasModule:function(e){for(var t={},n=1;n<arguments.length;n++)t[arguments[n]]=!0;return e.filter(function(e){return t.hasOwnProperty(e.get("module"))}).length==arguments.length-1},hasAnyModule:function(e){for(var t={},n=1;n<arguments.length;n++)t[arguments[n]]=!0;return!!e.find(function(e){return t.hasOwnProperty(e.get("module"))})}},initialize:function(){this.collection=this.model.conditions,this.$el.hide().html(this.template).fadeIn(300),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model,"unsavedChanges",this.saveChanges),this.listenTo(this.model.conditions,"unsavedChanges",this.saveChanges),this.listenTo(this.model.conditions,"add remove",this.saveAddRemove);var i=this,o=$(".js-wpca-add-and",this.$el);o.select2({theme:"wpca",placeholder:"+ "+WPCA.newCondition,minimumInputLength:0,closeOnSelect:!0,allowClear:!1,width:"resolve",nextSearchTerm:function(e,t){return t},data:WPCA.conditions}).on("select2:select",function(e){var t=e.params.data;if(!i.model.conditions.findWhere({module:t.id})){var n=new CAE.Models.Condition({module:t.id,label:t.text,placeholder:t.placeholder,default_value:t.default_value});i.model.conditions.add(n)}o.val(null).trigger("change")})},showOptions:function(e){$(e.delegateTarget).find(".cas-group-options").slideToggle(200),$(e.currentTarget).toggleClass("active")},saveChanges:function(e,t){e&&i.start(this)},saveAddRemove:function(e,t,n){t.length?n.add?""!==e.get("default_value")&&i.start(this):this.model.get("id")&&i.start(this):(i.clear(this),this.model.get("id")?this.saveGroup():this.removeModel())},removeModel:function(){var e=this;this.$el.slideUp(400,function(){e.model.destroy()})},saveGroup:function(e){var i=this.$el.find(".spinner"),o=this.$el.find(".js-wpca-save-group"),t=this,n=_.clone(this.model.attributes);n.action="wpca/add-rule",n.token=l.nonce,n.current_id=l.sidebarID,n.post_type=WPCA.post_type,n.conditions={};var s=!!this.model.unsavedAttributes();this.model.conditions.each(function(e){s=s||!!e.unsavedAttributes(),e.get("values").length?n.conditions[e.get("module")]=e.get("values").map(function(e){return e.id}):""!==e.get("default_value")&&(n.conditions[e.get("module")]=[e.get("default_value")])}),s&&(o.attr("disabled",!0),i.addClass("is-active"),$.ajax({url:ajaxurl,data:n,dataType:"JSON",type:"POST",success:function(e){l.alert.success(e.message),e.removed?t.removeModel():e.new_post_id&&t.model.set("id",e.new_post_id,{silent:!0}),e.removed||(o.hide(),i.removeClass("is-active"),t.model.restartTracking(),t.model.conditions.each(function(e){e.restartTracking()}))},error:function(e,t,n){o.attr("disabled",!1).show(),i.removeClass("is-active"),l.alert.failure(e.responseJSON.data)}}))},slideRemove:function(){this.$el.slideUp(400,function(){this.remove()})}}),CAE.Views.GroupCollection=Backbone.Epoxy.View.extend({bindings:"data-vm",el:"#cas-groups",collection:CAE.Models.GroupCollection,events:{"click .js-wpca-add-quick":"addGroupQuick","click .js-wpca-save":"saveAll"},conditionsById:{},initialize:function(){var o=this;this.conditionsById=_.chain(WPCA.conditions).pluck(["children"]).flatten().indexBy("id").value();var s=$(".js-wpca-add-or",this.$el);s.select2({theme:"wpca",placeholder:"+ "+WPCA.newGroup,minimumInputLength:0,closeOnSelect:!0,allowClear:!1,width:"auto",nextSearchTerm:function(e,t){return t},data:WPCA.conditions}).on("select2:select",function(e){var t=e.params.data,n=new CAE.Models.Group,i=new CAE.Models.Condition({module:t.id,label:t.text,placeholder:t.placeholder,default_value:t.default_value});o.collection.add(n),n.conditions.add(i),s.val(null).trigger("change")})},itemView:function(e){return new CAE.Views.Group(e)},addGroupQuick:function(e){e.preventDefault();var t=$(e.currentTarget).data("config"),n=new CAE.Models.Group;for(var i in n.set(t.options),this.collection.add(n),t.modules)if(this.conditionsById.hasOwnProperty(t.modules[i])){var o=this.conditionsById[t.modules[i]],s=new CAE.Models.Condition({module:o.id,label:o.text,placeholder:o.placeholder,default_value:o.default_value});n.conditions.add(s)}}}),$.fn.select2.amd.require(["select2/selection/search"],function(e){e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(""),this.handleSearch()}},null,!0),$.fn.select2.amd.require(["select2/results"],function(e){e.prototype.ensureHighlightVisible=function(){this.$results.resize()}},null,!0),$.fn.select2.amd.define("select2/data/wpcaAdapter",["select2/data/array","select2/utils"],function(e,t){function n(e,t){n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype.query=function(n,i){n.term=n.term||"";var o=this.options.options,s=o.cachedResults[n.term],a=n.page||1;if(s&&s.page>=a){if(!(1<a))return void i({results:s.items,pagination:{more:s.more}});a=s.page}clearTimeout(o.searchTimer),o.searchTimer=setTimeout(function(){$.ajax({url:ajaxurl,data:{search:n.term,paged:a,action:"wpca/module/"+o.type,sidebar_id:l.sidebarID,nonce:l.nonce},dataType:"JSON",type:"POST",success:function(e){var t=!(e.length<20);o.cachedResults[n.term]={page:a,more:t,items:s?o.cachedResults[n.term].items.concat(e):e},i({results:e,pagination:{more:t}})}})},o.quietMillis)},n});var i={treshold:2e3,timerQueue:{},start:function(e){this.clear(e);var t=this;this.timerQueue[e.cid]=window.setTimeout(function(){t.set(e)},this.treshold)},set:function(e){e.saveGroup()},clear:function(e){e&&this.timerQueue[e.cid]&&window.clearInterval(this.timerQueue[e.cid])}},l={nonce:$("#_ca_nonce").val(),sidebarID:$("#post_ID").val(),alert:null,wpcaDataAdapter:$.fn.select2.amd.require("select2/data/wpcaAdapter"),init:function(){this.alert=new CAE.Views.Alert({model:new CAE.Models.Alert}),CAE.conditionGroups=new CAE.Views.GroupCollection({collection:new CAE.Models.GroupCollection(WPCA.groups,{parse:!0})})}};$(document).ready(function(){l.init()})}(jQuery,CAE);
4
  * @license GPLv3
5
  * @copyright 2019 by Joachim Jensen
6
  */
7
+ var CAE=CAE||{};!function($,CAE){"use strict";CAE.settings={views:{}},CAE.Models={},CAE.Models.Alert=Backbone.Model.extend({defaults:{text:"",success:!0},sync:function(){return!1},url:"",reset:function(){this.set(this.defaults)}}),CAE.Models.Condition=Backbone.Model.extend({unsaved:{prompt:WPCA.unsaved,unloadWindowPrompt:!0},defaults:{module:null,label:"",placeholder:"",values:[],default_value:null},initialize:function(){this.startTracking(),this.on("destroy",this.stopTracking,this)},sync:function(){return!1},url:""}),CAE.Models.Group=Backbone.Model.extend({unsaved:{prompt:WPCA.unsaved,unloadWindowPrompt:!0},defaults:function(){var e=WPCA.meta_default;return e.id=null,e.status="publish",e.exposure=1,e},initialize:function(){this.startTracking(),this.on("destroy",this.stopTracking,this),this.conditions||(this.conditions=new CAE.Models.ConditionCollection)},parse:function(e){var t=[];if(_.has(e,"conditions")){for(var n in e.conditions)if(e.conditions.hasOwnProperty(n)){var i=[],o=e.conditions[n];for(var s in o.data)o.data.hasOwnProperty(s)&&i.push({text:"object"==typeof o.data[s]?o.data[s].text:o.data[s],id:s});delete o.data,o.module=n,o.values=i,t.push(o)}delete e.conditions}return this.conditions=new CAE.Models.ConditionCollection(t),e},sync:function(){return!1},url:""}),CAE.Models.GroupCollection=Backbone.Collection.extend({model:CAE.Models.Group,parse:function(e){return e}}),CAE.Models.ConditionCollection=Backbone.Collection.extend({model:CAE.Models.Condition}),CAE.Views={},CAE.Views.Alert=Backbone.Epoxy.View.extend({bindings:"data-vm",tagName:"div",className:"wpca-alert",template:"<div data-vm=\"classes:{'wpca-success':success,'wpca-error':not(success)},text:text\"></div>",timer:4e3,success:function(e){this.model.set({text:e,success:!0})},failure:function(e){this.model.set({text:e,success:!1})},dismiss:function(){var e=this;this.$el.fadeOut("slow",function(){e.model.reset()})},initialize:function(){this.listenTo(this.model,"change:text",this.show),this.$el.appendTo("body").hide().html(this.template)},show:function(){if(""!==this.model.get("text")){this.$el.fadeIn("slow");var e=this;setTimeout(function(){e.dismiss()},this.timer)}}}),CAE.Views.Condition=Backbone.Epoxy.View.extend({bindings:"data-vm",model:CAE.Models.Condition,tagName:"div",className:"cas-condition",templateName:"#wpca-template-condition",events:{"click .js-wpca-condition-remove":"removeModel"},initialize:function(){this.listenTo(this.model,"destroy",this.remove);var e=$(this.templateName);e.length?(this.template=e.html(),this.$el.append(this.template),this.createSuggestInput()):this.model.destroy()},removeModel:function(e){var t=this;this.$el.slideUp(300,function(){t.model.destroy()})},createSuggestInput:function(){var n=this.$el.find(".js-wpca-suggest");if(n.length){var i=this.model,e=this.model.get("values"),t=$("<div></div>").html(i.get("placeholder")).text();n.select2({cachedResults:{},quietMillis:400,searchTimer:null,type:i.get("module"),theme:"wpca",dir:WPCA.text_direction,placeholder:t,minimumInputLength:0,closeOnSelect:!0,width:"100%",language:{noResults:function(){return WPCA.noResults},searching:function(){return WPCA.searching+"..."},loadingMore:function(){return WPCA.loadingMore+"..."}},nextSearchTerm:function(e,t){return t},templateResult:function(e){return e.level?$('<span class="wpca-level-'+e.level+'">'+e.text+"</span>"):e.text},data:e,dataAdapter:l.wpcaDataAdapter,ajax:{}}).on("select2:selecting",function(e){n.data("forceOpen",!0)}).on("select2:closing",function(e){n.data("forceOpen")&&(e.preventDefault(),n.data("forceOpen",!1))}),e.length&&n.val(_.map(e,function(e){return e.id})).trigger("change"),n.on("change",function(e){var t=n.select2("data");i.set("values",t)})}}}),CAE.Views.Group=Backbone.Epoxy.View.extend({bindings:"data-vm",model:CAE.Models.Group,tagName:"li",className:"cas-group-single",template:$("#wpca-template-group").html(),itemView:function(e){if(CAE.Views[e.model.get("module")])var t=new(CAE.Views[e.model.get("module")])(e);else t=new CAE.Views.Condition(e);return t},events:{"click .js-wpca-save-group":"saveGroup","click .js-wpca-options":"showOptions"},computeds:{statusNegated:{deps:["status"],get:function(e){return"negated"==e},set:function(e){var t=e?"negated":"publish";this.setBinding("status",t)}}},bindingFilters:{int:{get:function(e){return e?1:0},set:function(e){return e?1:0}},binary:{get:function(e){return e?1:0},set:function(e){return e?1:0}},hasModule:function(e){for(var t={},n=1;n<arguments.length;n++)t[arguments[n]]=!0;return e.filter(function(e){return t.hasOwnProperty(e.get("module"))}).length==arguments.length-1},hasAnyModule:function(e){for(var t={},n=1;n<arguments.length;n++)t[arguments[n]]=!0;return!!e.find(function(e){return t.hasOwnProperty(e.get("module"))})}},initialize:function(){this.collection=this.model.conditions,this.$el.hide().html(this.template).fadeIn(300),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model,"unsavedChanges",this.saveChanges),this.listenTo(this.model.conditions,"unsavedChanges",this.saveChanges),this.listenTo(this.model.conditions,"add remove",this.saveAddRemove);var i=this,o=$(".js-wpca-add-and",this.$el);o.select2({theme:"wpca",placeholder:"+ "+WPCA.newCondition,minimumInputLength:0,closeOnSelect:!0,allowClear:!1,width:"resolve",nextSearchTerm:function(e,t){return t},data:WPCA.conditions}).on("select2:select",function(e){var t=e.params.data;if(!i.model.conditions.findWhere({module:t.id})){var n=new CAE.Models.Condition({module:t.id,label:t.text,placeholder:t.placeholder,default_value:t.default_value});i.model.conditions.add(n)}o.val(null).trigger("change")})},showOptions:function(e){$(e.delegateTarget).find(".cas-group-options").slideToggle(200),$(e.currentTarget).toggleClass("active")},saveChanges:function(e,t){e&&i.start(this)},saveAddRemove:function(e,t,n){t.length?n.add?""!==e.get("default_value")&&i.start(this):this.model.get("id")&&i.start(this):(i.clear(this),this.model.get("id")?this.saveGroup():this.removeModel())},removeModel:function(){var e=this;this.$el.slideUp(400,function(){e.model.destroy()})},saveGroup:function(e){var i=this.$el.find(".spinner"),o=this.$el.find(".js-wpca-save-group"),t=this,n=_.clone(this.model.attributes);n.action="wpca/add-rule",n.token=l.nonce,n.current_id=l.sidebarID,n.post_type=WPCA.post_type,n.conditions={},this.model.conditions.each(function(e){e.get("values").length?n.conditions[e.get("module")]=e.get("values").map(function(e){return e.id}):""!==e.get("default_value")&&(n.conditions[e.get("module")]=[e.get("default_value")])}),o.attr("disabled",!0),i.addClass("is-active"),$.ajax({url:ajaxurl,data:n,dataType:"JSON",type:"POST",success:function(e){l.alert.success(e.message),e.removed?t.removeModel():e.new_post_id&&t.model.set("id",e.new_post_id,{silent:!0}),e.removed||(o.hide(),i.removeClass("is-active"),t.model.restartTracking(),t.model.conditions.each(function(e){e.restartTracking()}))},error:function(e,t,n){o.attr("disabled",!1).show(),i.removeClass("is-active"),l.alert.failure(e.responseJSON.data)}})},slideRemove:function(){this.$el.slideUp(400,function(){this.remove()})}}),CAE.Views.GroupCollection=Backbone.Epoxy.View.extend({bindings:"data-vm",el:"#cas-groups",collection:CAE.Models.GroupCollection,events:{"click .js-wpca-add-quick":"addGroupQuick","click .js-wpca-save":"saveAll"},conditionsById:{},initialize:function(){var o=this;this.conditionsById=_.chain(WPCA.conditions).pluck(["children"]).flatten().indexBy("id").value();var s=$(".js-wpca-add-or",this.$el);s.select2({theme:"wpca",placeholder:"+ "+WPCA.newGroup,minimumInputLength:0,closeOnSelect:!0,allowClear:!1,width:"auto",nextSearchTerm:function(e,t){return t},data:WPCA.conditions}).on("select2:select",function(e){var t=e.params.data,n=new CAE.Models.Group,i=new CAE.Models.Condition({module:t.id,label:t.text,placeholder:t.placeholder,default_value:t.default_value});o.collection.add(n),n.conditions.add(i),s.val(null).trigger("change")})},itemView:function(e){return new CAE.Views.Group(e)},addGroupQuick:function(e){e.preventDefault();var t=$(e.currentTarget).data("config"),n=new CAE.Models.Group;for(var i in n.set(t.options),this.collection.add(n),t.modules)if(this.conditionsById.hasOwnProperty(t.modules[i])){var o=this.conditionsById[t.modules[i]],s=new CAE.Models.Condition({module:o.id,label:o.text,placeholder:o.placeholder,default_value:o.default_value});n.conditions.add(s)}}}),$.fn.select2.amd.require(["select2/selection/search"],function(e){e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(""),this.handleSearch()}},null,!0),$.fn.select2.amd.require(["select2/results"],function(e){e.prototype.ensureHighlightVisible=function(){this.$results.resize()}},null,!0),$.fn.select2.amd.define("select2/data/wpcaAdapter",["select2/data/array","select2/utils"],function(e,t){function n(e,t){n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype.query=function(n,i){n.term=n.term||"";var o=this.options.options,s=o.cachedResults[n.term],a=n.page||1;if(s&&s.page>=a){if(!(1<a))return void i({results:s.items,pagination:{more:s.more}});a=s.page}clearTimeout(o.searchTimer),o.searchTimer=setTimeout(function(){$.ajax({url:ajaxurl,data:{search:n.term,paged:a,action:"wpca/module/"+o.type,sidebar_id:l.sidebarID,nonce:l.nonce},dataType:"JSON",type:"POST",success:function(e){var t=!(e.length<20);o.cachedResults[n.term]={page:a,more:t,items:s?o.cachedResults[n.term].items.concat(e):e},i({results:e,pagination:{more:t}})}})},o.quietMillis)},n});var i={treshold:2e3,timerQueue:{},start:function(e){this.clear(e);var t=this;this.timerQueue[e.cid]=window.setTimeout(function(){t.set(e)},this.treshold)},set:function(e){e.saveGroup()},clear:function(e){e&&this.timerQueue[e.cid]&&window.clearInterval(this.timerQueue[e.cid])}},l={nonce:$("#_ca_nonce").val(),sidebarID:$("#post_ID").val(),alert:null,wpcaDataAdapter:$.fn.select2.amd.require("select2/data/wpcaAdapter"),init:function(){this.alert=new CAE.Views.Alert({model:new CAE.Models.Alert}),CAE.conditionGroups=new CAE.Views.GroupCollection({collection:new CAE.Models.GroupCollection(WPCA.groups,{parse:!0})})}};$(document).ready(function(){l.init()})}(jQuery,CAE);
lib/wp-content-aware-engine/bootstrap.php CHANGED
@@ -12,7 +12,7 @@ defined('ABSPATH') || exit;
12
  * Version of this WPCA
13
  * @var string
14
  */
15
- $this_wpca_version = '8.1';
16
 
17
  /**
18
  * Class to make sure the latest
12
  * Version of this WPCA
13
  * @var string
14
  */
15
+ $this_wpca_version = '8.1.1';
16
 
17
  /**
18
  * Class to make sure the latest
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: custom sidebars, sidebar, hide sidebar, display widgets, widget, bbpress,
5
  Requires at least: 4.7
6
  Requires PHP: 5.6
7
  Tested up to: 5.3
8
- Stable tag: 3.11
9
  License: GPLv3
10
 
11
  Display custom sidebars and widgets on any post, page, category etc. Supports bbPress, BuddyPress, WooCommerce, WPML, and more.
@@ -168,6 +168,10 @@ Of course! Check out the links below:
168
 
169
  ####Highlights
170
 
 
 
 
 
171
  = 3.11 =
172
 
173
  * Added: condition type cache for improved performance
5
  Requires at least: 4.7
6
  Requires PHP: 5.6
7
  Tested up to: 5.3
8
+ Stable tag: 3.11.1
9
  License: GPLv3
10
 
11
  Display custom sidebars and widgets on any post, page, category etc. Supports bbPress, BuddyPress, WooCommerce, WPML, and more.
168
 
169
  ####Highlights
170
 
171
+ = 3.11.1 =
172
+
173
+ * Fixed: conditions would not always be auto-saved
174
+
175
  = 3.11 =
176
 
177
  * Added: condition type cache for improved performance